6520998 64-bit Xephyr crashes on startup nv_59
authorAlan Coopersmith <Alan.Coopersmith@Sun.COM>
Fri, 09 Feb 2007 10:35:28 -0800
changeset 101 9cf86bf83343
parent 100 8b89bd2a5118
child 102 8e8dcdcc5094
6520998 64-bit Xephyr crashes on startup
open-src/xserver/xorg/Makefile
open-src/xserver/xorg/xephyr.patch
--- a/open-src/xserver/xorg/Makefile	Fri Feb 02 12:49:23 2007 -0800
+++ b/open-src/xserver/xorg/Makefile	Fri Feb 09 10:35:28 2007 -0800
@@ -30,7 +30,7 @@
 # or other dealings in this Software without prior written authorization
 # of the copyright holder.
 #
-# @(#)Makefile	1.30	07/01/30
+# @(#)Makefile	1.31	07/02/02
 #
 
 PWD:sh=pwd
@@ -55,6 +55,7 @@
 # Patches to apply to source after unpacking, in order
 SOURCE_PATCHES = \
 	xf1bpp.patch,-p1 \
+	xephyr.patch,-p1 \
 	server-libs.patch \
 	dtrace.patch \
 	ast-driver.patch \
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/open-src/xserver/xorg/xephyr.patch	Fri Feb 09 10:35:28 2007 -0800
@@ -0,0 +1,83 @@
+commit 5dcad9e9d7d9993d65f989219bee94a060bbf476
+Author: Alan Coopersmith <[email protected]>
+Date:   Fri Feb 2 14:44:55 2007 -0800
+
+    Fix bus error on startup in 64-bit Xephyr
+    
+    hostx_get_visual_masks takes unsigned long * arguments, but was being
+    passed pointers to CARD32's.
+
+diff --git a/hw/kdrive/ephyr/ephyr.c b/hw/kdrive/ephyr/ephyr.c
+index 7db8675..2ca51c3 100644
+--- a/hw/kdrive/ephyr/ephyr.c
++++ b/hw/kdrive/ephyr/ephyr.c
+@@ -81,7 +81,8 @@ Bool
+ ephyrScreenInitialize (KdScreenInfo *screen, EphyrScrPriv *scrpriv)
+ {
+   int width = 640, height = 480; 
+-
++  unsigned long redMask, greenMask, blueMask;
++  
+   if (hostx_want_screen_size(&width, &height) 
+       || !screen->width || !screen->height)
+     {
+@@ -133,30 +134,24 @@ ephyrScreenInitialize (KdScreenInfo *scr
+ 	{
+ 	  screen->fb[0].depth = 15;
+ 	  screen->fb[0].bitsPerPixel = 16;
+-	  
+-	  hostx_get_visual_masks (&screen->fb[0].redMask,
+-				  &screen->fb[0].greenMask,
+-				  &screen->fb[0].blueMask);
+-	  
+ 	}
+       else if (screen->fb[0].depth <= 16)
+ 	{
+ 	  screen->fb[0].depth = 16;
+ 	  screen->fb[0].bitsPerPixel = 16;
+-	  
+-	  hostx_get_visual_masks (&screen->fb[0].redMask,
+-				  &screen->fb[0].greenMask,
+-				  &screen->fb[0].blueMask);
+ 	}
+       else
+ 	{
+ 	  screen->fb[0].depth = 24;
+ 	  screen->fb[0].bitsPerPixel = 32;
+-	  
+-	  hostx_get_visual_masks (&screen->fb[0].redMask,
+-				  &screen->fb[0].greenMask,
+-				  &screen->fb[0].blueMask);
+ 	}
++
++      hostx_get_visual_masks (&redMask, &greenMask, &blueMask);
++
++      screen->fb[0].redMask = (Pixel) redMask;
++      screen->fb[0].greenMask = (Pixel) greenMask;
++      screen->fb[0].blueMask = (Pixel) blueMask;
++
+     }
+   
+   scrpriv->randr = screen->randr;
+
+
+--- xorg-server-1.2.0/hw/kdrive/ephyr/hostx.c~	2007-01-22 21:39:15.000000000 -0800
++++ xorg-server-1.2.0/hw/kdrive/ephyr/hostx.c	2007-02-02 16:03:09.840426000 -0800
+@@ -40,6 +40,7 @@
+ #include <X11/Xatom.h>
+ #include <X11/keysym.h>
+ #include <X11/extensions/XShm.h>
++#include <X11/Xmd.h>
+ 
+ /*  
+  * All xlib calls go here, which gets built as its own .a .
+@@ -79,7 +80,8 @@
+ 
+ extern KeySym         EphyrKeymap[];
+ 
+-extern KeySym	      kdKeymap[];
++extern CARD32	      kdKeymap[];	/* really KeySym, but Xlib & Xserver
++					   use different sizes for that */
+ extern int	      kdMinScanCode;
+ extern int	      kdMaxScanCode;
+ extern int	      kdMinKeyCode;