[Xquartz-changes] xserver: Branch 'server-1.11-apple' - 15 commits

Jeremy Huddleston jeremyhu at freedesktop.org
Sat Dec 17 20:44:59 PST 2011


Rebased ref, commits from common ancestor:
commit fd528230de4a6aa51e565b7915f0e3f82d6aea4d
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 eaa21ad..e65a1c0 100644
--- a/fb/fb.h
+++ b/fb/fb.h
@@ -2049,11 +2049,8 @@ fbFillRegionSolid (DrawablePtr	pDrawable,
 		   FbBits	xor);
 
 extern _X_EXPORT pixman_image_t *
-image_from_pict (PicturePtr	pict,
-		 Bool		has_clip,
-		 int		*xoff,
-		 int		*yoff);
-
+image_from_pict (PicturePtr pict,
+		 Bool       has_clip);
 extern _X_EXPORT void free_pixman_pict (PicturePtr, pixman_image_t *);
 
 #endif /* _FB_H_ */
diff --git a/fb/fbpict.c b/fb/fbpict.c
index 57c93fd..127e5c7 100644
--- a/fb/fbpict.c
+++ b/fb/fbpict.c
@@ -50,24 +50,19 @@ fbComposite (CARD8      op,
 	     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,
+				xSrc, ySrc, xMask, yMask, xDst, yDst,
 				width, height);
     }
 
@@ -146,22 +141,22 @@ create_conical_gradient_image (PictGradient *gradient)
 
 static pixman_image_t *
 create_bits_picture (PicturePtr pict,
-		     Bool       has_clip,
-		     int	*xoff,
-		     int	*yoff)
+		     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,
+	pict->pDrawable->width, pict->pDrawable->height,
 	(uint32_t *)bits, stride * sizeof (FbStride));
 
     if (!image)
@@ -189,55 +184,33 @@ create_bits_picture (PicturePtr pict,
 	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);
+image_from_pict_internal (PicturePtr pict, Bool has_clip, 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, (pixman_transform_t *)pict->transform);
     }
     
     switch (pict->repeatType)
@@ -267,8 +240,7 @@ set_image_properties (pixman_image_t *image, PicturePtr pict, Bool has_clip, int
      */
     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);
+	pixman_image_t *alpha_map = image_from_pict_internal (pict->alphaMap, TRUE, TRUE);
 	
 	pixman_image_set_alpha_map (
 	    image, alpha_map, pict->alphaOrigin.x, pict->alphaOrigin.y);
@@ -301,7 +273,8 @@ set_image_properties (pixman_image_t *image, PicturePtr pict, Bool has_clip, int
 }
 
 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;
 
@@ -310,7 +283,7 @@ image_from_pict_internal (PicturePtr pict, Bool has_clip, int *xoff, int *yoff,
 
     if (pict->pDrawable)
     {
-	image = create_bits_picture (pict, has_clip, xoff, yoff);
+	image = create_bits_picture (pict, has_clip);
     }
     else if (pict->pSourcePict)
     {
@@ -331,19 +304,18 @@ 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 0b5a638..fbe2647 100644
--- a/fb/fbtrap.c
+++ b/fb/fbtrap.c
@@ -39,12 +39,11 @@ fbAddTraps (PicturePtr	pPicture,
 	    xTrap	*traps)
 {
     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_traps (image, x_off + dst_xoff, y_off + dst_yoff,
+    pixman_add_traps (image, x_off, y_off,
 		      ntrap, (pixman_trap_t *)traps);
 
     free_pixman_pict (pPicture, image);
@@ -57,14 +56,13 @@ fbRasterizeTrapezoid (PicturePtr    pPicture,
 		      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);
+				x_off,
+				y_off);
 
     free_pixman_pict (pPicture, image);
 }
@@ -77,13 +75,12 @@ fbAddTriangles (PicturePtr  pPicture,
 		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,
+			  x_off, y_off,
 			  ntri, (pixman_triangle_t *)tris);
 
     free_pixman_pict (pPicture, image);
@@ -110,13 +107,11 @@ fbShapes (CompositeShapesFunc	composite,
 	  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)
     {
@@ -136,10 +131,10 @@ fbShapes (CompositeShapesFunc	composite,
 	    for (i = 0; i < nshapes; ++i)
 	    {
 		composite (op, src, dst, format,
-			   xSrc + src_xoff,
-			   ySrc + src_yoff,
-			   dst_xoff,
-			   dst_yoff,
+			   xSrc,
+			   ySrc,
+			   0,
+			   0,
 			   1, shapes + i * shape_size);
 	    }
 	}
@@ -162,10 +157,10 @@ fbShapes (CompositeShapesFunc	composite,
 	    }
 	    
 	    composite (op, src, dst, format,
-		       xSrc + src_xoff,
-		       ySrc + src_yoff,
-		       dst_xoff,
-		       dst_yoff,
+		       xSrc,
+		       ySrc,
+		       0,
+		       0,
 		       nshapes, shapes);
 	}
 
commit de988702f7f0284019a045eeb2aebac9f72527b4
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 0f1ebe5..dcbfe1c 100644
--- a/mi/miexpose.c
+++ b/mi/miexpose.c
@@ -521,6 +521,7 @@ void RootlessSetPixmapOfAncestors(WindowPtr pWin);
 void RootlessStartDrawing(WindowPtr pWin);
 void RootlessDamageRegion(WindowPtr pWin, RegionPtr prgn);
 Bool IsFramedWindow(WindowPtr pWin);
+#include "../fb/fb.h"
 #endif 
 
 void
@@ -548,24 +549,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;
-
-    if(IsFramedWindow(pWin)) {
-        RootlessStartDrawing(pWin);
-        RootlessDamageRegion(pWin, prgn);
-    
-        if(pWin->backgroundState == ParentRelative) {
-            if((what == PW_BACKGROUND) || 
-               (what == PW_BORDER && !pWin->borderIsPixel))
-                RootlessSetPixmapOfAncestors(pWin);
-        }
-    }
 #endif
     
     if (what == PW_BACKGROUND)
     {
+#ifdef ROOTLESS
+	if(IsFramedWindow(pWin)) {
+	    RootlessStartDrawing(pWin);
+	    RootlessDamageRegion(pWin, prgn);
+
+	    if(pWin->backgroundState == ParentRelative) {
+		RootlessSetPixmapOfAncestors(pWin);
+	    }
+	}
+#endif
+
 	while (pWin->backgroundState == ParentRelative)
 	    pWin = pWin->parent;
 
@@ -591,6 +605,18 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what)
     {
 	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;
 	
@@ -599,6 +625,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;
@@ -661,6 +693,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 cac38948bca833fe4f7972595d82f88b75324a0e
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Sat Oct 30 14:55:06 2010 -0700

    configure.ac: Add -fno-strict-aliasing to CFLAGS
    
    This should address https://bugs.freedesktop.org/show_bug.cgi?id=31238
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>

diff --git a/configure.ac b/configure.ac
index 5792731..ca90268 100644
--- a/configure.ac
+++ b/configure.ac
@@ -87,6 +87,12 @@ XORG_PROG_RAWCPP
 # easier overrides at build time.
 XSERVER_CFLAGS='$(CWARNFLAGS)'
 
+dnl Explicitly add -fno-strict-aliasing since this option should disappear
+dnl from util-macros CWARNFLAGS
+if  test "x$GCC" = xyes ; then
+    XSERVER_CFLAGS="$XSERVER_CFLAGS -fno-strict-aliasing"
+fi
+
 dnl Check for dtrace program (needed to build Xserver dtrace probes)
 dnl Also checks for <sys/sdt.h>, since some Linux distros have an 
 dnl ISDN trace program named dtrace
commit 41524dd61020f2a446ec54643fa17aa791338cac
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Fri Dec 16 17:47:46 2011 -0800

    configure.ac: 1.11.3
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>

diff --git a/configure.ac b/configure.ac
index 817c907..5792731 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,8 +26,8 @@ dnl
 dnl Process this file with autoconf to create configure.
 
 AC_PREREQ(2.57)
-AC_INIT([xorg-server], 1.11.2.902, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
-RELEASE_DATE="2011-12-09"
+AC_INIT([xorg-server], 1.11.3, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
+RELEASE_DATE="2011-12-16"
 AC_CONFIG_SRCDIR([Makefile.am])
 AM_INIT_AUTOMAKE([foreign dist-bzip2])
 AM_MAINTAINER_MODE
commit ee66474eb2009118a41539c6773e514a09d27e4d
Author: Gaetan Nadon <memsize at videotron.ca>
Date:   Fri Dec 9 07:45:02 2011 -0500

    dmx: fix distcheck failure, missing compsize.h in Makefile.am
    
    which was added in commit:
    dmx: Build fix for -Werror=implicit-function-declaration
    
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Gaetan Nadon <memsize at videotron.ca>
    Signed-off-by: Keith Packard <keithp at keithp.com>
    (cherry picked from commit 2c1d0a539c0fb1860ac89a00d1fb609f1959e1b6)

diff --git a/hw/dmx/glxProxy/Makefile.am b/hw/dmx/glxProxy/Makefile.am
index 8516048..4ee1036 100644
--- a/hw/dmx/glxProxy/Makefile.am
+++ b/hw/dmx/glxProxy/Makefile.am
@@ -1,10 +1,12 @@
 noinst_LIBRARIES = libglxproxy.a
 
 libglxproxy_a_SOURCES = compsize.c \
+                        compsize.h \
                         g_disptab.c \
                         g_disptab.h \
                         global.c \
                         glxcmds.c \
+                        glxcmds.h \
                         glxcmdsswap.c \
                         glxcontext.h \
                         glxdrawable.h \
commit 0ca8869e4537412f25bfd5610aba5e604952608c
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Fri Dec 9 12:58:30 2011 -0800

    configure.ac: 1.11.2.902 (1.11.3 RC2)
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>

diff --git a/configure.ac b/configure.ac
index 9237686..817c907 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,8 +26,8 @@ dnl
 dnl Process this file with autoconf to create configure.
 
 AC_PREREQ(2.57)
-AC_INIT([xorg-server], 1.11.2.901, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
-RELEASE_DATE="2011-11-28"
+AC_INIT([xorg-server], 1.11.2.902, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
+RELEASE_DATE="2011-12-09"
 AC_CONFIG_SRCDIR([Makefile.am])
 AM_INIT_AUTOMAKE([foreign dist-bzip2])
 AM_MAINTAINER_MODE
commit e76c397eb90291b048e0b2102111008e3d2e469e
Author: Dave Airlie <airlied at redhat.com>
Date:   Mon Nov 28 16:37:59 2011 +0000

    kdrive: drop screen crossing code.
    
    The only kdrive server we probably care about anymore is Xephyr,
    and this screen enable/disable code totally breaks it in multi-screen mode.
    
    When you are in one screen the other stops updating.
    
    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=757457
    
    Signed-off-by: Dave Airlie <airlied at redhat.com>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    (cherry picked from commit 98c4a888a4428789386c7c47cecc81933b5999ba)

diff --git a/hw/kdrive/src/kinput.c b/hw/kdrive/src/kinput.c
index c14dd82..500a3d8 100644
--- a/hw/kdrive/src/kinput.c
+++ b/hw/kdrive/src/kinput.c
@@ -2135,12 +2135,6 @@ KdCursorOffScreen(ScreenPtr *ppScreen, int *x, int *y)
 static void
 KdCrossScreen(ScreenPtr pScreen, Bool entering)
 {
-#ifndef XIPAQ
-    if (entering)
-	KdEnableScreen (pScreen);
-    else
-	KdDisableScreen (pScreen);
-#endif
 }
 
 int KdCurScreen;	/* current event screen */
commit db418ff7501d960c8de813a37b8bb37b1ba22175
Author: Dave Airlie <airlied at redhat.com>
Date:   Thu Oct 20 10:48:26 2011 +0100

    hal: free tmp_val in one missing case
    
    Pointed out by coverity scan.
    
    Signed-off-by: Dave Airlie <airlied at redhat.com>
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>
    (cherry picked from commit 8d3731a811e33e263920dd7c8ec63d02968cb56e)

diff --git a/config/hal.c b/config/hal.c
index 297520a..a4141d5 100644
--- a/config/hal.c
+++ b/config/hal.c
@@ -355,6 +355,7 @@ device_added(LibHalContext *hal_ctx, const char *udi)
                         if (!strcasecmp(tmp, ".options") && (!xkb_opts.options))
                             xkb_opts.options = strdup(tmp_val);
                     }
+                    free(tmp_val);
                 }
             }
         }
commit 6b11b18ab683e1f38e5b27066b35947b96956e5f
Author: Dave Airlie <airlied at redhat.com>
Date:   Thu Oct 20 11:00:43 2011 +0100

    xv: test correct number of requests. (v2)
    
    Pointed out by coverity.
    
    v2: fix swapped as well, as pointed out by Alan
    
    Signed-off-by: Dave Airlie <airlied at redhat.com>
    Reviewed-by: Alan Coopersmith <alan.coopersmith at oracle.com>
    (cherry picked from commit 41229392b790f30a0f0ef1f4ed95647c5bca4001)

diff --git a/Xext/xvdisp.c b/Xext/xvdisp.c
index b968431..84b10b4 100644
--- a/Xext/xvdisp.c
+++ b/Xext/xvdisp.c
@@ -1265,7 +1265,7 @@ ProcXvDispatch(ClientPtr client)
 
   UpdateCurrentTime();
 
-  if (stuff->data > xvNumRequests) {
+  if (stuff->data >= xvNumRequests) {
     SendErrorToClient(client, XvReqCode, stuff->data, 0, BadRequest);
     return BadRequest;
   }
@@ -1589,7 +1589,7 @@ SProcXvDispatch(ClientPtr client)
 
   UpdateCurrentTime();
 
-  if (stuff->data > xvNumRequests) {
+  if (stuff->data >= xvNumRequests) {
     SendErrorToClient(client, XvReqCode, stuff->data, 0, BadRequest);
     return BadRequest;
   }
commit df16b789aaf5fe7025e5661117477a5f6f9129ee
Author: Dave Airlie <airlied at redhat.com>
Date:   Wed Oct 19 16:57:13 2011 +0100

    xaa: avoid possible freed pointer reuse in epilogue
    
    If the pGCPriv->flags == 2, then we try to assign the freed pGCPriv->XAAOps
    avoid this by clearing the flags in to be destroyed pGCPriv.
    
    Reported by coverity.
    
    Signed-off-by: Dave Airlie <airlied at redhat.com>
    Reviewed-by: Jeremy Huddleston <jeremyhu at apple.com>
    (cherry picked from commit 1049139499d9132a20cd6d4d156fe9da9cddb6c2)

diff --git a/hw/xfree86/xaa/xaaGC.c b/hw/xfree86/xaa/xaaGC.c
index 44d50e6..1bc35d9 100644
--- a/hw/xfree86/xaa/xaaGC.c
+++ b/hw/xfree86/xaa/xaaGC.c
@@ -239,6 +239,7 @@ XAADestroyGC(GCPtr pGC)
 	free(pGCPriv->XAAOps);
 
     free(pGCPriv->DashPattern);
+    pGCPriv->flags = 0;
 
     (*pGC->funcs->DestroyGC)(pGC);
     XAA_GC_FUNC_EPILOGUE (pGC);
commit befa8a3b836e8b5781491aff4e659ae856beb494
Author: Dave Airlie <airlied at redhat.com>
Date:   Wed Oct 19 16:22:31 2011 +0100

    Xi: avoid overrun of callback array.
    
    This code had an off-by-one and would allow writing one past the end of
    the callbacks array.
    
    Pointed out by coverity.
    
    Signed-off-by: Dave Airlie <airlied at redhat.com>
    Reviewed-by: Jeremy Huddleston <jeremyhu at apple.com>
    (cherry picked from commit 682c09a2cedd234b005334cc01247d859dd7f26a)

diff --git a/Xi/extinit.c b/Xi/extinit.c
index 0905e18..0ce4e06 100644
--- a/Xi/extinit.c
+++ b/Xi/extinit.c
@@ -409,7 +409,7 @@ static int
 ProcIDispatch(ClientPtr client)
 {
     REQUEST(xReq);
-    if (stuff->data > ARRAY_SIZE(ProcIVector) || !ProcIVector[stuff->data])
+    if (stuff->data >= ARRAY_SIZE(ProcIVector) || !ProcIVector[stuff->data])
         return BadRequest;
 
     return (*ProcIVector[stuff->data])(client);
@@ -428,7 +428,7 @@ static int
 SProcIDispatch(ClientPtr client)
 {
     REQUEST(xReq);
-    if (stuff->data > ARRAY_SIZE(SProcIVector) || !SProcIVector[stuff->data])
+    if (stuff->data >= ARRAY_SIZE(SProcIVector) || !SProcIVector[stuff->data])
         return BadRequest;
 
     return (*SProcIVector[stuff->data])(client);
commit b22783f483d440a005ff76d5c7894e2cf2a95dcb
Author: Dave Airlie <airlied at redhat.com>
Date:   Wed Oct 19 16:21:26 2011 +0100

    xext: don't free uninitialised pointer when malloc fails. (v2)
    
    Initialise the pAttr->values to values so if the values allocation
    fails it just ends up as free(NULL).
    
    Pointed out by coverity.
    
    v2: use Alan's suggestion.
    
    Signed-off-by: Dave Airlie <airlied at redhat.com>
    Reviewed-by: Alan Coopersmith <alan.coopersmith at oracle.com>
    Reviewed-by: Jeremy Huddleston <jeremyhu at apple.com>
    (cherry picked from commit b62dc4fcbcffd10de16650bee284702c8608bb60)

diff --git a/Xext/saver.c b/Xext/saver.c
index 1888603..0f9e878 100644
--- a/Xext/saver.c
+++ b/Xext/saver.c
@@ -927,7 +927,7 @@ ScreenSaverSetAttributes (ClientPtr client)
 	goto bail;
     }
     /* over allocate for override redirect */
-    values = malloc((len + 1) * sizeof (unsigned long));
+    pAttr->values = values = malloc((len + 1) * sizeof (unsigned long));
     if (!values)
     {
 	ret = BadAlloc;
@@ -947,7 +947,6 @@ ScreenSaverSetAttributes (ClientPtr client)
     pAttr->pCursor = NullCursor;
     pAttr->pBackgroundPixmap = NullPixmap;
     pAttr->pBorderPixmap = NullPixmap;
-    pAttr->values = values;
     /*
      * go through the mask, checking the values,
      * looking up pixmaps and cursors and hold a reference
commit 083599c5597276289af9adaf8a8571cbe743c3fd
Author: Adam Jackson <ajax at redhat.com>
Date:   Thu Apr 28 13:34:28 2011 +1000

    fbdevhw: iterate over all modes that match a mode. (v3)
    
    So on RHEL5 anaconda sets an xorg.conf with a fixed 800x600 mode in it,
    we run radeonfb and fbdev since ati won't work in userspace due to domain
    issues in the older codebase.
    
    On certain pseries blades the built-in KVM can't accept an 800x600-43 mode,
    it requires the 800x600-60 mode, so we have to have the kernel radeonfb
    driver reject the 800x600-43 mode when it sees it. However then fbdev
    doesn't try any of the other 800x600 modes in the modelist, and we end up
    getting a default 640x480 mode we don't want.
    
    This patch changes the mode validation loop to continue on with the other modes
    that match to find one that works.
    
    v2: move code around to avoid extra loop, after comment from Jamey.
    v3: move loop setup back into loop as per Jeremy's review.
    
    Signed-off-by: Dave Airlie <airlied at redhat.com>
    Reviewed-by: Jamey Sharp <jamey at minilop.net>
    Reviewed-by: Jeremy Huddleston <jeremyhu at apple.com>
    (cherry picked from commit 22605effd188436629a0dbc688666549473741e4)

diff --git a/hw/xfree86/fbdevhw/fbdevhw.c b/hw/xfree86/fbdevhw/fbdevhw.c
index dee731b..806b906 100644
--- a/hw/xfree86/fbdevhw/fbdevhw.c
+++ b/hw/xfree86/fbdevhw/fbdevhw.c
@@ -509,20 +509,22 @@ fbdevHWSetVideoModes(ScrnInfoPtr pScrn)
 	pScrn->virtualY = pScrn->display->virtualY;
 
 	for (modename = pScrn->display->modes; *modename != NULL; modename++) {
-		for (mode = pScrn->monitor->Modes; mode != NULL; mode = mode->next)
-			if (0 == strcmp(mode->name,*modename))
-				break;
+		for (mode = pScrn->monitor->Modes; mode != NULL; mode = mode->next) {
+			if (0 == strcmp(mode->name,*modename)) {
+				if (fbdevHWSetMode(pScrn, mode, TRUE))
+					break;
+
+				xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+					   "\tmode \"%s\" test failed\n", *modename);
+			}
+		}
+
 		if (NULL == mode) {
 			xf86DrvMsg(pScrn->scrnIndex, X_INFO,
 				   "\tmode \"%s\" not found\n", *modename);
 			continue;
 		}
 
-		if (!fbdevHWSetMode(pScrn, mode, TRUE)) {
-			xf86DrvMsg(pScrn->scrnIndex, X_INFO,
-				   "\tmode \"%s\" test failed\n", *modename);
-			continue;
-		}
 		xf86DrvMsg(pScrn->scrnIndex, X_INFO,
 			   "\tmode \"%s\" ok\n", *modename);
 
commit 05a890df0ade7c4958a2a13ed0c6471e4658a098
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date:   Thu Dec 1 23:45:42 2011 -0800

    LoaderOpen returns either a valid pointer or NULL, so don't check for < 0
    
    Fixes Sun cc warning that was recently elevated to error by the
    stricter default CFLAGS changes to xorg-macros:
    
    "loadmod.c", line 914: improper pointer/integer combination: op "<"
    
    Should have been changed when commit ab7f057ce9df4e905b12 changed the
    LoaderOpen return type from int to void *.
    
    Changes log message when file is found but dlopen() fails from:
     (EE) LoadModule: Module dbe does not have a dbeModuleData data object.
     (EE) Failed to load module "dbe" (invalid module, 0)
    to:
     (EE) Failed to load module "dbe" (loader failed, 7)
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
    Reviewed-by: Adam Jackson <ajax at redhat.com>
    (cherry picked from commit e4dcf580f007d6adcf5b0c639865d7aaab1a319d)

diff --git a/hw/xfree86/loader/loadmod.c b/hw/xfree86/loader/loadmod.c
index 9f82099..20a4719 100644
--- a/hw/xfree86/loader/loadmod.c
+++ b/hw/xfree86/loader/loadmod.c
@@ -918,7 +918,7 @@ doLoadModule(const char *module, const char *path, const char **subdirlist,
 	goto LoadModule_fail;
     }
     ret->handle = LoaderOpen(found, errmaj, errmin);
-    if (ret->handle < 0)
+    if (ret->handle == NULL)
 	goto LoadModule_fail;
     ret->path = strdup(found);
 
commit f4944108421d6ae4c728290baa43291f55ebaa67
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date:   Wed Nov 23 00:30:02 2011 -0800

    Limit the number of screens Xvfb will attempt to allocate memory for
    
    Commit f9e3a2955d2ca7 removing the MAXSCREEN limit left the screen
    number too unlimited, and allowed any positive int for a screen number:
    
    Xvfb :1 -screen 2147483647 1024x1024x8
    
    Fatal server error:
    Not enough memory for screen 2147483647
    
    Found by Parfait 0.3.7:
    Error: Integer overflow (CWE 190)
       Integer parameter of memory allocation function realloc() may overflow due to multiplication with constant value 1112
            at line 293 of hw/vfb/InitOutput.c in function 'ddxProcessArgument'.
    
    Since the X11 connection setup only has a CARD8 for number of SCREENS,
    limit to 255 screens, which is also low enough to avoid overflow on the
    sizeof(*vfbScreens) * (screenNum + 1) calculation for realloc.
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
    Reviewed-by: Jamey Sharp <jamey at minilop.net>
    (cherry picked from commit feebf6746374aa04b12e9e3e51313a3a82c03530)

diff --git a/hw/vfb/InitOutput.c b/hw/vfb/InitOutput.c
index dce3f84..c17f12c 100644
--- a/hw/vfb/InitOutput.c
+++ b/hw/vfb/InitOutput.c
@@ -280,7 +280,9 @@ ddxProcessArgument(int argc, char *argv[], int i)
 	int screenNum;
 	CHECK_FOR_REQUIRED_ARGUMENTS(2);
 	screenNum = atoi(argv[i+1]);
-	if (screenNum < 0)
+	/* The protocol only has a CARD8 for number of screens in the
+	   connection setup block, so don't allow more than that. */
+	if ((screenNum < 0) || (screenNum >= 255))
 	{
 	    ErrorF("Invalid screen number %d\n", screenNum);
 	    UseMsg();


More information about the Xquartz-changes mailing list