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

xorg-server: Changes to 'upstream-unstable'



 Xi/exevents.c                           |    2 -
 configure.ac                            |    4 +-
 dix/devices.c                           |    4 ++
 dix/events.c                            |   21 ++++--------
 dix/getevents.c                         |    2 -
 hw/dmx/glxProxy/compsize.c              |    1 
 hw/dmx/glxProxy/compsize.h              |   51 ++++++++++++++++++++++++++++++
 hw/dmx/glxProxy/g_renderswap.c          |    1 
 hw/dmx/glxProxy/glxcmds.c               |    2 +
 hw/dmx/glxProxy/glxcmds.h               |   37 ++++++++++++++++++++++
 hw/dmx/glxProxy/glxcmdsswap.c           |    3 +
 hw/vfb/InitOutput.c                     |    2 +
 hw/xfree86/common/xf86VidMode.c         |    3 +
 hw/xfree86/dri2/dri2.c                  |   17 ++++++++--
 hw/xfree86/dri2/dri2ext.c               |    3 +
 hw/xfree86/modes/xf86Crtc.c             |   41 +++++++++++-------------
 hw/xfree86/modes/xf86EdidModes.c        |    5 +++
 hw/xfree86/os-support/linux/lnx_video.c |    8 ++--
 hw/xfree86/vbe/vbe.c                    |    5 ++-
 include/input.h                         |    4 +-
 include/os.h                            |    3 +
 miext/rootless/rootlessScreen.c         |    4 +-
 os/io.c                                 |    1 
 record/record.c                         |   53 ++++++++++++++++++--------------
 24 files changed, 201 insertions(+), 76 deletions(-)

New commits:
commit 4689c84a07f87d35492feeae2bc59642c31b6eb3
Author: Jeremy Huddleston <jeremyhu@apple.com>
Date:   Mon Nov 28 00:07:29 2011 -0800

    configure.ac: 1.11.2.901 (1.11.3 RC1)
    
    Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>

diff --git a/configure.ac b/configure.ac
index f0a14c4..9237686 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,8 +26,8 @@ dnl
 dnl Process this file with autoconf to create configure.
 
 AC_PREREQ(2.57)
-AC_INIT([xorg-server], 1.11.2, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
-RELEASE_DATE="2011-11-04"
+AC_INIT([xorg-server], 1.11.2.901, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
+RELEASE_DATE="2011-11-28"
 AC_CONFIG_SRCDIR([Makefile.am])
 AM_INIT_AUTOMAKE([foreign dist-bzip2])
 AM_MAINTAINER_MODE

commit e2661ddbc5d1b2edb1ab514a761f8c0b66e69736
Author: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Date:   Sun Nov 6 12:20:51 2011 -0500

    Fix vesa's VBE PanelID interpretation
    
    xserver's VESA driver's VBE (Vesa BIOS Extensions) code
    includes a PanelID probe, which can get a monitor's native
    resolution. From this, using CVT formulas, it derives
    horizontal sync rate and a vertical refresh rate ranges.
    
    It however, only derives the upper bounds of the ranges, and
    the lower bounds cannot de derived. By default, they are set
    to hardcoded constants which represent the lowest supported
    resolution: 640x480. The constants in vbe.c however, were
    not actually derived from forulas, but carried over from
    other code from the bad old days, and are not relevant
    to flat panel displays. This caused, for example, EEEPC701's
    panel, with a native resolution of 800x480, to end up with
    a upper bound of the horizontal sync rate that was lower
    than the hardcoded lower bound, which of course broke things.
    
    These numbers have been rederived using both my own CVT tool
    based on xf86CVTMode(), and using the provided 'cvt' tool
    that comes with xserver.
    
    Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Keith Packard <keithp@keithp.com>
    (cherry picked from commit f0d50cc6651dce3a8a3cd3fb84210aa92b139763)

diff --git a/hw/xfree86/vbe/vbe.c b/hw/xfree86/vbe/vbe.c
index 04132d9..06a6284 100644
--- a/hw/xfree86/vbe/vbe.c
+++ b/hw/xfree86/vbe/vbe.c
@@ -1036,13 +1036,16 @@ VBEInterpretPanelID(int scrnIndex, struct vbePanelID *data)
     mode = xf86CVTMode(data->hsize, data->vsize, PANEL_HZ, 1, 0);
 
     pScrn->monitor->nHsync = 1;
-    pScrn->monitor->hsync[0].lo = 31.5;
+    pScrn->monitor->hsync[0].lo = 29.37;
     pScrn->monitor->hsync[0].hi = (float)mode->Clock / (float)mode->HTotal;
     pScrn->monitor->nVrefresh = 1;
     pScrn->monitor->vrefresh[0].lo = 56.0;
     pScrn->monitor->vrefresh[0].hi =
 	(float)mode->Clock*1000.0 / (float)mode->HTotal / (float)mode->VTotal;
 
+    if (pScrn->monitor->vrefresh[0].hi < 59.47)
+	pScrn->monitor->vrefresh[0].hi = 59.47;
+
     free(mode);
 }
 

commit 2e3406fc6737539210e29ac0b2821848e6d1f069
Author: Jeremy Huddleston <jeremyhu@apple.com>
Date:   Mon Nov 7 22:14:30 2011 +0000

    dmx: Build fix for -Werror=implicit-function-declaration
    
    Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    (cherry picked from commit f405dfffe7d5db81d398615a80acbeba7e014ada)

diff --git a/hw/dmx/glxProxy/compsize.c b/hw/dmx/glxProxy/compsize.c
index 9a40d65..5a5d5d0 100644
--- a/hw/dmx/glxProxy/compsize.c
+++ b/hw/dmx/glxProxy/compsize.c
@@ -29,6 +29,7 @@
  */
 
 #include <GL/gl.h>
+#include "compsize.h"
 
 GLint __glFogiv_size(GLenum pname)
 {
diff --git a/hw/dmx/glxProxy/compsize.h b/hw/dmx/glxProxy/compsize.h
new file mode 100644
index 0000000..856c6f5
--- /dev/null
+++ b/hw/dmx/glxProxy/compsize.h
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2011 Apple Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation on the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial
+ * portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NON-INFRINGEMENT.  IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#ifndef __compsize_h__
+#define __compsize_h__
+
+extern GLint __glColorTableParameterfv_size(GLenum pname);
+extern GLint __glColorTableParameteriv_size(GLenum pname);
+extern GLint __glConvolutionParameterfv_size(GLenum pname);
+extern GLint __glConvolutionParameteriv_size(GLenum pname);
+extern GLint __glFogfv_size(GLenum pname);
+extern GLint __glFogiv_size(GLenum pname);
+extern GLint __glLightModelfv_size(GLenum pname);
+extern GLint __glLightModeliv_size(GLenum pname);
+extern GLint __glLightfv_size(GLenum pname);
+extern GLint __glLightiv_size(GLenum pname);
+extern GLint __glMaterialfv_size(GLenum pname);
+extern GLint __glMaterialiv_size(GLenum pname);
+extern GLint __glTexEnvfv_size(GLenum e);
+extern GLint __glTexEnviv_size(GLenum e);
+extern GLint __glTexGendv_size(GLenum e);
+extern GLint __glTexGenfv_size(GLenum e);
+extern GLint __glTexGeniv_size(GLenum e);
+extern GLint __glTexParameterfv_size(GLenum e);
+extern GLint __glTexParameteriv_size(GLenum e);
+
+#endif /* !__compsize_h__ */
diff --git a/hw/dmx/glxProxy/g_renderswap.c b/hw/dmx/glxProxy/g_renderswap.c
index e675696..e434a71 100644
--- a/hw/dmx/glxProxy/g_renderswap.c
+++ b/hw/dmx/glxProxy/g_renderswap.c
@@ -32,6 +32,7 @@
 #include "glxext.h"
 #include "g_disptab.h"
 #include "unpack.h"
+#include "compsize.h"
 
 void __glXDispSwap_CallList(GLbyte *pc)
 {
diff --git a/hw/dmx/glxProxy/glxcmds.c b/hw/dmx/glxProxy/glxcmds.c
index f79264e..3f21f65 100644
--- a/hw/dmx/glxProxy/glxcmds.c
+++ b/hw/dmx/glxProxy/glxcmds.c
@@ -52,6 +52,8 @@
 #include "glxvisuals.h"
 #include "glxswap.h"
 
+#include "glxcmds.h"
+
 #ifdef PANORAMIX
 #include "panoramiXsrv.h"
 #endif
diff --git a/hw/dmx/glxProxy/glxcmds.h b/hw/dmx/glxProxy/glxcmds.h
new file mode 100644
index 0000000..ae866be
--- /dev/null
+++ b/hw/dmx/glxProxy/glxcmds.h
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2011 Apple Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation on the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial
+ * portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NON-INFRINGEMENT.  IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#ifndef __GLX_cmds_h__
+#define __GLX_cmds_h__
+
+extern int __glXBindSwapBarrierSGIX(__GLXclientState *cl, GLbyte *pc);
+extern int __glXCreateContextWithConfigSGIX(__GLXclientState *cl, GLbyte *pc);
+extern int __glXJoinSwapGroupSGIX(__GLXclientState *cl, GLbyte *pc);
+extern int __glXMakeCurrentReadSGI(__GLXclientState *cl, GLbyte *pc);
+extern int __glXQueryMaxSwapBarriersSGIX(__GLXclientState *cl, GLbyte *pc);
+
+#endif /* !__GLX_cmds_h__ */
diff --git a/hw/dmx/glxProxy/glxcmdsswap.c b/hw/dmx/glxProxy/glxcmdsswap.c
index 2294059..f28a79d 100644
--- a/hw/dmx/glxProxy/glxcmdsswap.c
+++ b/hw/dmx/glxProxy/glxcmdsswap.c
@@ -35,11 +35,14 @@
 #include <pixmapstr.h>
 #include <windowstr.h>
 #include "unpack.h"
+#include "glxcmds.h"
 #include "glxext.h"
 #include "glxvendor.h"
 
 extern int glxIsExtensionSupported( char *ext );
 
+int __glXSwapGetFBConfigsSGIX(__GLXclientState *cl, GLbyte *pc);
+
 /************************************************************************/
 
 /*

commit b440fc9c1bb10f8c227120e6d9e58101108d71bb
Author: dtakahashi42 <dtakahashi42@gmail.com>
Date:   Fri Nov 18 11:30:22 2011 -0800

    rootless: Fix a server crash when choosing a color with the gimp color wheel
    
    https://trac.macports.org/ticket/30927
    
    Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
    Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
    (cherry picked from commit 328074890eeb111950e984c6f618311983600b20)

diff --git a/miext/rootless/rootlessScreen.c b/miext/rootless/rootlessScreen.c
index 0801e72..c855706 100644
--- a/miext/rootless/rootlessScreen.c
+++ b/miext/rootless/rootlessScreen.c
@@ -247,8 +247,8 @@ RootlessComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst,
     WindowPtr srcWin, dstWin, maskWin = NULL;
 
     if (pMask) {                        // pMask can be NULL
-        maskWin = (pMask->pDrawable->type == DRAWABLE_WINDOW) ?
-                  (WindowPtr)pMask->pDrawable :  NULL;
+        maskWin = (pMask->pDrawable && pMask->pDrawable->type == DRAWABLE_WINDOW) ?
+                  (WindowPtr)pMask->pDrawable : NULL;
     }
     srcWin  = (pSrc->pDrawable && pSrc->pDrawable->type  == DRAWABLE_WINDOW) ?
               (WindowPtr)pSrc->pDrawable  :  NULL;

commit 40c1287f36517f0afd62306e306f6a68120d9a59
Author: Ross Burton <ross@linux.intel.com>
Date:   Wed Sep 28 11:46:02 2011 +0100

    edid: Add quirk for Acer Aspire One 110
    
    At least one revision of the AAO reports a 190x110mm maximum size but a
    451x113mm mode.
    
    X.Org Bug 41141 <https://bugs.freedesktop.org/show_bug.cgi?id=41141>
    
    Signed-off-by: Ross Burton <ross@linux.intel.com>
    Reviewed-by: Daniel Stone <daniel@fooishbar.org>
    Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
    (cherry picked from commit 58864146fbdf1820d04825838691e84784ef91bc)

diff --git a/hw/xfree86/modes/xf86EdidModes.c b/hw/xfree86/modes/xf86EdidModes.c
index 9ff2f0d..86065f8 100644
--- a/hw/xfree86/modes/xf86EdidModes.c
+++ b/hw/xfree86/modes/xf86EdidModes.c
@@ -165,6 +165,11 @@ static Bool quirk_detailed_use_maximum_size (int scrnIndex, xf86MonPtr DDC)
 	DDC->vendor.prod_id == 6400)
 	return TRUE;
 
+    /* Bug #41141: Acer Aspire One */
+    if (memcmp (DDC->vendor.name, "LGD", 4) == 0 &&
+	DDC->vendor.prod_id == 0x7f01)
+	return TRUE;
+
     return FALSE;
 }
 

commit 7972e2dade58158bb98f5b7dc5f873b9fb3446de
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Aug 25 16:04:04 2011 +0100

    dri2: Register the DRI2DrawableType after server regeneration
    
    The Resource database is reset upon regeneration and so the dri2 module
    needs to re-register its RESTYPE for the drawable or else it will
    clobber the next unsuspecting user of the database. Fortunately, DRI2 is
    loaded late in the initialisation sequence and was last up until
    xf86-video-intel started using the Resource database to track
    outstanding swaps...
    
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
    Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
    Tested-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
    (cherry picked from commit 34b0e4eee911f8b09a3682a7f1b4c8598ef48b8d)

diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c
index d71e4f4..f7f7000 100644
--- a/hw/xfree86/dri2/dri2.c
+++ b/hw/xfree86/dri2/dri2.c
@@ -1194,14 +1194,24 @@ DRI2CloseScreen(ScreenPtr pScreen)
 }
 
 extern ExtensionModule dri2ExtensionModule;
+extern Bool DRI2ModuleSetup(void);
+
+/* Called by InitExtensions() */
+Bool
+DRI2ModuleSetup(void)
+{
+    dri2DrawableRes = CreateNewResourceType(DRI2DrawableGone, "DRI2Drawable");
+    if (!dri2DrawableRes)
+	return FALSE;
+
+    return TRUE;
+}
 
 static pointer
 DRI2Setup(pointer module, pointer opts, int *errmaj, int *errmin)
 {
     static Bool setupDone = FALSE;
 
-    dri2DrawableRes = CreateNewResourceType(DRI2DrawableGone, "DRI2Drawable");
-
     if (!setupDone)
     {
 	setupDone = TRUE;
diff --git a/hw/xfree86/dri2/dri2ext.c b/hw/xfree86/dri2/dri2ext.c
index 552b26b..a2198e2 100644
--- a/hw/xfree86/dri2/dri2ext.c
+++ b/hw/xfree86/dri2/dri2ext.c
@@ -50,6 +50,7 @@
 #include "xf86Module.h"
 
 static ExtensionEntry	*dri2Extension;
+extern Bool DRI2ModuleSetup(void);
 
 static Bool
 validDrawable(ClientPtr client, XID drawable, Mask access_mode,
@@ -636,6 +637,8 @@ DRI2ExtensionInit(void)
 				 StandardMinorOpcode);
 
     DRI2EventBase = dri2Extension->eventBase;
+
+    DRI2ModuleSetup();
 }
 
 extern Bool noDRI2Extension;

commit 73beaf9033d9a44e7a7c654f296624c7265eeb6d
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Mon Jan 24 11:17:03 2011 +0000

    DRI2: Avoid a NULL pointer dereference
    
    Bugzilla:  https://bugs.freedesktop.org/show_bug.cgi?id=41211
    
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
    Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
    (cherry picked from commit bfa1a0dd190ed88020d60eba3bb04681c8e83a68)

diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c
index af3bcae..d71e4f4 100644
--- a/hw/xfree86/dri2/dri2.c
+++ b/hw/xfree86/dri2/dri2.c
@@ -780,7 +780,8 @@ DRI2WaitSwap(ClientPtr client, DrawablePtr pDrawable)
     /* If we're currently waiting for a swap on this drawable, reset
      * the request and suspend the client.  We only support one
      * blocked client per drawable. */
-    if ((pPriv->swapsPending) &&
+    if (pPriv &&
+	pPriv->swapsPending &&
 	pPriv->blockedClient == NULL) {
 	ResetCurrentRequest(client);
 	client->sequence--;

commit 6105fcaa3592cb6d0d5f22d9b850986d0bc4d241
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Mon Jan 24 11:17:03 2011 +0000

    VidMode: prevent crash with no modes
    
    Bugzilla:  https://bugs.freedesktop.org/show_bug.cgi?id=17431
    
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
    Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
    (cherry picked from commit eeb21a133b982f71de739baf62e53c8a68f5d495)

diff --git a/hw/xfree86/common/xf86VidMode.c b/hw/xfree86/common/xf86VidMode.c
index 4dd454d..2ae5484 100644
--- a/hw/xfree86/common/xf86VidMode.c
+++ b/hw/xfree86/common/xf86VidMode.c
@@ -221,6 +221,9 @@ VidModeGetFirstModeline(int scrnIndex, pointer *mode, int *dotClock)
 	return FALSE;
 
     pScrn = xf86Screens[scrnIndex];
+    if (pScrn->modes == NULL)
+	    return FALSE;
+
     pVidMode = VMPTR(pScrn->pScreen);
     pVidMode->First = pScrn->modes;
     pVidMode->Next =  pVidMode->First->next;

commit d113b2911573f3685dc644c6fdd1979aa880b99f
Author: Rami Ylimäki <rami.ylimaki@vincit.fi>
Date:   Tue Oct 4 12:25:26 2011 +0300

    record: Prevent out of bounds access when recording a reply.
    
    Any pad bytes in replies are written to the client from a zeroed
    array. However, record extension tries to incorrectly access the pad
    bytes from the end of reply data.
    
    Signed-off-by: Rami Ylimäki <rami.ylimaki@vincit.fi>
    Reviewed-by: Erkki Seppälä <erkki.seppala@vincit.fi>
    (cherry picked from commit c1bb8f43b9290c2b18a9f0ac59773ff8f1eb974f)

diff --git a/include/os.h b/include/os.h
index a553f57..c9a8b3e 100644
--- a/include/os.h
+++ b/include/os.h
@@ -451,9 +451,10 @@ extern _X_EXPORT CallbackListPtr ReplyCallback;
 typedef struct {
     ClientPtr client;
     const void *replyData;
-    unsigned long dataLenBytes;
+    unsigned long dataLenBytes; /* actual bytes from replyData + pad bytes */
     unsigned long bytesRemaining;
     Bool startOfReply;
+    unsigned long padBytes;     /* pad bytes from zeroed array */
 } ReplyInfoRec;
 
 /* stuff for FlushCallback */
diff --git a/os/io.c b/os/io.c
index 4210238..c59e18c 100644
--- a/os/io.c
+++ b/os/io.c
@@ -810,6 +810,7 @@ WriteToClient (ClientPtr who, int count, const void *__buf)
 	replyinfo.client = who;
 	replyinfo.replyData = buf;
 	replyinfo.dataLenBytes = count + padBytes;
+	replyinfo.padBytes = padBytes;
 	if (who->replyBytesRemaining)
 	{ /* still sending data of an earlier reply */
 	    who->replyBytesRemaining -= count + padBytes;
diff --git a/record/record.c b/record/record.c
index 69fca72..93383ce 100644
--- a/record/record.c
+++ b/record/record.c
@@ -269,8 +269,9 @@ RecordFlushReplyBuffer(
  *	  device events and EndOfData, pClient is NULL.
  *	category is the category of the protocol element, as defined
  *	  by the RECORD spec.
- *	data is a pointer to the protocol data, and datalen is its length
- *	  in bytes.
+ *	data is a pointer to the protocol data, and datalen - padlen
+ *	  is its length in bytes.
+ *	padlen is the number of pad bytes from a zeroed array.
  *	futurelen is the number of bytes that will be sent in subsequent
  *	  calls to this function to complete this protocol element.  
  *	  In those subsequent calls, futurelen will be -1 to indicate
@@ -290,7 +291,7 @@ RecordFlushReplyBuffer(
  */
 static void
 RecordAProtocolElement(RecordContextPtr pContext, ClientPtr pClient,
-		       int category, pointer data, int datalen, int futurelen)
+		       int category, pointer data, int datalen, int padlen, int futurelen)
 {
     CARD32 elemHeaderData[2];
     int numElemHeaders = 0;
@@ -399,15 +400,20 @@ RecordAProtocolElement(RecordContextPtr pContext, ClientPtr pClient,
 	}
 	if (datalen)
 	{
+	    static char padBuffer[3]; /* as in FlushClient */
 	    memcpy(pContext->replyBuffer + pContext->numBufBytes,
-		   data, datalen);
-	    pContext->numBufBytes += datalen;
+		   data, datalen - padlen);
+	    pContext->numBufBytes += datalen - padlen;
+	    memcpy(pContext->replyBuffer + pContext->numBufBytes,
+		   padBuffer, padlen);
+	    pContext->numBufBytes += padlen;
 	}
     }
     else
+    {
 	RecordFlushReplyBuffer(pContext, (pointer)elemHeaderData,
-			       numElemHeaders, (pointer)data, datalen);
-
+			       numElemHeaders, (pointer)data, datalen - padlen);
+    }
 } /* RecordAProtocolElement */
 
 
@@ -485,19 +491,19 @@ RecordABigRequest(RecordContextPtr pContext, ClientPtr client, xReq *stuff)
     /* record the request header */
     bytesLeft = client->req_len << 2;
     RecordAProtocolElement(pContext, client, XRecordFromClient,
-			   (pointer)stuff, SIZEOF(xReq), bytesLeft);
+			   (pointer)stuff, SIZEOF(xReq), 0, bytesLeft);
 
     /* reinsert the extended length field that was squished out */
     bigLength = client->req_len + bytes_to_int32(sizeof(bigLength));
     if (client->swapped)
 	swapl(&bigLength, n);
     RecordAProtocolElement(pContext, client, XRecordFromClient,
-		(pointer)&bigLength, sizeof(bigLength), /* continuation */ -1);
+               (pointer)&bigLength, sizeof(bigLength), 0, /* continuation */ -1);
     bytesLeft -= sizeof(bigLength);
 
     /* record the rest of the request after the length */
     RecordAProtocolElement(pContext, client, XRecordFromClient,
-		(pointer)(stuff + 1), bytesLeft, /* continuation */ -1);
+               (pointer)(stuff + 1), bytesLeft, 0, /* continuation */ -1);
 } /* RecordABigRequest */
 
 
@@ -544,7 +550,7 @@ RecordARequest(ClientPtr client)
 		    RecordABigRequest(pContext, client, stuff);
 		else
 		    RecordAProtocolElement(pContext, client, XRecordFromClient,
-				(pointer)stuff, client->req_len << 2, 0);
+				(pointer)stuff, client->req_len << 2, 0, 0);
 	    }
 	    else /* extension, check minor opcode */
 	    {
@@ -568,7 +574,7 @@ RecordARequest(ClientPtr client)
 			else
 			    RecordAProtocolElement(pContext, client, 
 					XRecordFromClient, (pointer)stuff,
-					client->req_len << 2, 0);
+					client->req_len << 2, 0, 0);
 			break;
 		    }			    
 		} /* end for each minor op info */
@@ -621,7 +627,8 @@ RecordAReply(CallbackListPtr *pcbl, pointer nulldata, pointer calldata)
 	    if (pContext->continuedReply)
 	    {
 		RecordAProtocolElement(pContext, client, XRecordFromServer,
-		   (pointer)pri->replyData, pri->dataLenBytes, /* continuation */ -1);
+		   (pointer)pri->replyData, pri->dataLenBytes,
+			    pri->padBytes, /* continuation */ -1);
 		if (!pri->bytesRemaining)
 		    pContext->continuedReply = 0;
 	    }
@@ -631,7 +638,7 @@ RecordAReply(CallbackListPtr *pcbl, pointer nulldata, pointer calldata)
 		if (majorop <= 127)
 		{ /* core reply */
 		    RecordAProtocolElement(pContext, client, XRecordFromServer,
-		       (pointer)pri->replyData, pri->dataLenBytes, pri->bytesRemaining);
+		       (pointer)pri->replyData, pri->dataLenBytes, 0, pri->bytesRemaining);
 		    if (pri->bytesRemaining)
 			pContext->continuedReply = 1;
 		}
@@ -653,7 +660,7 @@ RecordAReply(CallbackListPtr *pcbl, pointer nulldata, pointer calldata)
 			{
 			    RecordAProtocolElement(pContext, client, 
 				XRecordFromServer, (pointer)pri->replyData,
-				pri->dataLenBytes, pri->bytesRemaining);
+				pri->dataLenBytes, 0, pri->bytesRemaining);
 			    if (pri->bytesRemaining)
 				pContext->continuedReply = 1;
 			    break;
@@ -725,7 +732,7 @@ RecordADeliveredEventOrError(CallbackListPtr *pcbl, pointer nulldata, pointer ca
 			
 		    }
 		    RecordAProtocolElement(pContext, pClient,
-			XRecordFromServer, pEvToRecord, SIZEOF(xEvent), 0);
+			XRecordFromServer, pEvToRecord, SIZEOF(xEvent), 0, 0);
 		}
 	    } /* end for each event */
 	} /* end this client is on this context */
@@ -776,7 +783,7 @@ RecordSendProtocolEvents(RecordClientsAndProtocolPtr pRCAP,
 	    }
 
 	    RecordAProtocolElement(pContext, NULL,
-		    XRecordFromServer,  pEvToRecord, SIZEOF(xEvent), 0);
+		    XRecordFromServer,  pEvToRecord, SIZEOF(xEvent), 0, 0);
 	    /* make sure device events get flushed in the absence
 	     * of other client activity
 	     */
@@ -2420,7 +2427,7 @@ ProcRecordEnableContext(ClientPtr client)
     assert(numEnabledContexts > 0);
 
     /* send StartOfData */
-    RecordAProtocolElement(pContext, NULL, XRecordStartOfData, NULL, 0, 0);
+    RecordAProtocolElement(pContext, NULL, XRecordStartOfData, NULL, 0, 0, 0);
     RecordFlushReplyBuffer(pContext, NULL, 0, NULL, 0);
     return Success;
 } /* ProcRecordEnableContext */
@@ -2451,7 +2458,7 @@ RecordDisableContext(RecordContextPtr pContext)
     if (!pContext->pRecordingClient) return;
     if (!pContext->pRecordingClient->clientGone)
     {
-	RecordAProtocolElement(pContext, NULL, XRecordEndOfData, NULL, 0, 0);
+	RecordAProtocolElement(pContext, NULL, XRecordEndOfData, NULL, 0, 0, 0);
 	RecordFlushReplyBuffer(pContext, NULL, 0, NULL, 0);
 	/* Re-enable request processing on this connection. */
 	AttendClient(pContext->pRecordingClient);
@@ -2775,7 +2782,7 @@ RecordConnectionSetupInfo(RecordContextPtr pContext, NewClientInfoRec *pci)
 	SwapConnSetupPrefix(pci->prefix, (xConnSetupPrefix*)pConnSetup);
 	SwapConnSetupInfo((char*)pci->setup, (char*)(pConnSetup + prefixsize));
 	RecordAProtocolElement(pContext, pci->client, XRecordClientStarted,
-			       (pointer)pConnSetup, prefixsize + restsize, 0);
+			       (pointer)pConnSetup, prefixsize + restsize, 0, 0);
 	free(pConnSetup);
     }
     else
@@ -2784,9 +2791,9 @@ RecordConnectionSetupInfo(RecordContextPtr pContext, NewClientInfoRec *pci)
 	 * data in two pieces
 	 */
 	RecordAProtocolElement(pContext, pci->client, XRecordClientStarted,
-			(pointer)pci->prefix, prefixsize, restsize);
+			(pointer)pci->prefix, prefixsize, 0, restsize);
 	RecordAProtocolElement(pContext, pci->client, XRecordClientStarted,
-			(pointer)pci->setup, restsize, /* continuation */ -1);
+			(pointer)pci->setup, restsize, 0, /* continuation */ -1);
     }
 } /* RecordConnectionSetupInfo */
 
@@ -2863,7 +2870,7 @@ RecordAClientStateChange(CallbackListPtr *pcbl, pointer nulldata, pointer callda
 	    {
 		if (pContext->pRecordingClient && pRCAP->clientDied)
 		    RecordAProtocolElement(pContext, pClient,
-					   XRecordClientDied, NULL, 0, 0);
+					   XRecordClientDied, NULL, 0, 0, 0);
 		RecordDeleteClientFromRCAP(pRCAP, pos);
 	    }
 	}

commit 4dc5b6ea9f4932070c37b7c5393d468d00803712
Author: Jeremy Huddleston <jeremyhu@apple.com>
Date:   Tue Nov 1 14:59:15 2011 -0700

    xfree86: Fix powerpc build with -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast
    
    memType is a uint64_t on powerpc. Using memType only really makes
    sense for *physical* addresses, which can be 64-bit for 32-bit
    systems running on 64-bit hardware.
    
    However, unmapVidMem() only deals with *virtual* addresses, which
    are guaranteed to fit into an uintptr_t.
    
    Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
    Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
    (cherry picked from commit eb3377ffb8a7baa26c9831e56ed782d48b28fa71)

diff --git a/hw/xfree86/os-support/linux/lnx_video.c b/hw/xfree86/os-support/linux/lnx_video.c
index 3d45511..468c621 100644
--- a/hw/xfree86/os-support/linux/lnx_video.c
+++ b/hw/xfree86/os-support/linux/lnx_video.c
@@ -469,11 +469,11 @@ mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
 static void
 unmapVidMem(int ScreenNum, pointer Base, unsigned long Size)
 {
-    memType alignOff = (memType)Base 
-	- ((memType)Base & ~(getpagesize() - 1));
+    uintptr_t alignOff = (uintptr_t)Base
+	- ((uintptr_t)Base & ~(getpagesize() - 1));
 
-    DebugF("alignment offset: %lx\n",alignOff);
-    munmap((caddr_t)((memType)Base - alignOff), (Size + alignOff));
+    DebugF("alignment offset: %lx\n", (unsigned long)alignOff);
+    munmap((void *)((uintptr_t)Base - alignOff), (Size + alignOff));
 }
 
 

commit a1925f08790083a5c00f9f4ba766cbb8749240f3
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Fri Apr 15 13:32:10 2011 +1000

    include: export GetProximityEvents and QueueProximityEvents
    
    This is mainly needed for consistency with GetPointerEvents and friend.
    No-one seems to actually need this function from outside the usual DDXs.
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
    (cherry picked from commit fc16917ad6f0d2722bfb5c5eeca955dd3bc4125a)

diff --git a/include/input.h b/include/input.h
index 5377a0c..0d995f5 100644
--- a/include/input.h
+++ b/include/input.h
@@ -464,13 +464,13 @@ extern _X_EXPORT void QueueKeyboardEvents(
     int key_code,
     const ValuatorMask *mask);
 
-extern int GetProximityEvents(
+extern _X_EXPORT int GetProximityEvents(
     InternalEvent *events,
     DeviceIntPtr pDev,
     int type,
     const ValuatorMask *mask);
 
-extern void QueueProximityEvents(
+extern _X_EXPORT void QueueProximityEvents(
     DeviceIntPtr pDev,
     int type,
     const ValuatorMask *mask);

commit a6a21f84bbdd4e3c6218f7b4c04a2d947a784f9f
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Thu Nov 3 08:58:58 2011 +1000

    dix: Don't let a driver without a ProximityClassRec post events
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
    (cherry picked from commit 11840595a1be9f2df7390bcc708cc176e60d3ef2)

diff --git a/dix/getevents.c b/dix/getevents.c
index a12462a..058fa8a 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -1309,7 +1309,7 @@ GetProximityEvents(InternalEvent *events, DeviceIntPtr pDev, int type, const Val
     /* Sanity checks. */
     if ((type != ProximityIn && type != ProximityOut) || !mask_in)
         return 0;
-    if (!pDev->valuator)
+    if (!pDev->valuator || !pDev->proximity)
         return 0;
 
     valuator_mask_copy(&mask, mask_in);

commit 2f2d871ccdfb256831ae487c5916054a3d29d126
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Thu Oct 27 11:03:39 2011 +1000

    Xi: allow passive keygrabs on the XIAll(Master)Devices fake devices
    
    They don't have a KeyClassRec, but we must still allow passive grabs on
    them.
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Tested-by: Bastien Nocera <hadess@hadess.net>
    Reviewed-by: Daniel Stone <daniel@fooishbar.org>
    (cherry picked from commit 22715e465b415b3351b83b8279a4f44157f63199)

diff --git a/Xi/exevents.c b/Xi/exevents.c
index 3e3c67b..dcb496f 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -1441,7 +1441,7 @@ GrabKey(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr modifier_device,
     rc = CheckGrabValues(client, param);
     if (rc != Success)
         return rc;
-    if (k == NULL)
+    if ((dev->id != XIAllDevices && dev->id != XIAllMasterDevices) && k == NULL)
 	return BadMatch;
     if (grabtype == GRABTYPE_XI)
     {

commit 34bb83b9df20ff63dbb147ed661f39efb8bae8e4
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Mon Oct 24 12:00:32 2011 +1000

    dix: block signals when closing all devices
    
    When closing down all devices, we manually unset master for all attached
    devices, but the device's sprite info still points to the master's sprite
    info. This leaves us a window where the master is freed already but the
    device isn't yet. A signal during that window causes dereference of the
    already freed spriteInfo in mieqEnqueue's EnqueueScreen macro.
    
    Simply block signals when removing all devices. It's not like we're really
    worrying about high-responsive input at this stage.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=737031
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: Julien Cristau <jcristau@debian.org>
    (cherry picked from commit d7c44a7c9760449bef263413ad3b20f19b1dc95a)

diff --git a/dix/devices.c b/dix/devices.c
index 0ccf252..cbdd4ea 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -982,6 +982,8 @@ CloseDownDevices(void)
 {
     DeviceIntPtr dev;
 
+    OsBlockSignals();
+
     /* Float all SDs before closing them. Note that at this point resources
      * (e.g. cursors) have been freed already, so we can't just call
      * AttachDevice(NULL, dev, NULL). Instead, we have to forcibly set master
@@ -1004,6 +1006,8 @@ CloseDownDevices(void)
     inputInfo.keyboard = NULL;
     inputInfo.pointer = NULL;
     XkbDeleteRulesDflts();
+
+    OsReleaseSignals();
 }
 
 /**

commit 97f2ae60fc0cc755abd8b88df826fcb1a20464fe
Author: Christopher Yeleighton <giecrilj@stegny.2a.pl>
Date:   Mon Oct 24 18:47:06 2011 -0700

    Bug 38420: Xvfb crashes in miInitVisuals() when started with depth=2
    
    https://bugs.freedesktop.org/show_bug.cgi?id=38420
    
    Exit with fatal error message, not segfault.
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
    Signed-off-by: Keith Packard <keithp@keithp.com>
    (cherry picked from commit 7d50211ab57a35910d79fc3f67ae89aff91fa995)

diff --git a/hw/vfb/InitOutput.c b/hw/vfb/InitOutput.c
index 31ed505..dce3f84 100644
--- a/hw/vfb/InitOutput.c
+++ b/hw/vfb/InitOutput.c
@@ -864,6 +864,8 @@ vfbScreenInit(int index, ScreenPtr pScreen, int argc, char **argv)
 				   (1 << DirectColor)),
 				  10, TrueColor, 0x3ff00000, 0x000ffc00, 0x000003ff);
 	break;
+    default:
+	return FALSE;
     }
 
     miSetPixmapDepths ();

commit 89626304ea1ad316c5b7145a40f09377148cff21
Author: Dave Airlie <airlied@redhat.com>
Date:   Thu Oct 20 14:43:01 2011 +0100

    xf86Crtc: handle no outputs with no modes harder.
    
    If you started an X server with no connected outputs, we pick a default
    1024x768 mode, however if you then ran an xvidmode using app against that
    server it would segfault the server due to not finding any valid modes.
    
    This was due to the no output mode set code, only adding the modes to the
    scrn->modes once, when something called randr 1.2 xf86SetScrnInfoModes would
    get called and remove all the modes and we'd end up with 0.
    
    This change fixes xf86SetScrnInfoModes to always report a scrn mode of at
    least 1024x768, and pushes the initial configuration to just call it instead
    of setting up the mode itself.
    
    Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=746926
    
    I've seen other bugs like this on other distros so it might also actually fix them.
    
    Signed-off-by: Dave Airlie <airlied@redhat.com>
    Reviewed-by: Keith Packard <keithp@keithp.com>
    Signed-off-by: Keith Packard <keithp@keithp.com>
    (cherry picked from commit 17416e88dcfcc584fe5f87580d5d2b719b3521c3)

diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index d75cd77..8906806 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -1915,19 +1915,25 @@ xf86SetScrnInfoModes (ScrnInfoPtr scrn)
 		break;
     }
 
-    if (scrn->modes != NULL) {
-	/* For some reason, scrn->modes is circular, unlike the other mode
-	 * lists.  How great is that?
-	 */
-	for (last = scrn->modes; last && last->next; last = last->next)
-	    ;
-	last->next = scrn->modes;
-	scrn->modes->prev = last;
-	if (mode) {
-	    while (scrn->modes != mode)
-		scrn->modes = scrn->modes->next;
-	}
+    if (!scrn->modes) {
+	scrn->modes = xf86ModesAdd(scrn->modes,
+				   xf86CVTMode(scrn->display->virtualX,
+					       scrn->display->virtualY,
+					       60, 0, 0));
+    }
+
+    /* For some reason, scrn->modes is circular, unlike the other mode
+     * lists.  How great is that?
+     */
+    for (last = scrn->modes; last && last->next; last = last->next)
+	;
+    last->next = scrn->modes;
+    scrn->modes->prev = last;
+    if (mode) {
+	while (scrn->modes != mode)
+	    scrn->modes = scrn->modes->next;
     }
+
     scrn->currentMode = scrn->modes;
 #ifdef XFreeXDGA
     if (scrn->pScreen)
@@ -2529,16 +2535,7 @@ xf86InitialConfiguration (ScrnInfoPtr scrn, Bool canGrow)
 			      width, height);
     }
 
-    if (have_outputs) {
-	/* Mirror output modes to scrn mode list */
-	xf86SetScrnInfoModes (scrn);
-    } else {
-	/* Clear any existing modes from scrn->modes */
-	while (scrn->modes != NULL)
-	    xf86DeleteMode(&scrn->modes, scrn->modes);
-	scrn->modes = xf86ModesAdd(scrn->modes,
-				   xf86CVTMode(width, height, 60, 0, 0));
-    }
+    xf86SetScrnInfoModes (scrn);
 
     success = TRUE;
  bailout:

commit c68a84e73d1ebb2f75cdc4c3d8576a15b31ab3f7
Author: Jeremy Huddleston <jeremyhu@apple.com>
Date:   Fri Nov 4 10:24:08 2011 -0700

    configure.ac: Bump to 1.11.2
    
    Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>

diff --git a/configure.ac b/configure.ac
index 5b6e39c..f0a14c4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,8 +26,8 @@ dnl
 dnl Process this file with autoconf to create configure.
 
 AC_PREREQ(2.57)
-AC_INIT([xorg-server], 1.11.1.902, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
-RELEASE_DATE="2011-10-28"
+AC_INIT([xorg-server], 1.11.2, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
+RELEASE_DATE="2011-11-04"
 AC_CONFIG_SRCDIR([Makefile.am])
 AM_INIT_AUTOMAKE([foreign dist-bzip2])
 AM_MAINTAINER_MODE

commit 2d6760f591a4138b2f4a32220e6a5aa855c123ca
Author: Jeremy Huddleston <jeremyhu@apple.com>
Date:   Thu Nov 3 15:01:35 2011 -0700


Reply to: