xserver: Branch 'master' - 4 commits

Keith Packard keithp at kemper.freedesktop.org
Wed May 12 19:27:34 PDT 2010


 dbe/dbe.c                    |   22 +++++----------
 dix/dixfonts.c               |   10 +++----
 dix/gc.c                     |   61 ++++---------------------------------------
 dix/window.c                 |    2 -
 fb/fbseg.c                   |    2 -
 hw/kdrive/ephyr/ephyr_draw.c |    5 +--
 hw/kdrive/src/kxv.c          |    2 -
 hw/xfree86/common/xf86xv.c   |    4 +-
 hw/xfree86/xaa/xaaPCache.c   |    2 -
 include/gc.h                 |   11 -------
 mi/mibitblt.c                |    8 ++---
 mi/midispcur.c               |   10 +++----
 mi/miexpose.c                |    4 +-
 mi/miglblt.c                 |    8 ++---
 mi/mipolypnt.c               |    4 +-
 mi/miwideline.c              |   16 +++++------
 mi/miwideline.h              |    4 +-
 mi/mizerarc.c                |    4 +-
 render/mirect.c              |    4 +-
 xfixes/region.c              |    2 -
 20 files changed, 59 insertions(+), 126 deletions(-)

New commits:
commit 315041762313598aad90df84226e2d2def4a0fc9
Author: Jamey Sharp <jamey at minilop.net>
Date:   Sat May 8 18:55:55 2010 -0700

    CreateGC: Pass current client on to ChangeGC.
    
    Otherwise we can't check that the XIDs this GC is being initialized with
    are accessible to this client.
    
    Signed-off-by: Jamey Sharp <jamey at minilop.net>
    Cc: Eamon Walsh <ewalsh at tycho.nsa.gov>
    Reviewed-by: Eamon Walsh <ewalsh at tycho.nsa.gov>

diff --git a/dix/gc.c b/dix/gc.c
index a7b335c..c9b704a 100644
--- a/dix/gc.c
+++ b/dix/gc.c
@@ -574,7 +574,7 @@ CreateGC(DrawablePtr pDrawable, BITS32 mask, XID *pval, int *pStatus,
     if (!(*pGC->pScreen->CreateGC)(pGC))
 	*pStatus = BadAlloc;
     else if (mask)
-        *pStatus = dixChangeGC(NullClient, pGC, mask, pval, NULL);
+        *pStatus = dixChangeGC(client, pGC, mask, pval, NULL);
     else
 	*pStatus = Success;
 
commit 04bad1b8a118a83064316d6e4327234aee19361e
Author: Jamey Sharp <jamey at minilop.net>
Date:   Thu May 6 21:56:10 2010 -0700

    Kill ChangeGC in favor of dixChangeGC.
    
    This doesn't change any behavior, but it isn't clear whether NullClient
    is correct in all cases. As ajax says,
    
    > For most of these changes, I think it's correct to use NullClient,
    > since they are server-initiated changes and should not fail for (eg)
    > xace reasons. ... At any rate, you're certainly not changing any
    > semantics by leaving them all as NullClient, so this patch can't be
    > more wrong than before.
    
    The call in CreateGC is particularly questionable.
    
    Signed-off-by: Jamey Sharp <jamey at minilop.net>
    Reviewed-by: Adam Jackson <ajax at redhat.com>

diff --git a/dix/dixfonts.c b/dix/dixfonts.c
index 378c380..332fb97 100644
--- a/dix/dixfonts.c
+++ b/dix/dixfonts.c
@@ -1261,7 +1261,7 @@ doPolyText(ClientPtr client, PTclosurePtr c)
 	    {
 		if (pFont != c->pGC->font && c->pDraw)
 		{
-		    ChangeGC( c->pGC, GCFont, &fid);
+		    dixChangeGC(NullClient, c->pGC, GCFont, &fid, NULL);
 		    ValidateGC(c->pDraw, c->pGC);
 		    if (c->reqType == X_PolyText8)
 			c->polyText = (PolyTextPtr) c->pGC->ops->PolyText8;
@@ -1404,7 +1404,7 @@ bail:
 	/* Step 4 */
 	if (pFont != origGC->font)
 	{
-	    ChangeGC(origGC, GCFont, &fid);
+	    dixChangeGC(NullClient, origGC, GCFont, &fid, NULL);
 	    ValidateGC(c->pDraw, origGC);
 	}
 
@@ -1423,7 +1423,7 @@ bail:
     if (c->slept)
     {
 	ClientWakeup(c->client);
-	ChangeGC(c->pGC, clearGCmask, clearGC);
+	dixChangeGC(NullClient, c->pGC, clearGCmask, clearGC, NULL);
 
 	/* Unreference the font from the scratch GC */
 	CloseFont(c->pGC->font, (Font)0);
@@ -1580,7 +1580,7 @@ bail:
     if (c->slept)
     {
 	ClientWakeup(c->client);
-	ChangeGC(c->pGC, clearGCmask, clearGC);
+	dixChangeGC(NullClient, c->pGC, clearGCmask, clearGC, NULL);
 
 	/* Unreference the font from the scratch GC */
 	CloseFont(c->pGC->font, (Font)0);
diff --git a/dix/gc.c b/dix/gc.c
index 3a008e0..a7b335c 100644
--- a/dix/gc.c
+++ b/dix/gc.c
@@ -491,14 +491,6 @@ dixChangeGC(ClientPtr client, GC *pGC, BITS32 mask, CARD32 *pC32, ChangeGCValPtr
 #undef NEXTVAL
 #undef NEXT_PTR
 
-/* Publically defined entry to ChangeGC.  Just calls dixChangeGC and tells
- * it that all of the entries are constants or IDs */
-int
-ChangeGC(GC *pGC, BITS32 mask, XID *pval)
-{
-    return (dixChangeGC(NullClient, pGC, mask, pval, NULL));
-}
-
 /* CreateGC(pDrawable, mask, pval, pStatus)
    creates a default GC for the given drawable, using mask to fill
    in any non-default values.
@@ -582,7 +574,7 @@ CreateGC(DrawablePtr pDrawable, BITS32 mask, XID *pval, int *pStatus,
     if (!(*pGC->pScreen->CreateGC)(pGC))
 	*pStatus = BadAlloc;
     else if (mask)
-        *pStatus = ChangeGC(pGC, mask, pval);
+        *pStatus = dixChangeGC(NullClient, pGC, mask, pval, NULL);
     else
 	*pStatus = Success;
 
@@ -625,8 +617,7 @@ CreateDefaultTile (GCPtr pGC)
     tmpval[0] = GXcopy;
     tmpval[1] = pGC->tile.pixel;
     tmpval[2] = FillSolid;
-    (void)ChangeGC(pgcScratch, GCFunction | GCForeground | GCFillStyle, 
-		   tmpval);
+    (void)dixChangeGC(NullClient, pgcScratch, GCFunction | GCForeground | GCFillStyle, tmpval, NULL);
     ValidateGC((DrawablePtr)pTile, pgcScratch);
     rect.x = 0;
     rect.y = 0;
@@ -965,7 +956,7 @@ CreateDefaultStipple(int screenNum)
 	(*pScreen->DestroyPixmap)(pScreen->PixmapPerDepth[0]);
 	return FALSE;
     }
-    (void)ChangeGC(pgcScratch, GCFunction|GCForeground|GCFillStyle, tmpval);
+    (void)dixChangeGC(NullClient, pgcScratch, GCFunction|GCForeground|GCFillStyle, tmpval, NULL);
     ValidateGC((DrawablePtr)pScreen->PixmapPerDepth[0], pgcScratch);
     rect.x = 0;
     rect.y = 0;
diff --git a/dix/window.c b/dix/window.c
index 0d03219..313593b 100644
--- a/dix/window.c
+++ b/dix/window.c
@@ -328,7 +328,7 @@ MakeRootTile(WindowPtr pWin)
 	attributes[0] = pScreen->whitePixel;
 	attributes[1] = pScreen->blackPixel;
 
-	(void)ChangeGC(pGC, GCForeground | GCBackground, attributes);
+	(void)dixChangeGC(NullClient, pGC, GCForeground | GCBackground, attributes, NULL);
     }
 
    ValidateGC((DrawablePtr)pWin->background.pixmap, pGC);
diff --git a/hw/kdrive/ephyr/ephyr_draw.c b/hw/kdrive/ephyr/ephyr_draw.c
index f25a9b4..672e0e4 100644
--- a/hw/kdrive/ephyr/ephyr_draw.c
+++ b/hw/kdrive/ephyr/ephyr_draw.c
@@ -107,8 +107,7 @@ ephyrPrepareSolid(PixmapPtr pPix, int alu, Pixel pm, Pixel fg)
     tmpval[0] = alu;
     tmpval[1] = pm;
     tmpval[2] = fg;
-    ChangeGC(fakexa->pGC, GCFunction | GCPlaneMask | GCForeground, 
-	     tmpval);
+    dixChangeGC(NullClient, fakexa->pGC, GCFunction | GCPlaneMask | GCForeground, tmpval, NULL);
 
     ValidateGC(&pPix->drawable, fakexa->pGC);
 
@@ -173,7 +172,7 @@ ephyrPrepareCopy(PixmapPtr pSrc, PixmapPtr pDst, int dx, int dy, int alu,
 
     tmpval[0] = alu;
     tmpval[1] = pm;
-    ChangeGC (fakexa->pGC, GCFunction | GCPlaneMask, tmpval);
+    dixChangeGC (NullClient, fakexa->pGC, GCFunction | GCPlaneMask, tmpval, NULL);
 
     ValidateGC(&pDst->drawable, fakexa->pGC);
 
diff --git a/hw/kdrive/src/kxv.c b/hw/kdrive/src/kxv.c
index 56f101f..bf6600a 100644
--- a/hw/kdrive/src/kxv.c
+++ b/hw/kdrive/src/kxv.c
@@ -1892,7 +1892,7 @@ KXVPaintRegion (DrawablePtr pDraw, RegionPtr pRgn, Pixel fg)
 
     val[0] = fg;
     val[1] = IncludeInferiors;
-    ChangeGC (pGC, GCForeground|GCSubwindowMode, val);
+    dixChangeGC (NullClient, pGC, GCForeground|GCSubwindowMode, val, NULL);
 
     ValidateGC (pDraw, pGC);
 
diff --git a/hw/xfree86/common/xf86xv.c b/hw/xfree86/common/xf86xv.c
index 99d1fdf..e2d9c15 100644
--- a/hw/xfree86/common/xf86xv.c
+++ b/hw/xfree86/common/xf86xv.c
@@ -1855,7 +1855,7 @@ xf86XVFillKeyHelperDrawable (DrawablePtr pDraw, CARD32 key, RegionPtr clipboxes)
        if (pPriv) pPriv->pGC = pGC;
    } else if (key != pGC->fgPixel){
        pval[0] = key;
-       ChangeGC(pGC, GCForeground, pval);
+       dixChangeGC(NullClient, pGC, GCForeground, pval, NULL);
        ValidateGC(pDraw, pGC);
    }
 
@@ -1892,7 +1892,7 @@ xf86XVFillKeyHelper (ScreenPtr pScreen, CARD32 key, RegionPtr clipboxes)
    gc = GetScratchGC(root->depth, pScreen);
    pval[0] = key;
    pval[1] = IncludeInferiors;
-   (void) ChangeGC(gc, GCForeground|GCSubwindowMode, pval);
+   (void) dixChangeGC(NullClient, gc, GCForeground|GCSubwindowMode, pval, NULL);
    ValidateGC(root, gc);
 
    rects = malloc(nbox * sizeof(xRectangle));
diff --git a/include/gc.h b/include/gc.h
index 7f481c3..3fa953d 100644
--- a/include/gc.h
+++ b/include/gc.h
@@ -88,11 +88,6 @@ extern _X_EXPORT void ValidateGC(
     DrawablePtr /*pDraw*/,
     GCPtr /*pGC*/);
 
-extern _X_EXPORT int ChangeGC(
-    GCPtr/*pGC*/,
-    BITS32 /*mask*/,
-    XID* /*pval*/);
-
 typedef union {
     CARD32 val;
     pointer ptr;
diff --git a/mi/midispcur.c b/mi/midispcur.c
index a107949..11547db 100644
--- a/mi/midispcur.c
+++ b/mi/midispcur.c
@@ -306,7 +306,7 @@ miDCRealize (ScreenPtr pScreen, CursorPtr pCursor)
 			   0, 0, pCursor->bits->width, pCursor->bits->height,
  			   0, XYPixmap, (char *)pCursor->bits->source);
     gcvals[0] = GXand;
-    ChangeGC (pGC, GCFunction, gcvals);
+    dixChangeGC (NullClient, pGC, GCFunction, gcvals, NULL);
     ValidateGC ((DrawablePtr)pPriv->sourceBits, pGC);
     (*pGC->ops->PutImage) ((DrawablePtr)pPriv->sourceBits, pGC, 1,
 			   0, 0, pCursor->bits->width, pCursor->bits->height,
@@ -314,13 +314,13 @@ miDCRealize (ScreenPtr pScreen, CursorPtr pCursor)
 
     /* mask bits -- pCursor->mask & ~pCursor->source */
     gcvals[0] = GXcopy;
-    ChangeGC (pGC, GCFunction, gcvals);
+    dixChangeGC (NullClient, pGC, GCFunction, gcvals, NULL);
     ValidateGC ((DrawablePtr)pPriv->maskBits, pGC);
     (*pGC->ops->PutImage) ((DrawablePtr)pPriv->maskBits, pGC, 1,
 			   0, 0, pCursor->bits->width, pCursor->bits->height,
  			   0, XYPixmap, (char *)pCursor->bits->mask);
     gcvals[0] = GXandInverted;
-    ChangeGC (pGC, GCFunction, gcvals);
+    dixChangeGC (NullClient, pGC, GCFunction, gcvals, NULL);
     ValidateGC ((DrawablePtr)pPriv->maskBits, pGC);
     (*pGC->ops->PutImage) ((DrawablePtr)pPriv->maskBits, pGC, 1,
 			   0, 0, pCursor->bits->width, pCursor->bits->height,
diff --git a/render/mirect.c b/render/mirect.c
index b54fe6f..0030eff 100644
--- a/render/mirect.c
+++ b/render/mirect.c
@@ -70,7 +70,7 @@ miColorRects (PicturePtr    pDst,
 	(*pGC->funcs->ChangeClip) (pGC, CT_REGION, pClip, 0);
     }
 
-    ChangeGC (pGC, mask, tmpval);
+    dixChangeGC (NullClient, pGC, mask, tmpval, NULL);
     ValidateGC (pDst->pDrawable, pGC);
     if (xoff || yoff)
     {
@@ -148,7 +148,7 @@ miCompositeRects (CARD8		op,
 	tmpval[0] = GXcopy;
 	tmpval[1] = pixel;
 
-	ChangeGC (pGC, GCFunction | GCForeground, tmpval);
+	dixChangeGC (NullClient, pGC, GCFunction | GCForeground, tmpval, NULL);
 	ValidateGC (&pPixmap->drawable, pGC);
 	one.x = 0;
 	one.y = 0;
commit 65cedf39054cf3a1e695e84ac228cce9e8d48097
Author: Jamey Sharp <jamey at minilop.net>
Date:   Thu May 6 21:39:43 2010 -0700

    Kill DoChangeGC in favor of dixChangeGC.
    
    This doesn't change any behavior, but it isn't clear whether NullClient
    is correct in all cases. As ajax says,
    
    > For most of these changes, I think it's correct to use NullClient,
    > since they are server-initiated changes and should not fail for (eg)
    > xace reasons. ... At any rate, you're certainly not changing any
    > semantics by leaving them all as NullClient, so this patch can't be
    > more wrong than before.
    
    Signed-off-by: Jamey Sharp <jamey at minilop.net>
    Reviewed-by: Keith Packard <keithp at keithp.com>

diff --git a/dbe/dbe.c b/dbe/dbe.c
index 1cda9f5..1d14bb3 100644
--- a/dbe/dbe.c
+++ b/dbe/dbe.c
@@ -1239,7 +1239,7 @@ SProcDbeDispatch(ClientPtr client)
 static Bool
 DbeSetupBackgroundPainter(WindowPtr pWin, GCPtr pGC)
 {
-    pointer	gcvalues[4];
+    ChangeGCVal	gcvalues[4];
     int		ts_x_origin, ts_y_origin;
     PixUnion	background;
     int		backgroundState;
@@ -1265,16 +1265,16 @@ DbeSetupBackgroundPainter(WindowPtr pWin, GCPtr pGC)
     switch (backgroundState)
     {
         case BackgroundPixel:
-            gcvalues[0] = (pointer)background.pixel;
-            gcvalues[1] = (pointer)FillSolid;
+            gcvalues[0].val = background.pixel;
+            gcvalues[1].val = FillSolid;
             gcmask = GCForeground|GCFillStyle;
             break;
 
         case BackgroundPixmap:
-            gcvalues[0] = (pointer)FillTiled;
-            gcvalues[1] = (pointer)background.pixmap;
-            gcvalues[2] = (pointer)(long)ts_x_origin;
-            gcvalues[3] = (pointer)(long)ts_y_origin;
+            gcvalues[0].val = FillTiled;
+            gcvalues[1].ptr = background.pixmap;
+            gcvalues[2].val = ts_x_origin;
+            gcvalues[3].val = ts_y_origin;
             gcmask = GCFillStyle|GCTile|GCTileStipXOrigin|GCTileStipYOrigin;
             break;
 
@@ -1283,13 +1283,7 @@ DbeSetupBackgroundPainter(WindowPtr pWin, GCPtr pGC)
             return(FALSE);
     }
 
-    if (DoChangeGC(pGC, gcmask, (XID *)gcvalues, TRUE) != 0)
-    {
-        return(FALSE);
-    }
-
-    return(TRUE);
-
+    return dixChangeGC(NullClient, pGC, gcmask, NULL, gcvalues) == 0;
 } /* DbeSetupBackgroundPainter() */
 
 
diff --git a/dix/gc.c b/dix/gc.c
index e45378c..3a008e0 100644
--- a/dix/gc.c
+++ b/dix/gc.c
@@ -91,11 +91,9 @@ ValidateGC(DrawablePtr pDraw, GC *pGC)
  * pass NullClient for the client since any access checking should have
  * already been done at a higher level.
  * 
- * Since we had to create a new function anyway, we decided to change the
- * way the list of gc values is passed to eliminate the compiler warnings
- * caused by the DoChangeGC interface.  You can pass the values via pC32
- * or pUnion, but not both; one of them must be NULL.  If you don't need
- * to pass any pointers, you can use either one:
+ * You can pass the list of gc values via pC32 or pUnion, but not both;
+ * one of them must be NULL.  If you don't need to pass any pointers,
+ * you can use either one:
  * 
  *     example calling dixChangeGC using pC32 parameter
  *
@@ -126,13 +124,6 @@ ValidateGC(DrawablePtr pDraw, GC *pGC)
  * Note: we could have gotten by with just the pUnion parameter, but on
  * 64 bit machines that would have forced us to copy the value list that
  * comes in the ChangeGC request.
- * 
- * Ideally, we'd change all the DoChangeGC calls to dixChangeGC, but this
- * is far too many changes to consider at this time, so we've only
- * changed the ones that caused compiler warnings.  New code should use
- * dixChangeGC.
- * 
- * dpw
  */
 
 #define NEXTVAL(_type, _var) { \
@@ -508,37 +499,6 @@ ChangeGC(GC *pGC, BITS32 mask, XID *pval)
     return (dixChangeGC(NullClient, pGC, mask, pval, NULL));
 }
 
-/* DoChangeGC(pGC, mask, pval, fPointer)
-   mask is a set of bits indicating which values to change.
-   pval contains an appropriate value for each mask.
-   fPointer is true if the values for tiles, stipples, fonts or clipmasks
-   are pointers instead of IDs.  Note: if you are passing pointers you
-   MUST declare the array of values as type pointer!  Other data types
-   may not be large enough to hold pointers on some machines.  Yes,
-   this means you have to cast to (XID *) when you pass the array to
-   DoChangeGC.  Similarly, if you are not passing pointers (fPointer = 0) you
-   MUST declare the array as type XID (not unsigned long!), or again the wrong
-   size data type may be used.  To avoid this cruftiness, use dixChangeGC
-   above.
-
-   if there is an error, the value is marked as changed 
-   anyway, which is probably wrong, but infrequent.
-
-NOTE:
-	all values sent over the protocol for ChangeGC requests are
-32 bits long
-*/
-int
-DoChangeGC(GC *pGC, BITS32 mask, XID *pval, int fPointer)
-{
-    if (fPointer)
-    /* XXX might be a problem on 64 bit big-endian servers */
-	return dixChangeGC(NullClient, pGC, mask, NULL, (ChangeGCValPtr)pval);
-    else
-	return dixChangeGC(NullClient, pGC, mask, pval, NULL);
-}
-
-
 /* CreateGC(pDrawable, mask, pval, pStatus)
    creates a default GC for the given drawable, using mask to fill
    in any non-default values.
diff --git a/fb/fbseg.c b/fb/fbseg.c
index 80ce740..80dd480 100644
--- a/fb/fbseg.c
+++ b/fb/fbseg.c
@@ -250,7 +250,7 @@ fbSetFg (DrawablePtr	pDrawable,
 {
     if (fg != pGC->fgPixel)
     {
-	DoChangeGC (pGC, GCForeground, (XID *) &fg, FALSE);
+	dixChangeGC (NullClient, pGC, GCForeground, &fg, NULL);
 	ValidateGC (pDrawable, pGC);
     }
 }
diff --git a/hw/xfree86/xaa/xaaPCache.c b/hw/xfree86/xaa/xaaPCache.c
index e78a6f8..e62f280 100644
--- a/hw/xfree86/xaa/xaaPCache.c
+++ b/hw/xfree86/xaa/xaaPCache.c
@@ -1881,7 +1881,7 @@ XAAWriteBitmapToCacheLinear(
    pGC = GetScratchGC(pScreenPix->drawable.depth, pScreen);
    gcvals[0] = fg;
    gcvals[1] = bg;
-   DoChangeGC(pGC, GCForeground | GCBackground, gcvals, 0);
+   dixChangeGC(NullClient, pGC, GCForeground | GCBackground, gcvals, NULL);
    ValidateGC((DrawablePtr)pDstPix, pGC);
 
    /* We've unwrapped already so these ops miss a sync */
diff --git a/include/gc.h b/include/gc.h
index e75cc5e..7f481c3 100644
--- a/include/gc.h
+++ b/include/gc.h
@@ -93,12 +93,6 @@ extern _X_EXPORT int ChangeGC(
     BITS32 /*mask*/,
     XID* /*pval*/);
 
-extern _X_EXPORT int DoChangeGC(
-    GCPtr/*pGC*/,
-    BITS32 /*mask*/,
-    XID* /*pval*/,
-    int /*fPointer*/);
-
 typedef union {
     CARD32 val;
     pointer ptr;
diff --git a/mi/mibitblt.c b/mi/mibitblt.c
index 2ac6ce0..f02c04f 100644
--- a/mi/mibitblt.c
+++ b/mi/mibitblt.c
@@ -679,7 +679,7 @@ miGetImage( DrawablePtr pDraw, int sx, int sy, int w, int h,
  
 	    /* alu is already GXCopy */
 	    gcv[0] = (XID)planeMask;
-	    DoChangeGC(pGC, GCPlaneMask, gcv, 0);
+	    dixChangeGC(NullClient, pGC, GCPlaneMask, gcv, NULL);
 	    ValidateGC((DrawablePtr)pPixmap, pGC);
 	}
 
@@ -776,7 +776,7 @@ miPutImage( DrawablePtr pDraw, GCPtr pGC, int depth,
 	oldBg = pGC->bgPixel;
 	gcv[0] = (XID)~0;
 	gcv[1] = (XID)0;
-	DoChangeGC(pGC, GCForeground | GCBackground, gcv, 0);
+	dixChangeGC(NullClient, pGC, GCForeground | GCBackground, gcv, NULL);
 	bytesPer = (long)h * BitmapBytePad(w + leftPad);
 
 	for (i = 1 << (depth-1); i != 0; i >>= 1, pImage += bytesPer)
@@ -784,7 +784,7 @@ miPutImage( DrawablePtr pDraw, GCPtr pGC, int depth,
 	    if (i & oldPlanemask)
 	    {
 	        gcv[0] = (XID)i;
-	        DoChangeGC(pGC, GCPlaneMask, gcv, 0);
+	        dixChangeGC(NullClient, pGC, GCPlaneMask, gcv, NULL);
 	        ValidateGC(pDraw, pGC);
 	        (*pGC->ops->PutImage)(pDraw, pGC, 1, x, y, w, h, leftPad,
 			         XYBitmap, (char *)pImage);
@@ -793,7 +793,7 @@ miPutImage( DrawablePtr pDraw, GCPtr pGC, int depth,
 	gcv[0] = (XID)oldPlanemask;
 	gcv[1] = (XID)oldFg;
 	gcv[2] = (XID)oldBg;
-	DoChangeGC(pGC, GCPlaneMask | GCForeground | GCBackground, gcv, 0);
+	dixChangeGC(NullClient, pGC, GCPlaneMask | GCForeground | GCBackground, gcv, NULL);
 	ValidateGC(pDraw, pGC);
 	break;
 
diff --git a/mi/midispcur.c b/mi/midispcur.c
index 06bddec..a107949 100644
--- a/mi/midispcur.c
+++ b/mi/midispcur.c
@@ -371,7 +371,7 @@ miDCPutBits (
     if (sourceGC->fgPixel != source)
     {
 	gcvals[0] = source;
-	DoChangeGC (sourceGC, GCForeground, gcvals, 0);
+	dixChangeGC (NullClient, sourceGC, GCForeground, gcvals, NULL);
     }
     if (sourceGC->serialNumber != pDrawable->serialNumber)
 	ValidateGC (pDrawable, sourceGC);
@@ -391,7 +391,7 @@ miDCPutBits (
     if (maskGC->fgPixel != mask)
     {
 	gcvals[0] = mask;
-	DoChangeGC (maskGC, GCForeground, gcvals, 0);
+	dixChangeGC (NullClient, maskGC, GCForeground, gcvals, NULL);
     }
     if (maskGC->serialNumber != pDrawable->serialNumber)
 	ValidateGC (pDrawable, maskGC);
diff --git a/mi/miexpose.c b/mi/miexpose.c
index 2072e6a..b4d489a 100644
--- a/mi/miexpose.c
+++ b/mi/miexpose.c
@@ -691,9 +691,9 @@ miClearDrawable(DrawablePtr pDraw, GCPtr pGC)
     rect.y = 0;
     rect.width = pDraw->width;
     rect.height = pDraw->height;
-    DoChangeGC(pGC, GCForeground, &bg, 0);
+    dixChangeGC(NullClient, pGC, GCForeground, &bg, NULL);
     ValidateGC(pDraw, pGC);
     (*pGC->ops->PolyFillRect)(pDraw, pGC, 1, &rect);
-    DoChangeGC(pGC, GCForeground, &fg, 0);
+    dixChangeGC(NullClient, pGC, GCForeground, &fg, NULL);
     ValidateGC(pDraw, pGC);
 }
diff --git a/mi/miglblt.c b/mi/miglblt.c
index ea199dc..22a170a 100644
--- a/mi/miglblt.c
+++ b/mi/miglblt.c
@@ -138,7 +138,7 @@ miPolyGlyphBlt(
     gcvals[1] = 1;
     gcvals[2] = 0;
 
-    DoChangeGC(pGCtmp, GCFunction|GCForeground|GCBackground, gcvals, 0);
+    dixChangeGC(NullClient, pGCtmp, GCFunction|GCForeground|GCBackground, gcvals, NULL);
 
     nbyLine = BitmapBytePad(width);
     pbits = malloc(height*nbyLine);
@@ -237,13 +237,13 @@ miImageGlyphBlt(
     gcvals[0] = GXcopy;
     gcvals[1] = pGC->bgPixel;
     gcvals[2] = FillSolid;
-    DoChangeGC(pGC, GCFunction|GCForeground|GCFillStyle, gcvals, 0);
+    dixChangeGC(NullClient, pGC, GCFunction|GCForeground|GCFillStyle, gcvals, NULL);
     ValidateGC(pDrawable, pGC);
     (*pGC->ops->PolyFillRect)(pDrawable, pGC, 1, &backrect);
 
     /* put down the glyphs */
     gcvals[0] = oldFG;
-    DoChangeGC(pGC, GCForeground, gcvals, 0);
+    dixChangeGC(NullClient, pGC, GCForeground, gcvals, NULL);
     ValidateGC(pDrawable, pGC);
     (*pGC->ops->PolyGlyphBlt)(pDrawable, pGC, x, y, nglyph, ppci,
 			      pglyphBase);
@@ -252,7 +252,7 @@ miImageGlyphBlt(
     gcvals[0] = oldAlu;
     gcvals[1] = oldFG;
     gcvals[2] = oldFS;
-    DoChangeGC(pGC, GCFunction|GCForeground|GCFillStyle, gcvals, 0);
+    dixChangeGC(NullClient, pGC, GCFunction|GCForeground|GCFillStyle, gcvals, NULL);
     ValidateGC(pDrawable, pGC);
 
 }
diff --git a/mi/mipolypnt.c b/mi/mipolypnt.c
index 5a0e523..b54a9fd 100644
--- a/mi/mipolypnt.c
+++ b/mi/mipolypnt.c
@@ -107,7 +107,7 @@ miPolyPoint(
     fsNew = FillSolid;
     if(pGC->fillStyle != FillSolid)
     {
-	DoChangeGC(pGC, GCFillStyle, &fsNew, 0);
+	dixChangeGC(NullClient, pGC, GCFillStyle, &fsNew, NULL);
 	ValidateGC(pDrawable, pGC);
     }
     pwidth = pwidthInit;
@@ -117,7 +117,7 @@ miPolyPoint(
 
     if(fsOld != FillSolid)
     {
-	DoChangeGC(pGC, GCFillStyle, &fsOld, 0);
+	dixChangeGC(NullClient, pGC, GCFillStyle, &fsOld, NULL);
 	ValidateGC(pDrawable, pGC);
     }
     free(pwidthInit);
diff --git a/mi/miwideline.c b/mi/miwideline.c
index 57dda22..c54e2de 100644
--- a/mi/miwideline.c
+++ b/mi/miwideline.c
@@ -137,7 +137,7 @@ miFillPolyHelper (DrawablePtr pDrawable, GCPtr pGC, unsigned long pixel,
     	if (pixel != oldPixel)
     	{
 	    XID tmpPixel = (XID)pixel;
-    	    DoChangeGC (pGC, GCForeground, &tmpPixel, FALSE);
+	    dixChangeGC (NullClient, pGC, GCForeground, &tmpPixel, NULL);
     	    ValidateGC (pDrawable, pGC);
     	}
     }
@@ -233,7 +233,7 @@ miFillPolyHelper (DrawablePtr pDrawable, GCPtr pGC, unsigned long pixel,
         free(pptInit);
     	if (pixel != oldPixel)
     	{
-	    DoChangeGC (pGC, GCForeground, &oldPixel, FALSE);
+	    dixChangeGC (NullClient, pGC, GCForeground, &oldPixel, NULL);
 	    ValidateGC (pDrawable, pGC);
     	}
     }
@@ -271,13 +271,13 @@ miFillRectPolyHelper (
     	if (pixel != oldPixel)
     	{
 	    XID tmpPixel = (XID)pixel;
-    	    DoChangeGC (pGC, GCForeground, &tmpPixel, FALSE);
+	    dixChangeGC (NullClient, pGC, GCForeground, &tmpPixel, NULL);
     	    ValidateGC (pDrawable, pGC);
     	}
 	(*pGC->ops->PolyFillRect) (pDrawable, pGC, 1, &rect);
     	if (pixel != oldPixel)
     	{
-	    DoChangeGC (pGC, GCForeground, &oldPixel, FALSE);
+	    dixChangeGC (NullClient, pGC, GCForeground, &oldPixel, NULL);
 	    ValidateGC (pDrawable, pGC);
     	}
     }
@@ -1120,7 +1120,7 @@ miLineArc (
     	if (pixel != oldPixel)
     	{
 	    XID tmpPixel = (XID)pixel;
-	    DoChangeGC(pGC, GCForeground, &tmpPixel, FALSE);
+	    dixChangeGC(NullClient, pGC, GCForeground, &tmpPixel, NULL);
 	    ValidateGC (pDraw, pGC);
     	}
     }
@@ -1152,7 +1152,7 @@ miLineArc (
         free(points);
     	if (pixel != oldPixel)
     	{
-	    DoChangeGC(pGC, GCForeground, &oldPixel, FALSE);
+	    dixChangeGC(NullClient, pGC, GCForeground, &oldPixel, NULL);
 	    ValidateGC (pDraw, pGC);
     	}
     }
@@ -1571,14 +1571,14 @@ miCleanupSpanData (DrawablePtr pDrawable, GCPtr pGC, SpanDataPtr spanData)
 	oldPixel = pGC->fgPixel;
     	if (pixel != oldPixel)
     	{
-    	    DoChangeGC (pGC, GCForeground, &pixel, FALSE);
+	    dixChangeGC (NullClient, pGC, GCForeground, &pixel, NULL);
     	    ValidateGC (pDrawable, pGC);
     	}
 	miFillUniqueSpanGroup (pDrawable, pGC, &spanData->bgGroup);
 	miFreeSpanGroup (&spanData->bgGroup);
     	if (pixel != oldPixel)
     	{
-	    DoChangeGC (pGC, GCForeground, &oldPixel, FALSE);
+	    dixChangeGC (NullClient, pGC, GCForeground, &oldPixel, NULL);
 	    ValidateGC (pDrawable, pGC);
     	}
     }
diff --git a/mi/miwideline.h b/mi/miwideline.h
index 1665ebf..2ff36ed 100644
--- a/mi/miwideline.h
+++ b/mi/miwideline.h
@@ -78,13 +78,13 @@ typedef struct _LineFace {
 #define MILINESETPIXEL(pDrawable, pGC, pixel, oldPixel) { \
     oldPixel = pGC->fgPixel; \
     if (pixel != oldPixel) { \
-	DoChangeGC (pGC, GCForeground, (XID *) &pixel, FALSE); \
+	dixChangeGC (NullClient, pGC, GCForeground, (XID *) &pixel, NULL); \
 	ValidateGC (pDrawable, pGC); \
     } \
 }
 #define MILINERESETPIXEL(pDrawable, pGC, pixel, oldPixel) { \
     if (pixel != oldPixel) { \
-	DoChangeGC (pGC, GCForeground, (XID *) &oldPixel, FALSE); \
+	dixChangeGC (NullClient, pGC, GCForeground, (XID *) &oldPixel, NULL); \
 	ValidateGC (pDrawable, pGC); \
     } \
 }
diff --git a/mi/mizerarc.c b/mi/mizerarc.c
index 1175bc1..feaa3cb 100644
--- a/mi/mizerarc.c
+++ b/mi/mizerarc.c
@@ -803,7 +803,7 @@ miZeroPolyArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc *parcs)
 	    if ((pGC->fillStyle == FillSolid) ||
 		(pGC->fillStyle == FillStippled))
 	    {
-		DoChangeGC(pGC, GCForeground, (XID *)&pGC->bgPixel, 0);
+		dixChangeGC(NullClient, pGC, GCForeground, (XID *)&pGC->bgPixel, NULL);
 		ValidateGC(pDraw, pGC);
 	    }
 	    pts = &points[numPts >> 1];
@@ -831,7 +831,7 @@ miZeroPolyArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc *parcs)
 	    if ((pGC->fillStyle == FillSolid) ||
 		(pGC->fillStyle == FillStippled))
 	    {
-		DoChangeGC(pGC, GCForeground, &fgPixel, 0);
+		dixChangeGC(NullClient, pGC, GCForeground, &fgPixel, NULL);
 		ValidateGC(pDraw, pGC);
 	    }
 	}
diff --git a/xfixes/region.c b/xfixes/region.c
index 2649c06..5e16369 100644
--- a/xfixes/region.c
+++ b/xfixes/region.c
@@ -642,7 +642,7 @@ ProcXFixesSetGCClipRegion (ClientPtr client)
     
     vals[0] = stuff->xOrigin;
     vals[1] = stuff->yOrigin;
-    DoChangeGC (pGC, GCClipXOrigin|GCClipYOrigin, vals, 0);
+    dixChangeGC (NullClient, pGC, GCClipXOrigin|GCClipYOrigin, vals, NULL);
     (*pGC->funcs->ChangeClip)(pGC, pRegion ? CT_REGION : CT_NONE, (pointer)pRegion, 0);
 
     return (client->noClientException);
commit afcbbd6dfea51c5b0adca0d720edc02ba0c2dc16
Author: Jamey Sharp <jamey at minilop.net>
Date:   Sat May 8 15:19:03 2010 -0700

    doPolyText needs UseAccess to each font, not ReadAccess.
    
    In commit 42d6112ec21949a336ee8b34469f2695273ee2d6, Eamon changed
    dixChangeGC to require DixUseAccess on any GCFont XID. I think
    doPolyText needs to require the same level of access. Otherwise
    dixChangeGC could fail when it does the same lookup, which doPolyText
    doesn't check for.
    
    Signed-off-by: Jamey Sharp <jamey at minilop.net>
    Cc: Eamon Walsh <ewalsh at tycho.nsa.gov>
    Reviewed-by: Eamon Walsh <ewalsh at tycho.nsa.gov>

diff --git a/dix/dixfonts.c b/dix/dixfonts.c
index e145254..378c380 100644
--- a/dix/dixfonts.c
+++ b/dix/dixfonts.c
@@ -1235,7 +1235,7 @@ doPolyText(ClientPtr client, PTclosurePtr c)
 		 | ((Font)*(c->pElt+2)) << 16
 		 | ((Font)*(c->pElt+1)) << 24;
 	    err = dixLookupResourceByType((pointer *)&pFont, fid, RT_FONT,
-					  client, DixReadAccess);
+					  client, DixUseAccess);
 	    if (err != Success)
 	    {
 		err = (err == BadValue) ? BadFont : err;


More information about the xorg-commit mailing list