SOURCES: xorg-xserver-server-sanity.patch (NEW), xorg-xserver-server-rawcon...

arekm arekm at pld-linux.org
Sun Nov 2 15:48:24 CET 2008


Author: arekm                        Date: Sun Nov  2 14:48:24 2008 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- new from upstream

---- Files affected:
SOURCES:
   xorg-xserver-server-sanity.patch (NONE -> 1.1)  (NEW), xorg-xserver-server-rawconsole.patch (NONE -> 1.1)  (NEW), xorg-xserver-server-mieq.patch (NONE -> 1.1)  (NEW), xorg-xserver-server-exa-sync-less.patch (NONE -> 1.1)  (NEW), xorg-xserver-server-edid.patch (NONE -> 1.1)  (NEW), xorg-xserver-server-backtrace.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/xorg-xserver-server-sanity.patch
diff -u /dev/null SOURCES/xorg-xserver-server-sanity.patch:1.1
--- /dev/null	Sun Nov  2 15:48:25 2008
+++ SOURCES/xorg-xserver-server-sanity.patch	Sun Nov  2 15:48:17 2008
@@ -0,0 +1,43 @@
+From 30c077f228f563e4e1f4115b345577d9fd393b68 Mon Sep 17 00:00:00 2001
+From: Peter Hutterer <peter.hutterer at redhat.com>
+Date: Fri, 24 Oct 2008 15:06:49 +1030
+Subject: [PATCH] dix: extra sanity-checks against potential NULL-dereferences. #434807
+
+Two minor code paths could potentially crash the server:
+- if scr is NULL, we shouldn't try to dereference it.
+- if GPE is called with buttons != 0 but the event is not a
+  ButtonPress or ButtonRelease, the button mapping may dereference a NULL
+  pointer.
+
+Admittedly the second should never happen, but better to guard against it.
+---
+ dix/getevents.c |    6 ++++++
+ 1 files changed, 6 insertions(+), 0 deletions(-)
+
+diff --git a/dix/getevents.c b/dix/getevents.c
+index 1e0edbf..923744d 100644
+--- a/dix/getevents.c
++++ b/dix/getevents.c
+@@ -537,6 +537,9 @@ GetPointerEvents(xEvent *events, DeviceIntPtr pDev, int type, int buttons,
+     ScreenPtr scr = miPointerGetScreen(pDev);
+ 
+     /* Sanity checks. */
++    if (!scr)
++        return 0;
++
+     if (type != MotionNotify && type != ButtonPress && type != ButtonRelease)
+         return 0;
+ 
+@@ -548,6 +551,9 @@ GetPointerEvents(xEvent *events, DeviceIntPtr pDev, int type, int buttons,
+     if (!pDev->valuator)
+         return 0;
+ 
++    if (buttons && !pDev->button)
++        return 0;
++
+     if (!coreOnly && pDev->coreEvents)
+         num_events = 2;
+     else
+-- 
+1.6.0.3
+

================================================================
Index: SOURCES/xorg-xserver-server-rawconsole.patch
diff -u /dev/null SOURCES/xorg-xserver-server-rawconsole.patch:1.1
--- /dev/null	Sun Nov  2 15:48:25 2008
+++ SOURCES/xorg-xserver-server-rawconsole.patch	Sun Nov  2 15:48:17 2008
@@ -0,0 +1,103 @@
+From 934dab76d01afb3a77439b94631eae37bf05c954 Mon Sep 17 00:00:00 2001
+From: Peter Hutterer <peter.hutterer at redhat.com>
+Date: Sun, 12 Oct 2008 21:58:30 +1030
+Subject: [PATCH] xfree86: if AllowEmptyInput is true, enable RAW mode on the console.
+
+Usually, the console is set to RAW in the kbd driver. If we hotplug all input
+devices (i.e. the evdev driver for keyboards) and the console is left as-is.
+As a result, the evdev driver must put an EVIOCGRAB on the device to avoid
+characters leaking onto the console. This again breaks many things, amongst
+them lirc, in-kernel mouse button emulation and HAL.
+
+This patch sets the console to RAW if AllowEmptyInput is on.
+
+Use-cases:
+1. AEI is off
+  1.1. Only kbd driver is used - behaviour as-is.
+  1.2. kbd and evdev driver is used: if evdev does not grab the device,
+       duplicate events are generated.
+2. AEI is on
+  2.1. Only evdev driver is used - behaviour as-is, but evdev does not need
+       to grab the device anymore.
+  2.2. evdev and kbd are used: duplicate key events are generated if evdev
+       does not grab the device.
+
+1.2 is a marginal use-case that can be fixed by adding a "grab" option to the
+evdev driver (update of xorg.conf is needed).
+
+2.2 is an issue. If we have no ServerLayout section, AEI is on, but devices
+specified in the xorg.conf are still added [1], resulting in duplicate events.
+This is a common configuration and needs sorting out.
+
+[1] 2eaed4a10fe5bf727579bca4ab8d4a47c8763a7d
+
+Signed-off-by: Peter Hutterer <peter.hutterer at redhat.com>
+Signed-off-by: Adam Jackson <ajax at redhat.com>
+
+---
+ hw/xfree86/os-support/linux/lnx_init.c |   35 +++++++++++++++++++++++++++++++-
+ 1 files changed, 34 insertions(+), 1 deletions(-)
+
+diff --git a/hw/xfree86/os-support/linux/lnx_init.c b/hw/xfree86/os-support/linux/lnx_init.c
+index 4c36b7c..6f68ba5 100644
+--- a/hw/xfree86/os-support/linux/lnx_init.c
++++ b/hw/xfree86/os-support/linux/lnx_init.c
+@@ -53,6 +53,8 @@ static int activeVT = -1;
+ 
+ static int vtPermSave[4];
+ static char vtname[11];
++static struct termios tty_attr; /* tty state to restore */
++static int tty_mode; /* kbd mode to restore */
+ 
+ static int
+ saveVtPerms(void)
+@@ -272,6 +274,34 @@ xf86OpenConsole(void)
+ 	        FatalError("xf86OpenConsole: KDSETMODE KD_GRAPHICS failed %s\n",
+ 		           strerror(errno));
+ 
++	    /* Set the keyboard to RAW mode. If we're using the keyboard
++	     * driver, the driver does it for us. If we have AEI on, then
++	     * we're expecting the devices to be added (i.e. evdev) and we
++	     * have to set it manually.
++	     */
++	    if (xf86Info.allowEmptyInput)
++	    {
++		struct termios nTty;
++
++		tcgetattr(xf86Info.consoleFd, &tty_attr);
++		ioctl(xf86Info.consoleFd, KDGKBMODE, &tty_mode);
++
++		if (ioctl(xf86Info.consoleFd, KDSKBMODE, K_RAW) < 0)
++		    FatalError("xf86OpenConsole: KDSKBMODE K_RAW failed %s\n",
++			    strerror(errno));
++
++		nTty = tty_attr;
++		nTty.c_iflag = (IGNPAR | IGNBRK) & (~PARMRK) & (~ISTRIP);
++		nTty.c_oflag = 0;
++		nTty.c_cflag = CREAD | CS8;
++		nTty.c_lflag = 0;
++		nTty.c_cc[VTIME]=0;
++		nTty.c_cc[VMIN]=1;
++		cfsetispeed(&nTty, 9600);
++		cfsetospeed(&nTty, 9600);
++		tcsetattr(xf86Info.consoleFd, TCSANOW, &nTty);
++	    }
++
+ 	    /* we really should have a InitOSInputDevices() function instead
+ 	     * of Init?$#*&Device(). So I just place it here */
+ 	
+@@ -328,7 +358,10 @@ xf86CloseConsole()
+     if (ioctl(xf86Info.consoleFd, KDSETMODE, KD_TEXT) < 0)
+ 	xf86Msg(X_WARNING, "xf86CloseConsole: KDSETMODE failed: %s\n",
+ 		strerror(errno));
+-	
++
++    ioctl(xf86Info.consoleFd, KDSKBMODE, tty_mode);
++    tcsetattr(xf86Info.consoleFd, TCSANOW, &tty_attr);
++
+     if (ioctl(xf86Info.consoleFd, VT_GETMODE, &VT) < 0) 
+ 	xf86Msg(X_WARNING, "xf86CloseConsole: VT_GETMODE failed: %s\n",
+ 		strerror(errno));
+-- 
+1.6.0.1
+

================================================================
Index: SOURCES/xorg-xserver-server-mieq.patch
diff -u /dev/null SOURCES/xorg-xserver-server-mieq.patch:1.1
--- /dev/null	Sun Nov  2 15:48:26 2008
+++ SOURCES/xorg-xserver-server-mieq.patch	Sun Nov  2 15:48:18 2008
@@ -0,0 +1,41 @@
+From b736f477f5324f79af30fc0f941ba0714a34ccda Mon Sep 17 00:00:00 2001
+From: Adam Jackson <ajax at redhat.com>
+Date: Fri, 10 Oct 2008 16:33:24 -0400
+Subject: [PATCH] mieq: Backtrace when the queue overflows.
+
+Since we're probably stuck down in a driver somewhere, let's at least
+try to point out where.  This will need to be rethought when the input
+thread work lands though.
+---
+ mi/mieq.c |    6 ++++++
+ 1 files changed, 6 insertions(+), 0 deletions(-)
+
+diff --git a/mi/mieq.c b/mi/mieq.c
+index 0a1b740..062dede 100644
+--- a/mi/mieq.c
++++ b/mi/mieq.c
+@@ -169,6 +169,7 @@ mieqEnqueue(DeviceIntPtr pDev, xEvent *e)
+ 	oldtail = (oldtail - 1) % QUEUE_SIZE;
+     }
+     else {
++	static int stuck = 0;
+ 	newtail = (oldtail + 1) % QUEUE_SIZE;
+ 	/* Toss events which come in late.  Usually this means your server's
+          * stuck in an infinite loop somewhere, but SIGIO is still getting
+@@ -176,8 +177,13 @@ mieqEnqueue(DeviceIntPtr pDev, xEvent *e)
+ 	if (newtail == miEventQueue.head) {
+             ErrorF("[mi] EQ overflowing. The server is probably stuck "
+                    "in an infinite loop.\n");
++	    if (!stuck) {
++		xorg_backtrace();
++		stuck = 1;
++	    }
+ 	    return;
+         }
++	stuck = 0;
+ 	miEventQueue.tail = newtail;
+     }
+ 
+-- 
+1.6.0.1
+

================================================================
Index: SOURCES/xorg-xserver-server-exa-sync-less.patch
diff -u /dev/null SOURCES/xorg-xserver-server-exa-sync-less.patch:1.1
--- /dev/null	Sun Nov  2 15:48:26 2008
+++ SOURCES/xorg-xserver-server-exa-sync-less.patch	Sun Nov  2 15:48:18 2008
@@ -0,0 +1,42 @@
+From 2188582e5ea90edb432a2f421d0a267439ba08f9 Mon Sep 17 00:00:00 2001
+From: =?utf-8?q?Michel=20D=C3=A4nzer?= <michel at tungstengraphics.com>
+Date: Mon, 20 Oct 2008 09:55:24 -0400
+Subject: [PATCH] EXA: Avoid excessive syncing in PutImage
+
+---
+ exa/exa_migration.c |    6 ++++--
+ 1 files changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/exa/exa_migration.c b/exa/exa_migration.c
+index 56b6945..571650c 100644
+--- a/exa/exa_migration.c
++++ b/exa/exa_migration.c
+@@ -129,6 +129,7 @@ exaCopyDirty(ExaMigrationPtr migrate, RegionPtr pValidDst, RegionPtr pValidSrc,
+     BoxPtr pBox;
+     int nbox;
+     Bool access_prepared = FALSE;
++    Bool need_sync = FALSE;
+ 
+     /* Damaged bits are valid in current copy but invalid in other one */
+     if (exaPixmapIsOffscreen(pPixmap)) {
+@@ -220,14 +221,15 @@ exaCopyDirty(ExaMigrationPtr migrate, RegionPtr pValidDst, RegionPtr pValidSrc,
+ 	    exaMemcpyBox (pPixmap, pBox,
+ 			  fallback_src, fallback_srcpitch,
+ 			  fallback_dst, fallback_dstpitch);
+-	}
++	} else
++	    need_sync = TRUE;
+ 
+ 	pBox++;
+     }
+ 
+     if (access_prepared)
+ 	exaFinishAccess(&pPixmap->drawable, fallback_index);
+-    else
++    else if (need_sync)
+ 	sync (pPixmap->drawable.pScreen);
+ 
+     pExaPixmap->offscreen = save_offscreen;
+-- 
+1.6.0.1
+

================================================================
Index: SOURCES/xorg-xserver-server-edid.patch
diff -u /dev/null SOURCES/xorg-xserver-server-edid.patch:1.1
--- /dev/null	Sun Nov  2 15:48:27 2008
+++ SOURCES/xorg-xserver-server-edid.patch	Sun Nov  2 15:48:18 2008
@@ -0,0 +1,39 @@
+From bd9c6b3a4d726a3f83ac6d8cf7211eddbc28f25a Mon Sep 17 00:00:00 2001
+From: Adam Jackson <ajax at redhat.com>
+Date: Tue, 14 Oct 2008 14:04:01 -0400
+Subject: [PATCH] EDID: Catch even more cases of encoding aspect as size.
+
+Very cute, Samsung, not only do you claim to be 16cm by 9cm in the
+global size record, you also claim to be 160mm by 90mm in the detailed
+timings.  Grrr.
+---
+ hw/xfree86/ddc/interpret_edid.c |   10 +++++++---
+ 1 files changed, 7 insertions(+), 3 deletions(-)
+
+diff --git a/hw/xfree86/ddc/interpret_edid.c b/hw/xfree86/ddc/interpret_edid.c
+index 3596e87..fbb17b1 100644
+--- a/hw/xfree86/ddc/interpret_edid.c
++++ b/hw/xfree86/ddc/interpret_edid.c
+@@ -115,12 +115,16 @@ handle_edid_quirks(xf86MonPtr m)
+ 	    }
+ 	}
+ 
+-	if (real_hsize && real_vsize) {
++	if (!real_hsize || !real_vsize) {
++	    m->features.hsize = m->features.vsize = 0;
++	} else if ((m->features.hsize * 10 == real_hsize) &&
++		   (m->features.vsize * 10 == real_vsize)) {
++	    /* exact match is just unlikely, should do a better check though */
++	    m->features.hsize = m->features.vsize = 0;
++	} else {
+ 	    /* convert mm to cm */
+ 	    m->features.hsize = (real_hsize + 5) / 10;
+ 	    m->features.vsize = (real_vsize + 5) / 10;
+-	} else {
+-	    m->features.hsize = m->features.vsize = 0;
+ 	}
+ 	
+ 	xf86Msg(X_INFO, "Quirked EDID physical size to %dx%d cm\n",
+-- 
+1.6.0.1
+

================================================================
Index: SOURCES/xorg-xserver-server-backtrace.patch
diff -u /dev/null SOURCES/xorg-xserver-server-backtrace.patch:1.1
--- /dev/null	Sun Nov  2 15:48:27 2008
+++ SOURCES/xorg-xserver-server-backtrace.patch	Sun Nov  2 15:48:19 2008
@@ -0,0 +1,36 @@
+From ad677238bc96a8578113bbe76d605d7a87aca44c Mon Sep 17 00:00:00 2001
+From: Adam Jackson <ajax at redhat.com>
+Date: Tue, 14 Oct 2008 13:00:50 -0400
+Subject: [PATCH] Add backtrace definitions to dix-config.h.in
+
+---
+ include/dix-config.h.in |    6 ++++++
+ 1 files changed, 6 insertions(+), 0 deletions(-)
+
+diff --git a/include/dix-config.h.in b/include/dix-config.h.in
+index 26f4b6a..6c3d91c 100644
+--- a/include/dix-config.h.in
++++ b/include/dix-config.h.in
+@@ -75,6 +75,9 @@
+ /* Define to 1 if you have the <asm/mtrr.h> header file. */
+ #undef HAVE_ASM_MTRR_H
+ 
++/* Has backtrace support */
++#undef HAVE_BACKTRACE
++
+ /* Define to 1 if you have the <byteswap.h> header file. */
+ #undef HAVE_BYTESWAP_H
+ 
+@@ -94,6 +97,9 @@
+ /* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */
+ #undef HAVE_DOPRNT
+ 
++/* Have execinfo.h */
++#undef HAVE_EXECINFO_H
++
+ /* Define to 1 if you have the <fcntl.h> header file. */
+ #undef HAVE_FCNTL_H
+ 
+-- 
+1.6.0.1
+
================================================================


More information about the pld-cvs-commit mailing list