Merge branch 'master' into XACE-SELINUX
Conflicts: dix/dixutils.c
This commit is contained in:
commit
e2a720c9a1
|
@ -886,8 +886,32 @@ getDrawableInfo(__DRInativeDisplay *dpy, int screen,
|
|||
if (*numClipRects > 0) {
|
||||
size = sizeof (drm_clip_rect_t) * *numClipRects;
|
||||
*ppClipRects = xalloc (size);
|
||||
if (*ppClipRects != NULL)
|
||||
memcpy (*ppClipRects, pClipRects, size);
|
||||
|
||||
/* Clip cliprects to screen dimensions (redirected windows) */
|
||||
if (*ppClipRects != NULL) {
|
||||
ScreenPtr pScreen = screenInfo.screens[screen];
|
||||
int i, j;
|
||||
|
||||
for (i = 0, j = 0; i < *numClipRects; i++) {
|
||||
(*ppClipRects)[j].x1 = max(pClipRects[i].x1, 0);
|
||||
(*ppClipRects)[j].y1 = max(pClipRects[i].y1, 0);
|
||||
(*ppClipRects)[j].x2 = min(pClipRects[i].x2, pScreen->width);
|
||||
(*ppClipRects)[j].y2 = min(pClipRects[i].y2, pScreen->height);
|
||||
|
||||
if ((*ppClipRects)[j].x1 < (*ppClipRects)[j].x2 &&
|
||||
(*ppClipRects)[j].y1 < (*ppClipRects)[j].y2) {
|
||||
j++;
|
||||
}
|
||||
}
|
||||
|
||||
if (*numClipRects != j) {
|
||||
*numClipRects = j;
|
||||
*ppClipRects = xrealloc (*ppClipRects,
|
||||
sizeof (drm_clip_rect_t) *
|
||||
*numClipRects);
|
||||
}
|
||||
} else
|
||||
*numClipRects = 0;
|
||||
}
|
||||
else {
|
||||
*ppClipRects = NULL;
|
||||
|
@ -1001,13 +1025,10 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
|
|||
size_t buffer_size;
|
||||
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
|
||||
|
||||
if (!xf86LoaderCheckSymbol("DRIQueryDirectRenderingCapable")) {
|
||||
LogMessage(X_ERROR, "AIGLX: DRI module not loaded\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!DRIQueryDirectRenderingCapable(pScreen, &isCapable) || !isCapable) {
|
||||
LogMessage(X_ERROR,
|
||||
if (!xf86LoaderCheckSymbol("DRIQueryDirectRenderingCapable") ||
|
||||
!DRIQueryDirectRenderingCapable(pScreen, &isCapable) ||
|
||||
!isCapable) {
|
||||
LogMessage(X_INFO,
|
||||
"AIGLX: Screen %d is not DRI capable\n", pScreen->myNum);
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
@ -34,7 +34,6 @@ MODULE_SRCS = \
|
|||
xcmisc.c
|
||||
|
||||
# Extra configuration files ship with some extensions
|
||||
SERVERCONFIGdir = $(libdir)/xserver
|
||||
SERVERCONFIG_DATA =
|
||||
|
||||
# Optional sources included if extension enabled by configure.ac rules
|
||||
|
|
|
@ -696,11 +696,13 @@ CompositeExtensionInit (void)
|
|||
if (GetPictureScreenIfSet(pScreen) == NULL)
|
||||
return;
|
||||
}
|
||||
#ifdef PANORAMIX
|
||||
/* Xinerama's rewriting of window drawing before Composite gets to it
|
||||
* breaks Composite.
|
||||
*/
|
||||
if (!noPanoramiXExtension)
|
||||
return;
|
||||
#endif
|
||||
|
||||
CompositeClientWindowType = CreateNewResourceType (FreeCompositeClientWindow);
|
||||
if (!CompositeClientWindowType)
|
||||
|
|
30
configure.ac
30
configure.ac
|
@ -123,19 +123,19 @@ b = __swap16(a);
|
|||
], [SYS_ENDIAN__SWAP='yes'], [SYS_ENDIAN__SWAP='no'])
|
||||
AC_MSG_RESULT([$SYS_ENDIAN__SWAP])
|
||||
|
||||
AC_MSG_CHECKING([for bswap_16 variant of <sys/endian.h> byteswapping macros])
|
||||
AC_MSG_CHECKING([for bswap16 variant of <sys/endian.h> byteswapping macros])
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([
|
||||
#include <sys/endian.h>
|
||||
], [
|
||||
int a = 1, b;
|
||||
b = bswap_16(a);
|
||||
b = bswap16(a);
|
||||
])
|
||||
], [SYS_ENDIAN_BSWAP='yes'], [SYS_ENDIAN_BSWAP='no'])
|
||||
AC_MSG_RESULT([$SYS_ENDIAN_BSWAP])
|
||||
|
||||
if test "$SYS_ENDIAN_BSWAP" = "yes" ; then
|
||||
USE_SYS_ENDIAN_H=yes
|
||||
BSWAP=bswap_
|
||||
BSWAP=bswap
|
||||
else
|
||||
if test "$SYS_ENDIAN__SWAP" = "yes" ; then
|
||||
USE_SYS_ENDIAN_H=yes
|
||||
|
@ -165,20 +165,20 @@ AC_CHECK_FUNCS([geteuid getuid link memmove memset mkstemp strchr strrchr \
|
|||
AC_FUNC_ALLOCA
|
||||
dnl Old HAS_* names used in os/*.c.
|
||||
AC_CHECK_FUNC([getdtablesize],
|
||||
AC_DEFINE(HAS_GETDTABLESIZE, 1, [Have the `getdtablesize' function.]))
|
||||
AC_DEFINE(HAS_GETDTABLESIZE, 1, [Have the 'getdtablesize' function.]))
|
||||
AC_CHECK_FUNC([getifaddrs],
|
||||
AC_DEFINE(HAS_GETIFADDRS, 1, [Have the `getifaddrs' function.]))
|
||||
AC_DEFINE(HAS_GETIFADDRS, 1, [Have the 'getifaddrs' function.]))
|
||||
AC_CHECK_FUNC([getpeereid],
|
||||
AC_DEFINE(HAS_GETPEEREID, 1, [Have the `getpeereid' function.]))
|
||||
AC_DEFINE(HAS_GETPEEREID, 1, [Have the 'getpeereid' function.]))
|
||||
AC_CHECK_FUNC([getpeerucred],
|
||||
AC_DEFINE(HAS_GETPEERUCRED, 1, [Have the `getpeerucred' function.]))
|
||||
AC_DEFINE(HAS_GETPEERUCRED, 1, [Have the 'getpeerucred' function.]))
|
||||
AC_CHECK_FUNC([strlcat], HAVE_STRLCAT=yes, HAVE_STRLCAT=no)
|
||||
AM_CONDITIONAL(NEED_STRLCAT, [test x$HAVE_STRLCAT = xno])
|
||||
|
||||
AM_CONDITIONAL(NEED_VSNPRINTF, [test x$HAVE_VSNPRINTF = xno])
|
||||
|
||||
dnl Check for mmap support for Xvfb
|
||||
AC_CHECK_FUNC([mmap], AC_DEFINE(HAS_MMAP, 1, [Have the `mmap' function.]))
|
||||
AC_CHECK_FUNC([mmap], AC_DEFINE(HAS_MMAP, 1, [Have the 'mmap' function.]))
|
||||
|
||||
dnl Find the math libary
|
||||
AC_CHECK_LIB(m, sqrt)
|
||||
|
@ -465,6 +465,9 @@ AC_ARG_WITH(xkb-output, AS_HELP_STRING([--with-xkb-output=PATH], [Path to
|
|||
AC_ARG_WITH(rgb-path, AS_HELP_STRING([--with-rgb-path=PATH], [Path to RGB database (default: ${datadir}/X11/rgb)]),
|
||||
[ RGBPATH="$withval" ],
|
||||
[ RGBPATH="${datadir}/X11/rgb" ])
|
||||
AC_ARG_WITH(serverconfig-path, AS_HELP_STRING([--with-serverconfig-path=PATH], [Path to server config (default: ${libdir}/xserver)]),
|
||||
[ SERVERCONFIG="$withval" ],
|
||||
[ SERVERCONFIG="${libdir}/xserver" ])
|
||||
APPLE_APPLICATIONS_DIR="${bindir}/Applications"
|
||||
AC_ARG_WITH(apple-applications-dir,AS_HELP_STRING([--with-apple-applications-dir=PATH], [Path to the Applications directory (default: ${bindir}/Applications)]),
|
||||
[ APPLE_APPLICATIONS_DIR="${withval}" ].
|
||||
|
@ -624,10 +627,10 @@ XEXT_INC='-I$(top_srcdir)/Xext'
|
|||
XEXT_LIB='$(top_builddir)/Xext/libXext.la'
|
||||
XEXTXORG_LIB='$(top_builddir)/Xext/libXextbuiltin.la'
|
||||
|
||||
PIXMAN="[pixman >= 0.9.0]"
|
||||
PIXMAN="[pixman >= 0.9.1]"
|
||||
|
||||
dnl Core modules for most extensions, et al.
|
||||
REQUIRED_MODULES="[randrproto >= 1.2] renderproto [fixesproto >= 4.0] [damageproto >= 1.1] xcmiscproto xextproto xproto xtrans [scrnsaverproto >= 1.1] bigreqsproto resourceproto fontsproto [inputproto >= 1.4.2] [kbproto >= 1.0.3]"
|
||||
REQUIRED_MODULES="[randrproto >= 1.2] renderproto [fixesproto >= 4.0] [damageproto >= 1.1] xcmiscproto xextproto [xproto >= 7.0.9] xtrans [scrnsaverproto >= 1.1] bigreqsproto resourceproto fontsproto [inputproto >= 1.4.2] [kbproto >= 1.0.3]"
|
||||
REQUIRED_LIBS="xfont xau fontenc $PIXMAN"
|
||||
|
||||
if test "x$DBUS" = xauto; then
|
||||
|
@ -889,7 +892,7 @@ XKB_LIB='$(top_builddir)/xkb/libxkb.la'
|
|||
XKB_STUB_LIB='$(top_builddir)/xkb/libxkbstubs.la'
|
||||
|
||||
AC_CHECK_FUNC(strcasecmp, [], AC_DEFINE([NEED_STRCASECMP], 1,
|
||||
[Do not have `strcasecmp'.]))
|
||||
[Do not have 'strcasecmp'.]))
|
||||
|
||||
if test "x$NULL_ROOT_CURSOR" = xyes; then
|
||||
AC_DEFINE(NULL_ROOT_CURSOR, 1, [Use an empty root cursor])
|
||||
|
@ -952,6 +955,7 @@ VENDOR_MAN_VERSION="Version ${VENDOR_VERSION_STRING}"
|
|||
|
||||
AC_DEFINE_DIR(COMPILEDDEFAULTFONTPATH, FONTPATH, [Default font path])
|
||||
AC_DEFINE_DIR(RGB_DB, RGBPATH, [Default RGB path])
|
||||
AC_DEFINE_DIR(SERVERCONFIGdir, SERVERCONFIG, [Server config path])
|
||||
AC_DEFINE_DIR(BASE_FONT_PATH, FONTDIR, [Default base font path])
|
||||
AC_DEFINE_DIR(DRI_DRIVER_PATH, DRI_DRIVER_PATH, [Default DRI driver path])
|
||||
AC_DEFINE_UNQUOTED(XVENDORNAME, ["$VENDOR_STRING"], [Vendor name])
|
||||
|
@ -1610,7 +1614,7 @@ AC_MSG_CHECKING([whether to build Xprint DDX])
|
|||
AC_MSG_RESULT([$XPRINT])
|
||||
|
||||
if test "x$XPRINT" = xyes; then
|
||||
PKG_CHECK_MODULES([XPRINT], [printproto x11 xfont $XDMCP_MODULES xau])
|
||||
PKG_CHECK_MODULES([XPRINT], [printproto x11 xfont $XDMCP_MODULES xau $PIXMAN])
|
||||
XPRINT_EXTENSIONS="$XEXT_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $RENDER_LIB $COMPOSITE_LIB $RANDR_LIB $XI_LIB $FIXES_LIB $DAMAGE_LIB $XI_LIB $GLX_LIBS"
|
||||
XPRINT_LIBS="$DIX_LIB $CONFIG_LIB $XKB_LIB $XKB_STUB_LIB $XPRINT_EXTENSIONS $MI_LIB $MIEXT_DAMAGE_LIB $CWRAP_LIB $OS_LIB $LIBS $XPRINT_LIBS"
|
||||
AC_SUBST([XPRINT_CFLAGS])
|
||||
|
@ -1958,6 +1962,8 @@ AM_CONDITIONAL(SUN_KBD_MODE, [test x$KBD_MODE_TYPE = xsun])
|
|||
|
||||
BUILD_DATE="$(date +'%Y%m%d')"
|
||||
AC_SUBST([BUILD_DATE])
|
||||
BUILD_TIME="$(date +'1%H%M%S')"
|
||||
AC_SUBST([BUILD_TIME])
|
||||
|
||||
DIX_CFLAGS="-DHAVE_DIX_CONFIG_H $XSERVER_CFLAGS"
|
||||
|
||||
|
|
|
@ -432,6 +432,7 @@ InitAndStartDevices(void)
|
|||
for (dev = inputInfo.devices;
|
||||
dev && (dev != inputInfo.keyboard);
|
||||
dev = dev->next)
|
||||
;
|
||||
if (!dev || (dev != inputInfo.keyboard)) {
|
||||
ErrorF("No core keyboard\n");
|
||||
return BadImplementation;
|
||||
|
@ -908,6 +909,7 @@ InitAbsoluteClassDeviceStruct(DeviceIntPtr dev)
|
|||
abs->width = -1;
|
||||
abs->height = -1;
|
||||
abs->following = 0;
|
||||
abs->screen = 0;
|
||||
|
||||
dev->absolute = abs;
|
||||
|
||||
|
|
|
@ -997,10 +997,6 @@ ProcGetAtomName(ClientPtr client)
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef K5AUTH
|
||||
extern int k5_bad();
|
||||
#endif
|
||||
|
||||
int
|
||||
ProcSetSelectionOwner(ClientPtr client)
|
||||
{
|
||||
|
@ -3548,12 +3544,6 @@ InitProcVectors(void)
|
|||
ProcVector[i] = SwappedProcVector[i] = ProcBadRequest;
|
||||
ReplySwapVector[i] = ReplyNotSwappd;
|
||||
}
|
||||
#ifdef K5AUTH
|
||||
if (!k5_Vector[i])
|
||||
{
|
||||
k5_Vector[i] = k5_bad;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
for(i = LASTEvent; i < 128; i++)
|
||||
{
|
||||
|
|
|
@ -271,7 +271,7 @@ dixLookupClient(ClientPtr *pClient, XID rid, ClientPtr client, Mask access)
|
|||
int clientIndex = CLIENT_ID(rid);
|
||||
client->errorValue = rid;
|
||||
|
||||
dixLookupResource(&pRes, rid, RC_ANY, client, DixReadAccess);
|
||||
dixLookupResource(&pRes, rid, RC_ANY, client, access);
|
||||
|
||||
if (clientIndex && pRes && clients[clientIndex] && !(rid & SERVER_BIT)) {
|
||||
*pClient = clients[clientIndex];
|
||||
|
|
|
@ -695,6 +695,13 @@ XineramaChangeToCursor(CursorPtr cursor)
|
|||
}
|
||||
}
|
||||
|
||||
#else
|
||||
#define SyntheticMotion(x, y) \
|
||||
PostSyntheticMotion(x, y, \
|
||||
0, \
|
||||
syncEvents.playingEvents ? \
|
||||
syncEvents.time.milliseconds : \
|
||||
currentTime.milliseconds);
|
||||
|
||||
#endif /* PANORAMIX */
|
||||
|
||||
|
|
15
dix/tables.c
15
dix/tables.c
|
@ -61,11 +61,6 @@ SOFTWARE.
|
|||
#include "swaprep.h"
|
||||
#include "swapreq.h"
|
||||
|
||||
#ifdef K5AUTH
|
||||
extern int
|
||||
k5_stage1(), k5_stage2(), k5_stage3(), k5_bad();
|
||||
#endif
|
||||
|
||||
int (* InitialVector[3]) (
|
||||
ClientPtr /* client */
|
||||
) =
|
||||
|
@ -515,13 +510,3 @@ _X_EXPORT ReplySwapPtr ReplySwapVector[256] =
|
|||
ReplyNotSwappd, /* NoOperation */
|
||||
ReplyNotSwappd
|
||||
};
|
||||
|
||||
#ifdef K5AUTH
|
||||
int (*k5_Vector[256])() =
|
||||
{
|
||||
k5_bad,
|
||||
k5_stage1,
|
||||
k5_bad,
|
||||
k5_stage3
|
||||
};
|
||||
#endif
|
||||
|
|
|
@ -69,9 +69,7 @@ libfb_la_SOURCES = \
|
|||
fbutil.c \
|
||||
fbwindow.c \
|
||||
fbpseudocolor.c \
|
||||
fbpseudocolor.h \
|
||||
fbedge.c \
|
||||
fbedgeimp.h
|
||||
fbpseudocolor.h
|
||||
|
||||
libwfb_la_SOURCES = $(libfb_la_SOURCES)
|
||||
|
||||
|
|
6
fb/fb.h
6
fb/fb.h
|
@ -26,6 +26,8 @@
|
|||
#define _FB_H_
|
||||
|
||||
#include <X11/X.h>
|
||||
#include <pixman/pixman.h>
|
||||
|
||||
#include "scrnintstr.h"
|
||||
#include "pixmap.h"
|
||||
#include "pixmapstr.h"
|
||||
|
@ -2147,4 +2149,8 @@ void
|
|||
fbPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what);
|
||||
|
||||
|
||||
pixman_image_t *image_from_pict (PicturePtr pict,
|
||||
Bool has_clip);
|
||||
|
||||
#endif /* _FB_H_ */
|
||||
|
||||
|
|
24
fb/fbcopy.c
24
fb/fbcopy.c
|
@ -60,21 +60,17 @@ fbCopyNtoN (DrawablePtr pSrcDrawable,
|
|||
|
||||
while (nbox--)
|
||||
{
|
||||
#ifdef USE_MMX
|
||||
#ifndef FB_ACCESS_WRAPPER /* pixman_blt() doesn't support accessors yet */
|
||||
if (pm == FB_ALLONES && alu == GXcopy && !reverse &&
|
||||
!upsidedown && fbHaveMMX())
|
||||
!upsidedown)
|
||||
{
|
||||
if (!fbCopyAreammx (pSrcDrawable,
|
||||
pDstDrawable,
|
||||
|
||||
(pbox->x1 + dx),
|
||||
(pbox->y1 + dy),
|
||||
|
||||
(pbox->x1),
|
||||
(pbox->y1),
|
||||
|
||||
(pbox->x2 - pbox->x1),
|
||||
(pbox->y2 - pbox->y1)))
|
||||
if (!pixman_blt ((uint32_t *)src, (uint32_t *)dst, srcStride, dstStride, srcBpp, dstBpp,
|
||||
(pbox->x1 + dx + srcXoff),
|
||||
(pbox->y1 + dy + srcYoff),
|
||||
(pbox->x1 + srcXoff),
|
||||
(pbox->y1 + srcYoff),
|
||||
(pbox->x2 - pbox->x1),
|
||||
(pbox->y2 - pbox->y1)))
|
||||
goto fallback;
|
||||
else
|
||||
goto next;
|
||||
|
@ -98,7 +94,7 @@ fbCopyNtoN (DrawablePtr pSrcDrawable,
|
|||
|
||||
reverse,
|
||||
upsidedown);
|
||||
#ifdef USE_MMX
|
||||
#ifndef FB_ACCESS_WRAPPER
|
||||
next:
|
||||
#endif
|
||||
pbox++;
|
||||
|
|
314
fb/fbedge.c
314
fb/fbedge.c
|
@ -1,314 +0,0 @@
|
|||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Copyright © 2004 Keith Packard
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and its
|
||||
* documentation for any purpose is hereby granted without fee, provided that
|
||||
* the above copyright notice appear in all copies and that both that
|
||||
* copyright notice and this permission notice appear in supporting
|
||||
* documentation, and that the name of Keith Packard not be used in
|
||||
* advertising or publicity pertaining to distribution of the software without
|
||||
* specific, written prior permission. Keith Packard makes no
|
||||
* representations about the suitability of this software for any purpose. It
|
||||
* is provided "as is" without express or implied warranty.
|
||||
*
|
||||
* KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
||||
* EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
||||
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include "fb.h"
|
||||
|
||||
#ifdef RENDER
|
||||
|
||||
#include "picturestr.h"
|
||||
#include "mipict.h"
|
||||
#include "renderedge.h"
|
||||
#include "fbpict.h"
|
||||
|
||||
/*
|
||||
* 4 bit alpha
|
||||
*/
|
||||
|
||||
#define N_BITS 4
|
||||
#define rasterizeEdges fbRasterizeEdges4
|
||||
|
||||
#if BITMAP_BIT_ORDER == LSBFirst
|
||||
#define Shift4(o) ((o) << 2)
|
||||
#else
|
||||
#define Shift4(o) ((1-(o)) << 2)
|
||||
#endif
|
||||
|
||||
#define Get4(x,o) (((x) >> Shift4(o)) & 0xf)
|
||||
#define Put4(x,o,v) (((x) & ~(0xf << Shift4(o))) | (((v) & 0xf) << Shift4(o)))
|
||||
|
||||
#define DefineAlpha(line,x) \
|
||||
CARD8 *__ap = (CARD8 *) line + ((x) >> 1); \
|
||||
int __ao = (x) & 1
|
||||
|
||||
#define StepAlpha ((__ap += __ao), (__ao ^= 1))
|
||||
|
||||
#define AddAlpha(a) { \
|
||||
CARD8 __o = READ(__ap); \
|
||||
CARD8 __a = (a) + Get4(__o, __ao); \
|
||||
WRITE(__ap, Put4 (__o, __ao, __a | (0 - ((__a) >> 4)))); \
|
||||
}
|
||||
|
||||
#include "fbedgeimp.h"
|
||||
|
||||
#undef AddAlpha
|
||||
#undef StepAlpha
|
||||
#undef DefineAlpha
|
||||
#undef rasterizeEdges
|
||||
#undef N_BITS
|
||||
|
||||
|
||||
/*
|
||||
* 1 bit alpha
|
||||
*/
|
||||
|
||||
#define N_BITS 1
|
||||
#define rasterizeEdges fbRasterizeEdges1
|
||||
|
||||
#include "fbedgeimp.h"
|
||||
|
||||
#undef rasterizeEdges
|
||||
#undef N_BITS
|
||||
|
||||
/*
|
||||
* 8 bit alpha
|
||||
*/
|
||||
|
||||
static INLINE CARD8
|
||||
clip255 (int x)
|
||||
{
|
||||
if (x > 255) return 255;
|
||||
return x;
|
||||
}
|
||||
|
||||
static INLINE void
|
||||
add_saturate_8 (CARD8 *buf, int value, int length)
|
||||
{
|
||||
while (length--)
|
||||
{
|
||||
WRITE(buf, clip255 (READ(buf) + value));
|
||||
buf++;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* We want to detect the case where we add the same value to a long
|
||||
* span of pixels. The triangles on the end are filled in while we
|
||||
* count how many sub-pixel scanlines contribute to the middle section.
|
||||
*
|
||||
* +--------------------------+
|
||||
* fill_height =| \ /
|
||||
* +------------------+
|
||||
* |================|
|
||||
* fill_start fill_end
|
||||
*/
|
||||
static void
|
||||
fbRasterizeEdges8 (FbBits *buf,
|
||||
int width,
|
||||
int stride,
|
||||
RenderEdge *l,
|
||||
RenderEdge *r,
|
||||
xFixed t,
|
||||
xFixed b)
|
||||
{
|
||||
xFixed y = t;
|
||||
FbBits *line;
|
||||
int fill_start = -1, fill_end = -1;
|
||||
int fill_size = 0;
|
||||
|
||||
line = buf + xFixedToInt (y) * stride;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
CARD8 *ap = (CARD8 *) line;
|
||||
xFixed lx, rx;
|
||||
int lxi, rxi;
|
||||
|
||||
/* clip X */
|
||||
lx = l->x;
|
||||
if (lx < 0)
|
||||
lx = 0;
|
||||
rx = r->x;
|
||||
if (xFixedToInt (rx) >= width)
|
||||
rx = IntToxFixed (width);
|
||||
|
||||
/* Skip empty (or backwards) sections */
|
||||
if (rx > lx)
|
||||
{
|
||||
int lxs, rxs;
|
||||
|
||||
/* Find pixel bounds for span. */
|
||||
lxi = xFixedToInt (lx);
|
||||
rxi = xFixedToInt (rx);
|
||||
|
||||
/* Sample coverage for edge pixels */
|
||||
lxs = RenderSamplesX (lx, 8);
|
||||
rxs = RenderSamplesX (rx, 8);
|
||||
|
||||
/* Add coverage across row */
|
||||
if (lxi == rxi)
|
||||
{
|
||||
WRITE(ap +lxi, clip255 (READ(ap + lxi) + rxs - lxs));
|
||||
}
|
||||
else
|
||||
{
|
||||
WRITE(ap + lxi, clip255 (READ(ap + lxi) + N_X_FRAC(8) - lxs));
|
||||
|
||||
/* Move forward so that lxi/rxi is the pixel span */
|
||||
lxi++;
|
||||
|
||||
/* Don't bother trying to optimize the fill unless
|
||||
* the span is longer than 4 pixels. */
|
||||
if (rxi - lxi > 4)
|
||||
{
|
||||
if (fill_start < 0)
|
||||
{
|
||||
fill_start = lxi;
|
||||
fill_end = rxi;
|
||||
fill_size++;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (lxi >= fill_end || rxi < fill_start)
|
||||
{
|
||||
/* We're beyond what we saved, just fill it */
|
||||
add_saturate_8 (ap + fill_start,
|
||||
fill_size * N_X_FRAC(8),
|
||||
fill_end - fill_start);
|
||||
fill_start = lxi;
|
||||
fill_end = rxi;
|
||||
fill_size = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Update fill_start */
|
||||
if (lxi > fill_start)
|
||||
{
|
||||
add_saturate_8 (ap + fill_start,
|
||||
fill_size * N_X_FRAC(8),
|
||||
lxi - fill_start);
|
||||
fill_start = lxi;
|
||||
}
|
||||
else if (lxi < fill_start)
|
||||
{
|
||||
add_saturate_8 (ap + lxi, N_X_FRAC(8),
|
||||
fill_start - lxi);
|
||||
}
|
||||
|
||||
/* Update fill_end */
|
||||
if (rxi < fill_end)
|
||||
{
|
||||
add_saturate_8 (ap + rxi,
|
||||
fill_size * N_X_FRAC(8),
|
||||
fill_end - rxi);
|
||||
fill_end = rxi;
|
||||
}
|
||||
else if (fill_end < rxi)
|
||||
{
|
||||
add_saturate_8 (ap + fill_end,
|
||||
N_X_FRAC(8),
|
||||
rxi - fill_end);
|
||||
}
|
||||
fill_size++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
add_saturate_8 (ap + lxi, N_X_FRAC(8), rxi - lxi);
|
||||
}
|
||||
|
||||
/* Do not add in a 0 alpha here. This check is
|
||||
* necessary to avoid a buffer overrun, (when rx
|
||||
* is exactly on a pixel boundary). */
|
||||
if (rxs)
|
||||
WRITE(ap + rxi, clip255 (READ(ap + rxi) + rxs));
|
||||
}
|
||||
}
|
||||
|
||||
if (y == b) {
|
||||
/* We're done, make sure we clean up any remaining fill. */
|
||||
if (fill_start != fill_end) {
|
||||
if (fill_size == N_Y_FRAC(8))
|
||||
{
|
||||
MEMSET_WRAPPED (ap + fill_start, 0xff, fill_end - fill_start);
|
||||
}
|
||||
else
|
||||
{
|
||||
add_saturate_8 (ap + fill_start, fill_size * N_X_FRAC(8),
|
||||
fill_end - fill_start);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (xFixedFrac (y) != Y_FRAC_LAST(8))
|
||||
{
|
||||
RenderEdgeStepSmall (l);
|
||||
RenderEdgeStepSmall (r);
|
||||
y += STEP_Y_SMALL(8);
|
||||
}
|
||||
else
|
||||
{
|
||||
RenderEdgeStepBig (l);
|
||||
RenderEdgeStepBig (r);
|
||||
y += STEP_Y_BIG(8);
|
||||
if (fill_start != fill_end)
|
||||
{
|
||||
if (fill_size == N_Y_FRAC(8))
|
||||
{
|
||||
MEMSET_WRAPPED (ap + fill_start, 0xff, fill_end - fill_start);
|
||||
}
|
||||
else
|
||||
{
|
||||
add_saturate_8 (ap + fill_start, fill_size * N_X_FRAC(8),
|
||||
fill_end - fill_start);
|
||||
}
|
||||
fill_start = fill_end = -1;
|
||||
fill_size = 0;
|
||||
}
|
||||
line += stride;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
fbRasterizeEdges (FbBits *buf,
|
||||
int bpp,
|
||||
int width,
|
||||
int stride,
|
||||
RenderEdge *l,
|
||||
RenderEdge *r,
|
||||
xFixed t,
|
||||
xFixed b)
|
||||
{
|
||||
switch (bpp) {
|
||||
case 1:
|
||||
fbRasterizeEdges1 (buf, width, stride, l, r, t, b);
|
||||
break;
|
||||
case 4:
|
||||
fbRasterizeEdges4 (buf, width, stride, l, r, t, b);
|
||||
break;
|
||||
case 8:
|
||||
fbRasterizeEdges8 (buf, width, stride, l, r, t, b);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* RENDER */
|
145
fb/fbedgeimp.h
145
fb/fbedgeimp.h
|
@ -1,145 +0,0 @@
|
|||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Copyright © 2004 Keith Packard
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and its
|
||||
* documentation for any purpose is hereby granted without fee, provided that
|
||||
* the above copyright notice appear in all copies and that both that
|
||||
* copyright notice and this permission notice appear in supporting
|
||||
* documentation, and that the name of Keith Packard not be used in
|
||||
* advertising or publicity pertaining to distribution of the software without
|
||||
* specific, written prior permission. Keith Packard makes no
|
||||
* representations about the suitability of this software for any purpose. It
|
||||
* is provided "as is" without express or implied warranty.
|
||||
*
|
||||
* KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
||||
* EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
||||
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#ifndef rasterizeSpan
|
||||
#endif
|
||||
|
||||
static void
|
||||
rasterizeEdges (FbBits *buf,
|
||||
int width,
|
||||
int stride,
|
||||
RenderEdge *l,
|
||||
RenderEdge *r,
|
||||
xFixed t,
|
||||
xFixed b)
|
||||
{
|
||||
xFixed y = t;
|
||||
FbBits *line;
|
||||
|
||||
line = buf + xFixedToInt (y) * stride;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
xFixed lx, rx;
|
||||
int lxi, rxi;
|
||||
|
||||
/* clip X */
|
||||
lx = l->x;
|
||||
if (lx < 0)
|
||||
lx = 0;
|
||||
rx = r->x;
|
||||
if (xFixedToInt (rx) >= width)
|
||||
rx = IntToxFixed (width);
|
||||
|
||||
/* Skip empty (or backwards) sections */
|
||||
if (rx > lx)
|
||||
{
|
||||
|
||||
/* Find pixel bounds for span */
|
||||
lxi = xFixedToInt (lx);
|
||||
rxi = xFixedToInt (rx);
|
||||
|
||||
#if N_BITS == 1
|
||||
{
|
||||
FbBits *a = line;
|
||||
FbBits startmask, endmask;
|
||||
int nmiddle;
|
||||
int width = rxi - lxi;
|
||||
int x = lxi;
|
||||
|
||||
a += x >> FB_SHIFT;
|
||||
x &= FB_MASK;
|
||||
|
||||
FbMaskBits (x, width, startmask, nmiddle, endmask);
|
||||
if (startmask) {
|
||||
WRITE(a, READ(a) | startmask);
|
||||
a++;
|
||||
}
|
||||
while (nmiddle--)
|
||||
WRITE(a++, FB_ALLONES);
|
||||
if (endmask)
|
||||
WRITE(a, READ(a) | endmask);
|
||||
}
|
||||
#else
|
||||
{
|
||||
DefineAlpha(line,lxi);
|
||||
int lxs, rxs;
|
||||
|
||||
/* Sample coverage for edge pixels */
|
||||
lxs = RenderSamplesX (lx, N_BITS);
|
||||
rxs = RenderSamplesX (rx, N_BITS);
|
||||
|
||||
/* Add coverage across row */
|
||||
if (lxi == rxi)
|
||||
{
|
||||
AddAlpha (rxs - lxs);
|
||||
}
|
||||
else
|
||||
{
|
||||
int xi;
|
||||
|
||||
AddAlpha (N_X_FRAC(N_BITS) - lxs);
|
||||
StepAlpha;
|
||||
for (xi = lxi + 1; xi < rxi; xi++)
|
||||
{
|
||||
AddAlpha (N_X_FRAC(N_BITS));
|
||||
StepAlpha;
|
||||
}
|
||||
/* Do not add in a 0 alpha here. This check is necessary
|
||||
* to avoid a buffer overrun when rx is exactly on a pixel
|
||||
* boundary.
|
||||
*/
|
||||
if (rxs != 0)
|
||||
AddAlpha (rxs);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
if (y == b)
|
||||
break;
|
||||
|
||||
#if N_BITS > 1
|
||||
if (xFixedFrac (y) != Y_FRAC_LAST(N_BITS))
|
||||
{
|
||||
RenderEdgeStepSmall (l);
|
||||
RenderEdgeStepSmall (r);
|
||||
y += STEP_Y_SMALL(N_BITS);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
RenderEdgeStepBig (l);
|
||||
RenderEdgeStepBig (r);
|
||||
y += STEP_Y_BIG(N_BITS);
|
||||
line += stride;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#undef rasterizeSpan
|
19
fb/fbfill.c
19
fb/fbfill.c
|
@ -49,10 +49,13 @@ fbFill (DrawablePtr pDrawable,
|
|||
case FillSolid:
|
||||
#ifdef USE_MMX
|
||||
if (!pPriv->and && fbHaveMMX())
|
||||
if (fbSolidFillmmx (pDrawable, x, y, width, height, pPriv->xor)) {
|
||||
{
|
||||
if (fbFillmmx (dst, dstStride, dstBpp, x + dstXoff, y + dstYoff, width, height, pPriv->xor))
|
||||
{
|
||||
fbFinishAccess (pDrawable);
|
||||
return;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
fbSolid (dst + (y + dstYoff) * dstStride,
|
||||
dstStride,
|
||||
|
@ -218,13 +221,13 @@ fbSolidBoxClipped (DrawablePtr pDrawable,
|
|||
#ifdef USE_MMX
|
||||
if (!and && fbHaveMMX())
|
||||
{
|
||||
if (fbSolidFillmmx (pDrawable,
|
||||
partX1, partY1,
|
||||
(partX2 - partX1), (partY2 - partY1),
|
||||
xor)) {
|
||||
fbFinishAccess (pDrawable);
|
||||
return;
|
||||
}
|
||||
if (fbFillmmx (dst, dstStride, dstBpp,
|
||||
partX1 + dstXoff, partX2 + dstYoff, (partX2 - partX1), (partY2 - partY1),
|
||||
xor))
|
||||
{
|
||||
fbFinishAccess (pDrawable);
|
||||
return;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
fbSolid (dst + (partY1 + dstYoff) * dstStride,
|
||||
|
|
2607
fb/fbmmx.c
2607
fb/fbmmx.c
File diff suppressed because it is too large
Load Diff
264
fb/fbmmx.h
264
fb/fbmmx.h
|
@ -44,251 +44,21 @@ Bool fbHaveMMX(void);
|
|||
|
||||
#ifdef USE_MMX
|
||||
|
||||
void fbComposeSetupMMX(void);
|
||||
|
||||
void fbCompositeSolidMask_nx8888x0565Cmmx (CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pMask,
|
||||
PicturePtr pDst,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
INT16 xMask,
|
||||
INT16 yMask,
|
||||
INT16 xDst,
|
||||
INT16 yDst,
|
||||
CARD16 width,
|
||||
CARD16 height);
|
||||
void fbCompositeSrcAdd_8888x8888mmx (CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pMask,
|
||||
PicturePtr pDst,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
INT16 xMask,
|
||||
INT16 yMask,
|
||||
INT16 xDst,
|
||||
INT16 yDst,
|
||||
CARD16 width,
|
||||
CARD16 height);
|
||||
void fbCompositeSrc_8888x8888mmx (CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pMask,
|
||||
PicturePtr pDst,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
INT16 xMask,
|
||||
INT16 yMask,
|
||||
INT16 xDst,
|
||||
INT16 yDst,
|
||||
CARD16 width,
|
||||
CARD16 height);
|
||||
void
|
||||
fbCompositeSolidMaskSrc_nx8x8888mmx (CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pMask,
|
||||
PicturePtr pDst,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
INT16 xMask,
|
||||
INT16 yMask,
|
||||
INT16 xDst,
|
||||
INT16 yDst,
|
||||
CARD16 width,
|
||||
CARD16 height);
|
||||
void
|
||||
fbCompositeSrc_x888x8x8888mmx (CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pMask,
|
||||
PicturePtr pDst,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
INT16 xMask,
|
||||
INT16 yMask,
|
||||
INT16 xDst,
|
||||
INT16 yDst,
|
||||
CARD16 width,
|
||||
CARD16 height);
|
||||
void fbCompositeSolidMask_nx8888x8888Cmmx (CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pMask,
|
||||
PicturePtr pDst,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
INT16 xMask,
|
||||
INT16 yMask,
|
||||
INT16 xDst,
|
||||
INT16 yDst,
|
||||
CARD16 width,
|
||||
CARD16 height);
|
||||
void fbCompositeSolidMask_nx8x8888mmx (CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pMask,
|
||||
PicturePtr pDst,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
INT16 xMask,
|
||||
INT16 yMask,
|
||||
INT16 xDst,
|
||||
INT16 yDst,
|
||||
CARD16 width,
|
||||
CARD16 height);
|
||||
void fbCompositeIn_nx8x8mmx (CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pMask,
|
||||
PicturePtr pDst,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
INT16 xMask,
|
||||
INT16 yMask,
|
||||
INT16 xDst,
|
||||
INT16 yDst,
|
||||
CARD16 width,
|
||||
CARD16 height);
|
||||
void fbCompositeIn_8x8mmx (CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pMask,
|
||||
PicturePtr pDst,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
INT16 xMask,
|
||||
INT16 yMask,
|
||||
INT16 xDst,
|
||||
INT16 yDst,
|
||||
CARD16 width,
|
||||
CARD16 height);
|
||||
void fbCompositeSrcAdd_8888x8x8mmx (CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pMask,
|
||||
PicturePtr pDst,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
INT16 xMask,
|
||||
INT16 yMask,
|
||||
INT16 xDst,
|
||||
INT16 yDst,
|
||||
CARD16 width,
|
||||
CARD16 height);
|
||||
void fbCompositeSrcAdd_8000x8000mmx (CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pMask,
|
||||
PicturePtr pDst,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
INT16 xMask,
|
||||
INT16 yMask,
|
||||
INT16 xDst,
|
||||
INT16 yDst,
|
||||
CARD16 width,
|
||||
CARD16 height);
|
||||
void fbCompositeSrc_8888RevNPx8888mmx (CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pMask,
|
||||
PicturePtr pDst,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
INT16 xMask,
|
||||
INT16 yMask,
|
||||
INT16 xDst,
|
||||
INT16 yDst,
|
||||
CARD16 width,
|
||||
CARD16 height);
|
||||
void fbCompositeSrc_8888x0565mmx (CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pMask,
|
||||
PicturePtr pDst,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
INT16 xMask,
|
||||
INT16 yMask,
|
||||
INT16 xDst,
|
||||
INT16 yDst,
|
||||
CARD16 width,
|
||||
CARD16 height);
|
||||
void fbCompositeSrc_8888RevNPx0565mmx (CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pMask,
|
||||
PicturePtr pDst,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
INT16 xMask,
|
||||
INT16 yMask,
|
||||
INT16 xDst,
|
||||
INT16 yDst,
|
||||
CARD16 width,
|
||||
CARD16 height);
|
||||
void fbCompositeSolid_nx8888mmx (CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pMask,
|
||||
PicturePtr pDst,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
INT16 xMask,
|
||||
INT16 yMask,
|
||||
INT16 xDst,
|
||||
INT16 yDst,
|
||||
CARD16 width,
|
||||
CARD16 height);
|
||||
void fbCompositeSolid_nx0565mmx (CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pMask,
|
||||
PicturePtr pDst,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
INT16 xMask,
|
||||
INT16 yMask,
|
||||
INT16 xDst,
|
||||
INT16 yDst,
|
||||
CARD16 width,
|
||||
CARD16 height);
|
||||
void fbCompositeSolidMask_nx8x0565mmx (CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pMask,
|
||||
PicturePtr pDst,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
INT16 xMask,
|
||||
INT16 yMask,
|
||||
INT16 xDst,
|
||||
INT16 yDst,
|
||||
CARD16 width,
|
||||
CARD16 height);
|
||||
void fbCompositeSrc_8888x8x8888mmx (CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pMask,
|
||||
PicturePtr pDst,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
INT16 xMask,
|
||||
INT16 yMask,
|
||||
INT16 xDst,
|
||||
INT16 yDst,
|
||||
CARD16 width,
|
||||
CARD16 height);
|
||||
Bool fbCopyAreammx (DrawablePtr pSrc,
|
||||
DrawablePtr pDst,
|
||||
int src_x,
|
||||
int src_y,
|
||||
int dst_x,
|
||||
int dst_y,
|
||||
int width,
|
||||
int height);
|
||||
void fbCompositeCopyAreammx (CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pMask,
|
||||
PicturePtr pDst,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
INT16 xMask,
|
||||
INT16 yMask,
|
||||
INT16 xDst,
|
||||
INT16 yDst,
|
||||
CARD16 width,
|
||||
CARD16 height);
|
||||
Bool fbSolidFillmmx (DrawablePtr pDraw,
|
||||
int x,
|
||||
int y,
|
||||
int width,
|
||||
int height,
|
||||
FbBits xor);
|
||||
|
||||
Bool fbBltmmx (FbBits *src_bits,
|
||||
FbBits *dst_bits,
|
||||
FbStride src_stride,
|
||||
FbStride dst_stride,
|
||||
int src_bpp,
|
||||
int dst_bpp,
|
||||
int src_x, int src_y,
|
||||
int dst_x, int dst_y,
|
||||
int width, int height);
|
||||
Bool fbFillmmx (FbBits *bits,
|
||||
FbStride stride,
|
||||
int bpp,
|
||||
int x,
|
||||
int y,
|
||||
int width,
|
||||
int height,
|
||||
FbBits xor);
|
||||
#endif /* USE_MMX */
|
||||
|
|
482
fb/fbpict.c
482
fb/fbpict.c
|
@ -30,7 +30,6 @@
|
|||
#include <string.h>
|
||||
|
||||
#include "fb.h"
|
||||
#include <pixman/pixman.h>
|
||||
|
||||
#ifdef RENDER
|
||||
|
||||
|
@ -39,228 +38,6 @@
|
|||
#include "fbpict.h"
|
||||
#include "fbmmx.h"
|
||||
|
||||
static pixman_image_t *
|
||||
create_solid_fill_image (PicturePtr pict)
|
||||
{
|
||||
PictSolidFill *solid = &pict->pSourcePict->solidFill;
|
||||
pixman_color_t color;
|
||||
CARD32 a, r, g, b;
|
||||
|
||||
a = (solid->color & 0xff000000) >> 24;
|
||||
r = (solid->color & 0x00ff0000) >> 16;
|
||||
g = (solid->color & 0x0000ff00) >> 8;
|
||||
b = (solid->color & 0x000000ff) >> 0;
|
||||
|
||||
color.alpha = (a << 8) | a;
|
||||
color.red = (r << 8) | r;
|
||||
color.green = (g << 8) | g;
|
||||
color.blue = (b << 8) | b;
|
||||
|
||||
return pixman_image_create_solid_fill (&color);
|
||||
}
|
||||
|
||||
static pixman_image_t *
|
||||
create_linear_gradient_image (PictGradient *gradient)
|
||||
{
|
||||
PictLinearGradient *linear = (PictLinearGradient *)gradient;
|
||||
pixman_point_fixed_t p1;
|
||||
pixman_point_fixed_t p2;
|
||||
|
||||
p1.x = linear->p1.x;
|
||||
p1.y = linear->p1.y;
|
||||
p2.x = linear->p2.x;
|
||||
p2.y = linear->p2.y;
|
||||
|
||||
return pixman_image_create_linear_gradient (
|
||||
&p1, &p2, (pixman_gradient_stop_t *)gradient->stops, gradient->nstops);
|
||||
}
|
||||
|
||||
static pixman_image_t *
|
||||
create_radial_gradient_image (PictGradient *gradient)
|
||||
{
|
||||
PictRadialGradient *radial = (PictRadialGradient *)gradient;
|
||||
pixman_point_fixed_t c1;
|
||||
pixman_point_fixed_t c2;
|
||||
|
||||
c1.x = radial->c1.x;
|
||||
c1.y = radial->c1.y;
|
||||
c2.x = radial->c2.x;
|
||||
c2.y = radial->c2.y;
|
||||
|
||||
return pixman_image_create_radial_gradient (
|
||||
&c1, &c2, radial->c1.radius,
|
||||
radial->c2.radius,
|
||||
(pixman_gradient_stop_t *)gradient->stops, gradient->nstops);
|
||||
}
|
||||
|
||||
static pixman_image_t *
|
||||
create_conical_gradient_image (PictGradient *gradient)
|
||||
{
|
||||
PictConicalGradient *conical = (PictConicalGradient *)gradient;
|
||||
pixman_point_fixed_t center;
|
||||
|
||||
center.x = conical->center.x;
|
||||
center.y = conical->center.y;
|
||||
|
||||
return pixman_image_create_conical_gradient (
|
||||
¢er, conical->angle, (pixman_gradient_stop_t *)gradient->stops,
|
||||
gradient->nstops);
|
||||
}
|
||||
|
||||
static pixman_image_t *
|
||||
create_bits_picture (PicturePtr pict)
|
||||
{
|
||||
FbBits *bits;
|
||||
FbStride stride;
|
||||
int bpp, xoff, yoff;
|
||||
pixman_image_t *image;
|
||||
|
||||
fbGetDrawable (pict->pDrawable, bits, stride, bpp, xoff, yoff);
|
||||
|
||||
bits += yoff * stride + xoff;
|
||||
|
||||
image = pixman_image_create_bits (
|
||||
pict->format,
|
||||
pict->pDrawable->width, pict->pDrawable->height,
|
||||
(uint32_t *)bits, stride * sizeof (FbStride));
|
||||
|
||||
|
||||
#ifdef FB_ACCESS_WRAPPER
|
||||
#if FB_SHIFT==5
|
||||
|
||||
pixman_image_set_accessors (image,
|
||||
(pixman_read_memory_func_t)wfbReadMemory,
|
||||
(pixman_write_memory_func_t)wfbWriteMemory);
|
||||
|
||||
#else
|
||||
|
||||
#error The pixman library only works when FbBits is 32 bits wide
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* pCompositeClip is undefined for source pictures, so
|
||||
* only set the clip region for pictures with drawables
|
||||
*/
|
||||
pixman_image_set_clip_region (image, pict->pCompositeClip);
|
||||
|
||||
/* Indexed table */
|
||||
if (pict->pFormat->index.devPrivate)
|
||||
pixman_image_set_indexed (image, pict->pFormat->index.devPrivate);
|
||||
|
||||
fbFinishAccess (pict->pDrawable);
|
||||
|
||||
return image;
|
||||
}
|
||||
|
||||
static pixman_image_t *image_from_pict (PicturePtr pict);
|
||||
|
||||
static void
|
||||
set_image_properties (pixman_image_t *image, PicturePtr pict)
|
||||
{
|
||||
pixman_repeat_t repeat;
|
||||
pixman_filter_t filter;
|
||||
|
||||
if (pict->transform)
|
||||
{
|
||||
pixman_image_set_transform (
|
||||
image, (pixman_transform_t *)pict->transform);
|
||||
}
|
||||
|
||||
switch (pict->repeatType)
|
||||
{
|
||||
default:
|
||||
case RepeatNone:
|
||||
repeat = PIXMAN_REPEAT_NONE;
|
||||
break;
|
||||
|
||||
case RepeatPad:
|
||||
repeat = PIXMAN_REPEAT_PAD;
|
||||
break;
|
||||
|
||||
case RepeatNormal:
|
||||
repeat = PIXMAN_REPEAT_NORMAL;
|
||||
break;
|
||||
|
||||
case RepeatReflect:
|
||||
repeat = PIXMAN_REPEAT_REFLECT;
|
||||
break;
|
||||
}
|
||||
|
||||
pixman_image_set_repeat (image, repeat);
|
||||
|
||||
if (pict->alphaMap)
|
||||
{
|
||||
pixman_image_t *alpha_map = image_from_pict (pict->alphaMap);
|
||||
|
||||
pixman_image_set_alpha_map (
|
||||
image, alpha_map, pict->alphaOrigin.x, pict->alphaOrigin.y);
|
||||
|
||||
pixman_image_unref (alpha_map);
|
||||
}
|
||||
|
||||
pixman_image_set_component_alpha (image, pict->componentAlpha);
|
||||
|
||||
switch (pict->filter)
|
||||
{
|
||||
default:
|
||||
case PictFilterNearest:
|
||||
case PictFilterFast:
|
||||
filter = PIXMAN_FILTER_NEAREST;
|
||||
break;
|
||||
|
||||
case PictFilterBilinear:
|
||||
case PictFilterGood:
|
||||
filter = PIXMAN_FILTER_BILINEAR;
|
||||
break;
|
||||
|
||||
case PictFilterConvolution:
|
||||
filter = PIXMAN_FILTER_CONVOLUTION;
|
||||
break;
|
||||
}
|
||||
|
||||
pixman_image_set_filter (image, filter, (pixman_fixed_t *)pict->filter_params, pict->filter_nparams);
|
||||
}
|
||||
|
||||
static pixman_image_t *
|
||||
image_from_pict (PicturePtr pict)
|
||||
{
|
||||
pixman_image_t *image = NULL;
|
||||
|
||||
if (!pict)
|
||||
return NULL;
|
||||
|
||||
if (pict->pDrawable)
|
||||
{
|
||||
image = create_bits_picture (pict);
|
||||
}
|
||||
else if (pict->pSourcePict)
|
||||
{
|
||||
SourcePict *sp = pict->pSourcePict;
|
||||
|
||||
if (sp->type == SourcePictTypeSolidFill)
|
||||
{
|
||||
image = create_solid_fill_image (pict);
|
||||
}
|
||||
else
|
||||
{
|
||||
PictGradient *gradient = &pict->pSourcePict->gradient;
|
||||
|
||||
if (sp->type == SourcePictTypeLinear)
|
||||
image = create_linear_gradient_image (gradient);
|
||||
else if (sp->type == SourcePictTypeRadial)
|
||||
image = create_radial_gradient_image (gradient);
|
||||
else if (sp->type == SourcePictTypeConical)
|
||||
image = create_conical_gradient_image (gradient);
|
||||
}
|
||||
}
|
||||
|
||||
if (image)
|
||||
set_image_properties (image, pict);
|
||||
|
||||
return image;
|
||||
}
|
||||
|
||||
#define mod(a,b) ((b) == 1 ? 0 : (a) >= 0 ? (a) % (b) : (b) - (-a) % (b))
|
||||
|
||||
void
|
||||
|
@ -381,26 +158,37 @@ fbComposite (CARD8 op,
|
|||
CARD16 width,
|
||||
CARD16 height)
|
||||
{
|
||||
pixman_region16_t region;
|
||||
pixman_image_t *src, *mask, *dest;
|
||||
|
||||
if (!miComputeCompositeRegion (®ion, pSrc, pMask, pDst, xSrc, ySrc,
|
||||
xMask, yMask, xDst, yDst, width, height))
|
||||
return;
|
||||
xDst += pDst->pDrawable->x;
|
||||
yDst += pDst->pDrawable->y;
|
||||
if (pSrc->pDrawable)
|
||||
{
|
||||
xSrc += pSrc->pDrawable->x;
|
||||
ySrc += pSrc->pDrawable->y;
|
||||
}
|
||||
if (pMask && pMask->pDrawable)
|
||||
{
|
||||
xMask += pMask->pDrawable->x;
|
||||
yMask += pMask->pDrawable->y;
|
||||
}
|
||||
|
||||
src = image_from_pict (pSrc);
|
||||
mask = image_from_pict (pMask);
|
||||
dest = image_from_pict (pDst);
|
||||
miCompositeSourceValidate (pSrc, xSrc, ySrc, width, height);
|
||||
if (pMask)
|
||||
miCompositeSourceValidate (pMask, xMask, yMask, width, height);
|
||||
|
||||
src = image_from_pict (pSrc, TRUE);
|
||||
mask = image_from_pict (pMask, TRUE);
|
||||
dest = image_from_pict (pDst, TRUE);
|
||||
|
||||
if (src && dest && !(pMask && !mask))
|
||||
{
|
||||
pixman_image_composite (op, src, mask, dest,
|
||||
xSrc, ySrc, xMask, yMask, xDst, yDst,
|
||||
width, height, ®ion);
|
||||
width, height);
|
||||
|
||||
}
|
||||
|
||||
pixman_region_fini (®ion);
|
||||
|
||||
if (src)
|
||||
pixman_image_unref (src);
|
||||
if (mask)
|
||||
|
@ -430,6 +218,234 @@ fbCompositeGeneral (CARD8 op,
|
|||
|
||||
#endif /* RENDER */
|
||||
|
||||
static pixman_image_t *
|
||||
create_solid_fill_image (PicturePtr pict)
|
||||
{
|
||||
PictSolidFill *solid = &pict->pSourcePict->solidFill;
|
||||
pixman_color_t color;
|
||||
CARD32 a, r, g, b;
|
||||
|
||||
a = (solid->color & 0xff000000) >> 24;
|
||||
r = (solid->color & 0x00ff0000) >> 16;
|
||||
g = (solid->color & 0x0000ff00) >> 8;
|
||||
b = (solid->color & 0x000000ff) >> 0;
|
||||
|
||||
color.alpha = (a << 8) | a;
|
||||
color.red = (r << 8) | r;
|
||||
color.green = (g << 8) | g;
|
||||
color.blue = (b << 8) | b;
|
||||
|
||||
return pixman_image_create_solid_fill (&color);
|
||||
}
|
||||
|
||||
static pixman_image_t *
|
||||
create_linear_gradient_image (PictGradient *gradient)
|
||||
{
|
||||
PictLinearGradient *linear = (PictLinearGradient *)gradient;
|
||||
pixman_point_fixed_t p1;
|
||||
pixman_point_fixed_t p2;
|
||||
|
||||
p1.x = linear->p1.x;
|
||||
p1.y = linear->p1.y;
|
||||
p2.x = linear->p2.x;
|
||||
p2.y = linear->p2.y;
|
||||
|
||||
return pixman_image_create_linear_gradient (
|
||||
&p1, &p2, (pixman_gradient_stop_t *)gradient->stops, gradient->nstops);
|
||||
}
|
||||
|
||||
static pixman_image_t *
|
||||
create_radial_gradient_image (PictGradient *gradient)
|
||||
{
|
||||
PictRadialGradient *radial = (PictRadialGradient *)gradient;
|
||||
pixman_point_fixed_t c1;
|
||||
pixman_point_fixed_t c2;
|
||||
|
||||
c1.x = radial->c1.x;
|
||||
c1.y = radial->c1.y;
|
||||
c2.x = radial->c2.x;
|
||||
c2.y = radial->c2.y;
|
||||
|
||||
return pixman_image_create_radial_gradient (
|
||||
&c1, &c2, radial->c1.radius,
|
||||
radial->c2.radius,
|
||||
(pixman_gradient_stop_t *)gradient->stops, gradient->nstops);
|
||||
}
|
||||
|
||||
static pixman_image_t *
|
||||
create_conical_gradient_image (PictGradient *gradient)
|
||||
{
|
||||
PictConicalGradient *conical = (PictConicalGradient *)gradient;
|
||||
pixman_point_fixed_t center;
|
||||
|
||||
center.x = conical->center.x;
|
||||
center.y = conical->center.y;
|
||||
|
||||
return pixman_image_create_conical_gradient (
|
||||
¢er, conical->angle, (pixman_gradient_stop_t *)gradient->stops,
|
||||
gradient->nstops);
|
||||
}
|
||||
|
||||
static pixman_image_t *
|
||||
create_bits_picture (PicturePtr pict,
|
||||
Bool has_clip)
|
||||
{
|
||||
FbBits *bits;
|
||||
FbStride stride;
|
||||
int bpp, xoff, yoff;
|
||||
pixman_image_t *image;
|
||||
|
||||
fbGetDrawable (pict->pDrawable, bits, stride, bpp, xoff, yoff);
|
||||
|
||||
bits += yoff * stride + xoff;
|
||||
|
||||
image = pixman_image_create_bits (
|
||||
pict->format,
|
||||
pict->pDrawable->width, pict->pDrawable->height,
|
||||
(uint32_t *)bits, stride * sizeof (FbStride));
|
||||
|
||||
|
||||
#ifdef FB_ACCESS_WRAPPER
|
||||
#if FB_SHIFT==5
|
||||
|
||||
pixman_image_set_accessors (image,
|
||||
(pixman_read_memory_func_t)wfbReadMemory,
|
||||
(pixman_write_memory_func_t)wfbWriteMemory);
|
||||
|
||||
#else
|
||||
|
||||
#error The pixman library only works when FbBits is 32 bits wide
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* pCompositeClip is undefined for source pictures, so
|
||||
* only set the clip region for pictures with drawables
|
||||
*/
|
||||
if (has_clip)
|
||||
{
|
||||
if (pict->clientClipType != CT_NONE)
|
||||
pixman_image_set_has_client_clip (image, TRUE);
|
||||
|
||||
pixman_image_set_clip_region (image, pict->pCompositeClip);
|
||||
}
|
||||
|
||||
/* Indexed table */
|
||||
if (pict->pFormat->index.devPrivate)
|
||||
pixman_image_set_indexed (image, pict->pFormat->index.devPrivate);
|
||||
|
||||
fbFinishAccess (pict->pDrawable);
|
||||
|
||||
return image;
|
||||
}
|
||||
|
||||
static void
|
||||
set_image_properties (pixman_image_t *image, PicturePtr pict)
|
||||
{
|
||||
pixman_repeat_t repeat;
|
||||
pixman_filter_t filter;
|
||||
|
||||
if (pict->transform)
|
||||
{
|
||||
pixman_image_set_transform (
|
||||
image, (pixman_transform_t *)pict->transform);
|
||||
}
|
||||
|
||||
switch (pict->repeatType)
|
||||
{
|
||||
default:
|
||||
case RepeatNone:
|
||||
repeat = PIXMAN_REPEAT_NONE;
|
||||
break;
|
||||
|
||||
case RepeatPad:
|
||||
repeat = PIXMAN_REPEAT_PAD;
|
||||
break;
|
||||
|
||||
case RepeatNormal:
|
||||
repeat = PIXMAN_REPEAT_NORMAL;
|
||||
break;
|
||||
|
||||
case RepeatReflect:
|
||||
repeat = PIXMAN_REPEAT_REFLECT;
|
||||
break;
|
||||
}
|
||||
|
||||
pixman_image_set_repeat (image, repeat);
|
||||
|
||||
if (pict->alphaMap)
|
||||
{
|
||||
pixman_image_t *alpha_map = image_from_pict (pict->alphaMap, TRUE);
|
||||
|
||||
pixman_image_set_alpha_map (
|
||||
image, alpha_map, pict->alphaOrigin.x, pict->alphaOrigin.y);
|
||||
|
||||
pixman_image_unref (alpha_map);
|
||||
}
|
||||
|
||||
pixman_image_set_component_alpha (image, pict->componentAlpha);
|
||||
|
||||
switch (pict->filter)
|
||||
{
|
||||
default:
|
||||
case PictFilterNearest:
|
||||
case PictFilterFast:
|
||||
filter = PIXMAN_FILTER_NEAREST;
|
||||
break;
|
||||
|
||||
case PictFilterBilinear:
|
||||
case PictFilterGood:
|
||||
filter = PIXMAN_FILTER_BILINEAR;
|
||||
break;
|
||||
|
||||
case PictFilterConvolution:
|
||||
filter = PIXMAN_FILTER_CONVOLUTION;
|
||||
break;
|
||||
}
|
||||
|
||||
pixman_image_set_filter (image, filter, (pixman_fixed_t *)pict->filter_params, pict->filter_nparams);
|
||||
}
|
||||
|
||||
pixman_image_t *
|
||||
image_from_pict (PicturePtr pict,
|
||||
Bool has_clip)
|
||||
{
|
||||
pixman_image_t *image = NULL;
|
||||
|
||||
if (!pict)
|
||||
return NULL;
|
||||
|
||||
if (pict->pDrawable)
|
||||
{
|
||||
image = create_bits_picture (pict, has_clip);
|
||||
}
|
||||
else if (pict->pSourcePict)
|
||||
{
|
||||
SourcePict *sp = pict->pSourcePict;
|
||||
|
||||
if (sp->type == SourcePictTypeSolidFill)
|
||||
{
|
||||
image = create_solid_fill_image (pict);
|
||||
}
|
||||
else
|
||||
{
|
||||
PictGradient *gradient = &pict->pSourcePict->gradient;
|
||||
|
||||
if (sp->type == SourcePictTypeLinear)
|
||||
image = create_linear_gradient_image (gradient);
|
||||
else if (sp->type == SourcePictTypeRadial)
|
||||
image = create_radial_gradient_image (gradient);
|
||||
else if (sp->type == SourcePictTypeConical)
|
||||
image = create_conical_gradient_image (gradient);
|
||||
}
|
||||
}
|
||||
|
||||
if (image)
|
||||
set_image_properties (image, pict);
|
||||
|
||||
return image;
|
||||
}
|
||||
|
||||
Bool
|
||||
fbPictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats)
|
||||
{
|
||||
|
|
12
fb/fbpict.h
12
fb/fbpict.h
|
@ -412,18 +412,6 @@ fbCompositeGeneral (CARD8 op,
|
|||
CARD16 width,
|
||||
CARD16 height);
|
||||
|
||||
|
||||
/* fbedge.c */
|
||||
void
|
||||
fbRasterizeEdges (FbBits *buf,
|
||||
int bpp,
|
||||
int width,
|
||||
int stride,
|
||||
RenderEdge *l,
|
||||
RenderEdge *r,
|
||||
xFixed t,
|
||||
xFixed b);
|
||||
|
||||
/* fbpict.c */
|
||||
void
|
||||
fbComposite (CARD8 op,
|
||||
|
|
101
fb/fbtrap.c
101
fb/fbtrap.c
|
@ -42,61 +42,16 @@ fbAddTraps (PicturePtr pPicture,
|
|||
int ntrap,
|
||||
xTrap *traps)
|
||||
{
|
||||
FbBits *buf;
|
||||
int bpp;
|
||||
int width;
|
||||
int stride;
|
||||
int height;
|
||||
int pxoff, pyoff;
|
||||
pixman_image_t *image = image_from_pict (pPicture, FALSE);
|
||||
|
||||
xFixed x_off_fixed;
|
||||
xFixed y_off_fixed;
|
||||
RenderEdge l, r;
|
||||
xFixed t, b;
|
||||
if (!image)
|
||||
return;
|
||||
|
||||
fbGetDrawable (pPicture->pDrawable, buf, stride, bpp, pxoff, pyoff);
|
||||
|
||||
width = pPicture->pDrawable->width;
|
||||
height = pPicture->pDrawable->height;
|
||||
x_off += pxoff;
|
||||
y_off += pyoff;
|
||||
|
||||
x_off_fixed = IntToxFixed(y_off);
|
||||
y_off_fixed = IntToxFixed(y_off);
|
||||
|
||||
while (ntrap--)
|
||||
{
|
||||
t = traps->top.y + y_off_fixed;
|
||||
if (t < 0)
|
||||
t = 0;
|
||||
t = RenderSampleCeilY (t, bpp);
|
||||
|
||||
b = traps->bot.y + y_off_fixed;
|
||||
if (xFixedToInt (b) >= height)
|
||||
b = IntToxFixed (height) - 1;
|
||||
b = RenderSampleFloorY (b, bpp);
|
||||
|
||||
if (b >= t)
|
||||
{
|
||||
/* initialize edge walkers */
|
||||
RenderEdgeInit (&l, bpp, t,
|
||||
traps->top.l + x_off_fixed,
|
||||
traps->top.y + y_off_fixed,
|
||||
traps->bot.l + x_off_fixed,
|
||||
traps->bot.y + y_off_fixed);
|
||||
|
||||
RenderEdgeInit (&r, bpp, t,
|
||||
traps->top.r + x_off_fixed,
|
||||
traps->top.y + y_off_fixed,
|
||||
traps->bot.r + x_off_fixed,
|
||||
traps->bot.y + y_off_fixed);
|
||||
|
||||
fbRasterizeEdges (buf, bpp, width, stride, &l, &r, t, b);
|
||||
}
|
||||
traps++;
|
||||
}
|
||||
pixman_add_traps (image, x_off, y_off, ntrap, (pixman_trap_t *)traps);
|
||||
|
||||
fbFinishAccess (pPicture->pDrawable);
|
||||
|
||||
pixman_image_unref (image);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -105,50 +60,16 @@ fbRasterizeTrapezoid (PicturePtr pPicture,
|
|||
int x_off,
|
||||
int y_off)
|
||||
{
|
||||
FbBits *buf;
|
||||
int bpp;
|
||||
int width;
|
||||
int stride;
|
||||
int height;
|
||||
int pxoff, pyoff;
|
||||
pixman_image_t *image = image_from_pict (pPicture, FALSE);
|
||||
|
||||
xFixed x_off_fixed;
|
||||
xFixed y_off_fixed;
|
||||
RenderEdge l, r;
|
||||
xFixed t, b;
|
||||
|
||||
if (!xTrapezoidValid (trap))
|
||||
if (!image)
|
||||
return;
|
||||
|
||||
fbGetDrawable (pPicture->pDrawable, buf, stride, bpp, pxoff, pyoff);
|
||||
|
||||
width = pPicture->pDrawable->width;
|
||||
height = pPicture->pDrawable->height;
|
||||
x_off += pxoff;
|
||||
y_off += pyoff;
|
||||
|
||||
x_off_fixed = IntToxFixed(x_off);
|
||||
y_off_fixed = IntToxFixed(y_off);
|
||||
t = trap->top + y_off_fixed;
|
||||
if (t < 0)
|
||||
t = 0;
|
||||
t = RenderSampleCeilY (t, bpp);
|
||||
|
||||
b = trap->bottom + y_off_fixed;
|
||||
if (xFixedToInt (b) >= height)
|
||||
b = IntToxFixed (height) - 1;
|
||||
b = RenderSampleFloorY (b, bpp);
|
||||
|
||||
if (b >= t)
|
||||
{
|
||||
/* initialize edge walkers */
|
||||
RenderLineFixedEdgeInit (&l, bpp, t, &trap->left, x_off, y_off);
|
||||
RenderLineFixedEdgeInit (&r, bpp, t, &trap->right, x_off, y_off);
|
||||
|
||||
fbRasterizeEdges (buf, bpp, width, stride, &l, &r, t, b);
|
||||
}
|
||||
pixman_rasterize_trapezoid (image, (pixman_trapezoid_t *)trap, x_off, y_off);
|
||||
|
||||
fbFinishAccess (pPicture->pDrawable);
|
||||
|
||||
pixman_image_unref (image);
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
|
@ -233,26 +233,27 @@ fbFillRegionSolid (DrawablePtr pDrawable,
|
|||
while (n--)
|
||||
{
|
||||
#ifdef USE_MMX
|
||||
if (!has_mmx || !fbSolidFillmmx (pDrawable,
|
||||
pbox->x1,
|
||||
pbox->y1,
|
||||
(pbox->x2 - pbox->x1),
|
||||
(pbox->y2 - pbox->y1), xor)) {
|
||||
if (!has_mmx || !fbFillmmx (dst, dstStride, dstBpp,
|
||||
pbox->x1 + dstXoff, pbox->y1 + dstYoff,
|
||||
(pbox->x2 - pbox->x1),
|
||||
(pbox->y2 - pbox->y1),
|
||||
xor))
|
||||
{
|
||||
#endif
|
||||
fbSolid (dst + (pbox->y1 + dstYoff) * dstStride,
|
||||
dstStride,
|
||||
(pbox->x1 + dstXoff) * dstBpp,
|
||||
dstBpp,
|
||||
(pbox->x2 - pbox->x1) * dstBpp,
|
||||
pbox->y2 - pbox->y1,
|
||||
and, xor);
|
||||
fbSolid (dst + (pbox->y1 + dstYoff) * dstStride,
|
||||
dstStride,
|
||||
(pbox->x1 + dstXoff) * dstBpp,
|
||||
dstBpp,
|
||||
(pbox->x2 - pbox->x1) * dstBpp,
|
||||
pbox->y2 - pbox->y1,
|
||||
and, xor);
|
||||
#ifdef USE_MMX
|
||||
}
|
||||
#endif
|
||||
fbValidateDrawable (pDrawable);
|
||||
pbox++;
|
||||
}
|
||||
|
||||
|
||||
fbFinishAccess (pDrawable);
|
||||
}
|
||||
|
||||
|
|
|
@ -184,9 +184,11 @@
|
|||
#define fbUnmapWindow wfbUnmapWindow
|
||||
#define fbUnrealizeFont wfbUnrealizeFont
|
||||
#define fbValidateGC wfbValidateGC
|
||||
#define fbWalkCompositeRegion wfbWalkCompositeRegion
|
||||
#define fbWinPrivateIndex wfbWinPrivateIndex
|
||||
#define fbZeroLine wfbZeroLine
|
||||
#define fbZeroSegment wfbZeroSegment
|
||||
#define image_from_pict wfb_image_from_pict
|
||||
#define xxScrPrivateIndex wfbxxScrPrivateIndex
|
||||
#define xxGCPrivateIndex wfbxxGCPrivateIndex
|
||||
#define xxColormapPrivateIndex wfbxxColormapPrivateIndex
|
||||
|
|
|
@ -65,7 +65,7 @@ of the copyright holder.
|
|||
|
||||
#include <linux/agpgart.h>
|
||||
|
||||
#elif defined(__FreeBSD__)
|
||||
#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/agpio.h>
|
||||
#endif
|
||||
|
|
|
@ -1365,7 +1365,7 @@ do { \
|
|||
# define write_mem_barrier() /* NOP */
|
||||
|
||||
# if !defined(__SUNPRO_C)
|
||||
# if !defined(FAKEIT) && !defined(__mc68000__) && !defined(__arm__) && !defined(__sh__) && !defined(__hppa__)
|
||||
# if !defined(FAKEIT) && !defined(__mc68000__) && !defined(__arm__) && !defined(__sh__) && !defined(__hppa__) && !defined(__s390__)
|
||||
# ifdef GCCUSESGAS
|
||||
|
||||
/*
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
#define BUILD_DATE @BUILD_DATE@
|
||||
#define BUILD_TIME @BUILD_TIME@
|
||||
|
|
|
@ -131,9 +131,9 @@ static Bool configInput(IDevPtr inputp, XF86ConfInputPtr conf_input,
|
|||
static Bool configDisplay(DispPtr displayp, XF86ConfDisplayPtr conf_display);
|
||||
static Bool addDefaultModes(MonPtr monitorp);
|
||||
#ifdef XF86DRI
|
||||
static Bool configDRI(XF86ConfDRIPtr drip);
|
||||
static void configDRI(XF86ConfDRIPtr drip);
|
||||
#endif
|
||||
static Bool configExtensions(XF86ConfExtensionsPtr conf_ext);
|
||||
static void configExtensions(XF86ConfExtensionsPtr conf_ext);
|
||||
|
||||
/*
|
||||
* xf86GetPathElem --
|
||||
|
@ -598,7 +598,7 @@ xf86ConfigError(char *msg, ...)
|
|||
return;
|
||||
}
|
||||
|
||||
static Bool
|
||||
static void
|
||||
configFiles(XF86ConfFilesPtr fileconf)
|
||||
{
|
||||
MessageType pathFrom = X_DEFAULT;
|
||||
|
@ -615,7 +615,7 @@ configFiles(XF86ConfFilesPtr fileconf)
|
|||
pathFrom = X_CONFIG;
|
||||
if (*f) {
|
||||
if (xf86Info.useDefaultFontPath) {
|
||||
xf86Msg(X_WARNING, "Including the default font path %s.\n", defaultFontPath);
|
||||
xf86Msg(X_DEFAULT, "Including the default font path %s.\n", defaultFontPath);
|
||||
char *g = xnfalloc(strlen(defaultFontPath) + strlen(f) + 3);
|
||||
strcpy(g, f);
|
||||
strcat(g, ",");
|
||||
|
@ -632,7 +632,7 @@ configFiles(XF86ConfFilesPtr fileconf)
|
|||
}
|
||||
}
|
||||
} else {
|
||||
xf86Msg(X_WARNING,
|
||||
xf86Msg(X_DEFAULT,
|
||||
"No FontPath specified. Using compiled-in default.\n");
|
||||
pathFrom = X_DEFAULT;
|
||||
}
|
||||
|
@ -1474,13 +1474,13 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
|
|||
}
|
||||
|
||||
if (pointerMsg) {
|
||||
xf86Msg(X_WARNING, "The core pointer device wasn't specified "
|
||||
xf86Msg(X_DEFAULT, "The core pointer device wasn't specified "
|
||||
"explicitly in the layout.\n"
|
||||
"\tUsing the %s.\n", pointerMsg);
|
||||
}
|
||||
|
||||
if (keyboardMsg) {
|
||||
xf86Msg(X_WARNING, "The core keyboard device wasn't specified "
|
||||
xf86Msg(X_DEFAULT, "The core keyboard device wasn't specified "
|
||||
"explicitly in the layout.\n"
|
||||
"\tUsing the %s.\n", keyboardMsg);
|
||||
}
|
||||
|
@ -1937,7 +1937,7 @@ configScreen(confScreenPtr screenp, XF86ConfScreenPtr conf_screen, int scrnum,
|
|||
}
|
||||
|
||||
if (defaultMonitor) {
|
||||
xf86Msg(X_WARNING, "No monitor specified for screen \"%s\".\n"
|
||||
xf86Msg(X_DEFAULT, "No monitor specified for screen \"%s\".\n"
|
||||
"\tUsing a default monitor configuration.\n", screenp->id);
|
||||
}
|
||||
return TRUE;
|
||||
|
@ -2228,7 +2228,7 @@ configDevice(GDevPtr devicep, XF86ConfDevicePtr conf_device, Bool active)
|
|||
}
|
||||
|
||||
#ifdef XF86DRI
|
||||
static Bool
|
||||
static void
|
||||
configDRI(XF86ConfDRIPtr drip)
|
||||
{
|
||||
int count = 0;
|
||||
|
@ -2269,12 +2269,10 @@ configDRI(XF86ConfDRIPtr drip)
|
|||
xf86ConfigDRI.bufs[i].flags = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
static Bool
|
||||
static void
|
||||
configExtensions(XF86ConfExtensionsPtr conf_ext)
|
||||
{
|
||||
XF86OptionPtr o;
|
||||
|
@ -2309,11 +2307,9 @@ configExtensions(XF86ConfExtensionsPtr conf_ext)
|
|||
xf86NameCmp(val, "false") == 0) {
|
||||
enable = !enable;
|
||||
} else {
|
||||
xf86Msg(X_ERROR,
|
||||
"%s is not a valid value for the Extension option\n",
|
||||
val);
|
||||
xf86Msg(X_WARNING, "Ignoring unrecognized value \"%s\"\n", val);
|
||||
xfree(n);
|
||||
return FALSE;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (EnableDisableExtension(name, enable)) {
|
||||
|
@ -2326,8 +2322,6 @@ configExtensions(XF86ConfExtensionsPtr conf_ext)
|
|||
xfree(n);
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static Bool
|
||||
|
@ -2457,7 +2451,7 @@ xf86HandleConfigFile(Bool autoconfig)
|
|||
|
||||
if (xf86configptr->conf_layout_lst == NULL || xf86ScreenName != NULL) {
|
||||
if (xf86ScreenName == NULL) {
|
||||
xf86Msg(X_WARNING,
|
||||
xf86Msg(X_DEFAULT,
|
||||
"No Layout section. Using the first Screen section.\n");
|
||||
}
|
||||
if (!configImpliedLayout(&xf86ConfigLayout,
|
||||
|
@ -2510,19 +2504,17 @@ xf86HandleConfigFile(Bool autoconfig)
|
|||
}
|
||||
|
||||
/* Now process everything else */
|
||||
|
||||
if (!configServerFlags(xf86configptr->conf_flags,
|
||||
xf86ConfigLayout.options) ||
|
||||
!configFiles(xf86configptr->conf_files) ||
|
||||
!configExtensions(xf86configptr->conf_extensions)
|
||||
#ifdef XF86DRI
|
||||
|| !configDRI(xf86configptr->conf_dri)
|
||||
#endif
|
||||
) {
|
||||
if (!configServerFlags(xf86configptr->conf_flags,xf86ConfigLayout.options)){
|
||||
ErrorF ("Problem when converting the config data structures\n");
|
||||
return CONFIG_PARSE_ERROR;
|
||||
}
|
||||
|
||||
configFiles(xf86configptr->conf_files);
|
||||
configExtensions(xf86configptr->conf_extensions);
|
||||
#ifdef XF86DRI
|
||||
configDRI(xf86configptr->conf_dri);
|
||||
#endif
|
||||
|
||||
checkInput(&xf86ConfigLayout);
|
||||
|
||||
/*
|
||||
|
|
|
@ -1208,31 +1208,3 @@ _X_EXPORT void
|
|||
DDXRingBell(int volume, int pitch, int duration) {
|
||||
xf86OSRingBell(volume, pitch, duration);
|
||||
}
|
||||
|
||||
#ifdef WSCONS_SUPPORT
|
||||
|
||||
/* XXX Currently XKB is mandatory. */
|
||||
|
||||
extern int WSKbdToKeycode(int);
|
||||
|
||||
void
|
||||
xf86PostWSKbdEvent(struct wscons_event *event)
|
||||
{
|
||||
int type = event->type;
|
||||
int value = event->value;
|
||||
unsigned int keycode;
|
||||
int blocked;
|
||||
|
||||
if (type == WSCONS_EVENT_KEY_UP || type == WSCONS_EVENT_KEY_DOWN) {
|
||||
Bool down = (type == WSCONS_EVENT_KEY_DOWN ? TRUE : FALSE);
|
||||
|
||||
/* map the scancodes to standard XFree86 scancode */
|
||||
keycode = WSKbdToKeycode(value);
|
||||
if (!down) keycode |= 0x80;
|
||||
/* It seems better to block SIGIO there */
|
||||
blocked = xf86BlockSIGIO();
|
||||
xf86PostKbdEvent(keycode);
|
||||
xf86UnblockSIGIO(blocked);
|
||||
}
|
||||
}
|
||||
#endif /* WSCONS_SUPPORT */
|
||||
|
|
|
@ -1730,8 +1730,16 @@ xf86PrintBanner()
|
|||
t.tm_mday = BUILD_DATE % 100;
|
||||
t.tm_mon = (BUILD_DATE / 100) % 100 - 1;
|
||||
t.tm_year = BUILD_DATE / 10000 - 1900;
|
||||
#if defined(BUILD_TIME)
|
||||
t.tm_sec = BUILD_TIME % 100;
|
||||
t.tm_min = (BUILD_TIME / 100) % 100;
|
||||
t.tm_hour = (BUILD_TIME / 10000) % 100;
|
||||
if (strftime(buf, sizeof(buf), "%d %B %Y %I:%M:%s%p", &t))
|
||||
ErrorF("Build Date: %s\n", buf);
|
||||
#else
|
||||
if (strftime(buf, sizeof(buf), "%d %B %Y", &t))
|
||||
ErrorF("Build Date: %s\n", buf);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
#if defined(CLOG_DATE) && (CLOG_DATE > 19000000)
|
||||
|
|
|
@ -1890,7 +1890,7 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes,
|
|||
virtX, virtY, vx, vy);
|
||||
virtX = vx;
|
||||
virtY = vy;
|
||||
linePitch = miScanLineWidth(vx, vy, linePitch, apertureSize,
|
||||
linePitch = miScanLineWidth(vx, vy, minPitch, apertureSize,
|
||||
BankFormat, pitchInc);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -85,7 +85,7 @@ typedef enum {
|
|||
*/
|
||||
#define ABI_ANSIC_VERSION SET_ABI_VERSION(0, 3)
|
||||
#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(2, 0)
|
||||
#define ABI_XINPUT_VERSION SET_ABI_VERSION(1, 0)
|
||||
#define ABI_XINPUT_VERSION SET_ABI_VERSION(1, 1)
|
||||
#define ABI_EXTENSION_VERSION SET_ABI_VERSION(0, 3)
|
||||
#define ABI_FONT_VERSION SET_ABI_VERSION(0, 5)
|
||||
|
||||
|
|
|
@ -101,7 +101,7 @@ xf86SendDragEvents(DeviceIntPtr device)
|
|||
{
|
||||
LocalDevicePtr local = (LocalDevicePtr) device->public.devicePrivate;
|
||||
|
||||
if (device->button->buttonsDown > 0)
|
||||
if (device->button && device->button->buttonsDown > 0)
|
||||
return (local->flags & XI86_SEND_DRAG_EVENTS);
|
||||
else
|
||||
return (TRUE);
|
||||
|
@ -119,10 +119,12 @@ _X_EXPORT void
|
|||
xf86ProcessCommonOptions(LocalDevicePtr local,
|
||||
pointer list)
|
||||
{
|
||||
if (!xf86SetBoolOption(list, "AlwaysCore", 0) ||
|
||||
xf86SetBoolOption(list, "SendCoreEvents", 0) ||
|
||||
xf86SetBoolOption(list, "CorePointer", 0) ||
|
||||
xf86SetBoolOption(list, "CoreKeyboard", 0)) {
|
||||
if (xf86SetBoolOption(list, "AlwaysCore", 0) ||
|
||||
!xf86SetBoolOption(list, "SendCoreEvents", 1) ||
|
||||
!xf86SetBoolOption(list, "CorePointer", 1) ||
|
||||
!xf86SetBoolOption(list, "CoreKeyboard", 1)) {
|
||||
xf86Msg(X_CONFIG, "%s: doesn't report core events\n", local->name);
|
||||
} else {
|
||||
local->flags |= XI86_ALWAYS_CORE;
|
||||
xf86Msg(X_CONFIG, "%s: always reports core events\n", local->name);
|
||||
}
|
||||
|
@ -329,7 +331,7 @@ NewInputDeviceRequest (InputOption *options, DeviceIntPtr *pdev)
|
|||
return BadAlloc;
|
||||
|
||||
for (option = options; option; option = option->next) {
|
||||
if (strcmp(option->key, "driver") == 0) {
|
||||
if (strcasecmp(option->key, "driver") == 0) {
|
||||
if (idev->driver) {
|
||||
rval = BadRequest;
|
||||
goto unwind;
|
||||
|
@ -352,8 +354,8 @@ NewInputDeviceRequest (InputOption *options, DeviceIntPtr *pdev)
|
|||
goto unwind;
|
||||
}
|
||||
}
|
||||
if (strcmp(option->key, "name") == 0 ||
|
||||
strcmp(option->key, "identifier") == 0) {
|
||||
if (strcasecmp(option->key, "name") == 0 ||
|
||||
strcasecmp(option->key, "identifier") == 0) {
|
||||
if (idev->identifier) {
|
||||
rval = BadRequest;
|
||||
goto unwind;
|
||||
|
@ -460,26 +462,47 @@ xf86PostMotionEvent(DeviceIntPtr device,
|
|||
...)
|
||||
{
|
||||
va_list var;
|
||||
int i = 0, nevents = 0;
|
||||
int dx, dy;
|
||||
Bool drag = xf86SendDragEvents(device);
|
||||
int *valuators = NULL;
|
||||
int flags = 0;
|
||||
xEvent *xE = NULL;
|
||||
int index;
|
||||
int i = 0;
|
||||
static int *valuators = NULL;
|
||||
static int n_valuators = 0;
|
||||
|
||||
if (is_absolute)
|
||||
flags = POINTER_ABSOLUTE;
|
||||
else
|
||||
flags = POINTER_RELATIVE | POINTER_ACCELERATE;
|
||||
|
||||
valuators = xcalloc(sizeof(int), num_valuators);
|
||||
if (num_valuators > n_valuators) {
|
||||
xfree (valuators);
|
||||
valuators = NULL;
|
||||
}
|
||||
|
||||
if (!valuators) {
|
||||
valuators = xcalloc(sizeof(int), num_valuators);
|
||||
n_valuators = num_valuators;
|
||||
}
|
||||
|
||||
va_start(var, num_valuators);
|
||||
for (i = 0; i < num_valuators; i++)
|
||||
valuators[i] = va_arg(var, int);
|
||||
va_end(var);
|
||||
|
||||
xf86PostMotionEventP(device, is_absolute, first_valuator, num_valuators, valuators);
|
||||
}
|
||||
|
||||
_X_EXPORT void
|
||||
xf86PostMotionEventP(DeviceIntPtr device,
|
||||
int is_absolute,
|
||||
int first_valuator,
|
||||
int num_valuators,
|
||||
int *valuators)
|
||||
{
|
||||
int i = 0, nevents = 0;
|
||||
int dx, dy;
|
||||
Bool drag = xf86SendDragEvents(device);
|
||||
xEvent *xE = NULL;
|
||||
int index;
|
||||
int flags = 0;
|
||||
|
||||
if (is_absolute)
|
||||
flags = POINTER_ABSOLUTE;
|
||||
else
|
||||
flags = POINTER_RELATIVE | POINTER_ACCELERATE;
|
||||
|
||||
#if XFreeXDGA
|
||||
if (first_valuator == 0 && num_valuators >= 2) {
|
||||
if (miPointerGetScreen(inputInfo.pointer)) {
|
||||
|
@ -493,7 +516,7 @@ xf86PostMotionEvent(DeviceIntPtr device,
|
|||
dy = valuators[1];
|
||||
}
|
||||
if (DGAStealMotionEvent(index, dx, dy))
|
||||
goto out;
|
||||
return;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -515,9 +538,6 @@ xf86PostMotionEvent(DeviceIntPtr device,
|
|||
mieqEnqueue(device, xf86Events + i);
|
||||
}
|
||||
}
|
||||
|
||||
out:
|
||||
xfree(valuators);
|
||||
}
|
||||
|
||||
_X_EXPORT void
|
||||
|
|
|
@ -163,6 +163,8 @@ extern InputInfoPtr xf86InputDevs;
|
|||
void InitExtInput(void);
|
||||
void xf86PostMotionEvent(DeviceIntPtr device, int is_absolute,
|
||||
int first_valuator, int num_valuators, ...);
|
||||
void xf86PostMotionEventP(DeviceIntPtr device, int is_absolute,
|
||||
int first_valuator, int num_valuators, int *valuators);
|
||||
void xf86PostProximityEvent(DeviceIntPtr device, int is_in,
|
||||
int first_valuator, int num_valuators, ...);
|
||||
void xf86PostButtonEvent(DeviceIntPtr device, int is_absolute, int button,
|
||||
|
|
|
@ -979,6 +979,9 @@ xf86XVEnlistPortInWindow(WindowPtr pWin, XvPortRecPrivatePtr portPriv)
|
|||
winPriv->next = PrivRoot;
|
||||
pWin->devPrivates[XF86XVWindowIndex].ptr = (pointer)winPriv;
|
||||
}
|
||||
|
||||
portPriv->pDraw = (DrawablePtr)pWin;
|
||||
|
||||
return Success;
|
||||
}
|
||||
|
||||
|
@ -1375,7 +1378,6 @@ xf86XVPutVideo(
|
|||
result = xf86XVEnlistPortInWindow((WindowPtr)pDraw, portPriv);
|
||||
if(result != Success) return result;
|
||||
|
||||
portPriv->pDraw = pDraw;
|
||||
portPriv->type = XvInputMask;
|
||||
|
||||
/* save a copy of these parameters */
|
||||
|
@ -1479,7 +1481,6 @@ xf86XVPutStill(
|
|||
|
||||
xf86XVEnlistPortInWindow((WindowPtr)pDraw, portPriv);
|
||||
portPriv->isOn = XV_ON;
|
||||
portPriv->pDraw = pDraw;
|
||||
portPriv->drw_x = drw_x; portPriv->drw_y = drw_y;
|
||||
portPriv->drw_w = drw_w; portPriv->drw_h = drw_h;
|
||||
portPriv->type = 0; /* no mask means it's transient and should
|
||||
|
@ -1529,7 +1530,6 @@ xf86XVGetVideo(
|
|||
result = xf86XVEnlistPortInWindow((WindowPtr)pDraw, portPriv);
|
||||
if(result != Success) return result;
|
||||
|
||||
portPriv->pDraw = pDraw;
|
||||
portPriv->type = XvOutputMask;
|
||||
|
||||
/* save a copy of these parameters */
|
||||
|
@ -1784,7 +1784,6 @@ xf86XVPutImage(
|
|||
(portPriv->AdaptorRec->flags & VIDEO_OVERLAID_IMAGES)) {
|
||||
|
||||
portPriv->isOn = XV_ON;
|
||||
portPriv->pDraw = pDraw;
|
||||
portPriv->drw_x = drw_x; portPriv->drw_y = drw_y;
|
||||
portPriv->drw_w = drw_w; portPriv->drw_h = drw_h;
|
||||
portPriv->type = 0; /* no mask means it's transient and should
|
||||
|
@ -1876,42 +1875,35 @@ xf86XVFillKeyHelperDrawable (DrawablePtr pDraw, CARD32 key, RegionPtr clipboxes)
|
|||
_X_EXPORT void
|
||||
xf86XVFillKeyHelper (ScreenPtr pScreen, CARD32 key, RegionPtr clipboxes)
|
||||
{
|
||||
XF86XVScreenPtr ScreenPriv = GET_XF86XV_SCREEN(pScreen);
|
||||
DrawablePtr root = &WindowTable[pScreen->myNum]->drawable;
|
||||
XID pval[2];
|
||||
BoxPtr pbox = REGION_RECTS(clipboxes);
|
||||
int i, nbox = REGION_NUM_RECTS(clipboxes);
|
||||
xRectangle *rects;
|
||||
GCPtr gc;
|
||||
|
||||
if(!xf86Screens[pScreen->myNum]->vtSema) return;
|
||||
|
||||
if(!ScreenPriv->videoGC) {
|
||||
int status;
|
||||
pval[0] = key;
|
||||
pval[1] = IncludeInferiors;
|
||||
ScreenPriv->videoGC = CreateGC(root, GCForeground | GCSubwindowMode,
|
||||
pval, &status);
|
||||
if(!ScreenPriv->videoGC) return;
|
||||
ValidateGC(root, ScreenPriv->videoGC);
|
||||
} else if (key != ScreenPriv->videoGC->fgPixel){
|
||||
pval[0] = key;
|
||||
ChangeGC(ScreenPriv->videoGC, GCForeground, pval);
|
||||
ValidateGC(root, ScreenPriv->videoGC);
|
||||
}
|
||||
gc = GetScratchGC(root->depth, pScreen);
|
||||
pval[0] = key;
|
||||
pval[1] = IncludeInferiors;
|
||||
(void) ChangeGC(gc, GCForeground|GCSubwindowMode, pval);
|
||||
ValidateGC(root, gc);
|
||||
|
||||
rects = ALLOCATE_LOCAL(nbox * sizeof(xRectangle));
|
||||
rects = xalloc (nbox * sizeof(xRectangle));
|
||||
|
||||
for(i = 0; i < nbox; i++, pbox++) {
|
||||
for(i = 0; i < nbox; i++, pbox++)
|
||||
{
|
||||
rects[i].x = pbox->x1;
|
||||
rects[i].y = pbox->y1;
|
||||
rects[i].width = pbox->x2 - pbox->x1;
|
||||
rects[i].height = pbox->y2 - pbox->y1;
|
||||
}
|
||||
|
||||
(*ScreenPriv->videoGC->ops->PolyFillRect)(
|
||||
root, ScreenPriv->videoGC, nbox, rects);
|
||||
|
||||
DEALLOCATE_LOCAL(rects);
|
||||
|
||||
(*gc->ops->PolyFillRect)(root, gc, nbox, rects);
|
||||
|
||||
xfree (rects);
|
||||
FreeScratchGC (gc);
|
||||
}
|
||||
|
||||
/* xf86XVClipVideoHelper -
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
sdk_HEADERS = edid.h vdif.h xf86DDC.h
|
||||
sdk_HEADERS = edid.h xf86DDC.h
|
||||
|
||||
noinst_LIBRARIES = libddc.a
|
||||
|
||||
libddc_a_SOURCES = xf86DDC.c edid.c interpret_edid.c print_edid.c \
|
||||
interpret_vdif.c print_vdif.c ddcProperty.c
|
||||
ddcProperty.c
|
||||
|
||||
INCLUDES = $(XORG_INCS) -I$(srcdir)/../i2c
|
||||
|
||||
|
|
|
@ -35,7 +35,6 @@
|
|||
|
||||
#define EDID1_ATOM_NAME "XFree86_DDC_EDID1_RAWDATA"
|
||||
#define EDID2_ATOM_NAME "XFree86_DDC_EDID2_RAWDATA"
|
||||
#define VDIF_ATOM_NAME "XFree86_DDC_VDIF_RAWDATA"
|
||||
|
||||
static void
|
||||
addRootWindowProperties(ScrnInfoPtr pScrn, xf86MonPtr DDC)
|
||||
|
@ -103,16 +102,6 @@ addRootWindowProperties(ScrnInfoPtr pScrn, xf86MonPtr DDC)
|
|||
xf86RegisterRootWindowProperty(scrnIndex, EDID2Atom, XA_INTEGER, 8,
|
||||
256, (unsigned char *)EDID2rawdata);
|
||||
}
|
||||
|
||||
#if 0
|
||||
if (DDC->vdif) {
|
||||
#define VDIF_DUMMY_STRING "setting dummy VDIF property - please insert correct values\n"
|
||||
|
||||
VDIFAtom = MakeAtom(VDIF_ATOM_NAME, sizeof(VDIF_ATOM_NAME), TRUE);
|
||||
xf86RegisterRootWindowProperty(scrnIndex, VDIFAtom, XA_STRING, 8,
|
||||
strlen(VDIF_DUMMY_STRING), VDIF_DUMMY_STRING);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
Bool
|
||||
|
|
|
@ -12,8 +12,6 @@
|
|||
#ifndef _EDID_H_
|
||||
#define _EDID_H_
|
||||
|
||||
#include "vdif.h"
|
||||
|
||||
/* read complete EDID record */
|
||||
#define EDID1_LEN 128
|
||||
#define BITS_PER_BYTE 9
|
||||
|
@ -453,7 +451,7 @@ typedef struct {
|
|||
struct established_timings timings1;
|
||||
struct std_timings timings2[8];
|
||||
struct detailed_monitor_section det_mon[4];
|
||||
xf86vdifPtr vdif;
|
||||
void *vdif; /* unused */
|
||||
int no_sections;
|
||||
Uchar *rawData;
|
||||
} xf86Monitor, *xf86MonPtr;
|
||||
|
|
|
@ -1,132 +0,0 @@
|
|||
|
||||
#ifdef HAVE_XORG_CONFIG_H
|
||||
#include <xorg-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/Xarch.h>
|
||||
#include "xf86DDC.h"
|
||||
#include "vdif.h"
|
||||
|
||||
static xf86VdifLimitsPtr* get_limits(CARD8 *c);
|
||||
static xf86VdifGammaPtr* get_gamma(CARD8 *c);
|
||||
static xf86VdifTimingPtr* get_timings(CARD8 *c);
|
||||
#if X_BYTE_ORDER == X_BIG_ENDIAN
|
||||
static CARD32 swap_byte_order(CARD32 c);
|
||||
#endif
|
||||
|
||||
xf86vdifPtr
|
||||
xf86InterpretVdif(CARD8 *c)
|
||||
{
|
||||
xf86VdifPtr p = (xf86VdifPtr)c;
|
||||
xf86vdifPtr vdif;
|
||||
int i;
|
||||
#if X_BYTE_ORDER == X_BIG_ENDIAN
|
||||
int length;
|
||||
#endif
|
||||
unsigned long l = 0;
|
||||
|
||||
if (c == NULL) return NULL;
|
||||
#if X_BYTE_ORDER == X_BIG_ENDIAN
|
||||
length = swap_byte_order(p->FileLength);
|
||||
for (i = 0; i < (length >>2); i++)
|
||||
((CARD32*)c)[i] = swap_byte_order(((CARD32*)c)[i]) ;
|
||||
#endif
|
||||
if (p->VDIFId[0] != 'V' || p->VDIFId[1] != 'D' || p->VDIFId[2] != 'I'
|
||||
|| p->VDIFId[3] != 'F') return NULL;
|
||||
for ( i = 12; i < p->FileLength; i++)
|
||||
l += c[i];
|
||||
if ( l != p->Checksum) return NULL;
|
||||
vdif = xalloc(sizeof(xf86vdif));
|
||||
vdif->vdif = p;
|
||||
vdif->limits = get_limits(c);
|
||||
vdif->timings = get_timings(c);
|
||||
vdif->gamma = get_gamma(c);
|
||||
vdif->strings = VDIF_STRING(((xf86VdifPtr)c),0);
|
||||
xfree(c);
|
||||
return vdif;
|
||||
}
|
||||
|
||||
static xf86VdifLimitsPtr*
|
||||
get_limits(CARD8 *c)
|
||||
{
|
||||
int num, i, j;
|
||||
xf86VdifLimitsPtr *pp;
|
||||
xf86VdifLimitsPtr p;
|
||||
|
||||
num = ((xf86VdifPtr)c)->NumberOperationalLimits;
|
||||
pp = xalloc(sizeof(xf86VdifLimitsPtr) * (num+1));
|
||||
p = VDIF_OPERATIONAL_LIMITS(((xf86VdifPtr)c));
|
||||
j = 0;
|
||||
for ( i = 0; i<num; i++) {
|
||||
if (p->Header.ScnTag == VDIF_OPERATIONAL_LIMITS_TAG)
|
||||
pp[j++] = p;
|
||||
VDIF_NEXT_OPERATIONAL_LIMITS(p);
|
||||
}
|
||||
pp[j] = NULL;
|
||||
return pp;
|
||||
}
|
||||
|
||||
static xf86VdifGammaPtr*
|
||||
get_gamma(CARD8 *c)
|
||||
{
|
||||
int num, i, j;
|
||||
xf86VdifGammaPtr *pp;
|
||||
xf86VdifGammaPtr p;
|
||||
|
||||
num = ((xf86VdifPtr)c)->NumberOptions;
|
||||
pp = xalloc(sizeof(xf86VdifGammaPtr) * (num+1));
|
||||
p = (xf86VdifGammaPtr)VDIF_OPTIONS(((xf86VdifPtr)c));
|
||||
j = 0;
|
||||
for ( i = 0; i<num; i++)
|
||||
{
|
||||
if (p->Header.ScnTag == VDIF_GAMMA_TABLE_TAG)
|
||||
pp[j++] = p;
|
||||
VDIF_NEXT_OPTIONS(p);
|
||||
}
|
||||
pp[j] = NULL;
|
||||
return pp;
|
||||
}
|
||||
|
||||
static xf86VdifTimingPtr*
|
||||
get_timings(CARD8 *c)
|
||||
{
|
||||
int num, num_limits;
|
||||
int i,j,k;
|
||||
xf86VdifLimitsPtr lp;
|
||||
xf86VdifTimingPtr *pp;
|
||||
xf86VdifTimingPtr p;
|
||||
|
||||
num = ((xf86VdifPtr)c)->NumberOperationalLimits;
|
||||
lp = VDIF_OPERATIONAL_LIMITS(((xf86VdifPtr)c));
|
||||
num_limits = 0;
|
||||
for (i = 0; i < num; i++) {
|
||||
if (lp->Header.ScnTag == VDIF_OPERATIONAL_LIMITS_TAG)
|
||||
num_limits += lp->NumberPreadjustedTimings;
|
||||
VDIF_NEXT_OPERATIONAL_LIMITS(lp);
|
||||
}
|
||||
pp = xalloc(sizeof(xf86VdifTimingPtr)
|
||||
* (num_limits+1));
|
||||
j = 0;
|
||||
lp = VDIF_OPERATIONAL_LIMITS(((xf86VdifPtr) c));
|
||||
for (i = 0; i < num; i++) {
|
||||
p = VDIF_PREADJUSTED_TIMING(lp);
|
||||
for (k = 0; k < lp->NumberPreadjustedTimings; k++) {
|
||||
if (p->Header.ScnTag == VDIF_PREADJUSTED_TIMING_TAG)
|
||||
pp[j++] = p;
|
||||
VDIF_NEXT_PREADJUSTED_TIMING(p);
|
||||
}
|
||||
VDIF_NEXT_OPERATIONAL_LIMITS(lp);
|
||||
}
|
||||
pp[j] = NULL;
|
||||
return pp;
|
||||
}
|
||||
|
||||
#if X_BYTE_ORDER == X_BIG_ENDIAN
|
||||
static CARD32
|
||||
swap_byte_order(CARD32 c)
|
||||
{
|
||||
return ((c & 0xFF000000) >> 24) | ((c & 0xFF0000) >> 8)
|
||||
| ((c & 0xFF00) << 8) | ((c & 0xFF) << 24);
|
||||
}
|
||||
|
||||
#endif
|
|
@ -1,225 +0,0 @@
|
|||
|
||||
#ifdef HAVE_XORG_CONFIG_H
|
||||
#include <xorg-config.h>
|
||||
#endif
|
||||
|
||||
#include "vdif.h"
|
||||
#include "misc.h"
|
||||
#include "xf86DDC.h"
|
||||
|
||||
static void print_vdif(xf86VdifPtr l, char *s);
|
||||
static void print_timings(xf86VdifTimingPtr *pt);
|
||||
static void print_limits(xf86VdifLimitsPtr *pl);
|
||||
static void print_gamma(xf86VdifGammaPtr *pg);
|
||||
static void print_type(CARD8 c);
|
||||
static void print_polarity(CARD8 c);
|
||||
|
||||
void
|
||||
xf86print_vdif(xf86vdifPtr v)
|
||||
{
|
||||
print_vdif(v->vdif,v->strings);
|
||||
print_limits(v->limits);
|
||||
print_timings(v->timings);
|
||||
print_gamma(v->gamma);
|
||||
}
|
||||
|
||||
static void
|
||||
print_vdif(xf86VdifPtr l, char *s)
|
||||
{
|
||||
ErrorF("Version %i.%i",l->VDIFVersion,l->VDIFRevision);
|
||||
ErrorF(" Date: %i/%i/%i, Manufactured: %i/%i/%i\n",l->Date[0],
|
||||
l->Date[1],l->Date[2],l->DateManufactured[0],
|
||||
l->DateManufactured[1],l->DateManufactured[2]);
|
||||
ErrorF("File Revision: %i",l->FileRevision);
|
||||
ErrorF("Manufacturer: %s\n",s + l->Manufacturer);
|
||||
ErrorF("ModelNumber: %s\n",s + l->ModelNumber);
|
||||
ErrorF("VDIFIndex: %s\n",s +l->MinVDIFIndex);
|
||||
ErrorF("Version: %s\n",s + l->Version);
|
||||
ErrorF("SerialNumber %s\n",s + l->SerialNumber);
|
||||
ErrorF("MonitorType: ");
|
||||
switch (l->MonitorType) {
|
||||
case VDIF_MONITOR_MONOCHROME:
|
||||
ErrorF("Mono\n");
|
||||
break;
|
||||
case VDIF_MONITOR_COLOR:
|
||||
ErrorF("Color\n");
|
||||
break;
|
||||
}
|
||||
ErrorF("CRT Size: %i inches\n",l->CRTSize);
|
||||
switch (l->MonitorType) {
|
||||
case VDIF_MONITOR_MONOCHROME:
|
||||
ErrorF("Border: %i percent\n",
|
||||
l->BorderRed);
|
||||
ErrorF("Phosphor Decay: 1: %i,",l->RedPhosphorDecay);
|
||||
if (l->GreenPhosphorDecay !=0)
|
||||
ErrorF(" 2: %i,",l->GreenPhosphorDecay);
|
||||
if (l->BluePhosphorDecay !=0)
|
||||
ErrorF(" 3: %i",l->BluePhosphorDecay);
|
||||
ErrorF(" ms\n");
|
||||
if (l->RedChromaticity_x)
|
||||
ErrorF("Chromaticity: 1: x:%f, y:%f; ",
|
||||
l->RedChromaticity_x/1000.0,l->RedChromaticity_y/1000.0);
|
||||
if (l->GreenChromaticity_x)
|
||||
ErrorF("Chromaticity: 2: x:%f, y:%f; ",
|
||||
l->GreenChromaticity_x/1000.0,l->GreenChromaticity_y/1000.0);
|
||||
if (l->BlueChromaticity_x)
|
||||
ErrorF("Chromaticity: 3: x:%f, y:%f ",
|
||||
l->BlueChromaticity_x/1000.0,l->BlueChromaticity_y/1000.0);
|
||||
ErrorF("\n");
|
||||
ErrorF("Gamma: %f\n",l->RedGamma/1000.0);
|
||||
break;
|
||||
case VDIF_MONITOR_COLOR:
|
||||
ErrorF("Border: Red: %i Green: %i Blue: %i percent\n",
|
||||
l->BorderRed,l->BorderGreen,l->BorderBlue);
|
||||
ErrorF("Phosphor Decay: Red: %i, Green: %i, Blue: %i ms\n",
|
||||
l->RedPhosphorDecay,l->GreenPhosphorDecay,l->BluePhosphorDecay);
|
||||
ErrorF("Chromaticity: Red: x:%f, y:%f; Green: x:%f, y:%f; "
|
||||
"Blue: x:%f, y:%f\n",
|
||||
l->RedChromaticity_x/1000.0,l->RedChromaticity_y/1000.0,
|
||||
l->GreenChromaticity_x/1000.0,l->GreenChromaticity_y/1000.0,
|
||||
l->BlueChromaticity_x/1000.0,l->BlueChromaticity_y/1000.0);
|
||||
ErrorF("Gamma: Red:%f, Green:%f, Blue:%f\n",l->RedGamma/1000.0,
|
||||
l->GreenGamma/1000.0,l->BlueGamma/1000.0);
|
||||
break;
|
||||
}
|
||||
ErrorF("White Point: x: %f y: %f Y: %f\n",l->WhitePoint_x/1000.0,
|
||||
l->WhitePoint_y/1000.0,l->WhitePoint_Y/1000.0);
|
||||
}
|
||||
|
||||
static void
|
||||
print_limits(xf86VdifLimitsPtr *pl)
|
||||
{
|
||||
int i = 0;
|
||||
xf86VdifLimitsPtr l;
|
||||
|
||||
while((l = pl[i]) != NULL) {
|
||||
ErrorF("Max display resolution: %i x %i pixel\n",l->MaxHorPixel,
|
||||
l->MaxVerPixel);
|
||||
ErrorF("Size of active area: %i x %i millimeters\n",l->MaxHorActiveLength,
|
||||
l->MaxVerActiveHeight);
|
||||
ErrorF("Video Type: ");
|
||||
print_type(l->VideoType);
|
||||
ErrorF("Sync Type: ");
|
||||
print_type(l->SyncType);
|
||||
ErrorF("Sync Configuration ");
|
||||
switch (l->SyncConfiguration) {
|
||||
case VDIF_SYNC_SEPARATE:
|
||||
ErrorF("separate\n");
|
||||
break;
|
||||
case VDIF_SYNC_C:
|
||||
ErrorF("composite C\n");
|
||||
break;
|
||||
case VDIF_SYNC_CP:
|
||||
ErrorF("composite CP\n");
|
||||
break;
|
||||
case VDIF_SYNC_G:
|
||||
ErrorF("composite G\n");
|
||||
break;
|
||||
case VDIF_SYNC_GP:
|
||||
ErrorF("composite GP\n");
|
||||
break;
|
||||
case VDIF_SYNC_OTHER:
|
||||
ErrorF("other\n");
|
||||
break;
|
||||
}
|
||||
ErrorF("Termination Resistance: %i\n",l->TerminationResistance);
|
||||
ErrorF("Levels: white: %i, black: %i, blank: %i, sync: %i mV\n",
|
||||
l->WhiteLevel,l->BlackLevel,l->BlankLevel,l->SyncLevel);
|
||||
ErrorF("Max. Pixel Clock: %f MHz\n",l->MaxPixelClock/1000.0);
|
||||
ErrorF("Freq. Range: Hor.: %f - %f kHz, Ver.: %f - %f Hz\n",
|
||||
l->MaxHorFrequency/1000.0,l->MinHorFrequency/1000.0,
|
||||
l->MaxVerFrequency/1000.0,l->MinVerFrequency/1000.0);
|
||||
ErrorF("Retrace time: Hor: %f us, Ver: %f ms\n",l->MinHorRetrace/1000.0,
|
||||
l->MinVerRetrace/1000.0);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
print_timings(xf86VdifTimingPtr *pt)
|
||||
{
|
||||
int i = 0;
|
||||
xf86VdifTimingPtr t;
|
||||
|
||||
while((t = pt[i]) != NULL) {
|
||||
ErrorF("SVGA / SVPMI mode number: %i\n",t->PreadjustedTimingName);
|
||||
ErrorF("Mode %i x %i\n",t->HorPixel,t->VerPixel);
|
||||
ErrorF("Size: %i x %i mm\n",t->HorAddrLength,t->VerAddrHeight);
|
||||
ErrorF("Ratios: %i/%i\n",t->PixelWidthRatio,t->PixelHeightRatio);
|
||||
ErrorF("Character width: %i",t->CharacterWidth);
|
||||
ErrorF("Clock: %f MHz HFreq.: %f kHz, VFreq: %f Hz\n",t->PixelClock/1000.0,
|
||||
t->HorFrequency/1000.0,t->VerFrequency/1000.0);
|
||||
ErrorF("Htotal: %f us, Vtotal %f ms\n", t->HorTotalTime/1000.0,
|
||||
t->VerTotalTime/1000.0);
|
||||
ErrorF("HDisp: %f, HBlankStart: %f, HBlankLength: %f, "
|
||||
"HSyncStart: %f HSyncEnd: %f us\n",t->HorAddrTime/1000.0,
|
||||
t->HorBlankStart/1000.0,t->HorBlankTime/1000.0,
|
||||
t->HorSyncStart/1000.0,t->HorSyncTime/1000.0);
|
||||
ErrorF("VDisp: %f, VBlankStart: %f, VBlankLength: %f, "
|
||||
"VSyncStart: %f VSyncEnd: %f us\n",t->VerAddrTime/1000.0,
|
||||
t->VerBlankStart/1000.0,t->VerBlankTime/1000.0,
|
||||
t->VerSyncStart/1000.0,t->VerSyncTime/1000.0);
|
||||
ErrorF("Scan Type: ");
|
||||
switch (t->ScanType) {
|
||||
case VDIF_SCAN_INTERLACED:
|
||||
ErrorF("interlaced ");
|
||||
break;
|
||||
case VDIF_SCAN_NONINTERLACED:
|
||||
ErrorF("non interlaced ");
|
||||
break;
|
||||
case VDIF_SCAN_OTHER:
|
||||
ErrorF("other ");
|
||||
break;
|
||||
}
|
||||
ErrorF("Polarity: H: ");
|
||||
print_polarity(t->HorSyncPolarity);
|
||||
ErrorF("V: ");
|
||||
print_polarity(t->VerSyncPolarity);
|
||||
ErrorF("\n");
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
print_gamma(xf86VdifGammaPtr *pg)
|
||||
{
|
||||
int i = 0;
|
||||
xf86VdifGammaPtr g;
|
||||
|
||||
while((g = pg[i]) != NULL) {
|
||||
ErrorF("Gamma Table Entries: %i\n",g->GammaTableEntries);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
print_type(CARD8 c)
|
||||
{
|
||||
switch (c) {
|
||||
case VDIF_VIDEO_TTL :
|
||||
ErrorF("TTL\n");
|
||||
break;
|
||||
case VDIF_VIDEO_ANALOG :
|
||||
ErrorF("Analog\n");
|
||||
break;
|
||||
case VDIF_VIDEO_ECL:
|
||||
ErrorF("ECL\n");
|
||||
break;
|
||||
case VDIF_VIDEO_DECL:
|
||||
ErrorF("DECL\n");
|
||||
break;
|
||||
case VDIF_VIDEO_OTHER:
|
||||
ErrorF("other\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
print_polarity(CARD8 c)
|
||||
{
|
||||
switch (c) {
|
||||
case VDIF_POLARITY_NEGATIVE:
|
||||
ErrorF(" Neg.");
|
||||
break;
|
||||
case VDIF_POLARITY_POSITIVE:
|
||||
ErrorF(" Pos.");
|
||||
break;
|
||||
}
|
||||
}
|
|
@ -1,174 +0,0 @@
|
|||
|
||||
#ifndef _VDIF_H
|
||||
#define _VDIF_H
|
||||
|
||||
#define VDIF_MONITOR_MONOCHROME 0
|
||||
#define VDIF_MONITOR_COLOR 1
|
||||
#define VDIF_VIDEO_TTL 0
|
||||
#define VDIF_VIDEO_ANALOG 1
|
||||
#define VDIF_VIDEO_ECL 2
|
||||
#define VDIF_VIDEO_DECL 3
|
||||
#define VDIF_VIDEO_OTHER 4
|
||||
#define VDIF_SYNC_SEPARATE 0
|
||||
#define VDIF_SYNC_C 1
|
||||
#define VDIF_SYNC_CP 2
|
||||
#define VDIF_SYNC_G 3
|
||||
#define VDIF_SYNC_GP 4
|
||||
#define VDIF_SYNC_OTHER 5
|
||||
#define VDIF_SCAN_NONINTERLACED 0
|
||||
#define VDIF_SCAN_INTERLACED 1
|
||||
#define VDIF_SCAN_OTHER 2
|
||||
#define VDIF_POLARITY_NEGATIVE 0
|
||||
#define VDIF_POLARITY_POSITIVE 1
|
||||
|
||||
#include <X11/Xmd.h>
|
||||
|
||||
#undef CARD32
|
||||
#define CARD32 unsigned int /* ... on all supported platforms */
|
||||
|
||||
typedef struct _VDIF { /* Monitor Description: */
|
||||
CARD8 VDIFId[4]; /* alway "VDIF" */
|
||||
CARD32 FileLength; /* lenght of the whole file */
|
||||
CARD32 Checksum; /* sum of all bytes in the file after*/
|
||||
/* this field */
|
||||
CARD16 VDIFVersion; /* structure version number */
|
||||
CARD16 VDIFRevision; /* structure revision number */
|
||||
CARD16 Date[3]; /* file date Year/Month/Day */
|
||||
CARD16 DateManufactured[3]; /* date Year/Month/Day */
|
||||
CARD32 FileRevision; /* file revision string */
|
||||
CARD32 Manufacturer; /* ASCII ID of the manufacturer */
|
||||
CARD32 ModelNumber; /* ASCII ID of the model */
|
||||
CARD32 MinVDIFIndex; /* ASCII ID of Minimum VDIF index */
|
||||
CARD32 Version; /* ASCII ID of the model version */
|
||||
CARD32 SerialNumber; /* ASCII ID of the serial number */
|
||||
CARD8 MonitorType; /* Monochrome or Color */
|
||||
CARD8 CRTSize; /* inches */
|
||||
CARD8 BorderRed; /* percent */
|
||||
CARD8 BorderGreen; /* percent */
|
||||
CARD8 BorderBlue; /* percent */
|
||||
CARD8 Reserved1; /* padding */
|
||||
CARD16 Reserved2; /* padding */
|
||||
CARD32 RedPhosphorDecay; /* microseconds */
|
||||
CARD32 GreenPhosphorDecay; /* microseconds */
|
||||
CARD32 BluePhosphorDecay; /* microseconds */
|
||||
CARD16 WhitePoint_x; /* WhitePoint in CIExyY (scale 1000) */
|
||||
CARD16 WhitePoint_y;
|
||||
CARD16 WhitePoint_Y;
|
||||
CARD16 RedChromaticity_x; /* Red chromaticity in x,y */
|
||||
CARD16 RedChromaticity_y;
|
||||
CARD16 GreenChromaticity_x; /* Green chromaticity in x,y */
|
||||
CARD16 GreenChromaticity_y;
|
||||
CARD16 BlueChromaticity_x; /* Blue chromaticity in x,y */
|
||||
CARD16 BlueChromaticity_y;
|
||||
CARD16 RedGamma; /* Gamme curve exponent (scale 1000) */
|
||||
CARD16 GreenGamma;
|
||||
CARD16 BlueGamma;
|
||||
CARD32 NumberOperationalLimits;
|
||||
CARD32 OffsetOperationalLimits;
|
||||
CARD32 NumberOptions; /* optinal sections (gamma table) */
|
||||
CARD32 OffsetOptions;
|
||||
CARD32 OffsetStringTable;
|
||||
} xf86VdifRec, *xf86VdifPtr;
|
||||
|
||||
typedef enum { /* Tags for section identification */
|
||||
VDIF_OPERATIONAL_LIMITS_TAG = 1,
|
||||
VDIF_PREADJUSTED_TIMING_TAG,
|
||||
VDIF_GAMMA_TABLE_TAG
|
||||
} VDIFScnTag;
|
||||
|
||||
typedef struct _VDIFScnHdr { /* Generic Section Header: */
|
||||
CARD32 ScnLength; /* lenght of section */
|
||||
CARD32 ScnTag; /* tag for section identification */
|
||||
} VDIFScnHdrRec, *VDIFScnHdrPtr;
|
||||
|
||||
typedef struct _VDIFLimits { /* Operational Limits: */
|
||||
VDIFScnHdrRec Header; /* common section info */
|
||||
CARD16 MaxHorPixel; /* pixels */
|
||||
CARD16 MaxVerPixel; /* lines */
|
||||
CARD16 MaxHorActiveLength; /* millimeters */
|
||||
CARD16 MaxVerActiveHeight; /* millimeters */
|
||||
CARD8 VideoType; /* TTL / Analog / ECL / DECL */
|
||||
CARD8 SyncType; /* TTL / Analog / ECL / DECL */
|
||||
CARD8 SyncConfiguration; /* separate / composite / other */
|
||||
CARD8 Reserved1; /* padding */
|
||||
CARD16 Reserved2; /* padding */
|
||||
CARD16 TerminationResistance; /* */
|
||||
CARD16 WhiteLevel; /* millivolts */
|
||||
CARD16 BlackLevel; /* millivolts */
|
||||
CARD16 BlankLevel; /* millivolts */
|
||||
CARD16 SyncLevel; /* millivolts */
|
||||
CARD32 MaxPixelClock; /* kiloHertz */
|
||||
CARD32 MinHorFrequency; /* Hertz */
|
||||
CARD32 MaxHorFrequency; /* Hertz */
|
||||
CARD32 MinVerFrequency; /* milliHertz */
|
||||
CARD32 MaxVerFrequency; /* milliHertz */
|
||||
CARD16 MinHorRetrace; /* nanoseconds */
|
||||
CARD16 MinVerRetrace; /* microseconds */
|
||||
CARD32 NumberPreadjustedTimings;
|
||||
CARD32 OffsetNextLimits;
|
||||
} xf86VdifLimitsRec, *xf86VdifLimitsPtr;
|
||||
|
||||
typedef struct _VDIFTiming { /* Preadjusted Timing: */
|
||||
VDIFScnHdrRec Header; /* common section info */
|
||||
CARD32 PreadjustedTimingName; /* SVGA/SVPMI mode number */
|
||||
CARD16 HorPixel; /* pixels */
|
||||
CARD16 VerPixel; /* lines */
|
||||
CARD16 HorAddrLength; /* millimeters */
|
||||
CARD16 VerAddrHeight; /* millimeters */
|
||||
CARD8 PixelWidthRatio; /* gives H:V */
|
||||
CARD8 PixelHeightRatio;
|
||||
CARD8 Reserved1; /* padding */
|
||||
CARD8 ScanType; /* noninterlaced / interlaced / other*/
|
||||
CARD8 HorSyncPolarity; /* negative / positive */
|
||||
CARD8 VerSyncPolarity; /* negative / positive */
|
||||
CARD16 CharacterWidth; /* pixels */
|
||||
CARD32 PixelClock; /* kiloHertz */
|
||||
CARD32 HorFrequency; /* Hertz */
|
||||
CARD32 VerFrequency; /* milliHertz */
|
||||
CARD32 HorTotalTime; /* nanoseconds */
|
||||
CARD32 VerTotalTime; /* microseconds */
|
||||
CARD16 HorAddrTime; /* nanoseconds */
|
||||
CARD16 HorBlankStart; /* nanoseconds */
|
||||
CARD16 HorBlankTime; /* nanoseconds */
|
||||
CARD16 HorSyncStart; /* nanoseconds */
|
||||
CARD16 HorSyncTime; /* nanoseconds */
|
||||
CARD16 VerAddrTime; /* microseconds */
|
||||
CARD16 VerBlankStart; /* microseconds */
|
||||
CARD16 VerBlankTime; /* microseconds */
|
||||
CARD16 VerSyncStart; /* microseconds */
|
||||
CARD16 VerSyncTime; /* microseconds */
|
||||
} xf86VdifTimingRec, *xf86VdifTimingPtr;
|
||||
|
||||
typedef struct _VDIFGamma { /* Gamma Table: */
|
||||
VDIFScnHdrRec Header; /* common section info */
|
||||
CARD16 GammaTableEntries; /* count of grays or RGB 3-tuples */
|
||||
CARD16 Unused1;
|
||||
} xf86VdifGammaRec, *xf86VdifGammaPtr;
|
||||
|
||||
/* access macros */
|
||||
#define VDIF_OPERATIONAL_LIMITS(vdif) \
|
||||
((xf86VdifLimitsPtr)((char*)(vdif) + (vdif)->OffsetOperationalLimits))
|
||||
#define VDIF_NEXT_OPERATIONAL_LIMITS(limits) limits = \
|
||||
((xf86VdifLimitsPtr)((char*)(limits) + (limits)->OffsetNextLimits))
|
||||
#define VDIF_PREADJUSTED_TIMING(limits) \
|
||||
((xf86VdifTimingPtr)((char*)(limits) + (limits)->Header.ScnLength))
|
||||
#define VDIF_NEXT_PREADJUSTED_TIMING(timing) timing = \
|
||||
((xf86VdifTimingPtr)((char*)(timing) + (timing)->Header.ScnLength))
|
||||
#define VDIF_OPTIONS(vdif) \
|
||||
((VDIFScnHdrPtr)((char*)(vdif) + (vdif)->OffsetOptions))
|
||||
#define VDIF_NEXT_OPTIONS(options) options = \
|
||||
((xf86VdifGammaPtr)((char*)(options) + (options)->Header.ScnLength))
|
||||
#define VDIF_STRING(vdif, string) \
|
||||
((char*)((char*)vdif + vdif->OffsetStringTable + (string)))
|
||||
|
||||
typedef struct _vdif {
|
||||
xf86VdifPtr vdif;
|
||||
xf86VdifLimitsPtr *limits;
|
||||
xf86VdifTimingPtr *timings;
|
||||
xf86VdifGammaPtr *gamma;
|
||||
char * strings;
|
||||
} xf86vdif, *xf86vdifPtr;
|
||||
|
||||
#undef CARD32
|
||||
|
||||
#endif
|
|
@ -38,12 +38,6 @@ static unsigned char* EDID1Read_DDC2(
|
|||
I2CBusPtr pBus
|
||||
);
|
||||
|
||||
static unsigned char * VDIFRead(
|
||||
int scrnIndex,
|
||||
I2CBusPtr pBus,
|
||||
int start
|
||||
);
|
||||
|
||||
static unsigned char * DDCRead_DDC2(
|
||||
int scrnIndex,
|
||||
I2CBusPtr pBus,
|
||||
|
@ -138,7 +132,6 @@ xf86DoEDID_DDC2(int scrnIndex, I2CBusPtr pBus)
|
|||
{
|
||||
ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
|
||||
unsigned char *EDID_block = NULL;
|
||||
unsigned char *VDIF_Block = NULL;
|
||||
xf86MonPtr tmp = NULL;
|
||||
/* Default DDC and DDC2 to enabled. */
|
||||
Bool noddc = FALSE, noddc2 = FALSE;
|
||||
|
@ -171,11 +164,6 @@ xf86DoEDID_DDC2(int scrnIndex, I2CBusPtr pBus)
|
|||
else
|
||||
ErrorF("Sections to follow: %i\n",tmp->no_sections);
|
||||
#endif
|
||||
if (tmp) {
|
||||
VDIF_Block =
|
||||
VDIFRead(scrnIndex, pBus, EDID1_LEN * (tmp->no_sections + 1));
|
||||
tmp->vdif = xf86InterpretVdif(VDIF_Block);
|
||||
}
|
||||
|
||||
return tmp;
|
||||
}
|
||||
|
@ -253,35 +241,6 @@ EDID1Read_DDC2(int scrnIndex, I2CBusPtr pBus)
|
|||
return DDCRead_DDC2(scrnIndex, pBus, 0, EDID1_LEN);
|
||||
}
|
||||
|
||||
static unsigned char*
|
||||
VDIFRead(int scrnIndex, I2CBusPtr pBus, int start)
|
||||
{
|
||||
unsigned char * Buffer, *v_buffer = NULL, *v_bufferp = NULL;
|
||||
int i, num = 0;
|
||||
|
||||
/* read VDIF length in 64 byte blocks */
|
||||
Buffer = DDCRead_DDC2(scrnIndex, pBus,start,64);
|
||||
if (Buffer == NULL)
|
||||
return NULL;
|
||||
#ifdef DEBUG
|
||||
ErrorF("number of 64 bit blocks: %i\n",Buffer[0]);
|
||||
#endif
|
||||
if ((num = Buffer[0]) > 0)
|
||||
v_buffer = v_bufferp = xalloc(sizeof(unsigned char) * 64 * num);
|
||||
|
||||
for (i = 0; i < num; i++) {
|
||||
Buffer = DDCRead_DDC2(scrnIndex, pBus,start,64);
|
||||
if (Buffer == NULL) {
|
||||
xfree (v_buffer);
|
||||
return NULL;
|
||||
}
|
||||
memcpy(v_bufferp,Buffer,63); /* 64th byte is checksum */
|
||||
xfree(Buffer);
|
||||
v_bufferp += 63;
|
||||
}
|
||||
return v_buffer;
|
||||
}
|
||||
|
||||
static unsigned char *
|
||||
DDCRead_DDC2(int scrnIndex, I2CBusPtr pBus, int start, int len)
|
||||
{
|
||||
|
|
|
@ -43,10 +43,6 @@ extern xf86MonPtr xf86InterpretEDID(
|
|||
int screenIndex, Uchar *block
|
||||
);
|
||||
|
||||
extern xf86vdifPtr xf86InterpretVdif(
|
||||
CARD8 *c
|
||||
);
|
||||
|
||||
extern void
|
||||
xf86DDCMonitorSet(int scrnIndex, MonPtr Monitor, xf86MonPtr DDC);
|
||||
|
||||
|
@ -55,10 +51,6 @@ extern Bool xf86SetDDCproperties(
|
|||
xf86MonPtr DDC
|
||||
);
|
||||
|
||||
extern void xf86print_vdif(
|
||||
xf86vdifPtr v
|
||||
);
|
||||
|
||||
DisplayModePtr xf86DDCGetModes(int scrnIndex, xf86MonPtr DDC);
|
||||
|
||||
#endif
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1518,13 +1518,18 @@ DRIGetDrawableInfo(ScreenPtr pScreen,
|
|||
if (x1 > pScreen->width) x1 = pScreen->width;
|
||||
if (y1 > pScreen->height) y1 = pScreen->height;
|
||||
|
||||
pDRIPriv->private_buffer_rect.x1 = x0;
|
||||
pDRIPriv->private_buffer_rect.y1 = y0;
|
||||
pDRIPriv->private_buffer_rect.x2 = x1;
|
||||
pDRIPriv->private_buffer_rect.y2 = y1;
|
||||
if (y0 >= y1 || x0 >= x1) {
|
||||
*numBackClipRects = 0;
|
||||
*pBackClipRects = NULL;
|
||||
} else {
|
||||
pDRIPriv->private_buffer_rect.x1 = x0;
|
||||
pDRIPriv->private_buffer_rect.y1 = y0;
|
||||
pDRIPriv->private_buffer_rect.x2 = x1;
|
||||
pDRIPriv->private_buffer_rect.y2 = y1;
|
||||
|
||||
*numBackClipRects = 1;
|
||||
*pBackClipRects = &(pDRIPriv->private_buffer_rect);
|
||||
*numBackClipRects = 1;
|
||||
*pBackClipRects = &(pDRIPriv->private_buffer_rect);
|
||||
}
|
||||
} else {
|
||||
/* Use the frontbuffer cliprects for back buffers. */
|
||||
*numBackClipRects = 0;
|
||||
|
@ -1863,11 +1868,15 @@ DRITreeTraversal(WindowPtr pWin, pointer data)
|
|||
if(pDRIDrawablePriv) {
|
||||
ScreenPtr pScreen = pWin->drawable.pScreen;
|
||||
DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
|
||||
RegionPtr reg = (RegionPtr)data;
|
||||
|
||||
REGION_UNION(pScreen, reg, reg, &(pWin->clipList));
|
||||
if(REGION_NUM_RECTS(&(pWin->clipList)) > 0) {
|
||||
RegionPtr reg = (RegionPtr)data;
|
||||
|
||||
if(pDRIPriv->nrWindows == 1)
|
||||
REGION_UNION(pScreen, reg, reg, &(pWin->clipList));
|
||||
pDRIPriv->nrWalked++;
|
||||
}
|
||||
|
||||
if(pDRIPriv->nrWindows == pDRIPriv->nrWalked)
|
||||
return WT_STOPWALKING;
|
||||
}
|
||||
return WT_WALKCHILDREN;
|
||||
|
@ -1885,6 +1894,7 @@ DRICopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
|
|||
RegionRec reg;
|
||||
|
||||
REGION_NULL(pScreen, ®);
|
||||
pDRIPriv->nrWalked = 0;
|
||||
TraverseTree(pWin, DRITreeTraversal, (pointer)(®));
|
||||
|
||||
if(REGION_NOTEMPTY(pScreen, ®)) {
|
||||
|
|
|
@ -88,6 +88,6 @@ driSetup(pointer module, pointer opts, int *errmaj, int *errmin)
|
|||
drmSetServerInfo(&DRIDRMServerInfo);
|
||||
|
||||
/* Need a non-NULL return value to indicate success */
|
||||
return 1;
|
||||
return (pointer)1;
|
||||
}
|
||||
|
||||
|
|
|
@ -452,7 +452,7 @@ ProcXF86DRIGetDrawableInfo(
|
|||
xXF86DRIGetDrawableInfoReply rep;
|
||||
DrawablePtr pDrawable;
|
||||
int X, Y, W, H;
|
||||
drm_clip_rect_t * pClipRects;
|
||||
drm_clip_rect_t * pClipRects, *pClippedRects;
|
||||
drm_clip_rect_t * pBackClipRects;
|
||||
int backX, backY, rc;
|
||||
|
||||
|
@ -502,8 +502,35 @@ ProcXF86DRIGetDrawableInfo(
|
|||
if (rep.numBackClipRects)
|
||||
rep.length += sizeof(drm_clip_rect_t) * rep.numBackClipRects;
|
||||
|
||||
if (rep.numClipRects)
|
||||
pClippedRects = pClipRects;
|
||||
|
||||
if (rep.numClipRects) {
|
||||
/* Clip cliprects to screen dimensions (redirected windows) */
|
||||
pClippedRects = xalloc(rep.numClipRects * sizeof(drm_clip_rect_t));
|
||||
|
||||
if (pClippedRects) {
|
||||
ScreenPtr pScreen = screenInfo.screens[stuff->screen];
|
||||
int i, j;
|
||||
|
||||
for (i = 0, j = 0; i < rep.numClipRects; i++) {
|
||||
pClippedRects[j].x1 = max(pClipRects[i].x1, 0);
|
||||
pClippedRects[j].y1 = max(pClipRects[i].y1, 0);
|
||||
pClippedRects[j].x2 = min(pClipRects[i].x2, pScreen->width);
|
||||
pClippedRects[j].y2 = min(pClipRects[i].y2, pScreen->height);
|
||||
|
||||
if (pClippedRects[j].x1 < pClippedRects[j].x2 &&
|
||||
pClippedRects[j].y1 < pClippedRects[j].y2) {
|
||||
j++;
|
||||
}
|
||||
}
|
||||
|
||||
rep.numClipRects = j;
|
||||
} else {
|
||||
rep.numClipRects = 0;
|
||||
}
|
||||
|
||||
rep.length += sizeof(drm_clip_rect_t) * rep.numClipRects;
|
||||
}
|
||||
|
||||
rep.length = ((rep.length + 3) & ~3) >> 2;
|
||||
|
||||
|
@ -512,7 +539,8 @@ ProcXF86DRIGetDrawableInfo(
|
|||
if (rep.numClipRects) {
|
||||
WriteToClient(client,
|
||||
sizeof(drm_clip_rect_t) * rep.numClipRects,
|
||||
(char *)pClipRects);
|
||||
(char *)pClippedRects);
|
||||
xfree(pClippedRects);
|
||||
}
|
||||
|
||||
if (rep.numBackClipRects) {
|
||||
|
|
|
@ -96,6 +96,11 @@
|
|||
#endif
|
||||
#include "xf86DDC.h"
|
||||
#include "edid.h"
|
||||
#include "xf86Cursor.h"
|
||||
#include "xf86RamDac.h"
|
||||
#include "BT.h"
|
||||
#include "IBM.h"
|
||||
#include "TI.h"
|
||||
|
||||
#ifndef HAS_GLIBC_SIGSETJMP
|
||||
#if defined(setjmp) && defined(__GNU_LIBRARY__) && \
|
||||
|
@ -1231,8 +1236,6 @@ _X_HIDDEN void *xfree86LookupTab[] = {
|
|||
SYMFUNC(xf86DoEDID_DDC2)
|
||||
SYMFUNC(xf86InterpretEDID)
|
||||
SYMFUNC(xf86PrintEDID)
|
||||
SYMFUNC(xf86InterpretVdif)
|
||||
SYMFUNC(xf86print_vdif)
|
||||
SYMFUNC(xf86DDCMonitorSet)
|
||||
SYMFUNC(xf86SetDDCproperties)
|
||||
|
||||
|
@ -1255,4 +1258,50 @@ _X_HIDDEN void *xfree86LookupTab[] = {
|
|||
SYMFUNC(xf86I2CWriteRead)
|
||||
SYMFUNC(xf86I2CWriteVec)
|
||||
SYMFUNC(xf86I2CWriteWord)
|
||||
|
||||
/* ramdac/xf86RamDac.c */
|
||||
SYMFUNC(RamDacCreateInfoRec)
|
||||
SYMFUNC(RamDacHelperCreateInfoRec)
|
||||
SYMFUNC(RamDacDestroyInfoRec)
|
||||
SYMFUNC(RamDacHelperDestroyInfoRec)
|
||||
SYMFUNC(RamDacInit)
|
||||
SYMFUNC(RamDacHandleColormaps)
|
||||
SYMFUNC(RamDacFreeRec)
|
||||
SYMFUNC(RamDacGetHWIndex)
|
||||
SYMVAR(RamDacHWPrivateIndex)
|
||||
SYMVAR(RamDacScreenPrivateIndex)
|
||||
|
||||
/* ramdac/xf86Cursor.c */
|
||||
SYMFUNC(xf86InitCursor)
|
||||
SYMFUNC(xf86CreateCursorInfoRec)
|
||||
SYMFUNC(xf86DestroyCursorInfoRec)
|
||||
SYMFUNC(xf86ForceHWCursor)
|
||||
|
||||
/* ramdac/BT.c */
|
||||
SYMFUNC(BTramdacProbe)
|
||||
SYMFUNC(BTramdacSave)
|
||||
SYMFUNC(BTramdacRestore)
|
||||
SYMFUNC(BTramdacSetBpp)
|
||||
|
||||
/* ramdac/IBM.c */
|
||||
SYMFUNC(IBMramdacProbe)
|
||||
SYMFUNC(IBMramdacSave)
|
||||
SYMFUNC(IBMramdacRestore)
|
||||
SYMFUNC(IBMramdac526SetBpp)
|
||||
SYMFUNC(IBMramdac640SetBpp)
|
||||
SYMFUNC(IBMramdac526CalculateMNPCForClock)
|
||||
SYMFUNC(IBMramdac640CalculateMNPCForClock)
|
||||
SYMFUNC(IBMramdac526HWCursorInit)
|
||||
SYMFUNC(IBMramdac640HWCursorInit)
|
||||
SYMFUNC(IBMramdac526SetBppWeak)
|
||||
|
||||
/* ramdac/TI.c */
|
||||
SYMFUNC(TIramdacCalculateMNPForClock)
|
||||
SYMFUNC(TIramdacProbe)
|
||||
SYMFUNC(TIramdacSave)
|
||||
SYMFUNC(TIramdacRestore)
|
||||
SYMFUNC(TIramdac3026SetBpp)
|
||||
SYMFUNC(TIramdac3030SetBpp)
|
||||
SYMFUNC(TIramdacHWCursorInit)
|
||||
SYMFUNC(TIramdacLoadPalette)
|
||||
};
|
||||
|
|
|
@ -1217,8 +1217,15 @@ xf86ProbeOutputModes (ScrnInfoPtr scrn, int maxX, int maxY)
|
|||
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
|
||||
int o;
|
||||
|
||||
if (maxX == 0 || maxY == 0)
|
||||
xf86RandR12GetOriginalVirtualSize (scrn, &maxX, &maxY);
|
||||
/* When canGrow was TRUE in the initial configuration we have to
|
||||
* compare against the maximum values so that we don't drop modes.
|
||||
* When canGrow was FALSE, the maximum values would have been clamped
|
||||
* anyway.
|
||||
*/
|
||||
if (maxX == 0 || maxY == 0) {
|
||||
maxX = config->maxWidth;
|
||||
maxY = config->maxHeight;
|
||||
}
|
||||
|
||||
/* Elide duplicate modes before defaulting code uses them */
|
||||
xf86PruneDuplicateMonitorModes (scrn->monitor);
|
||||
|
|
|
@ -71,7 +71,11 @@ static Bool quirk_dt_sync_hm_vp (int scrnIndex, xf86MonPtr DDC)
|
|||
if (memcmp (DDC->vendor.name, "VSC", 4) == 0 &&
|
||||
DDC->vendor.prod_id == 58653)
|
||||
return TRUE;
|
||||
|
||||
/* Samsung SyncMaster 205BW */
|
||||
if (memcmp (DDC->vendor.name, "SAM", 4) == 0 &&
|
||||
DDC->vendor.prod_id == 541)
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
#include <xorg-config.h>
|
||||
#endif
|
||||
|
||||
#if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT)
|
||||
#if defined (SYSCONS_SUPPORT)
|
||||
#include <sys/kbio.h>
|
||||
#endif
|
||||
|
||||
|
@ -77,7 +77,7 @@ xf86OSRingBell(int loudness, int pitch, int duration)
|
|||
wsb.pitch = pitch;
|
||||
wsb.period = duration;
|
||||
wsb.volume = loudness;
|
||||
ioctl(KBD_FD(xf86Info), WSKBDIO_COMPLEXBELL,
|
||||
ioctl(xf86Info.consoleFd, WSKBDIO_COMPLEXBELL,
|
||||
&wsb);
|
||||
break;
|
||||
#endif
|
||||
|
|
|
@ -50,6 +50,11 @@
|
|||
#include <machine/mtrr.h>
|
||||
#include <machine/sysarch.h>
|
||||
#include <sys/queue.h>
|
||||
#ifdef __x86_64__
|
||||
#define i386_set_mtrr x86_64_set_mtrr
|
||||
#define i386_get_mtrr x86_64_get_mtrr
|
||||
#define i386_iopl x86_64_iopl
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(__OpenBSD__) && defined(__amd64__)
|
||||
|
|
|
@ -788,8 +788,10 @@ xf86ReadDomainMemory(PCITAG Tag, ADDRESS Base, int Len, unsigned char *Buf)
|
|||
write(fd, "1", 2);
|
||||
lseek(fd, 0, SEEK_SET);
|
||||
|
||||
len = min(Len, st.st_size);
|
||||
|
||||
/* copy the ROM until we hit Len, EOF or read error */
|
||||
for (i = 0; i < Len && read(fd, Buf, 1) > 0; Buf++, i++)
|
||||
for (; len && (size = read(fd, Buf, len)) > 0 ; Buf+=size, len-=size)
|
||||
;
|
||||
|
||||
write(fd, "0", 2);
|
||||
|
|
|
@ -117,49 +117,29 @@ xf86LinearVidMem()
|
|||
/**************************************************************************
|
||||
* I/O Permissions section
|
||||
***************************************************************************/
|
||||
mach_port_t io_port;
|
||||
|
||||
/*
|
||||
* Due to conflicts with "compiler.h", don't rely on <sys/io.h> to declare
|
||||
* this.
|
||||
*/
|
||||
extern int ioperm(unsigned long __from, unsigned long __num, int __turn_on);
|
||||
|
||||
Bool
|
||||
xf86EnableIO()
|
||||
{
|
||||
mach_port_t device;
|
||||
kern_return_t err;
|
||||
|
||||
err = get_privileged_ports(NULL, &device);
|
||||
if( err )
|
||||
{
|
||||
errno = err;
|
||||
FatalError("xf86EnableIO() can't get_privileged_ports. (%s)\n",strerror(errno));
|
||||
}
|
||||
err = device_open(device,D_READ|D_WRITE,"io",&io_port);
|
||||
mach_port_deallocate(mach_task_self(), device);
|
||||
if( err )
|
||||
{
|
||||
errno = err;
|
||||
FatalError("xf86EnableIO() can't device_open. (%s)\n",strerror(errno));
|
||||
}
|
||||
|
||||
err = i386_io_port_add(mach_thread_self (), io_port);
|
||||
if( err )
|
||||
{
|
||||
errno = err;
|
||||
FatalError("xf86EnableIO() can't i386_io_port_add.(io_port) (%s)\n",strerror(errno));
|
||||
if (ioperm(0, 0xffff, 1)) {
|
||||
FatalError("xf86EnableIO: ioperm() failed (%s)\n", strerror(errno));
|
||||
return FALSE;
|
||||
}
|
||||
ioperm(0x40,4,0); /* trap access to the timer chip */
|
||||
ioperm(0x60,4,0); /* trap access to the keyboard controller */
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
xf86DisableIO()
|
||||
{
|
||||
kern_return_t err;
|
||||
|
||||
err = i386_io_port_remove(mach_thread_self (), io_port);
|
||||
if( err )
|
||||
{
|
||||
errno = err;
|
||||
FatalError("xf86DisableIO() can't i386_io_port_remove.(io_port) (%s)\n",strerror(errno));
|
||||
}
|
||||
mach_port_deallocate(mach_task_self(), io_port);
|
||||
ioperm(0,0xffff,0);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -567,7 +567,7 @@ xf86EnableIO(void)
|
|||
#endif
|
||||
}
|
||||
close(fd);
|
||||
#elif !defined(__mc68000__) && !defined(__sparc__) && !defined(__mips__) && !defined(__sh__) && !defined(__hppa__)
|
||||
#elif !defined(__mc68000__) && !defined(__sparc__) && !defined(__mips__) && !defined(__sh__) && !defined(__hppa__) && !defined(__s390__)
|
||||
if (ioperm(0, 1024, 1) || iopl(3)) {
|
||||
if (errno == ENODEV)
|
||||
ErrorF("xf86EnableIOPorts: no I/O ports found\n");
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.\" $Xorg: Xnest.man,v 1.3 2000/08/17 19:53:28 cpqbld Exp $
|
||||
.\" Copyright (c) 1993, 1994 X Consortium
|
||||
.\"
|
||||
.\"
|
||||
.\" Permission is hereby granted, free of charge, to any person obtaining
|
||||
.\" a copy of this software and associated documentation files (the
|
||||
.\" "Software"), to deal in the Software without restriction, including
|
||||
|
@ -8,10 +8,10 @@
|
|||
.\" distribute, sublicense, and/or sell copies of the Software, and to
|
||||
.\" permit persons to whom the Software is furnished to do so, subject to
|
||||
.\" the following conditions:
|
||||
.\"
|
||||
.\"
|
||||
.\" The above copyright notice and this permission notice shall be included
|
||||
.\" in all copies or substantial portions of the Software.
|
||||
.\"
|
||||
.\"
|
||||
.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
.\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
|
@ -19,7 +19,7 @@
|
|||
.\" OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
.\" ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
.\" OTHER DEALINGS IN THE SOFTWARE.
|
||||
.\"
|
||||
.\"
|
||||
.\" Except as contained in this notice, the name of the X Consortium shall
|
||||
.\" not be used in advertising or otherwise to promote the sale, use or
|
||||
.\" other dealings in this Software without prior written authorization
|
||||
|
@ -27,238 +27,402 @@
|
|||
.\"
|
||||
.\" $XFree86: xc/programs/Xserver/hw/xnest/Xnest.man,v 1.6 2001/01/27 18:21:00 dawes Exp $
|
||||
.\"
|
||||
.TH XNEST 1 __xorgversion__
|
||||
.TH Xnest __appmansuffix__ __xorgversion__
|
||||
.SH NAME
|
||||
Xnest \- a nested X server
|
||||
.SH SYNOPSIS
|
||||
.B Xnest
|
||||
[-options]
|
||||
[
|
||||
.I options
|
||||
]
|
||||
.SH DESCRIPTION
|
||||
\fIXnest\fP is a client and a server. \fIXnest\fP is a client of the
|
||||
real server which manages windows and graphics requests on its behalf.
|
||||
\fIXnest\fP is a server to its own clients. \fIXnest\fP manages
|
||||
windows and graphics requests on their behalf. To these clients
|
||||
\fIXnest\fP appears to be a conventional server.
|
||||
.B Xnest
|
||||
is both an X client and an X server.
|
||||
.B Xnest
|
||||
is a client of the real server which manages windows and graphics requests on
|
||||
its behalf.
|
||||
.B Xnest
|
||||
is a server to its own clients.
|
||||
.B Xnest
|
||||
manages windows and graphics requests on their behalf.
|
||||
To these clients,
|
||||
.B Xnest
|
||||
appears to be a conventional server.
|
||||
.SH OPTIONS
|
||||
\fIXnest\fP supports all standard options of the sample server
|
||||
implementation. For more details, please see the manual page on your
|
||||
system for \fIXserver\fP. The following additional arguments are
|
||||
supported as well.
|
||||
.TP 4
|
||||
.B \-display \fIstring\fP
|
||||
.B Xnest
|
||||
supports all standard options of the sample server implementation.
|
||||
For more details, please see
|
||||
.BR Xserver (__appmansuffix__).
|
||||
The following additional arguments are supported as well.
|
||||
.TP
|
||||
.BI "\-display " string
|
||||
This option specifies the display name of the real server that
|
||||
\fIXnest\fP should try to connect with. If it is not provided on the
|
||||
command line \fIXnest\fP will read the \fIDISPLAY\fP environment
|
||||
variable in order to find out the same information.
|
||||
.TP 4
|
||||
.B Xnest
|
||||
should try to connect to.
|
||||
If it is not provided on the command line,
|
||||
.B Xnest
|
||||
will read the
|
||||
.I DISPLAY
|
||||
environment variable in order to find out this information.
|
||||
.TP
|
||||
.B \-sync
|
||||
This option tells \fIXnest\fP to synchronize its window and graphics
|
||||
operations with the real server. This is a useful option for
|
||||
debugging, but it will slow down the performance considerably. It
|
||||
should not be used unless absolutely necessary.
|
||||
.TP 4
|
||||
This option tells
|
||||
.B Xnest
|
||||
to synchronize its window and graphics operations with the real server.
|
||||
This is a useful option for debugging, but it will slow down
|
||||
.BR Xnest 's
|
||||
performance considerably.
|
||||
It should not be used unless absolutely necessary.
|
||||
.TP
|
||||
.B \-full
|
||||
This option tells \fIXnest\fP to utilize full regeneration of real
|
||||
server objects and reopen a new connection to the real server each
|
||||
time the nested server regenerates. The sample server implementation
|
||||
regenerates all objects in the server when the last client of this
|
||||
server terminates. When this happens, \fIXnest\fP by default
|
||||
maintains the same top level window and the same real server
|
||||
connection in each new generation. If the user selects full
|
||||
regeneration, even the top level window and the connection to the real
|
||||
server will be regenerated for each server generation.
|
||||
.TP 4
|
||||
.B \-class \fIstring\fP
|
||||
This option tells
|
||||
.B Xnest
|
||||
to utilize full regeneration of real server objects and reopen a new connection
|
||||
to the real server each time the nested server regenerates.
|
||||
The sample server implementation regenerates all objects in the server when the
|
||||
last client of this server terminates.
|
||||
When this happens,
|
||||
.B Xnest
|
||||
by default maintains the same top-level window and the same real server
|
||||
connection in each new generation.
|
||||
If the user selects full regeneration, even the top-level window and the
|
||||
connection to the real server will be regenerated for each server generation.
|
||||
.TP
|
||||
.BI "\-class " string
|
||||
This option specifies the default visual class of the nested server.
|
||||
It is similar to the \fI-cc\fP option from the set of standard options
|
||||
except that it will accept a string rather than a number for the
|
||||
visual class specification. The string must be one of the following
|
||||
six values: \fIStaticGray\fP, \fIGrayScale\fP, \fIStaticColor\fP,
|
||||
\fIPseudoColor\fP, \fITrueColor\fP, or \fIDirectColor\fP. If both,
|
||||
\fI-class\fP and \fI-cc\fP options are specified, the last instance of
|
||||
either option assumes precedence. The class of the default visual of
|
||||
the nested server need not be the same as the class of the default
|
||||
visual of the real server; although, it has to be supported by the
|
||||
real server. See \fIxdpyinfo\fP for a list of supported visual
|
||||
classes on the real server before starting \fIXnest\fP. If the user
|
||||
chooses a static class, all the colors in the default colormap will be
|
||||
preallocated. If the user chooses a dynamic class, colors in the
|
||||
default colormap will be available to individual clients for
|
||||
allocation.
|
||||
.TP 4
|
||||
.B \-depth \fIint\fP
|
||||
It is similar to the
|
||||
.B \-cc
|
||||
option from the set of standard options except that it will accept a string
|
||||
rather than a number for the visual class specification.
|
||||
The
|
||||
.I string
|
||||
must be one of the following six values:
|
||||
.BR StaticGray ,
|
||||
.BR GrayScale ,
|
||||
.BR StaticColor ,
|
||||
.BR PseudoColor ,
|
||||
.BR TrueColor ,
|
||||
or
|
||||
.BR DirectColor .
|
||||
If both the
|
||||
.B \-class
|
||||
and
|
||||
.B \-cc
|
||||
options are specified, the last instance of either option takes precedence.
|
||||
The class of the default visual of the nested server need not be the same as the
|
||||
class of the default visual of the real server, but it must be supported by the
|
||||
real server.
|
||||
Use
|
||||
.BR xdpyinfo (__appmansuffix__)
|
||||
to obtain a list of supported visual classes on the real server before starting
|
||||
.BR Xnest .
|
||||
If the user chooses a static class, all the colors in the default color map will
|
||||
be preallocated.
|
||||
If the user chooses a dynamic class, colors in the default color map will be
|
||||
available to individual clients for allocation.
|
||||
.TP
|
||||
.BI "\-depth " int
|
||||
This option specifies the default visual depth of the nested server.
|
||||
The depth of the default visual of the nested server need not be the
|
||||
same as the depth of the default visual of the real server; although,
|
||||
it has to be supported by the real server. See \fIxdpyinfo\fP for a
|
||||
list of supported visual depths on the real server before starting
|
||||
\fIXnest\fP.
|
||||
.TP 4
|
||||
The depth of the default visual of the nested server need not be the same as the
|
||||
depth of the default visual of the real server, but it must be supported by the
|
||||
real server.
|
||||
Use
|
||||
.BR xdpyinfo (__appmansuffix__)
|
||||
to obtain a list of supported visual depths on the real server before starting
|
||||
.BR Xnest .
|
||||
.TP
|
||||
.B \-sss
|
||||
This option tells \fIXnest\fP to use the software screen saver. By
|
||||
default \fIXnest\fP will use the screen saver that corresponds to the
|
||||
hardware screen saver in the real server. Of course, even this screen
|
||||
saver is software generated since \fIXnest\fP does not control any
|
||||
actual hardware. However, it is treated as a hardware screen saver
|
||||
within the sample server code.
|
||||
.TP 4
|
||||
.B \-geometry \fIWxH+X+Y\fP
|
||||
This option specifies geometry parameters for the top level
|
||||
\fIXnest\fP windows. These windows corresponds to the root windows of
|
||||
the nested server. The width and height specified with this option
|
||||
will be the maximum width and height of each top level \fIXnest\fP
|
||||
window. \fIXnest\fP will allow the user to make any top level window
|
||||
smaller, but it will not actually change the size of the nested server
|
||||
root window. As of yet, there is no mechanism within the sample
|
||||
server implementation to change the size of the root window after
|
||||
screen initialization. In order to do so, one would probably need to
|
||||
extend the X protocol. Therefore, it is not likely that this will be
|
||||
available any time soon. If this option is not specified \fIXnest\fP
|
||||
will choose width and height to be 3/4 of the dimensions of the root
|
||||
window of the real server.
|
||||
.TP 4
|
||||
.B \-bw \fIint\fP
|
||||
This option specifies the border width of the top level \fIXnest\fP
|
||||
window. The integer parameter must be a positive number. The default
|
||||
border width is 1.
|
||||
.TP 4
|
||||
.B \-name \fIstring\fP
|
||||
This option specifies the name of the top level \fIXnest\fP window.
|
||||
This option tells
|
||||
.B Xnest
|
||||
to use the software screen saver.
|
||||
By default,
|
||||
.B Xnest
|
||||
will use the screen saver that corresponds to the hardware screen saver in the
|
||||
real server.
|
||||
Of course, even this screen saver is software-generated since
|
||||
.B Xnest
|
||||
does not control any actual hardware.
|
||||
However, it is treated as a hardware screen saver within the sample server code.
|
||||
.TP
|
||||
.B \-geometry \fIW\fBx\fIH\fB+\fIX\fB+\fIY\fP
|
||||
This option specifies the geometry parameters for the top-level
|
||||
.B Xnest
|
||||
window.
|
||||
See \(lqGEOMETRY SPECIFICATIONS\(rq in
|
||||
.BR X (__miscmansuffix__)
|
||||
for a discusson of this option's syntax.
|
||||
This window corresponds to the root window of the nested server.
|
||||
The width
|
||||
.I W
|
||||
and height
|
||||
.I H
|
||||
specified with this option will be the maximum width and height of each
|
||||
top-level
|
||||
.B Xnest
|
||||
window.
|
||||
.B Xnest
|
||||
will allow the user to make any top-level window smaller, but it will not
|
||||
actually change the size of the nested server root window.
|
||||
.B Xnest
|
||||
does not yet support the RANDR extension for resizing, rotation, and reflection
|
||||
of the root window.
|
||||
If this option is not specified,
|
||||
.B Xnest
|
||||
will choose
|
||||
.I W
|
||||
and
|
||||
.I H
|
||||
to be 3/4ths the dimensions of the root window of the real server.
|
||||
.TP
|
||||
.BI "\-bw " int
|
||||
This option specifies the border width of the top-level
|
||||
.B Xnest
|
||||
window.
|
||||
The integer parameter
|
||||
.I int
|
||||
must be positive.
|
||||
The default border width is 1.
|
||||
.TP
|
||||
.BI "\-name " string
|
||||
This option specifies the name of the top-level
|
||||
.B Xnest
|
||||
window as
|
||||
.IR string .
|
||||
The default value is the program name.
|
||||
.TP 4
|
||||
.B \-scrns \fIint\fP
|
||||
This option specifies the number of screens to create in the nested
|
||||
server. For each screen, \fIXnest\fP will create a separate top level
|
||||
window. Each screen is referenced by the number after the dot in the
|
||||
client display name specification. For example, \fIxterm -display
|
||||
:1.1\fP will open an \fIxterm\fP client in the nested server with the
|
||||
display number \fI:1\fP on the second screen. The number of screens
|
||||
is limited by the hard coded constant in the server sample code which
|
||||
is usually 3.
|
||||
.TP 4
|
||||
.TP
|
||||
.BI "\-scrns " int
|
||||
This option specifies the number of screens to create in the nested server.
|
||||
For each screen,
|
||||
.B Xnest
|
||||
will create a separate top-level window.
|
||||
Each screen is referenced by the number after the dot in the client display name
|
||||
specification.
|
||||
For example,
|
||||
.B xterm \-display :1.1
|
||||
will open an
|
||||
.BR xterm (__appmansuffix__)
|
||||
client in the nested server with the display number
|
||||
.B :1
|
||||
on the second screen.
|
||||
The number of screens is limited by the hard-coded constant in the server sample
|
||||
code, which is usually 3.
|
||||
.TP
|
||||
.B \-install
|
||||
This option tells \fIXnest\fP to do its own colormap installation by
|
||||
bypassing the real window manager. For it to work properly the user
|
||||
will probably have to temporarily quit the real window manager. By
|
||||
default \fIXnest\fP will keep the nested client window whose colormap
|
||||
should be installed in the real server in the
|
||||
\fIWM\_COLORMAP\_WINDOWS\fP property of the top level \fIXnest\fP
|
||||
window. If this colormap is of the same visual type as the root
|
||||
window of the nested server, \fIXnest\fP will associate this colormap
|
||||
with the top level \fIXnest\fP window as well. Since this does not
|
||||
have to be the case, window managers should look primarily at the
|
||||
\fIWM\_COLORMAP\_WINDOWS\fP property rather than the colormap
|
||||
associated with the top level \fIXnest\fP window. Unfortunately,
|
||||
window managers are not very good at doing that yet so this option
|
||||
might come in handy.
|
||||
.TP 4
|
||||
.B \-parent \fIwindow_id\fP
|
||||
This option tells \fIXnest\fP to use the \fIwindow_id\fP as the
|
||||
root window instead of creating a window. This option is used
|
||||
by the xrx xnestplugin.
|
||||
.SH USAGE
|
||||
Starting up \fIXnest\fP is as simple as starting up \fIxclock\fP from
|
||||
a terminal emulator. If a user wishes to run \fIXnest\fP on the same
|
||||
workstation as the real server, it is important that the nested server
|
||||
is given its own listening socket address. Therefore, if there is a
|
||||
server already running on the user's workstation, \fIXnest\fP will
|
||||
have to be started up with a new display number. Since there is
|
||||
usually no more than one server running on a workstation, specifying
|
||||
\fIXnest :1\fP on the command line will be sufficient for most users.
|
||||
For each server running on the workstation the display number needs to
|
||||
be incremented by one. Thus, if you wish to start another
|
||||
\fIXnest\fP, you will need to type \fIXnest :2\fP on the command line.
|
||||
This option tells
|
||||
.B Xnest
|
||||
to do its own color map installation by bypassing the real window manager.
|
||||
For it to work properly, the user will probably have to temporarily quit the
|
||||
real window manager.
|
||||
By default,
|
||||
.B Xnest
|
||||
will keep the nested client window whose color map should be installed in the
|
||||
real server in the
|
||||
.I WM_COLORMAP_WINDOWS
|
||||
property of the top-level
|
||||
.B Xnest
|
||||
window.
|
||||
If this color map is of the same visual type as the root window of the nested
|
||||
server,
|
||||
.B Xnest
|
||||
will associate this color map with the top-level
|
||||
.B Xnest
|
||||
window as well.
|
||||
Since this does not have to be the case, window managers should look primarily
|
||||
at the
|
||||
.I WM_COLORMAP_WINDOWS
|
||||
property rather than the color map associated with the top-level
|
||||
.B Xnest
|
||||
window.
|
||||
.\" Is the following still true? This sentence is several years old.
|
||||
Unfortunately, window managers are not very good at doing that yet so this
|
||||
option might come in handy.
|
||||
.TP
|
||||
.BI "\-parent " window_id
|
||||
This option tells
|
||||
.B Xnest
|
||||
to use
|
||||
.I window_id
|
||||
as the root window instead of creating a window.
|
||||
.\" XRX is dead, dead, dead.
|
||||
.\" This option is used by the xrx xnestplugin.
|
||||
.SH "EXTENDED DESCRIPTION"
|
||||
Starting up
|
||||
.B Xnest
|
||||
is just as simple as starting up
|
||||
.BR xclock (__appmansuffix__)
|
||||
from a terminal emulator.
|
||||
If a user wishes to run
|
||||
.B Xnest
|
||||
on the same
|
||||
workstation as the real server, it is important that the nested server is given
|
||||
its own listening socket address.
|
||||
Therefore, if there is a server already running on the user's workstation,
|
||||
.B Xnest
|
||||
will have to be started up with a new display number.
|
||||
Since there is usually no more than one server running on a workstation,
|
||||
specifying
|
||||
.RB \(oq "Xnest :1" \(cq
|
||||
on the command line will be sufficient for most users.
|
||||
For each server running on the workstation, the display number needs to be
|
||||
incremented by one.
|
||||
Thus, if you wish to start another
|
||||
.BR Xnest ,
|
||||
you will need to type
|
||||
.RB \(oq "Xnest :2" \(cq
|
||||
on the command line.
|
||||
.PP
|
||||
To run clients in the nested server each client needs to be given the
|
||||
same display number as the nested server. For example, \fIxterm
|
||||
-display :1\fP will start up an \fIxterm\fP in the first nested server
|
||||
and \fIxterm -display :2\fP will start an \fIxterm\fP in the second
|
||||
nested server from the example above. Additional clients can be
|
||||
started from these \fIxterm\fPs in each nested server.
|
||||
.SH XNEST AS A CLIENT
|
||||
\fIXnest\fP behaves and looks to the real server and other real
|
||||
clients as another real client. It is a rather demanding client,
|
||||
however, since almost any window or graphics request from a nested
|
||||
client will result in a window or graphics request from \fIXnest\fP to
|
||||
the real server. Therefore, it is desirable that \fIXnest\fP and the
|
||||
real server are on a local network, or even better, on the same
|
||||
machine. As of now, \fIXnest\fP assumes that the real server supports
|
||||
the shape extension. There is no way to turn off this assumption
|
||||
dynamically. \fIXnest\fP can be compiled without the shape extension
|
||||
built in, and in that case the real server need not support it. The
|
||||
dynamic shape extension selection support should be considered in
|
||||
further development of \fIXnest\fP.
|
||||
To run clients in the nested server, each client needs to be given the same
|
||||
display number as the nested server.
|
||||
For example,
|
||||
.RB \(oq "xterm \-display :1" \(cq
|
||||
will start up an
|
||||
.B xterm
|
||||
process in the first nested server
|
||||
and
|
||||
.RB \(oq "xterm \-display :2" \(cq
|
||||
will start an
|
||||
.B xterm
|
||||
in the second nested server from the example above.
|
||||
Additional clients can be started from these
|
||||
.BR xterm s
|
||||
in each nested server.
|
||||
.SS "Xnest as a client"
|
||||
.B Xnest
|
||||
behaves and looks to the real server and other real clients as another real
|
||||
client.
|
||||
It is a rather demanding client, however, since almost any window or graphics
|
||||
request from a nested client will result in a window or graphics request from
|
||||
.B Xnest
|
||||
to the real server.
|
||||
Therefore, it is desirable that
|
||||
.B Xnest
|
||||
and the real server are on a local network, or even better, on the same machine.
|
||||
.B Xnest
|
||||
assumes that the real server supports the SHAPE extension.
|
||||
There is no way to turn off this assumption dynamically.
|
||||
.B Xnest
|
||||
can be compiled without the SHAPE extension built in, in which case the real
|
||||
server need not support it.
|
||||
Dynamic SHAPE extension selection support may be considered in further
|
||||
development of
|
||||
.BR Xnest .
|
||||
.PP
|
||||
Since \fIXnest\fP need not use the same default visual as the the real
|
||||
server, the top level window of the \fIXnest\fP client always has its
|
||||
own colormap. This implies that other windows' colors will not be
|
||||
displayed properly while the keyboard or pointer focus is in the
|
||||
\fIXnest\fP window, unless the real server has support for more than
|
||||
one installed colormap at any time. The colormap associated with the
|
||||
top window of the \fIXnest\fP client need not be the appropriate
|
||||
colormap that the nested server wants installed in the real server.
|
||||
In the case that a nested client attempts to install a colormap of a
|
||||
different visual from the default visual of the nested server,
|
||||
\fIXnest\fP will put the top window of this nested client and all
|
||||
other top windows of the nested clients that use the same colormap
|
||||
into the \fIWM\_COLORMAP\_WINDOWS\fP property of the top level
|
||||
\fIXnest\fP window on the real server. Thus, it is important that the
|
||||
real window manager that manages the \fIXnest\fP top level window
|
||||
looks at the \fIWM\_COLORMAP\_WINDOWS\fP property rather than the
|
||||
colormap associated with the top level \fIXnest\fP window. Since most
|
||||
window managers appear to not implement this convention properly as of
|
||||
yet, \fIXnest\fP can optionally do direct installation of colormaps
|
||||
into the real server bypassing the real window manager. If the user
|
||||
chooses this option, it is usually necessary to temporarily disable
|
||||
the real window manager since it will interfere with the \fIXnest\fP
|
||||
scheme of colormap installation.
|
||||
Since
|
||||
.B Xnest
|
||||
need not use the same default visual as the the real server, the top-level
|
||||
window of the
|
||||
.B Xnest
|
||||
client always has its own color map.
|
||||
This implies that other windows' colors will not be displayed properly while the
|
||||
keyboard or pointer focus is in the
|
||||
.B Xnest
|
||||
window, unless the real server has support for more than one installed color map
|
||||
at any time.
|
||||
The color map associated with the top window of the
|
||||
.B Xnest
|
||||
client need not be the appropriate color map that the nested server wants
|
||||
installed in the real server.
|
||||
In the case that a nested client attempts to install a color map of a different
|
||||
visual from the default visual of the nested server,
|
||||
.B Xnest
|
||||
will put the top window of this nested client and all other top windows of the
|
||||
nested clients that use the same color map into the
|
||||
.I WM_COLORMAP_WINDOWS
|
||||
property of the top-level
|
||||
.B Xnest
|
||||
window on the real server.
|
||||
Thus, it is important that the real window manager that manages the
|
||||
.B Xnest
|
||||
top-level window looks at the
|
||||
.I WM_COLORMAP_WINDOWS
|
||||
property rather than the color map associated with the top-level
|
||||
.B Xnest
|
||||
window.
|
||||
Since most window managers don't yet appear to implement this convention
|
||||
properly,
|
||||
.B Xnest
|
||||
can optionally do direct installation of color maps into the real server
|
||||
bypassing the real window manager.
|
||||
If the user chooses this option, it is usually necessary to temporarily disable
|
||||
the real window manager since it will interfere with the
|
||||
.B Xnest
|
||||
scheme of color map installation.
|
||||
.PP
|
||||
Keyboard and pointer control procedures of the nested server change
|
||||
the keyboard and pointer control parameters of the real server.
|
||||
Therefore, after \fIXnest\fP is started up, it will change the
|
||||
keyboard and pointer controls of the real server to its own internal
|
||||
defaults. Perhaps there should be a command line option to tell
|
||||
\fIXnest\fP to inherit the keyboard and pointer control parameters
|
||||
from the real server rather than imposing its own. This is a future
|
||||
consideration.
|
||||
.SH XNEST AS A SERVER
|
||||
\fIXnest\fP as a server looks exactly like a real server to its own
|
||||
clients. For the clients there is no way of telling if they are
|
||||
running on a real or a nested server.
|
||||
Keyboard and pointer control procedures of the nested server change the keyboard
|
||||
and pointer control parameters of the real server.
|
||||
Therefore, after
|
||||
.B Xnest
|
||||
is started up, it will change the keyboard and pointer controls of the real
|
||||
server to its own internal defaults.
|
||||
.SS "Xnest as a server"
|
||||
.B Xnest
|
||||
as a server looks exactly like a real server to its own clients.
|
||||
For the clients, there is no way of telling if they are running on a real or a
|
||||
nested server.
|
||||
.PP
|
||||
As already mentioned, \fIXnest\fP is a very user friendly server when
|
||||
it comes to customization. \fIXnest\fP will pick up a number of
|
||||
command line arguments that can configure its default visual class and
|
||||
depth, number of screens, etc. In the future, \fIXnest\fP should read
|
||||
a customization input file to provide even greater freedom and
|
||||
simplicity in selecting the desired layout. Unfortunately, there is
|
||||
no support for backing store and save under as of yet, but this should
|
||||
also be considered in the future development of \fIXnest\fP.
|
||||
As already mentioned,
|
||||
.B Xnest
|
||||
is a very user-friendly server when it comes to customization.
|
||||
.B Xnest
|
||||
will pick up a number of command-line arguments that can configure its default
|
||||
visual class and depth, number of screens, etc.
|
||||
.PP
|
||||
The only apparent intricacy from the users' perspective about using
|
||||
\fIXnest\fP as a server is the selection of fonts. \fIXnest\fP
|
||||
manages fonts by loading them locally and then passing the font name
|
||||
to the real server and asking it to load that font remotely. This
|
||||
approach avoids the overload of sending the glyph bits across the
|
||||
network for every text operation, although it is really a bug. The
|
||||
proper implementation of fonts should be moved into the \fIos\fP
|
||||
layer. The consequence of this approach is that the user will have to
|
||||
worry about two different font paths - a local one for the nested
|
||||
server and a remote one for the real server - since \fIXnest\fP does
|
||||
not propagate its font path to the real server. The reason for this
|
||||
is because real and nested servers need not run on the same file
|
||||
system which makes the two font paths mutually incompatible. Thus, if
|
||||
there is a font in the local font path of the nested server, there is
|
||||
no guarantee that this font exists in the remote font path of the real
|
||||
server. \fIXlsfonts\fP client, if run on the nested server will list
|
||||
fonts in the local font path and if run on the real server will list
|
||||
fonts in the remote font path. Before a font can be successfully
|
||||
opened by the nested server it has to exist in local and remote font
|
||||
paths. It is the users' responsibility to make sure that this is the
|
||||
case.
|
||||
.B Xnest
|
||||
as a server is the selection of fonts.
|
||||
.B Xnest
|
||||
manages fonts by loading them locally and then passing the font name to the real
|
||||
server and asking it to load that font remotely.
|
||||
This approach avoids the overload of sending the glyph bits across the network
|
||||
for every text operation, although it is really a bug.
|
||||
The consequence of this approach is that the user will have to worry about two
|
||||
different font paths \(em a local one for the nested server and a remote one for
|
||||
the real server \(em since
|
||||
.B Xnest
|
||||
does not propagate its font path to the real server.
|
||||
The reason for this is because real and nested servers need not run on the same
|
||||
file system which makes the two font paths mutually incompatible.
|
||||
Thus, if there is a font in the local font path of the nested server, there is
|
||||
no guarantee that this font exists in the remote font path of the real server.
|
||||
The
|
||||
.BR xlsfonts (__appmansuffix__)
|
||||
client, if run on the nested server, will list fonts in the local font path and,
|
||||
if run on the real server, will list fonts in the remote font path.
|
||||
Before a font can be successfully opened by the nested server, it has to exist
|
||||
in local and remote font paths.
|
||||
It is the users' responsibility to make sure that this is the case.
|
||||
.SH "FUTURE DIRECTIONS"
|
||||
Make dynamic the requirement for the SHAPE extension in the real server, rather
|
||||
than having to recompile
|
||||
.B Xnest
|
||||
to turn this requirement on and off.
|
||||
.PP
|
||||
Perhaps there should be a command-line option to tell
|
||||
.B Xnest
|
||||
to inherit the keyboard and pointer control parameters from the real server
|
||||
rather than imposing its own.
|
||||
.PP
|
||||
.B Xnest
|
||||
should read a customization input file to provide even greater freedom and
|
||||
simplicity in selecting the desired layout.
|
||||
.PP
|
||||
There is no support for backing store and save unders, but this should also be
|
||||
considered.
|
||||
.PP
|
||||
.\" Is the following still true now that client-side font rendering is
|
||||
.\" considered the way to go?
|
||||
The proper implementation of fonts should be moved into the
|
||||
.I os
|
||||
layer.
|
||||
.SH BUGS
|
||||
Won't run well on servers supporting different visual depths.
|
||||
Still crashes randomly. Probably has some memory leaks.
|
||||
Doesn't run well on servers supporting different visual depths.
|
||||
.PP
|
||||
Still crashes randomly.
|
||||
.PP
|
||||
Probably has some memory leaks.
|
||||
.SH AUTHOR
|
||||
Davor Matic, MIT X Consortium
|
||||
|
||||
.SH "SEE ALSO"
|
||||
.BR Xserver (__appmansuffix__),
|
||||
.BR xdpyinfo (__appmansuffix__),
|
||||
.BR X (__miscmansuffix__)
|
||||
|
|
|
@ -10,9 +10,9 @@ Xprt_CFLAGS = @DIX_CFLAGS@ @XPRINT_CFLAGS@ \
|
|||
|
||||
Xprt_LDFLAGS = -L$(top_srcdir)
|
||||
Xprt_LDADD = @XPRINT_LIBS@ ps/libps.la raster/libraster.la \
|
||||
pcl/libpcl.la pcl-mono/libpcl.la ../../fb/libfb.la \
|
||||
../../render/librender.la ../../mi/libmi.la ../../Xext/libXext.la \
|
||||
@FREETYPE_LIBS@
|
||||
pcl/libpcl.la pcl-mono/libpcl.la $(top_builddir)/fb/libfb.la \
|
||||
$(top_builddir)/render/librender.la $(top_builddir)/mi/libmi.la \
|
||||
$(top_builddir)/Xext/libXext.la @FREETYPE_LIBS@
|
||||
|
||||
miinitext-wrapper.c:
|
||||
echo "#include \"$(top_srcdir)/mi/miinitext.c\"" >> $@
|
||||
|
|
|
@ -264,7 +264,7 @@ winMultiWindowGetTransientFor (WindowPtr pWin, WindowPtr *ppDaddy)
|
|||
if (prop->propertyName == XA_WM_TRANSIENT_FOR)
|
||||
{
|
||||
if (ppDaddy)
|
||||
memcpy (*ppDaddy, prop->data, sizeof (WindowPtr *));
|
||||
memcpy (*ppDaddy, prop->data, sizeof (WindowPtr));
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
|
|
|
@ -207,10 +207,6 @@ extern int (* ProcVector[256]) (ClientPtr /*client*/);
|
|||
|
||||
extern int (* SwappedProcVector[256]) (ClientPtr /*client*/);
|
||||
|
||||
#ifdef K5AUTH
|
||||
extern int (*k5_Vector[256])(ClientPtr /*client*/);
|
||||
#endif
|
||||
|
||||
extern ReplySwapPtr ReplySwapVector[256];
|
||||
|
||||
extern int ProcBadRequest(ClientPtr /*client*/);
|
||||
|
|
|
@ -515,7 +515,15 @@ SOFTWARE.
|
|||
#define GLYPHPADBYTES 4
|
||||
#define GETLEFTBITS_ALIGNMENT 1
|
||||
#endif
|
||||
|
||||
|
||||
/* linux on IBM S/390 */
|
||||
#if defined (linux) && defined (__s390__)
|
||||
#define IMAGE_BYTE_ORDER MSBFirst
|
||||
#define BITMAP_BIT_ORDER MSBFirst
|
||||
#define GLYPHPADBYTES 4
|
||||
#define GETLEFTBITS_ALIGNMENT 1
|
||||
#endif /* linux/s390 */
|
||||
|
||||
/* size of buffer to use with GetImage, measured in bytes. There's obviously
|
||||
* a trade-off between the amount of stack (or whatever ALLOCATE_LOCAL gives
|
||||
* you) used and the number of times the ddx routine has to be called.
|
||||
|
|
22
mi/mieq.c
22
mi/mieq.c
|
@ -108,7 +108,8 @@ mieqEnqueue(DeviceIntPtr pDev, xEvent *e)
|
|||
HWEventQueueType oldtail = miEventQueue.tail, newtail;
|
||||
int isMotion = 0;
|
||||
deviceValuator *v = (deviceValuator *) e;
|
||||
EventPtr laste = &miEventQueue.events[oldtail - 1];
|
||||
EventPtr laste = &miEventQueue.events[(oldtail - 1) %
|
||||
QUEUE_SIZE];
|
||||
deviceKeyButtonPointer *lastkbp = (deviceKeyButtonPointer *)
|
||||
&laste->event[0];
|
||||
|
||||
|
@ -139,14 +140,10 @@ mieqEnqueue(DeviceIntPtr pDev, xEvent *e)
|
|||
|
||||
if (isMotion && isMotion == miEventQueue.lastMotion &&
|
||||
oldtail != miEventQueue.head) {
|
||||
if (oldtail == 0)
|
||||
oldtail = QUEUE_SIZE;
|
||||
oldtail = oldtail - 1;
|
||||
oldtail = (oldtail - 1) % QUEUE_SIZE;
|
||||
}
|
||||
else {
|
||||
newtail = oldtail + 1;
|
||||
if (newtail == QUEUE_SIZE)
|
||||
newtail = 0;
|
||||
newtail = (oldtail + 1) % QUEUE_SIZE;
|
||||
/* Toss events which come in late. Usually this means your server's
|
||||
* stuck in an infinite loop somewhere, but SIGIO is still getting
|
||||
* handled. */
|
||||
|
@ -214,22 +211,15 @@ mieqProcessInputEvents(void)
|
|||
|
||||
e = &miEventQueue.events[miEventQueue.head];
|
||||
/* Assumption - screen switching can only occur on motion events. */
|
||||
miEventQueue.head = (miEventQueue.head + 1) % QUEUE_SIZE;
|
||||
|
||||
if (e->pScreen != miEventQueue.pDequeueScreen) {
|
||||
miEventQueue.pDequeueScreen = e->pScreen;
|
||||
x = e->event[0].u.keyButtonPointer.rootX;
|
||||
y = e->event[0].u.keyButtonPointer.rootY;
|
||||
if (miEventQueue.head == QUEUE_SIZE - 1)
|
||||
miEventQueue.head = 0;
|
||||
else
|
||||
++miEventQueue.head;
|
||||
NewCurrentScreen (miEventQueue.pDequeueScreen, x, y);
|
||||
}
|
||||
else {
|
||||
if (miEventQueue.head == QUEUE_SIZE - 1)
|
||||
miEventQueue.head = 0;
|
||||
else
|
||||
++miEventQueue.head;
|
||||
|
||||
/* If someone's registered a custom event handler, let them
|
||||
* steal it. */
|
||||
if (miEventQueue.handlers[e->event->u.u.type]) {
|
||||
|
|
|
@ -3,7 +3,6 @@ noinst_LTLIBRARIES = libos.la libcwrapper.la
|
|||
AM_CFLAGS = $(DIX_CFLAGS)
|
||||
|
||||
# FIXME: Add support for these in configure.ac
|
||||
K5AUTH_SRCS = k5auth.c
|
||||
SECURERPC_SRCS = rpcauth.c
|
||||
INTERNALMALLOC_SRCS = xalloc.c
|
||||
|
||||
|
@ -48,7 +47,7 @@ libcwrapper_la_CFLAGS = \
|
|||
-I$(top_srcdir)/hw/xfree86/os-support \
|
||||
$(AM_CFLAGS)
|
||||
|
||||
EXTRA_DIST = $(K5AUTH_SRCS) $(SECURERPC_SRCS) $(INTERNALMALLOC_SRCS) \
|
||||
EXTRA_DIST = $(SECURERPC_SRCS) $(INTERNALMALLOC_SRCS) \
|
||||
$(XCSECURITY_SRCS) $(XDMCP_SRCS) $(STRLCAT_SRCS)
|
||||
|
||||
if XSERVER_DTRACE
|
||||
|
|
31
os/access.c
31
os/access.c
|
@ -1168,10 +1168,6 @@ ResetHosts (char *display)
|
|||
#ifdef DNETCONN
|
||||
struct nodeent *np;
|
||||
struct dn_naddr dnaddr, *dnaddrp, *dnet_addr();
|
||||
#endif
|
||||
#ifdef K5AUTH
|
||||
krb5_principal princ;
|
||||
krb5_data kbuf;
|
||||
#endif
|
||||
int family = 0;
|
||||
pointer addr;
|
||||
|
@ -1251,13 +1247,6 @@ ResetHosts (char *display)
|
|||
family = FamilyNetname;
|
||||
hostname = ohostname + 4;
|
||||
}
|
||||
#endif
|
||||
#ifdef K5AUTH
|
||||
else if (!strncmp("krb:", lhostname, 4))
|
||||
{
|
||||
family = FamilyKrb5Principal;
|
||||
hostname = ohostname + 4;
|
||||
}
|
||||
#endif
|
||||
else if (!strncmp("si:", lhostname, 3))
|
||||
{
|
||||
|
@ -1301,16 +1290,6 @@ ResetHosts (char *display)
|
|||
}
|
||||
else
|
||||
#endif /* DNETCONN */
|
||||
#ifdef K5AUTH
|
||||
if (family == FamilyKrb5Principal)
|
||||
{
|
||||
krb5_parse_name(hostname, &princ);
|
||||
XauKrb5Encode(princ, &kbuf);
|
||||
(void) NewHost(FamilyKrb5Principal, kbuf.data, kbuf.length, FALSE);
|
||||
krb5_free_principal(princ);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
#ifdef SECURE_RPC
|
||||
if ((family == FamilyNetname) || (strchr(hostname, '@')))
|
||||
{
|
||||
|
@ -1552,11 +1531,6 @@ AddHost (ClientPtr client,
|
|||
len = length;
|
||||
LocalHostEnabled = TRUE;
|
||||
break;
|
||||
#ifdef K5AUTH
|
||||
case FamilyKrb5Principal:
|
||||
len = length;
|
||||
break;
|
||||
#endif
|
||||
#ifdef SECURE_RPC
|
||||
case FamilyNetname:
|
||||
len = length;
|
||||
|
@ -1655,11 +1629,6 @@ RemoveHost (
|
|||
len = length;
|
||||
LocalHostEnabled = FALSE;
|
||||
break;
|
||||
#ifdef K5AUTH
|
||||
case FamilyKrb5Principal:
|
||||
len = length;
|
||||
break;
|
||||
#endif
|
||||
#ifdef SECURE_RPC
|
||||
case FamilyNetname:
|
||||
len = length;
|
||||
|
|
12
os/auth.c
12
os/auth.c
|
@ -35,9 +35,6 @@ from The Open Group.
|
|||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#ifdef K5AUTH
|
||||
# include <krb5/krb5.h>
|
||||
#endif
|
||||
# include <X11/X.h>
|
||||
# include <X11/Xauth.h>
|
||||
# include "misc.h"
|
||||
|
@ -92,15 +89,6 @@ static struct protocol protocols[] = {
|
|||
#endif
|
||||
},
|
||||
#endif
|
||||
#ifdef K5AUTH
|
||||
{ (unsigned short) 14, "MIT-KERBEROS-5",
|
||||
K5Add, K5Check, K5Reset,
|
||||
K5ToID, K5FromID, K5Remove,
|
||||
#ifdef XCSECURITY
|
||||
NULL
|
||||
#endif
|
||||
},
|
||||
#endif
|
||||
#ifdef XCSECURITY
|
||||
{ (unsigned short) XSecurityAuthorizationNameLen,
|
||||
XSecurityAuthorizationName,
|
||||
|
|
799
os/k5auth.c
799
os/k5auth.c
|
@ -1,799 +0,0 @@
|
|||
/*
|
||||
|
||||
Copyright 1993, 1994, 1998 The Open Group
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this software and its
|
||||
documentation for any purpose is hereby granted without fee, provided that
|
||||
the above copyright notice appear in all copies and that both that
|
||||
copyright notice and this permission notice appear in supporting
|
||||
documentation.
|
||||
|
||||
The above copyright notice and this permission notice shall be included
|
||||
in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
Except as contained in this notice, the name of The Open Group shall
|
||||
not be used in advertising or otherwise to promote the sale, use or
|
||||
other dealings in this Software without prior written authorization
|
||||
from The Open Group.
|
||||
|
||||
*/
|
||||
|
||||
/*
|
||||
* Kerberos V5 authentication scheme
|
||||
* Author: Tom Yu <tlyu@MIT.EDU>
|
||||
*
|
||||
* Mostly snarfed wholesale from the user_user demo in the
|
||||
* krb5 distribution. (At least the checking part)
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#ifdef TCPCONN
|
||||
#include <netinet/in.h>
|
||||
#endif
|
||||
#ifdef DNETCONN
|
||||
#include <netdnet/dn.h>
|
||||
#endif
|
||||
#include <arpa/inet.h>
|
||||
#include <krb5/krb5.h>
|
||||
/* 9/93: krb5.h leaks some symbols */
|
||||
#undef BITS32
|
||||
#undef xfree
|
||||
#include <krb5/los-proto.h>
|
||||
#include <X11/X.h>
|
||||
#include "os.h"
|
||||
#include "osdep.h"
|
||||
#include <X11/Xproto.h>
|
||||
#include <X11/Xfuncs.h>
|
||||
#include "dixstruct.h"
|
||||
#include <com_err.h>
|
||||
#include "Xauth.h"
|
||||
|
||||
extern int (*k5_Vector[256])();
|
||||
extern int SendConnSetup();
|
||||
extern char *display; /* need this to generate rcache name */
|
||||
|
||||
static XID krb5_id = ~0L;
|
||||
static krb5_principal srvname = NULL; /* service name */
|
||||
static char *ccname = NULL;
|
||||
static char *ktname = NULL; /* key table name */
|
||||
static char kerror[256];
|
||||
|
||||
/*
|
||||
* tgt_keyproc:
|
||||
*
|
||||
* extract session key from a credentials struct
|
||||
*/
|
||||
krb5_error_code tgt_keyproc(keyprocarg, principal, vno, key)
|
||||
krb5_pointer keyprocarg;
|
||||
krb5_principal principal;
|
||||
krb5_kvno vno;
|
||||
krb5_keyblock **key;
|
||||
{
|
||||
krb5_creds *creds = (krb5_creds *)keyprocarg;
|
||||
|
||||
return krb5_copy_keyblock(&creds->keyblock, key);
|
||||
}
|
||||
|
||||
/*
|
||||
* k5_cmpenc:
|
||||
*
|
||||
* compare "encoded" principals
|
||||
*/
|
||||
Bool k5_cmpenc(pname, plen, buf)
|
||||
unsigned char *pname;
|
||||
short plen;
|
||||
krb5_data *buf;
|
||||
{
|
||||
return (plen == buf->length &&
|
||||
memcmp(pname, buf->data, plen) == 0);
|
||||
}
|
||||
|
||||
/*
|
||||
* K5Check:
|
||||
*
|
||||
* This is stage 0 of the krb5 authentication protocol. It
|
||||
* goes through the current credentials cache and extracts the
|
||||
* primary principal and tgt to send to the client, or as
|
||||
* appropriate, extracts from a keytab.
|
||||
*
|
||||
* The packet sent to the client has the following format:
|
||||
*
|
||||
* CARD8 reqType = 2
|
||||
* CARD8 data = 0
|
||||
* CARD16 length = total length of packet (in 32 bit units)
|
||||
* CARD16 plen = length of encoded principal following
|
||||
* STRING8 princ = encoded principal
|
||||
* STRING8 ticket = server tgt
|
||||
*
|
||||
* For client-server authentication, the packet is as follows:
|
||||
*
|
||||
* CARD8 reqType = 3
|
||||
* CARD8 data = 0
|
||||
* CARD16 length = total length
|
||||
* STRING8 princ = encoded principal of server
|
||||
*/
|
||||
XID K5Check(data_length, data, client, reason)
|
||||
unsigned short data_length;
|
||||
char *data;
|
||||
ClientPtr client;
|
||||
char **reason;
|
||||
{
|
||||
krb5_error_code retval;
|
||||
CARD16 tlen;
|
||||
krb5_principal sprinc, cprinc;
|
||||
krb5_ccache cc;
|
||||
krb5_creds *creds;
|
||||
char *outbuf, *cp;
|
||||
krb5_data princ;
|
||||
register char n;
|
||||
xReq prefix;
|
||||
|
||||
if (krb5_id == ~0L)
|
||||
return ~0L;
|
||||
if (!ccname && !srvname)
|
||||
return ~0L;
|
||||
if (ccname)
|
||||
{
|
||||
if ((creds = (krb5_creds *)malloc(sizeof(krb5_creds))) == NULL)
|
||||
return ~0L;
|
||||
if (retval = krb5_cc_resolve(ccname, &cc))
|
||||
return ~0L;
|
||||
bzero((char*)creds, sizeof (krb5_creds));
|
||||
if (retval = krb5_cc_get_principal(cc, &cprinc))
|
||||
{
|
||||
krb5_free_creds(creds);
|
||||
krb5_cc_close(cc);
|
||||
return ~0L;
|
||||
}
|
||||
creds->client = cprinc;
|
||||
if (retval =
|
||||
krb5_build_principal_ext(&sprinc,
|
||||
krb5_princ_realm(creds->client)->length,
|
||||
krb5_princ_realm(creds->client)->data,
|
||||
6, "krbtgt",
|
||||
krb5_princ_realm(creds->client)->length,
|
||||
krb5_princ_realm(creds->client)->data,
|
||||
0))
|
||||
{
|
||||
krb5_free_creds(creds);
|
||||
krb5_cc_close(cc);
|
||||
return ~0L;
|
||||
}
|
||||
creds->server = sprinc;
|
||||
retval = krb5_get_credentials(KRB5_GC_CACHED, cc, creds);
|
||||
krb5_cc_close(cc);
|
||||
if (retval)
|
||||
{
|
||||
krb5_free_creds(creds);
|
||||
return ~0L;
|
||||
}
|
||||
if (retval = XauKrb5Encode(cprinc, &princ))
|
||||
{
|
||||
krb5_free_creds(creds);
|
||||
return ~0L;
|
||||
}
|
||||
tlen = sz_xReq + 2 + princ.length + creds->ticket.length;
|
||||
prefix.reqType = 2; /* opcode = authenticate user-to-user */
|
||||
}
|
||||
else if (srvname)
|
||||
{
|
||||
if (retval = XauKrb5Encode(srvname, &princ))
|
||||
{
|
||||
return ~0L;
|
||||
}
|
||||
tlen = sz_xReq + princ.length;
|
||||
prefix.reqType = 3; /* opcode = authenticate client-server */
|
||||
}
|
||||
prefix.data = 0; /* stage = 0 */
|
||||
prefix.length = (tlen + 3) >> 2; /* round up to nearest multiple
|
||||
of 4 bytes */
|
||||
if (client->swapped)
|
||||
{
|
||||
swaps(&prefix.length, n);
|
||||
}
|
||||
if ((cp = outbuf = (char *)malloc(tlen)) == NULL)
|
||||
{
|
||||
if (ccname)
|
||||
{
|
||||
krb5_free_creds(creds);
|
||||
}
|
||||
free(princ.data);
|
||||
return ~0L;
|
||||
}
|
||||
memcpy(cp, &prefix, sz_xReq);
|
||||
cp += sz_xReq;
|
||||
if (ccname)
|
||||
{
|
||||
memcpy(cp, &princ.length, 2);
|
||||
if (client->swapped)
|
||||
{
|
||||
swaps((CARD16 *)cp, n);
|
||||
}
|
||||
cp += 2;
|
||||
}
|
||||
memcpy(cp, princ.data, princ.length);
|
||||
cp += princ.length;
|
||||
free(princ.data); /* we don't need that anymore */
|
||||
if (ccname)
|
||||
memcpy(cp, creds->ticket.data, creds->ticket.length);
|
||||
WriteToClient(client, tlen, outbuf);
|
||||
free(outbuf);
|
||||
client->requestVector = k5_Vector; /* hack in our dispatch vector */
|
||||
client->clientState = ClientStateAuthenticating;
|
||||
if (ccname)
|
||||
{
|
||||
((OsCommPtr)client->osPrivate)->authstate.srvcreds = (pointer)creds; /* save tgt creds */
|
||||
((OsCommPtr)client->osPrivate)->authstate.ktname = NULL;
|
||||
((OsCommPtr)client->osPrivate)->authstate.srvname = NULL;
|
||||
}
|
||||
if (srvname)
|
||||
{
|
||||
((OsCommPtr)client->osPrivate)->authstate.srvcreds = NULL;
|
||||
((OsCommPtr)client->osPrivate)->authstate.ktname = (pointer)ktname;
|
||||
((OsCommPtr)client->osPrivate)->authstate.srvname = (pointer)srvname;
|
||||
}
|
||||
((OsCommPtr)client->osPrivate)->authstate.stageno = 1; /* next stage is 1 */
|
||||
return krb5_id;
|
||||
}
|
||||
|
||||
/*
|
||||
* k5_stage1:
|
||||
*
|
||||
* This gets called out of the dispatcher after K5Check frobs with the
|
||||
* client->requestVector. It accepts the ap_req from the client and verifies
|
||||
* it. In addition, if the client has set AP_OPTS_MUTUAL_REQUIRED, it then
|
||||
* sends an ap_rep to the client to achieve mutual authentication.
|
||||
*
|
||||
* client stage1 packet format is as follows:
|
||||
*
|
||||
* CARD8 reqType = 1
|
||||
* CARD8 data = ignored
|
||||
* CARD16 length = total length
|
||||
* STRING8 data = the actual ap_req
|
||||
*
|
||||
* stage2 packet sent back to client for mutual authentication:
|
||||
*
|
||||
* CARD8 reqType = 2
|
||||
* CARD8 data = 2
|
||||
* CARD16 length = total length
|
||||
* STRING8 data = the ap_rep
|
||||
*/
|
||||
int k5_stage1(client)
|
||||
register ClientPtr client;
|
||||
{
|
||||
long addrlen;
|
||||
krb5_error_code retval, retval2;
|
||||
register char n;
|
||||
struct sockaddr cli_net_addr;
|
||||
xReq prefix;
|
||||
krb5_principal cprinc;
|
||||
krb5_data buf;
|
||||
krb5_creds *creds = (krb5_creds *)((OsCommPtr)client->osPrivate)->authstate.srvcreds;
|
||||
krb5_keyblock *skey;
|
||||
krb5_address cli_addr, **localaddrs = NULL;
|
||||
krb5_tkt_authent *authdat;
|
||||
krb5_ap_rep_enc_part rep;
|
||||
krb5_int32 ctime, cusec;
|
||||
krb5_rcache rcache = NULL;
|
||||
char *cachename = NULL, *rc_type = NULL, *rc_base = "rcX", *kt = NULL;
|
||||
REQUEST(xReq);
|
||||
|
||||
if (((OsCommPtr)client->osPrivate)->authstate.stageno != 1)
|
||||
{
|
||||
if (creds)
|
||||
krb5_free_creds(creds);
|
||||
return(SendConnSetup(client, "expected Krb5 stage1 packet"));
|
||||
}
|
||||
addrlen = sizeof (cli_net_addr);
|
||||
if (getpeername(((OsCommPtr)client->osPrivate)->fd,
|
||||
&cli_net_addr, &addrlen) == -1)
|
||||
{
|
||||
if (creds)
|
||||
krb5_free_creds(creds);
|
||||
return(SendConnSetup(client, "Krb5 stage1: getpeername failed"));
|
||||
}
|
||||
if (cli_net_addr.sa_family == AF_UNSPEC
|
||||
#if defined(UNIXCONN) || defined(LOCALCONN) || defined(OS2PIPECONN)
|
||||
|| cli_net_addr.sa_family == AF_UNIX
|
||||
#endif
|
||||
) /* assume local host */
|
||||
{
|
||||
krb5_os_localaddr(&localaddrs);
|
||||
if (!localaddrs || !localaddrs[0])
|
||||
{
|
||||
if (creds)
|
||||
krb5_free_creds(creds);
|
||||
return(SendConnSetup(client, "Krb5 failed to get localaddrs"));
|
||||
}
|
||||
cli_addr.addrtype = localaddrs[0]->addrtype;
|
||||
cli_addr.length = localaddrs[0]->length;
|
||||
cli_addr.contents = localaddrs[0]->contents;
|
||||
}
|
||||
else
|
||||
{
|
||||
cli_addr.addrtype = cli_net_addr.sa_family; /* the values
|
||||
are compatible */
|
||||
switch (cli_net_addr.sa_family)
|
||||
{
|
||||
#ifdef TCPCONN
|
||||
case AF_INET:
|
||||
cli_addr.length = sizeof (struct in_addr);
|
||||
cli_addr.contents =
|
||||
(krb5_octet *)&((struct sockaddr_in *)&cli_net_addr)->sin_addr;
|
||||
break;
|
||||
#endif
|
||||
#ifdef DNETCONN
|
||||
case AF_DECnet:
|
||||
cli_addr.length = sizeof (struct dn_naddr);
|
||||
cli_addr.contents =
|
||||
(krb5_octet *)&((struct sockaddr_dn *)&cli_net_addr)->sdn_add;
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
if (localaddrs)
|
||||
krb5_free_addresses(localaddrs);
|
||||
if (creds)
|
||||
krb5_free_creds(creds);
|
||||
sprintf(kerror, "Krb5 stage1: unknown address family %d from getpeername",
|
||||
cli_net_addr.sa_family);
|
||||
return(SendConnSetup(client, kerror));
|
||||
}
|
||||
}
|
||||
if ((rcache = (krb5_rcache)malloc(sizeof(*rcache))) == NULL)
|
||||
{
|
||||
if (localaddrs)
|
||||
krb5_free_addresses(localaddrs);
|
||||
if (creds)
|
||||
krb5_free_creds(creds);
|
||||
return(SendConnSetup(client, "malloc bombed for krb5_rcache"));
|
||||
}
|
||||
if ((rc_type = krb5_rc_default_type()) == NULL)
|
||||
rc_type = "dfl";
|
||||
if (retval = krb5_rc_resolve_type(&rcache, rc_type))
|
||||
{
|
||||
if (localaddrs)
|
||||
krb5_free_addresses(localaddrs);
|
||||
if (creds)
|
||||
krb5_free_creds(creds);
|
||||
free(rcache);
|
||||
strcpy(kerror, "krb5_rc_resolve_type failed: ");
|
||||
strncat(kerror, error_message(retval), 231);
|
||||
return(SendConnSetup(client, kerror));
|
||||
}
|
||||
if ((cachename = (char *)malloc(strlen(rc_base) + strlen(display) + 1))
|
||||
== NULL)
|
||||
{
|
||||
if (localaddrs)
|
||||
krb5_free_addresses(localaddrs);
|
||||
if (creds)
|
||||
krb5_free_creds(creds);
|
||||
free(rcache);
|
||||
return(SendConnSetup(client, "Krb5: malloc bombed for cachename"));
|
||||
}
|
||||
strcpy(cachename, rc_base);
|
||||
strcat(cachename, display);
|
||||
if (retval = krb5_rc_resolve(rcache, cachename))
|
||||
{
|
||||
if (localaddrs)
|
||||
krb5_free_addresses(localaddrs);
|
||||
if (creds)
|
||||
krb5_free_creds(creds);
|
||||
free(rcache);
|
||||
free(cachename);
|
||||
strcpy(kerror, "krb5_rc_resolve failed: ");
|
||||
strncat(kerror, error_message(retval), 236);
|
||||
return(SendConnSetup(client, kerror));
|
||||
}
|
||||
free(cachename);
|
||||
if (krb5_rc_recover(rcache))
|
||||
{
|
||||
extern krb5_deltat krb5_clockskew;
|
||||
if (retval = krb5_rc_initialize(rcache, krb5_clockskew))
|
||||
{
|
||||
if (localaddrs)
|
||||
krb5_free_addresses(localaddrs);
|
||||
if (creds)
|
||||
krb5_free_creds(creds);
|
||||
if (retval2 = krb5_rc_close(rcache))
|
||||
{
|
||||
strcpy(kerror, "krb5_rc_close failed: ");
|
||||
strncat(kerror, error_message(retval2), 238);
|
||||
return(SendConnSetup(client, kerror));
|
||||
}
|
||||
free(rcache);
|
||||
strcpy(kerror, "krb5_rc_initialize failed: ");
|
||||
strncat(kerror, error_message(retval), 233);
|
||||
return(SendConnSetup(client, kerror));
|
||||
}
|
||||
}
|
||||
buf.length = (stuff->length << 2) - sz_xReq;
|
||||
buf.data = (char *)stuff + sz_xReq;
|
||||
if (creds)
|
||||
{
|
||||
retval = krb5_rd_req(&buf,
|
||||
NULL, /* don't bother with server name */
|
||||
&cli_addr,
|
||||
NULL, /* no fetchfrom */
|
||||
tgt_keyproc,
|
||||
creds, /* credentials as arg to
|
||||
keyproc */
|
||||
rcache,
|
||||
&authdat);
|
||||
krb5_free_creds(creds);
|
||||
}
|
||||
else if (kt = (char *)((OsCommPtr)client->osPrivate)->authstate.ktname)
|
||||
{
|
||||
retval = krb5_rd_req(&buf, srvname, &cli_addr, kt, NULL, NULL,
|
||||
rcache, &authdat);
|
||||
((OsCommPtr)client->osPrivate)->authstate.ktname = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (localaddrs)
|
||||
krb5_free_addresses(localaddrs);
|
||||
return(SendConnSetup(client, "Krb5: neither srvcreds nor ktname set"));
|
||||
}
|
||||
if (localaddrs)
|
||||
krb5_free_addresses(localaddrs);
|
||||
if (rcache)
|
||||
{
|
||||
if (retval2 = krb5_rc_close(rcache))
|
||||
{
|
||||
strcpy(kerror, "krb5_rc_close failed (2): ");
|
||||
strncat(kerror, error_message(retval2), 230);
|
||||
return(SendConnSetup(client, kerror));
|
||||
}
|
||||
free(rcache);
|
||||
}
|
||||
if (retval)
|
||||
{
|
||||
strcpy(kerror, "Krb5: Bad application request: ");
|
||||
strncat(kerror, error_message(retval), 224);
|
||||
return(SendConnSetup(client, kerror));
|
||||
}
|
||||
cprinc = authdat->ticket->enc_part2->client;
|
||||
skey = authdat->ticket->enc_part2->session;
|
||||
if (XauKrb5Encode(cprinc, &buf))
|
||||
{
|
||||
krb5_free_tkt_authent(authdat);
|
||||
return(SendConnSetup(client, "XauKrb5Encode bombed"));
|
||||
}
|
||||
/*
|
||||
* Now check to see if the principal we got is one that we want to let in
|
||||
*/
|
||||
if (ForEachHostInFamily(FamilyKrb5Principal, k5_cmpenc, (pointer)&buf))
|
||||
{
|
||||
free(buf.data);
|
||||
/*
|
||||
* The following deals with sending an ap_rep to the client to
|
||||
* achieve mutual authentication. The client sends back a stage 3
|
||||
* packet if all is ok.
|
||||
*/
|
||||
if (authdat->ap_options | AP_OPTS_MUTUAL_REQUIRED)
|
||||
{
|
||||
/*
|
||||
* stage 2: send ap_rep to client
|
||||
*/
|
||||
if (retval = krb5_us_timeofday(&ctime, &cusec))
|
||||
{
|
||||
krb5_free_tkt_authent(authdat);
|
||||
strcpy(kerror, "error in krb5_us_timeofday: ");
|
||||
strncat(kerror, error_message(retval), 234);
|
||||
return(SendConnSetup(client, kerror));
|
||||
}
|
||||
rep.ctime = ctime;
|
||||
rep.cusec = cusec;
|
||||
rep.subkey = NULL;
|
||||
rep.seq_number = 0;
|
||||
if (retval = krb5_mk_rep(&rep, skey, &buf))
|
||||
{
|
||||
krb5_free_tkt_authent(authdat);
|
||||
strcpy(kerror, "error in krb5_mk_rep: ");
|
||||
strncat(kerror, error_message(retval), 238);
|
||||
return(SendConnSetup(client, kerror));
|
||||
}
|
||||
prefix.reqType = 2; /* opcode = authenticate */
|
||||
prefix.data = 2; /* stage = 2 */
|
||||
prefix.length = (buf.length + sz_xReq + 3) >> 2;
|
||||
if (client->swapped)
|
||||
{
|
||||
swaps(&prefix.length, n);
|
||||
}
|
||||
WriteToClient(client, sz_xReq, (char *)&prefix);
|
||||
WriteToClient(client, buf.length, buf.data);
|
||||
free(buf.data);
|
||||
krb5_free_tkt_authent(authdat);
|
||||
((OsCommPtr)client->osPrivate)->authstate.stageno = 3; /* expect stage3 packet */
|
||||
return(Success);
|
||||
}
|
||||
else
|
||||
{
|
||||
free(buf.data);
|
||||
krb5_free_tkt_authent(authdat);
|
||||
return(SendConnSetup(client, NULL)); /* success! */
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
char *kname;
|
||||
|
||||
krb5_free_tkt_authent(authdat);
|
||||
free(buf.data);
|
||||
retval = krb5_unparse_name(cprinc, &kname);
|
||||
if (retval == 0)
|
||||
{
|
||||
sprintf(kerror, "Principal \"%s\" is not authorized to connect",
|
||||
kname);
|
||||
if (kname)
|
||||
free(kname);
|
||||
return(SendConnSetup(client, kerror));
|
||||
}
|
||||
else
|
||||
return(SendConnSetup(client,"Principal is not authorized to connect to Server"));
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* k5_stage3:
|
||||
*
|
||||
* Get the short ack packet from the client. This packet can conceivably
|
||||
* be expanded to allow for switching on end-to-end encryption.
|
||||
*
|
||||
* stage3 packet format:
|
||||
*
|
||||
* CARD8 reqType = 3
|
||||
* CARD8 data = ignored (for now)
|
||||
* CARD16 length = should be zero
|
||||
*/
|
||||
int k5_stage3(client)
|
||||
register ClientPtr client;
|
||||
{
|
||||
REQUEST(xReq);
|
||||
|
||||
if (((OsCommPtr)client->osPrivate)->authstate.stageno != 3)
|
||||
{
|
||||
return(SendConnSetup(client, "expected Krb5 stage3 packet"));
|
||||
}
|
||||
else
|
||||
return(SendConnSetup(client, NULL)); /* success! */
|
||||
}
|
||||
|
||||
k5_bad(client)
|
||||
register ClientPtr client;
|
||||
{
|
||||
if (((OsCommPtr)client->osPrivate)->authstate.srvcreds)
|
||||
krb5_free_creds((krb5_creds *)((OsCommPtr)client->osPrivate)->authstate.srvcreds);
|
||||
sprintf(kerror, "unrecognized Krb5 auth packet %d, expecting %d",
|
||||
((xReq *)client->requestBuffer)->reqType,
|
||||
((OsCommPtr)client->osPrivate)->authstate.stageno);
|
||||
return(SendConnSetup(client, kerror));
|
||||
}
|
||||
|
||||
/*
|
||||
* K5Add:
|
||||
*
|
||||
* Takes the name of a credentials cache and resolves it. Also adds the
|
||||
* primary principal of the ccache to the acl.
|
||||
*
|
||||
* Now will also take a service name.
|
||||
*/
|
||||
int K5Add(data_length, data, id)
|
||||
unsigned short data_length;
|
||||
char *data;
|
||||
XID id;
|
||||
{
|
||||
krb5_principal princ;
|
||||
krb5_error_code retval;
|
||||
krb5_keytab_entry tmp_entry;
|
||||
krb5_keytab keytab;
|
||||
krb5_kvno kvno = 0;
|
||||
krb5_ccache cc;
|
||||
char *nbuf, *cp;
|
||||
krb5_data kbuf;
|
||||
int i, ktlen;
|
||||
|
||||
krb5_init_ets(); /* can't think of a better place to put it */
|
||||
krb5_id = ~0L;
|
||||
if (data_length < 3)
|
||||
return 0;
|
||||
if ((nbuf = (char *)malloc(data_length - 2)) == NULL)
|
||||
return 0;
|
||||
memcpy(nbuf, data + 3, data_length - 3);
|
||||
nbuf[data_length - 3] = '\0';
|
||||
if (ccname)
|
||||
{
|
||||
free(ccname);
|
||||
ccname = NULL;
|
||||
}
|
||||
if (srvname)
|
||||
{
|
||||
krb5_free_principal(srvname);
|
||||
srvname = NULL;
|
||||
}
|
||||
if (ktname)
|
||||
{
|
||||
free(ktname);
|
||||
ktname = NULL;
|
||||
}
|
||||
if (!strncmp(data, "UU:", 3))
|
||||
{
|
||||
if (retval = krb5_cc_resolve(nbuf, &cc))
|
||||
{
|
||||
ErrorF("K5Add: krb5_cc_resolve of \"%s\" failed: %s\n",
|
||||
nbuf, error_message(retval));
|
||||
free(nbuf);
|
||||
return 0;
|
||||
}
|
||||
if (cc && !(retval = krb5_cc_get_principal(cc, &princ)))
|
||||
{
|
||||
if (XauKrb5Encode(princ, &kbuf))
|
||||
{
|
||||
free(nbuf);
|
||||
krb5_free_principal(princ);
|
||||
krb5_cc_close(cc);
|
||||
return 0;
|
||||
}
|
||||
if (krb5_cc_close(cc))
|
||||
return 0;
|
||||
AddHost(NULL, FamilyKrb5Principal, kbuf.length, kbuf.data);
|
||||
krb5_free_principal(princ);
|
||||
free(kbuf.data);
|
||||
ccname = nbuf;
|
||||
krb5_id = id;
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
ErrorF("K5Add: getting principal from cache \"%s\" failed: %s\n",
|
||||
nbuf, error_message(retval));
|
||||
}
|
||||
}
|
||||
else if (!strncmp(data, "CS:", 3))
|
||||
{
|
||||
if ((cp = strchr(nbuf, ',')) == NULL)
|
||||
{
|
||||
free(nbuf);
|
||||
return 0;
|
||||
}
|
||||
*cp = '\0'; /* gross but it works :-) */
|
||||
ktlen = strlen(cp + 1);
|
||||
if ((ktname = (char *)malloc(ktlen + 1)) == NULL)
|
||||
{
|
||||
free(nbuf);
|
||||
return 0;
|
||||
}
|
||||
strcpy(ktname, cp + 1);
|
||||
retval = krb5_sname_to_principal(NULL, /* NULL for hostname uses
|
||||
local host name*/
|
||||
nbuf, KRB5_NT_SRV_HST,
|
||||
&srvname);
|
||||
free(nbuf);
|
||||
if (retval)
|
||||
{
|
||||
free(ktname);
|
||||
ktname = NULL;
|
||||
return 0;
|
||||
}
|
||||
if (retval = krb5_kt_resolve(ktname, &keytab))
|
||||
{
|
||||
free(ktname);
|
||||
ktname = NULL;
|
||||
krb5_free_principal(srvname);
|
||||
srvname = NULL;
|
||||
return 0;
|
||||
}
|
||||
retval = krb5_kt_get_entry(keytab, srvname, kvno, &tmp_entry);
|
||||
krb5_kt_free_entry(&tmp_entry);
|
||||
if (retval)
|
||||
{
|
||||
free(ktname);
|
||||
ktname = NULL;
|
||||
krb5_free_principal(srvname);
|
||||
srvname = NULL;
|
||||
return 0;
|
||||
}
|
||||
if (XauKrb5Encode(srvname, &kbuf))
|
||||
{
|
||||
free(ktname);
|
||||
ktname = NULL;
|
||||
krb5_free_principal(srvname);
|
||||
srvname = NULL;
|
||||
return 0;
|
||||
}
|
||||
AddHost(NULL, FamilyKrb5Principal, kbuf.length, kbuf.data);
|
||||
krb5_id = id;
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
ErrorF("K5Add: credentials cache name \"%.*s\" in auth file: unknown type\n",
|
||||
data_length, data);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* K5Reset:
|
||||
*
|
||||
* Reset krb5_id, also nuke the current principal from the acl.
|
||||
*/
|
||||
int K5Reset()
|
||||
{
|
||||
krb5_principal princ;
|
||||
krb5_error_code retval;
|
||||
krb5_ccache cc;
|
||||
krb5_data kbuf;
|
||||
int i;
|
||||
|
||||
if (ccname)
|
||||
{
|
||||
if (retval = krb5_cc_resolve(ccname, &cc))
|
||||
{
|
||||
free(ccname);
|
||||
ccname = NULL;
|
||||
}
|
||||
if (cc && !(retval = krb5_cc_get_principal(cc, &princ)))
|
||||
{
|
||||
if (XauKrb5Encode(princ, &kbuf))
|
||||
return 1;
|
||||
RemoveHost(NULL, FamilyKrb5Principal, kbuf.length, kbuf.data);
|
||||
krb5_free_principal(princ);
|
||||
free(kbuf.data);
|
||||
if (krb5_cc_close(cc))
|
||||
return 1;
|
||||
free(ccname);
|
||||
ccname = NULL;
|
||||
}
|
||||
}
|
||||
if (srvname)
|
||||
{
|
||||
if (XauKrb5Encode(srvname, &kbuf))
|
||||
return 1;
|
||||
RemoveHost(NULL, FamilyKrb5Principal, kbuf.length, kbuf.data);
|
||||
krb5_free_principal(srvname);
|
||||
free(kbuf.data);
|
||||
srvname = NULL;
|
||||
}
|
||||
if (ktname)
|
||||
{
|
||||
free(ktname);
|
||||
ktname = NULL;
|
||||
}
|
||||
krb5_id = ~0L;
|
||||
return 0;
|
||||
}
|
||||
|
||||
XID K5ToID(data_length, data)
|
||||
unsigned short data_length;
|
||||
char *data;
|
||||
{
|
||||
return krb5_id;
|
||||
}
|
||||
|
||||
int K5FromID(id, data_lenp, datap)
|
||||
XID id;
|
||||
unsigned short *data_lenp;
|
||||
char **datap;
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int K5Remove(data_length, data)
|
||||
unsigned short data_length;
|
||||
char *data;
|
||||
{
|
||||
return 0;
|
||||
}
|
23
os/osdep.h
23
os/osdep.h
|
@ -145,16 +145,6 @@ typedef struct _connectionOutput {
|
|||
int count;
|
||||
} ConnectionOutput, *ConnectionOutputPtr;
|
||||
|
||||
#ifdef K5AUTH
|
||||
typedef struct _k5_state {
|
||||
int stageno; /* current stage of auth protocol */
|
||||
pointer srvcreds; /* server credentials */
|
||||
pointer srvname; /* server principal name */
|
||||
pointer ktname; /* key table: principal-key pairs */
|
||||
pointer skey; /* session key */
|
||||
} k5_state;
|
||||
#endif
|
||||
|
||||
struct _osComm;
|
||||
|
||||
#define AuthInitArgs void
|
||||
|
@ -190,9 +180,6 @@ typedef struct _osComm {
|
|||
ConnectionInputPtr input;
|
||||
ConnectionOutputPtr output;
|
||||
XID auth_id; /* authorization id */
|
||||
#ifdef K5AUTH
|
||||
k5_state authstate; /* state of setup auth conversation */
|
||||
#endif
|
||||
CARD32 conn_time; /* timestamp if not established, else 0 */
|
||||
struct _XtransConnInfo *trans_conn; /* transport connection object */
|
||||
} OsCommRec, *OsCommPtr;
|
||||
|
@ -273,16 +260,6 @@ extern int SecureRPCRemove (AuthRemCArgs);
|
|||
extern int SecureRPCReset (AuthRstCArgs);
|
||||
#endif
|
||||
|
||||
/* in k5auth.c */
|
||||
#ifdef K5AUTH
|
||||
extern XID K5Check (AuthCheckArgs);
|
||||
extern XID K5ToID (AuthToIDArgs);
|
||||
extern int K5Add (AuthAddCArgs);
|
||||
extern int K5FromID (AuthFromIDArgs);
|
||||
extern int K5Remove (AuthRemCArgs);
|
||||
extern int K5Reset (AuthRstCArgs);
|
||||
#endif
|
||||
|
||||
/* in secauth.c */
|
||||
extern XID AuthSecurityCheck (AuthCheckArgs);
|
||||
|
||||
|
|
14
os/utils.c
14
os/utils.c
|
@ -64,8 +64,10 @@ OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#include <X11/Xos.h>
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
#if !defined(WIN32) || !defined(__MINGW32__)
|
||||
#include <sys/time.h>
|
||||
#include <sys/resource.h>
|
||||
#endif
|
||||
#include "misc.h"
|
||||
#include <X11/X.h>
|
||||
#define XSERV_t
|
||||
|
@ -527,6 +529,13 @@ GiveUp(int sig)
|
|||
errno = olderrno;
|
||||
}
|
||||
|
||||
#if defined WIN32 && defined __MINGW32__
|
||||
_X_EXPORT CARD32
|
||||
GetTimeInMillis (void)
|
||||
{
|
||||
return GetTickCount ();
|
||||
}
|
||||
#else
|
||||
_X_EXPORT CARD32
|
||||
GetTimeInMillis(void)
|
||||
{
|
||||
|
@ -541,6 +550,7 @@ GetTimeInMillis(void)
|
|||
X_GETTIMEOFDAY(&tv);
|
||||
return(tv.tv_sec * 1000) + (tv.tv_usec / 1000);
|
||||
}
|
||||
#endif
|
||||
|
||||
_X_EXPORT void
|
||||
AdjustWaitForDelay (pointer waitTime, unsigned long newdelay)
|
||||
|
@ -798,11 +808,13 @@ ProcessCommandLine(int argc, char *argv[])
|
|||
}
|
||||
else if ( strcmp( argv[i], "-core") == 0)
|
||||
{
|
||||
struct rlimit core_limit;
|
||||
CoreDump = TRUE;
|
||||
#if !defined(WIN32) || !defined(__MINGW32__)
|
||||
struct rlimit core_limit;
|
||||
getrlimit (RLIMIT_CORE, &core_limit);
|
||||
core_limit.rlim_cur = core_limit.rlim_max;
|
||||
setrlimit (RLIMIT_CORE, &core_limit);
|
||||
#endif
|
||||
}
|
||||
else if ( strcmp( argv[i], "-dpi") == 0)
|
||||
{
|
||||
|
|
|
@ -2,6 +2,8 @@ noinst_LTLIBRARIES = librandr.la
|
|||
|
||||
AM_CFLAGS = $(DIX_CFLAGS)
|
||||
|
||||
XINERAMA_SRCS = rrxinerama.c
|
||||
|
||||
if XORG
|
||||
sdk_HEADERS = randrstr.h
|
||||
endif
|
||||
|
@ -18,5 +20,9 @@ librandr_la_SOURCES = \
|
|||
rrpointer.c \
|
||||
rrproperty.c \
|
||||
rrscreen.c \
|
||||
rrsdispatch.c \
|
||||
rrxinerama.c
|
||||
rrsdispatch.c
|
||||
|
||||
if XINERAMA
|
||||
librandr_la_SOURCES += ${XINERAMA_SRCS}
|
||||
endif
|
||||
|
||||
|
|
|
@ -358,8 +358,9 @@ RRExtensionInit (void)
|
|||
SRRScreenChangeNotifyEvent;
|
||||
EventSwapVector[RREventBase + RRNotify] = (EventSwapPtr)
|
||||
SRRNotifyEvent;
|
||||
|
||||
#ifdef PANORAMIX
|
||||
RRXineramaExtensionInit();
|
||||
#endif
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/*
|
||||
/*
|
||||
*
|
||||
* Copyright © 1999 Keith Packard
|
||||
*
|
||||
|
@ -266,19 +266,19 @@ miChangePictureFilter (PicturePtr pPicture,
|
|||
|
||||
#define BOUND(v) (INT16) ((v) < MINSHORT ? MINSHORT : (v) > MAXSHORT ? MAXSHORT : (v))
|
||||
|
||||
static __inline Bool
|
||||
miClipPictureReg (RegionPtr pRegion,
|
||||
RegionPtr pClip,
|
||||
static inline pixman_bool_t
|
||||
miClipPictureReg (pixman_region16_t * pRegion,
|
||||
pixman_region16_t * pClip,
|
||||
int dx,
|
||||
int dy)
|
||||
{
|
||||
if (REGION_NUM_RECTS(pRegion) == 1 &&
|
||||
REGION_NUM_RECTS(pClip) == 1)
|
||||
if (pixman_region_n_rects(pRegion) == 1 &&
|
||||
pixman_region_n_rects(pClip) == 1)
|
||||
{
|
||||
BoxPtr pRbox = REGION_RECTS(pRegion);
|
||||
BoxPtr pCbox = REGION_RECTS(pClip);
|
||||
pixman_box16_t * pRbox = pixman_region_rectangles(pRegion, NULL);
|
||||
pixman_box16_t * pCbox = pixman_region_rectangles(pClip, NULL);
|
||||
int v;
|
||||
|
||||
|
||||
if (pRbox->x1 < (v = pCbox->x1 + dx))
|
||||
pRbox->x1 = BOUND(v);
|
||||
if (pRbox->x2 > (v = pCbox->x2 + dx))
|
||||
|
@ -290,23 +290,23 @@ miClipPictureReg (RegionPtr pRegion,
|
|||
if (pRbox->x1 >= pRbox->x2 ||
|
||||
pRbox->y1 >= pRbox->y2)
|
||||
{
|
||||
REGION_EMPTY(pScreen, pRegion);
|
||||
pixman_region_init (pRegion);
|
||||
}
|
||||
}
|
||||
else if (!REGION_NOTEMPTY (pScreen, pClip))
|
||||
else if (!pixman_region_not_empty (pClip))
|
||||
return FALSE;
|
||||
else
|
||||
{
|
||||
if (dx || dy)
|
||||
REGION_TRANSLATE(pScreen, pRegion, -dx, -dy);
|
||||
if (!REGION_INTERSECT (pScreen, pRegion, pRegion, pClip))
|
||||
pixman_region_translate (pRegion, -dx, -dy);
|
||||
if (!pixman_region_intersect (pRegion, pRegion, pClip))
|
||||
return FALSE;
|
||||
if (dx || dy)
|
||||
REGION_TRANSLATE(pScreen, pRegion, dx, dy);
|
||||
pixman_region_translate(pRegion, dx, dy);
|
||||
}
|
||||
return REGION_NOTEMPTY(pScreen, pRegion);
|
||||
return pixman_region_not_empty(pRegion);
|
||||
}
|
||||
|
||||
|
||||
static __inline Bool
|
||||
miClipPictureSrc (RegionPtr pRegion,
|
||||
PicturePtr pPicture,
|
||||
|
@ -320,13 +320,13 @@ miClipPictureSrc (RegionPtr pRegion,
|
|||
{
|
||||
if (pPicture->clientClipType != CT_NONE)
|
||||
{
|
||||
REGION_TRANSLATE(pScreen, pRegion,
|
||||
pixman_region_translate ( pRegion,
|
||||
dx - pPicture->clipOrigin.x,
|
||||
dy - pPicture->clipOrigin.y);
|
||||
if (!REGION_INTERSECT (pScreen, pRegion, pRegion,
|
||||
(RegionPtr) pPicture->clientClip))
|
||||
(RegionPtr) pPicture->pCompositeClip)) // clientClip))
|
||||
return FALSE;
|
||||
REGION_TRANSLATE(pScreen, pRegion,
|
||||
pixman_region_translate ( pRegion,
|
||||
- (dx - pPicture->clipOrigin.x),
|
||||
- (dy - pPicture->clipOrigin.y));
|
||||
}
|
||||
|
@ -341,7 +341,7 @@ miClipPictureSrc (RegionPtr pRegion,
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
void
|
||||
miCompositeSourceValidate (PicturePtr pPicture,
|
||||
INT16 x,
|
||||
INT16 y,
|
||||
|
@ -417,6 +417,7 @@ miComputeCompositeRegion (RegionPtr pRegion,
|
|||
CARD16 width,
|
||||
CARD16 height)
|
||||
{
|
||||
|
||||
int v;
|
||||
|
||||
pRegion->extents.x1 = xDst;
|
||||
|
@ -430,13 +431,13 @@ miComputeCompositeRegion (RegionPtr pRegion,
|
|||
if (pRegion->extents.x1 >= pRegion->extents.x2 ||
|
||||
pRegion->extents.y1 >= pRegion->extents.y2)
|
||||
{
|
||||
REGION_EMPTY (pDst->pDrawable->pScreen, pRegion);
|
||||
pixman_region_init (pRegion);
|
||||
return FALSE;
|
||||
}
|
||||
/* clip against dst */
|
||||
if (!miClipPictureReg (pRegion, pDst->pCompositeClip, 0, 0))
|
||||
{
|
||||
REGION_UNINIT (pScreen, pRegion);
|
||||
pixman_region_fini (pRegion);
|
||||
return FALSE;
|
||||
}
|
||||
if (pDst->alphaMap)
|
||||
|
@ -445,14 +446,14 @@ miComputeCompositeRegion (RegionPtr pRegion,
|
|||
-pDst->alphaOrigin.x,
|
||||
-pDst->alphaOrigin.y))
|
||||
{
|
||||
REGION_UNINIT (pScreen, pRegion);
|
||||
pixman_region_fini (pRegion);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
/* clip against src */
|
||||
if (!miClipPictureSrc (pRegion, pSrc, xDst - xSrc, yDst - ySrc))
|
||||
{
|
||||
REGION_UNINIT (pScreen, pRegion);
|
||||
pixman_region_fini (pRegion);
|
||||
return FALSE;
|
||||
}
|
||||
if (pSrc->alphaMap)
|
||||
|
@ -461,7 +462,7 @@ miComputeCompositeRegion (RegionPtr pRegion,
|
|||
xDst - (xSrc + pSrc->alphaOrigin.x),
|
||||
yDst - (ySrc + pSrc->alphaOrigin.y)))
|
||||
{
|
||||
REGION_UNINIT (pScreen, pRegion);
|
||||
pixman_region_fini (pRegion);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
@ -470,7 +471,7 @@ miComputeCompositeRegion (RegionPtr pRegion,
|
|||
{
|
||||
if (!miClipPictureSrc (pRegion, pMask, xDst - xMask, yDst - yMask))
|
||||
{
|
||||
REGION_UNINIT (pScreen, pRegion);
|
||||
pixman_region_fini (pRegion);
|
||||
return FALSE;
|
||||
}
|
||||
if (pMask->alphaMap)
|
||||
|
@ -479,14 +480,17 @@ miComputeCompositeRegion (RegionPtr pRegion,
|
|||
xDst - (xMask + pMask->alphaOrigin.x),
|
||||
yDst - (yMask + pMask->alphaOrigin.y)))
|
||||
{
|
||||
REGION_UNINIT (pScreen, pRegion);
|
||||
pixman_region_fini (pRegion);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
miCompositeSourceValidate (pSrc, xSrc, ySrc, width, height);
|
||||
if (pMask)
|
||||
miCompositeSourceValidate (pMask, xMask, yMask, width, height);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
|
@ -88,6 +88,12 @@ miClipPicture (RegionPtr pRegion,
|
|||
INT16 xPict,
|
||||
INT16 yPict);
|
||||
|
||||
void
|
||||
miCompositeSourceValidate (PicturePtr pPicture,
|
||||
INT16 x,
|
||||
INT16 y,
|
||||
CARD16 width,
|
||||
CARD16 height);
|
||||
Bool
|
||||
miComputeCompositeRegion (RegionPtr pRegion,
|
||||
PicturePtr pSrc,
|
||||
|
|
|
@ -661,6 +661,10 @@ AddTraps (PicturePtr pPicture,
|
|||
int ntraps,
|
||||
xTrap *traps);
|
||||
|
||||
pixman_image_t *
|
||||
PixmanImageFromPicture (PicturePtr pPict,
|
||||
Bool hasClip);
|
||||
|
||||
PicturePtr
|
||||
CreateSolidPicture (Picture pid,
|
||||
xRenderColor *color,
|
||||
|
|
|
@ -36,16 +36,7 @@
|
|||
_X_EXPORT xFixed
|
||||
RenderSampleCeilY (xFixed y, int n)
|
||||
{
|
||||
xFixed f = xFixedFrac(y);
|
||||
xFixed i = xFixedFloor(y);
|
||||
|
||||
f = ((f + Y_FRAC_FIRST(n)) / STEP_Y_SMALL(n)) * STEP_Y_SMALL(n) + Y_FRAC_FIRST(n);
|
||||
if (f > Y_FRAC_LAST(n))
|
||||
{
|
||||
f = Y_FRAC_FIRST(n);
|
||||
i += xFixed1;
|
||||
}
|
||||
return (i | f);
|
||||
return pixman_sample_ceil_y (y, n);
|
||||
}
|
||||
|
||||
#define _div(a,b) ((a) >= 0 ? (a) / (b) : -((-(a) + (b) - 1) / (b)))
|
||||
|
@ -57,16 +48,7 @@ RenderSampleCeilY (xFixed y, int n)
|
|||
_X_EXPORT xFixed
|
||||
RenderSampleFloorY (xFixed y, int n)
|
||||
{
|
||||
xFixed f = xFixedFrac(y);
|
||||
xFixed i = xFixedFloor (y);
|
||||
|
||||
f = _div(f - Y_FRAC_FIRST(n), STEP_Y_SMALL(n)) * STEP_Y_SMALL(n) + Y_FRAC_FIRST(n);
|
||||
if (f < Y_FRAC_FIRST(n))
|
||||
{
|
||||
f = Y_FRAC_LAST(n);
|
||||
i -= xFixed1;
|
||||
}
|
||||
return (i | f);
|
||||
return pixman_sample_floor_y (y, n);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -75,52 +57,7 @@ RenderSampleFloorY (xFixed y, int n)
|
|||
_X_EXPORT void
|
||||
RenderEdgeStep (RenderEdge *e, int n)
|
||||
{
|
||||
xFixed_48_16 ne;
|
||||
|
||||
e->x += n * e->stepx;
|
||||
|
||||
ne = e->e + n * (xFixed_48_16) e->dx;
|
||||
|
||||
if (n >= 0)
|
||||
{
|
||||
if (ne > 0)
|
||||
{
|
||||
int nx = (ne + e->dy - 1) / e->dy;
|
||||
e->e = ne - nx * (xFixed_48_16) e->dy;
|
||||
e->x += nx * e->signdx;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ne <= -e->dy)
|
||||
{
|
||||
int nx = (-ne) / e->dy;
|
||||
e->e = ne + nx * (xFixed_48_16) e->dy;
|
||||
e->x -= nx * e->signdx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* A private routine to initialize the multi-step
|
||||
* elements of an edge structure
|
||||
*/
|
||||
static void
|
||||
_RenderEdgeMultiInit (RenderEdge *e, int n, xFixed *stepx_p, xFixed *dx_p)
|
||||
{
|
||||
xFixed stepx;
|
||||
xFixed_48_16 ne;
|
||||
|
||||
ne = n * (xFixed_48_16) e->dx;
|
||||
stepx = n * e->stepx;
|
||||
if (ne > 0)
|
||||
{
|
||||
int nx = ne / e->dy;
|
||||
ne -= nx * e->dy;
|
||||
stepx += nx * e->signdx;
|
||||
}
|
||||
*dx_p = ne;
|
||||
*stepx_p = stepx;
|
||||
pixman_edge_step (e, n);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -136,35 +73,7 @@ RenderEdgeInit (RenderEdge *e,
|
|||
xFixed x_bot,
|
||||
xFixed y_bot)
|
||||
{
|
||||
xFixed dx, dy;
|
||||
|
||||
e->x = x_top;
|
||||
e->e = 0;
|
||||
dx = x_bot - x_top;
|
||||
dy = y_bot - y_top;
|
||||
e->dy = dy;
|
||||
e->dx = 0;
|
||||
if (dy)
|
||||
{
|
||||
if (dx >= 0)
|
||||
{
|
||||
e->signdx = 1;
|
||||
e->stepx = dx / dy;
|
||||
e->dx = dx % dy;
|
||||
e->e = -dy;
|
||||
}
|
||||
else
|
||||
{
|
||||
e->signdx = -1;
|
||||
e->stepx = -(-dx / dy);
|
||||
e->dx = -dx % dy;
|
||||
e->e = 0;
|
||||
}
|
||||
|
||||
_RenderEdgeMultiInit (e, STEP_Y_SMALL(n), &e->stepx_small, &e->dx_small);
|
||||
_RenderEdgeMultiInit (e, STEP_Y_BIG(n), &e->stepx_big, &e->dx_big);
|
||||
}
|
||||
RenderEdgeStep (e, y_start - y_top);
|
||||
pixman_edge_init (e, n, y_start, x_top, y_top, x_bot, y_bot);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -179,24 +88,6 @@ RenderLineFixedEdgeInit (RenderEdge *e,
|
|||
int x_off,
|
||||
int y_off)
|
||||
{
|
||||
xFixed x_off_fixed = IntToxFixed(x_off);
|
||||
xFixed y_off_fixed = IntToxFixed(y_off);
|
||||
xPointFixed *top, *bot;
|
||||
|
||||
if (line->p1.y <= line->p2.y)
|
||||
{
|
||||
top = &line->p1;
|
||||
bot = &line->p2;
|
||||
}
|
||||
else
|
||||
{
|
||||
top = &line->p2;
|
||||
bot = &line->p1;
|
||||
}
|
||||
RenderEdgeInit (e, n, y,
|
||||
top->x + x_off_fixed,
|
||||
top->y + y_off_fixed,
|
||||
bot->x + x_off_fixed,
|
||||
bot->y + y_off_fixed);
|
||||
pixman_line_fixed_edge_init (e, n, y, (pixman_line_fixed_t *)line, x_off, y_off);
|
||||
}
|
||||
|
||||
|
|
|
@ -50,20 +50,7 @@
|
|||
* and can be quickly stepped across small or large gaps in the
|
||||
* sample grid
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
xFixed x;
|
||||
xFixed e;
|
||||
xFixed stepx;
|
||||
xFixed signdx;
|
||||
xFixed dy;
|
||||
xFixed dx;
|
||||
|
||||
xFixed stepx_small;
|
||||
xFixed stepx_big;
|
||||
xFixed dx_small;
|
||||
xFixed dx_big;
|
||||
} RenderEdge;
|
||||
typedef pixman_edge_t RenderEdge;
|
||||
|
||||
/*
|
||||
* Step across a small sample grid gap
|
||||
|
|
Loading…
Reference in New Issue
Block a user