[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

xorg-server: Changes to 'upstream-experimental'



 Xi/exevents.c                        |    2 
 configure.ac                         |    6 -
 dix/getevents.c                      |    5 -
 dix/main.c                           |    3 
 exa/exa.c                            |   14 +--
 glx/glxcmds.c                        |   19 ++--
 glx/glxext.c                         |    9 ++
 hw/kdrive/ephyr/Makefile.am          |    2 
 hw/kdrive/ephyr/XF86dri.c            |   10 ++
 hw/kdrive/ephyr/ephyrhostglx.c       |   11 ++
 hw/kdrive/ephyr/ephyrhostvideo.c     |   10 ++
 hw/kdrive/ephyr/hostx.c              |   12 ++
 hw/kdrive/fake/Makefile.am           |    2 
 hw/kdrive/fbdev/Makefile.am          |    2 
 hw/kdrive/sdl/Makefile.am            |    2 
 hw/kdrive/src/kinput.c               |   16 ++-
 hw/kdrive/vesa/Makefile.am           |    2 
 hw/vfb/Makefile.am                   |    1 
 hw/xfree86/common/xf86AutoConfig.c   |  141 +++++++++++++++++------------------
 hw/xfree86/common/xf86Config.c       |   14 +--
 hw/xfree86/common/xf86Helper.c       |   14 ++-
 hw/xfree86/common/xf86Init.c         |   60 +++++++-------
 hw/xfree86/common/xf86RandR.c        |   21 +++++
 hw/xfree86/common/xf86Xinput.c       |   18 +++-
 hw/xfree86/doc/man/xorg.conf.man.pre |    3 
 hw/xfree86/modes/xf86Crtc.c          |   59 +++++++++++++-
 hw/xfree86/modes/xf86Cursors.c       |   10 +-
 include/Makefile.am                  |    3 
 include/inputstr.h                   |    2 
 render/filter.c                      |    2 
 xkb/xkbAccessX.c                     |    4 
 31 files changed, 323 insertions(+), 156 deletions(-)

New commits:
commit c0c73e9236cffece7c8049515b03facb41f12f0e
Author: Adam Jackson <ajax@redhat.com>
Date:   Wed Jul 23 14:16:47 2008 -0400

    xserver 1.4.99.906
    
    You know, Mesa 7.1 could release any day now and that'd be just fine.

diff --git a/configure.ac b/configure.ac
index a9b1651..2a8ef8d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,7 +26,8 @@ dnl
 dnl Process this file with autoconf to create configure.
 
 AC_PREREQ(2.57)
-AC_INIT([xorg-server], 1.4.99.905, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
+RELEASE_DATE="23 July 2008"
+AC_INIT([xorg-server], 1.4.99.906, [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
@@ -418,7 +419,6 @@ VENDOR_MAN_VERSION="Version ${PACKAGE_VERSION}"
 
 VENDOR_NAME="The X.Org Foundation"
 VENDOR_NAME_SHORT="X.Org"
-RELEASE_DATE="5 September 2007"
 VENDOR_WEB="http://wiki.x.org";
 
 m4_ifdef([AS_HELP_STRING], , [m4_define([AS_HELP_STRING], m4_defn([AC_HELP_STRING]))])

commit e909a396194e64119d04fc6ecb68ddc4265a3e49
Author: Pierre-Loup A. Griffais <pgriffais@nvidia.com>
Date:   Tue Jul 22 17:34:37 2008 -0700

    Don't return BadAlloc when trying to set a PictureFilter with no parameters when a filter with parameters was previously set.
    
    Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
    (cherry picked from commit bc3c03a3f3c091026310f0e8d55321cec570a0c5)

diff --git a/render/filter.c b/render/filter.c
index 092313f..aa3eb1a 100644
--- a/render/filter.c
+++ b/render/filter.c
@@ -301,7 +301,7 @@ SetPictureFilter (PicturePtr pPicture, char *name, int len, xFixed *params, int
     if (nparams != pPicture->filter_nparams)
     {
 	new_params = xalloc (nparams * sizeof (xFixed));
-	if (!new_params)
+	if (!new_params && nparams)
 	    return BadAlloc;
 	xfree (pPicture->filter_params);
 	pPicture->filter_params = new_params;

commit c217cb96dccb39ffd689086b6d833a1963dfb661
Author: Dodji Seketeli <dodji@seketeli.org>
Date:   Wed Jul 23 01:00:26 2008 +0200

    [Xephyr] Fix #15839
    
    Make sure the _XSERVER64 macro is not defined in Xlib client code.
    That macro is meant to be define only on pure server code, when necessary.
    (cherry picked from commit 5de1867fbb0a336ff3fdc92cbf734849f6111b1b)

diff --git a/hw/kdrive/ephyr/XF86dri.c b/hw/kdrive/ephyr/XF86dri.c
index e656ff5..63e630c 100644
--- a/hw/kdrive/ephyr/XF86dri.c
+++ b/hw/kdrive/ephyr/XF86dri.c
@@ -45,6 +45,16 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #ifdef HAVE_CONFIG_H
 #include <kdrive-config.h>
 #endif
+/*
+ * including some server headers (like kdrive-config.h)
+ * might define the macro _XSERVER64
+ * on 64 bits machines. That macro must _NOT_ be defined for Xlib
+ * client code, otherwise bad things happen.
+ * So let's undef that macro if necessary.
+ */
+#ifdef _XSERVER64
+#undef _XSERVER64
+#endif
 
 #ifdef XEPHYR_DRI
 
diff --git a/hw/kdrive/ephyr/ephyrhostglx.c b/hw/kdrive/ephyr/ephyrhostglx.c
index f5db5be..1eec4e0 100644
--- a/hw/kdrive/ephyr/ephyrhostglx.c
+++ b/hw/kdrive/ephyr/ephyrhostglx.c
@@ -31,6 +31,17 @@
 #include <kdrive-config.h>
 #endif
 
+/*
+ * including some server headers (like kdrive-config.h)
+ * might define the macro _XSERVER64
+ * on 64 bits machines. That macro must _NOT_ be defined for Xlib
+ * client code, otherwise bad things happen.
+ * So let's undef that macro if necessary.
+ */
+#ifdef _XSERVER64
+#undef _XSERVER64
+#endif
+
 #include <X11/Xlibint.h>
 #include <GL/glx.h>
 #include <GL/internal/glcore.h>
diff --git a/hw/kdrive/ephyr/ephyrhostvideo.c b/hw/kdrive/ephyr/ephyrhostvideo.c
index 562c2a4..41c0b75 100644
--- a/hw/kdrive/ephyr/ephyrhostvideo.c
+++ b/hw/kdrive/ephyr/ephyrhostvideo.c
@@ -28,6 +28,16 @@
 #ifdef HAVE_CONFIG_H
 #include <kdrive-config.h>
 #endif
+/*
+ * including some server headers (like kdrive-config.h)
+ * might define the macro _XSERVER64
+ * on 64 bits machines. That macro must _NOT_ be defined for Xlib
+ * client code, otherwise bad things happen.
+ * So let's undef that macro if necessary.
+ */
+#ifdef _XSERVER64
+#undef _XSERVER64
+#endif
 #include <X11/Xutil.h>
 #include <X11/Xlibint.h>
 #include <X11/extensions/Xvlib.h>
diff --git a/hw/kdrive/ephyr/hostx.c b/hw/kdrive/ephyr/hostx.c
index 1a71d06..c870a29 100644
--- a/hw/kdrive/ephyr/hostx.c
+++ b/hw/kdrive/ephyr/hostx.c
@@ -27,6 +27,18 @@
 #include <kdrive-config.h>
 #endif
 
+/*
+ * including some server headers (like kdrive-config.h)
+ * might define the macro _XSERVER64
+ * on 64 bits machines. That macro must _NOT_ be defined for Xlib
+ * client code, otherwise bad things happen.
+ * So let's undef that macro if necessary.
+ */
+#ifdef _XSERVER64
+#undef _XSERVER64
+#endif
+
+
 #include "hostx.h"
 
 #include <stdlib.h>

commit 14a033f0321b3869f0cbedd344bc0f71738fd052
Author: Roland Scheidegger <sroland@tungstengraphics.com>
Date:   Tue Jun 10 15:40:48 2008 +0200

    glx: copy msaa visual capabilities
    (cherry picked from commit 49751fee3b82ebc4917bfb168ec78aad7874f1f1)

diff --git a/glx/glxcmds.c b/glx/glxcmds.c
index 0c2a95e..0831135 100644
--- a/glx/glxcmds.c
+++ b/glx/glxcmds.c
@@ -943,11 +943,11 @@ int __glXDisp_GetVisualConfigs(__GLXclientState *cl, GLbyte *pc)
 	buf[p++] = modes->transparentAlpha;
 	buf[p++] = GLX_TRANSPARENT_INDEX_VALUE;
 	buf[p++] = modes->transparentIndex;
-	buf[p++] = 0;
-	buf[p++] = 0;
-	buf[p++] = 0;
-	buf[p++] = 0;
-	buf[p++] = 0;
+	buf[p++] = GLX_SAMPLES_SGIS;
+	buf[p++] = modes->samples;
+	buf[p++] = GLX_SAMPLE_BUFFERS_SGIS;
+	buf[p++] = modes->sampleBuffers;
+	buf[p++] = 0; /* copy over visualSelectGroup (GLX_VISUAL_SELECT_GROUP_SGIX)? */
 	buf[p++] = 0;
 
 	if (client->swapped) {
@@ -959,7 +959,7 @@ int __glXDisp_GetVisualConfigs(__GLXclientState *cl, GLbyte *pc)
     return Success;
 }
 
-#define __GLX_TOTAL_FBCONFIG_ATTRIBS (33)
+#define __GLX_TOTAL_FBCONFIG_ATTRIBS (35)
 #define __GLX_FBCONFIG_ATTRIBS_LENGTH (__GLX_TOTAL_FBCONFIG_ATTRIBS * 2)
 /**
  * Send the set of GLXFBConfigs to the client.  There is not currently
@@ -1037,6 +1037,9 @@ DoGetFBConfigs(__GLXclientState *cl, unsigned screen)
 	WRITE_PAIR( GLX_TRANSPARENT_ALPHA_VALUE, modes->transparentAlpha );
 	WRITE_PAIR( GLX_TRANSPARENT_INDEX_VALUE, modes->transparentIndex );
 	WRITE_PAIR( GLX_SWAP_METHOD_OML, modes->swapMethod );
+	WRITE_PAIR( GLX_SAMPLES_SGIS, modes->samples );
+	WRITE_PAIR( GLX_SAMPLE_BUFFERS_SGIS, modes->sampleBuffers );
+	/* GLX_VISUAL_SELECT_GROUP_SGIX ? */
 	WRITE_PAIR( GLX_DRAWABLE_TYPE, modes->drawableType );
 	WRITE_PAIR( GLX_BIND_TO_TEXTURE_RGB_EXT, modes->bindToTextureRgb );
 	WRITE_PAIR( GLX_BIND_TO_TEXTURE_RGBA_EXT, modes->bindToTextureRgba );

commit ff1a9b7fea2cfe00bc02a99b919fa1178d4f0b12
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Wed Jul 23 16:53:59 2008 +0930

    xkb: don't send core events for extension devices on SlowKey timeout.
    
    RedHat Bug 448604 <https://bugzilla.redhat.com/show_bug.cgi?id=448604>

diff --git a/xkb/xkbAccessX.c b/xkb/xkbAccessX.c
index 75b8c5a..89be839 100644
--- a/xkb/xkbAccessX.c
+++ b/xkb/xkbAccessX.c
@@ -352,7 +352,9 @@ XkbControlsPtr	ctrls;
 	XkbSendAccessXNotify(keybd,&ev);
 	if (XkbAX_NeedFeedback(ctrls,XkbAX_SKAcceptFBMask))
 	    XkbDDXAccessXBeep(keybd,_BEEP_SLOW_ACCEPT,XkbSlowKeysMask);
-	AccessXKeyboardEvent(keybd,KeyPress,xkbi->slowKey,False);
+	AccessXKeyboardEvent(keybd,
+                (keybd == inputInfo.keyboard) ?  KeyPress : DeviceKeyPress,
+                xkbi->slowKey,False);
 	/* check for magic sequences */
 	if ((ctrls->enabled_ctrls&XkbAccessXKeysMask) &&
 	    ((sym[0]==XK_Shift_R)||(sym[0]==XK_Shift_L)))

commit 2d6022bd4001190df97b5320dccb306a78d7ca21
Author: Kristian Høgsberg <krh@redhat.com>
Date:   Mon Jul 21 16:05:53 2008 -0400

    Need to unref pixmaps backing pbuffers too.
    (cherry picked from commit facb255fa9267e343cbc91f841f1b64e5dc99e98)

diff --git a/glx/glxext.c b/glx/glxext.c
index cd92f6d..13c65da 100644
--- a/glx/glxext.c
+++ b/glx/glxext.c
@@ -109,8 +109,12 @@ static Bool DrawableGone(__GLXdrawable *glxPriv, XID xid)
 {
     ScreenPtr pScreen = glxPriv->pDraw->pScreen;
 
-    if (glxPriv->type == GLX_DRAWABLE_PIXMAP)
+    switch (glxPriv->type) {
+	case GLX_DRAWABLE_PIXMAP:
+	case GLX_DRAWABLE_PBUFFER:
 	    (*pScreen->DestroyPixmap)((PixmapPtr) glxPriv->pDraw);
+	    break;
+    }
 
     glxPriv->pDraw = NULL;
     glxPriv->drawId = 0;

commit e4cfdc07f4ef2e42762f0296936bbe776b4b7fbe
Author: Kristian Høgsberg <krh@redhat.com>
Date:   Mon Jul 21 15:28:50 2008 -0400

    Fix embarrasing GLXPixmap leak.
    (cherry picked from commit d5ae85b5b722821499d5796cf0973ecb6ec125f1)

diff --git a/glx/glxcmds.c b/glx/glxcmds.c
index dcd8352..0c2a95e 100644
--- a/glx/glxcmds.c
+++ b/glx/glxcmds.c
@@ -1223,10 +1223,6 @@ static int DoDestroyDrawable(__GLXclientState *cl, XID glxdrawable, int type)
 	}
     }
 
-    if (type == GLX_DRAWABLE_PIXMAP) {
-	((PixmapPtr) pGlxDraw->pDraw)->refcnt--;
-    }
-
     FreeResource(glxdrawable, FALSE);
 
     return Success;
diff --git a/glx/glxext.c b/glx/glxext.c
index 85d8deb..cd92f6d 100644
--- a/glx/glxext.c
+++ b/glx/glxext.c
@@ -107,6 +107,11 @@ static int ContextGone(__GLXcontext* cx, XID id)
 */
 static Bool DrawableGone(__GLXdrawable *glxPriv, XID xid)
 {
+    ScreenPtr pScreen = glxPriv->pDraw->pScreen;
+
+    if (glxPriv->type == GLX_DRAWABLE_PIXMAP)
+	    (*pScreen->DestroyPixmap)((PixmapPtr) glxPriv->pDraw);
+
     glxPriv->pDraw = NULL;
     glxPriv->drawId = 0;
     __glXUnrefDrawable(glxPriv);

commit ceffece78b828c30a144affa437cd5ae2021a342
Author: Eamon Walsh <ewalsh@tycho.nsa.gov>
Date:   Fri Jun 20 23:49:32 2008 -0400

    Fix "warning: passing argument 1 of `modeIsPresent' from incompatible pointer type".
    (cherry picked from commit 95d4ede538fbb68049ba3efa0acb0e9712e5cb01)

diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index 8e30c84..fde3a9c 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -2418,14 +2418,14 @@ configInput(IDevPtr inputp, XF86ConfInputPtr conf_input, MessageType from)
 }
 
 static Bool
-modeIsPresent(char * modename,MonPtr monitorp)
+modeIsPresent(DisplayModePtr mode, MonPtr monitorp)
 {
     DisplayModePtr knownmodes = monitorp->Modes;
 
     /* all I can think of is a linear search... */
     while(knownmodes != NULL)
     {
-	if(!strcmp(modename,knownmodes->name) &&
+	if(!strcmp(mode->name, knownmodes->name) &&
 	   !(knownmodes->type & M_T_DEFAULT))
 	    return TRUE;
 	knownmodes = knownmodes->next;

commit 7f542ab37fe0795fa04ea647b0ff3b9b886758f6
Author: Dave Airlie <airlied@redhat.com>
Date:   Fri Jul 4 07:29:32 2008 +1000

    modes: fix initial xorg.conf mode selection.
    
    This was all kinds of broken, we ignored user preferred modes for multiple
    monitors and also for side-by-side configurations.
    (cherry picked from commit 0b9ef835a0fe900c121b84e43989591e58ab1126)

diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index ea452df..91ba1b7 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -997,6 +997,54 @@ xf86DefaultScreenLimits (ScrnInfoPtr scrn, int *widthp, int *heightp,
 
 #define POSITION_UNSET	-100000
 
+/*
+ * check if the user configured any outputs at all 
+ * with either a position or a relative setting or a mode.
+ */
+static Bool
+xf86UserConfiguredOutputs(ScrnInfoPtr scrn, DisplayModePtr *modes)
+{
+    xf86CrtcConfigPtr	config = XF86_CRTC_CONFIG_PTR(scrn);
+    int o;
+    Bool user_conf = FALSE;
+
+    for (o = 0; o < config->num_output; o++)
+    {
+	xf86OutputPtr output = config->output[o];
+	char	    *position;
+	char	    *relative_name;
+	OutputOpts	    relation;
+	int r;
+	static const OutputOpts	relations[] = {
+	    OPTION_BELOW, OPTION_RIGHT_OF, OPTION_ABOVE, OPTION_LEFT_OF
+	};
+
+	position = xf86GetOptValString (output->options,
+					OPTION_POSITION);
+	if (position)
+	    user_conf = TRUE;
+
+	relation = 0;
+	relative_name = NULL;
+	for (r = 0; r < 4; r++)
+	{
+	    relation = relations[r];
+	    relative_name = xf86GetOptValString (output->options,
+						     relation);
+	    if (relative_name)
+		break;
+	}
+	if (relative_name)
+	    user_conf = TRUE;
+
+	modes[o] = xf86OutputHasUserPreferredMode(output);
+	if (modes[o])
+	    user_conf = TRUE;
+    }
+
+    return user_conf;
+}
+
 static Bool
 xf86InitialOutputPositions (ScrnInfoPtr scrn, DisplayModePtr *modes)
 {
@@ -1984,6 +2032,9 @@ xf86TargetUserpref(ScrnInfoPtr scrn, xf86CrtcConfigPtr config,
 {
     int o;
 
+    if (xf86UserConfiguredOutputs(scrn, modes))
+	return xf86TargetFallback(scrn, config, modes, enabled, width, height);
+    
     for (o = -1; nextEnabledOutput(config, enabled, &o); )
 	if (xf86OutputHasUserPreferredMode(config->output[o]))
 	    return 

commit 0baf677da6a724c2d8de46530622e1a186fa749e
Author: Peter Hutterer <peter@cs.unisa.edu.au>
Date:   Mon Jun 2 11:04:41 2008 +0930

    kdrive: don't post motion event if there was no motion. #16179
    
    Based on the patch by Tomas Janousek. Backported version.
    
    X.Org Bug 16179 <http://bugs.freedesktop.org/show_bug.cgi?id=16179>
    (cherry picked from commit 26e7e69ab893d1f2b35213250ada40ec90944f62)

diff --git a/hw/kdrive/src/kinput.c b/hw/kdrive/src/kinput.c
index df73942..80fcdde 100644
--- a/hw/kdrive/src/kinput.c
+++ b/hw/kdrive/src/kinput.c
@@ -2078,7 +2078,7 @@ KdEnqueuePointerEvent(KdPointerInfo *pi, unsigned long flags, int rx, int ry,
     int           (*matrix)[3] = kdPointerMatrix.matrix;
     unsigned long button;
     int           n;
-    int           dixflags;
+    int           dixflags = 0;
 
     if (!pi)
 	return;
@@ -2109,11 +2109,15 @@ KdEnqueuePointerEvent(KdPointerInfo *pi, unsigned long flags, int rx, int ry,
     z = rz;
 
     if (flags & KD_MOUSE_DELTA)
-        dixflags = POINTER_RELATIVE & POINTER_ACCELERATE;
-    else
-        dixflags = POINTER_ABSOLUTE;
-
-    _KdEnqueuePointerEvent(pi, MotionNotify, x, y, z, 0, dixflags, FALSE);
+    {
+        if (x || y || z)
+            dixflags = POINTER_RELATIVE | POINTER_ACCELERATE;
+    } else if ((pi->dixdev->valuator) && (x != pi->dixdev->valuator->lastx ||
+                                          y != pi->dixdev->valuator->lasty))
+            dixflags = POINTER_ABSOLUTE;
+
+    if (dixflags)
+        _KdEnqueuePointerEvent(pi, MotionNotify, x, y, z, 0, dixflags, FALSE);
 
     buttons = flags;
 

commit a75cbabc25d67b6e03a0f8e5be82ae5ac3887096
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Thu Jul 17 08:40:54 2008 +0930

    Revert "kdrive: don't post motion event if there was no motion. #16179"
    
    Just because it compiles on my machine doesn't make it right. Needs backported
    patch from http://bugs.freedesktop.org/show_bug.cgi?id=16179.
    
    This reverts commit a08ea64ded83f3781df769eec074d563b03a718f.

diff --git a/hw/kdrive/src/kinput.c b/hw/kdrive/src/kinput.c
index a7eae3f..df73942 100644
--- a/hw/kdrive/src/kinput.c
+++ b/hw/kdrive/src/kinput.c
@@ -2078,7 +2078,7 @@ KdEnqueuePointerEvent(KdPointerInfo *pi, unsigned long flags, int rx, int ry,
     int           (*matrix)[3] = kdPointerMatrix.matrix;
     unsigned long button;
     int           n;
-    int           dixflags = 0;
+    int           dixflags;
 
     if (!pi)
 	return;
@@ -2109,15 +2109,11 @@ KdEnqueuePointerEvent(KdPointerInfo *pi, unsigned long flags, int rx, int ry,
     z = rz;
 
     if (flags & KD_MOUSE_DELTA)
-    {
-        if (x || y || z)
-            dixflags = POINTER_RELATIVE & POINTER_ACCELERATE;
-    } else if (x != pi->dixdev->last.valuators[0] ||
-                y != pi->dixdev->last.valuators[1])
-            dixflags = POINTER_ABSOLUTE;
-
-    if (dixflags)
-        _KdEnqueuePointerEvent(pi, MotionNotify, x, y, z, 0, dixflags, FALSE);
+        dixflags = POINTER_RELATIVE & POINTER_ACCELERATE;
+    else
+        dixflags = POINTER_ABSOLUTE;
+
+    _KdEnqueuePointerEvent(pi, MotionNotify, x, y, z, 0, dixflags, FALSE);
 
     buttons = flags;
 

commit a08ea64ded83f3781df769eec074d563b03a718f
Author: Peter Hutterer <peter@cs.unisa.edu.au>
Date:   Mon Jun 2 11:04:41 2008 +0930

    kdrive: don't post motion event if there was no motion. #16179
    
    Based on the patch by Tomas Janousek.
    
    X.Org Bug 16179 <http://bugs.freedesktop.org/show_bug.cgi?id=16179>
    (cherry picked from commit 26e7e69ab893d1f2b35213250ada40ec90944f62)

diff --git a/hw/kdrive/src/kinput.c b/hw/kdrive/src/kinput.c
index df73942..a7eae3f 100644
--- a/hw/kdrive/src/kinput.c
+++ b/hw/kdrive/src/kinput.c
@@ -2078,7 +2078,7 @@ KdEnqueuePointerEvent(KdPointerInfo *pi, unsigned long flags, int rx, int ry,
     int           (*matrix)[3] = kdPointerMatrix.matrix;
     unsigned long button;
     int           n;
-    int           dixflags;
+    int           dixflags = 0;
 
     if (!pi)
 	return;
@@ -2109,11 +2109,15 @@ KdEnqueuePointerEvent(KdPointerInfo *pi, unsigned long flags, int rx, int ry,
     z = rz;
 
     if (flags & KD_MOUSE_DELTA)
-        dixflags = POINTER_RELATIVE & POINTER_ACCELERATE;
-    else
-        dixflags = POINTER_ABSOLUTE;
-
-    _KdEnqueuePointerEvent(pi, MotionNotify, x, y, z, 0, dixflags, FALSE);
+    {
+        if (x || y || z)
+            dixflags = POINTER_RELATIVE & POINTER_ACCELERATE;
+    } else if (x != pi->dixdev->last.valuators[0] ||
+                y != pi->dixdev->last.valuators[1])
+            dixflags = POINTER_ABSOLUTE;
+
+    if (dixflags)
+        _KdEnqueuePointerEvent(pi, MotionNotify, x, y, z, 0, dixflags, FALSE);
 
     buttons = flags;
 

commit 45f274415d8f7dfc18f395783cd7c5dbd4a43c4f
Author: Peter Hutterer <peter@cs.unisa.edu.au>
Date:   Thu Apr 24 13:30:28 2008 +0930

    Xi: don't attempt to send to a NULL window.
    
    Only applicable when the server comes down/restarts. In this case,
    WindowTable[i] may be NULL. Let's not try to send an event then.
    (cherry picked from commit f377141912594f87144d6d7f7fdd279a101d8e6c)

diff --git a/Xi/exevents.c b/Xi/exevents.c
index c03f796..0b312f5 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -1284,6 +1284,8 @@ SendEventToAllWindows(DeviceIntPtr dev, Mask mask, xEvent * ev, int count)
 
     for (i = 0; i < screenInfo.numScreens; i++) {
         pWin = WindowTable[i];
+        if (!pWin)
+            continue;
         (void)DeliverEventsToWindow(pWin, ev, count, mask, NullGrab, dev->id);
         p1 = pWin->firstChild;
         FindInterestedChildren(dev, p1, mask, ev, count);

commit 476de585bee851ea592af043652aa7525bc8d3ce
Author: Peter Hutterer <peter@cs.unisa.edu.au>
Date:   Thu Apr 24 13:29:46 2008 +0930

    dix: NULL out WindowTable after freeing all the windows.
    
    CloseDownDevices() tries to send PresenceNotify events. If the windows are
    already freed, then we are accessing dangling pointers.
    (cherry picked from commit aec485f2dcc87b340759d67b60e7dee7931aaec5)

diff --git a/dix/main.c b/dix/main.c
index db43473..6d9dd33 100644
--- a/dix/main.c
+++ b/dix/main.c
@@ -458,7 +458,10 @@ main(int argc, char *argv[], char *envp[])
 #endif
 
         config_fini();
+
+        memset(WindowTable, 0, MAXSCREENS * sizeof(WindowPtr));
 	CloseDownDevices();
+
 	for (i = screenInfo.numScreens - 1; i >= 0; i--)
 	{
 	    FreeScratchPixmapsForScreen(i);

commit 5cb38a3fcabb1b46fc24584f5e42d28a9a2dc703
Author: Peter Hutterer <peter@cs.unisa.edu.au>
Date:   Wed Apr 23 11:38:08 2008 +0930

    xfree86: don't free the config-file related information in DIDR. #15645
    
    In DeleteInputDeviceRequest, leave the conf_idev (which is shared with
    xf86ConfigLayout.input) alone for devices that were specified in the
    ServerLayout section of the config file. This way, in the next server
    generation we are left with what was the original config and can thus re-init
    the devices.
    
    This is an addon to 6d22a9615a0e6ab3d00b0bcb22ff001b6ece02ae, an attempt to
    fix Bug 14418.
    
    X.Org Bug 15645 <https://bugs.freedesktop.org/show_bug.cgi?id=15645>
    X.Org Bug 14418 <https://bugs.freedesktop.org/show_bug.cgi?id=15645>
    (cherry picked from commit 9ab4e2fd8eaa87dbd16835affb1aa54dcb1a619e)

diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
index 6d5eaad..68dc387 100644
--- a/hw/xfree86/common/xf86Init.c
+++ b/hw/xfree86/common/xf86Init.c
@@ -1123,37 +1123,35 @@ InitInput(argc, argv)
     xf86Info.vtRequestsPending = FALSE;
     xf86Info.inputPending = FALSE;
 
-    if (serverGeneration == 1) {
-	/* Call the PreInit function for each input device instance. */
-	for (pDev = xf86ConfigLayout.inputs; pDev && *pDev; pDev++) {
-	    /* Replace obsolete keyboard driver with kbd */
-	    if (!xf86NameCmp((*pDev)->driver, "keyboard")) {
-		strcpy((*pDev)->driver, "kbd");
-            }
-
-	    if ((pDrv = xf86LookupInputDriver((*pDev)->driver)) == NULL) {
-		xf86Msg(X_ERROR, "No Input driver matching `%s'\n", (*pDev)->driver);
-		/* XXX For now, just continue. */
-		continue;
-	    }
-	    if (!pDrv->PreInit) {
-		xf86MsgVerb(X_WARNING, 0,
-		    "Input driver `%s' has no PreInit function (ignoring)\n",
-		    pDrv->driverName);
-		continue;
-	    }
-	    pInfo = pDrv->PreInit(pDrv, *pDev, 0);
-	    if (!pInfo) {
-		xf86Msg(X_ERROR, "PreInit returned NULL for \"%s\"\n",
-			(*pDev)->identifier);
-		continue;
-	    } else if (!(pInfo->flags & XI86_CONFIGURED)) {
-		xf86Msg(X_ERROR, "PreInit failed for input device \"%s\"\n",
-			(*pDev)->identifier);
-		xf86DeleteInput(pInfo, 0);
-		continue;
-	    }
-	}
+    /* Call the PreInit function for each input device instance. */
+    for (pDev = xf86ConfigLayout.inputs; pDev && *pDev; pDev++) {
+        /* Replace obsolete keyboard driver with kbd */
+        if (!xf86NameCmp((*pDev)->driver, "keyboard")) {
+            strcpy((*pDev)->driver, "kbd");
+        }
+
+        if ((pDrv = xf86LookupInputDriver((*pDev)->driver)) == NULL) {
+            xf86Msg(X_ERROR, "No Input driver matching `%s'\n", (*pDev)->driver);
+            /* XXX For now, just continue. */
+            continue;
+        }
+        if (!pDrv->PreInit) {
+            xf86MsgVerb(X_WARNING, 0,
+                    "Input driver `%s' has no PreInit function (ignoring)\n",
+                    pDrv->driverName);
+            continue;
+        }
+        pInfo = pDrv->PreInit(pDrv, *pDev, 0);
+        if (!pInfo) {
+            xf86Msg(X_ERROR, "PreInit returned NULL for \"%s\"\n",
+                    (*pDev)->identifier);
+            continue;
+        } else if (!(pInfo->flags & XI86_CONFIGURED)) {
+            xf86Msg(X_ERROR, "PreInit failed for input device \"%s\"\n",
+                    (*pDev)->identifier);
+            xf86DeleteInput(pInfo, 0);
+            continue;
+        }
     }
 
     /* Initialise all input devices. */
diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c
index d34238e..710e787 100644
--- a/hw/xfree86/common/xf86Xinput.c
+++ b/hw/xfree86/common/xf86Xinput.c
@@ -448,6 +448,8 @@ DeleteInputDeviceRequest(DeviceIntPtr pDev)
     LocalDevicePtr pInfo = (LocalDevicePtr) pDev->public.devicePrivate;
     InputDriverPtr drv;
     IDevRec *idev;
+    BOOL found;
+    IDevPtr *it;
 
     if (pInfo) /* need to get these before RemoveDevice */
     {
@@ -464,10 +466,18 @@ DeleteInputDeviceRequest(DeviceIntPtr pDev)
     else
         xf86DeleteInput(pInfo, 0);
 
-    xfree(idev->driver);
-    xfree(idev->identifier);
-    xf86optionListFree(idev->commonOptions);
-    xfree(idev);
+    /* devices added through HAL aren't in the config layout */
+    it = xf86ConfigLayout.inputs;
+    while(*it && *it != idev)
+        it++;
+
+    if (!(*it)) /* end of list, not in the layout */
+    {
+        xfree(idev->driver);
+        xfree(idev->identifier);
+        xf86optionListFree(idev->commonOptions);
+        xfree(idev);
+    }
 }
 
 /* 

commit 2b3faf2a75a1acc3b799a2868c55736c94a8183f
Author: Julien Cristau <jcristau@debian.org>
Date:   Tue Jul 15 10:36:38 2008 -0400

    Bug #16674: Make sure RANDR reports refresh as 0 if pixel clock is 0.
    (cherry picked from commit 9111944b292355f7478b4ae75bead8dc25edbbcb)

diff --git a/hw/xfree86/common/xf86RandR.c b/hw/xfree86/common/xf86RandR.c
index 4ee0d8b..a55b93d 100644
--- a/hw/xfree86/common/xf86RandR.c
+++ b/hw/xfree86/common/xf86RandR.c
@@ -54,6 +54,8 @@ xf86RandRModeRefresh (DisplayModePtr mode)
 {
     if (mode->VRefresh)
 	return (int) (mode->VRefresh + 0.5);
+    else if (mode->Clock == 0)
+	return 0;
     else
 	return (int) (mode->Clock * 1000.0 / mode->HTotal / mode->VTotal + 0.5);
 }

commit 5b546f1c493785c1f24a4f6c69174b70caa64eb1
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Mon Jul 14 10:20:11 2008 +0930

    xfree86: append, not prepent, new input devices to xf86InputDevs.
    
    If devices are prepended to the list, their wake-up order on resume is not the
    same as the original initialisation order. Hot-plugged devices, originally
    inited last, are re-enabled before the xorg.conf devices and in some cases may
    steal the device files. Result: we have different devices before and after
    suspend/resume.
    
    RedHat Bug 439386 <https://bugzilla.redhat.com/show_bug.cgi?id=439386>
    (cherry picked from commit 11ee0ae9390a608a232ff94abcc0cbcf9ed7b70a)

diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c
index 1dd0bbc..475628b 100644
--- a/hw/xfree86/common/xf86Helper.c
+++ b/hw/xfree86/common/xf86Helper.c
@@ -308,12 +308,11 @@ xf86AllocateScrnInfoPrivateIndex(void)
     return idx;
 }
 
-/* Allocate a new InputInfoRec and add it to the head xf86InputDevs. */
-
+/* Allocate a new InputInfoRec and append it to the tail of xf86InputDevs. */
 _X_EXPORT InputInfoPtr
 xf86AllocateInput(InputDriverPtr drv, int flags)
 {
-    InputInfoPtr new;
+    InputInfoPtr new, *prev = NULL;
 
     if (!(new = xcalloc(sizeof(InputInfoRec), 1)))
 	return NULL;
@@ -321,8 +320,13 @@ xf86AllocateInput(InputDriverPtr drv, int flags)
     new->drv = drv;
     drv->refCount++;
     new->module = DuplicateModule(drv->module, NULL);
-    new->next = xf86InputDevs;
-    xf86InputDevs = new;
+
+    for (prev = &xf86InputDevs; *prev; prev = &(*prev)->next)
+        ;
+
+    *prev = new;
+    new->next = NULL;
+
     return new;
 }
 

commit 5659f6d31bc4dd2e79d13f4856cbfa3f120958ff
Author: Julien Cristau <jcristau@debian.org>
Date:   Mon Jul 7 13:14:49 2008 +0200

    Export xkbfile.h in the SDK
    
    It's needed by xkbsrv.h
    (cherry picked from commit d8af9d9ab1cd98c07fdf42490dcc0cab3c655b89)

diff --git a/include/Makefile.am b/include/Makefile.am
index 7d5fee7..5edefe7 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -50,6 +50,7 @@ sdk_HEADERS =		\
 	validate.h	\
 	window.h	\
 	windowstr.h	\
+	xkbfile.h	\
 	xkbsrv.h	\
 	xkbstr.h	\
 	xorg-server.h
@@ -58,4 +59,4 @@ endif
 AM_CFLAGS = $(DIX_CFLAGS)
 
 EXTRA_DIST = $(sdk_HEADERS) do-not-use-config.h dix-config.h xorg-config.h \
-	xkb-config.h xkbfile.h
+	xkb-config.h

commit e135a77b8bad15fb135cd080c1725064f938b790
Author: Ander Conselvan de Oliveira <ander@mandriva.com.br>
Date:   Wed Jul 9 10:44:19 2008 -0300

    Fix incorrect test regarding keyboard map.
    
    In the map stored in each keyboard device, the first line refers to minimum
    keycode, i.e., the 0th line refers to keycode 8. When not using XKB the wrong
    test caused some keys to be interpreted as locks ('m' for instance). The had
    to be pressed twice to generate both KeyPress and KeyRelease events.
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

diff --git a/dix/getevents.c b/dix/getevents.c
index bf9331e..fbead11 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -408,9 +408,12 @@ GetKeyboardValuatorEvents(xEvent *events, DeviceIntPtr pDev, int type,
     int numEvents = 0;
     CARD32 ms = 0;
     KeySym *map = pDev->key->curKeySyms.map;
-    KeySym sym = map[key_code * pDev->key->curKeySyms.mapWidth];
+    KeySym sym;
     deviceKeyButtonPointer *kbp = NULL;
 
+    sym = map[(key_code - pDev->key->curKeySyms.minKeyCode)
+              * pDev->key->curKeySyms.mapWidth];
+
     if (!events)
         return 0;
 

commit c30f36c8c1dfd85deaf1c109823a1f15dd218ac7
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
Date:   Thu Jul 3 21:42:10 2008 +0200

    xfree86: AllowEmptyInput is now enabled by default if hotplugging is enabled.
    
    Remove AEI check from configImpliedLayout as the setting isn't actually parsed
    at this point anyway.
    
    Set AllowEmptyInput to enabled by default if hotplugging is enabled.

diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index 5631aa6..8e30c84 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -1088,9 +1088,9 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts)
     }
 #endif
 
-    xf86Info.allowEmptyInput = FALSE;
-    if (xf86GetOptValBool(FlagOptions, FLAG_ALLOW_EMPTY_INPUT, &value))
-        xf86Info.allowEmptyInput = TRUE;
+    /* AllowEmptyInput is automatically true if we're hotplugging */
+    xf86Info.allowEmptyInput = (xf86Info.autoAddDevices && xf86Info.autoEnableDevices);
+    xf86GetOptValBool(FlagOptions, FLAG_ALLOW_EMPTY_INPUT, &xf86Info.allowEmptyInput);
 
     xf86Info.useDefaultFontPath = TRUE;
     xf86Info.useDefaultFontPathFrom = X_DEFAULT;
@@ -1857,8 +1857,6 @@ configImpliedLayout(serverLayoutPtr servlayoutp, XF86ConfScreenPtr conf_screen)
     indp = xnfalloc(sizeof(IDevPtr));
     *indp = NULL;
     servlayoutp->inputs = indp;
-    if (!xf86Info.allowEmptyInput && !checkCoreInputDevices(servlayoutp, TRUE))
-	return FALSE;
     
     return TRUE;
 }
diff --git a/hw/xfree86/doc/man/xorg.conf.man.pre b/hw/xfree86/doc/man/xorg.conf.man.pre
index 9f39808..74f8cef 100644
--- a/hw/xfree86/doc/man/xorg.conf.man.pre
+++ b/hw/xfree86/doc/man/xorg.conf.man.pre
@@ -696,7 +696,8 @@ the X server to load. Disabled by default.
 .TP 7
 .BI "Option \*qAllowEmptyInput\*q \*q" boolean \*q
 If enabled, don't add the standard keyboard and mouse drivers, if there are no
-input devices in the config file.  Disabled by default.
+input devices in the config file.  Enabled by default if AutoAddDevices and
+AutoEnableDevices is enabled, otherwise disabled.
 .TP 7
 .BI "Option \*qAutoAddDevices\*q \*q" boolean \*q
 If this option is disabled, then no devices will be added from HAL events.

commit 5144158ced1c03fcd0df080e42436523c6ac5e8f
Author: Dave Airlie <airlied@linux.ie>
Date:   Thu Jul 3 20:00:22 2008 +1000

    dri2: bump libdrm numbers as 2.3.1 is released without ttm interface

diff --git a/configure.ac b/configure.ac
index 83892df..a9b1651 100644
--- a/configure.ac
+++ b/configure.ac
@@ -868,7 +868,7 @@ if test "x$DRI2" = xyes; then
 	# FIXME: Bump the versions once we have releases of these.
 	AC_DEFINE(DRI2, 1, [Build DRI2 extension])
 	PKG_CHECK_MODULES([DRI2PROTO], [dri2proto >= 1.1])
-	PKG_CHECK_MODULES([LIBDRM], [libdrm >= 2.3.1])
+	PKG_CHECK_MODULES([LIBDRM], [libdrm >= 2.3.2])
 fi
 
 AM_CONDITIONAL(XINERAMA, [test "x$XINERAMA" = xyes])

commit 793ff6754e9ff16714a2dd9fa5ae83d7189d316e
Author: Dave Airlie <airlied@redhat.com>
Date:   Thu Jul 3 18:57:09 2008 +1000

    modes: check the crtc is valid before using its desired modes.
    
    this fixes a crash I was getting on radeon rotate when gnome is running.
    I'm sure g-s-d was doing something bad, but really not crashing ftw.
    (cherry picked from commit 1771edcb44b564f83f509748b4e4cd5b7586e2a8)

diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index 17cf745..ea452df 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -1705,9 +1705,11 @@ xf86SetScrnInfoModes (ScrnInfoPtr scrn)
     /* Set scrn->modes to the mode list for the 'compat' output */
     scrn->modes = xf86DuplicateModes(scrn, output->probed_modes);
 
-    for (mode = scrn->modes; mode; mode = mode->next)
-	if (xf86ModesEqual (mode, &crtc->desiredMode))
-	    break;
+    if (crtc) {
+	for (mode = scrn->modes; mode; mode = mode->next)
+	    if (xf86ModesEqual (mode, &crtc->desiredMode))
+		break;
+    }
 
     if (scrn->modes != NULL) {
 	/* For some reason, scrn->modes is circular, unlike the other mode

commit e9f83740e3269a7e73c417b5b6c67668f1cac6e0
Author: Dave Airlie <airlied@redhat.com>
Date:   Mon May 19 11:16:08 2008 +1000

    cursor: don't dereference NULL pointer is devPrivates not yet set.
    
    This fixes a bug on server recycle with ati zaphod.

diff --git a/hw/xfree86/modes/xf86Cursors.c b/hw/xfree86/modes/xf86Cursors.c
index cb93dc6..fee02df 100644
--- a/hw/xfree86/modes/xf86Cursors.c
+++ b/hw/xfree86/modes/xf86Cursors.c
@@ -608,13 +608,17 @@ xf86_reload_cursors (ScreenPtr screen)
 
     if (cursor)
     {
+#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(7,0,0,0,0)
+	void *src = dixLookupPrivate(&cursor->devPrivates, screen);
+#else


Reply to: