[Xquartz-changes] xserver: Branch 'server-1.16-apple' - 42 commits

Jeremy Huddleston jeremyhu at freedesktop.org
Sat May 31 12:32:36 PDT 2014


Rebased ref, commits from common ancestor:
commit 51d3119f021e8bd49d00ed6d6b662e03b9c1927d
Author: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
Date:   Sat Nov 2 11:00:23 2013 -0700

    Use old miTrapezoids and miTriangles routines
    
    Reverts commits:
        788ccb9a8bcf6a4fb4054c507111eec3338fb969
        566f1931ee2916269e164e114bffaf2da1d039d1
    
    http://xquartz.macosforge.org/trac/ticket/525
    
    Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu at apple.com>

diff --git a/fb/fbpict.c b/fb/fbpict.c
index dc0ca3c..276ff06 100644
--- a/fb/fbpict.c
+++ b/fb/fbpict.c
@@ -326,10 +326,8 @@ fbPictureInit(ScreenPtr pScreen, PictFormatPtr formats, int nformats)
     ps->Glyphs = miGlyphs;
     ps->CompositeRects = miCompositeRects;
     ps->RasterizeTrapezoid = fbRasterizeTrapezoid;
-    ps->Trapezoids = fbTrapezoids;
     ps->AddTraps = fbAddTraps;
     ps->AddTriangles = fbAddTriangles;
-    ps->Triangles = fbTriangles;
 
     return TRUE;
 }
diff --git a/render/mipict.c b/render/mipict.c
index 3959fc4..2bb1a1d 100644
--- a/render/mipict.c
+++ b/render/mipict.c
@@ -595,8 +595,8 @@ miPictureInit(ScreenPtr pScreen, PictFormatPtr formats, int nformats)
     ps->Composite = 0;          /* requires DDX support */
     ps->Glyphs = miGlyphs;
     ps->CompositeRects = miCompositeRects;
-    ps->Trapezoids = 0;
-    ps->Triangles = 0;
+    ps->Trapezoids = miTrapezoids;
+    ps->Triangles = miTriangles;
 
     ps->RasterizeTrapezoid = 0; /* requires DDX support */
     ps->AddTraps = 0;           /* requires DDX support */
diff --git a/render/mipict.h b/render/mipict.h
index a16dd31..ee90b58 100644
--- a/render/mipict.h
+++ b/render/mipict.h
@@ -122,6 +122,16 @@ miCompositeRects(CARD8 op,
                  xRenderColor * color, int nRect, xRectangle *rects);
 
 extern _X_EXPORT void
+miTriangles (CARD8	    op,
+	     PicturePtr	    pSrc,
+	     PicturePtr	    pDst,
+	     PictFormatPtr  maskFormat,
+	     INT16	    xSrc,
+	     INT16	    ySrc,
+	     int	    ntri,
+	     xTriangle	    *tris);
+
+extern _X_EXPORT void
 
 miTriStrip(CARD8 op,
            PicturePtr pSrc,
@@ -137,10 +147,27 @@ miTriFan(CARD8 op,
          PictFormatPtr maskFormat,
          INT16 xSrc, INT16 ySrc, int npoints, xPointFixed * points);
 
+extern _X_EXPORT PicturePtr
+miCreateAlphaPicture (ScreenPtr	    pScreen, 
+		      PicturePtr    pDst,
+		      PictFormatPtr pPictFormat,
+		      CARD16	    width,
+		      CARD16	    height);
+
 extern _X_EXPORT void
  miTrapezoidBounds(int ntrap, xTrapezoid * traps, BoxPtr box);
 
 extern _X_EXPORT void
+miTrapezoids (CARD8        op,
+             PicturePtr    pSrc,
+             PicturePtr    pDst,
+             PictFormatPtr maskFormat,
+             INT16         xSrc,
+             INT16         ySrc,
+             int           ntrap,
+             xTrapezoid    *traps);
+
+extern _X_EXPORT void
  miPointFixedBounds(int npoint, xPointFixed * points, BoxPtr bounds);
 
 extern _X_EXPORT void
diff --git a/render/mitrap.c b/render/mitrap.c
index 17b6dcd..71c1857 100644
--- a/render/mitrap.c
+++ b/render/mitrap.c
@@ -34,6 +34,55 @@
 #include "picturestr.h"
 #include "mipict.h"
 
+PicturePtr
+miCreateAlphaPicture (ScreenPtr	    pScreen, 
+		      PicturePtr    pDst,
+		      PictFormatPtr pPictFormat,
+		      CARD16	    width,
+		      CARD16	    height)
+{
+    PixmapPtr	    pPixmap;
+    PicturePtr	    pPicture;
+    GCPtr	    pGC;
+    int		    error;
+    xRectangle	    rect;
+
+    if (width > 32767 || height > 32767)
+	return 0;
+
+    if (!pPictFormat)
+    {
+	if (pDst->polyEdge == PolyEdgeSharp)
+	    pPictFormat = PictureMatchFormat (pScreen, 1, PICT_a1);
+	else
+	    pPictFormat = PictureMatchFormat (pScreen, 8, PICT_a8);
+	if (!pPictFormat)
+	    return 0;
+    }
+
+    pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, 
+					pPictFormat->depth, 0);
+    if (!pPixmap)
+	return 0;
+    pGC = GetScratchGC (pPixmap->drawable.depth, pScreen);
+    if (!pGC)
+    {
+	(*pScreen->DestroyPixmap) (pPixmap);
+	return 0;
+    }
+    ValidateGC (&pPixmap->drawable, pGC);
+    rect.x = 0;
+    rect.y = 0;
+    rect.width = width;
+    rect.height = height;
+    (*pGC->ops->PolyFillRect)(&pPixmap->drawable, pGC, 1, &rect);
+    FreeScratchGC (pGC);
+    pPicture = CreatePicture (0, &pPixmap->drawable, pPictFormat,
+			      0, 0, serverClient, &error);
+    (*pScreen->DestroyPixmap) (pPixmap);
+    return pPicture;
+}
+
 static xFixed
 miLineFixedX(xLineFixed * l, xFixed y, Bool ceil)
 {
@@ -79,3 +128,65 @@ miTrapezoidBounds(int ntrap, xTrapezoid * traps, BoxPtr box)
             box->x2 = x2;
     }
 }
+
+
+void
+miTrapezoids (CARD8        op,
+             PicturePtr    pSrc,
+             PicturePtr    pDst,
+             PictFormatPtr maskFormat,
+             INT16         xSrc,
+             INT16         ySrc,
+             int           ntrap,
+             xTrapezoid    *traps)
+{
+    ScreenPtr          pScreen = pDst->pDrawable->pScreen;
+    PictureScreenPtr    ps = GetPictureScreen(pScreen);
+
+    /*
+     * Check for solid alpha add
+     */
+    if (op == PictOpAdd && miIsSolidAlpha (pSrc))
+    {
+       for (; ntrap; ntrap--, traps++)
+           (*ps->RasterizeTrapezoid) (pDst, traps, 0, 0);
+    } 
+    else if (maskFormat)
+    {
+       PicturePtr      pPicture;
+       BoxRec          bounds;
+       INT16           xDst, yDst;
+       INT16           xRel, yRel;
+       
+       xDst = traps[0].left.p1.x >> 16;
+       yDst = traps[0].left.p1.y >> 16;
+
+       miTrapezoidBounds (ntrap, traps, &bounds);
+       if (bounds.y1 >= bounds.y2 || bounds.x1 >= bounds.x2)
+           return;
+       pPicture = miCreateAlphaPicture (pScreen, pDst, maskFormat,
+                                        bounds.x2 - bounds.x1,
+                                        bounds.y2 - bounds.y1);
+       if (!pPicture)
+           return;
+       for (; ntrap; ntrap--, traps++)
+           (*ps->RasterizeTrapezoid) (pPicture, traps, 
+                                      -bounds.x1, -bounds.y1);
+       xRel = bounds.x1 + xSrc - xDst;
+       yRel = bounds.y1 + ySrc - yDst;
+       CompositePicture (op, pSrc, pPicture, pDst,
+                         xRel, yRel, 0, 0, bounds.x1, bounds.y1,
+                         bounds.x2 - bounds.x1,
+                         bounds.y2 - bounds.y1);
+       FreePicture (pPicture, 0);
+    }
+    else
+    {
+       if (pDst->polyEdge == PolyEdgeSharp)
+           maskFormat = PictureMatchFormat (pScreen, 1, PICT_a1);
+       else
+           maskFormat = PictureMatchFormat (pScreen, 8, PICT_a8);
+       for (; ntrap; ntrap--, traps++)
+           miTrapezoids (op, pSrc, pDst, maskFormat, xSrc, ySrc, 1, traps);
+    }
+}
diff --git a/render/mitri.c b/render/mitri.c
index 922f22a..bdca9ca 100644
--- a/render/mitri.c
+++ b/render/mitri.c
@@ -65,3 +65,64 @@ miTriangleBounds(int ntri, xTriangle * tris, BoxPtr bounds)
 {
     miPointFixedBounds(ntri * 3, (xPointFixed *) tris, bounds);
 }
+
+
+void
+miTriangles (CARD8	    op,
+	     PicturePtr	    pSrc,
+	     PicturePtr	    pDst,
+	     PictFormatPtr  maskFormat,
+	     INT16	    xSrc,
+	     INT16	    ySrc,
+	     int	    ntri,
+	     xTriangle	    *tris)
+{
+    ScreenPtr		pScreen = pDst->pDrawable->pScreen;
+    PictureScreenPtr    ps = GetPictureScreen(pScreen);
+    
+    /*
+     * Check for solid alpha add
+     */
+    if (op == PictOpAdd && miIsSolidAlpha (pSrc))
+    {
+	(*ps->AddTriangles) (pDst, 0, 0, ntri, tris);
+    }
+    else if (maskFormat)
+    {
+	BoxRec		bounds;
+	PicturePtr	pPicture;
+	INT16		xDst, yDst;
+	INT16		xRel, yRel;
+	
+	xDst = tris[0].p1.x >> 16;
+	yDst = tris[0].p1.y >> 16;
+
+	miTriangleBounds (ntri, tris, &bounds);
+	if (bounds.x2 <= bounds.x1 || bounds.y2 <= bounds.y1)
+	    return;
+	pPicture = miCreateAlphaPicture (pScreen, pDst, maskFormat,
+					 bounds.x2 - bounds.x1,
+					 bounds.y2 - bounds.y1);
+	if (!pPicture)
+	    return;
+	(*ps->AddTriangles) (pPicture, -bounds.x1, -bounds.y1, ntri, tris);
+	
+	xRel = bounds.x1 + xSrc - xDst;
+	yRel = bounds.y1 + ySrc - yDst;
+	CompositePicture (op, pSrc, pPicture, pDst,
+			  xRel, yRel, 0, 0, bounds.x1, bounds.y1,
+			  bounds.x2 - bounds.x1, bounds.y2 - bounds.y1);
+	FreePicture (pPicture, 0);
+    }
+    else
+    {
+	if (pDst->polyEdge == PolyEdgeSharp)
+	    maskFormat = PictureMatchFormat (pScreen, 1, PICT_a1);
+	else
+	    maskFormat = PictureMatchFormat (pScreen, 8, PICT_a8);
+	
+	for (; ntri; ntri--, tris++)
+	    miTriangles (op, pSrc, pDst, maskFormat, xSrc, ySrc, 1, tris);
+    }
+}
+
commit ded09c3c4354e45c9539cd781040e468f20d2ffa
Author: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
Date:   Tue Dec 18 01:03:38 2012 -0800

    fb: Revert fb changes that broke XQuartz
    
        http://bugs.freedesktop.org/show_bug.cgi?id=26124
    
    Revert "Use new pixman_glyph_cache_t API that will be in pixman 0.28.0"
    
    This reverts commit 9cbcb5bd6a5360a128d15b77a02d8d3351f74366.

diff --git a/fb/fb.h b/fb/fb.h
index f584154..25a7eff 100644
--- a/fb/fb.h
+++ b/fb/fb.h
@@ -1310,9 +1310,6 @@ extern _X_EXPORT void
 extern _X_EXPORT Bool
  fbPictureInit(ScreenPtr pScreen, PictFormatPtr formats, int nformats);
 
-extern _X_EXPORT void
-fbDestroyGlyphCache(void);
-
 /*
  * fbpixmap.c
  */
diff --git a/fb/fbpict.c b/fb/fbpict.c
index ca518ff..dc0ca3c 100644
--- a/fb/fbpict.c
+++ b/fb/fbpict.c
@@ -65,152 +65,6 @@ fbComposite(CARD8 op,
     free_pixman_pict(pDst, dest);
 }
 
-static pixman_glyph_cache_t *glyphCache;
-
-void
-fbDestroyGlyphCache(void)
-{
-    if (glyphCache)
-    {
-	pixman_glyph_cache_destroy (glyphCache);
-	glyphCache = NULL;
-    }
-}
-
-void
-fbUnrealizeGlyph(ScreenPtr pScreen,
-		 GlyphPtr pGlyph)
-{
-    if (glyphCache)
-	pixman_glyph_cache_remove (glyphCache, pGlyph, NULL);
-}
-
-void
-fbGlyphs(CARD8 op,
-	 PicturePtr pSrc,
-	 PicturePtr pDst,
-	 PictFormatPtr maskFormat,
-	 INT16 xSrc,
-	 INT16 ySrc, int nlist,
-	 GlyphListPtr list,
-	 GlyphPtr *glyphs)
-{
-#define N_STACK_GLYPHS 512
-    ScreenPtr pScreen = pDst->pDrawable->pScreen;
-    pixman_glyph_t stack_glyphs[N_STACK_GLYPHS];
-    pixman_glyph_t *pglyphs = stack_glyphs;
-    pixman_image_t *srcImage, *dstImage;
-    int srcXoff, srcYoff, dstXoff, dstYoff;
-    GlyphPtr glyph;
-    int n_glyphs;
-    int x, y;
-    int i, n;
-    int xDst = list->xOff, yDst = list->yOff;
-
-    miCompositeSourceValidate(pSrc);
-    
-    n_glyphs = 0;
-    for (i = 0; i < nlist; ++i)
-	n_glyphs += list[i].len;
-
-    if (!glyphCache)
-	glyphCache = pixman_glyph_cache_create();
-
-    pixman_glyph_cache_freeze (glyphCache);
-    
-    if (n_glyphs > N_STACK_GLYPHS) {
-	if (!(pglyphs = malloc (n_glyphs * sizeof (pixman_glyph_t))))
-	    goto out;
-    }
-    
-    i = 0;
-    x = y = 0;
-    while (nlist--) {
-        x += list->xOff;
-        y += list->yOff;
-        n = list->len;
-        while (n--) {
-	    const void *g;
-
-            glyph = *glyphs++;
-
-	    if (!(g = pixman_glyph_cache_lookup (glyphCache, glyph, NULL))) {
-		pixman_image_t *glyphImage;
-		PicturePtr pPicture;
-		int xoff, yoff;
-
-		pPicture = GetGlyphPicture(glyph, pScreen);
-		if (!pPicture) {
-		    n_glyphs--;
-		    goto next;
-		}
-
-		if (!(glyphImage = image_from_pict(pPicture, FALSE, &xoff, &yoff)))
-		    goto out;
-
-		g = pixman_glyph_cache_insert(glyphCache, glyph, NULL,
-					      glyph->info.x,
-					      glyph->info.y,
-					      glyphImage);
-
-		free_pixman_pict(pPicture, glyphImage);
-
-		if (!g)
-		    goto out;
-	    }
-
-	    pglyphs[i].x = x;
-	    pglyphs[i].y = y;
-	    pglyphs[i].glyph = g;
-	    i++;
-
-	next:
-            x += glyph->info.xOff;
-            y += glyph->info.yOff;
-	}
-	list++;
-    }
-
-    if (!(srcImage = image_from_pict(pSrc, FALSE, &srcXoff, &srcYoff)))
-	goto out;
-
-    if (!(dstImage = image_from_pict(pDst, TRUE, &dstXoff, &dstYoff)))
-	goto out_free_src;
-
-    if (maskFormat) {
-	pixman_format_code_t format;
-	pixman_box32_t extents;
-
-	format = maskFormat->format | (maskFormat->depth << 24);
-
-	pixman_glyph_get_extents(glyphCache, n_glyphs, pglyphs, &extents);
-
-	pixman_composite_glyphs(op, srcImage, dstImage, format,
-				xSrc + srcXoff + xDst, ySrc + srcYoff + yDst,
-				extents.x1, extents.y1,
-				extents.x1 + dstXoff, extents.y1 + dstYoff,
-				extents.x2 - extents.x1,
-				extents.y2 - extents.y1,
-				glyphCache, n_glyphs, pglyphs);
-    }
-    else {
-	pixman_composite_glyphs_no_mask(op, srcImage, dstImage,
-					xSrc + srcXoff - xDst, ySrc + srcYoff - yDst,
-					dstXoff, dstYoff,
-					glyphCache, n_glyphs, pglyphs);
-    }
-
-    free_pixman_pict(pDst, dstImage);
-
-out_free_src:
-    free_pixman_pict(pSrc, srcImage);
-
-out:
-    pixman_glyph_cache_thaw(glyphCache);
-    if (pglyphs != stack_glyphs)
-	free(pglyphs);
-}
-
 static pixman_image_t *
 create_solid_fill_image(PicturePtr pict)
 {
@@ -469,8 +323,7 @@ fbPictureInit(ScreenPtr pScreen, PictFormatPtr formats, int nformats)
         return FALSE;
     ps = GetPictureScreen(pScreen);
     ps->Composite = fbComposite;
-    ps->Glyphs = fbGlyphs;
-    ps->UnrealizeGlyph = fbUnrealizeGlyph;
+    ps->Glyphs = miGlyphs;
     ps->CompositeRects = miCompositeRects;
     ps->RasterizeTrapezoid = fbRasterizeTrapezoid;
     ps->Trapezoids = fbTrapezoids;
diff --git a/fb/fbscreen.c b/fb/fbscreen.c
index b2b9739..a88d9c7 100644
--- a/fb/fbscreen.c
+++ b/fb/fbscreen.c
@@ -32,7 +32,6 @@ fbCloseScreen(ScreenPtr pScreen)
     int d;
     DepthPtr depths = pScreen->allowedDepths;
 
-    fbDestroyGlyphCache();
     for (d = 0; d < pScreen->numDepths; d++)
         free(depths[d].vids);
     free(depths);
commit 60103370a7082db3ab081dd0a8f574a4f45e8e0b
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Fri Feb 12 19:48:52 2010 -0800

    fb: Revert fb changes that broke XQuartz
    
    http://bugs.freedesktop.org/show_bug.cgi?id=26124
    
    Revert "Fix source pictures getting random transforms after 2d6a8f668342a5190cdf43b5."
    Revert "fb: Adjust transform or composite coordinates for pixman operations"
    
    http://bugs.freedesktop.org/26124
    
    This reverts commit a72c65e9176c51de95db2fdbf4c5d946a4911695.
    This reverts commit a6bd5d2e482a5aa84acb3d4932e2a166d8670ef1.
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>

diff --git a/fb/fb.h b/fb/fb.h
index 9057767..f584154 100644
--- a/fb/fb.h
+++ b/fb/fb.h
@@ -1652,8 +1652,7 @@ fbFillRegionSolid(DrawablePtr pDrawable,
                   RegionPtr pRegion, FbBits and, FbBits xor);
 
 extern _X_EXPORT pixman_image_t *image_from_pict(PicturePtr pict,
-                                                 Bool has_clip,
-                                                 int *xoff, int *yoff);
+                                                 Bool has_clip);
 
 extern _X_EXPORT void free_pixman_pict(PicturePtr, pixman_image_t *);
 
diff --git a/fb/fbpict.c b/fb/fbpict.c
index c2ee8a5..ca518ff 100644
--- a/fb/fbpict.c
+++ b/fb/fbpict.c
@@ -46,23 +46,18 @@ fbComposite(CARD8 op,
             INT16 yMask, INT16 xDst, INT16 yDst, CARD16 width, CARD16 height)
 {
     pixman_image_t *src, *mask, *dest;
-    int src_xoff, src_yoff;
-    int msk_xoff, msk_yoff;
-    int dst_xoff, dst_yoff;
-
     miCompositeSourceValidate(pSrc);
     if (pMask)
         miCompositeSourceValidate(pMask);
 
-    src = image_from_pict(pSrc, FALSE, &src_xoff, &src_yoff);
-    mask = image_from_pict(pMask, FALSE, &msk_xoff, &msk_yoff);
-    dest = image_from_pict(pDst, TRUE, &dst_xoff, &dst_yoff);
+    src = image_from_pict(pSrc, TRUE);
+    mask = image_from_pict(pMask, TRUE);
+    dest = image_from_pict(pDst, TRUE);
 
     if (src && dest && !(pMask && !mask)) {
         pixman_image_composite(op, src, mask, dest,
-                               xSrc + src_xoff, ySrc + src_yoff,
-                               xMask + msk_xoff, yMask + msk_yoff,
-                               xDst + dst_xoff, yDst + dst_yoff, width, height);
+                               xSrc, ySrc, xMask, yMask, xDst, yDst,
+                               width, height);
     }
 
     free_pixman_pict(pSrc, src);
@@ -289,20 +284,22 @@ create_conical_gradient_image(PictGradient * gradient)
 }
 
 static pixman_image_t *
-create_bits_picture(PicturePtr pict, Bool has_clip, int *xoff, int *yoff)
+create_bits_picture(PicturePtr pict, Bool has_clip)
 {
-    PixmapPtr pixmap;
     FbBits *bits;
     FbStride stride;
-    int bpp;
+    int bpp, xoff, yoff;
     pixman_image_t *image;
 
-    fbGetDrawablePixmap(pict->pDrawable, pixmap, *xoff, *yoff);
-    fbGetPixmapBitsData(pixmap, bits, stride, bpp);
+    fbGetDrawable (pict->pDrawable, bits, stride, bpp, xoff, yoff);
+
+    bits = (FbBits*)((CARD8*)bits +
+                     (pict->pDrawable->y + yoff) * stride * sizeof(FbBits) +
+                     (pict->pDrawable->x + xoff) * (bpp / 8));
 
     image = pixman_image_create_bits((pixman_format_code_t) pict->format,
-                                     pixmap->drawable.width,
-                                     pixmap->drawable.height, (uint32_t *) bits,
+                                     pict->pDrawable->width,
+                                     pict->pDrawable->height, (uint32_t *) bits,
                                      stride * sizeof(FbStride));
 
     if (!image)
@@ -329,57 +326,31 @@ create_bits_picture(PicturePtr pict, Bool has_clip, int *xoff, int *yoff)
         if (pict->clientClipType != CT_NONE)
             pixman_image_set_has_client_clip(image, TRUE);
 
-        if (*xoff || *yoff)
-            pixman_region_translate(pict->pCompositeClip, *xoff, *yoff);
+        pixman_region_translate (pict->pCompositeClip, - pict->pDrawable->x, - pict->pDrawable->y);
 
         pixman_image_set_clip_region(image, pict->pCompositeClip);
 
-        if (*xoff || *yoff)
-            pixman_region_translate(pict->pCompositeClip, -*xoff, -*yoff);
+        pixman_region_translate (pict->pCompositeClip, pict->pDrawable->x, pict->pDrawable->y);
     }
 
     /* Indexed table */
     if (pict->pFormat->index.devPrivate)
         pixman_image_set_indexed(image, pict->pFormat->index.devPrivate);
 
-    /* Add in drawable origin to position within the image */
-    *xoff += pict->pDrawable->x;
-    *yoff += pict->pDrawable->y;
-
     return image;
 }
 
 static pixman_image_t *image_from_pict_internal(PicturePtr pict, Bool has_clip,
-                                                int *xoff, int *yoff,
                                                 Bool is_alpha_map);
 
 static void
-set_image_properties(pixman_image_t * image, PicturePtr pict, Bool has_clip,
-                     int *xoff, int *yoff, Bool is_alpha_map)
+set_image_properties(pixman_image_t * image, PicturePtr pict, Bool is_alpha_map)
 {
     pixman_repeat_t repeat;
     pixman_filter_t filter;
 
     if (pict->transform) {
-        /* For source images, adjust the transform to account
-         * for the drawable offset within the pixman image,
-         * then set the offset to 0 as it will be used
-         * to compute positions within the transformed image.
-         */
-        if (!has_clip) {
-            struct pixman_transform adjusted;
-
-            adjusted = *pict->transform;
-            pixman_transform_translate(&adjusted,
-                                       NULL,
-                                       pixman_int_to_fixed(*xoff),
-                                       pixman_int_to_fixed(*yoff));
-            pixman_image_set_transform(image, &adjusted);
-            *xoff = 0;
-            *yoff = 0;
-        }
-        else
-            pixman_image_set_transform(image, pict->transform);
+        pixman_image_set_transform(image, pict->transform);
     }
 
     switch (pict->repeatType) {
@@ -407,10 +378,8 @@ set_image_properties(pixman_image_t * image, PicturePtr pict, Bool has_clip,
      * as the alpha map for this operation
      */
     if (pict->alphaMap && !is_alpha_map) {
-        int alpha_xoff, alpha_yoff;
         pixman_image_t *alpha_map =
-            image_from_pict_internal(pict->alphaMap, FALSE, &alpha_xoff,
-                                     &alpha_yoff, TRUE);
+            image_from_pict_internal(pict->alphaMap, TRUE, TRUE);
 
         pixman_image_set_alpha_map(image, alpha_map, pict->alphaOrigin.x,
                                    pict->alphaOrigin.y);
@@ -444,8 +413,7 @@ set_image_properties(pixman_image_t * image, PicturePtr pict, Bool has_clip,
 }
 
 static pixman_image_t *
-image_from_pict_internal(PicturePtr pict, Bool has_clip, int *xoff, int *yoff,
-                         Bool is_alpha_map)
+image_from_pict_internal(PicturePtr pict, Bool has_clip, Bool is_alpha_map)
 {
     pixman_image_t *image = NULL;
 
@@ -453,7 +421,7 @@ image_from_pict_internal(PicturePtr pict, Bool has_clip, int *xoff, int *yoff,
         return NULL;
 
     if (pict->pDrawable) {
-        image = create_bits_picture(pict, has_clip, xoff, yoff);
+        image = create_bits_picture(pict, has_clip);
     }
     else if (pict->pSourcePict) {
         SourcePict *sp = pict->pSourcePict;
@@ -471,19 +439,17 @@ image_from_pict_internal(PicturePtr pict, Bool has_clip, int *xoff, int *yoff,
             else if (sp->type == SourcePictTypeConical)
                 image = create_conical_gradient_image(gradient);
         }
-        *xoff = *yoff = 0;
     }
 
     if (image)
-        set_image_properties(image, pict, has_clip, xoff, yoff, is_alpha_map);
-
+        set_image_properties (image, pict, is_alpha_map);
     return image;
 }
 
 pixman_image_t *
-image_from_pict(PicturePtr pict, Bool has_clip, int *xoff, int *yoff)
+image_from_pict (PicturePtr pict, Bool has_clip)
 {
-    return image_from_pict_internal(pict, has_clip, xoff, yoff, FALSE);
+    return image_from_pict_internal (pict, has_clip, FALSE);
 }
 
 void
diff --git a/fb/fbtrap.c b/fb/fbtrap.c
index bf82f8f..0145ce9 100644
--- a/fb/fbtrap.c
+++ b/fb/fbtrap.c
@@ -36,13 +36,12 @@ fbAddTraps(PicturePtr pPicture,
            INT16 x_off, INT16 y_off, int ntrap, xTrap * traps)
 {
     pixman_image_t *image;
-    int dst_xoff, dst_yoff;
 
-    if (!(image = image_from_pict(pPicture, FALSE, &dst_xoff, &dst_yoff)))
-        return;
-
-    pixman_add_traps(image, x_off + dst_xoff, y_off + dst_yoff,
-                     ntrap, (pixman_trap_t *) traps);
+    if (!(image = image_from_pict (pPicture, FALSE)))
+	return;
+    
+    pixman_add_traps(image, x_off, y_off,
+                     ntrap, (pixman_trap_t *)traps);
 
     free_pixman_pict(pPicture, image);
 }
@@ -52,13 +51,12 @@ fbRasterizeTrapezoid(PicturePtr pPicture,
                      xTrapezoid * trap, int x_off, int y_off)
 {
     pixman_image_t *image;
-    int dst_xoff, dst_yoff;
 
-    if (!(image = image_from_pict(pPicture, FALSE, &dst_xoff, &dst_yoff)))
+    if (!(image = image_from_pict (pPicture, FALSE)))
         return;
 
-    pixman_rasterize_trapezoid(image, (pixman_trapezoid_t *) trap,
-                               x_off + dst_xoff, y_off + dst_yoff);
+    pixman_rasterize_trapezoid(image, (pixman_trapezoid_t *)trap,
+                               x_off, y_off);
 
     free_pixman_pict(pPicture, image);
 }
@@ -68,14 +66,12 @@ fbAddTriangles(PicturePtr pPicture,
                INT16 x_off, INT16 y_off, int ntri, xTriangle * tris)
 {
     pixman_image_t *image;
-    int dst_xoff, dst_yoff;
 
-    if (!(image = image_from_pict(pPicture, FALSE, &dst_xoff, &dst_yoff)))
+    if (!(image = image_from_pict (pPicture, FALSE)))
         return;
-
-    pixman_add_triangles(image,
-                         dst_xoff + x_off, dst_yoff + y_off,
-                         ntri, (pixman_triangle_t *) tris);
+    
+    pixman_add_triangles(image, x_off, y_off, ntri,
+                         (pixman_triangle_t *)tris);
 
     free_pixman_pict(pPicture, image);
 }
@@ -98,13 +94,11 @@ fbShapes(CompositeShapesFunc composite,
          int16_t ySrc, int nshapes, int shape_size, const uint8_t * shapes)
 {
     pixman_image_t *src, *dst;
-    int src_xoff, src_yoff;
-    int dst_xoff, dst_yoff;
 
     miCompositeSourceValidate(pSrc);
 
-    src = image_from_pict(pSrc, FALSE, &src_xoff, &src_yoff);
-    dst = image_from_pict(pDst, TRUE, &dst_xoff, &dst_yoff);
+    src = image_from_pict(pSrc, FALSE);
+    dst = image_from_pict(pDst, TRUE);
 
     if (src && dst) {
         pixman_format_code_t format;
@@ -121,9 +115,8 @@ fbShapes(CompositeShapesFunc composite,
 
             for (i = 0; i < nshapes; ++i) {
                 composite(op, src, dst, format,
-                          xSrc + src_xoff,
-                          ySrc + src_yoff,
-                          dst_xoff, dst_yoff, 1, shapes + i * shape_size);
+                          xSrc, ySrc, 0, 0, 
+                          1, shapes + i * shape_size);
             }
         }
         else {
@@ -143,8 +136,8 @@ fbShapes(CompositeShapesFunc composite,
             }
 
             composite(op, src, dst, format,
-                      xSrc + src_xoff,
-                      ySrc + src_yoff, dst_xoff, dst_yoff, nshapes, shapes);
+                      xSrc, ySrc, 0, 0,
+                      nshapes, shapes);
         }
 
         DamageRegionProcessPending(pDst->pDrawable);
commit eb2f511c112481a922ffc0c71fa2c869472be4a9
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Fri Apr 30 13:08:25 2010 -0700

    Workaround the GC clipping problem in miPaintWindow and add some debugging output.
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>

diff --git a/mi/miexpose.c b/mi/miexpose.c
index 198c433..ad1621d 100644
--- a/mi/miexpose.c
+++ b/mi/miexpose.c
@@ -489,7 +489,8 @@ void RootlessSetPixmapOfAncestors(WindowPtr pWin);
 void RootlessStartDrawing(WindowPtr pWin);
 void RootlessDamageRegion(WindowPtr pWin, RegionPtr prgn);
 Bool IsFramedWindow(WindowPtr pWin);
-#endif
+#include "../fb/fb.h"
+#endif 
 
 void
 miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what)
@@ -518,23 +519,37 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what)
     Bool solid = TRUE;
     DrawablePtr drawable = &pWin->drawable;
 
+#ifdef XQUARTZ_CLIP_DEBUG
+    ErrorF("START %d BS %d (pR = %ld)\n", what, pWin->backgroundState, ParentRelative);
+    ErrorF("      Rgn: %d %d %d %d\n", prgn->extents.x1, prgn->extents.y1,
+	                               prgn->extents.x2 - prgn->extents.x1,
+	                               prgn->extents.y2 - prgn->extents.y1);
+    ErrorF("      Win: %d %d (%d %d) %d %d\n", pWin->origin.x, pWin->origin.y,
+	                                       pWin->winSize.extents.x1, pWin->winSize.extents.y1,
+	                                       pWin->winSize.extents.x2 - pWin->winSize.extents.x1,
+					       pWin->winSize.extents.y2 - pWin->winSize.extents.y1);
+    ErrorF("     Draw: %d %d %d %d\n", pWin->drawable.x, pWin->drawable.y,
+				       pWin->drawable.width, pWin->drawable.height);
+#endif
+
 #ifdef ROOTLESS
     if (!drawable || drawable->type == UNDRAWABLE_WINDOW)
         return;
+#endif
+    
+    if (what == PW_BACKGROUND)
+    {
+#ifdef ROOTLESS
+        if(IsFramedWindow(pWin)) {
+            RootlessStartDrawing(pWin);
+            RootlessDamageRegion(pWin, prgn);
 
-    if (IsFramedWindow(pWin)) {
-        RootlessStartDrawing(pWin);
-        RootlessDamageRegion(pWin, prgn);
-
-        if (pWin->backgroundState == ParentRelative) {
-            if ((what == PW_BACKGROUND) ||
-                (what == PW_BORDER && !pWin->borderIsPixel))
+            if(pWin->backgroundState == ParentRelative) {
                 RootlessSetPixmapOfAncestors(pWin);
+            }
         }
-    }
 #endif
 
-    if (what == PW_BACKGROUND) {
         while (pWin->backgroundState == ParentRelative)
             pWin = pWin->parent;
 
@@ -559,6 +574,18 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what)
     else {
         PixmapPtr pixmap;
 
+#ifdef ROOTLESS
+	if(IsFramedWindow(pWin)) {
+	    RootlessStartDrawing(pWin);
+	    RootlessDamageRegion(pWin, prgn);
+	    
+	    if(!pWin->borderIsPixel &&
+		pWin->backgroundState == ParentRelative) {
+		RootlessSetPixmapOfAncestors(pWin);
+	    }
+	}
+#endif
+
         tile_x_off = drawable->x;
         tile_y_off = drawable->y;
 
@@ -567,6 +594,12 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what)
             return;
         pixmap = (*pScreen->GetWindowPixmap) ((WindowPtr) drawable);
         drawable = &pixmap->drawable;
+
+#ifdef XQUARTZ_CLIP_DEBUG
+        ErrorF("     Draw: %d %d %d %d\n",
+               drawable->x, drawable->y, drawable->width, drawable->height);    
+#endif
+	
 #ifdef COMPOSITE
         draw_x_off = pixmap->screen_x;
         draw_y_off = pixmap->screen_y;
@@ -629,6 +662,57 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what)
     ChangeGC(NullClient, pGC, gcmask, gcval);
     ValidateGC(drawable, pGC);
 
+#ifdef XQUARTZ_CLIP_DEBUG
+    ErrorF("       GC: %d %d %d %d\n",
+	   pGC->pCompositeClip->extents.x1, pGC->pCompositeClip->extents.y1,
+	   pGC->pCompositeClip->extents.x2 - pGC->pCompositeClip->extents.x1,
+	   pGC->pCompositeClip->extents.y2 - pGC->pCompositeClip->extents.y1);
+#endif
+    
+#ifdef XQUARTZ
+    /* Looks like our clipping isn't set right for some reason:
+     * http://xquartz.macosforge.org/trac/ticket/290
+     */
+    if(what == PW_BORDER) {
+
+#if 0
+	if(solid) {
+#if 1
+	    fbFillRegionSolid(&pWin->drawable,
+			      prgn,
+			      0,
+			      fbReplicatePixel(fill.pixel,
+					       pWin->drawable.bitsPerPixel));
+#else
+	    fbFillRegionSolid(drawable,
+			      prgn,
+			      0,
+			      fbReplicatePixel(fill.pixel,
+					       drawable->bitsPerPixel));
+#endif
+	    return;
+	}
+#endif
+    
+	pGC->pCompositeClip->extents.x1 += prgn->extents.x1;
+	pGC->pCompositeClip->extents.y1 += prgn->extents.y1;
+	pGC->pCompositeClip->extents.x2 += prgn->extents.x1;
+	pGC->pCompositeClip->extents.y2 += prgn->extents.y1;
+	
+	if(pGC->pCompositeClip->extents.x2 > drawable->pScreen->width)
+	    pGC->pCompositeClip->extents.x2 = drawable->pScreen->width;
+	if(pGC->pCompositeClip->extents.y2 > drawable->pScreen->height)
+	    pGC->pCompositeClip->extents.y2 = drawable->pScreen->height;
+    }
+#endif
+
+#ifdef XQUARTZ_CLIP_DEBUG
+    ErrorF("       GC: %d %d %d %d\n",
+	   pGC->pCompositeClip->extents.x1, pGC->pCompositeClip->extents.y1,
+	   pGC->pCompositeClip->extents.x2 - pGC->pCompositeClip->extents.x1,
+	   pGC->pCompositeClip->extents.y2 - pGC->pCompositeClip->extents.y1);    
+#endif
+
     numRects = RegionNumRects(prgn);
     pbox = RegionRects(prgn);
     for (i = numRects; --i >= 0; pbox++, prect++) {
commit d3f1ca4162bf2f0d2d7ce6ecb625885c3007cc5b
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Fri Jan 13 12:00:57 2012 -0800

    sdksyms.sh: Use CPPFLAGS, not CFLAGS
    
    CFLAGS can include flags which are not useful to the preprocessor
    or can even cause it to fail.  This fixes a build issue on darwin
    when building for more than one architecture.
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>
    Reviewed-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/xfree86/Makefile.am b/hw/xfree86/Makefile.am
index c5992c3..71b6769 100644
--- a/hw/xfree86/Makefile.am
+++ b/hw/xfree86/Makefile.am
@@ -48,8 +48,7 @@ DIST_SUBDIRS = common ddc i2c x86emu int10 fbdevhw os-support \
 bin_PROGRAMS = Xorg
 nodist_Xorg_SOURCES = sdksyms.c
 
-AM_CFLAGS = $(DIX_CFLAGS) @XORG_CFLAGS@
-AM_CPPFLAGS = $(XORG_INCS) -I$(srcdir)/parser -I$(top_srcdir)/miext/cw \
+AM_CPPFLAGS = $(DIX_CFLAGS) @XORG_CFLAGS@ $(XORG_INCS) -I$(srcdir)/parser -I$(top_srcdir)/miext/cw \
 	-I$(srcdir)/ddc -I$(srcdir)/i2c -I$(srcdir)/modes -I$(srcdir)/ramdac \
 	-I$(srcdir)/dri -I$(srcdir)/dri2 -I$(top_srcdir)/dri3
 
@@ -135,7 +134,7 @@ CLEANFILES = sdksyms.c sdksyms.dep Xorg.sh
 EXTRA_DIST += sdksyms.sh
 
 sdksyms.dep sdksyms.c: sdksyms.sh
-	$(AM_V_GEN)CPP='$(CPP)' AWK='$(AWK)' $(SHELL) $(srcdir)/sdksyms.sh $(top_srcdir) $(CFLAGS) $(AM_CFLAGS) $(AM_CPPFLAGS)
+	$(AM_V_GEN)CPP='$(CPP)' AWK='$(AWK)' $(SHELL) $(srcdir)/sdksyms.sh $(top_srcdir) $(CPPFLAGS) $(AM_CPPFLAGS)
 
 SDKSYMS_DEP = sdksyms.dep
 -include $(SDKSYMS_DEP)
commit 80a0b29c3b61ba9024bd0278ea8cc51686afe3f4
Author: Michel Dänzer <michel.daenzer at amd.com>
Date:   Fri Apr 11 11:01:51 2014 +0900

    glamor: Add remaining header files to SOURCES
    
    It wasn't possible to build glamor from tarballs.
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=64297#c9
    Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
    Reviewed-by: Keith Packard <keithp at keithp.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/glamor/Makefile.am b/glamor/Makefile.am
index 4d0cc81..b7069e0 100644
--- a/glamor/Makefile.am
+++ b/glamor/Makefile.am
@@ -13,6 +13,7 @@ libglamor_la_SOURCES = \
 	glamor_debug.h \
 	glamor_fill.c \
 	glamor_font.c \
+	glamor_font.h \
 	glamor_glx.c \
 	glamor_glyphs.c \
 	glamor_polylines.c \
@@ -21,12 +22,14 @@ libglamor_la_SOURCES = \
 	glamor_render.c \
 	glamor_gradient.c \
 	glamor_program.c \
+	glamor_program.h \
 	glamor_rects.c \
 	glamor_spans.c \
 	glamor_text.c \
 	glamor_transfer.c \
 	glamor_transfer.h \
 	glamor_transform.c \
+	glamor_transform.h \
 	glamor_trapezoid.c \
 	glamor_tile.c \
 	glamor_triangles.c\
commit ea15f8b4c90ebef21d4031bf7f412ef9241d5438
Author: Jasper St. Pierre <jstpierre at mecheye.net>
Date:   Mon Apr 21 16:30:49 2014 -0400

    dixfonts: Turn a missing directory ErrorF into a DebugF
    
    On systems without these directories, we don't need to be complaining
    loudly.
    
    Reviewed-by: Kristian Hoegsberg <krh at bitplanet.net>
    
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/dix/dixfonts.c b/dix/dixfonts.c
index 83d2539..1c6442c 100644
--- a/dix/dixfonts.c
+++ b/dix/dixfonts.c
@@ -1658,7 +1658,7 @@ SetFontPathElements(int npaths, unsigned char *paths, int *bad, Bool persist)
                     err = (*fpe_functions[fpe->type].init_fpe) (fpe);
                 if (err != Successful) {
                     if (persist) {
-                        ErrorF
+                        DebugF
                             ("[dix] Could not init font path element %s, removing from list!\n",
                              fpe->name);
                     }
commit ba5c2b6c876a15fe18bc1ff1ab4e773c46bc9009
Merge: 9c86d5f 66b6024
Author: Keith Packard <keithp at keithp.com>
Date:   Mon Apr 21 14:59:51 2014 -0700

    Merge remote-tracking branch 'krh/xwayland-for-keithp'

commit 9c86d5f4f6f5d6d135a9f2f8eae904c6441e84e5
Author: Kristian Høgsberg <krh at bitplanet.net>
Date:   Tue Mar 25 14:57:12 2014 -0700

    .gitignore: Add new autotools file 'test-driver'
    
    Automake 1.12 introduces a new parallel test framework that uses a shell
    script helper and generates *.log and *.trs files.  Add to .gitignore.
    
    Signed-off-by: Kristian Høgsberg <krh at bitplanet.net>
    Reviewed-by: Gaetan Nadon <memsize at videotron.ca>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/.gitignore b/.gitignore
index 94a12fd..dc56b46 100644
--- a/.gitignore
+++ b/.gitignore
@@ -41,6 +41,7 @@ mkinstalldirs
 py-compile
 stamp-h?
 symlink-tree
+test-driver
 texinfo.tex
 ylwrap
 
diff --git a/test/.gitignore b/test/.gitignore
index da86d6e..a62fc3d 100644
--- a/test/.gitignore
+++ b/test/.gitignore
@@ -11,3 +11,5 @@ xfree86
 xkb
 xtest
 signal-logging
+*.log
+*.trs
commit 28fa5dd5cad3a5fb51018250dfa2b605a8aea85c
Author: Julien Cristau <jcristau at debian.org>
Date:   Mon Apr 14 15:27:19 2014 +0200

    configure: require xproto 7.0.26 for pointer typedef removal
    
    Signed-off-by: Julien Cristau <jcristau at debian.org>
    Reviewed-by: Alan Coopersmith <alan.coopersmith at oracle.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/configure.ac b/configure.ac
index c70bd99..388e17c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -789,7 +789,7 @@ APPLEWMPROTO="applewmproto >= 1.4"
 XSHMFENCE="xshmfence >= 1.1"
 
 dnl Required modules
-XPROTO="xproto >= 7.0.22"
+XPROTO="xproto >= 7.0.26"
 RANDRPROTO="randrproto >= 1.4.0"
 RENDERPROTO="renderproto >= 0.11"
 XEXTPROTO="xextproto >= 7.2.99.901"
commit d2274f2f46db300ac75ca0fdcba7f5655865b8b6
Author: Julien Cristau <jcristau at debian.org>
Date:   Mon Apr 14 15:27:18 2014 +0200

    configure: require fontsproto 2.1.3 for pointer typedef removal
    
    Signed-off-by: Julien Cristau <jcristau at debian.org>
    Reviewed-by: Alan Coopersmith <alan.coopersmith at oracle.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/configure.ac b/configure.ac
index bfe1fc9..c70bd99 100644
--- a/configure.ac
+++ b/configure.ac
@@ -795,7 +795,7 @@ RENDERPROTO="renderproto >= 0.11"
 XEXTPROTO="xextproto >= 7.2.99.901"
 INPUTPROTO="inputproto >= 2.3"
 KBPROTO="kbproto >= 1.0.3"
-FONTSPROTO="fontsproto"
+FONTSPROTO="fontsproto >= 2.1.3"
 FIXESPROTO="fixesproto >= 5.0"
 DAMAGEPROTO="damageproto >= 1.1"
 XCMISCPROTO="xcmiscproto >= 1.2.0"
commit 6d892ad112fc887e184f50c5dc2ba593668e9e11
Author: Robert Morell <rmorell at nvidia.com>
Date:   Fri Apr 18 18:29:44 2014 -0700

    randr: Implement RandR 1.4 request swapping
    
    The protocol handlers all have support for swapping variable data and
    replies, but the top-level dispatch plumbing was missing.
    
    Signed-off-by: Robert Morell <rmorell at nvidia.com>
    Reviewed-by: Alan Coopersmith <alan.coopersmith at oracle.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/randr/rrsdispatch.c b/randr/rrsdispatch.c
index 9968c7f..08c3b6a 100644
--- a/randr/rrsdispatch.c
+++ b/randr/rrsdispatch.c
@@ -434,6 +434,133 @@ SProcRRGetOutputPrimary(ClientPtr client)
     return ProcRandrVector[stuff->randrReqType] (client);
 }
 
+static int SProcRRGetProviders(ClientPtr client)
+{
+    REQUEST(xRRGetProvidersReq);
+
+    REQUEST_SIZE_MATCH(xRRGetProvidersReq);
+    swaps(&stuff->length);
+    swapl(&stuff->window);
+    return ProcRandrVector[stuff->randrReqType] (client);
+}
+
+static int SProcRRGetProviderInfo(ClientPtr client)
+{
+    REQUEST(xRRGetProviderInfoReq);
+
+    REQUEST_SIZE_MATCH(xRRGetProviderInfoReq);
+    swaps(&stuff->length);
+    swapl(&stuff->provider);
+    swapl(&stuff->configTimestamp);
+    return ProcRandrVector[stuff->randrReqType] (client);
+}
+
+static int SProcRRSetProviderOffloadSink(ClientPtr client)
+{
+    REQUEST(xRRSetProviderOffloadSinkReq);
+
+    REQUEST_SIZE_MATCH(xRRSetProviderOffloadSinkReq);
+    swaps(&stuff->length);
+    swapl(&stuff->provider);
+    swapl(&stuff->sink_provider);
+    swapl(&stuff->configTimestamp);
+    return ProcRandrVector[stuff->randrReqType] (client);
+}
+
+static int SProcRRSetProviderOutputSource(ClientPtr client)
+{
+    REQUEST(xRRSetProviderOutputSourceReq);
+
+    REQUEST_SIZE_MATCH(xRRSetProviderOutputSourceReq);
+    swaps(&stuff->length);
+    swapl(&stuff->provider);
+    swapl(&stuff->source_provider);
+    swapl(&stuff->configTimestamp);
+    return ProcRandrVector[stuff->randrReqType] (client);
+}
+
+static int SProcRRListProviderProperties(ClientPtr client)
+{
+    REQUEST(xRRListProviderPropertiesReq);
+
+    REQUEST_SIZE_MATCH(xRRListProviderPropertiesReq);
+    swaps(&stuff->length);
+    swapl(&stuff->provider);
+    return ProcRandrVector[stuff->randrReqType] (client);
+}
+
+static int SProcRRQueryProviderProperty(ClientPtr client)
+{
+    REQUEST(xRRQueryProviderPropertyReq);
+
+    REQUEST_SIZE_MATCH(xRRQueryProviderPropertyReq);
+    swaps(&stuff->length);
+    swapl(&stuff->provider);
+    swapl(&stuff->property);
+    return ProcRandrVector[stuff->randrReqType] (client);
+}
+
+static int SProcRRConfigureProviderProperty(ClientPtr client)
+{
+    REQUEST(xRRConfigureProviderPropertyReq);
+
+    REQUEST_AT_LEAST_SIZE(xRRConfigureProviderPropertyReq);
+    swaps(&stuff->length);
+    swapl(&stuff->provider);
+    swapl(&stuff->property);
+    /* TODO: no way to specify format? */
+    SwapRestL(stuff);
+    return ProcRandrVector[stuff->randrReqType] (client);
+}
+
+static int SProcRRChangeProviderProperty(ClientPtr client)
+{
+    REQUEST(xRRChangeProviderPropertyReq);
+
+    REQUEST_AT_LEAST_SIZE(xRRChangeProviderPropertyReq);
+    swaps(&stuff->length);
+    swapl(&stuff->provider);
+    swapl(&stuff->property);
+    swapl(&stuff->type);
+    swapl(&stuff->nUnits);
+    switch (stuff->format) {
+    case 8:
+        break;
+    case 16:
+        SwapRestS(stuff);
+        break;
+    case 32:
+        SwapRestL(stuff);
+        break;
+    }
+    return ProcRandrVector[stuff->randrReqType] (client);
+}
+
+static int SProcRRDeleteProviderProperty(ClientPtr client)
+{
+    REQUEST(xRRDeleteProviderPropertyReq);
+
+    REQUEST_SIZE_MATCH(xRRDeleteProviderPropertyReq);
+    swaps(&stuff->length);
+    swapl(&stuff->provider);
+    swapl(&stuff->property);
+    return ProcRandrVector[stuff->randrReqType] (client);
+}
+
+static int SProcRRGetProviderProperty(ClientPtr client)
+{
+    REQUEST(xRRGetProviderPropertyReq);
+
+    REQUEST_SIZE_MATCH(xRRGetProviderPropertyReq);
+    swaps(&stuff->length);
+    swapl(&stuff->provider);
+    swapl(&stuff->property);
+    swapl(&stuff->type);
+    swapl(&stuff->longOffset);
+    swapl(&stuff->longLength);
+    return ProcRandrVector[stuff->randrReqType] (client);
+}
+
 int (*SProcRandrVector[RRNumberRequests]) (ClientPtr) = {
     SProcRRQueryVersion,        /* 0 */
 /* we skip 1 to make old clients fail pretty immediately */
@@ -472,4 +599,15 @@ int (*SProcRandrVector[RRNumberRequests]) (ClientPtr) = {
         SProcRRSetPanning,      /* 29 */
         SProcRRSetOutputPrimary,        /* 30 */
         SProcRRGetOutputPrimary,        /* 31 */
+/* V1.4 additions */
+        SProcRRGetProviders,            /* 32 */
+        SProcRRGetProviderInfo,         /* 33 */
+        SProcRRSetProviderOffloadSink,  /* 34 */
+        SProcRRSetProviderOutputSource, /* 35 */
+        SProcRRListProviderProperties,  /* 36 */
+        SProcRRQueryProviderProperty,   /* 37 */
+        SProcRRConfigureProviderProperty, /* 38 */
+        SProcRRChangeProviderProperty,  /* 39 */
+        SProcRRDeleteProviderProperty,  /* 40 */
+        SProcRRGetProviderProperty,     /* 41 */
 };
commit ed4ee7c34a7fbb58a449647fb8d968618c499a61
Author: Robert Morell <rmorell at nvidia.com>
Date:   Fri Apr 18 18:29:43 2014 -0700

    randr: Fix size checks for SetProvider* reqs
    
    Both xRRSetProviderOutputSourceReq and xRRSetProviderOffloadSinkReq are
    fixed-size requests, so the length on the wire should match exactly.
    
    Signed-off-by: Robert Morell <rmorell at nvidia.com>
    Reviewed-by: Alan Coopersmith <alan.coopersmith at oracle.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/randr/rrprovider.c b/randr/rrprovider.c
index 3ce7d75..4507ba8 100644
--- a/randr/rrprovider.c
+++ b/randr/rrprovider.c
@@ -285,7 +285,7 @@ ProcRRSetProviderOutputSource(ClientPtr client)
     RRProviderPtr provider, source_provider = NULL;
     ScreenPtr pScreen;
 
-    REQUEST_AT_LEAST_SIZE(xRRSetProviderOutputSourceReq);
+    REQUEST_SIZE_MATCH(xRRSetProviderOutputSourceReq);
 
     VERIFY_RR_PROVIDER(stuff->provider, provider, DixReadAccess);
 
@@ -320,7 +320,7 @@ ProcRRSetProviderOffloadSink(ClientPtr client)
     RRProviderPtr provider, sink_provider = NULL;
     ScreenPtr pScreen;
 
-    REQUEST_AT_LEAST_SIZE(xRRSetProviderOffloadSinkReq);
+    REQUEST_SIZE_MATCH(xRRSetProviderOffloadSinkReq);
 
     VERIFY_RR_PROVIDER(stuff->provider, provider, DixReadAccess);
     if (!(provider->capabilities & RR_Capability_SourceOffload))
commit 668321e7e5acb41c0c7b299f57165e86dc74d7ed
Author: Robert Morell <rmorell at nvidia.com>
Date:   Fri Apr 18 18:29:42 2014 -0700

    randr: Fix crash for NULL swap dispatch procs
    
    The previous code was checking the wrong table for function pointers.
    
    Signed-off-by: Robert Morell <rmorell at nvidia.com>
    Reviewed-by: Alan Coopersmith <alan.coopersmith at oracle.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/randr/randr.c b/randr/randr.c
index 3c97714..6e3f14b 100644
--- a/randr/randr.c
+++ b/randr/randr.c
@@ -679,7 +679,7 @@ static int
 SProcRRDispatch(ClientPtr client)
 {
     REQUEST(xReq);
-    if (stuff->data >= RRNumberRequests || !ProcRandrVector[stuff->data])
+    if (stuff->data >= RRNumberRequests || !SProcRandrVector[stuff->data])
         return BadRequest;
     return (*SProcRandrVector[stuff->data]) (client);
 }
commit 66b602474047c499b8a888267a489790fc9f9d85
Author: Kristian Høgsberg <krh at bitplanet.net>
Date:   Mon Apr 21 11:14:51 2014 -0700

    xwayland: Remove left-over ErrorF logging
    
    Reviewed-by: Jasper St. Pierre <jstpierre at mecheye.net>
    Signed-off-by: Kristian Høgsberg <krh at bitplanet.net>

diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c
index 844745a..b966e50 100644
--- a/hw/xwayland/xwayland.c
+++ b/hw/xwayland/xwayland.c
@@ -218,7 +218,6 @@ xwl_realize_window(WindowPtr window)
     screen->RealizeWindow = xwl_realize_window;
 
     if (xwl_screen->rootless && !window->parent) {
-        ErrorF("Clearing root clip\n");
         RegionNull(&window->clipList);
         RegionNull(&window->borderClip);
         RegionNull(&window->winSize);
commit 138bf5ac9703b410a6066c303feea067680edf5a
Author: Jamey Sharp <jamey at minilop.net>
Date:   Fri Apr 18 12:22:19 2014 -0700

    DRI2SwapBuffers: Fix uninitialized target SBC.
    
    Fixes Piglit test "swapbuffersmsc-return swap_interval 0".
    
    Ensure that *swap_target gets initialized on any 'return Success' path,
    even if the swap request can't be completed by the driver and the server
    falls back to a simple blit. That path can also be triggered by setting
    swap_interval to 0, which disables sync to vertical retrace.
    
    We originally found this bug because for some reason SDL2 automatically
    sets swap_interval to 0, when we were trying to test OML_sync_control in
    an SDL2 test application. We then discovered that the above-mentioned
    Piglit test has been failing for the same reason since it was
    introduced.
    
    Signed-off-by: Jamey Sharp <jamey at minilop.net>
    Signed-off-by: Theo Hill <Theo0x48 at gmail.com>
    Reviewed-by: Keith Packard <keithp at keithp.com>
    Reviewed-by: Eric Anholt <eric at anholt.net>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c
index 962f40c..76708ca 100644
--- a/hw/xfree86/dri2/dri2.c
+++ b/hw/xfree86/dri2/dri2.c
@@ -1092,6 +1092,14 @@ DRI2SwapBuffers(ClientPtr client, DrawablePtr pDraw, CARD64 target_msc,
         return BadDrawable;
     }
 
+    /* According to spec, return expected swapbuffers count SBC after this swap
+     * will complete. This is ignored unless we return Success, but it must be
+     * initialized on every path where we return Success or the caller will send
+     * an uninitialized value off the stack to the client. So let's initialize
+     * it as early as possible, just to be sure.
+     */
+    *swap_target = pPriv->swap_count + pPriv->swapsPending + 1;
+
     for (i = 0; i < pPriv->bufferCount; i++) {
         if (pPriv->buffers[i]->attachment == DRI2BufferFrontLeft)
             pDestBuffer = (DRI2BufferPtr) pPriv->buffers[i];
@@ -1165,11 +1173,6 @@ DRI2SwapBuffers(ClientPtr client, DrawablePtr pDraw, CARD64 target_msc,
 
     pPriv->last_swap_target = target_msc;
 
-    /* According to spec, return expected swapbuffers count SBC after this swap
-     * will complete.
-     */
-    *swap_target = pPriv->swap_count + pPriv->swapsPending;
-
     DRI2InvalidateDrawableAll(pDraw);
 
     return Success;
commit 4927af4475bc7d020190d9f468c90366525c1109
Author: Jamey Sharp <jamey at minilop.net>
Date:   Fri Apr 18 12:22:18 2014 -0700

    DRI2SwapBuffers: Don't reuse swap_target variable.
    
    swap_target is an out-parameter that needs to be set to the value that
    SBC will take on after this SwapBuffers request completes.
    
    However, it was also being used as a temporary variable to hold the MSC
    at which the SwapBuffers request got scheduled to occur. This confusion
    makes it harder to reason about whether swap_target is being set
    correctly for its out-parameter usage. (Hint: It isn't.)
    
    For the latter use, it makes more sense to use the existing target_msc
    variable, which already has the right value unless target_msc, divisor,
    and remainder are all 0, in which case we can set it using swap_interval
    as usual.
    
    Signed-off-by: Jamey Sharp <jamey at minilop.net>
    Signed-off-by: Theo Hill <Theo0x48 at gmail.com>
    Reviewed-by: Keith Packard <keithp at keithp.com>
    Reviewed-by: Eric Anholt <eric at anholt.net>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c
index 729a323..962f40c 100644
--- a/hw/xfree86/dri2/dri2.c
+++ b/hw/xfree86/dri2/dri2.c
@@ -1149,17 +1149,13 @@ DRI2SwapBuffers(ClientPtr client, DrawablePtr pDraw, CARD64 target_msc,
          * we have to account for the current swap count, interval, and the
          * number of pending swaps.
          */
-        *swap_target = pPriv->last_swap_target + pPriv->swap_interval;
+        target_msc = pPriv->last_swap_target + pPriv->swap_interval;
 
     }
-    else {
-        /* glXSwapBuffersMscOML could have a 0 target_msc, honor it */
-        *swap_target = target_msc;
-    }
 
     pPriv->swapsPending++;
     ret = (*ds->ScheduleSwap) (client, pDraw, pDestBuffer, pSrcBuffer,
-                               swap_target, divisor, remainder, func, data);
+                               &target_msc, divisor, remainder, func, data);
     if (!ret) {
         pPriv->swapsPending--;  /* didn't schedule */
         xf86DrvMsg(pScreen->myNum, X_ERROR,
@@ -1167,7 +1163,7 @@ DRI2SwapBuffers(ClientPtr client, DrawablePtr pDraw, CARD64 target_msc,
         return BadDrawable;
     }
 
-    pPriv->last_swap_target = *swap_target;
+    pPriv->last_swap_target = target_msc;
 
     /* According to spec, return expected swapbuffers count SBC after this swap
      * will complete.
commit d2c6e801b548674b8636e6a64b42c9038d46263c
Author: Kristian Høgsberg <krh at bitplanet.net>
Date:   Tue Apr 8 09:23:42 2014 -0700

    configure.ac: Remove check for WAYLAND_SCANNER_RULES
    
    This makes configure fail if the wayland autoconf macros aren't found.
    We don't need the scanner for shm-only xwayland so just drop this line for
    now.
    
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>
    Reviewed-by: Gaetan Nadon <memsize at videotron.ca>
    Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
    Signed-off-by: Kristian Høgsberg <krh at bitplanet.net>

diff --git a/configure.ac b/configure.ac
index bfe1fc9..4563dc7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2458,7 +2458,6 @@ if test "x$XWAYLAND" = xyes; then
 	XWAYLAND_SYS_LIBS="$XWAYLANDMODULES_LIBS $GLX_SYS_LIBS"
 	AC_SUBST([XWAYLAND_LIBS])
 	AC_SUBST([XWAYLAND_SYS_LIBS])
-	WAYLAND_SCANNER_RULES(['$(top_srcdir)/hw/xwayland'])
 fi
 
 
commit f618455c802abb77de8d64eb442422cfe5e26ea8
Author: Kristian Høgsberg <krh at bitplanet.net>
Date:   Tue Apr 8 09:19:13 2014 -0700

    xwayland: Build without xshmfence
    
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>
    Signed-off-by: Kristian Høgsberg <krh at bitplanet.net>

diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c
index 5cecefd..844745a 100644
--- a/hw/xwayland/xwayland.c
+++ b/hw/xwayland/xwayland.c
@@ -573,8 +573,10 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv)
 
     fbPictureInit(pScreen, 0, 0);
 
+#ifdef HAVE_XSHMFENCE
     if (!miSyncShmScreenInit(pScreen))
         return FALSE;
+#endif
 
     xwl_screen->wayland_fd = wl_display_get_fd(xwl_screen->display);
     AddGeneralSocket(xwl_screen->wayland_fd);
commit 552d40b26a082df6f1816bb461793b8fa8b553c6
Author: Kristian Høgsberg <krh at bitplanet.net>
Date:   Tue Apr 8 09:17:51 2014 -0700

    xwayland: Build without GLX extension
    
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>
    Signed-off-by: Kristian Høgsberg <krh at bitplanet.net>

diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c
index c2c6481..5cecefd 100644
--- a/hw/xwayland/xwayland.c
+++ b/hw/xwayland/xwayland.c
@@ -616,8 +616,10 @@ xwl_log_handler(const char *format, va_list args)
     FatalError("%s", msg);
 }
 
-static const ExtensionModule glx_extension[] = {
+static const ExtensionModule xwayland_extensions[] = {
+#ifdef GLXEXT
     { GlxExtensionInit, "GLX", &noGlxExtension },
+#endif
 };
 
 void
@@ -639,7 +641,8 @@ InitOutput(ScreenInfo * screen_info, int argc, char **argv)
     screen_info->bitmapBitOrder = BITMAP_BIT_ORDER;
     screen_info->numPixmapFormats = ARRAY_SIZE(depths);
 
-    LoadExtensionList(glx_extension, ARRAY_SIZE(glx_extension), FALSE);
+    LoadExtensionList(xwayland_extensions,
+                      ARRAY_SIZE(xwayland_extensions), FALSE);
 
     /* Cast away warning from missing printf annotation for
      * wl_log_func_t.  Wayland 1.5 will have the annotation, so we can
commit c7011249d2abe6cc7af82ee4b79d8f6873444707
Author: Keith Packard <keithp at keithp.com>
Date:   Fri Apr 18 15:12:14 2014 -0700

    xkb: Verify reads of compiled keymap header and TOC
    
    Check the return values from fread to make sure the elements are
    actually getting read from the file.
    
    Signed-off-by: Keith Packard <keithp at keithp.com>
    Reviewed-by: Jamey Sharp <jamey at minilop.net>

diff --git a/xkb/xkmread.c b/xkb/xkmread.c
index 258bb91..b6241b5 100644
--- a/xkb/xkmread.c
+++ b/xkb/xkmread.c
@@ -1204,7 +1204,8 @@ XkmReadTOC(FILE * file, xkmFileInfo * file_info, int max_toc,
         }
         return 0;
     }
-    fread(file_info, SIZEOF(xkmFileInfo), 1, file);
+    if (fread(file_info, SIZEOF(xkmFileInfo), 1, file) != 1)
+        return 0;
     size_toc = file_info->num_toc;
     if (size_toc > max_toc) {
         DebugF("Warning! Too many TOC entries; last %d ignored\n",
@@ -1212,7 +1213,8 @@ XkmReadTOC(FILE * file, xkmFileInfo * file_info, int max_toc,
         size_toc = max_toc;
     }
     for (i = 0; i < size_toc; i++) {
-        fread(&toc[i], SIZEOF(xkmSectionInfo), 1, file);
+        if (fread(&toc[i], SIZEOF(xkmSectionInfo), 1, file) != 1)
+            return 0;
     }
     return 1;
 }
commit 0af8788579c2f52cc1172952c9004483bf863932
Author: Keith Packard <keithp at keithp.com>
Date:   Fri Apr 18 15:09:50 2014 -0700

    os: Ignore log file write failures
    
    There's no place to log the message if writing to the log file fails,
    and we surely don't want to crash in that case, so just ignore errors
    and keep going.
    
    Signed-off-by: Keith Packard <keithp at keithp.com>
    Reviewed-by: Jamey Sharp <jamey at minilop.net>

diff --git a/os/log.c b/os/log.c
index 38193ee..a0f2a81 100644
--- a/os/log.c
+++ b/os/log.c
@@ -491,13 +491,14 @@ static void
 LogSWrite(int verb, const char *buf, size_t len, Bool end_line)
 {
     static Bool newline = TRUE;
+    int ret;
 
     if (verb < 0 || logVerbosity >= verb)
-        write(2, buf, len);
+        ret = write(2, buf, len);
 
     if (verb < 0 || logFileVerbosity >= verb) {
         if (inSignalContext && logFileFd >= 0) {
-            write(logFileFd, buf, len);
+            ret = write(logFileFd, buf, len);
 #ifndef WIN32
             if (logFlush && logSync)
                 fsync(logFileFd);
@@ -529,6 +530,11 @@ LogSWrite(int verb, const char *buf, size_t len, Bool end_line)
             bufferPos += len;
         }
     }
+
+    /* There's no place to log an error message if the log write
+     * fails...
+     */
+    (void) ret;
 }
 
 void
commit 7abd28685066369ded807f59493c1159cfb286bf
Author: Keith Packard <keithp at keithp.com>
Date:   Fri Apr 18 15:05:00 2014 -0700

    os: Make sure that writing our pid to the lock file actually worked
    
    There's no sense verifying that we can create the lock file and then
    ignoring the return value from write.
    
    Signed-off-by: Keith Packard <keithp at keithp.com>
    Reviewed-by: Jamey Sharp <jamey at minilop.net>

diff --git a/os/utils.c b/os/utils.c
index 6e6974e..83d85cd 100644
--- a/os/utils.c
+++ b/os/utils.c
@@ -313,7 +313,8 @@ LockServer(void)
     if (lfd < 0)
         FatalError("Could not create lock file in %s\n", tmp);
     snprintf(pid_str, sizeof(pid_str), "%10ld\n", (long) getpid());
-    (void) write(lfd, pid_str, 11);
+    if (write(lfd, pid_str, 11) != 11)
+        FatalError("Could not write pid to lock file in %s\n", tmp);
     (void) fchmod(lfd, 0444);
     (void) close(lfd);
 
commit d72f691c0c9cace857975a6608a4cb431c8b6846
Author: Keith Packard <keithp at keithp.com>
Date:   Fri Apr 18 15:00:30 2014 -0700

    os: FatalError if -displayfd writes fail
    
    When the server is started with the -displayfd option, check to make
    sure that the writes succeed and give up running if they don't.
    
    Signed-off-by: Keith Packard <keithp at keithp.com>
    Reviewed-by: Jamey Sharp <jamey at minilop.net>

diff --git a/os/connection.c b/os/connection.c
index 5294e59..40d9ff3 100644
--- a/os/connection.c
+++ b/os/connection.c
@@ -353,8 +353,10 @@ NotifyParentProcess(void)
 {
 #if !defined(WIN32)
     if (displayfd >= 0) {
-        write(displayfd, display, strlen(display));
-        write(displayfd, "\n", 1);
+        if (write(displayfd, display, strlen(display)) != strlen(display))
+            FatalError("Cannot write display number to fd %d\n", displayfd);
+        if (write(displayfd, "\n", 1) != 1)
+            FatalError("Cannot write display number to fd %d\n", displayfd);
         close(displayfd);
         displayfd = -1;
     }
commit 4957e986841225e9984daca76f1a0ee08df125bb
Author: Keith Packard <keithp at keithp.com>
Date:   Fri Apr 18 15:00:35 2014 -0700

    os: Clear the -displayfd option after closing the file
    
    Failing to clear this means that we'll attempt to write the display
    number to a random file descriptor on subsequent X server generations.
    
    Signed-off-by: Keith Packard <keithp at keithp.com>
    Reviewed-by: Jamey Sharp <jamey at minilop.net>

diff --git a/os/connection.c b/os/connection.c
index e914d9d..5294e59 100644
--- a/os/connection.c
+++ b/os/connection.c
@@ -356,6 +356,7 @@ NotifyParentProcess(void)
         write(displayfd, display, strlen(display));
         write(displayfd, "\n", 1);
         close(displayfd);
+        displayfd = -1;
     }
     if (RunFromSmartParent) {
         if (ParentProcess > 1) {
commit 0c0feddbcda238efa82a47f456ef3008ffa53195
Author: Keith Packard <keithp at keithp.com>
Date:   Fri Apr 18 14:54:02 2014 -0700

    kdrive: Ignore failure to chown console tty to current user
    
    I'm not sure what we'd do in this case anyways, other than fatal
    error.
    
    Signed-off-by: Keith Packard <keithp at keithp.com>
    Reviewed-by: Jamey Sharp <jamey at minilop.net>

diff --git a/hw/kdrive/linux/linux.c b/hw/kdrive/linux/linux.c
index 6284de5..73a8169 100644
--- a/hw/kdrive/linux/linux.c
+++ b/hw/kdrive/linux/linux.c
@@ -68,13 +68,16 @@ LinuxCheckChown(const char *file)
     struct stat st;
     __uid_t u;
     __gid_t g;
+    int r;
 
     if (stat(file, &st) < 0)
         return;
     u = getuid();
     g = getgid();
-    if (st.st_uid != u || st.st_gid != g)
-        chown(file, u, g);
+    if (st.st_uid != u || st.st_gid != g) {
+        r = chown(file, u, g);
+        (void) r;
+    }
 }
 
 static int
commit 696e08f8e820449bb4b0ce7a60bf5b5bc5097935
Author: Keith Packard <keithp at keithp.com>
Date:   Fri Apr 18 14:50:14 2014 -0700

    kdrive: Explicitly ignore errors from the -switchCmd script
    
    Make it clear that we intentionally ignore the -switchCmd return
    value. This keeps GCC from emitting a warning when the server is
    compiled with -D_FORTIFY_SOURCE=2.
    
    Signed-off-by: Keith Packard <keithp at keithp.com>
    Reviewed-by: Jamey Sharp <jamey at minilop.net>

diff --git a/hw/kdrive/src/kdrive.c b/hw/kdrive/src/kdrive.c
index 8eb8cd0..9814fc6 100644
--- a/hw/kdrive/src/kdrive.c
+++ b/hw/kdrive/src/kdrive.c
@@ -118,10 +118,17 @@ KdDoSwitchCmd(const char *reason)
 {
     if (kdSwitchCmd) {
         char *command;
+        int ret;
 
         if (asprintf(&command, "%s %s", kdSwitchCmd, reason) == -1)
             return;
-        system(command);
+
+        /* Ignore the return value from system; I'm not sure
+         * there's anything more useful to be done when
+         * it fails
+         */
+        ret = system(command);
+        (void) ret;
         free(command);
     }
 }
commit 570b1c79942b237022be3594ae3a25e7b833cb73
Author: Keith Packard <keithp at keithp.com>
Date:   Fri Apr 18 14:47:00 2014 -0700

    test: [v2] Validate server log reading more carefully in signal-logging test
    
    Check return value from fgets and strchr instead of assuming they
    worked.
    
    [v2]
    
    Don't do any necessary work inside the assert call.
    Also make sure the return value was long enough.
    
    Signed-off-by: Keith Packard <keithp at keithp.com>
    Reviewed-by: Jamey Sharp <jamey at minilop.net>

diff --git a/test/signal-logging.c b/test/signal-logging.c
index 88b37c1..4320121 100644
--- a/test/signal-logging.c
+++ b/test/signal-logging.c
@@ -178,9 +178,14 @@ static void logging_format(void)
     LogInit(log_file_path, NULL);
     assert(f = fopen(log_file_path, "r"));
 
-#define read_log_msg(msg) \
-    fgets(read_buf, sizeof(read_buf), f); \
-    msg = strchr(read_buf, ']') + 2; /* advance past [time.stamp] */
+#define read_log_msg(msg) do {                                  \
+        msg = fgets(read_buf, sizeof(read_buf), f);             \
+        assert(msg != NULL);                                   \
+        msg = strchr(read_buf, ']');                            \
+        assert(msg != NULL);                                    \
+        assert(strlen(msg) > 2);                                \
+        msg = msg + 2; /* advance past [time.stamp] */          \
+    } while (0)
 
     /* boring test message */
     LogMessageVerbSigSafe(X_ERROR, -1, "test message\n");
commit 3119aae80782b7ff5613c719fbcc8a01feab1134
Author: Gaetan Nadon <memsize at videotron.ca>
Date:   Fri Apr 4 14:59:21 2014 -0400

    test: create a link to the generated hw/xfree86/sdksyms.c at build time
    
    Automake 1.14 gives us warning about source code specified in _SOURCES
    that comes from directories other than the current one. It suggests to enable
    the subdir-objects feature which only supports code in sub directories.
    
    The test directory needs source from hw/xfree86 which is neither under test
    nor under a sub directory of test. In 1.14 we get a warning, in 2.0 it will
    break as it will overwrite the object code in xfree86.
    
    The solution in this case is to create a link to hw/xfree86/sdksyms.c at build
    time. It's just like any other built source file.
    
    There are no links created in git.
    
    Signed-off-by: Gaetan Nadon <memsize at videotron.ca>
    Reviewed-by: Keith Packard <keithp at keithp.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/test/.gitignore b/test/.gitignore
index acbda7a..da86d6e 100644
--- a/test/.gitignore
+++ b/test/.gitignore
@@ -4,6 +4,7 @@ input
 list
 misc
 os
+sdksyms.c
 string
 touch
 xfree86
diff --git a/test/Makefile.am b/test/Makefile.am
index 3ad24d9..32edc7a 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -41,7 +41,7 @@ os_LDADD=$(TEST_LDADD)
 libxservertest_la_LIBADD = $(XSERVER_LIBS)
 if XORG
 
-nodist_libxservertest_la_SOURCES = $(top_builddir)/hw/xfree86/sdksyms.c
+nodist_libxservertest_la_SOURCES = sdksyms.c
 libxservertest_la_LIBADD += \
             $(top_builddir)/hw/xfree86/loader/libloader.la \
             $(top_builddir)/hw/xfree86/os-support/libxorgos.la \
@@ -55,6 +55,12 @@ libxservertest_la_LIBADD += \
             $(top_builddir)/hw/xfree86/dixmods/libxorgxkb.la \
             @XORG_LIBS@
 
+BUILT_SOURCES = sdksyms.c
+CLEANFILES = sdksyms.c
+
+sdksyms.c: $(top_builddir)/hw/xfree86/sdksyms.c
+	$(AM_V_GEN)$(LN_S) $(top_builddir)/hw/xfree86/sdksyms.c
+
 if DRI
 libxservertest_la_LIBADD += $(top_builddir)/hw/xfree86/dri/libdri.la
 endif
commit 58ef01648b18f85ad79620da110ece2339f638c3
Author: Adam Jackson <ajax at redhat.com>
Date:   Thu Apr 17 10:49:46 2014 -0400

    dri1: Don't bother asking the loader about drmGetLibVersion
    
    This was added for DRM_IOCTL_SET_VERSION support, which has been around
    for over ten years now. Since we require ≥2.3.0 in configure.ac this
    would really only protect you if you managed to build against a modern
    libdrm but run against one that's more than 7½ years old, which, doctor
    it hurts when I do this.
    
    Archaeology: http://cgit.freedesktop.org/~ajax/dri/commit/xc/programs/Xserver/GL/dri/dri.c?id=77d62efca033dced96ab7998b7c62a4e2df907d5
    Signed-off-by: Adam Jackson <ajax at redhat.com>
    Reviewed-by: Eric Anholt <eric at anholt.net>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/xfree86/dri/dri.c b/hw/xfree86/dri/dri.c
index 6033999..95828bb 100644
--- a/hw/xfree86/dri/dri.c
+++ b/hw/xfree86/dri/dri.c
@@ -177,19 +177,15 @@ DRIOpenDRMMaster(ScrnInfoPtr pScrn,
     memset(&tmp, 0, sizeof(tmp));
 
     /* Check the DRM lib version.
-     * drmGetLibVersion was not supported in version 1.0, so check for
-     * symbol first to avoid possible crash or hang.
      */
 
     drmlibmajor = 1;
     drmlibminor = 0;
-    if (xf86LoaderCheckSymbol("drmGetLibVersion")) {
-        drmlibv = drmGetLibVersion(-1);
-        if (drmlibv != NULL) {
-            drmlibmajor = drmlibv->version_major;
-            drmlibminor = drmlibv->version_minor;
-            drmFreeVersion(drmlibv);
-        }
+    drmlibv = drmGetLibVersion(-1);
+    if (drmlibv != NULL) {
+        drmlibmajor = drmlibv->version_major;
+        drmlibminor = drmlibv->version_minor;
+        drmFreeVersion(drmlibv);
     }
 
     /* Check if the libdrm can handle falling back to loading based on name
commit 461ed561b9f75cee43c0dfd39228716f977956e7
Author: Hans de Goede <hdegoede at redhat.com>
Date:   Fri Apr 18 11:30:16 2014 +0200

    Xorg.wrap manpages: use __appmansuffix__ instead of hardcoding 1
    
    Cc: Gaetan Nadon <memsize at videotron.ca>
    Signed-off-by: Hans de Goede <hdegoede at redhat.com>
    Reviewed-by: Gaetan Nadon <memsize at videotron.ca>

diff --git a/hw/xfree86/man/Xorg.wrap.man b/hw/xfree86/man/Xorg.wrap.man
index f2153e3..58937c7 100644
--- a/hw/xfree86/man/Xorg.wrap.man
+++ b/hw/xfree86/man/Xorg.wrap.man
@@ -1,4 +1,4 @@
-.\" Xwrapper.wrap.1
+.\" Xwrapper.wrap.__appmansuffix__
 .\"
 .\" Copyright 2014 Red Hat, Inc.
 .\"
@@ -26,7 +26,7 @@
 .\"
 .\" shorthand for double quote that works everywhere.
 .ds q \N'34'
-.TH Xorg.wrap 1 __xorgversion__
+.TH Xorg.wrap __appmansuffix__ __xorgversion__
 .SH NAME
 Xorg.wrap \- Xorg X server binary wrapper
 .SH DESCRIPTION
diff --git a/hw/xfree86/man/Xwrapper.config.man b/hw/xfree86/man/Xwrapper.config.man
index 800947c..5c777c9 100644
--- a/hw/xfree86/man/Xwrapper.config.man
+++ b/hw/xfree86/man/Xwrapper.config.man
@@ -1 +1 @@
-.so man1/Xorg.wrap.1
+.so man__appmansuffix__/Xorg.wrap.__appmansuffix__
commit 584961c86427b400a5ba65b0f145d00748d2da1e
Author: Hans de Goede <hdegoede at redhat.com>
Date:   Fri Apr 18 11:26:00 2014 +0200

    man/Makefile.am: Fix Xorg.wrap.man Xwrapper.config.man missing from make dist
    
    Fix suggested by: Gaetan Nadon <memsize at videotron.ca>
    
    Cc: Gaetan Nadon <memsize at videotron.ca>
    Signed-off-by: Hans de Goede <hdegoede at redhat.com>
    Reviewed-by: Gaetan Nadon <memsize at videotron.ca>

diff --git a/hw/xfree86/man/Makefile.am b/hw/xfree86/man/Makefile.am
index f41d26c..5da404c 100644
--- a/hw/xfree86/man/Makefile.am
+++ b/hw/xfree86/man/Makefile.am
@@ -5,4 +5,6 @@ fileman_PRE = xorg.conf.man xorg.conf.d.man
 if SUID_WRAPPER
 appman_PRE += Xorg.wrap.man
 fileman_PRE += Xwrapper.config.man
+else
+EXTRA_DIST += Xorg.wrap.man Xwrapper.config.man
 endif
commit ec01d51a9973a9cf5f32f14f00058f1fdc9ed25e
Author: Guillem Jover <guillem at hadrons.org>
Date:   Mon Apr 14 18:13:25 2014 +0200

    Xorg.wrap: Make the console check portable
    
    Handle the unported case by issuing a build-time and run-time warning.
    
    And add support for FreeBSD kernel based systems, by using the
    VT_GETINDEX ioctl to check if the file descriptor is on a virtual
    console.
    
    Signed-off-by: Guillem Jover <guillem at hadrons.org>
    Reviewed-by: Hans de Goede <hdegoede at redhat.com>
    Signed-off-by: Hans de Goede <hdegoede at redhat.com>

diff --git a/hw/xfree86/xorg-wrapper.c b/hw/xfree86/xorg-wrapper.c
index 12ea2c3..4ea4733 100644
--- a/hw/xfree86/xorg-wrapper.c
+++ b/hw/xfree86/xorg-wrapper.c
@@ -35,6 +35,9 @@
 #include <sys/ioctl.h>
 #include <sys/stat.h>
 #include <sys/types.h>
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+#include <sys/consio.h>
+#endif
 #include <unistd.h>
 #include <drm.h>
 #include <xf86drm.h> /* For DRM_DEV_NAME */
@@ -150,10 +153,37 @@ static void parse_config(int *allowed, int *needs_root_rights)
     fclose(f);
 }
 
+static int on_console(int fd)
+{
+#if defined(__linux__)
+    struct stat st;
+    int r;
+
+    r = fstat(fd, &st);
+    if (r == 0 && S_ISCHR(st.st_mode) && major(st.st_rdev) == 4)
+      return 1;
+#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+    int idx;
+
+    if (ioctl(fd, VT_GETINDEX, &idx) != -1)
+        return 1;
+#else
+#warning This program needs porting to your kernel.
+    static int seen;
+
+    if (!seen) {
+        fprintf(stderr, "%s: Unable to determine if running on a console\n",
+            progname);
+        seen = 1;
+    }
+#endif
+
+    return 0;
+}
+
 int main(int argc, char *argv[])
 {
     struct drm_mode_card_res res;
-    struct stat st;
     char buf[PATH_MAX];
     int i, r, fd;
     int kms_cards = 0;
@@ -176,8 +206,7 @@ int main(int argc, char *argv[])
         case CONSOLE_ONLY:
             /* Some of stdin / stdout / stderr maybe redirected to a file */
             for (i = STDIN_FILENO; i <= STDERR_FILENO; i++) {
-                r = fstat(i, &st);
-                if (r == 0 && S_ISCHR(st.st_mode) && major(st.st_rdev) == 4)
+                if (on_console(i))
                     break;
             }
             if (i > STDERR_FILENO) {
commit 3a469917b585914ba2421e305f3b6a837b232e93
Author: Guillem Jover <guillem at hadrons.org>
Date:   Mon Apr 14 18:13:24 2014 +0200

    Xorg.wrap: Clarify error messages
    
    Not printing the program name produces very confusing messages that
    might be difficult to attribute while trying to diagnose problems,
    let's be explicit about who we are.
    
    Also add a missing "/" between SUID_WRAPPER_DIR and "Xorg.bin".
    
    Signed-off-by: Guillem Jover <guillem at hadrons.org>
    Reviewed-by: Hans de Goede <hdegoede at redhat.com>
    Signed-off-by: Hans de Goede <hdegoede at redhat.com>

diff --git a/hw/xfree86/xorg-wrapper.c b/hw/xfree86/xorg-wrapper.c
index 80889e8..12ea2c3 100644
--- a/hw/xfree86/xorg-wrapper.c
+++ b/hw/xfree86/xorg-wrapper.c
@@ -25,6 +25,7 @@
 
 #include "dix-config.h"
 
+#include <errno.h>
 #include <fcntl.h>
 #include <limits.h>
 #include <stdint.h>
@@ -40,6 +41,8 @@
 
 #define CONFIG_FILE SYSCONFDIR "/X11/Xwrapper.config"
 
+static const char *progname;
+
 enum { ROOT_ONLY, CONSOLE_ONLY, ANYBODY };
 
 /* KISS non locale / LANG parsing isspace version */
@@ -88,18 +91,21 @@ static void parse_config(int *allowed, int *needs_root_rights)
         /* Split in a key + value pair */
         equals = strchr(stripped, '=');
         if (!equals) {
-            fprintf(stderr, "Syntax error at %s line %d\n", CONFIG_FILE, line);
+            fprintf(stderr, "%s: Syntax error at %s line %d\n", progname,
+                CONFIG_FILE, line);
             exit(1);
         }
         *equals = 0;
         key   = strip(stripped);   /* To remove trailing whitespace from key */
         value = strip(equals + 1); /* To remove leading whitespace from val */
         if (!key[0]) {
-            fprintf(stderr, "Missing key at %s line %d\n", CONFIG_FILE, line);
+            fprintf(stderr, "%s: Missing key at %s line %d\n", progname,
+                CONFIG_FILE, line);
             exit(1);
         }
         if (!value[0]) {
-            fprintf(stderr, "Missing value at %s line %d\n", CONFIG_FILE, line);
+            fprintf(stderr, "%s: Missing value at %s line %d\n", progname,
+                CONFIG_FILE, line);
             exit(1);
         }
 
@@ -113,8 +119,8 @@ static void parse_config(int *allowed, int *needs_root_rights)
                 *allowed = ANYBODY;
             else {
                 fprintf(stderr,
-                    "Invalid value '%s' for 'allowed_users' at %s line %d\n",
-                    value, CONFIG_FILE, line);
+                    "%s: Invalid value '%s' for 'allowed_users' at %s line %d\n",
+                    progname, value, CONFIG_FILE, line);
                 exit(1);
             }
         }
@@ -127,8 +133,8 @@ static void parse_config(int *allowed, int *needs_root_rights)
                 *needs_root_rights = -1;
             else {
                 fprintf(stderr,
-                    "Invalid value '%s' for 'needs_root_rights' at %s line %d\n",
-                    value, CONFIG_FILE, line);
+                    "%s: Invalid value '%s' for 'needs_root_rights' at %s line %d\n",
+                    progname, value, CONFIG_FILE, line);
                 exit(1);
             }
         }
@@ -136,8 +142,8 @@ static void parse_config(int *allowed, int *needs_root_rights)
             /* Backward compatibility with older Debian Xwrapper, ignore */
         }
         else {
-            fprintf(stderr, "Invalid key '%s' at %s line %d\n", key,
-                    CONFIG_FILE, line);
+            fprintf(stderr, "%s: Invalid key '%s' at %s line %d\n", key,
+                progname, CONFIG_FILE, line);
             exit(1);
         }
     }
@@ -155,6 +161,8 @@ int main(int argc, char *argv[])
     int allowed = CONSOLE_ONLY;
     int needs_root_rights = -1;
 
+    progname = argv[0];
+
     parse_config(&allowed, &needs_root_rights);
 
     /* For non root users check if they are allowed to run the X server */
@@ -207,11 +215,13 @@ int main(int argc, char *argv[])
         uid_t realuid = getuid();
 
         if (setresgid(-1, realgid, realgid) != 0) {
-            perror("Could not drop setgid privileges");
+            fprintf(stderr, "%s: Could not drop setgid privileges: %s\n",
+                progname, strerror(errno));
             exit(1);
         }
         if (setresuid(-1, realuid, realuid) != 0) {
-            perror("Could not drop setuid privileges");
+            fprintf(stderr, "%s: Could not drop setuid privileges: %s\n",
+                progname, strerror(errno));
             exit(1);
         }
     }
@@ -220,12 +230,14 @@ int main(int argc, char *argv[])
 
     /* Check if the server is executable by our real uid */
     if (access(buf, X_OK) != 0) {
-        perror("Missing execute permissions for " SUID_WRAPPER_DIR "Xorg.bin");
+        fprintf(stderr, "%s: Missing execute permissions for %s/Xorg.bin: %s\n",
+            progname, SUID_WRAPPER_DIR, strerror(errno));
         exit(1);
     }
 
     argv[0] = buf;
     (void) execv(argv[0], argv);
-    perror("Failed to execute " SUID_WRAPPER_DIR "/Xorg.bin");
+    fprintf(stderr, "%s: Failed to execute %s/Xorg.bin: %s\n",
+        progname, SUID_WRAPPER_DIR, strerror(errno));
     exit(1);
 }
commit 50b6e1b0d786d95ee8eab030b0d1fd7420e2fbeb
Author: Guillem Jover <guillem at hadrons.org>
Date:   Mon Apr 14 18:13:23 2014 +0200

    Xorg.wrap: Use <drm.h> instead of hardcoding libdrm include path
    
    The libdrm.pc file gives us the correct include path, do not try to
    hardcode it on the source, as it might vary on the installed system,
    for example on Debian-based systems it's under /user/include/libdrm/.
    
    Signed-off-by: Guillem Jover <guillem at hadrons.org>
    Reviewed-by: Hans de Goede <hdegoede at redhat.com>
    Signed-off-by: Hans de Goede <hdegoede at redhat.com>

diff --git a/hw/xfree86/xorg-wrapper.c b/hw/xfree86/xorg-wrapper.c
index 90c8c11..80889e8 100644
--- a/hw/xfree86/xorg-wrapper.c
+++ b/hw/xfree86/xorg-wrapper.c
@@ -35,7 +35,7 @@
 #include <sys/stat.h>
 #include <sys/types.h>
 #include <unistd.h>
-#include <drm/drm.h>
+#include <drm.h>
 #include <xf86drm.h> /* For DRM_DEV_NAME */
 
 #define CONFIG_FILE SYSCONFDIR "/X11/Xwrapper.config"
commit 7bffceb9f939c0bf5529b00500cbb14ae01bb61a
Author: Guillem Jover <guillem at hadrons.org>
Date:   Mon Apr 14 18:13:22 2014 +0200

    Xorg: Add Xorg.wrap to hw/xfree86/.gitignore
    
    Signed-off-by: Guillem Jover <guillem at hadrons.org>
    Reviewed-by: Hans de Goede <hdegoede at redhat.com>
    Signed-off-by: Hans de Goede <hdegoede at redhat.com>

diff --git a/hw/xfree86/.gitignore b/hw/xfree86/.gitignore
index fb6830b..c84c37f 100644
--- a/hw/xfree86/.gitignore
+++ b/hw/xfree86/.gitignore
@@ -1,4 +1,5 @@
 Xorg
+Xorg.wrap
 Xorg.sh
 xorg.conf.example
 sdksyms.c
commit 208157a76c6f340e0161e18ac77149d7110af2f5
Author: Julien Cristau <jcristau at debian.org>
Date:   Sun Apr 13 19:14:34 2014 +0200

    configure: fix help text for dmx
    
    As of 93fa64e17d7bd600ebf18ecab85f5b2d17fe30ce it's disabled by default,
    so stop saying it's automatically enabled in configure --help.
    
    Signed-off-by: Julien Cristau <jcristau at debian.org>
    Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
    Reviewed-by: Hans de Goede <hdegoede at redhat.com>
    Signed-off-by: Hans de Goede <hdegoede at redhat.com>

diff --git a/configure.ac b/configure.ac
index 695a481..bfe1fc9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -629,7 +629,7 @@ AC_ARG_ENABLE(suid-wrapper, AS_HELP_STRING([--enable-suid-wrapper], [Build suid-
 
 dnl DDXes.
 AC_ARG_ENABLE(xorg,    	      AS_HELP_STRING([--enable-xorg], [Build Xorg server (default: auto)]), [XORG=$enableval], [XORG=auto])
-AC_ARG_ENABLE(dmx,    	      AS_HELP_STRING([--enable-dmx], [Build DMX server (default: auto)]), [DMX=$enableval], [DMX=no])
+AC_ARG_ENABLE(dmx,    	      AS_HELP_STRING([--enable-dmx], [Build DMX server (default: no)]), [DMX=$enableval], [DMX=no])
 AC_ARG_ENABLE(xvfb,    	      AS_HELP_STRING([--enable-xvfb], [Build Xvfb server (default: yes)]), [XVFB=$enableval], [XVFB=yes])
 AC_ARG_ENABLE(xnest,   	      AS_HELP_STRING([--enable-xnest], [Build Xnest server (default: auto)]), [XNEST=$enableval], [XNEST=auto])
 AC_ARG_ENABLE(xquartz,        AS_HELP_STRING([--enable-xquartz], [Build Xquartz server for OS-X (default: auto)]), [XQUARTZ=$enableval], [XQUARTZ=auto])
commit c917fa411502d402b9c69de30f6a88e102bb8610
Author: Keith Packard <keithp at keithp.com>
Date:   Tue Apr 8 01:01:28 2014 -0700

    glamor: Always allocate precisely the requested pixmap size
    
    Using a pixmap as a tile or stipple means that we must have the
    underlying FBO match the pixmap geometry exactly. We may want to add
    some complexity here to migrate pixmaps into exact sized objects as
    necessary, but for now, make the server work correctly by skipping
    this optimization.
    
    Signed-off-by: Keith Packard <keithp at keithp.com>
    Reviewed-by: Eric Anholt <eric at anholt.net>

diff --git a/glamor/glamor_fbo.c b/glamor/glamor_fbo.c
index 4f6da67..d0215be 100644
--- a/glamor/glamor_fbo.c
+++ b/glamor/glamor_fbo.c
@@ -367,10 +367,11 @@ glamor_create_fbo(glamor_screen_private *glamor_priv,
     if (flag == GLAMOR_CREATE_PIXMAP_MAP)
         goto no_tex;
 
-    if (flag == GLAMOR_CREATE_PIXMAP_FIXUP)
-        cache_flag = GLAMOR_CACHE_EXACT_SIZE;
-    else
-        cache_flag = 0;
+    /* Tiling from textures requires exact pixmap sizes. As we don't
+     * know which pixmaps will be used as tiles, just allocate
+     * everything at the requested size
+     */
+    cache_flag = GLAMOR_CACHE_EXACT_SIZE;
 
     fbo = glamor_pixmap_fbo_cache_get(glamor_priv, w, h, format, cache_flag);
     if (fbo)
commit 3028ae6c9aa37168e249e0d847b29f8e3efb05b2
Merge: bd3de10 ec6007e
Author: Keith Packard <keithp at keithp.com>
Date:   Wed Apr 9 21:59:17 2014 -0700

    Merge remote-tracking branch 'jeremyhu/master'

commit bd3de10f86a511886b0748d55fa19860314a0150
Author: Keith Packard <keithp at keithp.com>
Date:   Tue Apr 8 14:25:18 2014 -0700

    Bump to version 1.15.99.902. Closing the 1.16 merge window.
    
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/configure.ac b/configure.ac
index 70eceab..695a481 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,9 +26,9 @@ dnl
 dnl Process this file with autoconf to create configure.
 
 AC_PREREQ(2.60)
-AC_INIT([xorg-server], 1.15.99.901, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
-RELEASE_DATE="2014-02-24"
-RELEASE_NAME="Szechuan Hot Pot"
+AC_INIT([xorg-server], 1.15.99.902, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
+RELEASE_DATE="2014-04-08"
+RELEASE_NAME="Glacier Blue"
 AC_CONFIG_SRCDIR([Makefile.am])
 AC_CONFIG_MACRO_DIR([m4])
 AM_INIT_AUTOMAKE([foreign dist-bzip2])
commit 6ec04a75deb1695820e337abbefe1929d5928f15
Author: Keith Packard <keithp at keithp.com>
Date:   Fri Apr 4 16:28:43 2014 -0700

    dri3: Fix dri3_open API change by adding new dri3_open_client
    
    Xwayland will eventually need the current client in dri3_open. Simply
    changing that API is not an option though as other drivers that
    implement DRI3 will not have a matching function signature and will
    crash when called.
    
    Add a new dri3_open_client function pointer and bump
    DRI3_SCREEN_INFO_VERSION so that drivers can be aware of the new
    function which will be used in preference to the old function when
    available.
    
    Signed-off-by: Keith Packard <keithp at keithp.com>
    Reviewed-by: Eric Anhole <eric at anholt.net>

diff --git a/dri3/dri3.h b/dri3/dri3.h
index 1c04cbd..edc7fa2 100644
--- a/dri3/dri3.h
+++ b/dri3/dri3.h
@@ -30,13 +30,17 @@
 #include <X11/extensions/dri3proto.h>
 #include <randrstr.h>
 
-#define DRI3_SCREEN_INFO_VERSION        0
+#define DRI3_SCREEN_INFO_VERSION        1
 
-typedef int (*dri3_open_proc)(ClientPtr client,
-                              ScreenPtr screen,
+typedef int (*dri3_open_proc)(ScreenPtr screen,
                               RRProviderPtr provider,
                               int *fd);
 
+typedef int (*dri3_open_client_proc)(ClientPtr client,
+                                     ScreenPtr screen,
+                                     RRProviderPtr provider,
+                                     int *fd);
+
 typedef PixmapPtr (*dri3_pixmap_from_fd_proc) (ScreenPtr screen,
                                                int fd,
                                                CARD16 width,
@@ -56,6 +60,10 @@ typedef struct dri3_screen_info {
     dri3_open_proc              open;
     dri3_pixmap_from_fd_proc    pixmap_from_fd;
     dri3_fd_from_pixmap_proc    fd_from_pixmap;
+
+    /* Version 1 */
+    dri3_open_client_proc       open_client;
+
 } dri3_screen_info_rec, *dri3_screen_info_ptr;
 
 extern _X_EXPORT Bool
diff --git a/dri3/dri3_screen.c b/dri3/dri3_screen.c
index bbf1d05..6c0c60c 100644
--- a/dri3/dri3_screen.c
+++ b/dri3/dri3_screen.c
@@ -30,6 +30,14 @@
 #include <misyncshm.h>
 #include <randrstr.h>
 
+static inline Bool has_open(dri3_screen_info_ptr info) {
+    if (info == NULL)
+        return FALSE;
+
+    return info->open != NULL ||
+        (info->version >= 1 && info->open_client != NULL);
+}
+
 int
 dri3_open(ClientPtr client, ScreenPtr screen, RRProviderPtr provider, int *fd)
 {
@@ -37,10 +45,14 @@ dri3_open(ClientPtr client, ScreenPtr screen, RRProviderPtr provider, int *fd)
     dri3_screen_info_ptr        info = ds->info;
     int                         rc;
 
-    if (!info || !info->open)
+    if (!has_open(info))
         return BadMatch;
 
-    rc = (*info->open) (client, screen, provider, fd);
+    if (info->version >= 1 && info->open_client != NULL)
+        rc = (*info->open_client) (client, screen, provider, fd);
+    else
+        rc = (*info->open) (screen, provider, fd);
+
     if (rc != Success)
         return rc;
 
diff --git a/glamor/glamor_egl.c b/glamor/glamor_egl.c
index e2b6a92..d37de9b 100644
--- a/glamor/glamor_egl.c
+++ b/glamor/glamor_egl.c
@@ -608,10 +608,10 @@ glamor_egl_close_screen(ScreenPtr screen)
 }
 
 static int
-glamor_dri3_open(ClientPtr client,
-                 ScreenPtr screen,
-                 RRProviderPtr provider,
-                 int *fdp)
+glamor_dri3_open_client(ClientPtr client,
+                        ScreenPtr screen,
+                        RRProviderPtr provider,
+                        int *fdp)
 {
     ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
     struct glamor_egl_screen_private *glamor_egl =
@@ -658,8 +658,8 @@ glamor_dri3_open(ClientPtr client,
 }
 
 static dri3_screen_info_rec glamor_dri3_info = {
-    .version = 0,
-    .open = glamor_dri3_open,
+    .version = 1,
+    .open_client = glamor_dri3_open_client,
     .pixmap_from_fd = glamor_pixmap_from_fd,
     .fd_from_pixmap = glamor_fd_from_pixmap,
 };
commit ec6007e6f7772a90713c9c51c64359229961ce27
Author: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
Date:   Sun Apr 6 05:32:00 2014 -0700

    XQuartz: Ensure we wait for the server thread to terminate
    
    AKA: XQuartz 2.7.5 doesn't delete its /tmp/.X$d-lock
    
    http://xquartz.macosforge.org/trac/ticket/823
    
    Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu at apple.com>

diff --git a/hw/xquartz/X11Controller.m b/hw/xquartz/X11Controller.m
index 5445c6f..022e832 100644
--- a/hw/xquartz/X11Controller.m
+++ b/hw/xquartz/X11Controller.m
@@ -942,9 +942,8 @@ extern char *bundle_id_prefix;
     /* shutdown the X server, it will exit () for us. */
     DarwinSendDDXEvent(kXquartzQuit, 0);
 
-    /* In case it doesn't, exit anyway after a while. */
-    remain = 10000000;
-    while ((remain = usleep(remain)) > 0) ;
+    /* In case it doesn't, exit anyway after 5s. */
+    [NSThread sleepForTimeInterval:5.0];
 
     exit(1);
 }


More information about the Xquartz-changes mailing list