Merge branch 'master' into XACE-SELINUX

Conflicts:

	dix/dixutils.c
This commit is contained in:
Eamon Walsh 2007-06-11 15:29:11 -04:00 committed by Eamon Walsh
commit e2a720c9a1
72 changed files with 1857 additions and 6282 deletions

View File

@ -886,8 +886,32 @@ getDrawableInfo(__DRInativeDisplay *dpy, int screen,
if (*numClipRects > 0) { if (*numClipRects > 0) {
size = sizeof (drm_clip_rect_t) * *numClipRects; size = sizeof (drm_clip_rect_t) * *numClipRects;
*ppClipRects = xalloc (size); *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 { else {
*ppClipRects = NULL; *ppClipRects = NULL;
@ -1001,13 +1025,10 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
size_t buffer_size; size_t buffer_size;
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
if (!xf86LoaderCheckSymbol("DRIQueryDirectRenderingCapable")) { if (!xf86LoaderCheckSymbol("DRIQueryDirectRenderingCapable") ||
LogMessage(X_ERROR, "AIGLX: DRI module not loaded\n"); !DRIQueryDirectRenderingCapable(pScreen, &isCapable) ||
return NULL; !isCapable) {
} LogMessage(X_INFO,
if (!DRIQueryDirectRenderingCapable(pScreen, &isCapable) || !isCapable) {
LogMessage(X_ERROR,
"AIGLX: Screen %d is not DRI capable\n", pScreen->myNum); "AIGLX: Screen %d is not DRI capable\n", pScreen->myNum);
return NULL; return NULL;
} }

View File

@ -34,7 +34,6 @@ MODULE_SRCS = \
xcmisc.c xcmisc.c
# Extra configuration files ship with some extensions # Extra configuration files ship with some extensions
SERVERCONFIGdir = $(libdir)/xserver
SERVERCONFIG_DATA = SERVERCONFIG_DATA =
# Optional sources included if extension enabled by configure.ac rules # Optional sources included if extension enabled by configure.ac rules

View File

@ -696,11 +696,13 @@ CompositeExtensionInit (void)
if (GetPictureScreenIfSet(pScreen) == NULL) if (GetPictureScreenIfSet(pScreen) == NULL)
return; return;
} }
#ifdef PANORAMIX
/* Xinerama's rewriting of window drawing before Composite gets to it /* Xinerama's rewriting of window drawing before Composite gets to it
* breaks Composite. * breaks Composite.
*/ */
if (!noPanoramiXExtension) if (!noPanoramiXExtension)
return; return;
#endif
CompositeClientWindowType = CreateNewResourceType (FreeCompositeClientWindow); CompositeClientWindowType = CreateNewResourceType (FreeCompositeClientWindow);
if (!CompositeClientWindowType) if (!CompositeClientWindowType)

View File

@ -123,19 +123,19 @@ b = __swap16(a);
], [SYS_ENDIAN__SWAP='yes'], [SYS_ENDIAN__SWAP='no']) ], [SYS_ENDIAN__SWAP='yes'], [SYS_ENDIAN__SWAP='no'])
AC_MSG_RESULT([$SYS_ENDIAN__SWAP]) 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([ AC_LINK_IFELSE([AC_LANG_PROGRAM([
#include <sys/endian.h> #include <sys/endian.h>
], [ ], [
int a = 1, b; int a = 1, b;
b = bswap_16(a); b = bswap16(a);
]) ])
], [SYS_ENDIAN_BSWAP='yes'], [SYS_ENDIAN_BSWAP='no']) ], [SYS_ENDIAN_BSWAP='yes'], [SYS_ENDIAN_BSWAP='no'])
AC_MSG_RESULT([$SYS_ENDIAN_BSWAP]) AC_MSG_RESULT([$SYS_ENDIAN_BSWAP])
if test "$SYS_ENDIAN_BSWAP" = "yes" ; then if test "$SYS_ENDIAN_BSWAP" = "yes" ; then
USE_SYS_ENDIAN_H=yes USE_SYS_ENDIAN_H=yes
BSWAP=bswap_ BSWAP=bswap
else else
if test "$SYS_ENDIAN__SWAP" = "yes" ; then if test "$SYS_ENDIAN__SWAP" = "yes" ; then
USE_SYS_ENDIAN_H=yes USE_SYS_ENDIAN_H=yes
@ -165,20 +165,20 @@ AC_CHECK_FUNCS([geteuid getuid link memmove memset mkstemp strchr strrchr \
AC_FUNC_ALLOCA AC_FUNC_ALLOCA
dnl Old HAS_* names used in os/*.c. dnl Old HAS_* names used in os/*.c.
AC_CHECK_FUNC([getdtablesize], 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_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_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_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) AC_CHECK_FUNC([strlcat], HAVE_STRLCAT=yes, HAVE_STRLCAT=no)
AM_CONDITIONAL(NEED_STRLCAT, [test x$HAVE_STRLCAT = xno]) AM_CONDITIONAL(NEED_STRLCAT, [test x$HAVE_STRLCAT = xno])
AM_CONDITIONAL(NEED_VSNPRINTF, [test x$HAVE_VSNPRINTF = xno]) AM_CONDITIONAL(NEED_VSNPRINTF, [test x$HAVE_VSNPRINTF = xno])
dnl Check for mmap support for Xvfb 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 dnl Find the math libary
AC_CHECK_LIB(m, sqrt) 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)]), AC_ARG_WITH(rgb-path, AS_HELP_STRING([--with-rgb-path=PATH], [Path to RGB database (default: ${datadir}/X11/rgb)]),
[ RGBPATH="$withval" ], [ RGBPATH="$withval" ],
[ RGBPATH="${datadir}/X11/rgb" ]) [ 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" 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)]), 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}" ]. [ APPLE_APPLICATIONS_DIR="${withval}" ].
@ -624,10 +627,10 @@ XEXT_INC='-I$(top_srcdir)/Xext'
XEXT_LIB='$(top_builddir)/Xext/libXext.la' XEXT_LIB='$(top_builddir)/Xext/libXext.la'
XEXTXORG_LIB='$(top_builddir)/Xext/libXextbuiltin.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. 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" REQUIRED_LIBS="xfont xau fontenc $PIXMAN"
if test "x$DBUS" = xauto; then 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' XKB_STUB_LIB='$(top_builddir)/xkb/libxkbstubs.la'
AC_CHECK_FUNC(strcasecmp, [], AC_DEFINE([NEED_STRCASECMP], 1, 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 if test "x$NULL_ROOT_CURSOR" = xyes; then
AC_DEFINE(NULL_ROOT_CURSOR, 1, [Use an empty root cursor]) 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(COMPILEDDEFAULTFONTPATH, FONTPATH, [Default font path])
AC_DEFINE_DIR(RGB_DB, RGBPATH, [Default RGB 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(BASE_FONT_PATH, FONTDIR, [Default base font path])
AC_DEFINE_DIR(DRI_DRIVER_PATH, DRI_DRIVER_PATH, [Default DRI driver path]) AC_DEFINE_DIR(DRI_DRIVER_PATH, DRI_DRIVER_PATH, [Default DRI driver path])
AC_DEFINE_UNQUOTED(XVENDORNAME, ["$VENDOR_STRING"], [Vendor name]) AC_DEFINE_UNQUOTED(XVENDORNAME, ["$VENDOR_STRING"], [Vendor name])
@ -1610,7 +1614,7 @@ AC_MSG_CHECKING([whether to build Xprint DDX])
AC_MSG_RESULT([$XPRINT]) AC_MSG_RESULT([$XPRINT])
if test "x$XPRINT" = xyes; then 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_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" 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]) 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')" BUILD_DATE="$(date +'%Y%m%d')"
AC_SUBST([BUILD_DATE]) AC_SUBST([BUILD_DATE])
BUILD_TIME="$(date +'1%H%M%S')"
AC_SUBST([BUILD_TIME])
DIX_CFLAGS="-DHAVE_DIX_CONFIG_H $XSERVER_CFLAGS" DIX_CFLAGS="-DHAVE_DIX_CONFIG_H $XSERVER_CFLAGS"

View File

@ -432,6 +432,7 @@ InitAndStartDevices(void)
for (dev = inputInfo.devices; for (dev = inputInfo.devices;
dev && (dev != inputInfo.keyboard); dev && (dev != inputInfo.keyboard);
dev = dev->next) dev = dev->next)
;
if (!dev || (dev != inputInfo.keyboard)) { if (!dev || (dev != inputInfo.keyboard)) {
ErrorF("No core keyboard\n"); ErrorF("No core keyboard\n");
return BadImplementation; return BadImplementation;
@ -908,6 +909,7 @@ InitAbsoluteClassDeviceStruct(DeviceIntPtr dev)
abs->width = -1; abs->width = -1;
abs->height = -1; abs->height = -1;
abs->following = 0; abs->following = 0;
abs->screen = 0;
dev->absolute = abs; dev->absolute = abs;

View File

@ -997,10 +997,6 @@ ProcGetAtomName(ClientPtr client)
} }
} }
#ifdef K5AUTH
extern int k5_bad();
#endif
int int
ProcSetSelectionOwner(ClientPtr client) ProcSetSelectionOwner(ClientPtr client)
{ {
@ -3548,12 +3544,6 @@ InitProcVectors(void)
ProcVector[i] = SwappedProcVector[i] = ProcBadRequest; ProcVector[i] = SwappedProcVector[i] = ProcBadRequest;
ReplySwapVector[i] = ReplyNotSwappd; ReplySwapVector[i] = ReplyNotSwappd;
} }
#ifdef K5AUTH
if (!k5_Vector[i])
{
k5_Vector[i] = k5_bad;
}
#endif
} }
for(i = LASTEvent; i < 128; i++) for(i = LASTEvent; i < 128; i++)
{ {

View File

@ -271,7 +271,7 @@ dixLookupClient(ClientPtr *pClient, XID rid, ClientPtr client, Mask access)
int clientIndex = CLIENT_ID(rid); int clientIndex = CLIENT_ID(rid);
client->errorValue = 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)) { if (clientIndex && pRes && clients[clientIndex] && !(rid & SERVER_BIT)) {
*pClient = clients[clientIndex]; *pClient = clients[clientIndex];

View File

@ -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 */ #endif /* PANORAMIX */

View File

@ -61,11 +61,6 @@ SOFTWARE.
#include "swaprep.h" #include "swaprep.h"
#include "swapreq.h" #include "swapreq.h"
#ifdef K5AUTH
extern int
k5_stage1(), k5_stage2(), k5_stage3(), k5_bad();
#endif
int (* InitialVector[3]) ( int (* InitialVector[3]) (
ClientPtr /* client */ ClientPtr /* client */
) = ) =
@ -515,13 +510,3 @@ _X_EXPORT ReplySwapPtr ReplySwapVector[256] =
ReplyNotSwappd, /* NoOperation */ ReplyNotSwappd, /* NoOperation */
ReplyNotSwappd ReplyNotSwappd
}; };
#ifdef K5AUTH
int (*k5_Vector[256])() =
{
k5_bad,
k5_stage1,
k5_bad,
k5_stage3
};
#endif

View File

@ -69,9 +69,7 @@ libfb_la_SOURCES = \
fbutil.c \ fbutil.c \
fbwindow.c \ fbwindow.c \
fbpseudocolor.c \ fbpseudocolor.c \
fbpseudocolor.h \ fbpseudocolor.h
fbedge.c \
fbedgeimp.h
libwfb_la_SOURCES = $(libfb_la_SOURCES) libwfb_la_SOURCES = $(libfb_la_SOURCES)

View File

@ -26,6 +26,8 @@
#define _FB_H_ #define _FB_H_
#include <X11/X.h> #include <X11/X.h>
#include <pixman/pixman.h>
#include "scrnintstr.h" #include "scrnintstr.h"
#include "pixmap.h" #include "pixmap.h"
#include "pixmapstr.h" #include "pixmapstr.h"
@ -2147,4 +2149,8 @@ void
fbPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what); fbPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what);
pixman_image_t *image_from_pict (PicturePtr pict,
Bool has_clip);
#endif /* _FB_H_ */ #endif /* _FB_H_ */

View File

@ -60,19 +60,15 @@ fbCopyNtoN (DrawablePtr pSrcDrawable,
while (nbox--) while (nbox--)
{ {
#ifdef USE_MMX #ifndef FB_ACCESS_WRAPPER /* pixman_blt() doesn't support accessors yet */
if (pm == FB_ALLONES && alu == GXcopy && !reverse && if (pm == FB_ALLONES && alu == GXcopy && !reverse &&
!upsidedown && fbHaveMMX()) !upsidedown)
{ {
if (!fbCopyAreammx (pSrcDrawable, if (!pixman_blt ((uint32_t *)src, (uint32_t *)dst, srcStride, dstStride, srcBpp, dstBpp,
pDstDrawable, (pbox->x1 + dx + srcXoff),
(pbox->y1 + dy + srcYoff),
(pbox->x1 + dx), (pbox->x1 + srcXoff),
(pbox->y1 + dy), (pbox->y1 + srcYoff),
(pbox->x1),
(pbox->y1),
(pbox->x2 - pbox->x1), (pbox->x2 - pbox->x1),
(pbox->y2 - pbox->y1))) (pbox->y2 - pbox->y1)))
goto fallback; goto fallback;
@ -98,7 +94,7 @@ fbCopyNtoN (DrawablePtr pSrcDrawable,
reverse, reverse,
upsidedown); upsidedown);
#ifdef USE_MMX #ifndef FB_ACCESS_WRAPPER
next: next:
#endif #endif
pbox++; pbox++;

View File

@ -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 */

View File

@ -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

View File

@ -49,10 +49,13 @@ fbFill (DrawablePtr pDrawable,
case FillSolid: case FillSolid:
#ifdef USE_MMX #ifdef USE_MMX
if (!pPriv->and && fbHaveMMX()) 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); fbFinishAccess (pDrawable);
return; return;
} }
}
#endif #endif
fbSolid (dst + (y + dstYoff) * dstStride, fbSolid (dst + (y + dstYoff) * dstStride,
dstStride, dstStride,
@ -218,10 +221,10 @@ fbSolidBoxClipped (DrawablePtr pDrawable,
#ifdef USE_MMX #ifdef USE_MMX
if (!and && fbHaveMMX()) if (!and && fbHaveMMX())
{ {
if (fbSolidFillmmx (pDrawable, if (fbFillmmx (dst, dstStride, dstBpp,
partX1, partY1, partX1 + dstXoff, partX2 + dstYoff, (partX2 - partX1), (partY2 - partY1),
(partX2 - partX1), (partY2 - partY1), xor))
xor)) { {
fbFinishAccess (pDrawable); fbFinishAccess (pDrawable);
return; return;
} }

2595
fb/fbmmx.c

File diff suppressed because it is too large Load Diff

View File

@ -44,251 +44,21 @@ Bool fbHaveMMX(void);
#ifdef USE_MMX #ifdef USE_MMX
void fbComposeSetupMMX(void); Bool fbBltmmx (FbBits *src_bits,
FbBits *dst_bits,
void fbCompositeSolidMask_nx8888x0565Cmmx (CARD8 op, FbStride src_stride,
PicturePtr pSrc, FbStride dst_stride,
PicturePtr pMask, int src_bpp,
PicturePtr pDst, int dst_bpp,
INT16 xSrc, int src_x, int src_y,
INT16 ySrc, int dst_x, int dst_y,
INT16 xMask, int width, int height);
INT16 yMask, Bool fbFillmmx (FbBits *bits,
INT16 xDst, FbStride stride,
INT16 yDst, int bpp,
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 x,
int y, int y,
int width, int width,
int height, int height,
FbBits xor); FbBits xor);
#endif /* USE_MMX */ #endif /* USE_MMX */

View File

@ -30,7 +30,6 @@
#include <string.h> #include <string.h>
#include "fb.h" #include "fb.h"
#include <pixman/pixman.h>
#ifdef RENDER #ifdef RENDER
@ -39,228 +38,6 @@
#include "fbpict.h" #include "fbpict.h"
#include "fbmmx.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 (
&center, 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)) #define mod(a,b) ((b) == 1 ? 0 : (a) >= 0 ? (a) % (b) : (b) - (-a) % (b))
void void
@ -381,25 +158,36 @@ fbComposite (CARD8 op,
CARD16 width, CARD16 width,
CARD16 height) CARD16 height)
{ {
pixman_region16_t region;
pixman_image_t *src, *mask, *dest; pixman_image_t *src, *mask, *dest;
if (!miComputeCompositeRegion (&region, pSrc, pMask, pDst, xSrc, ySrc, xDst += pDst->pDrawable->x;
xMask, yMask, xDst, yDst, width, height)) yDst += pDst->pDrawable->y;
return; 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); miCompositeSourceValidate (pSrc, xSrc, ySrc, width, height);
mask = image_from_pict (pMask); if (pMask)
dest = image_from_pict (pDst); 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)) if (src && dest && !(pMask && !mask))
{ {
pixman_image_composite (op, src, mask, dest, pixman_image_composite (op, src, mask, dest,
xSrc, ySrc, xMask, yMask, xDst, yDst, xSrc, ySrc, xMask, yMask, xDst, yDst,
width, height, &region); width, height);
}
pixman_region_fini (&region); }
if (src) if (src)
pixman_image_unref (src); pixman_image_unref (src);
@ -430,6 +218,234 @@ fbCompositeGeneral (CARD8 op,
#endif /* RENDER */ #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 (
&center, 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 Bool
fbPictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats) fbPictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats)
{ {

View File

@ -412,18 +412,6 @@ fbCompositeGeneral (CARD8 op,
CARD16 width, CARD16 width,
CARD16 height); CARD16 height);
/* fbedge.c */
void
fbRasterizeEdges (FbBits *buf,
int bpp,
int width,
int stride,
RenderEdge *l,
RenderEdge *r,
xFixed t,
xFixed b);
/* fbpict.c */ /* fbpict.c */
void void
fbComposite (CARD8 op, fbComposite (CARD8 op,

View File

@ -42,61 +42,16 @@ fbAddTraps (PicturePtr pPicture,
int ntrap, int ntrap,
xTrap *traps) xTrap *traps)
{ {
FbBits *buf; pixman_image_t *image = image_from_pict (pPicture, FALSE);
int bpp;
int width;
int stride;
int height;
int pxoff, pyoff;
xFixed x_off_fixed; if (!image)
xFixed y_off_fixed; return;
RenderEdge l, r;
xFixed t, b;
fbGetDrawable (pPicture->pDrawable, buf, stride, bpp, pxoff, pyoff); pixman_add_traps (image, x_off, y_off, ntrap, (pixman_trap_t *)traps);
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++;
}
fbFinishAccess (pPicture->pDrawable); fbFinishAccess (pPicture->pDrawable);
pixman_image_unref (image);
} }
void void
@ -105,50 +60,16 @@ fbRasterizeTrapezoid (PicturePtr pPicture,
int x_off, int x_off,
int y_off) int y_off)
{ {
FbBits *buf; pixman_image_t *image = image_from_pict (pPicture, FALSE);
int bpp;
int width;
int stride;
int height;
int pxoff, pyoff;
xFixed x_off_fixed; if (!image)
xFixed y_off_fixed;
RenderEdge l, r;
xFixed t, b;
if (!xTrapezoidValid (trap))
return; return;
fbGetDrawable (pPicture->pDrawable, buf, stride, bpp, pxoff, pyoff); pixman_rasterize_trapezoid (image, (pixman_trapezoid_t *)trap, x_off, y_off);
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);
}
fbFinishAccess (pPicture->pDrawable); fbFinishAccess (pPicture->pDrawable);
pixman_image_unref (image);
} }
static int static int

View File

@ -233,11 +233,12 @@ fbFillRegionSolid (DrawablePtr pDrawable,
while (n--) while (n--)
{ {
#ifdef USE_MMX #ifdef USE_MMX
if (!has_mmx || !fbSolidFillmmx (pDrawable, if (!has_mmx || !fbFillmmx (dst, dstStride, dstBpp,
pbox->x1, pbox->x1 + dstXoff, pbox->y1 + dstYoff,
pbox->y1,
(pbox->x2 - pbox->x1), (pbox->x2 - pbox->x1),
(pbox->y2 - pbox->y1), xor)) { (pbox->y2 - pbox->y1),
xor))
{
#endif #endif
fbSolid (dst + (pbox->y1 + dstYoff) * dstStride, fbSolid (dst + (pbox->y1 + dstYoff) * dstStride,
dstStride, dstStride,

View File

@ -184,9 +184,11 @@
#define fbUnmapWindow wfbUnmapWindow #define fbUnmapWindow wfbUnmapWindow
#define fbUnrealizeFont wfbUnrealizeFont #define fbUnrealizeFont wfbUnrealizeFont
#define fbValidateGC wfbValidateGC #define fbValidateGC wfbValidateGC
#define fbWalkCompositeRegion wfbWalkCompositeRegion
#define fbWinPrivateIndex wfbWinPrivateIndex #define fbWinPrivateIndex wfbWinPrivateIndex
#define fbZeroLine wfbZeroLine #define fbZeroLine wfbZeroLine
#define fbZeroSegment wfbZeroSegment #define fbZeroSegment wfbZeroSegment
#define image_from_pict wfb_image_from_pict
#define xxScrPrivateIndex wfbxxScrPrivateIndex #define xxScrPrivateIndex wfbxxScrPrivateIndex
#define xxGCPrivateIndex wfbxxGCPrivateIndex #define xxGCPrivateIndex wfbxxGCPrivateIndex
#define xxColormapPrivateIndex wfbxxColormapPrivateIndex #define xxColormapPrivateIndex wfbxxColormapPrivateIndex

View File

@ -65,7 +65,7 @@ of the copyright holder.
#include <linux/agpgart.h> #include <linux/agpgart.h>
#elif defined(__FreeBSD__) #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <sys/agpio.h> #include <sys/agpio.h>
#endif #endif

View File

@ -1365,7 +1365,7 @@ do { \
# define write_mem_barrier() /* NOP */ # define write_mem_barrier() /* NOP */
# if !defined(__SUNPRO_C) # 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 # ifdef GCCUSESGAS
/* /*

View File

@ -1 +1,2 @@
#define BUILD_DATE @BUILD_DATE@ #define BUILD_DATE @BUILD_DATE@
#define BUILD_TIME @BUILD_TIME@

View File

@ -131,9 +131,9 @@ static Bool configInput(IDevPtr inputp, XF86ConfInputPtr conf_input,
static Bool configDisplay(DispPtr displayp, XF86ConfDisplayPtr conf_display); static Bool configDisplay(DispPtr displayp, XF86ConfDisplayPtr conf_display);
static Bool addDefaultModes(MonPtr monitorp); static Bool addDefaultModes(MonPtr monitorp);
#ifdef XF86DRI #ifdef XF86DRI
static Bool configDRI(XF86ConfDRIPtr drip); static void configDRI(XF86ConfDRIPtr drip);
#endif #endif
static Bool configExtensions(XF86ConfExtensionsPtr conf_ext); static void configExtensions(XF86ConfExtensionsPtr conf_ext);
/* /*
* xf86GetPathElem -- * xf86GetPathElem --
@ -598,7 +598,7 @@ xf86ConfigError(char *msg, ...)
return; return;
} }
static Bool static void
configFiles(XF86ConfFilesPtr fileconf) configFiles(XF86ConfFilesPtr fileconf)
{ {
MessageType pathFrom = X_DEFAULT; MessageType pathFrom = X_DEFAULT;
@ -615,7 +615,7 @@ configFiles(XF86ConfFilesPtr fileconf)
pathFrom = X_CONFIG; pathFrom = X_CONFIG;
if (*f) { if (*f) {
if (xf86Info.useDefaultFontPath) { 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); char *g = xnfalloc(strlen(defaultFontPath) + strlen(f) + 3);
strcpy(g, f); strcpy(g, f);
strcat(g, ","); strcat(g, ",");
@ -632,7 +632,7 @@ configFiles(XF86ConfFilesPtr fileconf)
} }
} }
} else { } else {
xf86Msg(X_WARNING, xf86Msg(X_DEFAULT,
"No FontPath specified. Using compiled-in default.\n"); "No FontPath specified. Using compiled-in default.\n");
pathFrom = X_DEFAULT; pathFrom = X_DEFAULT;
} }
@ -1474,13 +1474,13 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
} }
if (pointerMsg) { 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" "explicitly in the layout.\n"
"\tUsing the %s.\n", pointerMsg); "\tUsing the %s.\n", pointerMsg);
} }
if (keyboardMsg) { 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" "explicitly in the layout.\n"
"\tUsing the %s.\n", keyboardMsg); "\tUsing the %s.\n", keyboardMsg);
} }
@ -1937,7 +1937,7 @@ configScreen(confScreenPtr screenp, XF86ConfScreenPtr conf_screen, int scrnum,
} }
if (defaultMonitor) { 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); "\tUsing a default monitor configuration.\n", screenp->id);
} }
return TRUE; return TRUE;
@ -2228,7 +2228,7 @@ configDevice(GDevPtr devicep, XF86ConfDevicePtr conf_device, Bool active)
} }
#ifdef XF86DRI #ifdef XF86DRI
static Bool static void
configDRI(XF86ConfDRIPtr drip) configDRI(XF86ConfDRIPtr drip)
{ {
int count = 0; int count = 0;
@ -2269,12 +2269,10 @@ configDRI(XF86ConfDRIPtr drip)
xf86ConfigDRI.bufs[i].flags = 0; xf86ConfigDRI.bufs[i].flags = 0;
} }
} }
return TRUE;
} }
#endif #endif
static Bool static void
configExtensions(XF86ConfExtensionsPtr conf_ext) configExtensions(XF86ConfExtensionsPtr conf_ext)
{ {
XF86OptionPtr o; XF86OptionPtr o;
@ -2309,11 +2307,9 @@ configExtensions(XF86ConfExtensionsPtr conf_ext)
xf86NameCmp(val, "false") == 0) { xf86NameCmp(val, "false") == 0) {
enable = !enable; enable = !enable;
} else { } else {
xf86Msg(X_ERROR, xf86Msg(X_WARNING, "Ignoring unrecognized value \"%s\"\n", val);
"%s is not a valid value for the Extension option\n",
val);
xfree(n); xfree(n);
return FALSE; continue;
} }
if (EnableDisableExtension(name, enable)) { if (EnableDisableExtension(name, enable)) {
@ -2326,8 +2322,6 @@ configExtensions(XF86ConfExtensionsPtr conf_ext)
xfree(n); xfree(n);
} }
} }
return TRUE;
} }
static Bool static Bool
@ -2457,7 +2451,7 @@ xf86HandleConfigFile(Bool autoconfig)
if (xf86configptr->conf_layout_lst == NULL || xf86ScreenName != NULL) { if (xf86configptr->conf_layout_lst == NULL || xf86ScreenName != NULL) {
if (xf86ScreenName == NULL) { if (xf86ScreenName == NULL) {
xf86Msg(X_WARNING, xf86Msg(X_DEFAULT,
"No Layout section. Using the first Screen section.\n"); "No Layout section. Using the first Screen section.\n");
} }
if (!configImpliedLayout(&xf86ConfigLayout, if (!configImpliedLayout(&xf86ConfigLayout,
@ -2510,19 +2504,17 @@ xf86HandleConfigFile(Bool autoconfig)
} }
/* Now process everything else */ /* Now process everything else */
if (!configServerFlags(xf86configptr->conf_flags,xf86ConfigLayout.options)){
if (!configServerFlags(xf86configptr->conf_flags,
xf86ConfigLayout.options) ||
!configFiles(xf86configptr->conf_files) ||
!configExtensions(xf86configptr->conf_extensions)
#ifdef XF86DRI
|| !configDRI(xf86configptr->conf_dri)
#endif
) {
ErrorF ("Problem when converting the config data structures\n"); ErrorF ("Problem when converting the config data structures\n");
return CONFIG_PARSE_ERROR; return CONFIG_PARSE_ERROR;
} }
configFiles(xf86configptr->conf_files);
configExtensions(xf86configptr->conf_extensions);
#ifdef XF86DRI
configDRI(xf86configptr->conf_dri);
#endif
checkInput(&xf86ConfigLayout); checkInput(&xf86ConfigLayout);
/* /*

View File

@ -1208,31 +1208,3 @@ _X_EXPORT void
DDXRingBell(int volume, int pitch, int duration) { DDXRingBell(int volume, int pitch, int duration) {
xf86OSRingBell(volume, pitch, 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 */

View File

@ -1730,8 +1730,16 @@ xf86PrintBanner()
t.tm_mday = BUILD_DATE % 100; t.tm_mday = BUILD_DATE % 100;
t.tm_mon = (BUILD_DATE / 100) % 100 - 1; t.tm_mon = (BUILD_DATE / 100) % 100 - 1;
t.tm_year = BUILD_DATE / 10000 - 1900; 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)) if (strftime(buf, sizeof(buf), "%d %B %Y", &t))
ErrorF("Build Date: %s\n", buf); ErrorF("Build Date: %s\n", buf);
#endif
} }
#endif #endif
#if defined(CLOG_DATE) && (CLOG_DATE > 19000000) #if defined(CLOG_DATE) && (CLOG_DATE > 19000000)

View File

@ -1890,7 +1890,7 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes,
virtX, virtY, vx, vy); virtX, virtY, vx, vy);
virtX = vx; virtX = vx;
virtY = vy; virtY = vy;
linePitch = miScanLineWidth(vx, vy, linePitch, apertureSize, linePitch = miScanLineWidth(vx, vy, minPitch, apertureSize,
BankFormat, pitchInc); BankFormat, pitchInc);
} }
} }

View File

@ -85,7 +85,7 @@ typedef enum {
*/ */
#define ABI_ANSIC_VERSION SET_ABI_VERSION(0, 3) #define ABI_ANSIC_VERSION SET_ABI_VERSION(0, 3)
#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(2, 0) #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_EXTENSION_VERSION SET_ABI_VERSION(0, 3)
#define ABI_FONT_VERSION SET_ABI_VERSION(0, 5) #define ABI_FONT_VERSION SET_ABI_VERSION(0, 5)

View File

@ -101,7 +101,7 @@ xf86SendDragEvents(DeviceIntPtr device)
{ {
LocalDevicePtr local = (LocalDevicePtr) device->public.devicePrivate; 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); return (local->flags & XI86_SEND_DRAG_EVENTS);
else else
return (TRUE); return (TRUE);
@ -119,10 +119,12 @@ _X_EXPORT void
xf86ProcessCommonOptions(LocalDevicePtr local, xf86ProcessCommonOptions(LocalDevicePtr local,
pointer list) pointer list)
{ {
if (!xf86SetBoolOption(list, "AlwaysCore", 0) || if (xf86SetBoolOption(list, "AlwaysCore", 0) ||
xf86SetBoolOption(list, "SendCoreEvents", 0) || !xf86SetBoolOption(list, "SendCoreEvents", 1) ||
xf86SetBoolOption(list, "CorePointer", 0) || !xf86SetBoolOption(list, "CorePointer", 1) ||
xf86SetBoolOption(list, "CoreKeyboard", 0)) { !xf86SetBoolOption(list, "CoreKeyboard", 1)) {
xf86Msg(X_CONFIG, "%s: doesn't report core events\n", local->name);
} else {
local->flags |= XI86_ALWAYS_CORE; local->flags |= XI86_ALWAYS_CORE;
xf86Msg(X_CONFIG, "%s: always reports core events\n", local->name); xf86Msg(X_CONFIG, "%s: always reports core events\n", local->name);
} }
@ -329,7 +331,7 @@ NewInputDeviceRequest (InputOption *options, DeviceIntPtr *pdev)
return BadAlloc; return BadAlloc;
for (option = options; option; option = option->next) { for (option = options; option; option = option->next) {
if (strcmp(option->key, "driver") == 0) { if (strcasecmp(option->key, "driver") == 0) {
if (idev->driver) { if (idev->driver) {
rval = BadRequest; rval = BadRequest;
goto unwind; goto unwind;
@ -352,8 +354,8 @@ NewInputDeviceRequest (InputOption *options, DeviceIntPtr *pdev)
goto unwind; goto unwind;
} }
} }
if (strcmp(option->key, "name") == 0 || if (strcasecmp(option->key, "name") == 0 ||
strcmp(option->key, "identifier") == 0) { strcasecmp(option->key, "identifier") == 0) {
if (idev->identifier) { if (idev->identifier) {
rval = BadRequest; rval = BadRequest;
goto unwind; goto unwind;
@ -460,26 +462,47 @@ xf86PostMotionEvent(DeviceIntPtr device,
...) ...)
{ {
va_list var; va_list var;
int i = 0, nevents = 0; int i = 0;
int dx, dy; static int *valuators = NULL;
Bool drag = xf86SendDragEvents(device); static int n_valuators = 0;
int *valuators = NULL;
int flags = 0;
xEvent *xE = NULL;
int index;
if (is_absolute) if (num_valuators > n_valuators) {
flags = POINTER_ABSOLUTE; xfree (valuators);
else valuators = NULL;
flags = POINTER_RELATIVE | POINTER_ACCELERATE; }
if (!valuators) {
valuators = xcalloc(sizeof(int), num_valuators); valuators = xcalloc(sizeof(int), num_valuators);
n_valuators = num_valuators;
}
va_start(var, num_valuators); va_start(var, num_valuators);
for (i = 0; i < num_valuators; i++) for (i = 0; i < num_valuators; i++)
valuators[i] = va_arg(var, int); valuators[i] = va_arg(var, int);
va_end(var); 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 XFreeXDGA
if (first_valuator == 0 && num_valuators >= 2) { if (first_valuator == 0 && num_valuators >= 2) {
if (miPointerGetScreen(inputInfo.pointer)) { if (miPointerGetScreen(inputInfo.pointer)) {
@ -493,7 +516,7 @@ xf86PostMotionEvent(DeviceIntPtr device,
dy = valuators[1]; dy = valuators[1];
} }
if (DGAStealMotionEvent(index, dx, dy)) if (DGAStealMotionEvent(index, dx, dy))
goto out; return;
} }
} }
#endif #endif
@ -515,9 +538,6 @@ xf86PostMotionEvent(DeviceIntPtr device,
mieqEnqueue(device, xf86Events + i); mieqEnqueue(device, xf86Events + i);
} }
} }
out:
xfree(valuators);
} }
_X_EXPORT void _X_EXPORT void

View File

@ -163,6 +163,8 @@ extern InputInfoPtr xf86InputDevs;
void InitExtInput(void); void InitExtInput(void);
void xf86PostMotionEvent(DeviceIntPtr device, int is_absolute, void xf86PostMotionEvent(DeviceIntPtr device, int is_absolute,
int first_valuator, int num_valuators, ...); 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, void xf86PostProximityEvent(DeviceIntPtr device, int is_in,
int first_valuator, int num_valuators, ...); int first_valuator, int num_valuators, ...);
void xf86PostButtonEvent(DeviceIntPtr device, int is_absolute, int button, void xf86PostButtonEvent(DeviceIntPtr device, int is_absolute, int button,

View File

@ -979,6 +979,9 @@ xf86XVEnlistPortInWindow(WindowPtr pWin, XvPortRecPrivatePtr portPriv)
winPriv->next = PrivRoot; winPriv->next = PrivRoot;
pWin->devPrivates[XF86XVWindowIndex].ptr = (pointer)winPriv; pWin->devPrivates[XF86XVWindowIndex].ptr = (pointer)winPriv;
} }
portPriv->pDraw = (DrawablePtr)pWin;
return Success; return Success;
} }
@ -1375,7 +1378,6 @@ xf86XVPutVideo(
result = xf86XVEnlistPortInWindow((WindowPtr)pDraw, portPriv); result = xf86XVEnlistPortInWindow((WindowPtr)pDraw, portPriv);
if(result != Success) return result; if(result != Success) return result;
portPriv->pDraw = pDraw;
portPriv->type = XvInputMask; portPriv->type = XvInputMask;
/* save a copy of these parameters */ /* save a copy of these parameters */
@ -1479,7 +1481,6 @@ xf86XVPutStill(
xf86XVEnlistPortInWindow((WindowPtr)pDraw, portPriv); xf86XVEnlistPortInWindow((WindowPtr)pDraw, portPriv);
portPriv->isOn = XV_ON; portPriv->isOn = XV_ON;
portPriv->pDraw = pDraw;
portPriv->drw_x = drw_x; portPriv->drw_y = drw_y; portPriv->drw_x = drw_x; portPriv->drw_y = drw_y;
portPriv->drw_w = drw_w; portPriv->drw_h = drw_h; portPriv->drw_w = drw_w; portPriv->drw_h = drw_h;
portPriv->type = 0; /* no mask means it's transient and should portPriv->type = 0; /* no mask means it's transient and should
@ -1529,7 +1530,6 @@ xf86XVGetVideo(
result = xf86XVEnlistPortInWindow((WindowPtr)pDraw, portPriv); result = xf86XVEnlistPortInWindow((WindowPtr)pDraw, portPriv);
if(result != Success) return result; if(result != Success) return result;
portPriv->pDraw = pDraw;
portPriv->type = XvOutputMask; portPriv->type = XvOutputMask;
/* save a copy of these parameters */ /* save a copy of these parameters */
@ -1784,7 +1784,6 @@ xf86XVPutImage(
(portPriv->AdaptorRec->flags & VIDEO_OVERLAID_IMAGES)) { (portPriv->AdaptorRec->flags & VIDEO_OVERLAID_IMAGES)) {
portPriv->isOn = XV_ON; portPriv->isOn = XV_ON;
portPriv->pDraw = pDraw;
portPriv->drw_x = drw_x; portPriv->drw_y = drw_y; portPriv->drw_x = drw_x; portPriv->drw_y = drw_y;
portPriv->drw_w = drw_w; portPriv->drw_h = drw_h; portPriv->drw_w = drw_w; portPriv->drw_h = drw_h;
portPriv->type = 0; /* no mask means it's transient and should 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 _X_EXPORT void
xf86XVFillKeyHelper (ScreenPtr pScreen, CARD32 key, RegionPtr clipboxes) xf86XVFillKeyHelper (ScreenPtr pScreen, CARD32 key, RegionPtr clipboxes)
{ {
XF86XVScreenPtr ScreenPriv = GET_XF86XV_SCREEN(pScreen);
DrawablePtr root = &WindowTable[pScreen->myNum]->drawable; DrawablePtr root = &WindowTable[pScreen->myNum]->drawable;
XID pval[2]; XID pval[2];
BoxPtr pbox = REGION_RECTS(clipboxes); BoxPtr pbox = REGION_RECTS(clipboxes);
int i, nbox = REGION_NUM_RECTS(clipboxes); int i, nbox = REGION_NUM_RECTS(clipboxes);
xRectangle *rects; xRectangle *rects;
GCPtr gc;
if(!xf86Screens[pScreen->myNum]->vtSema) return; if(!xf86Screens[pScreen->myNum]->vtSema) return;
if(!ScreenPriv->videoGC) { gc = GetScratchGC(root->depth, pScreen);
int status;
pval[0] = key; pval[0] = key;
pval[1] = IncludeInferiors; pval[1] = IncludeInferiors;
ScreenPriv->videoGC = CreateGC(root, GCForeground | GCSubwindowMode, (void) ChangeGC(gc, GCForeground|GCSubwindowMode, pval);
pval, &status); ValidateGC(root, gc);
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);
}
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].x = pbox->x1;
rects[i].y = pbox->y1; rects[i].y = pbox->y1;
rects[i].width = pbox->x2 - pbox->x1; rects[i].width = pbox->x2 - pbox->x1;
rects[i].height = pbox->y2 - pbox->y1; rects[i].height = pbox->y2 - pbox->y1;
} }
(*ScreenPriv->videoGC->ops->PolyFillRect)( (*gc->ops->PolyFillRect)(root, gc, nbox, rects);
root, ScreenPriv->videoGC, nbox, rects);
DEALLOCATE_LOCAL(rects); xfree (rects);
FreeScratchGC (gc);
} }
/* xf86XVClipVideoHelper - /* xf86XVClipVideoHelper -

View File

@ -1,9 +1,9 @@
sdk_HEADERS = edid.h vdif.h xf86DDC.h sdk_HEADERS = edid.h xf86DDC.h
noinst_LIBRARIES = libddc.a noinst_LIBRARIES = libddc.a
libddc_a_SOURCES = xf86DDC.c edid.c interpret_edid.c print_edid.c \ 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 INCLUDES = $(XORG_INCS) -I$(srcdir)/../i2c

View File

@ -35,7 +35,6 @@
#define EDID1_ATOM_NAME "XFree86_DDC_EDID1_RAWDATA" #define EDID1_ATOM_NAME "XFree86_DDC_EDID1_RAWDATA"
#define EDID2_ATOM_NAME "XFree86_DDC_EDID2_RAWDATA" #define EDID2_ATOM_NAME "XFree86_DDC_EDID2_RAWDATA"
#define VDIF_ATOM_NAME "XFree86_DDC_VDIF_RAWDATA"
static void static void
addRootWindowProperties(ScrnInfoPtr pScrn, xf86MonPtr DDC) addRootWindowProperties(ScrnInfoPtr pScrn, xf86MonPtr DDC)
@ -103,16 +102,6 @@ addRootWindowProperties(ScrnInfoPtr pScrn, xf86MonPtr DDC)
xf86RegisterRootWindowProperty(scrnIndex, EDID2Atom, XA_INTEGER, 8, xf86RegisterRootWindowProperty(scrnIndex, EDID2Atom, XA_INTEGER, 8,
256, (unsigned char *)EDID2rawdata); 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 Bool

View File

@ -12,8 +12,6 @@
#ifndef _EDID_H_ #ifndef _EDID_H_
#define _EDID_H_ #define _EDID_H_
#include "vdif.h"
/* read complete EDID record */ /* read complete EDID record */
#define EDID1_LEN 128 #define EDID1_LEN 128
#define BITS_PER_BYTE 9 #define BITS_PER_BYTE 9
@ -453,7 +451,7 @@ typedef struct {
struct established_timings timings1; struct established_timings timings1;
struct std_timings timings2[8]; struct std_timings timings2[8];
struct detailed_monitor_section det_mon[4]; struct detailed_monitor_section det_mon[4];
xf86vdifPtr vdif; void *vdif; /* unused */
int no_sections; int no_sections;
Uchar *rawData; Uchar *rawData;
} xf86Monitor, *xf86MonPtr; } xf86Monitor, *xf86MonPtr;

View File

@ -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

View File

@ -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;
}
}

View File

@ -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

View File

@ -38,12 +38,6 @@ static unsigned char* EDID1Read_DDC2(
I2CBusPtr pBus I2CBusPtr pBus
); );
static unsigned char * VDIFRead(
int scrnIndex,
I2CBusPtr pBus,
int start
);
static unsigned char * DDCRead_DDC2( static unsigned char * DDCRead_DDC2(
int scrnIndex, int scrnIndex,
I2CBusPtr pBus, I2CBusPtr pBus,
@ -138,7 +132,6 @@ xf86DoEDID_DDC2(int scrnIndex, I2CBusPtr pBus)
{ {
ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
unsigned char *EDID_block = NULL; unsigned char *EDID_block = NULL;
unsigned char *VDIF_Block = NULL;
xf86MonPtr tmp = NULL; xf86MonPtr tmp = NULL;
/* Default DDC and DDC2 to enabled. */ /* Default DDC and DDC2 to enabled. */
Bool noddc = FALSE, noddc2 = FALSE; Bool noddc = FALSE, noddc2 = FALSE;
@ -171,11 +164,6 @@ xf86DoEDID_DDC2(int scrnIndex, I2CBusPtr pBus)
else else
ErrorF("Sections to follow: %i\n",tmp->no_sections); ErrorF("Sections to follow: %i\n",tmp->no_sections);
#endif #endif
if (tmp) {
VDIF_Block =
VDIFRead(scrnIndex, pBus, EDID1_LEN * (tmp->no_sections + 1));
tmp->vdif = xf86InterpretVdif(VDIF_Block);
}
return tmp; return tmp;
} }
@ -253,35 +241,6 @@ EDID1Read_DDC2(int scrnIndex, I2CBusPtr pBus)
return DDCRead_DDC2(scrnIndex, pBus, 0, EDID1_LEN); 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 * static unsigned char *
DDCRead_DDC2(int scrnIndex, I2CBusPtr pBus, int start, int len) DDCRead_DDC2(int scrnIndex, I2CBusPtr pBus, int start, int len)
{ {

View File

@ -43,10 +43,6 @@ extern xf86MonPtr xf86InterpretEDID(
int screenIndex, Uchar *block int screenIndex, Uchar *block
); );
extern xf86vdifPtr xf86InterpretVdif(
CARD8 *c
);
extern void extern void
xf86DDCMonitorSet(int scrnIndex, MonPtr Monitor, xf86MonPtr DDC); xf86DDCMonitorSet(int scrnIndex, MonPtr Monitor, xf86MonPtr DDC);
@ -55,10 +51,6 @@ extern Bool xf86SetDDCproperties(
xf86MonPtr DDC xf86MonPtr DDC
); );
extern void xf86print_vdif(
xf86vdifPtr v
);
DisplayModePtr xf86DDCGetModes(int scrnIndex, xf86MonPtr DDC); DisplayModePtr xf86DDCGetModes(int scrnIndex, xf86MonPtr DDC);
#endif #endif

File diff suppressed because it is too large Load Diff

View File

@ -1518,6 +1518,10 @@ DRIGetDrawableInfo(ScreenPtr pScreen,
if (x1 > pScreen->width) x1 = pScreen->width; if (x1 > pScreen->width) x1 = pScreen->width;
if (y1 > pScreen->height) y1 = pScreen->height; if (y1 > pScreen->height) y1 = pScreen->height;
if (y0 >= y1 || x0 >= x1) {
*numBackClipRects = 0;
*pBackClipRects = NULL;
} else {
pDRIPriv->private_buffer_rect.x1 = x0; pDRIPriv->private_buffer_rect.x1 = x0;
pDRIPriv->private_buffer_rect.y1 = y0; pDRIPriv->private_buffer_rect.y1 = y0;
pDRIPriv->private_buffer_rect.x2 = x1; pDRIPriv->private_buffer_rect.x2 = x1;
@ -1525,6 +1529,7 @@ DRIGetDrawableInfo(ScreenPtr pScreen,
*numBackClipRects = 1; *numBackClipRects = 1;
*pBackClipRects = &(pDRIPriv->private_buffer_rect); *pBackClipRects = &(pDRIPriv->private_buffer_rect);
}
} else { } else {
/* Use the frontbuffer cliprects for back buffers. */ /* Use the frontbuffer cliprects for back buffers. */
*numBackClipRects = 0; *numBackClipRects = 0;
@ -1863,11 +1868,15 @@ DRITreeTraversal(WindowPtr pWin, pointer data)
if(pDRIDrawablePriv) { if(pDRIDrawablePriv) {
ScreenPtr pScreen = pWin->drawable.pScreen; ScreenPtr pScreen = pWin->drawable.pScreen;
DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
if(REGION_NUM_RECTS(&(pWin->clipList)) > 0) {
RegionPtr reg = (RegionPtr)data; RegionPtr reg = (RegionPtr)data;
REGION_UNION(pScreen, reg, reg, &(pWin->clipList)); REGION_UNION(pScreen, reg, reg, &(pWin->clipList));
pDRIPriv->nrWalked++;
}
if(pDRIPriv->nrWindows == 1) if(pDRIPriv->nrWindows == pDRIPriv->nrWalked)
return WT_STOPWALKING; return WT_STOPWALKING;
} }
return WT_WALKCHILDREN; return WT_WALKCHILDREN;
@ -1885,6 +1894,7 @@ DRICopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
RegionRec reg; RegionRec reg;
REGION_NULL(pScreen, &reg); REGION_NULL(pScreen, &reg);
pDRIPriv->nrWalked = 0;
TraverseTree(pWin, DRITreeTraversal, (pointer)(&reg)); TraverseTree(pWin, DRITreeTraversal, (pointer)(&reg));
if(REGION_NOTEMPTY(pScreen, &reg)) { if(REGION_NOTEMPTY(pScreen, &reg)) {

View File

@ -88,6 +88,6 @@ driSetup(pointer module, pointer opts, int *errmaj, int *errmin)
drmSetServerInfo(&DRIDRMServerInfo); drmSetServerInfo(&DRIDRMServerInfo);
/* Need a non-NULL return value to indicate success */ /* Need a non-NULL return value to indicate success */
return 1; return (pointer)1;
} }

View File

@ -452,7 +452,7 @@ ProcXF86DRIGetDrawableInfo(
xXF86DRIGetDrawableInfoReply rep; xXF86DRIGetDrawableInfoReply rep;
DrawablePtr pDrawable; DrawablePtr pDrawable;
int X, Y, W, H; int X, Y, W, H;
drm_clip_rect_t * pClipRects; drm_clip_rect_t * pClipRects, *pClippedRects;
drm_clip_rect_t * pBackClipRects; drm_clip_rect_t * pBackClipRects;
int backX, backY, rc; int backX, backY, rc;
@ -502,8 +502,35 @@ ProcXF86DRIGetDrawableInfo(
if (rep.numBackClipRects) if (rep.numBackClipRects)
rep.length += sizeof(drm_clip_rect_t) * 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 += sizeof(drm_clip_rect_t) * rep.numClipRects;
}
rep.length = ((rep.length + 3) & ~3) >> 2; rep.length = ((rep.length + 3) & ~3) >> 2;
@ -512,7 +539,8 @@ ProcXF86DRIGetDrawableInfo(
if (rep.numClipRects) { if (rep.numClipRects) {
WriteToClient(client, WriteToClient(client,
sizeof(drm_clip_rect_t) * rep.numClipRects, sizeof(drm_clip_rect_t) * rep.numClipRects,
(char *)pClipRects); (char *)pClippedRects);
xfree(pClippedRects);
} }
if (rep.numBackClipRects) { if (rep.numBackClipRects) {

View File

@ -96,6 +96,11 @@
#endif #endif
#include "xf86DDC.h" #include "xf86DDC.h"
#include "edid.h" #include "edid.h"
#include "xf86Cursor.h"
#include "xf86RamDac.h"
#include "BT.h"
#include "IBM.h"
#include "TI.h"
#ifndef HAS_GLIBC_SIGSETJMP #ifndef HAS_GLIBC_SIGSETJMP
#if defined(setjmp) && defined(__GNU_LIBRARY__) && \ #if defined(setjmp) && defined(__GNU_LIBRARY__) && \
@ -1231,8 +1236,6 @@ _X_HIDDEN void *xfree86LookupTab[] = {
SYMFUNC(xf86DoEDID_DDC2) SYMFUNC(xf86DoEDID_DDC2)
SYMFUNC(xf86InterpretEDID) SYMFUNC(xf86InterpretEDID)
SYMFUNC(xf86PrintEDID) SYMFUNC(xf86PrintEDID)
SYMFUNC(xf86InterpretVdif)
SYMFUNC(xf86print_vdif)
SYMFUNC(xf86DDCMonitorSet) SYMFUNC(xf86DDCMonitorSet)
SYMFUNC(xf86SetDDCproperties) SYMFUNC(xf86SetDDCproperties)
@ -1255,4 +1258,50 @@ _X_HIDDEN void *xfree86LookupTab[] = {
SYMFUNC(xf86I2CWriteRead) SYMFUNC(xf86I2CWriteRead)
SYMFUNC(xf86I2CWriteVec) SYMFUNC(xf86I2CWriteVec)
SYMFUNC(xf86I2CWriteWord) 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)
}; };

View File

@ -1217,8 +1217,15 @@ xf86ProbeOutputModes (ScrnInfoPtr scrn, int maxX, int maxY)
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
int o; int o;
if (maxX == 0 || maxY == 0) /* When canGrow was TRUE in the initial configuration we have to
xf86RandR12GetOriginalVirtualSize (scrn, &maxX, &maxY); * 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 */ /* Elide duplicate modes before defaulting code uses them */
xf86PruneDuplicateMonitorModes (scrn->monitor); xf86PruneDuplicateMonitorModes (scrn->monitor);

View File

@ -71,6 +71,10 @@ static Bool quirk_dt_sync_hm_vp (int scrnIndex, xf86MonPtr DDC)
if (memcmp (DDC->vendor.name, "VSC", 4) == 0 && if (memcmp (DDC->vendor.name, "VSC", 4) == 0 &&
DDC->vendor.prod_id == 58653) DDC->vendor.prod_id == 58653)
return TRUE; return TRUE;
/* Samsung SyncMaster 205BW */
if (memcmp (DDC->vendor.name, "SAM", 4) == 0 &&
DDC->vendor.prod_id == 541)
return TRUE;
return FALSE; return FALSE;
} }

View File

@ -27,7 +27,7 @@
#include <xorg-config.h> #include <xorg-config.h>
#endif #endif
#if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT) #if defined (SYSCONS_SUPPORT)
#include <sys/kbio.h> #include <sys/kbio.h>
#endif #endif
@ -77,7 +77,7 @@ xf86OSRingBell(int loudness, int pitch, int duration)
wsb.pitch = pitch; wsb.pitch = pitch;
wsb.period = duration; wsb.period = duration;
wsb.volume = loudness; wsb.volume = loudness;
ioctl(KBD_FD(xf86Info), WSKBDIO_COMPLEXBELL, ioctl(xf86Info.consoleFd, WSKBDIO_COMPLEXBELL,
&wsb); &wsb);
break; break;
#endif #endif

View File

@ -50,6 +50,11 @@
#include <machine/mtrr.h> #include <machine/mtrr.h>
#include <machine/sysarch.h> #include <machine/sysarch.h>
#include <sys/queue.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 #endif
#if defined(__OpenBSD__) && defined(__amd64__) #if defined(__OpenBSD__) && defined(__amd64__)

View File

@ -788,8 +788,10 @@ xf86ReadDomainMemory(PCITAG Tag, ADDRESS Base, int Len, unsigned char *Buf)
write(fd, "1", 2); write(fd, "1", 2);
lseek(fd, 0, SEEK_SET); lseek(fd, 0, SEEK_SET);
len = min(Len, st.st_size);
/* copy the ROM until we hit Len, EOF or read error */ /* 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); write(fd, "0", 2);

View File

@ -117,49 +117,29 @@ xf86LinearVidMem()
/************************************************************************** /**************************************************************************
* I/O Permissions section * 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 Bool
xf86EnableIO() xf86EnableIO()
{ {
mach_port_t device; if (ioperm(0, 0xffff, 1)) {
kern_return_t err; FatalError("xf86EnableIO: ioperm() failed (%s)\n", strerror(errno));
return FALSE;
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));
} }
ioperm(0x40,4,0); /* trap access to the timer chip */
ioperm(0x60,4,0); /* trap access to the keyboard controller */
return TRUE; return TRUE;
} }
void void
xf86DisableIO() xf86DisableIO()
{ {
kern_return_t err; ioperm(0,0xffff,0);
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);
return; return;
} }

View File

@ -567,7 +567,7 @@ xf86EnableIO(void)
#endif #endif
} }
close(fd); 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 (ioperm(0, 1024, 1) || iopl(3)) {
if (errno == ENODEV) if (errno == ENODEV)
ErrorF("xf86EnableIOPorts: no I/O ports found\n"); ErrorF("xf86EnableIOPorts: no I/O ports found\n");

View File

@ -27,238 +27,402 @@
.\" .\"
.\" $XFree86: xc/programs/Xserver/hw/xnest/Xnest.man,v 1.6 2001/01/27 18:21:00 dawes Exp $ .\" $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 .SH NAME
Xnest \- a nested X server Xnest \- a nested X server
.SH SYNOPSIS .SH SYNOPSIS
.B Xnest .B Xnest
[-options] [
.I options
]
.SH DESCRIPTION .SH DESCRIPTION
\fIXnest\fP is a client and a server. \fIXnest\fP is a client of the .B Xnest
real server which manages windows and graphics requests on its behalf. is both an X client and an X server.
\fIXnest\fP is a server to its own clients. \fIXnest\fP manages .B Xnest
windows and graphics requests on their behalf. To these clients is a client of the real server which manages windows and graphics requests on
\fIXnest\fP appears to be a conventional server. 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 .SH OPTIONS
\fIXnest\fP supports all standard options of the sample server .B Xnest
implementation. For more details, please see the manual page on your supports all standard options of the sample server implementation.
system for \fIXserver\fP. The following additional arguments are For more details, please see
supported as well. .BR Xserver (__appmansuffix__).
.TP 4 The following additional arguments are supported as well.
.B \-display \fIstring\fP .TP
.BI "\-display " string
This option specifies the display name of the real server that 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 .B Xnest
command line \fIXnest\fP will read the \fIDISPLAY\fP environment should try to connect to.
variable in order to find out the same information. If it is not provided on the command line,
.TP 4 .B Xnest
will read the
.I DISPLAY
environment variable in order to find out this information.
.TP
.B \-sync .B \-sync
This option tells \fIXnest\fP to synchronize its window and graphics This option tells
operations with the real server. This is a useful option for .B Xnest
debugging, but it will slow down the performance considerably. It to synchronize its window and graphics operations with the real server.
should not be used unless absolutely necessary. This is a useful option for debugging, but it will slow down
.TP 4 .BR Xnest 's
performance considerably.
It should not be used unless absolutely necessary.
.TP
.B \-full .B \-full
This option tells \fIXnest\fP to utilize full regeneration of real This option tells
server objects and reopen a new connection to the real server each .B Xnest
time the nested server regenerates. The sample server implementation to utilize full regeneration of real server objects and reopen a new connection
regenerates all objects in the server when the last client of this to the real server each time the nested server regenerates.
server terminates. When this happens, \fIXnest\fP by default The sample server implementation regenerates all objects in the server when the
maintains the same top level window and the same real server last client of this server terminates.
connection in each new generation. If the user selects full When this happens,
regeneration, even the top level window and the connection to the real .B Xnest
server will be regenerated for each server generation. by default maintains the same top-level window and the same real server
.TP 4 connection in each new generation.
.B \-class \fIstring\fP 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. 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 It is similar to the
except that it will accept a string rather than a number for the .B \-cc
visual class specification. The string must be one of the following option from the set of standard options except that it will accept a string
six values: \fIStaticGray\fP, \fIGrayScale\fP, \fIStaticColor\fP, rather than a number for the visual class specification.
\fIPseudoColor\fP, \fITrueColor\fP, or \fIDirectColor\fP. If both, The
\fI-class\fP and \fI-cc\fP options are specified, the last instance of .I string
either option assumes precedence. The class of the default visual of must be one of the following six values:
the nested server need not be the same as the class of the default .BR StaticGray ,
visual of the real server; although, it has to be supported by the .BR GrayScale ,
real server. See \fIxdpyinfo\fP for a list of supported visual .BR StaticColor ,
classes on the real server before starting \fIXnest\fP. If the user .BR PseudoColor ,
chooses a static class, all the colors in the default colormap will be .BR TrueColor ,
preallocated. If the user chooses a dynamic class, colors in the or
default colormap will be available to individual clients for .BR DirectColor .
allocation. If both the
.TP 4 .B \-class
.B \-depth \fIint\fP 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. 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 The depth of the default visual of the nested server need not be the same as the
same as the depth of the default visual of the real server; although, depth of the default visual of the real server, but it must be supported by the
it has to be supported by the real server. See \fIxdpyinfo\fP for a real server.
list of supported visual depths on the real server before starting Use
\fIXnest\fP. .BR xdpyinfo (__appmansuffix__)
.TP 4 to obtain a list of supported visual depths on the real server before starting
.BR Xnest .
.TP
.B \-sss .B \-sss
This option tells \fIXnest\fP to use the software screen saver. By This option tells
default \fIXnest\fP will use the screen saver that corresponds to the .B Xnest
hardware screen saver in the real server. Of course, even this screen to use the software screen saver.
saver is software generated since \fIXnest\fP does not control any By default,
actual hardware. However, it is treated as a hardware screen saver .B Xnest
within the sample server code. will use the screen saver that corresponds to the hardware screen saver in the
.TP 4 real server.
.B \-geometry \fIWxH+X+Y\fP Of course, even this screen saver is software-generated since
This option specifies geometry parameters for the top level .B Xnest
\fIXnest\fP windows. These windows corresponds to the root windows of does not control any actual hardware.
the nested server. The width and height specified with this option However, it is treated as a hardware screen saver within the sample server code.
will be the maximum width and height of each top level \fIXnest\fP .TP
window. \fIXnest\fP will allow the user to make any top level window .B \-geometry \fIW\fBx\fIH\fB+\fIX\fB+\fIY\fP
smaller, but it will not actually change the size of the nested server This option specifies the geometry parameters for the top-level
root window. As of yet, there is no mechanism within the sample .B Xnest
server implementation to change the size of the root window after window.
screen initialization. In order to do so, one would probably need to See \(lqGEOMETRY SPECIFICATIONS\(rq in
extend the X protocol. Therefore, it is not likely that this will be .BR X (__miscmansuffix__)
available any time soon. If this option is not specified \fIXnest\fP for a discusson of this option's syntax.
will choose width and height to be 3/4 of the dimensions of the root This window corresponds to the root window of the nested server.
window of the real server. The width
.TP 4 .I W
.B \-bw \fIint\fP and height
This option specifies the border width of the top level \fIXnest\fP .I H
window. The integer parameter must be a positive number. The default specified with this option will be the maximum width and height of each
border width is 1. top-level
.TP 4 .B Xnest
.B \-name \fIstring\fP window.
This option specifies the name of the top level \fIXnest\fP 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. The default value is the program name.
.TP 4 .TP
.B \-scrns \fIint\fP .BI "\-scrns " int
This option specifies the number of screens to create in the nested This option specifies the number of screens to create in the nested server.
server. For each screen, \fIXnest\fP will create a separate top level For each screen,
window. Each screen is referenced by the number after the dot in the .B Xnest
client display name specification. For example, \fIxterm -display will create a separate top-level window.
:1.1\fP will open an \fIxterm\fP client in the nested server with the Each screen is referenced by the number after the dot in the client display name
display number \fI:1\fP on the second screen. The number of screens specification.
is limited by the hard coded constant in the server sample code which For example,
is usually 3. .B xterm \-display :1.1
.TP 4 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 .B \-install
This option tells \fIXnest\fP to do its own colormap installation by This option tells
bypassing the real window manager. For it to work properly the user .B Xnest
will probably have to temporarily quit the real window manager. By to do its own color map installation by bypassing the real window manager.
default \fIXnest\fP will keep the nested client window whose colormap For it to work properly, the user will probably have to temporarily quit the
should be installed in the real server in the real window manager.
\fIWM\_COLORMAP\_WINDOWS\fP property of the top level \fIXnest\fP By default,
window. If this colormap is of the same visual type as the root .B Xnest
window of the nested server, \fIXnest\fP will associate this colormap will keep the nested client window whose color map should be installed in the
with the top level \fIXnest\fP window as well. Since this does not real server in the
have to be the case, window managers should look primarily at the .I WM_COLORMAP_WINDOWS
\fIWM\_COLORMAP\_WINDOWS\fP property rather than the colormap property of the top-level
associated with the top level \fIXnest\fP window. Unfortunately, .B Xnest
window managers are not very good at doing that yet so this option window.
might come in handy. If this color map is of the same visual type as the root window of the nested
.TP 4 server,
.B \-parent \fIwindow_id\fP .B Xnest
This option tells \fIXnest\fP to use the \fIwindow_id\fP as the will associate this color map with the top-level
root window instead of creating a window. This option is used .B Xnest
by the xrx xnestplugin. window as well.
.SH USAGE Since this does not have to be the case, window managers should look primarily
Starting up \fIXnest\fP is as simple as starting up \fIxclock\fP from at the
a terminal emulator. If a user wishes to run \fIXnest\fP on the same .I WM_COLORMAP_WINDOWS
workstation as the real server, it is important that the nested server property rather than the color map associated with the top-level
is given its own listening socket address. Therefore, if there is a .B Xnest
server already running on the user's workstation, \fIXnest\fP will window.
have to be started up with a new display number. Since there is .\" Is the following still true? This sentence is several years old.
usually no more than one server running on a workstation, specifying Unfortunately, window managers are not very good at doing that yet so this
\fIXnest :1\fP on the command line will be sufficient for most users. option might come in handy.
For each server running on the workstation the display number needs to .TP
be incremented by one. Thus, if you wish to start another .BI "\-parent " window_id
\fIXnest\fP, you will need to type \fIXnest :2\fP on the command line. 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 .PP
To run clients in the nested server each client needs to be given the To run clients in the nested server, each client needs to be given the same
same display number as the nested server. For example, \fIxterm display number as the nested server.
-display :1\fP will start up an \fIxterm\fP in the first nested server For example,
and \fIxterm -display :2\fP will start an \fIxterm\fP in the second .RB \(oq "xterm \-display :1" \(cq
nested server from the example above. Additional clients can be will start up an
started from these \fIxterm\fPs in each nested server. .B xterm
.SH XNEST AS A CLIENT process in the first nested server
\fIXnest\fP behaves and looks to the real server and other real and
clients as another real client. It is a rather demanding client, .RB \(oq "xterm \-display :2" \(cq
however, since almost any window or graphics request from a nested will start an
client will result in a window or graphics request from \fIXnest\fP to .B xterm
the real server. Therefore, it is desirable that \fIXnest\fP and the in the second nested server from the example above.
real server are on a local network, or even better, on the same Additional clients can be started from these
machine. As of now, \fIXnest\fP assumes that the real server supports .BR xterm s
the shape extension. There is no way to turn off this assumption in each nested server.
dynamically. \fIXnest\fP can be compiled without the shape extension .SS "Xnest as a client"
built in, and in that case the real server need not support it. The .B Xnest
dynamic shape extension selection support should be considered in behaves and looks to the real server and other real clients as another real
further development of \fIXnest\fP. 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 .PP
Since \fIXnest\fP need not use the same default visual as the the real Since
server, the top level window of the \fIXnest\fP client always has its .B Xnest
own colormap. This implies that other windows' colors will not be need not use the same default visual as the the real server, the top-level
displayed properly while the keyboard or pointer focus is in the window of the
\fIXnest\fP window, unless the real server has support for more than .B Xnest
one installed colormap at any time. The colormap associated with the client always has its own color map.
top window of the \fIXnest\fP client need not be the appropriate This implies that other windows' colors will not be displayed properly while the
colormap that the nested server wants installed in the real server. keyboard or pointer focus is in the
In the case that a nested client attempts to install a colormap of a .B Xnest
different visual from the default visual of the nested server, window, unless the real server has support for more than one installed color map
\fIXnest\fP will put the top window of this nested client and all at any time.
other top windows of the nested clients that use the same colormap The color map associated with the top window of the
into the \fIWM\_COLORMAP\_WINDOWS\fP property of the top level .B Xnest
\fIXnest\fP window on the real server. Thus, it is important that the client need not be the appropriate color map that the nested server wants
real window manager that manages the \fIXnest\fP top level window installed in the real server.
looks at the \fIWM\_COLORMAP\_WINDOWS\fP property rather than the In the case that a nested client attempts to install a color map of a different
colormap associated with the top level \fIXnest\fP window. Since most visual from the default visual of the nested server,
window managers appear to not implement this convention properly as of .B Xnest
yet, \fIXnest\fP can optionally do direct installation of colormaps will put the top window of this nested client and all other top windows of the
into the real server bypassing the real window manager. If the user nested clients that use the same color map into the
chooses this option, it is usually necessary to temporarily disable .I WM_COLORMAP_WINDOWS
the real window manager since it will interfere with the \fIXnest\fP 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. scheme of color map installation.
.PP .PP
Keyboard and pointer control procedures of the nested server change Keyboard and pointer control procedures of the nested server change the keyboard
the keyboard and pointer control parameters of the real server. and pointer control parameters of the real server.
Therefore, after \fIXnest\fP is started up, it will change the Therefore, after
keyboard and pointer controls of the real server to its own internal .B Xnest
defaults. Perhaps there should be a command line option to tell is started up, it will change the keyboard and pointer controls of the real
\fIXnest\fP to inherit the keyboard and pointer control parameters server to its own internal defaults.
from the real server rather than imposing its own. This is a future .SS "Xnest as a server"
consideration. .B Xnest
.SH XNEST AS A SERVER as a server looks exactly like a real server to its own clients.
\fIXnest\fP as a server looks exactly like a real server to its own For the clients, there is no way of telling if they are running on a real or a
clients. For the clients there is no way of telling if they are nested server.
running on a real or a nested server.
.PP .PP
As already mentioned, \fIXnest\fP is a very user friendly server when As already mentioned,
it comes to customization. \fIXnest\fP will pick up a number of .B Xnest
command line arguments that can configure its default visual class and is a very user-friendly server when it comes to customization.
depth, number of screens, etc. In the future, \fIXnest\fP should read .B Xnest
a customization input file to provide even greater freedom and will pick up a number of command-line arguments that can configure its default
simplicity in selecting the desired layout. Unfortunately, there is visual class and depth, number of screens, etc.
no support for backing store and save under as of yet, but this should
also be considered in the future development of \fIXnest\fP.
.PP .PP
The only apparent intricacy from the users' perspective about using The only apparent intricacy from the users' perspective about using
\fIXnest\fP as a server is the selection of fonts. \fIXnest\fP .B Xnest
manages fonts by loading them locally and then passing the font name as a server is the selection of fonts.
to the real server and asking it to load that font remotely. This .B Xnest
approach avoids the overload of sending the glyph bits across the manages fonts by loading them locally and then passing the font name to the real
network for every text operation, although it is really a bug. The server and asking it to load that font remotely.
proper implementation of fonts should be moved into the \fIos\fP This approach avoids the overload of sending the glyph bits across the network
layer. The consequence of this approach is that the user will have to for every text operation, although it is really a bug.
worry about two different font paths - a local one for the nested The consequence of this approach is that the user will have to worry about two
server and a remote one for the real server - since \fIXnest\fP does different font paths \(em a local one for the nested server and a remote one for
not propagate its font path to the real server. The reason for this the real server \(em since
is because real and nested servers need not run on the same file .B Xnest
system which makes the two font paths mutually incompatible. Thus, if does not propagate its font path to the real server.
there is a font in the local font path of the nested server, there is The reason for this is because real and nested servers need not run on the same
no guarantee that this font exists in the remote font path of the real file system which makes the two font paths mutually incompatible.
server. \fIXlsfonts\fP client, if run on the nested server will list Thus, if there is a font in the local font path of the nested server, there is
fonts in the local font path and if run on the real server will list no guarantee that this font exists in the remote font path of the real server.
fonts in the remote font path. Before a font can be successfully The
opened by the nested server it has to exist in local and remote font .BR xlsfonts (__appmansuffix__)
paths. It is the users' responsibility to make sure that this is the client, if run on the nested server, will list fonts in the local font path and,
case. 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 .SH BUGS
Won't run well on servers supporting different visual depths. Doesn't run well on servers supporting different visual depths.
Still crashes randomly. Probably has some memory leaks. .PP
Still crashes randomly.
.PP
Probably has some memory leaks.
.SH AUTHOR .SH AUTHOR
Davor Matic, MIT X Consortium Davor Matic, MIT X Consortium
.SH "SEE ALSO"
.BR Xserver (__appmansuffix__),
.BR xdpyinfo (__appmansuffix__),
.BR X (__miscmansuffix__)

View File

@ -10,9 +10,9 @@ Xprt_CFLAGS = @DIX_CFLAGS@ @XPRINT_CFLAGS@ \
Xprt_LDFLAGS = -L$(top_srcdir) Xprt_LDFLAGS = -L$(top_srcdir)
Xprt_LDADD = @XPRINT_LIBS@ ps/libps.la raster/libraster.la \ Xprt_LDADD = @XPRINT_LIBS@ ps/libps.la raster/libraster.la \
pcl/libpcl.la pcl-mono/libpcl.la ../../fb/libfb.la \ pcl/libpcl.la pcl-mono/libpcl.la $(top_builddir)/fb/libfb.la \
../../render/librender.la ../../mi/libmi.la ../../Xext/libXext.la \ $(top_builddir)/render/librender.la $(top_builddir)/mi/libmi.la \
@FREETYPE_LIBS@ $(top_builddir)/Xext/libXext.la @FREETYPE_LIBS@
miinitext-wrapper.c: miinitext-wrapper.c:
echo "#include \"$(top_srcdir)/mi/miinitext.c\"" >> $@ echo "#include \"$(top_srcdir)/mi/miinitext.c\"" >> $@

View File

@ -264,7 +264,7 @@ winMultiWindowGetTransientFor (WindowPtr pWin, WindowPtr *ppDaddy)
if (prop->propertyName == XA_WM_TRANSIENT_FOR) if (prop->propertyName == XA_WM_TRANSIENT_FOR)
{ {
if (ppDaddy) if (ppDaddy)
memcpy (*ppDaddy, prop->data, sizeof (WindowPtr *)); memcpy (*ppDaddy, prop->data, sizeof (WindowPtr));
return 1; return 1;
} }
else else

View File

@ -207,10 +207,6 @@ extern int (* ProcVector[256]) (ClientPtr /*client*/);
extern int (* SwappedProcVector[256]) (ClientPtr /*client*/); extern int (* SwappedProcVector[256]) (ClientPtr /*client*/);
#ifdef K5AUTH
extern int (*k5_Vector[256])(ClientPtr /*client*/);
#endif
extern ReplySwapPtr ReplySwapVector[256]; extern ReplySwapPtr ReplySwapVector[256];
extern int ProcBadRequest(ClientPtr /*client*/); extern int ProcBadRequest(ClientPtr /*client*/);

View File

@ -516,6 +516,14 @@ SOFTWARE.
#define GETLEFTBITS_ALIGNMENT 1 #define GETLEFTBITS_ALIGNMENT 1
#endif #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 /* 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 * 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. * you) used and the number of times the ddx routine has to be called.

View File

@ -108,7 +108,8 @@ mieqEnqueue(DeviceIntPtr pDev, xEvent *e)
HWEventQueueType oldtail = miEventQueue.tail, newtail; HWEventQueueType oldtail = miEventQueue.tail, newtail;
int isMotion = 0; int isMotion = 0;
deviceValuator *v = (deviceValuator *) e; deviceValuator *v = (deviceValuator *) e;
EventPtr laste = &miEventQueue.events[oldtail - 1]; EventPtr laste = &miEventQueue.events[(oldtail - 1) %
QUEUE_SIZE];
deviceKeyButtonPointer *lastkbp = (deviceKeyButtonPointer *) deviceKeyButtonPointer *lastkbp = (deviceKeyButtonPointer *)
&laste->event[0]; &laste->event[0];
@ -139,14 +140,10 @@ mieqEnqueue(DeviceIntPtr pDev, xEvent *e)
if (isMotion && isMotion == miEventQueue.lastMotion && if (isMotion && isMotion == miEventQueue.lastMotion &&
oldtail != miEventQueue.head) { oldtail != miEventQueue.head) {
if (oldtail == 0) oldtail = (oldtail - 1) % QUEUE_SIZE;
oldtail = QUEUE_SIZE;
oldtail = oldtail - 1;
} }
else { else {
newtail = oldtail + 1; newtail = (oldtail + 1) % QUEUE_SIZE;
if (newtail == QUEUE_SIZE)
newtail = 0;
/* Toss events which come in late. Usually this means your server's /* Toss events which come in late. Usually this means your server's
* stuck in an infinite loop somewhere, but SIGIO is still getting * stuck in an infinite loop somewhere, but SIGIO is still getting
* handled. */ * handled. */
@ -214,22 +211,15 @@ mieqProcessInputEvents(void)
e = &miEventQueue.events[miEventQueue.head]; e = &miEventQueue.events[miEventQueue.head];
/* Assumption - screen switching can only occur on motion events. */ /* Assumption - screen switching can only occur on motion events. */
miEventQueue.head = (miEventQueue.head + 1) % QUEUE_SIZE;
if (e->pScreen != miEventQueue.pDequeueScreen) { if (e->pScreen != miEventQueue.pDequeueScreen) {
miEventQueue.pDequeueScreen = e->pScreen; miEventQueue.pDequeueScreen = e->pScreen;
x = e->event[0].u.keyButtonPointer.rootX; x = e->event[0].u.keyButtonPointer.rootX;
y = e->event[0].u.keyButtonPointer.rootY; y = e->event[0].u.keyButtonPointer.rootY;
if (miEventQueue.head == QUEUE_SIZE - 1)
miEventQueue.head = 0;
else
++miEventQueue.head;
NewCurrentScreen (miEventQueue.pDequeueScreen, x, y); NewCurrentScreen (miEventQueue.pDequeueScreen, x, y);
} }
else { else {
if (miEventQueue.head == QUEUE_SIZE - 1)
miEventQueue.head = 0;
else
++miEventQueue.head;
/* If someone's registered a custom event handler, let them /* If someone's registered a custom event handler, let them
* steal it. */ * steal it. */
if (miEventQueue.handlers[e->event->u.u.type]) { if (miEventQueue.handlers[e->event->u.u.type]) {

View File

@ -3,7 +3,6 @@ noinst_LTLIBRARIES = libos.la libcwrapper.la
AM_CFLAGS = $(DIX_CFLAGS) AM_CFLAGS = $(DIX_CFLAGS)
# FIXME: Add support for these in configure.ac # FIXME: Add support for these in configure.ac
K5AUTH_SRCS = k5auth.c
SECURERPC_SRCS = rpcauth.c SECURERPC_SRCS = rpcauth.c
INTERNALMALLOC_SRCS = xalloc.c INTERNALMALLOC_SRCS = xalloc.c
@ -48,7 +47,7 @@ libcwrapper_la_CFLAGS = \
-I$(top_srcdir)/hw/xfree86/os-support \ -I$(top_srcdir)/hw/xfree86/os-support \
$(AM_CFLAGS) $(AM_CFLAGS)
EXTRA_DIST = $(K5AUTH_SRCS) $(SECURERPC_SRCS) $(INTERNALMALLOC_SRCS) \ EXTRA_DIST = $(SECURERPC_SRCS) $(INTERNALMALLOC_SRCS) \
$(XCSECURITY_SRCS) $(XDMCP_SRCS) $(STRLCAT_SRCS) $(XCSECURITY_SRCS) $(XDMCP_SRCS) $(STRLCAT_SRCS)
if XSERVER_DTRACE if XSERVER_DTRACE

View File

@ -1168,10 +1168,6 @@ ResetHosts (char *display)
#ifdef DNETCONN #ifdef DNETCONN
struct nodeent *np; struct nodeent *np;
struct dn_naddr dnaddr, *dnaddrp, *dnet_addr(); struct dn_naddr dnaddr, *dnaddrp, *dnet_addr();
#endif
#ifdef K5AUTH
krb5_principal princ;
krb5_data kbuf;
#endif #endif
int family = 0; int family = 0;
pointer addr; pointer addr;
@ -1251,13 +1247,6 @@ ResetHosts (char *display)
family = FamilyNetname; family = FamilyNetname;
hostname = ohostname + 4; hostname = ohostname + 4;
} }
#endif
#ifdef K5AUTH
else if (!strncmp("krb:", lhostname, 4))
{
family = FamilyKrb5Principal;
hostname = ohostname + 4;
}
#endif #endif
else if (!strncmp("si:", lhostname, 3)) else if (!strncmp("si:", lhostname, 3))
{ {
@ -1301,16 +1290,6 @@ ResetHosts (char *display)
} }
else else
#endif /* DNETCONN */ #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 #ifdef SECURE_RPC
if ((family == FamilyNetname) || (strchr(hostname, '@'))) if ((family == FamilyNetname) || (strchr(hostname, '@')))
{ {
@ -1552,11 +1531,6 @@ AddHost (ClientPtr client,
len = length; len = length;
LocalHostEnabled = TRUE; LocalHostEnabled = TRUE;
break; break;
#ifdef K5AUTH
case FamilyKrb5Principal:
len = length;
break;
#endif
#ifdef SECURE_RPC #ifdef SECURE_RPC
case FamilyNetname: case FamilyNetname:
len = length; len = length;
@ -1655,11 +1629,6 @@ RemoveHost (
len = length; len = length;
LocalHostEnabled = FALSE; LocalHostEnabled = FALSE;
break; break;
#ifdef K5AUTH
case FamilyKrb5Principal:
len = length;
break;
#endif
#ifdef SECURE_RPC #ifdef SECURE_RPC
case FamilyNetname: case FamilyNetname:
len = length; len = length;

View File

@ -35,9 +35,6 @@ from The Open Group.
#include <dix-config.h> #include <dix-config.h>
#endif #endif
#ifdef K5AUTH
# include <krb5/krb5.h>
#endif
# include <X11/X.h> # include <X11/X.h>
# include <X11/Xauth.h> # include <X11/Xauth.h>
# include "misc.h" # include "misc.h"
@ -92,15 +89,6 @@ static struct protocol protocols[] = {
#endif #endif
}, },
#endif #endif
#ifdef K5AUTH
{ (unsigned short) 14, "MIT-KERBEROS-5",
K5Add, K5Check, K5Reset,
K5ToID, K5FromID, K5Remove,
#ifdef XCSECURITY
NULL
#endif
},
#endif
#ifdef XCSECURITY #ifdef XCSECURITY
{ (unsigned short) XSecurityAuthorizationNameLen, { (unsigned short) XSecurityAuthorizationNameLen,
XSecurityAuthorizationName, XSecurityAuthorizationName,

View File

@ -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;
}

View File

@ -145,16 +145,6 @@ typedef struct _connectionOutput {
int count; int count;
} ConnectionOutput, *ConnectionOutputPtr; } 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; struct _osComm;
#define AuthInitArgs void #define AuthInitArgs void
@ -190,9 +180,6 @@ typedef struct _osComm {
ConnectionInputPtr input; ConnectionInputPtr input;
ConnectionOutputPtr output; ConnectionOutputPtr output;
XID auth_id; /* authorization id */ 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 */ CARD32 conn_time; /* timestamp if not established, else 0 */
struct _XtransConnInfo *trans_conn; /* transport connection object */ struct _XtransConnInfo *trans_conn; /* transport connection object */
} OsCommRec, *OsCommPtr; } OsCommRec, *OsCommPtr;
@ -273,16 +260,6 @@ extern int SecureRPCRemove (AuthRemCArgs);
extern int SecureRPCReset (AuthRstCArgs); extern int SecureRPCReset (AuthRstCArgs);
#endif #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 */ /* in secauth.c */
extern XID AuthSecurityCheck (AuthCheckArgs); extern XID AuthSecurityCheck (AuthCheckArgs);

View File

@ -64,8 +64,10 @@ OR PERFORMANCE OF THIS SOFTWARE.
#include <X11/Xos.h> #include <X11/Xos.h>
#include <stdio.h> #include <stdio.h>
#include <time.h> #include <time.h>
#if !defined(WIN32) || !defined(__MINGW32__)
#include <sys/time.h> #include <sys/time.h>
#include <sys/resource.h> #include <sys/resource.h>
#endif
#include "misc.h" #include "misc.h"
#include <X11/X.h> #include <X11/X.h>
#define XSERV_t #define XSERV_t
@ -527,6 +529,13 @@ GiveUp(int sig)
errno = olderrno; errno = olderrno;
} }
#if defined WIN32 && defined __MINGW32__
_X_EXPORT CARD32
GetTimeInMillis (void)
{
return GetTickCount ();
}
#else
_X_EXPORT CARD32 _X_EXPORT CARD32
GetTimeInMillis(void) GetTimeInMillis(void)
{ {
@ -541,6 +550,7 @@ GetTimeInMillis(void)
X_GETTIMEOFDAY(&tv); X_GETTIMEOFDAY(&tv);
return(tv.tv_sec * 1000) + (tv.tv_usec / 1000); return(tv.tv_sec * 1000) + (tv.tv_usec / 1000);
} }
#endif
_X_EXPORT void _X_EXPORT void
AdjustWaitForDelay (pointer waitTime, unsigned long newdelay) AdjustWaitForDelay (pointer waitTime, unsigned long newdelay)
@ -798,11 +808,13 @@ ProcessCommandLine(int argc, char *argv[])
} }
else if ( strcmp( argv[i], "-core") == 0) else if ( strcmp( argv[i], "-core") == 0)
{ {
struct rlimit core_limit;
CoreDump = TRUE; CoreDump = TRUE;
#if !defined(WIN32) || !defined(__MINGW32__)
struct rlimit core_limit;
getrlimit (RLIMIT_CORE, &core_limit); getrlimit (RLIMIT_CORE, &core_limit);
core_limit.rlim_cur = core_limit.rlim_max; core_limit.rlim_cur = core_limit.rlim_max;
setrlimit (RLIMIT_CORE, &core_limit); setrlimit (RLIMIT_CORE, &core_limit);
#endif
} }
else if ( strcmp( argv[i], "-dpi") == 0) else if ( strcmp( argv[i], "-dpi") == 0)
{ {

View File

@ -2,6 +2,8 @@ noinst_LTLIBRARIES = librandr.la
AM_CFLAGS = $(DIX_CFLAGS) AM_CFLAGS = $(DIX_CFLAGS)
XINERAMA_SRCS = rrxinerama.c
if XORG if XORG
sdk_HEADERS = randrstr.h sdk_HEADERS = randrstr.h
endif endif
@ -18,5 +20,9 @@ librandr_la_SOURCES = \
rrpointer.c \ rrpointer.c \
rrproperty.c \ rrproperty.c \
rrscreen.c \ rrscreen.c \
rrsdispatch.c \ rrsdispatch.c
rrxinerama.c
if XINERAMA
librandr_la_SOURCES += ${XINERAMA_SRCS}
endif

View File

@ -358,8 +358,9 @@ RRExtensionInit (void)
SRRScreenChangeNotifyEvent; SRRScreenChangeNotifyEvent;
EventSwapVector[RREventBase + RRNotify] = (EventSwapPtr) EventSwapVector[RREventBase + RRNotify] = (EventSwapPtr)
SRRNotifyEvent; SRRNotifyEvent;
#ifdef PANORAMIX
RRXineramaExtensionInit(); RRXineramaExtensionInit();
#endif
} }
static int static int

View File

@ -266,17 +266,17 @@ miChangePictureFilter (PicturePtr pPicture,
#define BOUND(v) (INT16) ((v) < MINSHORT ? MINSHORT : (v) > MAXSHORT ? MAXSHORT : (v)) #define BOUND(v) (INT16) ((v) < MINSHORT ? MINSHORT : (v) > MAXSHORT ? MAXSHORT : (v))
static __inline Bool static inline pixman_bool_t
miClipPictureReg (RegionPtr pRegion, miClipPictureReg (pixman_region16_t * pRegion,
RegionPtr pClip, pixman_region16_t * pClip,
int dx, int dx,
int dy) int dy)
{ {
if (REGION_NUM_RECTS(pRegion) == 1 && if (pixman_region_n_rects(pRegion) == 1 &&
REGION_NUM_RECTS(pClip) == 1) pixman_region_n_rects(pClip) == 1)
{ {
BoxPtr pRbox = REGION_RECTS(pRegion); pixman_box16_t * pRbox = pixman_region_rectangles(pRegion, NULL);
BoxPtr pCbox = REGION_RECTS(pClip); pixman_box16_t * pCbox = pixman_region_rectangles(pClip, NULL);
int v; int v;
if (pRbox->x1 < (v = pCbox->x1 + dx)) if (pRbox->x1 < (v = pCbox->x1 + dx))
@ -290,21 +290,21 @@ miClipPictureReg (RegionPtr pRegion,
if (pRbox->x1 >= pRbox->x2 || if (pRbox->x1 >= pRbox->x2 ||
pRbox->y1 >= pRbox->y2) 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; return FALSE;
else else
{ {
if (dx || dy) if (dx || dy)
REGION_TRANSLATE(pScreen, pRegion, -dx, -dy); pixman_region_translate (pRegion, -dx, -dy);
if (!REGION_INTERSECT (pScreen, pRegion, pRegion, pClip)) if (!pixman_region_intersect (pRegion, pRegion, pClip))
return FALSE; return FALSE;
if (dx || dy) 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 static __inline Bool
@ -320,13 +320,13 @@ miClipPictureSrc (RegionPtr pRegion,
{ {
if (pPicture->clientClipType != CT_NONE) if (pPicture->clientClipType != CT_NONE)
{ {
REGION_TRANSLATE(pScreen, pRegion, pixman_region_translate ( pRegion,
dx - pPicture->clipOrigin.x, dx - pPicture->clipOrigin.x,
dy - pPicture->clipOrigin.y); dy - pPicture->clipOrigin.y);
if (!REGION_INTERSECT (pScreen, pRegion, pRegion, if (!REGION_INTERSECT (pScreen, pRegion, pRegion,
(RegionPtr) pPicture->clientClip)) (RegionPtr) pPicture->pCompositeClip)) // clientClip))
return FALSE; return FALSE;
REGION_TRANSLATE(pScreen, pRegion, pixman_region_translate ( pRegion,
- (dx - pPicture->clipOrigin.x), - (dx - pPicture->clipOrigin.x),
- (dy - pPicture->clipOrigin.y)); - (dy - pPicture->clipOrigin.y));
} }
@ -341,7 +341,7 @@ miClipPictureSrc (RegionPtr pRegion,
} }
} }
static void void
miCompositeSourceValidate (PicturePtr pPicture, miCompositeSourceValidate (PicturePtr pPicture,
INT16 x, INT16 x,
INT16 y, INT16 y,
@ -417,6 +417,7 @@ miComputeCompositeRegion (RegionPtr pRegion,
CARD16 width, CARD16 width,
CARD16 height) CARD16 height)
{ {
int v; int v;
pRegion->extents.x1 = xDst; pRegion->extents.x1 = xDst;
@ -430,13 +431,13 @@ miComputeCompositeRegion (RegionPtr pRegion,
if (pRegion->extents.x1 >= pRegion->extents.x2 || if (pRegion->extents.x1 >= pRegion->extents.x2 ||
pRegion->extents.y1 >= pRegion->extents.y2) pRegion->extents.y1 >= pRegion->extents.y2)
{ {
REGION_EMPTY (pDst->pDrawable->pScreen, pRegion); pixman_region_init (pRegion);
return FALSE; return FALSE;
} }
/* clip against dst */ /* clip against dst */
if (!miClipPictureReg (pRegion, pDst->pCompositeClip, 0, 0)) if (!miClipPictureReg (pRegion, pDst->pCompositeClip, 0, 0))
{ {
REGION_UNINIT (pScreen, pRegion); pixman_region_fini (pRegion);
return FALSE; return FALSE;
} }
if (pDst->alphaMap) if (pDst->alphaMap)
@ -445,14 +446,14 @@ miComputeCompositeRegion (RegionPtr pRegion,
-pDst->alphaOrigin.x, -pDst->alphaOrigin.x,
-pDst->alphaOrigin.y)) -pDst->alphaOrigin.y))
{ {
REGION_UNINIT (pScreen, pRegion); pixman_region_fini (pRegion);
return FALSE; return FALSE;
} }
} }
/* clip against src */ /* clip against src */
if (!miClipPictureSrc (pRegion, pSrc, xDst - xSrc, yDst - ySrc)) if (!miClipPictureSrc (pRegion, pSrc, xDst - xSrc, yDst - ySrc))
{ {
REGION_UNINIT (pScreen, pRegion); pixman_region_fini (pRegion);
return FALSE; return FALSE;
} }
if (pSrc->alphaMap) if (pSrc->alphaMap)
@ -461,7 +462,7 @@ miComputeCompositeRegion (RegionPtr pRegion,
xDst - (xSrc + pSrc->alphaOrigin.x), xDst - (xSrc + pSrc->alphaOrigin.x),
yDst - (ySrc + pSrc->alphaOrigin.y))) yDst - (ySrc + pSrc->alphaOrigin.y)))
{ {
REGION_UNINIT (pScreen, pRegion); pixman_region_fini (pRegion);
return FALSE; return FALSE;
} }
} }
@ -470,7 +471,7 @@ miComputeCompositeRegion (RegionPtr pRegion,
{ {
if (!miClipPictureSrc (pRegion, pMask, xDst - xMask, yDst - yMask)) if (!miClipPictureSrc (pRegion, pMask, xDst - xMask, yDst - yMask))
{ {
REGION_UNINIT (pScreen, pRegion); pixman_region_fini (pRegion);
return FALSE; return FALSE;
} }
if (pMask->alphaMap) if (pMask->alphaMap)
@ -479,14 +480,17 @@ miComputeCompositeRegion (RegionPtr pRegion,
xDst - (xMask + pMask->alphaOrigin.x), xDst - (xMask + pMask->alphaOrigin.x),
yDst - (yMask + pMask->alphaOrigin.y))) yDst - (yMask + pMask->alphaOrigin.y)))
{ {
REGION_UNINIT (pScreen, pRegion); pixman_region_fini (pRegion);
return FALSE; return FALSE;
} }
} }
} }
miCompositeSourceValidate (pSrc, xSrc, ySrc, width, height); miCompositeSourceValidate (pSrc, xSrc, ySrc, width, height);
if (pMask) if (pMask)
miCompositeSourceValidate (pMask, xMask, yMask, width, height); miCompositeSourceValidate (pMask, xMask, yMask, width, height);
return TRUE; return TRUE;
} }

View File

@ -88,6 +88,12 @@ miClipPicture (RegionPtr pRegion,
INT16 xPict, INT16 xPict,
INT16 yPict); INT16 yPict);
void
miCompositeSourceValidate (PicturePtr pPicture,
INT16 x,
INT16 y,
CARD16 width,
CARD16 height);
Bool Bool
miComputeCompositeRegion (RegionPtr pRegion, miComputeCompositeRegion (RegionPtr pRegion,
PicturePtr pSrc, PicturePtr pSrc,

View File

@ -661,6 +661,10 @@ AddTraps (PicturePtr pPicture,
int ntraps, int ntraps,
xTrap *traps); xTrap *traps);
pixman_image_t *
PixmanImageFromPicture (PicturePtr pPict,
Bool hasClip);
PicturePtr PicturePtr
CreateSolidPicture (Picture pid, CreateSolidPicture (Picture pid,
xRenderColor *color, xRenderColor *color,

View File

@ -36,16 +36,7 @@
_X_EXPORT xFixed _X_EXPORT xFixed
RenderSampleCeilY (xFixed y, int n) RenderSampleCeilY (xFixed y, int n)
{ {
xFixed f = xFixedFrac(y); return pixman_sample_ceil_y (y, n);
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);
} }
#define _div(a,b) ((a) >= 0 ? (a) / (b) : -((-(a) + (b) - 1) / (b))) #define _div(a,b) ((a) >= 0 ? (a) / (b) : -((-(a) + (b) - 1) / (b)))
@ -57,16 +48,7 @@ RenderSampleCeilY (xFixed y, int n)
_X_EXPORT xFixed _X_EXPORT xFixed
RenderSampleFloorY (xFixed y, int n) RenderSampleFloorY (xFixed y, int n)
{ {
xFixed f = xFixedFrac(y); return pixman_sample_floor_y (y, n);
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);
} }
/* /*
@ -75,52 +57,7 @@ RenderSampleFloorY (xFixed y, int n)
_X_EXPORT void _X_EXPORT void
RenderEdgeStep (RenderEdge *e, int n) RenderEdgeStep (RenderEdge *e, int n)
{ {
xFixed_48_16 ne; pixman_edge_step (e, n);
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;
} }
/* /*
@ -136,35 +73,7 @@ RenderEdgeInit (RenderEdge *e,
xFixed x_bot, xFixed x_bot,
xFixed y_bot) xFixed y_bot)
{ {
xFixed dx, dy; pixman_edge_init (e, n, y_start, x_top, y_top, x_bot, y_bot);
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);
} }
/* /*
@ -179,24 +88,6 @@ RenderLineFixedEdgeInit (RenderEdge *e,
int x_off, int x_off,
int y_off) int y_off)
{ {
xFixed x_off_fixed = IntToxFixed(x_off); pixman_line_fixed_edge_init (e, n, y, (pixman_line_fixed_t *)line, x_off, y_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);
} }

View File

@ -50,20 +50,7 @@
* and can be quickly stepped across small or large gaps in the * and can be quickly stepped across small or large gaps in the
* sample grid * sample grid
*/ */
typedef pixman_edge_t RenderEdge;
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;
/* /*
* Step across a small sample grid gap * Step across a small sample grid gap