Merge branch 'master' into XACE-SELINUX

This commit is contained in:
Eamon Walsh 2007-03-28 12:54:04 -04:00 committed by Eamon Walsh
commit 99b220969f
21 changed files with 86 additions and 63 deletions

View File

@ -34,6 +34,7 @@ nodist_libswrast_la_SOURCES = s_aaline.c \
s_drawpix.c \ s_drawpix.c \
s_feedback.c \ s_feedback.c \
s_fog.c \ s_fog.c \
s_fragprog.c \
s_imaging.c \ s_imaging.c \
s_lines.c \ s_lines.c \
s_logic.c \ s_logic.c \

View File

@ -678,6 +678,30 @@ CompositeExtensionInit (void)
ExtensionEntry *extEntry; ExtensionEntry *extEntry;
int s; int s;
for (s = 0; s < screenInfo.numScreens; s++) {
ScreenPtr pScreen = screenInfo.screens[s];
VisualPtr vis;
/* Composite on 8bpp pseudocolor root windows appears to fail, so
* just disable it on anything pseudocolor for safety.
*/
for (vis = pScreen->visuals; vis->vid != pScreen->rootVisual; vis++)
;
if ((vis->class | DynamicClass) == PseudoColor)
return;
/* Ensure that Render is initialized, which is required for automatic
* compositing.
*/
if (GetPictureScreenIfSet(pScreen) == NULL)
return;
}
/* Xinerama's rewriting of window drawing before Composite gets to it
* breaks Composite.
*/
if (!noPanoramiXExtension)
return;
CompositeClientWindowType = CreateNewResourceType (FreeCompositeClientWindow); CompositeClientWindowType = CreateNewResourceType (FreeCompositeClientWindow);
if (!CompositeClientWindowType) if (!CompositeClientWindowType)
return; return;

View File

@ -867,10 +867,6 @@ AC_DEFINE(DAMAGE,1,[Support Damage extension])
DAMAGE_LIB='$(top_builddir)/damageext/libdamageext.la' DAMAGE_LIB='$(top_builddir)/damageext/libdamageext.la'
DAMAGE_INC='-I$(top_srcdir)/damageext' DAMAGE_INC='-I$(top_srcdir)/damageext'
MIEXT_DAMAGE_LIB='$(top_builddir)/miext/damage/libdamage.la' MIEXT_DAMAGE_LIB='$(top_builddir)/miext/damage/libdamage.la'
dnl damage (may) need the composite wrapper when composite is enabled
if test "$COMPOSITE" = yes; then
MIEXT_DAMAGE_LIB="$MIEXT_DAMAGE_LIB "'$(top_builddir)/miext/cw/libcw.la'
fi
MIEXT_DAMAGE_INC='-I$(top_srcdir)/miext/damage' MIEXT_DAMAGE_INC='-I$(top_srcdir)/miext/damage'
AC_DEFINE(XINPUT, 1, [Support X Input extension]) AC_DEFINE(XINPUT, 1, [Support X Input extension])

View File

@ -668,10 +668,6 @@ exaDriverInit (ScreenPtr pScreen,
} }
#endif #endif
#ifdef COMPOSITE
miDisableCompositeWrapper(pScreen);
#endif
#ifdef MITSHM #ifdef MITSHM
/* Re-register with the MI funcs, which don't allow shared pixmaps. /* Re-register with the MI funcs, which don't allow shared pixmaps.
* Shared pixmaps are almost always a performance loss for us, but this * Shared pixmaps are almost always a performance loss for us, but this

View File

@ -81,7 +81,7 @@ ddxUseMsg (void)
ErrorF("-host-cursor Re-use exisiting X host server cursor\n"); ErrorF("-host-cursor Re-use exisiting X host server cursor\n");
ErrorF("-fullscreen Attempt to run Xephyr fullscreen\n"); ErrorF("-fullscreen Attempt to run Xephyr fullscreen\n");
ErrorF("-grayscale Simulate 8bit grayscale\n"); ErrorF("-grayscale Simulate 8bit grayscale\n");
ErrorF("-fakexa Simulate acceleration using software rendering\n"); ErrorF("-fakexa Simulate acceleration using software rendering\n");
ErrorF("\n"); ErrorF("\n");
exit(1); exit(1);

View File

@ -107,6 +107,19 @@ DDCModeFromDetailedTiming(int scrnIndex, struct detailed_timings *timing,
{ {
DisplayModePtr Mode; DisplayModePtr Mode;
/*
* Refuse to create modes that are insufficiently large. 64 is a random
* number, maybe the spec says something about what the minimum is. In
* particular I see this frequently with _old_ EDID, 1.0 or so, so maybe
* our parser is just being too aggresive there.
*/
if (timing->h_active < 64 || timing->v_active < 64) {
xf86DrvMsg(scrnIndex, X_INFO,
"%s: Ignoring tiny %dx%d mode\n", __func__,
timing->h_active, timing->v_active);
return NULL;
}
/* We don't do stereo */ /* We don't do stereo */
if (timing->stereo) { if (timing->stereo) {
xf86DrvMsg(scrnIndex, X_INFO, xf86DrvMsg(scrnIndex, X_INFO,

View File

@ -208,9 +208,6 @@ _X_HIDDEN void *miLookupTab[] = {
#ifdef RENDER #ifdef RENDER
SYMFUNC(miGlyphExtents) SYMFUNC(miGlyphExtents)
#endif #endif
#ifdef COMPOSITE
SYMFUNC(miDisableCompositeWrapper)
#endif
#ifdef DAMAGE #ifdef DAMAGE
SYMFUNC(DamageDamageRegion) SYMFUNC(DamageDamageRegion)
#endif #endif

View File

@ -197,6 +197,19 @@ DDCModeFromDetailedTiming(int scrnIndex, struct detailed_timings *timing,
{ {
DisplayModePtr Mode; DisplayModePtr Mode;
/*
* Refuse to create modes that are insufficiently large. 64 is a random
* number, maybe the spec says something about what the minimum is. In
* particular I see this frequently with _old_ EDID, 1.0 or so, so maybe
* our parser is just being too aggresive there.
*/
if (timing->h_active < 64 || timing->v_active < 64) {
xf86DrvMsg(scrnIndex, X_INFO,
"%s: Ignoring tiny %dx%d mode\n", __func__,
timing->h_active, timing->v_active);
return NULL;
}
/* We don't do stereo */ /* We don't do stereo */
if (timing->stereo) { if (timing->stereo) {
xf86DrvMsg(scrnIndex, X_INFO, xf86DrvMsg(scrnIndex, X_INFO,

View File

@ -9,6 +9,7 @@ MSB_3_FIXED = mf3-xaaBitmap.c mf3-xaaStipple.c
POLYSEG = s-xaaLine.c s-xaaDashLine.c POLYSEG = s-xaaLine.c s-xaaDashLine.c
libxaa_la_LDFLAGS = -avoid-version libxaa_la_LDFLAGS = -avoid-version
libxaa_la_LIBADD = $(top_builddir)/miext/cw/libcw.la
module_LTLIBRARIES = libxaa.la module_LTLIBRARIES = libxaa.la
libxaa_la_SOURCES = xaaInit.c xaaGC.c xaaInitAccel.c xaaFallback.c \ libxaa_la_SOURCES = xaaInit.c xaaGC.c xaaInitAccel.c xaaFallback.c \

View File

@ -35,7 +35,7 @@ XAAPolyLinesDashed(
#endif #endif
){ ){
XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
XAAGCPtr pGCPriv = (XAAGCPtr) (pGC)->devPrivates[XAAGCIndex].ptr; XAAGCPtr pGCPriv = (XAAGCPtr) (pGC)->devPrivates[XAAGetGCIndex()].ptr;
BoxPtr pboxInit = REGION_RECTS(pGC->pCompositeClip); BoxPtr pboxInit = REGION_RECTS(pGC->pCompositeClip);
int nboxInit = REGION_NUM_RECTS(pGC->pCompositeClip); int nboxInit = REGION_NUM_RECTS(pGC->pCompositeClip);
unsigned int bias = miGetZeroLineBias(pDrawable->pScreen); unsigned int bias = miGetZeroLineBias(pDrawable->pScreen);

View File

@ -38,7 +38,7 @@ Bool
XAACreateGC(GCPtr pGC) XAACreateGC(GCPtr pGC)
{ {
ScreenPtr pScreen = pGC->pScreen; ScreenPtr pScreen = pGC->pScreen;
XAAGCPtr pGCPriv = (XAAGCPtr)(pGC->devPrivates[XAAGCIndex].ptr); XAAGCPtr pGCPriv = (XAAGCPtr)(pGC->devPrivates[XAAGetGCIndex()].ptr);
Bool ret; Bool ret;
XAA_SCREEN_PROLOGUE(pScreen,CreateGC); XAA_SCREEN_PROLOGUE(pScreen,CreateGC);

View File

@ -305,7 +305,7 @@ XAAValidatePolylines(
DrawablePtr pDraw ) DrawablePtr pDraw )
{ {
XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
XAAGCPtr pGCPriv = (XAAGCPtr) (pGC)->devPrivates[XAAGCIndex].ptr; XAAGCPtr pGCPriv = (XAAGCPtr) (pGC)->devPrivates[XAAGetGCIndex()].ptr;
if(pGC->lineStyle == LineSolid) changes &= ~GCDashList; if(pGC->lineStyle == LineSolid) changes &= ~GCDashList;
if(!changes) return; if(!changes) return;

View File

@ -42,14 +42,9 @@ static int XAASetDGAMode(int index, int num, DGADevicePtr devRet);
static void XAAEnableDisableFBAccess (int index, Bool enable); static void XAAEnableDisableFBAccess (int index, Bool enable);
static Bool XAAChangeWindowAttributes (WindowPtr pWin, unsigned long mask); static Bool XAAChangeWindowAttributes (WindowPtr pWin, unsigned long mask);
/* static int XAAScreenIndex = -1;
* XXX These three should be static, but that breaks ABI compat with XF4.4 static int XAAGCIndex = -1;
* and Xorg 6.7.0 modules. DO NOT use them in new code, you should never static int XAAPixmapIndex = -1;
* be setting them, and you've got Get functions below.
*/
int XAAScreenIndex = -1;
int XAAGCIndex = -1;
int XAAPixmapIndex = -1;
static unsigned long XAAGeneration = 0; static unsigned long XAAGeneration = 0;
@ -227,6 +222,14 @@ XAAInit(ScreenPtr pScreen, XAAInfoRecPtr infoRec)
if(infoRec->Flags & MICROSOFT_ZERO_LINE_BIAS) if(infoRec->Flags & MICROSOFT_ZERO_LINE_BIAS)
miSetZeroLineBias(pScreen, OCTANT1 | OCTANT2 | OCTANT3 | OCTANT4); miSetZeroLineBias(pScreen, OCTANT1 | OCTANT2 | OCTANT3 | OCTANT4);
#ifdef COMPOSITE
/* Initialize the composite wrapper. This needs to happen after the
* wrapping above (so it comes before us), but before all other extensions,
* so it doesn't confuse them. (particularly damage).
*/
miInitializeCompositeWrapper(pScreen);
#endif
return TRUE; return TRUE;
} }

View File

@ -64,7 +64,7 @@ void
XAAComputeDash(GCPtr pGC) XAAComputeDash(GCPtr pGC)
{ {
XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
XAAGCPtr pGCPriv = (XAAGCPtr) (pGC)->devPrivates[XAAGCIndex].ptr; XAAGCPtr pGCPriv = (XAAGCPtr) (pGC)->devPrivates[XAAGetGCIndex()].ptr;
Bool EvenDash = (pGC->numInDashList & 0x01) ? FALSE : TRUE; Bool EvenDash = (pGC->numInDashList & 0x01) ? FALSE : TRUE;
int PatternLength = 0; int PatternLength = 0;
unsigned char* DashPtr = (unsigned char*)pGC->dash; unsigned char* DashPtr = (unsigned char*)pGC->dash;

View File

@ -522,7 +522,7 @@ void
XAASync(ScreenPtr pScreen) XAASync(ScreenPtr pScreen)
{ {
XAAScreenPtr pScreenPriv = XAAScreenPtr pScreenPriv =
(XAAScreenPtr) pScreen->devPrivates[XAAScreenIndex].ptr; (XAAScreenPtr) pScreen->devPrivates[XAAGetScreenIndex()].ptr;
XAAInfoRecPtr infoRec = pScreenPriv->AccelInfoRec; XAAInfoRecPtr infoRec = pScreenPriv->AccelInfoRec;
if(infoRec->NeedToSync) { if(infoRec->NeedToSync) {

View File

@ -1640,9 +1640,6 @@ XAAGetPixelFromRGBA (
extern GCOps XAAFallbackOps; extern GCOps XAAFallbackOps;
extern GCOps *XAAGetFallbackOps(void); extern GCOps *XAAGetFallbackOps(void);
extern GCFuncs XAAGCFuncs; extern GCFuncs XAAGCFuncs;
extern int XAAScreenIndex; /* XXX DONTUSE */
extern int XAAGCIndex; /* XXX DONTUSE */
extern int XAAPixmapIndex; /* XXX DONTUSE */
extern int XAAGetScreenIndex(void); extern int XAAGetScreenIndex(void);
extern int XAAGetGCIndex(void); extern int XAAGetGCIndex(void);
extern int XAAGetPixmapIndex(void); extern int XAAGetPixmapIndex(void);

View File

@ -50,7 +50,6 @@ int cwWindowIndex;
#ifdef RENDER #ifdef RENDER
int cwPictureIndex; int cwPictureIndex;
#endif #endif
static Bool cwDisabled[MAXSCREENS];
static unsigned long cwGeneration = 0; static unsigned long cwGeneration = 0;
extern GCOps cwGCOps; extern GCOps cwGCOps;
@ -619,9 +618,9 @@ void
miInitializeCompositeWrapper(ScreenPtr pScreen) miInitializeCompositeWrapper(ScreenPtr pScreen)
{ {
cwScreenPtr pScreenPriv; cwScreenPtr pScreenPriv;
#ifdef RENDER
if (cwDisabled[pScreen->myNum]) Bool has_render = GetPictureScreenIfSet(pScreen) != NULL;
return; #endif
if (cwGeneration != serverGeneration) if (cwGeneration != serverGeneration)
{ {
@ -631,7 +630,8 @@ miInitializeCompositeWrapper(ScreenPtr pScreen)
cwGCIndex = AllocateGCPrivateIndex(); cwGCIndex = AllocateGCPrivateIndex();
cwWindowIndex = AllocateWindowPrivateIndex(); cwWindowIndex = AllocateWindowPrivateIndex();
#ifdef RENDER #ifdef RENDER
cwPictureIndex = AllocatePicturePrivateIndex(); if (has_render)
cwPictureIndex = AllocatePicturePrivateIndex();
#endif #endif
cwGeneration = serverGeneration; cwGeneration = serverGeneration;
} }
@ -640,8 +640,10 @@ miInitializeCompositeWrapper(ScreenPtr pScreen)
if (!AllocateWindowPrivate(pScreen, cwWindowIndex, 0)) if (!AllocateWindowPrivate(pScreen, cwWindowIndex, 0))
return; return;
#ifdef RENDER #ifdef RENDER
if (!AllocatePicturePrivate(pScreen, cwPictureIndex, 0)) if (has_render) {
return; if (!AllocatePicturePrivate(pScreen, cwPictureIndex, 0))
return;
}
#endif #endif
pScreenPriv = (cwScreenPtr)xalloc(sizeof(cwScreenRec)); pScreenPriv = (cwScreenPtr)xalloc(sizeof(cwScreenRec));
if (!pScreenPriv) if (!pScreenPriv)
@ -661,17 +663,11 @@ miInitializeCompositeWrapper(ScreenPtr pScreen)
SCREEN_EPILOGUE(pScreen, GetWindowPixmap, cwGetWindowPixmap); SCREEN_EPILOGUE(pScreen, GetWindowPixmap, cwGetWindowPixmap);
#ifdef RENDER #ifdef RENDER
if (GetPictureScreen (pScreen)) if (has_render)
cwInitializeRender(pScreen); cwInitializeRender(pScreen);
#endif #endif
} }
_X_EXPORT void
miDisableCompositeWrapper(ScreenPtr pScreen)
{
cwDisabled[pScreen->myNum] = TRUE;
}
static Bool static Bool
cwCloseScreen (int i, ScreenPtr pScreen) cwCloseScreen (int i, ScreenPtr pScreen)
{ {

View File

@ -169,7 +169,3 @@ cwFiniRender (ScreenPtr pScreen);
void void
miInitializeCompositeWrapper(ScreenPtr pScreen); miInitializeCompositeWrapper(ScreenPtr pScreen);
/* Must be called before miInitializeCompositeWrapper */
void
miDisableCompositeWrapper(ScreenPtr pScreen);

View File

@ -1831,16 +1831,6 @@ DamageSetup (ScreenPtr pScreen)
if (!pScrPriv) if (!pScrPriv)
return FALSE; return FALSE;
#ifdef COMPOSITE
/* This is a kludge to ensure wrapping order with the composite wrapper.
* If it's done from compinit.c, then DamageSetup may be called before the
* extension init phase, so that cw will be higher in the wrapping chain and
* rewrite drawables before damage gets to it, causing confusion.
*/
if (!noCompositeExtension)
miInitializeCompositeWrapper (pScreen);
#endif
pScrPriv->internalLevel = 0; pScrPriv->internalLevel = 0;
pScrPriv->pScreenDamage = 0; pScrPriv->pScreenDamage = 0;

View File

@ -125,7 +125,7 @@ struct _OsTimerRec {
}; };
static void DoTimer(OsTimerPtr timer, CARD32 now, OsTimerPtr *prev); static void DoTimer(OsTimerPtr timer, CARD32 now, OsTimerPtr *prev);
static void CheckAllTimers(CARD32 now); static void CheckAllTimers(void);
static OsTimerPtr timers = NULL; static OsTimerPtr timers = NULL;
/***************** /*****************
@ -204,7 +204,7 @@ WaitForSomething(int *pClientsReady)
timeout = timers->expires - now; timeout = timers->expires - now;
if (timeout > 0 && timeout > timers->delta + 250) { if (timeout > 0 && timeout > timers->delta + 250) {
/* time has rewound. reset the timers. */ /* time has rewound. reset the timers. */
CheckAllTimers(now); CheckAllTimers();
} }
if (timers) { if (timers) {
@ -436,11 +436,14 @@ ANYSET(FdMask *src)
/* If time has rewound, re-run every affected timer. /* If time has rewound, re-run every affected timer.
* Timers might drop out of the list, so we have to restart every time. */ * Timers might drop out of the list, so we have to restart every time. */
static void static void
CheckAllTimers(CARD32 now) CheckAllTimers(void)
{ {
OsTimerPtr timer; OsTimerPtr timer;
CARD32 now;
start: start:
now = GetTimeInMillis();
for (timer = timers; timer; timer = timer->next) { for (timer = timers; timer; timer = timer->next) {
if (timer->expires - now > timer->delta + 250) { if (timer->expires - now > timer->delta + 250) {
TimerForce(timer); TimerForce(timer);

View File

@ -136,10 +136,7 @@ _X_EXPORT Bool noTestExtensions;
_X_EXPORT Bool noBigReqExtension = FALSE; _X_EXPORT Bool noBigReqExtension = FALSE;
#endif #endif
#ifdef COMPOSITE #ifdef COMPOSITE
/* COMPOSITE is disabled by default for now until the _X_EXPORT Bool noCompositeExtension = FALSE;
* interface is stable */
#define COMPOSITE_DEFAULT FALSE
_X_EXPORT Bool noCompositeExtension = !COMPOSITE_DEFAULT;
#endif #endif
#ifdef DAMAGE #ifdef DAMAGE