[Xquartz-changes] xserver: Branch 'server-1.15-apple' - 33 commits

Jeremy Huddleston jeremyhu at freedesktop.org
Fri Nov 29 11:37:06 PST 2013


Rebased ref, commits from common ancestor:
commit 845c191c0a617a62f390f06a197821ab447e9685
Author: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
Date:   Wed Nov 13 09:51:59 2013 -0800

    Test
    
    Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu at apple.com>

diff --git a/glx/glxdricommon.c b/glx/glxdricommon.c
index 1022c00..fd6da3c 100644
--- a/glx/glxdricommon.c
+++ b/glx/glxdricommon.c
@@ -23,6 +23,8 @@
  * SOFTWARE.
  */
 
+#ifndef __APPLE__
+
 #ifdef HAVE_DIX_CONFIG_H
 #include <dix-config.h>
 #endif
@@ -321,3 +323,5 @@ glxProbeDriver(const char *driverName,
     *coreExt = *renderExt = NULL;
     return NULL;
 }
+
+#endif
commit 9cdfac43a65008eaaedd93d89c893adedc5b0c9c
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 1c6963f..11e6344 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 7c2ead5..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;
-    }
-}
-
-static void
-fbUnrealizeGlyph(ScreenPtr pScreen,
-		 GlyphPtr pGlyph)
-{
-    if (glyphCache)
-	pixman_glyph_cache_remove (glyphCache, pGlyph, NULL);
-}
-
-static 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 f9080a4..7c7d656 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 1cd3c94db7fc30588aa7c18c249dd20a9a74c8e6
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 26957df..1c6963f 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 b503858..7c2ead5 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 bef9677991f6b1948b9e50e226baf0bd725912b3
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 8b7c93f..3e972f7 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 69c049c8fac869cb0f4d08ab126bd3863f72723b
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 15670d0..b35e464 100644
--- a/hw/xfree86/Makefile.am
+++ b/hw/xfree86/Makefile.am
@@ -43,8 +43,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
 
@@ -118,7 +117,7 @@ CLEANFILES = sdksyms.c sdksyms.dep
 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 ba70bd8c3402c9f2071af563e4f56462a2b05f81
Author: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
Date:   Wed Nov 13 09:24:12 2013 -0800

    glxstubs: Don't mix availability types on non-ELF
    
    Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu at apple.com>

diff --git a/glx/glxstubs.c b/glx/glxstubs.c
index 69bc004..509f65c 100644
--- a/glx/glxstubs.c
+++ b/glx/glxstubs.c
@@ -33,8 +33,14 @@
 #include <inttypes.h>
 #include "glxserver.h"
 
+#ifdef __ELF__
+#define _THUNK_AVAILABILITY _X_HIDDEN
+#else
+#define _THUNK_AVAILABILITY
+#endif
+
 #define thunk(name, type, call_args, ...) \
-    _X_HIDDEN void name(__VA_ARGS__) { \
+    _THUNK_AVAILABILITY void name(__VA_ARGS__) { \
 	static type proc; \
 	if (!proc) proc = __glGetProcAddress(#name); \
 	proc call_args; \
commit d695cb7fb6bb8fd159a332d902673edbbd2237d7
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date:   Mon Nov 25 22:19:34 2013 -0800

    Xdmx: Initialize DMX extension even if not built with GLX support
    
    dmxAddExtensions takes an argument to determine if it should just
    initialize the DMX extension, or both DMX & GLX, but if GLX wasn't
    compiled in, the entire call was #ifdef'ed out, leaving the DMX
    extension unavailable.
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
    Reviewed-by: Julien Cristau <jcristau at debian.org>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/dmx/dmxinit.c b/hw/dmx/dmxinit.c
index bd868a0..7adcba0 100644
--- a/hw/dmx/dmxinit.c
+++ b/hw/dmx/dmxinit.c
@@ -612,6 +612,8 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char *argv[])
 
 #ifdef GLXEXT
     static Bool glxSupported = TRUE;
+#else
+    const Bool glxSupported = FALSE;
 #endif
 
     if (dmxGeneration != serverGeneration) {
@@ -740,10 +742,10 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char *argv[])
     /* Check if GLX extension exists on all back-end servers */
     for (i = 0; i < dmxNumScreens; i++)
         glxSupported &= (dmxScreens[i].glxMajorOpcode > 0);
+#endif
 
     if (serverGeneration == 1)
         dmxAddExtensions(glxSupported);
-#endif
 
     /* Tell dix layer about the backend displays */
     for (i = 0; i < dmxNumScreens; i++) {
commit bd70def07754357d26b86c287037eb3884631daf
Author: Connor Behan <connor.behan at gmail.com>
Date:   Fri Nov 15 17:00:40 2013 -0800

    configure.ac: Require libpciaccess for int10
    
    A --disable-pciaccess build will fail with an int10 module other than
    stub.
    
    Signed-off-by: Connor Behan <connor.behan at gmail.com>
    Reviewed-by: Adam Jackson <ajax at redhat.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/configure.ac b/configure.ac
index c7ec947..6197e9b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1830,6 +1830,9 @@ if test "x$XORG" = xyes; then
 		if test "x$CONFIG_UDEV_KMS" = xyes; then
 			AC_MSG_ERROR([Platform device enumeration requires libpciaccess])
 		fi
+		if test "x$INT10" != xstub; then
+			AC_MSG_ERROR([Cannot build int10 without libpciaccess])
+		fi
 	fi
 	AC_MSG_RESULT([$PCI])
 
commit a575c1dc64c10bc88bd0e963ebb8ab137f59a078
Author: Connor Behan <connor.behan at gmail.com>
Date:   Fri Nov 15 17:00:20 2013 -0800

    configure.ac: Require libpciaccess for platform bus support
    
    There is currently no reason to build with --enable-config-udev-kms and
    --disable-pciaccess but anyone who tries this should know that the build
    will fail.
    
    Signed-off-by: Connor Behan <connor.behan at gmail.com>
    Reviewed-by: Adam Jackson <ajax at redhat.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/configure.ac b/configure.ac
index b8c85d5..c7ec947 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1826,6 +1826,10 @@ if test "x$XORG" = xyes; then
 			xorg_bus_sparc="yes"
 			;;
 		esac
+	else
+		if test "x$CONFIG_UDEV_KMS" = xyes; then
+			AC_MSG_ERROR([Platform device enumeration requires libpciaccess])
+		fi
 	fi
 	AC_MSG_RESULT([$PCI])
 
commit 361dfe74eaa2f1eddb54abdecca1d8b1b3f58704
Author: Connor Behan <connor.behan at gmail.com>
Date:   Fri Nov 15 17:00:00 2013 -0800

    configure.ac: Add whitespace near PCI configuration
    
    Signed-off-by: Connor Behan <connor.behan at gmail.com>
    Reviewed-by: Adam Jackson <ajax at redhat.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/configure.ac b/configure.ac
index 6c4a609..b8c85d5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1809,24 +1809,23 @@ if test "x$XORG" = xyes; then
 
 	AC_MSG_CHECKING([whether to build Xorg PCI functions])
 	if test "x$PCI" = xyes; then
-
-	PKG_CHECK_MODULES([PCIACCESS], $LIBPCIACCESS)
-	SDK_REQUIRED_MODULES="$SDK_REQUIRED_MODULES $LIBPCIACCESS"
-	XORG_SYS_LIBS="$XORG_SYS_LIBS $PCIACCESS_LIBS $GLX_SYS_LIBS $LIBDRM_LIBS"
-	XORG_CFLAGS="$XORG_CFLAGS $PCIACCESS_CFLAGS $LIBDRM_CFLAGS"
-
-	AC_DEFINE(XSERVER_LIBPCIACCESS, 1, [Use libpciaccess for all pci manipulation])
-	AC_DEFINE_DIR(PCI_TXT_IDS_PATH, PCI_TXT_IDS_DIR, [Default PCI text file ID path])
-	case $host_os in
-	  gnu* | freebsd* | kfreebsd*-gnu | netbsd* | openbsd* | solaris* | dragonfly*)
-		xorg_bus_bsdpci="yes"
-		;;
-	esac
-	case $host_cpu in
-	  sparc*)
-		xorg_bus_sparc="yes"
-		;;
-	esac
+		PKG_CHECK_MODULES([PCIACCESS], $LIBPCIACCESS)
+		SDK_REQUIRED_MODULES="$SDK_REQUIRED_MODULES $LIBPCIACCESS"
+		XORG_SYS_LIBS="$XORG_SYS_LIBS $PCIACCESS_LIBS $GLX_SYS_LIBS $LIBDRM_LIBS"
+		XORG_CFLAGS="$XORG_CFLAGS $PCIACCESS_CFLAGS $LIBDRM_CFLAGS"
+
+		AC_DEFINE(XSERVER_LIBPCIACCESS, 1, [Use libpciaccess for all pci manipulation])
+		AC_DEFINE_DIR(PCI_TXT_IDS_PATH, PCI_TXT_IDS_DIR, [Default PCI text file ID path])
+		case $host_os in
+		  gnu* | freebsd* | kfreebsd*-gnu | netbsd* | openbsd* | solaris* | dragonfly*)
+			xorg_bus_bsdpci="yes"
+			;;
+		esac
+		case $host_cpu in
+		  sparc*)
+			xorg_bus_sparc="yes"
+			;;
+		esac
 	fi
 	AC_MSG_RESULT([$PCI])
 
commit 80481267662c8687e73081237913fa561e7a6561
Author: Keith Packard <keithp at keithp.com>
Date:   Sat Nov 23 22:22:37 2013 -0800

    Bump release to 1.14.99.903 (1.15 RC3)
    
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/configure.ac b/configure.ac
index 2f4edee..6c4a609 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.14.99.902, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
-RELEASE_DATE="2013-11-14"
-RELEASE_NAME="English Breakfast"
+AC_INIT([xorg-server], 1.14.99.903, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
+RELEASE_DATE="2013-11-23"
+RELEASE_NAME="Apple Pie"
 AC_CONFIG_SRCDIR([Makefile.am])
 AM_INIT_AUTOMAKE([foreign dist-bzip2])
 AC_USE_SYSTEM_EXTENSIONS
commit f1604002a32b7f098c2a16b4a8649c694af570c8
Author: Keith Packard <keithp at keithp.com>
Date:   Mon Nov 18 22:36:17 2013 -0800

    miext: Ensure xshmfence is only called when driver supports it
    
    This provides a place for drivers to insert their own FD-based
    SyncFence implementations, and prevents applications from using DRI3
    SyncFence creation functions unless the driver has some support for
    them.
    
    Signed-off-by: Keith Packard <keithp at keithp.com>
    Tested-by: Fredrik Höglund <fredrik at kde.org>

diff --git a/miext/sync/Makefile.am b/miext/sync/Makefile.am
index ac13c52..34961d5 100644
--- a/miext/sync/Makefile.am
+++ b/miext/sync/Makefile.am
@@ -5,7 +5,7 @@ AM_CFLAGS = $(DIX_CFLAGS)
 AM_CPPFLAGS = 
 
 if XORG
-sdk_HEADERS = misync.h misyncstr.h misyncshm.h
+sdk_HEADERS = misync.h misyncstr.h misyncshm.h misyncfd.h
 endif
 
 XSHMFENCE_SRCS = misyncshm.c
@@ -13,6 +13,7 @@ XSHMFENCE_SRCS = misyncshm.c
 libsync_la_SOURCES =	\
 	misync.c	\
 	misync.h	\
+	misyncfd.c	\
 	misyncstr.h
 
 if XSHMFENCE
diff --git a/miext/sync/misync.h b/miext/sync/misync.h
index f63ec2b..dc78c5f 100644
--- a/miext/sync/misync.h
+++ b/miext/sync/misync.h
@@ -42,8 +42,8 @@ typedef struct _syncScreenFuncs {
     SyncScreenDestroyFenceFunc DestroyFence;
 } SyncScreenFuncsRec, *SyncScreenFuncsPtr;
 
-extern _X_EXPORT void
 
+extern _X_EXPORT void
 miSyncScreenCreateFence(ScreenPtr pScreen, SyncFence * pFence,
                         Bool initially_triggered);
 extern _X_EXPORT void
diff --git a/miext/sync/misyncfd.c b/miext/sync/misyncfd.c
new file mode 100644
index 0000000..93ff85f
--- /dev/null
+++ b/miext/sync/misyncfd.c
@@ -0,0 +1,99 @@
+/*
+ * Copyright © 2013 Keith Packard
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting documentation, and
+ * that the name of the copyright holders not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  The copyright holders make no representations
+ * about the suitability of this software for any purpose.  It is provided "as
+ * is" without express or implied warranty.
+ *
+ * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "scrnintstr.h"
+#include "misync.h"
+#include "misyncstr.h"
+#include "misyncfd.h"
+#include "pixmapstr.h"
+
+static DevPrivateKeyRec syncFdScreenPrivateKey;
+
+typedef struct _SyncFdScreenPrivate {
+    SyncFdScreenFuncsRec        funcs;
+} SyncFdScreenPrivateRec, *SyncFdScreenPrivatePtr;
+
+static inline SyncFdScreenPrivatePtr sync_fd_screen_priv(ScreenPtr pScreen)
+{
+    if (!dixPrivateKeyRegistered(&syncFdScreenPrivateKey))
+        return NULL;
+    return dixLookupPrivate(&pScreen->devPrivates, &syncFdScreenPrivateKey);
+}
+
+int
+miSyncInitFenceFromFD(DrawablePtr pDraw, SyncFence *pFence, int fd, BOOL initially_triggered)
+
+{
+    SyncFdScreenPrivatePtr      priv = sync_fd_screen_priv(pDraw->pScreen);
+
+    if (!priv)
+        return BadMatch;
+
+    return (*priv->funcs.CreateFenceFromFd)(pDraw->pScreen, pFence, fd, initially_triggered);
+}
+
+int
+miSyncFDFromFence(DrawablePtr pDraw, SyncFence *pFence)
+{
+    SyncFdScreenPrivatePtr      priv = sync_fd_screen_priv(pDraw->pScreen);
+
+    if (!priv)
+        return -1;
+
+    return (*priv->funcs.GetFenceFd)(pDraw->pScreen, pFence);
+}
+
+_X_EXPORT Bool miSyncFdScreenInit(ScreenPtr pScreen,
+                                  const SyncFdScreenFuncsRec *funcs)
+{
+    SyncFdScreenPrivatePtr     priv;
+
+    /* Check to see if we've already been initialized */
+    if (sync_fd_screen_priv(pScreen) != NULL)
+        return FALSE;
+
+    if (!miSyncSetup(pScreen))
+        return FALSE;
+    
+    if (!dixPrivateKeyRegistered(&syncFdScreenPrivateKey)) {
+        if (!dixRegisterPrivateKey(&syncFdScreenPrivateKey, PRIVATE_SCREEN, 0))
+            return FALSE;
+    }
+
+    priv = calloc(1, sizeof (SyncFdScreenPrivateRec));
+    if (!priv)
+        return FALSE;
+
+    /* Will require version checks when there are multiple versions
+     * of the funcs structure
+     */
+
+    priv->funcs = *funcs;
+
+    dixSetPrivate(&pScreen->devPrivates, &syncFdScreenPrivateKey, priv);
+    
+    return TRUE;
+}
diff --git a/miext/sync/misyncfd.h b/miext/sync/misyncfd.h
new file mode 100644
index 0000000..c1d05f9
--- /dev/null
+++ b/miext/sync/misyncfd.h
@@ -0,0 +1,45 @@
+/*
+ * Copyright © 2013 Keith Packard
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting documentation, and
+ * that the name of the copyright holders not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  The copyright holders make no representations
+ * about the suitability of this software for any purpose.  It is provided "as
+ * is" without express or implied warranty.
+ *
+ * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+#ifndef _MISYNCFD_H_
+#define _MISYNCFD_H_
+
+typedef int (*SyncScreenCreateFenceFromFdFunc) (ScreenPtr screen,
+                                                SyncFence *fence,
+                                                int fd,
+                                                Bool initially_triggered);
+
+typedef int (*SyncScreenGetFenceFdFunc) (ScreenPtr screen,
+                                      SyncFence *fence);
+
+#define SYNC_FD_SCREEN_FUNCS_VERSION    1
+
+typedef struct _syncFdScreenFuncs {
+    int                                 version;
+    SyncScreenCreateFenceFromFdFunc     CreateFenceFromFd;
+    SyncScreenGetFenceFdFunc            GetFenceFd;
+} SyncFdScreenFuncsRec, *SyncFdScreenFuncsPtr;
+
+extern _X_EXPORT Bool miSyncFdScreenInit(ScreenPtr pScreen,
+                                         const SyncFdScreenFuncsRec *funcs);
+
+#endif /* _MISYNCFD_H_ */
diff --git a/miext/sync/misyncshm.c b/miext/sync/misyncshm.c
index ddd15ae..3f9350a 100644
--- a/miext/sync/misyncshm.c
+++ b/miext/sync/misyncshm.c
@@ -28,6 +28,7 @@
 #include "misync.h"
 #include "misyncstr.h"
 #include "misyncshm.h"
+#include "misyncfd.h"
 #include "pixmapstr.h"
 #include <sys/mman.h>
 #include <unistd.h>
@@ -118,13 +119,12 @@ miSyncShmScreenDestroyFence(ScreenPtr pScreen, SyncFence * pFence)
     miSyncScreenDestroyFence(pScreen, pFence);
 }
 
-int
-miSyncInitFenceFromFD(DrawablePtr pDraw, SyncFence *pFence, int fd, BOOL initially_triggered)
-
+static int
+miSyncShmCreateFenceFromFd(ScreenPtr pScreen, SyncFence *pFence, int fd, Bool initially_triggered)
 {
     SyncShmFencePrivatePtr      pPriv = SYNC_FENCE_PRIV(pFence);
 
-    miSyncInitFence(pDraw->pScreen, pFence, initially_triggered);
+    miSyncInitFence(pScreen, pFence, initially_triggered);
 
     pPriv->fence = xshmfence_map_shm(fd);
     if (pPriv->fence) {
@@ -136,8 +136,8 @@ miSyncInitFenceFromFD(DrawablePtr pDraw, SyncFence *pFence, int fd, BOOL initial
     return BadValue;
 }
 
-int
-miSyncFDFromFence(DrawablePtr pDraw, SyncFence *pFence)
+static int
+miSyncShmGetFenceFd(ScreenPtr pScreen, SyncFence *pFence)
 {
     SyncShmFencePrivatePtr      pPriv = SYNC_FENCE_PRIV(pFence);
 
@@ -154,11 +154,17 @@ miSyncFDFromFence(DrawablePtr pDraw, SyncFence *pFence)
     return pPriv->fd;
 }
 
+static const SyncFdScreenFuncsRec miSyncShmScreenFuncs = {
+    .version = SYNC_FD_SCREEN_FUNCS_VERSION,
+    .CreateFenceFromFd = miSyncShmCreateFenceFromFd,
+    .GetFenceFd = miSyncShmGetFenceFd
+};
+
 _X_EXPORT Bool miSyncShmScreenInit(ScreenPtr pScreen)
 {
     SyncScreenFuncsPtr  funcs;
 
-    if (!miSyncSetup(pScreen))
+    if (!miSyncFdScreenInit(pScreen, &miSyncShmScreenFuncs))
         return FALSE;
 
     if (!dixPrivateKeyRegistered(&syncShmFencePrivateKey)) {
@@ -171,6 +177,7 @@ _X_EXPORT Bool miSyncShmScreenInit(ScreenPtr pScreen)
 
     funcs->CreateFence = miSyncShmScreenCreateFence;
     funcs->DestroyFence = miSyncShmScreenDestroyFence;
+
     return TRUE;
 }
 
diff --git a/miext/sync/misyncshm.h b/miext/sync/misyncshm.h
index 4edbb50..23c001a 100644
--- a/miext/sync/misyncshm.h
+++ b/miext/sync/misyncshm.h
@@ -21,7 +21,7 @@
  */
 
 #ifndef _MISYNCSHM_H_
-#define _MISYNCSYM_H_
+#define _MISYNCSHM_H_
 
 extern _X_EXPORT Bool miSyncShmScreenInit(ScreenPtr pScreen);
 
commit 037566c57caff93fd7717f385d4b532b81f19c77
Author: Keith Packard <keithp at keithp.com>
Date:   Mon Nov 18 22:33:27 2013 -0800

    Xext: Recover from miSyncInitFenceFromFD failure without crashing
    
    miSyncDestroyFence must not be called unless miSyncInitFence has been
    invoked, so if miSyncInitFenceFromFD fails, we must free the fence
    manually.
    
    Signed-off-by: Keith Packard <keithp at keithp.com>
    Tested-by: Fredrik Höglund <fredrik at kde.org>

diff --git a/Xext/sync.c b/Xext/sync.c
index dd18cde..2d58ea1 100644
--- a/Xext/sync.c
+++ b/Xext/sync.c
@@ -929,7 +929,7 @@ SyncCreateFenceFromFD(ClientPtr client, DrawablePtr pDraw, XID id, int fd, BOOL
 
     status = miSyncInitFenceFromFD(pDraw, pFence, fd, initially_triggered);
     if (status != Success) {
-        miSyncDestroyFence(pFence);
+        dixFreeObjectWithPrivates(pFence, PRIVATE_SYNC_FENCE);
         return status;
     }
 
commit e7000534a456fdf9cd4eaada3193846c8525f740
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sat Oct 5 08:47:03 2013 +0100

    glx/glxdri2: Unwrap EnterVT/LeaveVT upon CloseScreen
    
    In a similar spirit to
    
    commit d75e8146c414bfd512ba5dbd4a83acb334bbe19b
    Author: Keith Packard <keithp at keithp.com>
    Date:   Mon Jul 12 16:01:34 2010 -0700
    
        Unwrap/rewrap EnterVT/LeaveVT completely, Fixes 28998
    
    we need to unwrap our pScrn->EnterVT/LeaveVT hooks around server
    regeneration or else we cause an infinite recursion on the next VT
    switch afterwards.
    
    Bugzilla: https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/1235516
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
    Reviewed-by: Keith Packard <keithp at keithp.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/glx/glxdri2.c b/glx/glxdri2.c
index 1d74c8f..fbbd1fd 100644
--- a/glx/glxdri2.c
+++ b/glx/glxdri2.c
@@ -371,6 +371,7 @@ __glXDRIscreenDestroy(__GLXscreen * baseScreen)
 {
     int i;
 
+    ScrnInfoPtr pScrn = xf86ScreenToScrn(baseScreen->pScreen);
     __GLXDRIscreen *screen = (__GLXDRIscreen *) baseScreen;
 
     (*screen->core->destroyScreen) (screen->driScreen);
@@ -385,6 +386,9 @@ __glXDRIscreenDestroy(__GLXscreen * baseScreen)
         free(screen->driConfigs);
     }
 
+    pScrn->EnterVT = screen->enterVT;
+    pScrn->LeaveVT = screen->leaveVT;
+
     free(screen);
 }
 
commit 6d5883bd7e5b765f8f0548501b825d9e56840799
Author: Keith Packard <keithp at keithp.com>
Date:   Sat Nov 23 16:19:46 2013 -0800

    xnest: Ignore GetImage() error in xnestGetImage() (v3)
    
    (I found an amended version of this patch and applied the difference
    here - keithp)
    
    v3: Don't call Xsync before restoring error handler as any errors
        generated by XGetImage() should be processed when this call
        returns as suggested by Jamey Sharp <jamey at minilop.net>
    
    Signed-off-by: Egbert Eich <eich at freedesktop.org>
    Reviewed-by: Jamey Sharp <jamey at minilop.net>

diff --git a/hw/xnest/GCOps.c b/hw/xnest/GCOps.c
index 7b1956d..d00511d 100644
--- a/hw/xnest/GCOps.c
+++ b/hw/xnest/GCOps.c
@@ -115,7 +115,6 @@ xnestGetImage(DrawablePtr pDrawable, int x, int y, int w, int h,
 
     ximage = XGetImage(xnestDisplay, xnestDrawable(pDrawable),
                        x, y, w, h, planeMask, format);
-    XSync(xnestDisplay, False);
     XSetErrorHandler(old_handler);
 
     if (ximage) {
commit 6403cbb143c67872ca9c58e3116ae7942def0ae1
Author: Keith Packard <keithp at keithp.com>
Date:   Tue Nov 19 22:13:54 2013 -0800

    present: When unflipping, copy to flip window rather than screen
    
    unflip happens after the clip lists have been updated, so instead of
    smashing the whole screen and drawing over other windows, just draw to
    the original flip window; it'll have the right clip list and so the
    copy will work just fine.
    
    Signed-off-by: Keith Packard <keithp at keithp.com>
    Reviewed-by: Adam Jackson <ajax at redhat.com>

diff --git a/present/present.c b/present/present.c
index 16dc381..f9eef6b 100644
--- a/present/present.c
+++ b/present/present.c
@@ -321,8 +321,8 @@ present_unflip(ScreenPtr screen)
 
     /* Update the screen pixmap with the current flip pixmap contents
      */
-    if (screen_priv->flip_pixmap) {
-        present_copy_region(&screen->GetScreenPixmap(screen)->drawable,
+    if (screen_priv->flip_pixmap && screen_priv->flip_window) {
+        present_copy_region(&screen_priv->flip_window->drawable,
                             screen_priv->flip_pixmap,
                             NULL, 0, 0);
     }
commit 8bdd2ccc776ded3f527596b5009ef25129aa3287
Author: Keith Packard <keithp at keithp.com>
Date:   Mon Nov 11 18:03:42 2013 -0800

    present: Block for wait_fence in present_execute
    
    Pend presentation until wait_fence is also triggered by having the
    SyncFence trigger invoke present_execute once triggered.
    
    Signed-off-by: Keith Packard <keithp at keithp.com>
    Reviewed-by: Adam Jackson <ajax at redhat.com>

diff --git a/present/present.c b/present/present.c
index 67d7f6e..16dc381 100644
--- a/present/present.c
+++ b/present/present.c
@@ -453,6 +453,26 @@ present_check_flip_window (WindowPtr window)
 }
 
 /*
+ * Called when the wait fence is triggered; just gets the current msc/ust and
+ * calls present_execute again. That will re-check the fence and pend the
+ * request again if it's still not actually ready
+ */
+static void
+present_wait_fence_triggered(void *param)
+{
+    present_vblank_ptr  vblank = param;
+    WindowPtr           window = vblank->window;
+    uint64_t            ust = 0, crtc_msc = 0;
+
+    if (window) {
+        present_window_priv_ptr     window_priv = present_get_window_priv(window, TRUE);
+        if (window_priv)
+            (void) present_get_ust_msc(window, window_priv->crtc, &ust, &crtc_msc);
+    }
+    present_execute(vblank, ust, crtc_msc);
+}
+
+/*
  * Once the required MSC has been reached, execute the pending request.
  *
  * For requests to actually present something, either blt contents to
@@ -469,7 +489,10 @@ present_execute(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc)
     present_screen_priv_ptr     screen_priv = present_screen_priv(window->drawable.pScreen);
 
     if (vblank->wait_fence) {
-        /* XXX check fence, queue if not ready */
+        if (!present_fence_check_triggered(vblank->wait_fence)) {
+            present_fence_set_callback(vblank->wait_fence, present_wait_fence_triggered, vblank);
+            return;
+        }
     }
 
     xorg_list_del(&vblank->event_queue);
@@ -654,6 +677,12 @@ present_pixmap(WindowPtr window,
             target_msc--;
     }
 
+    if (wait_fence) {
+        vblank->wait_fence = present_fence_create(wait_fence);
+        if (!vblank->wait_fence)
+            goto no_mem;
+    }
+
     if (idle_fence) {
         vblank->idle_fence = present_fence_create(idle_fence);
         if (!vblank->idle_fence)
@@ -764,6 +793,9 @@ present_vblank_destroy(present_vblank_ptr vblank)
     if (vblank->update)
         RegionDestroy(vblank->update);
 
+    if (vblank->wait_fence)
+        present_fence_destroy(vblank->wait_fence);
+
     if (vblank->idle_fence)
         present_fence_destroy(vblank->idle_fence);
 
diff --git a/present/present_event.c b/present/present_event.c
index a30bc82..a8f7176 100644
--- a/present/present_event.c
+++ b/present/present_event.c
@@ -26,8 +26,6 @@
 
 #include "present_priv.h"
 
-#include "present_priv.h"
-
 RESTYPE present_event_type;
 
 static int
diff --git a/present/present_fence.c b/present/present_fence.c
index db5efca..e09657d 100644
--- a/present/present_fence.c
+++ b/present/present_fence.c
@@ -37,6 +37,8 @@
 struct present_fence {
     SyncTrigger         trigger;
     SyncFence           *fence;
+    void                (*callback)(void *param);
+    void                *param;
 };
 
 /*
@@ -45,12 +47,18 @@ struct present_fence {
 static Bool
 present_fence_sync_check_trigger(SyncTrigger *trigger, XSyncValue oldval)
 {
-    return FALSE;
+    struct present_fence        *present_fence = container_of(trigger, struct present_fence, trigger);
+
+    return present_fence->callback != NULL;
 }
 
 static void
 present_fence_sync_trigger_fired(SyncTrigger *trigger)
 {
+    struct present_fence        *present_fence = container_of(trigger, struct present_fence, trigger);
+
+    if (present_fence->callback)
+        (*present_fence->callback)(present_fence->param);
 }
 
 static void
@@ -101,6 +109,25 @@ present_fence_set_triggered(struct present_fence *present_fence)
             (*present_fence->fence->funcs.SetTriggered) (present_fence->fence);
 }
 
+Bool
+present_fence_check_triggered(struct present_fence *present_fence)
+{
+    if (!present_fence)
+        return TRUE;
+    if (!present_fence->fence)
+        return TRUE;
+    return (*present_fence->fence->funcs.CheckTriggered)(present_fence->fence);
+}
+
+void
+present_fence_set_callback(struct present_fence *present_fence,
+                           void (*callback) (void *param),
+                           void *param)
+{
+    present_fence->callback = callback;
+    present_fence->param = param;
+}
+
 XID
 present_fence_id(struct present_fence *present_fence)
 {
diff --git a/present/present_priv.h b/present/present_priv.h
index 40c88dd..500c7c2 100644
--- a/present/present_priv.h
+++ b/present/present_priv.h
@@ -249,6 +249,14 @@ present_fence_destroy(struct present_fence *present_fence);
 void
 present_fence_set_triggered(struct present_fence *present_fence);
 
+Bool
+present_fence_check_triggered(struct present_fence *present_fence);
+
+void
+present_fence_set_callback(struct present_fence *present_fence,
+                           void (*callback)(void *param),
+                           void *param);
+
 XID
 present_fence_id(struct present_fence *present_fence);
 
@@ -271,6 +279,13 @@ void
 present_destroy_notifies(present_notify_ptr notifies, int num_notifies);
 
 /*
+ * present_redirect.c
+ */
+
+WindowPtr
+present_redirect(ClientPtr client, WindowPtr target);
+
+/*
  * present_request.c
  */
 int
commit e5a188cb919edee2e3a03054276bce0db02f7b62
Author: Keith Packard <keithp at keithp.com>
Date:   Sat Nov 9 12:36:47 2013 -0800

    present: Signal destroyed flip window with vblank->window == NULL
    
    This eliminates dereferencing freed window pointers when there is a
    flip for that window in progress. The flip will complete, and then
    immediately get undone (as we can't stop an in-progress flip).
    
    Remove the vblank->window_destroyed field as we can signal this with
    vblank->window == NULL instead.
    
    Change check to vblank->window == NULL in:
    
    	present_flip_notify
    
    Add check for vblank->window == NULL in:
    	present_vblank_notify
    	present_execute
    
    present_flip_notify was also using vblank->window->drawable.pScreen,
    so stop doing that and use vblank->screen instead.
    
    Signed-off-by: Keith Packard <keithp at keithp.com>
    Reviewed-by: Adam Jackson <ajax at redhat.com>

diff --git a/present/present.c b/present/present.c
index bfafa92..67d7f6e 100644
--- a/present/present.c
+++ b/present/present.c
@@ -171,7 +171,8 @@ present_vblank_notify(present_vblank_ptr vblank, CARD8 kind, CARD8 mode, uint64_
 {
     int         n;
 
-    present_send_complete_notify(vblank->window, kind, mode, vblank->serial, ust, crtc_msc - vblank->msc_offset);
+    if (vblank->window)
+        present_send_complete_notify(vblank->window, kind, mode, vblank->serial, ust, crtc_msc - vblank->msc_offset);
     for (n = 0; n < vblank->num_notifies; n++) {
         WindowPtr   window = vblank->notifies[n].window;
         CARD32      serial = vblank->notifies[n].serial;
@@ -336,8 +337,7 @@ present_execute(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc);
 static void
 present_flip_notify(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc)
 {
-    WindowPtr                   window = vblank->window;
-    ScreenPtr                   screen = window->drawable.pScreen;
+    ScreenPtr                   screen = vblank->screen;
     present_screen_priv_ptr     screen_priv = present_screen_priv(screen);
 
     DebugPresent(("\tn %p %8lld: %08lx -> %08lx\n", vblank, vblank->target_msc,
@@ -363,8 +363,7 @@ present_flip_notify(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc)
     if (vblank->abort_flip)
         present_unflip(screen);
 
-    if (!vblank->window_destroyed)
-        present_vblank_notify(vblank, PresentCompleteKindPixmap, PresentCompleteModeFlip, ust, crtc_msc);
+    present_vblank_notify(vblank, PresentCompleteKindPixmap, PresentCompleteModeFlip, ust, crtc_msc);
     present_vblank_destroy(vblank);
 }
 
@@ -474,7 +473,7 @@ present_execute(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc)
     }
 
     xorg_list_del(&vblank->event_queue);
-    if (vblank->pixmap) {
+    if (vblank->pixmap && vblank->window) {
 
         if (vblank->flip && screen_priv->flip_pending == NULL && !screen_priv->unflip_event_id) {
 
diff --git a/present/present_priv.h b/present/present_priv.h
index a92b62a..40c88dd 100644
--- a/present/present_priv.h
+++ b/present/present_priv.h
@@ -72,8 +72,6 @@ struct present_vblank {
     Bool                flip;
     Bool                sync_flip;
     Bool                abort_flip;
-
-    Bool                window_destroyed;
 };
 
 typedef struct present_screen_priv {
diff --git a/present/present_screen.c b/present/present_screen.c
index 50b2b2d..2702cd6 100644
--- a/present/present_screen.c
+++ b/present/present_screen.c
@@ -92,7 +92,7 @@ present_clear_window_flip(WindowPtr window)
 
     if (flip_pending && flip_pending->window == window) {
         assert (flip_pending->abort_flip);
-        flip_pending->window_destroyed = TRUE;
+        flip_pending->window = NULL;
     }
     if (screen_priv->flip_window == window)
         screen_priv->flip_window = NULL;
commit a5bcc4f7b9499caf8993f0a6ef96088553399ca3
Author: Keith Packard <keithp at keithp.com>
Date:   Sat Nov 9 12:33:02 2013 -0800

    present: Ignore event_id 0 from driver vblank notify
    
    We use event_id 0 to mean 'no such event'; if a driver sends us that
    event_id, make sure we don't accidentally match it.
    
    Signed-off-by: Keith Packard <keithp at keithp.com>
    Reviewed-by: Adam Jackson <ajax at redhat.com>

diff --git a/present/present.c b/present/present.c
index 228d43a..bfafa92 100644
--- a/present/present.c
+++ b/present/present.c
@@ -374,6 +374,8 @@ present_event_notify(uint64_t event_id, uint64_t ust, uint64_t msc)
     present_vblank_ptr  vblank, tmp;
     int                 s;
 
+    if (!event_id)
+        return;
     DebugPresent(("\te %lld ust %lld msc %lld\n", event_id, ust, msc));
     xorg_list_for_each_entry_safe(vblank, tmp, &present_exec_queue, event_queue) {
         if (vblank->event_id == event_id) {
@@ -398,6 +400,7 @@ present_event_notify(uint64_t event_id, uint64_t ust, uint64_t msc)
             DebugPresent(("\tun %lld\n", event_id));
             screen_priv->unflip_event_id = 0;
             present_flip_idle(screen);
+            return;
         }
     }
 }
commit 4f3c37a1f17ffcfbbff71d217e1caad3d0148c90
Author: Keith Packard <keithp at keithp.com>
Date:   Thu Nov 7 14:17:12 2013 -0800

    present: Round fake MSC computations intead of truncating
    
    If the timer fired too early, we'd sometimes mis-compute the MSC for
    fake vblanks. Rounding the computation to the nearest MSC fixes this nicely.
    
    Signed-off-by: Keith Packard <keithp at keithp.com>
    Reviewed-by: Adam Jackson <ajax at redhat.com>

diff --git a/present/present_fake.c b/present/present_fake.c
index a677592..e550e98 100644
--- a/present/present_fake.c
+++ b/present/present_fake.c
@@ -42,7 +42,7 @@ present_fake_get_ust_msc(ScreenPtr screen, uint64_t *ust, uint64_t *msc)
     present_screen_priv_ptr screen_priv = present_screen_priv(screen);
 
     *ust = GetTimeInMicros();
-    *msc = *ust / screen_priv->fake_interval;
+    *msc = (*ust + screen_priv->fake_interval / 2) / screen_priv->fake_interval;
     return Success;
 }
 
commit da9997f89f14ab619f244d5b2e80a423b028c789
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Tue Nov 19 08:07:09 2013 +1000

    configure: allow for --enable-libunwind and --disable-libunwind
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Keith Packard <keithp at keithp.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/configure.ac b/configure.ac
index 1e6f813..2f4edee 100644
--- a/configure.ac
+++ b/configure.ac
@@ -305,13 +305,6 @@ AC_CHECK_HEADER([execinfo.h],[
     ])]
 )
 
-PKG_CHECK_MODULES(LIBUNWIND, libunwind, [HAVE_LIBUNWIND=yes], [HAVE_LIBUNWIND=no])
-if test "x$HAVE_LIBUNWIND" = xyes; then
-	AC_DEFINE(HAVE_LIBUNWIND, 1, [Have libunwind support])
-fi
-AM_CONDITIONAL(HAVE_LIBUNWIND, [test "x$HAVE_LIBUNWIND" = xyes])
-
-
 dnl ---------------------------------------------------------------------------
 dnl Bus options and CPU capabilities.  Replaces logic in
 dnl hw/xfree86/os-support/bus/Makefile.am, among others.
@@ -654,6 +647,7 @@ dnl kdrive options
 AC_ARG_ENABLE(kdrive-kbd,     AS_HELP_STRING([--enable-kdrive-kbd], [Build kbd driver for kdrive (default: auto)]), [KDRIVE_KBD=$enableval], [KDRIVE_KBD=auto])
 AC_ARG_ENABLE(kdrive-mouse,   AC_HELP_STRING([--enable-kdrive-mouse], [Build mouse driver for kdrive (default: auto)]), [KDRIVE_MOUSE=$enableval], [KDRIVE_MOUSE=auto])
 AC_ARG_ENABLE(kdrive-evdev,   AC_HELP_STRING([--enable-kdrive-evdev], [Build evdev driver for kdrive (default: auto)]), [KDRIVE_EVDEV=$enableval], [KDRIVE_EVDEV=auto])
+AC_ARG_ENABLE(libunwind,      AS_HELP_STRING([--enable-libunwind], [Use libunwind for backtracing (default: auto)]), [LIBUNWIND="$enableval"], [LIBUNWIND="auto"])
 
 
 dnl chown/chmod to be setuid root as part of build
@@ -1616,6 +1610,20 @@ AC_SUBST(SHA1_CFLAGS)
 PKG_CHECK_MODULES([XSERVERCFLAGS], [$REQUIRED_MODULES $REQUIRED_LIBS])
 PKG_CHECK_MODULES([XSERVERLIBS], [$REQUIRED_LIBS])
 
+PKG_CHECK_MODULES(LIBUNWIND, libunwind, [HAVE_LIBUNWIND=yes], [HAVE_LIBUNWIND=no])
+if test "x$LIBUNWIND" = "xauto"; then
+    LIBUNWIND="$HAVE_LIBUNWIND"
+fi
+
+if test "x$LIBUNWIND" = "xyes"; then
+    if test "x$HAVE_LIBUNWIND" != "xyes"; then
+        AC_MSG_ERROR([libunwind requested but not installed.])
+    fi
+    AC_DEFINE(HAVE_LIBUNWIND, 1, [Have libunwind support])
+fi
+
+AM_CONDITIONAL(HAVE_LIBUNWIND, [test "x$LIBUNWIND" = xyes])
+
 # Autotools has some unfortunate issues with library handling.  In order to
 # get a server to rebuild when a dependency in the tree is changed, it must
 # be listed in SERVERNAME_DEPENDENCIES.  However, no system libraries may be
commit 29240e5cbf6e7f875b128fc7bfc4d56b2350835a
Merge: 0492deb 8ff7e32
Author: Keith Packard <keithp at keithp.com>
Date:   Thu Nov 14 17:02:04 2013 +0900

    Merge remote-tracking branch 'whot/for-keith'

commit 0492deb8f8238b7782e5a706ec6219d88aa1091d
Author: Adam Jackson <ajax at redhat.com>
Date:   Tue Oct 29 12:09:27 2013 -0400

    mieq: Bump default queue size to 512
    
    Based on some bugzilla scraping I did around November 2012.  Of xserver
    bugs in Red Hat bugzilla with an EQ size message in the log, the
    distribution looked like:
    
    String                      | Matches
    -------------------------------------
    Increasing EQ size to 512   | 460
    Increasing EQ size to 1024  | 52
    Increasing EQ size to 2048  | 6
    Increasing EQ size to 4096  | 0
    
    Most of the "512" ones appear to be mostly harmless, some relatively
    expensive path in either rendering or resource destruction simply taking
    too long due to external pressures like paging or CPU contention.  So
    let's raise the initial queue size, both to reduce the number of
    spurious abrt reports and to drop fewer events in all but the most
    pathological cases.
    
    Signed-off-by: Adam Jackson <ajax at redhat.com>
    Reviewed-by: Jasper St. Pierre <jstpierre at mecheye.net>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/mi/mieq.c b/mi/mieq.c
index d7d73de..4c07480 100644
--- a/mi/mieq.c
+++ b/mi/mieq.c
@@ -60,7 +60,7 @@ in this Software without prior written authorization from The Open Group.
 #endif
 
 /* Maximum size should be initial size multiplied by a power of 2 */
-#define QUEUE_INITIAL_SIZE                 256
+#define QUEUE_INITIAL_SIZE                 512
 #define QUEUE_RESERVED_SIZE                 64
 #define QUEUE_MAXIMUM_SIZE                4096
 #define QUEUE_DROP_BACKTRACE_FREQUENCY     100
commit d1440783a7367ff0d0c47d256bbca3b3cf8a5034
Author: Dave Airlie <airlied at redhat.com>
Date:   Tue Oct 29 12:09:26 2013 -0400

    xfree86: return NULL for compat output if no outputs.
    
    With outputless GPUs showing up we crash here if there are not outputs
    try and recover with a bit of grace.
    
    Reviewed-by: Adam Jackson <ajax at redhat.com>
    Signed-off-by: Dave Airlie <airlied at redhat.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index 2a02c85..a441fd1 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -1863,6 +1863,9 @@ SetCompatOutput(xf86CrtcConfigPtr config)
     DisplayModePtr maxmode = NULL, testmode, mode;
     int o, compat = -1, count, mincount = 0;
 
+    if (config->num_output == 0)
+        return NULL;
+
     /* Look for one that's definitely connected */
     for (o = 0; o < config->num_output; o++) {
         test = config->output[o];
commit d7ee27e5e415778240919082c83a65226c6f17e6
Author: Dan Horák <dan at danny.cz>
Date:   Tue Oct 29 12:09:25 2013 -0400

    test: build the touch test only when building Xorg
    
    Reviewed-by: Adam Jackson <ajax at redhat.com>
    Signed-off-by: Dan Horák <dan at danny.cz>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/test/Makefile.am b/test/Makefile.am
index e59c412..2852bb3 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -1,11 +1,11 @@
 if ENABLE_UNIT_TESTS
 SUBDIRS= .
-noinst_PROGRAMS = list string touch
+noinst_PROGRAMS = list string
 if XORG
 # Tests that require at least some DDX functions in order to fully link
 # For now, requires xf86 ddx, could be adjusted to use another
 SUBDIRS += xi2
-noinst_PROGRAMS += xkb input xtest misc fixes xfree86 hashtabletest os signal-logging
+noinst_PROGRAMS += xkb input xtest misc fixes xfree86 hashtabletest os signal-logging touch
 endif
 check_LTLIBRARIES = libxservertest.la
 
commit 8ff7e32c3ef7b0c13c4ab9664f651e9782d35a85
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Wed Nov 13 17:14:11 2013 +1000

    include: export key_is_down and friends
    
    VNC needs key_is_down to check if a key is processed as down before it
    simulates various key releases. Make it available, because I seriously can't
    be bothered thinking about how to rewrite VNC to not need that.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Acked-by: Keith Packard <keithp at keithp.com>

diff --git a/include/input.h b/include/input.h
index 350daba..2d5e531 100644
--- a/include/input.h
+++ b/include/input.h
@@ -244,12 +244,12 @@ typedef struct _InputAttributes {
 #define KEY_POSTED 2
 #define BUTTON_POSTED 2
 
-extern void set_key_down(DeviceIntPtr pDev, int key_code, int type);
-extern void set_key_up(DeviceIntPtr pDev, int key_code, int type);
-extern int key_is_down(DeviceIntPtr pDev, int key_code, int type);
-extern void set_button_down(DeviceIntPtr pDev, int button, int type);
-extern void set_button_up(DeviceIntPtr pDev, int button, int type);
-extern int button_is_down(DeviceIntPtr pDev, int button, int type);
+extern _X_EXPORT void set_key_down(DeviceIntPtr pDev, int key_code, int type);
+extern _X_EXPORT void set_key_up(DeviceIntPtr pDev, int key_code, int type);
+extern _X_EXPORT int key_is_down(DeviceIntPtr pDev, int key_code, int type);
+extern _X_EXPORT void set_button_down(DeviceIntPtr pDev, int button, int type);
+extern _X_EXPORT void set_button_up(DeviceIntPtr pDev, int button, int type);
+extern _X_EXPORT int button_is_down(DeviceIntPtr pDev, int button, int type);
 
 extern void InitCoreDevices(void);
 extern void InitXTestDevices(void);
commit 0ba7fc8472f1227fd1cd51bd58048f164b8ea1ab
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date:   Tue Nov 12 14:46:04 2013 -0800

    Stop including inline assembly .il file for Solaris Studio builds
    
    Since all the inb/outb/etc. use in the X server itself (except for
    xf86SlowBcopy) has been replaced by calls to libpciaccess, we no
    longer need to pass inline assembly files to replace the gcc inline
    assembly from hw/xfree86/common/compiler.h when building Xorg itself.
    
    The .il files are still generated and installed in the SDK for the
    benefit of drivers who may use them.
    
    Binary diff of before and after showed that xf86SlowBcopy was the
    only function changed across the Xorg binary and all modules built
    in the Xserver build, it just calls the outb() function now instead
    of having the outb instructions inlined, making it a slightly slower
    bcopy.
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
    Reviewed-by: Keith Packard <keithp at keithp.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/configure.ac b/configure.ac
index 4be8fcb..1e6f813 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1879,9 +1879,6 @@ if test "x$XORG" = xyes; then
 		if test "${OS_MINOR}" -lt 8 ; then
 			AC_MSG_ERROR([This release no longer supports Solaris versions older than Solaris 8.])
 		fi
-		if test "x$SUNCC" = "xyes"; then
-			solaris_asm_inline="yes"
-		fi
 		AC_CHECK_DECL([_LP64], [SOLARIS_64="yes"], [SOLARIS_64="no"])
 			
 		case $host_cpu in
@@ -1902,11 +1899,6 @@ if test "x$XORG" = xyes; then
 			xorg at lists.freedesktop.org.]) ;;
 		esac
 		AC_SUBST([SOLARIS_INOUT_ARCH])
-		if test x$solaris_asm_inline = xyes ; then
-			SOLARIS_ASM_CFLAGS='$(top_srcdir)/hw/xfree86/os-support/solaris/solaris-$(SOLARIS_INOUT_ARCH).il'
-			XORG_CFLAGS="${XORG_CFLAGS} "'$(SOLARIS_ASM_CFLAGS)'
-		fi
-		AC_SUBST([SOLARIS_ASM_CFLAGS])
 		;;
 	  gnu*)
 		XORG_OS_SUBDIR="hurd"
@@ -2012,7 +2004,6 @@ AM_CONDITIONAL([XORG_BUS_SPARC], [test "x$xorg_bus_sparc" = xyes])
 AM_CONDITIONAL([LINUX_ALPHA], [test "x$linux_alpha" = xyes])
 AM_CONDITIONAL([LNXACPI], [test "x$linux_acpi" = xyes])
 AM_CONDITIONAL([LNXAPM], [test "x$linux_apm" = xyes])
-AM_CONDITIONAL([SOLARIS_ASM_INLINE], [test "x$solaris_asm_inline" = xyes])
 AM_CONDITIONAL([SOLARIS_VT], [test "x$solaris_vt" = xyes])
 AM_CONDITIONAL([DGA], [test "x$DGA" = xyes])
 AM_CONDITIONAL([XF86VIDMODE], [test "x$XF86VIDMODE" = xyes])
diff --git a/exa/Makefile.am b/exa/Makefile.am
index c1f1e86..6a09966 100644
--- a/exa/Makefile.am
+++ b/exa/Makefile.am
@@ -1,9 +1,5 @@
 noinst_LTLIBRARIES = libexa.la
 
-# Override these since EXA doesn't need them and the needed files aren't
-# built (in hw/xfree86/os-support/solaris) until after EXA is built
-SOLARIS_ASM_CFLAGS=""
-
 if XORG
 sdk_HEADERS = exa.h
 endif
diff --git a/hw/xfree86/Makefile.am b/hw/xfree86/Makefile.am
index 485386f..15670d0 100644
--- a/hw/xfree86/Makefile.am
+++ b/hw/xfree86/Makefile.am
@@ -80,17 +80,6 @@ BUILT_SOURCES = xorg.conf.example
 DISTCLEANFILES = xorg.conf.example
 EXTRA_DIST = xorgconf.cpp
 
-if SOLARIS_ASM_INLINE
-# Needs to be built before any files are compiled when using Sun compilers
-# so in*/out* inline definitions are properly processed.
-
-BUILT_SOURCES += os-support/solaris/solaris- at SOLARIS_INOUT_ARCH@.il
-
-os-support/solaris/solaris- at SOLARIS_INOUT_ARCH@.il:
-	cd os-support/solaris ; \
-	 $(MAKE) $(AM_MAKEFLAGS) solaris- at SOLARIS_INOUT_ARCH@.il
-endif
-
 # Without logdir, X will post an error on the terminal and will not start
 install-data-local:
 	$(AM_V_GEN)$(MKDIR_P) $(DESTDIR)$(logdir)
commit 550baf38f6096658f0bcf0ad647c4fedf93132f2
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Fri Oct 4 10:55:52 2013 +1000

    kdrive: fix cursor jumps on CursorOffScreen behavior
    
    This patch fixes cursor jumps when there is a grab on the Xephyr window and
    the pointer moves outside the window.
    
    So on two side-by-side 640x480 screens, a coordinate of 0/481
    triggers KdCursorOffscreen.
    
    If the delta between two screens is 0, they share the same offset for
    that dimension. When searching for the new screen, the loop always rules out
    the current screen. So we get to the second screen, trigger the conditions
    where dy <= 0 and decide that this new screen is the correct one. The result
    is that whenever KdCursorOffScreen is called, the pointer jumps to the other
    screen.
    
    Change to check for dy < 0 etc. so that the cursor stays on the same screen if
    there is no other screen at the target location.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/kdrive/src/kinput.c b/hw/kdrive/src/kinput.c
index abda693..a9a9fa5 100644
--- a/hw/kdrive/src/kinput.c
+++ b/hw/kdrive/src/kinput.c
@@ -2030,25 +2030,25 @@ KdCursorOffScreen(ScreenPtr *ppScreen, int *x, int *y)
         dx = KdScreenOrigin(pNewScreen)->x - KdScreenOrigin(pScreen)->x;
         dy = KdScreenOrigin(pNewScreen)->y - KdScreenOrigin(pScreen)->y;
         if (*x < 0) {
-            if (dx <= 0 && -dx < best_x) {
+            if (dx < 0 && -dx < best_x) {
                 best_x = -dx;
                 n_best_x = n;
             }
         }
         else if (*x >= pScreen->width) {
-            if (dx >= 0 && dx < best_x) {
+            if (dx > 0 && dx < best_x) {
                 best_x = dx;
                 n_best_x = n;
             }
         }
         if (*y < 0) {
-            if (dy <= 0 && -dy < best_y) {
+            if (dy < 0 && -dy < best_y) {
                 best_y = -dy;
                 n_best_y = n;
             }
         }
         else if (*y >= pScreen->height) {
-            if (dy >= 0 && dy < best_y) {
+            if (dy > 0 && dy < best_y) {
                 best_y = dy;
                 n_best_y = n;
             }
commit a94d945065177d73f3ee8dc0b9147264ba281136
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Tue Oct 29 14:24:41 2013 +1000

    kdrive: modify ephyr events to use POINTER_DESKTOP and scale them to that
    
    A multi-head Xephyr instance has the pointer stuck on one screen
    because of bad coordinate calculation. The coordinates passed to
    GetPointerEvents are per-screen, so the cursor gets stuck on the left-most
    screen by default.
    
    Adjust and mark the events as POINTER_DESKTOP, so the DIX
    can adjust them accordingly.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/kdrive/ephyr/ephyr.c b/hw/kdrive/ephyr/ephyr.c
index 91e949d..ef4b321 100644
--- a/hw/kdrive/ephyr/ephyr.c
+++ b/hw/kdrive/ephyr/ephyr.c
@@ -959,7 +959,14 @@ ephyrProcessMouseMotion(xcb_generic_event_t *xev)
         }
         EPHYR_LOG("final (x,y):(%d,%d)\n", x, y);
 #endif
-        KdEnqueuePointerEvent(ephyrMouse, mouseState, x, y, 0);
+
+        /* convert coords into desktop-wide coordinates.
+         * fill_pointer_events will convert that back to
+         * per-screen coordinates where needed */
+        x += screen->pScreen->x;
+        y += screen->pScreen->y;
+
+        KdEnqueuePointerEvent(ephyrMouse, mouseState | KD_POINTER_DESKTOP, x, y, 0);
     }
 }
 
diff --git a/hw/kdrive/src/kdrive.h b/hw/kdrive/src/kdrive.h
index d5d0799..296d611 100644
--- a/hw/kdrive/src/kdrive.h
+++ b/hw/kdrive/src/kdrive.h
@@ -506,6 +506,7 @@ KdEnqueueKeyboardEvent(KdKeyboardInfo * ki, unsigned char scan_code,
 #define KD_BUTTON_4	0x08
 #define KD_BUTTON_5	0x10
 #define KD_BUTTON_8	0x80
+#define KD_POINTER_DESKTOP 0x40000000
 #define KD_MOUSE_DELTA	0x80000000
 
 void
diff --git a/hw/kdrive/src/kinput.c b/hw/kdrive/src/kinput.c
index d845830..abda693 100644
--- a/hw/kdrive/src/kinput.c
+++ b/hw/kdrive/src/kinput.c
@@ -1895,6 +1895,8 @@ KdEnqueuePointerEvent(KdPointerInfo * pi, unsigned long flags, int rx, int ry,
     }
     else {
         dixflags = POINTER_ABSOLUTE;
+        if (flags & KD_POINTER_DESKTOP)
+            dixflags |= POINTER_DESKTOP;
         if (x != pi->dixdev->last.valuators[0] ||
             y != pi->dixdev->last.valuators[1])
             _KdEnqueuePointerEvent(pi, MotionNotify, x, y, z, 0, dixflags,
commit d66832a3b8a8675f1e5f3656dcb1bbe95598f0ea
Author: Keith Packard <keithp at keithp.com>
Date:   Thu Nov 14 13:21:54 2013 +1000

    kdrive: handle WxH as valid geometry spec
    
    If a screen size was specified as WxH, the loop returned early and kdOrigin
    was never advanced. Thus, screen->origin was always 0 (or whatever was given
    at the -origin commandline flag).
    
    If a screen size was given with a bit depth (WxHxD), kdOrigin would always
    advance by the current screen, offsetting the next screen.
    
    Signed-off-by: Keith Packard <keithp at keithp.com>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/hw/kdrive/src/kdrive.c b/hw/kdrive/src/kdrive.c
index f8949be..3829684 100644
--- a/hw/kdrive/src/kdrive.c
+++ b/hw/kdrive/src/kdrive.c
@@ -328,7 +328,8 @@ KdParseScreen(KdScreenInfo * screen, const char *arg)
             screen->height = pixels;
             screen->height_mm = mm;
         }
-        if (delim != 'x' && delim != '@' && delim != 'X' && delim != 'Y')
+        if (delim != 'x' && delim != '@' && delim != 'X' && delim != 'Y' &&
+            (delim != '\0' || i == 0))
             return;
     }
 
commit c8c5105c1d5c093675d7f571f158147f22f7572b
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Tue Oct 29 14:33:56 2013 +1000

    ephyr: xcb_connect returns an error, not NULL
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/kdrive/ephyr/hostx.c b/hw/kdrive/ephyr/hostx.c
index ee9ae45..3e01a47 100644
--- a/hw/kdrive/ephyr/hostx.c
+++ b/hw/kdrive/ephyr/hostx.c
@@ -304,8 +304,8 @@ hostx_init(void)
         | XCB_EVENT_MASK_STRUCTURE_NOTIFY;
 
     EPHYR_DBG("mark");
-
-    if ((HostX.conn = xcb_connect(NULL, &HostX.screen)) == NULL) {
+    HostX.conn = xcb_connect(NULL, &HostX.screen);
+    if (xcb_connection_has_error(HostX.conn)) {
         fprintf(stderr, "\nXephyr cannot open host display. Is DISPLAY set?\n");
         exit(1);
     }
commit 2aa67ccef6ad8f51deb94b66defc668ddb7d226c
Author: Keith Packard <keithp at keithp.com>
Date:   Thu Nov 14 10:26:20 2013 +0900

    Update to version 1.14.99.902
    
    1.15 RC2
    
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/configure.ac b/configure.ac
index eb90b1a..4be8fcb 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.14.99.901, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
-RELEASE_DATE="2013-10-31"
-RELEASE_NAME="Bom Retiro"
+AC_INIT([xorg-server], 1.14.99.902, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
+RELEASE_DATE="2013-11-14"
+RELEASE_NAME="English Breakfast"
 AC_CONFIG_SRCDIR([Makefile.am])
 AM_INIT_AUTOMAKE([foreign dist-bzip2])
 AC_USE_SYSTEM_EXTENSIONS
commit 9309d2a009a6a3b6090fc377fc7a3eded1a34dc0
Author: Keith Packard <keithp at keithp.com>
Date:   Wed Nov 13 07:01:45 2013 +0900

    xext: Fix shmint.h to not use headers outside of sdk_HEADERS
    
    shmint.h is part of sdk_HEADERS, and so can't use anything not
    included in sdk_HEADERS.
    
    busfault.h includes dix-config.h which is not. Leave the use of
    struct busfault in shmint.h and move the include of busfault.h to
    shm.c.
    
    protocol-versions.h is not part of sdk_HEADERS, so instead of using
    that, just use XTRANS_SEND_FDS to choose whether to expose the fd
    passing requests directly.
    
    Reported-by: Julien Cristau <jcristau at debian.org>
    Signed-off-by: Keith Packard <keithp at keithp.com>
    Tested-by: Knut Petersen <Knut_Petersen at t-online.de>
    Reviewed-by: Julien Cristau <jcristau at debian.org>
    
    v2: also avoid using protocol-versions.h

diff --git a/Xext/shm.c b/Xext/shm.c
index 46ce521..d014b91 100644
--- a/Xext/shm.c
+++ b/Xext/shm.c
@@ -55,6 +55,7 @@ in this Software without prior written authorization from The Open Group.
 #include <X11/Xfuncproto.h>
 #include <sys/mman.h>
 #include "protocol-versions.h"
+#include "busfault.h"
 
 /* Needed for Solaris cross-zone shared memory extension */
 #ifdef HAVE_SHMCTL64
diff --git a/Xext/shmint.h b/Xext/shmint.h
index 21d6cc4..9dadea7 100644
--- a/Xext/shmint.h
+++ b/Xext/shmint.h
@@ -56,16 +56,10 @@ typedef struct _ShmFuncs {
     void (*PutImage) (XSHM_PUT_IMAGE_ARGS);
 } ShmFuncs, *ShmFuncsPtr;
 
-#include <protocol-versions.h>
-
-#if SERVER_SHM_MAJOR_VERSION == 1 && SERVER_SHM_MINOR_VERSION >= 2
+#if XTRANS_SEND_FDS
 #define SHM_FD_PASSING  1
 #endif
 
-#ifdef SHM_FD_PASSING
-#include "busfault.h"
-#endif
-
 typedef struct _ShmDesc {
     struct _ShmDesc *next;
     int shmid;
diff --git a/include/Makefile.am b/include/Makefile.am
index 13d91e2..93d8616 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -2,7 +2,6 @@ if XORG
 sdk_HEADERS =		\
 	XIstubs.h	\
 	Xprintf.h	\
-	busfault.h	\
 	callback.h	\
 	client.h	\
 	closestr.h	\
@@ -69,6 +68,7 @@ endif
 AM_CFLAGS = $(DIX_CFLAGS)
 
 EXTRA_DIST = 	\
+	busfault.h	\
 	dix-config-apple-verbatim.h \
 	dixfontstubs.h eventconvert.h eventstr.h inpututils.h \
 	protocol-versions.h \


More information about the Xquartz-changes mailing list