xserver: Branch 'xorg-server-1.4-apple' - 3 commits

Jeremy Huddleston jeremyhu at kemper.freedesktop.org
Fri Aug 29 20:41:00 PDT 2008


 configure.ac                          |    4 ++--
 dix/events.c                          |   16 ++++++++++++++--
 fb/fbwindow.c                         |   33 ++++++++++++++++++++++++++++-----
 hw/xquartz/darwin.c                   |    2 --
 hw/xquartz/mach-startup/bundle-main.c |   19 +++++++++++++++++--
 miext/rootless/rootlessWindow.c       |   33 +++++++++++++++++++++++++++++++--
 6 files changed, 92 insertions(+), 15 deletions(-)

New commits:
commit 9224fb289971136a4785a282a345b815e263eadb
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Fri Aug 29 20:31:57 2008 -0700

    1.4.2-apple13

diff --git a/configure.ac b/configure.ac
index 067ceee..36ebc07 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,7 +26,7 @@ dnl
 dnl Process this file with autoconf to create configure.
 
 AC_PREREQ(2.57)
-AC_INIT([xorg-server], 1.4.2-apple12, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
+AC_INIT([xorg-server], 1.4.2-apple13, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
 AC_CONFIG_SRCDIR([Makefile.am])
 AM_INIT_AUTOMAKE([dist-bzip2 foreign])
 AM_MAINTAINER_MODE
commit bc964ff1e3f3d8ab590eab40d767c6241e9480d4
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Fri Aug 29 20:31:38 2008 -0700

    XQuartz: Stab at fixing the alpha 0/1 bug (screenshots, etc) by pulling in some old code that got gutted from rootless.

diff --git a/configure.ac b/configure.ac
index 213a856..067ceee 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1764,7 +1764,7 @@ if test "x$XQUARTZ" = xyes; then
 
 	AC_CHECK_LIB([Xplugin],[xp_init],[:])
 
-	CFLAGS="${CFLAGS} -DROOTLESS_WORKAROUND -DNO_ALLOCA"
+	CFLAGS="${CFLAGS} -DROOTLESS_WORKAROUND -DROOTLESS_SAFEALPHA -DNO_ALLOCA"
 fi
 
 # Support for objc in autotools is minimal and not documented.
diff --git a/fb/fbwindow.c b/fb/fbwindow.c
index 144f083..a5cfc34 100644
--- a/fb/fbwindow.c
+++ b/fb/fbwindow.c
@@ -256,6 +256,14 @@ fbFillRegionSolid (DrawablePtr	pDrawable,
 #include "panoramiXsrv.h"
 #endif
 
+#ifdef ROOTLESS_SAFEALPHA
+/* Bit mask for alpha channel with a particular number of bits per
+ * pixel. Note that we only care for 32bpp data. Mac OS X uses planar
+ * alpha for 16bpp.
+ */
+#define RootlessAlphaMask(bpp) ((bpp) == 32 ? 0xFF000000 : 0)
+#endif
+
 void
 fbFillRegionTiled (DrawablePtr	pDrawable,
 		   RegionPtr	pRegion,
@@ -274,6 +282,11 @@ fbFillRegionTiled (DrawablePtr	pDrawable,
     BoxPtr	pbox = REGION_RECTS(pRegion);
     int		xRot = pDrawable->x;
     int		yRot = pDrawable->y;
+#ifdef ROOTLESS_SAFEALPHA
+    FbBits planeMask = FB_ALLONES & ~RootlessAlphaMask(dstBpp);
+#else
+    FbBits planeMask = FB_ALLONES;
+#endif
     
 #ifdef PANORAMIX
     if(!noPanoramiXExtension) 
@@ -305,7 +318,7 @@ fbFillRegionTiled (DrawablePtr	pDrawable,
 		tileWidth * dstBpp,
 		tileHeight,
 		GXcopy,
-		FB_ALLONES,
+		planeMask,
 		dstBpp,
 		xRot * dstBpp,
 		yRot - (pbox->y1 + dstYoff));
@@ -342,8 +355,13 @@ fbPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what)
 	    fbFillRegionSolid (&pWin->drawable,
 			       pRegion,
 			       0,
-			       fbReplicatePixel (pWin->background.pixel,
-						 pWin->drawable.bitsPerPixel));
+			       fbReplicatePixel (
+#ifdef ROOTLESS_SAFEALPHA
+                                     pWin->background.pixel | RootlessAlphaMask(pWin->drawable.bitsPerPixel),
+#else
+                                     pWin->background.pixel,
+#endif
+                                     pWin->drawable.bitsPerPixel));
 	    break;
     	}
     	break;
@@ -353,8 +371,13 @@ fbPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what)
 	    fbFillRegionSolid (&pWin->drawable,
 			       pRegion,
 			       0,
-			       fbReplicatePixel (pWin->border.pixel,
-						 pWin->drawable.bitsPerPixel));
+			       fbReplicatePixel (
+#ifdef ROOTLESS_SAFEALPHA
+                           pWin->border.pixel | RootlessAlphaMask(pWin->drawable.bitsPerPixel),
+#else
+                           pWin->border.pixel,
+#endif
+                           pWin->drawable.bitsPerPixel));
 	}
 	else
 	{
commit aaf0f71db197526b6b866cc1b39fbdfe051879ef
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Fri Aug 29 19:43:13 2008 -0700

    XQuartz: Added debugging output to the crash log to help track down two crashes, since people don't often report their system.log spew.

diff --git a/dix/events.c b/dix/events.c
index c0142ca..6a2fff1 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -2373,13 +2373,25 @@ WindowHasNewCursor(WindowPtr pWin)
     PostNewCursor();
 }
 
+#ifdef XQUARTZ
+#include <string.h>
+extern char *__crashreporter_info__;
+extern const char *__crashreporter_info__base;
+extern int __crashreporter_info__len;
+#endif
+
 _X_EXPORT void
 NewCurrentScreen(ScreenPtr newScreen, int x, int y)
 {
     sprite.hotPhys.x = x;
     sprite.hotPhys.y = y;
-    ErrorF("noPanoramiXExtension=%d newScreen=%p\n", noPanoramiXExtension, newScreen);
-    ErrorF("newScreen->myNum=%d\n", newScreen->myNum);
+#ifdef XQUARTZ
+    /* We're seeing a crash here, but I'm not sure what's causing it... so putting in some debugging */
+    snprintf(__crashreporter_info__, __crashreporter_info__len, "%s\n\nNewCurrentScreen debug data\nnoPanoramiXExtension=%d\nnewScreen=%p\nnewScreen->myNum=%d\n",
+             __crashreporter_info__base, noPanoramiXExtension, newScreen,newScreen->myNum);
+    ErrorF("NewCurrentScreen debug data\nnoPanoramiXExtension=%d\nnewScreen=%p\nnewScreen->myNum=%d\n",
+           noPanoramiXExtension, newScreen, newScreen->myNum);
+#endif
 #ifdef PANORAMIX
     if(!noPanoramiXExtension) {
 	sprite.hotPhys.x += panoramiXdataPtr[newScreen->myNum].x - 
diff --git a/hw/xquartz/darwin.c b/hw/xquartz/darwin.c
index 2260a5f..72d1b23 100644
--- a/hw/xquartz/darwin.c
+++ b/hw/xquartz/darwin.c
@@ -153,8 +153,6 @@ const int NUMFORMATS = sizeof(formats)/sizeof(formats[0]);
 #define XSERVER_VERSION "?"
 #endif
 
-const char *__crashreporter_info__ = "X.Org X Server " XSERVER_VERSION " Build Date: " BUILD_DATE;
-
 void DDXRingBell(int volume, int pitch, int duration) {
   // FIXME -- make some noise, yo
 }
diff --git a/hw/xquartz/mach-startup/bundle-main.c b/hw/xquartz/mach-startup/bundle-main.c
index 0eb45d1..6f1704e 100644
--- a/hw/xquartz/mach-startup/bundle-main.c
+++ b/hw/xquartz/mach-startup/bundle-main.c
@@ -59,6 +59,18 @@ extern int noPanoramiXExtension;
 #define DEFAULT_STARTX "/usr/X11/bin/startx"
 #define DEFAULT_SHELL  "/bin/sh"
 
+#ifndef BUILD_DATE
+#define BUILD_DATE ""
+#endif
+#ifndef XSERVER_VERSION
+#define XSERVER_VERSION "?"
+#endif
+
+const int __crashreporter_info__len = 4096;
+const char *__crashreporter_info__base = "X.Org X Server " XSERVER_VERSION " Build Date: " BUILD_DATE;
+char __crashreporter_info__buf[4096];
+char *__crashreporter_info__ = __crashreporter_info__buf;
+
 #define DEBUG 1
 
 static int execute(const char *command);
@@ -389,7 +401,10 @@ int main(int argc, char **argv, char **envp) {
 
     // The server must not run the PanoramiX operations.
     noPanoramiXExtension = TRUE;
-    
+
+    /* Setup the initial crasherporter info */
+    strlcpy(__crashreporter_info__, __crashreporter_info__base, __crashreporter_info__len);
+
     fprintf(stderr, "X11.app: main(): argc=%d\n", argc);
     for(i=0; i < argc; i++) {
         fprintf(stderr, "\targv[%u] = %s\n", (unsigned)i, argv[i]);
@@ -397,7 +412,7 @@ int main(int argc, char **argv, char **envp) {
             listenOnly = TRUE;
         }
     }
-    
+
     mp = checkin_or_register(SERVER_BOOTSTRAP_NAME);
     if(mp == MACH_PORT_NULL) {
         fprintf(stderr, "NULL mach service: %s", SERVER_BOOTSTRAP_NAME);
diff --git a/miext/rootless/rootlessWindow.c b/miext/rootless/rootlessWindow.c
index f71a1a2..9066e0b 100644
--- a/miext/rootless/rootlessWindow.c
+++ b/miext/rootless/rootlessWindow.c
@@ -131,16 +131,45 @@ RootlessNativeWindowStateChanged (WindowPtr pWin, unsigned int state)
   pWin->rootlessUnhittable = winRec->is_offscreen;
 }
 
+#ifdef XQUARTZ
+#include <string.h>
+extern char *__crashreporter_info__;
+extern const char *__crashreporter_info__base;
+extern int __crashreporter_info__len;
+#endif
+
 void RootlessNativeWindowMoved (WindowPtr pWin) {
     xp_box bounds;
     int sx, sy, err;
     XID vlist[2];
     Mask mask;
     ClientPtr client, pClient;
-    RootlessWindowRec *winRec = WINREC(pWin);
+    RootlessWindowRec *winRec;
+
+#ifdef XQUARTZ
+    /* We're seeing a crash here, but I'm not sure what's causing it... so putting in some debugging */
+    snprintf(__crashreporter_info__, __crashreporter_info__len,
+             "%s\n\RootlessNativeWindowMoved debug data\npWin=%p\n",
+             __crashreporter_info__base, pWin);
+    ErrorF("RootlessNativeWindowMoved debug data\npWin=%p\n", pWin);
+#endif
+    
+    winRec = WINREC(pWin);
+
+#ifdef XQUARTZ
+    /* We're seeing a crash here, but I'm not sure what's causing it... so putting in some debugging */
+    snprintf(__crashreporter_info__, __crashreporter_info__len, "%swinRec=%p\nwinRec->wid=%d\n", __crashreporter_info__, winRec, winRec ? (int)winRec->wid : 0);
+    ErrorF("winRec=%p\nwinRec->wid=%d\n", winRec, winRec ? (int)winRec->wid : 0);
+#endif
     
     if (xp_get_window_bounds ((xp_window_id)winRec->wid, &bounds) != Success) return;
     
+#ifdef XQUARTZ
+    /* We're seeing a crash here, but I'm not sure what's causing it... so putting in some debugging */
+    snprintf(__crashreporter_info__, __crashreporter_info__len, "%spWin->drawable.pScreen=%p\npWin->drawable.pScreen->myNum=%d\n", __crashreporter_info__, pWin->drawable.pScreen, pWin->drawable.pScreen ? pWin->drawable.pScreen->myNum : 0);
+    ErrorF("pWin->drawable.pScreen=%p\npWin->drawable.pScreen->myNum=%d\n", pWin->drawable.pScreen, pWin->drawable.pScreen ? pWin->drawable.pScreen->myNum : 0);
+#endif
+    
     sx = dixScreenOrigins[pWin->drawable.pScreen->myNum].x + darwinMainScreenX;
     sy = dixScreenOrigins[pWin->drawable.pScreen->myNum].y + darwinMainScreenY;
     
@@ -153,7 +182,7 @@ void RootlessNativeWindowMoved (WindowPtr pWin) {
     /* pretend we're the owner of the window! */
     err = dixLookupClient(&pClient, pWin->drawable.id, NullClient, DixUnknownAccess);
     if(err != Success) {
-        ErrorF("RootlessNativeWindowMoved(): Failed to lookup window: 0x%x\n", pWin->drawable.id);
+        ErrorF("RootlessNativeWindowMoved(): Failed to lookup window: 0x%x\n", (unsigned int)pWin->drawable.id);
         return;
     }
     


More information about the xorg-commit mailing list