xserver: Branch 'no-pci-rework' - 3 commits

Keith Packard keithp at kemper.freedesktop.org
Wed Sep 5 14:19:48 PDT 2007


 configure.ac                   |    9 +++++-
 hw/xfree86/common/xf86Events.c |    4 ++
 hw/xfree86/common/xf86str.h    |    1 
 hw/xfree86/modes/xf86Crtc.c    |   55 +++++++++++++++++------------------------
 hw/xfree86/modes/xf86Crtc.h    |    3 ++
 render/picturestr.h            |    2 -
 6 files changed, 40 insertions(+), 34 deletions(-)

New commits:
diff-tree aa7ed1f5f35cd043bc38d985500aa0a32e857e84 (from 643a263f2cefbb680c3289466a233fccf335baa0)
Author: Keith Packard <keithp at koto.keithp.com>
Date:   Wed Sep 5 14:19:19 2007 -0700

    Deliver correct event when releasing keys on VT switch.
    
    In commit 41bb9fce47f6366cc3f7d45790f7883f74289b5a, the event delivery loop
    for Xinput enabled keyboards was changed and accidentally used the wrong
    index variable, causing random events to be delivered when returning from VT
    switch.
    
    In addition, in commit aeba855b07832354f59678e20cc29a085e42bd99,
    SIGIO was blocked during delivery of these events, but not for the entire
    period the xf86Events array was being used. Block SIGIO for the whole loop
    to avoid other event delivery from trashing the key release events.

diff --git a/hw/xfree86/common/xf86Events.c b/hw/xfree86/common/xf86Events.c
index dd9c34e..91964c9 100644
--- a/hw/xfree86/common/xf86Events.c
+++ b/hw/xfree86/common/xf86Events.c
@@ -811,9 +811,11 @@ xf86ReleaseKeys(DeviceIntPtr pDev)
                     (*pDev->public.processInputProc) (&ke, pDev, 1);
                 }
                 else {
+		    int sigstate = xf86BlockSIGIO ();
                     nevents = GetKeyboardEvents(xf86Events, pDev, KeyRelease, i);
                     for (j = 0; j < nevents; j++)
-                        EqEnqueue(pDev, xf86Events + i);
+                        mieqEnqueue(pDev, xf86Events + j);
+		    xf86UnblockSIGIO(sigstate);
                 }
                 break;
             }
diff-tree 643a263f2cefbb680c3289466a233fccf335baa0 (from 19256f60564496de7064366d3acf079221679fb5)
Author: Keith Packard <keithp at koto.keithp.com>
Date:   Wed Sep 5 14:14:12 2007 -0700

    Bug #7364: Require renderproto 0.9.3 on 64-bit, and fix build with it.
    (cherry picked from commit 07630d897ef37cad8b79d073d9edc891d5a7bddd)

diff --git a/configure.ac b/configure.ac
index fae439c..2d129b2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -629,7 +629,14 @@ PKG_CHECK_MODULES(PIXMAN, $PIXMAN)
 AC_SUBST(PIXMAN_CFLAGS)
 
 dnl Core modules for most extensions, et al.
-REQUIRED_MODULES="[randrproto >= 1.2] renderproto [fixesproto >= 4.0] [damageproto >= 1.1] xcmiscproto xextproto [xproto >= 7.0.9] xtrans [scrnsaverproto >= 1.1] bigreqsproto resourceproto fontsproto [inputproto >= 1.4.2] [kbproto >= 1.0.3]"
+# Require updated renderproto for ABI sanity if we're 64-bit.
+if test "$ac_cv_sizeof_unsigned_long" = 8; then
+	RENDERPROTO="[renderproto >= 0.9.3]"
+else
+	RENDERPROTO="renderproto"
+fi
+
+REQUIRED_MODULES="[randrproto >= 1.2] $RENDERPROTO [fixesproto >= 4.0] [damageproto >= 1.1] xcmiscproto xextproto [xproto >= 7.0.9] xtrans [scrnsaverproto >= 1.1] bigreqsproto resourceproto fontsproto [inputproto >= 1.4.2] [kbproto >= 1.0.3]"
 REQUIRED_LIBS="xfont xau fontenc $PIXMAN"
 
 dnl HAVE_DBUS is true if we actually have the D-Bus library, whereas
diff --git a/render/picturestr.h b/render/picturestr.h
index 005c588..09a7131 100644
--- a/render/picturestr.h
+++ b/render/picturestr.h
@@ -24,8 +24,8 @@
 #ifndef _PICTURESTR_H_
 #define _PICTURESTR_H_
 
-#include "glyphstr.h"
 #include "scrnintstr.h"
+#include "glyphstr.h"
 #include "resource.h"
 
 typedef struct _DirectFormat {
diff-tree 19256f60564496de7064366d3acf079221679fb5 (from 319971813cdb977f1dff0fe7219b817445ee47fc)
Author: Keith Packard <keithp at koto.keithp.com>
Date:   Fri Aug 31 11:52:59 2007 -0700

    Make user-specified mode preferences override EDID/BIOS preferences.
    
    When the user adds a 'PreferredMode' option to the config file, have that
    take precedence over any EDID or BIOS detected preferred mode. In
    addition, a user-specified PreferredMode will be used as the controlling
    mode for the overall server configuration.

diff --git a/hw/xfree86/common/xf86str.h b/hw/xfree86/common/xf86str.h
index 086d2bf..31b6343 100644
--- a/hw/xfree86/common/xf86str.h
+++ b/hw/xfree86/common/xf86str.h
@@ -132,6 +132,7 @@ typedef enum {
 # define M_T_DEFAULT 0x10	/* (VESA) default modes */
 # define M_T_USERDEF 0x20	/* One of the modes from the config file */
 # define M_T_DRIVER  0x40	/* Supplied by the driver (EDID, etc) */
+# define M_T_USERPREF 0x80	/* mode preferred by the user config */
 
 /* Video mode */
 typedef struct _DisplayModeRec {
diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index d375da8..7196a2e 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -711,7 +711,8 @@ xf86DefaultMode (xf86OutputPtr output, i
     for (mode = output->probed_modes; mode; mode = mode->next)
     {
 	int	    dpi;
-	int	    preferred = (mode->type & M_T_PREFERRED) != 0;
+	int	    preferred = (((mode->type & M_T_PREFERRED) != 0) +
+				 ((mode->type & M_T_USERPREF) != 0));
 	int	    diff;
 
 	if (xf86ModeWidth (mode, output->initial_rotation) > width ||
@@ -1415,7 +1416,7 @@ xf86ProbeOutputModes (ScrnInfoPtr scrn, 
 			mode->prev = NULL;
 			output->probed_modes = mode;
 		    }
-		    mode->type |= M_T_PREFERRED;
+		    mode->type |= (M_T_PREFERRED|M_T_USERPREF);
 		}
 		else
 		    mode->type &= ~M_T_PREFERRED;
@@ -1532,6 +1533,7 @@ xf86InitialConfiguration (ScrnInfoPtr sc
     xf86CrtcConfigPtr	config = XF86_CRTC_CONFIG_PTR(scrn);
     int			o, c;
     DisplayModePtr	target_mode = NULL;
+    int			target_preferred = 0;
     Rotation		target_rotation = RR_Rotate_0;
     xf86CrtcPtr		*crtcs;
     DisplayModePtr	*modes;
@@ -1572,43 +1574,34 @@ xf86InitialConfiguration (ScrnInfoPtr sc
     }
     
     /*
-     * Let outputs with preferred modes drive screen size
+     * User preferred > preferred > other modes
      */
     for (o = 0; o < config->num_output; o++)
     {
-	xf86OutputPtr output = config->output[o];
+	xf86OutputPtr	output = config->output[o];
+	DisplayModePtr	default_mode;
+	int		default_preferred;
 
-	if (enabled[o] &&
-	    xf86OutputHasPreferredMode (output, width, height))
+	if (!enabled[o])
+	    continue;
+	default_mode = xf86DefaultMode (output, width, height);
+	if (!default_mode)
+	    continue;
+	default_preferred = (((default_mode->type & M_T_PREFERRED) != 0) +
+			     ((default_mode->type & M_T_USERPREF) != 0));
+	if (default_preferred > target_preferred || !target_mode)
 	{
-	    target_mode = xf86DefaultMode (output, width, height);
+	    target_mode = default_mode;
+	    target_preferred = default_preferred;
 	    target_rotation = output->initial_rotation;
-	    if (target_mode)
-	    {
-		modes[o] = target_mode;
-		config->compat_output = o;
-		break;
-	    }
-	}
-    }
-    if (!target_mode)
-    {
-	for (o = 0; o < config->num_output; o++)
-	{
-	    xf86OutputPtr output = config->output[o];
-	    if (enabled[o])
-	    {
-		target_mode = xf86DefaultMode (output, width, height);
-		target_rotation = output->initial_rotation;
-		if (target_mode)
-		{
-		    modes[o] = target_mode;
-		    config->compat_output = o;
-		    break;
-		}
-	    }
+	    config->compat_output = o;
 	}
     }
+    if (target_mode)
+	modes[config->compat_output] = target_mode;
+    /*
+     * Fill in other output modes
+     */
     for (o = 0; o < config->num_output; o++)
     {
 	xf86OutputPtr output = config->output[o];
diff --git a/hw/xfree86/modes/xf86Crtc.h b/hw/xfree86/modes/xf86Crtc.h
index 9693e12..4c843cd 100644
--- a/hw/xfree86/modes/xf86Crtc.h
+++ b/hw/xfree86/modes/xf86Crtc.h
@@ -39,6 +39,9 @@
 #ifndef M_T_DRIVER
 #define M_T_DRIVER	0x40
 #endif
+#ifndef M_T_USERPREF
+#define M_T_USERPREF	0x80
+#endif
 #ifndef HARDWARE_CURSOR_ARGB
 #define HARDWARE_CURSOR_ARGB				0x00004000
 #endif


More information about the xorg-commit mailing list