aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/dix
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2010-05-21 06:36:23 +0000
committermarha <marha@users.sourceforge.net>2010-05-21 06:36:23 +0000
commit1a038249967b51878bc492df42e24b2af797bb85 (patch)
treefb2dcd26819ab0ac4e3d3aa4b5a8a3d8e339b9c6 /xorg-server/dix
parent3319741e6f9fc3232eb40462a261271b9af2dcb2 (diff)
downloadvcxsrv-1a038249967b51878bc492df42e24b2af797bb85.tar.gz
vcxsrv-1a038249967b51878bc492df42e24b2af797bb85.tar.bz2
vcxsrv-1a038249967b51878bc492df42e24b2af797bb85.zip
xserver git update 21/5/2010
Diffstat (limited to 'xorg-server/dix')
-rw-r--r--xorg-server/dix/devices.c4
-rw-r--r--xorg-server/dix/dispatch.c1
-rw-r--r--xorg-server/dix/gc.c37
3 files changed, 18 insertions, 24 deletions
diff --git a/xorg-server/dix/devices.c b/xorg-server/dix/devices.c
index f419a98fd..fae5361e8 100644
--- a/xorg-server/dix/devices.c
+++ b/xorg-server/dix/devices.c
@@ -311,10 +311,6 @@ EnableDevice(DeviceIntPtr dev, BOOL sendevent)
}
}
- /* Before actually enabling the device, we need to make sure the event
- * list's events have enough memory for a ClassesChangedEvent from the
- * device
- */
if ((*prev != dev) || !dev->inited ||
((ret = (*dev->deviceProc)(dev, DEVICE_ON)) != Success)) {
ErrorF("[dix] couldn't enable device %d\n", dev->id);
diff --git a/xorg-server/dix/dispatch.c b/xorg-server/dix/dispatch.c
index 181fafa77..a14853624 100644
--- a/xorg-server/dix/dispatch.c
+++ b/xorg-server/dix/dispatch.c
@@ -3916,7 +3916,6 @@ AddScreen(
any of the strings pointed to by argv. They may be passed to
multiple screens.
*/
- pScreen->rgf = ~0L; /* there are no scratch GCs yet*/
WindowTable[i] = NullWindow;
screenInfo.screens[i] = pScreen;
screenInfo.numScreens++;
diff --git a/xorg-server/dix/gc.c b/xorg-server/dix/gc.c
index c93b04496..d39a5a76a 100644
--- a/xorg-server/dix/gc.c
+++ b/xorg-server/dix/gc.c
@@ -537,6 +537,9 @@ CreateGC(DrawablePtr pDrawable, BITS32 mask, XID *pval, int *pStatus,
pGC->stipple = pGC->pScreen->PixmapPerDepth[0];
pGC->stipple->refcnt++;
+ /* this is not a scratch GC */
+ pGC->scratch_inuse = FALSE;
+
/* security creation/labeling check */
*pStatus = XaceHook(XACE_RESOURCE_ACCESS, client, gcid, RT_GC, pGC,
RT_NONE, NULL, DixCreateAccess|DixSetAttrAccess);
@@ -844,6 +847,9 @@ CreateScratchGC(ScreenPtr pScreen, unsigned depth)
pGC->lastWinOrg.x = 0;
pGC->lastWinOrg.y = 0;
+ /* scratch GCs in the GCperDepth pool start off unused */
+ pGC->scratch_inuse = FALSE;
+
pGC->stateChanges = GCAllBits;
if (!(*pScreen->CreateGC)(pGC))
{
@@ -864,8 +870,10 @@ FreeGCperDepth(int screenNum)
ppGC = pScreen->GCperDepth;
for (i = 0; i <= pScreen->numDepths; i++)
+ {
(void)FreeGC(ppGC[i], (XID)0);
- pScreen->rgf = ~0L;
+ ppGC[i] = NULL;
+ }
}
@@ -878,7 +886,6 @@ CreateGCperDepth(int screenNum)
GCPtr *ppGC;
pScreen = screenInfo.screens[screenNum];
- pScreen->rgf = 0;
ppGC = pScreen->GCperDepth;
/* do depth 1 separately because it's not included in list */
if (!(ppGC[0] = CreateScratchGC(pScreen, 1)))
@@ -1097,12 +1104,11 @@ GetScratchGC(unsigned depth, ScreenPtr pScreen)
GCPtr pGC;
for (i=0; i<=pScreen->numDepths; i++)
- if ( pScreen->GCperDepth[i]->depth == depth &&
- !(pScreen->rgf & (1L << (i+1)))
- )
+ {
+ pGC = pScreen->GCperDepth[i];
+ if (pGC && pGC->depth == depth && !pGC->scratch_inuse)
{
- pScreen->rgf |= (1L << (i+1));
- pGC = (pScreen->GCperDepth[i]);
+ pGC->scratch_inuse = TRUE;
pGC->alu = GXcopy;
pGC->planemask = ~0;
@@ -1127,6 +1133,7 @@ GetScratchGC(unsigned depth, ScreenPtr pScreen)
pGC->stateChanges = GCAllBits;
return pGC;
}
+ }
/* if we make it this far, need to roll our own */
pGC = CreateScratchGC(pScreen, depth);
if (pGC)
@@ -1142,16 +1149,8 @@ mark it as available.
void
FreeScratchGC(GCPtr pGC)
{
- ScreenPtr pScreen = pGC->pScreen;
- int i;
-
- for (i=0; i<=pScreen->numDepths; i++)
- {
- if ( pScreen->GCperDepth[i] == pGC)
- {
- pScreen->rgf &= ~(1L << (i+1));
- return;
- }
- }
- (void)FreeGC(pGC, (GContext)0);
+ if (pGC->scratch_inuse)
+ pGC->scratch_inuse = FALSE;
+ else
+ FreeGC(pGC, (GContext)0);
}