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

xorg-server: Changes to 'upstream-experimental'



Rebased ref, commits from common ancestor:
commit a71dbc03e65cf7b0654a6eca93ce0bf6a1711ffa
Author: Keith Packard <keithp@keithp.com>
Date:   Thu Jul 1 08:27:05 2010 -0400

    Bump to version 1.8.99.904 (1.9 RC4)
    
    Signed-off-by: Keith Packard <keithp@keithp.com>

diff --git a/configure.ac b/configure.ac
index 5c18a12..b3b752c 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.8.99.903, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
-RELEASE_DATE="2010-06-22"
+AC_INIT([xorg-server], 1.8.99.904, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
+RELEASE_DATE="2010-07-01"
 AC_CONFIG_SRCDIR([Makefile.am])
 AM_INIT_AUTOMAKE([foreign dist-bzip2])
 AM_MAINTAINER_MODE

commit 5ea497fc32202ff19c2b7d8ef4eba08889108a87
Author: Tiago Vignatti <tiago.vignatti@nokia.com>
Date:   Tue Jun 29 16:08:02 2010 +0300

    xfree86: configure: remove vendor and card name matching rules
    
    Although vendor and board naming are used to create the configure file, the
    server doesn't actually use it when fetching such file and probing devices.
    
    Reported-by: Richard Barnette <jrbarnette@chromium.org>
    Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
    Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
    Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
    Tested-by: Richard Barnette <jrbarnette@chromium.org>
    Signed-off-by: Keith Packard <keithp@keithp.com>

diff --git a/hw/xfree86/common/xf86Configure.c b/hw/xfree86/common/xf86Configure.c
index 822d767..da654f0 100644
--- a/hw/xfree86/common/xf86Configure.c
+++ b/hw/xfree86/common/xf86Configure.c
@@ -107,8 +107,6 @@ bus_sbus_configure(void *busData)
 static void
 bus_pci_newdev_configure(void *busData, int i, int *chipset)
 {
-	const char *VendorName;
-	const char *CardName;
 	char busnum[8];
     struct pci_device * pVideo = NULL;
 
@@ -116,26 +114,6 @@ bus_pci_newdev_configure(void *busData, int i, int *chipset)
 
 	DevToConfig[i].pVideo = pVideo;
 
-	VendorName = pci_device_get_vendor_name( pVideo );
-	CardName = pci_device_get_device_name( pVideo );
-
-	if (!VendorName) {
-	    VendorName = xnfalloc(15);
-	    sprintf((char*)VendorName, "Unknown Vendor");
-	}
-
-	if (!CardName) {
-	    CardName = xnfalloc(14);
-	    sprintf((char*)CardName, "Unknown Board");
-	}
-
-	DevToConfig[i].GDev.identifier =
-	    xnfalloc(strlen(VendorName) + strlen(CardName) + 2);
-	sprintf(DevToConfig[i].GDev.identifier, "%s %s", VendorName, CardName);
-
-	DevToConfig[i].GDev.vendor = (char *)VendorName;
-	DevToConfig[i].GDev.board = (char *)CardName;
-
 	DevToConfig[i].GDev.busID = xnfalloc(16);
 	xf86FormatPciBusNumber(pVideo->bus, busnum);
 	sprintf(DevToConfig[i].GDev.busID, "PCI:%s:%d:%d",
@@ -357,9 +335,6 @@ configureDeviceSection (int screennum)
     /* Move device info to parser structure */
     sprintf(identifier, "Card%d", screennum);
     ptr->dev_identifier = strdup(identifier);
-/*    ptr->dev_identifier = DevToConfig[screennum].GDev.identifier;*/
-    ptr->dev_vendor = DevToConfig[screennum].GDev.vendor;
-    ptr->dev_board = DevToConfig[screennum].GDev.board;
     ptr->dev_chipset = DevToConfig[screennum].GDev.chipset;
     ptr->dev_busid = DevToConfig[screennum].GDev.busID;
     ptr->dev_driver = DevToConfig[screennum].GDev.driver;

commit 90fd9e40b59e69333d250a795998f44dc3a5dc0c
Author: Tiago Vignatti <tiago.vignatti@nokia.com>
Date:   Tue Jun 29 16:08:01 2010 +0300

    xfree86: pci: remove superfluous vendor and card name logging
    
    X server suffers in startup time when relying on the pciaccess's linear search
    to fetch vendor and video device name from PCI ID file (when existent). Such
    names are only used to write the log, which may be superfluous. This
    information often is provided by the drivers or likewise users can get the it
    using external tools like lspci or scanpci.
    
    This patch remove the references of those functions from X start up.
    
    Reported-by: Richard Barnette <jrbarnette@chromium.org>
    Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
    Tested-by: Richard Barnette <jrbarnette@chromium.org>
    Reviewed-by: James Cloos <cloos@jhcloos.com>
    Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
    Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
    Signed-off-by: Keith Packard <keithp@keithp.com>

diff --git a/hw/xfree86/common/xf86pciBus.c b/hw/xfree86/common/xf86pciBus.c
index 1517951..74016af 100644
--- a/hw/xfree86/common/xf86pciBus.c
+++ b/hw/xfree86/common/xf86pciBus.c
@@ -151,18 +151,13 @@ xf86PciProbe(void)
     
     /* Print a summary of the video devices found */
     for (k = 0; k < num; k++) {
-	const char *vendorname = NULL, *chipname = NULL;
 	const char *prim = " ";
 	Bool memdone = FALSE, iodone = FALSE;
 
 
 	info = xf86PciVideoInfo[k];
 
-	vendorname = pci_device_get_vendor_name( info );
-	chipname = pci_device_get_device_name( info );
-
-	if ((!vendorname || !chipname) &&
-	    !PCIALWAYSPRINTCLASSES(info->device_class))
+	if (!PCIALWAYSPRINTCLASSES(info->device_class))
 	    continue;
 
 	if (xf86IsPrimaryPci(info))
@@ -173,12 +168,6 @@ xf86PciProbe(void)
 		info->vendor_id, info->device_id,
 		info->subvendor_id, info->subdevice_id);
 
-	if (vendorname)
-	    xf86ErrorF("%s ", vendorname);
-
-	if (chipname)
-	    xf86ErrorF("%s ", chipname);
-
 	xf86ErrorF("rev %d", info->revision);
 
 	for (i = 0; i < 6; i++) {

commit f028e70ca714f6956e41754f132cb9b8a1e8db63
Author: Keith Packard <keithp@keithp.com>
Date:   Wed Jun 30 08:33:55 2010 -0700

    Initialize dev privates before using any
    
    Initializing the dev privates code after allocating the server client
    dev privates would cause the memory leak check to fire at server
    startup or reset.
    
    Signed-off-by: Keith Packard <keithp@keithp.com>
    Acked-by: Daniel Stone <daniel@fooishbar.org>

diff --git a/dix/main.c b/dix/main.c
index 5c46dc1..47a932f 100644
--- a/dix/main.c
+++ b/dix/main.c
@@ -184,6 +184,9 @@ int main(int argc, char *argv[], char *envp[])
 	clients[0] = serverClient;
 	currentMaxClients = 1;
 
+	/* Initialize privates before first allocation */
+	dixResetPrivates();
+
 	/* Initialize server client devPrivates, to be reallocated as
 	 * more client privates are registered
 	 */
@@ -200,7 +203,6 @@ int main(int argc, char *argv[], char *envp[])
 	InitEvents();
 	InitSelections();
 	InitGlyphCaching();
-	dixResetPrivates();
 	dixResetRegistry();
 	ResetFontPrivateIndex();
 	InitCallbackManager();

commit 433d0851cd3e61d841ff374ee0a0f052d5907029
Author: Julien Cristau <jcristau@debian.org>
Date:   Fri Jun 25 11:34:44 2010 +0100

    Xephyr: fix Xv adaptor capability tests
    
    Signed-off-by: Julien Cristau <jcristau@debian.org>
    Reviewed-by: Keith Packard <keithp@keithp.com>
    Signed-off-by: Keith Packard <keithp@keithp.com>

diff --git a/hw/kdrive/ephyr/ephyrhostvideo.c b/hw/kdrive/ephyr/ephyrhostvideo.c
index 9dde768..600b50f 100644
--- a/hw/kdrive/ephyr/ephyrhostvideo.c
+++ b/hw/kdrive/ephyr/ephyrhostvideo.c
@@ -380,7 +380,8 @@ ephyrHostXVAdaptorHasPutVideo (const EphyrHostXVAdaptor *a_this,
 {
     EPHYR_RETURN_VAL_IF_FAIL (a_this && a_result, FALSE) ;
 
-    if (((XvAdaptorInfo*)a_this)->type & XvVideoMask & XvInputMask)
+    if ((((XvAdaptorInfo*)a_this)->type & (XvVideoMask | XvInputMask)) ==
+		    (XvVideoMask | XvInputMask))
         *a_result = TRUE ;
     else
         *a_result = FALSE ;
@@ -391,7 +392,8 @@ Bool
 ephyrHostXVAdaptorHasGetVideo (const EphyrHostXVAdaptor *a_this,
                                Bool *a_result)
 {
-    if (((XvAdaptorInfo*)a_this)->type & XvVideoMask & XvOutputMask)
+    if ((((XvAdaptorInfo*)a_this)->type & (XvVideoMask | XvOutputMask)) ==
+		    (XvVideoMask | XvOutputMask))
         *a_result = TRUE ;
     else
         *a_result = FALSE ;
@@ -404,7 +406,8 @@ ephyrHostXVAdaptorHasPutStill (const EphyrHostXVAdaptor *a_this,
 {
     EPHYR_RETURN_VAL_IF_FAIL (a_this && a_result, FALSE) ;
 
-    if (((XvAdaptorInfo*)a_this)->type & XvStillMask && XvInputMask)
+    if ((((XvAdaptorInfo*)a_this)->type & (XvStillMask | XvInputMask)) ==
+		    (XvStillMask | XvInputMask))
         *a_result = TRUE ;
     else
         *a_result = FALSE ;
@@ -417,7 +420,8 @@ ephyrHostXVAdaptorHasGetStill (const EphyrHostXVAdaptor *a_this,
 {
     EPHYR_RETURN_VAL_IF_FAIL (a_this && a_result, FALSE) ;
 
-    if (((XvAdaptorInfo*)a_this)->type & XvStillMask && XvOutputMask)
+    if ((((XvAdaptorInfo*)a_this)->type & (XvStillMask | XvOutputMask)) ==
+		    (XvStillMask | XvOutputMask))
         *a_result = TRUE ;
     else
         *a_result = FALSE ;
@@ -430,7 +434,8 @@ ephyrHostXVAdaptorHasPutImage (const EphyrHostXVAdaptor *a_this,
 {
     EPHYR_RETURN_VAL_IF_FAIL (a_this && a_result, FALSE) ;
 
-    if (((XvAdaptorInfo*)a_this)->type & XvImageMask && XvInputMask)
+    if ((((XvAdaptorInfo*)a_this)->type & (XvImageMask | XvInputMask)) ==
+		    (XvImageMask | XvInputMask))
         *a_result = TRUE ;
     else
         *a_result = FALSE ;

commit 9626eedebf620559652ffb1fefa82b5d659e57be
Author: Julien Cristau <jcristau@debian.org>
Date:   Thu Jun 24 18:45:11 2010 +0100

    configure: bail if Xephyr was requested but its dependencies are missing
    
    Signed-off-by: Julien Cristau <jcristau@debian.org>
    Reviewed-by: Jamey Sharp <jamey@minilop.net>
    Signed-off-by: Keith Packard <keithp@keithp.com>

diff --git a/configure.ac b/configure.ac
index 4491e90..5c18a12 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2073,6 +2073,9 @@ if test "$KDRIVE" = yes; then
     if test "x$XEPHYR" = xauto; then
         XEPHYR=$xephyr
     fi
+    if test "x$XEPHYR" = xyes && test "x$xephyr" = xno; then	
+        AC_MSG_ERROR([Xephyr dependencies missing])
+    fi
 
     # Xephyr needs nanosleep() which is in librt on Solaris
     AC_CHECK_FUNC([nanosleep], [],

commit e6531ae9d5bdd37775e921268366fb76056e22d5
Author: Julien Cristau <jcristau@debian.org>
Date:   Thu Jun 24 18:45:10 2010 +0100

    Xephyr: fix memory leak in XF86DRIOpenConnection
    
    The allocated bus id string was not being freed.
    
    Signed-off-by: Julien Cristau <jcristau@debian.org>
    Reviewed-by: Jamey Sharp <jamey@minilop.net>
    Signed-off-by: Keith Packard <keithp@keithp.com>

diff --git a/hw/kdrive/ephyr/ephyrdriext.c b/hw/kdrive/ephyr/ephyrdriext.c
index 4041bf5..ce584b0 100644
--- a/hw/kdrive/ephyr/ephyrdriext.c
+++ b/hw/kdrive/ephyr/ephyrdriext.c
@@ -682,7 +682,7 @@ ProcXF86DRIOpenConnection (register ClientPtr client)
 {
     xXF86DRIOpenConnectionReply rep;
     drm_handle_t			hSAREA;
-    char*			busIdString;
+    char*			busIdString = NULL;
     REQUEST(xXF86DRIOpenConnectionReq);
     REQUEST_SIZE_MATCH(xXF86DRIOpenConnectionReq);
 
@@ -716,6 +716,7 @@ ProcXF86DRIOpenConnection (register ClientPtr client)
     WriteToClient(client, sizeof(xXF86DRIOpenConnectionReply), (char *)&rep);
     if (rep.busIdStringLength)
         WriteToClient(client, rep.busIdStringLength, busIdString);
+    free(busIdString);
     EPHYR_LOG ("leave\n") ;
     return Success;
 }

commit 390a8466dd1914f4786b811ff8454f6e0c4b6b04
Author: Ville Syrjälä <ville.syrjala@nokia.com>
Date:   Mon Jun 28 23:26:48 2010 +0300

    xfree86/modes: Allow the driver to specify initial rotation
    
    When the "Rotate" option isn't specified allow the driver to specify
    the initial rotation mode. This way the driver can choose to retain
    the same settings that were used by software that was used prior to
    starting X.
    
    Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
    Reviewed-by: Keith Packard <keithp@keithp.com>
    Signed-off-by: Keith Packard <keithp@keithp.com>

diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index 7f6fad3..b2daec7 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -572,8 +572,11 @@ xf86OutputInitialRotation (xf86OutputPtr output)
 						OPTION_ROTATE);
     int	    i;
 
-    if (!rotate_name)
+    if (!rotate_name) {
+	if (output->initial_rotation)
+	    return output->initial_rotation;
 	return RR_Rotate_0;
+    }
     
     for (i = 0; i < 4; i++)
 	if (xf86nameCompare (direction[i], rotate_name) == 0)

commit 6052710670953b43b4fff5d101b727163fcb1187
Author: Keith Packard <keithp@keithp.com>
Date:   Wed Jun 30 08:21:04 2010 -0700

    xkb: merge lockedPtrButtons state from all attached SDs.
    
    Problem:
    lockedPtrButtons keeps the state of the buttons locked by a PointerKeys button
    press. Unconditionally clearing the bits may cause stuck buttons in this
    sequence of events:
    
    1. type Shift + NumLock to enable PointerKeys
    2. type 0/Ins on keypad to emulate Button 1 press
            → button1 press event to client
    3. press and release button 1 on physical mouse
            → button1 release event to client
    
    Button 1 on the MD is now stuck and cannot be released.
    
    Cause:
    XKB PointerKeys button events are posted through the XTEST pointer device.
    Once a press is generated, the XTEST device's button is down. The DIX merges
    the button state of all attached SDs, hence the MD will have a button down
    while the XTEST device has a button down.
    
    PointerKey button events are only generated on the master device to avoid
    duplicate events (see XkbFakeDeviceButton()). If the MD has the
    lockedPtrButtons bit cleared by a release event on a physical device, no
    such event is generated when a keyboard device triggers the PointerKey
    ButtonRelease trigger. Since the event - if generated - is posted through
    the XTEST pointer device, lack of a generated ButtonRelease event on the
    XTEST pointer device means the button is never released, resulting in the
    stuck button observed above.
    
    Solution:
    This patch merges the MD's lockedPtrButtons with the one of all attached
    slave devices on release events. Thus, as long as one attached keyboard has
    a lockedPtrButtons bit set, this bit is kept in the MD. Once a PointerKey
    button is released on all keyboards, the matching release event is emulated
    from the MD through the XTEST pointer device, thus also releasing the button
    in the DIX.
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: Keith Packard <keithp@keithp.com>
    Signed-off-by: Keith Packard <keithp@keithp.com>

diff --git a/include/xkbsrv.h b/include/xkbsrv.h
index 5847e63..956b224 100644
--- a/include/xkbsrv.h
+++ b/include/xkbsrv.h
@@ -924,6 +924,9 @@ extern int XkbGetEffectiveGroup(
         XkbStatePtr             /* xkbstate */,
         CARD8                   /* keycode */);
 
+extern void XkbMergeLockedPtrBtns(
+        DeviceIntPtr            /* master */);
+
 #include "xkbfile.h"
 #include "xkbrules.h"
 
diff --git a/xkb/xkbAccessX.c b/xkb/xkbAccessX.c
index b5486b7..451c797 100644
--- a/xkb/xkbAccessX.c
+++ b/xkb/xkbAccessX.c
@@ -707,8 +707,24 @@ DeviceEvent     *event = &ev->device_event;
 	    changed |= XkbPointerButtonMask;
     }
     else if (event->type == ET_ButtonRelease) {
-	if (xkbi)
+	if (xkbi) {
 	    xkbi->lockedPtrButtons&= ~(1 << (event->detail.key & 0x7));
+
+            /* Merge this MD's lockedPtrButtons with the one of all
+             * attached slave devices.
+             * The DIX uses a merged button state for MDs, not
+             * releasing buttons until the last SD has released
+             * thenm. If we unconditionally clear the
+             * lockedPtrButtons bit on the MD, a PointerKeys button
+             * release on the SD keyboard won't generate the required fake button
+             * event on the XTEST pointer, thus never processing the
+             * button event in the DIX and the XTEST pointer's
+             * buttons stay down - result is a stuck button.
+             */
+	    if (IsMaster(dev))
+                XkbMergeLockedPtrBtns(dev);
+	}
+
 	changed |= XkbPointerButtonMask;
     }
 
diff --git a/xkb/xkbActions.c b/xkb/xkbActions.c
index c5030d0..b4b8395 100644
--- a/xkb/xkbActions.c
+++ b/xkb/xkbActions.c
@@ -633,6 +633,16 @@ _XkbFilterPointerBtn(	XkbSrvInfoPtr	xkbi,
 		    break;
 		}
 		xkbi->lockedPtrButtons&= ~(1<<button);
+
+		if (IsMaster(xkbi->device))
+		{
+		    XkbMergeLockedPtrBtns(xkbi->device);
+                    /* One SD still has lock set, don't post event */
+		    if ((xkbi->lockedPtrButtons & (1 << button)) != 0)
+			break;
+		}
+
+		/* fallthrough */
 	    case XkbSA_PtrBtn:
 		XkbFakeDeviceButton(xkbi->device, 0, button);
 		break;
diff --git a/xkb/xkbUtils.c b/xkb/xkbUtils.c
index 3344e50..14dc784 100644
--- a/xkb/xkbUtils.c
+++ b/xkb/xkbUtils.c
@@ -2094,3 +2094,29 @@ XkbGetEffectiveGroup(XkbSrvInfoPtr xkbi, XkbStatePtr xkbState, CARD8 keycode)
 
     return effectiveGroup;
 }
+
+/* Merge the lockedPtrButtons from all attached SDs for the given master
+ * device into the MD's state.
+ */
+void
+XkbMergeLockedPtrBtns(DeviceIntPtr master)
+{
+    DeviceIntPtr d = inputInfo.devices;
+    XkbSrvInfoPtr xkbi = NULL;
+
+    if (!IsMaster(master))
+        return;
+
+    if (!master->key)
+        return;
+
+    xkbi = master->key->xkbInfo;
+    xkbi->lockedPtrButtons = 0;
+
+    for (; d; d = d->next) {
+        if (IsMaster(d) || GetMaster(d, MASTER_KEYBOARD) != master || !d->key)
+            continue;
+
+        xkbi->lockedPtrButtons |= d->key->xkbInfo->lockedPtrButtons;
+    }
+}

commit 28e33ae6f69f716ece5d68e63fc52557236c5f6e
Author: Jesse Barnes <jbarnes@virtuousgeek.org>
Date:   Wed Jun 30 07:59:04 2010 -0700

    OS support: fix writeable client vs IgnoreClient behavior
    
    When ResetCurrentRequest is called, or IgnoreClient is called when a
    client has input pending, IgnoredClientsWithInput will be set.  However,
    a subsequent IgnoreClient request will clear the client fd from that fd
    set, potentially causing the client to hang.
    
    So add an Ignore/Attend count, and only apply the ignore logic on the
    first ignore and the attend logic on the last attend.  This is
    consistent with the comments for these functions; callers must pair
    them.
    
    Fixes https://bugs.freedesktop.org/show_bug.cgi?id=27035.
    
    Reviewed-by: Keith Packard <keithp@keithp.com>
    Reviewed-by: Daniel Stone <daniel@fooishbar.org>
    Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
    Signed-off-by: Keith Packard <keithp@keithp.com>

diff --git a/include/dixstruct.h b/include/dixstruct.h
index 9610427..efa2577 100644
--- a/include/dixstruct.h
+++ b/include/dixstruct.h
@@ -98,6 +98,7 @@ typedef struct _Client {
     int         clientGone;
     int         noClientException;	/* this client died or needs to be
 					 * killed */
+    int         ignoreCount;		/* count for Attend/IgnoreClient */
     SaveSetElt	*saveSet;
     int         numSaved;
     int         (**requestVector) (
diff --git a/os/connection.c b/os/connection.c
index cd0ca5e..c143fb6 100644
--- a/os/connection.c
+++ b/os/connection.c
@@ -1147,6 +1147,10 @@ IgnoreClient (ClientPtr client)
     OsCommPtr oc = (OsCommPtr)client->osPrivate;
     int connection = oc->fd;
 
+    client->ignoreCount++;
+    if (client->ignoreCount > 1)
+	return;
+
     isItTimeToYield = TRUE;
     if (!GrabInProgress || FD_ISSET(connection, &AllClients))
     {
@@ -1181,6 +1185,11 @@ AttendClient (ClientPtr client)
 {
     OsCommPtr oc = (OsCommPtr)client->osPrivate;
     int connection = oc->fd;
+
+    client->ignoreCount--;
+    if (client->ignoreCount)
+	return;
+
     if (!GrabInProgress || GrabInProgress == client->index ||
 	FD_ISSET(connection, &GrabImperviousClients))
     {

commit 018c878e9495b21146c8f38617fdd1bf6d8cc73b
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Fri Jun 25 09:48:10 2010 +1000

    Revert "dix: use the event mask of the grab for TryClientEvents."
    
    Behaviour of earlier X servers was to deliver the ButtonPress event
    unconditionally, regardless of the actual event mask being set. Thus, a
    GrabButton event will always deliver the button press event, a GrabKey
    always the key press event, etc. Same goes for XI and XI2.
    
    Reproducible with a simple client requesting a button grab in the form of:
        XGrabButton(dpy, AnyButton, AnyModifier, win, True, ButtonReleaseMask,
                    GrabModeAsync, GrabModeAsync, None, None);
    
    On servers before MPX/XI2, the client will receive a button press and
    release event. On current servers, the client receives only the release.
    Clients that expect the press event to be delivered unconditionally may
    leave the user with a stuck grab.
    
    XTS test results for XGrabButton are identical with and without this patch.
    
    This reverts commit 48585bd1e3e98db0f3df1ecc68022510216e00cc.
    
    Conflicts:
    
    	dix/events.c
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: Keith Packard <keithp@keithp.com>
    Signed-off-by: Keith Packard <keithp@keithp.com>

diff --git a/dix/events.c b/dix/events.c
index ae9847c..e1c3d0a 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -3420,7 +3420,6 @@ CheckPassiveGrabsOnWindow(
     {
 	DeviceIntPtr	gdev;
 	XkbSrvInfoPtr	xkbi = NULL;
-	Mask		mask = 0;
 
 	gdev= grab->modifierDevice;
         if (grab->grabtype == GRABTYPE_CORE)
@@ -3535,9 +3534,6 @@ CheckPassiveGrabsOnWindow(
                 }
                 xE = &core;
                 count = 1;
-                mask = grab->eventMask;
-                if (grab->ownerEvents)
-                    mask |= pWin->eventMask;
             } else if (match & XI2_MATCH)
             {
                 rc = EventToXI2((InternalEvent*)event, &xE);
@@ -3549,34 +3545,6 @@ CheckPassiveGrabsOnWindow(
                     continue;
                 }
                 count = 1;
-
-                /* FIXME: EventToXI2 returns NULL for enter events, so
-                 * dereferencing the event is bad. Internal event types are
-                 * aligned with core events, so the else clause is valid.
-                 * long-term we should use internal events for enter/focus
-                 * as well */
-                if (xE)
-                    mask = grab->xi2mask[device->id][((xGenericEvent*)xE)->evtype/8];
-                else if (event->type == XI_Enter || event->type == XI_FocusIn)
-                    mask = grab->xi2mask[device->id][event->type/8];
-
-                if (grab->ownerEvents && wOtherInputMasks(grab->window))
-                {
-                    InputClientsPtr icp =
-                        wOtherInputMasks(grab->window)->inputClients;
-
-                    while(icp)
-                    {
-                        if (rClient(icp) == rClient(grab))
-                        {
-                            int evtype = (xE) ? ((xGenericEvent*)xE)->evtype : event->type;
-                            mask |= icp->xi2mask[device->id][evtype/8];
-                            break;
-                        }
-
-                        icp = icp->next;
-                    }
-                }
             } else
             {
                 rc = EventToXI((InternalEvent*)event, &xE, &count);
@@ -3587,23 +3555,6 @@ CheckPassiveGrabsOnWindow(
                                 "(%d, %d).\n", device->name, event->type, rc);
                     continue;
                 }
-                mask = grab->eventMask;
-                if (grab->ownerEvents && wOtherInputMasks(grab->window))
-                {
-                    InputClientsPtr icp =
-                        wOtherInputMasks(grab->window)->inputClients;
-
-                    while(icp)
-                    {
-                        if (rClient(icp) == rClient(grab))
-                        {
-                            mask |= icp->mask[device->id];
-                            break;
-                        }
-
-                        icp = icp->next;
-                    }
-                }
             }
 
 	    (*grabinfo->ActivateGrab)(device, grab, currentTime, TRUE);
@@ -3612,7 +3563,8 @@ CheckPassiveGrabsOnWindow(
             {
                 FixUpEventFromWindow(device, xE, grab->window, None, TRUE);
 
-                TryClientEvents(rClient(grab), device, xE, count, mask,
+                TryClientEvents(rClient(grab), device, xE, count,
+                                       GetEventFilter(device, xE),
                                        GetEventFilter(device, xE), grab);
             }
 

commit 3b3c77b87070ddcdbb2acb114a81628485e7a129
Author: Tiago Vignatti <tiago.vignatti@Nokia.com>
Date:   Wed Jun 23 15:18:04 2010 +0300

    configure: don't check xfont always for each server
    
    It's already defined inside REQUIRED_LIBS and all DDX are getting it already.
    No semantical changes.
    
    Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
    Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
    Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
    Signed-off-by: Keith Packard <keithp@keithp.com>

diff --git a/configure.ac b/configure.ac
index 415168a..4491e90 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1515,7 +1515,7 @@ fi
 
 dnl Xnest DDX
 
-PKG_CHECK_MODULES(XNESTMODULES, [xfont $LIBXEXT x11 xau $XDMCP_MODULES], [have_xnest=yes], [have_xnest=no])
+PKG_CHECK_MODULES(XNESTMODULES, [$LIBXEXT x11 xau $XDMCP_MODULES], [have_xnest=yes], [have_xnest=no])
 AC_MSG_CHECKING([whether to build Xnest DDX])
 if test "x$XNEST" = xauto; then
 	XNEST="$have_xnest"
@@ -1867,7 +1867,7 @@ if test "x$XWIN" = xyes; then
 	AC_DEFINE_UNQUOTED(__VENDORDWEBSUPPORT__, ["$VENDOR_WEB"], [Vendor web address for support])
 	AC_CHECK_TOOL(WINDRES, windres)
 
-	PKG_CHECK_MODULES([XWINMODULES],[x11 xdmcp xau xfont])
+	PKG_CHECK_MODULES([XWINMODULES],[x11 xdmcp xau])
 
 	if test "x$WINDOWSWM" = xauto; then
 		PKG_CHECK_EXISTS($WINDOWSWMPROTO, [WINDOWSWM=yes], [WINDOWSWM=no])
@@ -1956,7 +1956,7 @@ AM_CONDITIONAL(STANDALONE_XPBPROXY, [test "x$STANDALONE_XPBPROXY" = xyes])
 dnl DMX DDX
 PKG_CHECK_MODULES(
 	[DMXMODULES],
-	[xmuu $LIBXEXT x11 xrender xfixes xfont $LIBXI $DMXPROTO xau $XDMCP_MODULES],
+	[xmuu $LIBXEXT x11 xrender xfixes $LIBXI $DMXPROTO xau $XDMCP_MODULES],
 	[PKG_CHECK_MODULES(
 		[XDMXCONFIG_DEP],
 		[xaw7 xmu xt xpm x11],
@@ -2061,7 +2061,7 @@ if test "$KDRIVE" = yes; then
        AC_DEFINE(KDRIVE_MOUSE, 1, [Enable KDrive mouse driver])
     fi
 
-    XEPHYR_REQUIRED_LIBS="x11 $LIBXEXT xfont xau xdmcp"
+    XEPHYR_REQUIRED_LIBS="x11 $LIBXEXT xau xdmcp"
     if test "x$XV" = xyes; then
         XEPHYR_REQUIRED_LIBS="$XEPHYR_REQUIRED_LIBS xv"
     fi

commit 75536ee80595c79bba95a1fb6844126ee08486d4
Author: Tiago Vignatti <tiago.vignatti@nokia.com>
Date:   Wed Jun 23 15:18:03 2010 +0300

    dix: use one single function to register fpe fonts
    
    X server doesn't need to understand fpe internals, so use
    register_fpe_functions from libXfont.
    
    It's required to get new version of libXfont, therefore adjust it to be passed
    to autoconf.
    
    Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
    Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
    Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
    Signed-off-by: Keith Packard <keithp@keithp.com>

diff --git a/configure.ac b/configure.ac
index 1a1f2d3..415168a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -794,9 +794,6 @@ APPLEWMPROTO="applewmproto >= 1.4"
 
 dnl Core modules for most extensions, et al.
 SDK_REQUIRED_MODULES="[xproto >= 7.0.17] [randrproto >= 1.2.99.3] [renderproto >= 0.11] [xextproto >= 7.0.99.3] [inputproto >= 1.9.99.902] [kbproto >= 1.0.3] fontsproto"
-REQUIRED_MODULES="[fixesproto >= 4.1] [damageproto >= 1.1] [xcmiscproto >= 1.2.0] [xtrans >= 1.2.2] [bigreqsproto >= 1.1.0] $SDK_REQUIRED_MODULES"
-REQUIRED_LIBS="xfont xau"
-
 # Make SDK_REQUIRED_MODULES available for inclusion in xorg-server.pc
 AC_SUBST(SDK_REQUIRED_MODULES)
 
@@ -807,6 +804,7 @@ LIBDRI="dri >= 7.8.0"
 LIBDRM="libdrm >= 2.3.0"
 LIBGL="gl >= 7.1.0"
 LIBXEXT="xext >= 1.0.99.4"
+LIBXFONT="xfont >= 1.4.2"
 LIBXI="xi >= 1.2.99.1"
 LIBXTST="xtst >= 1.0.99.2"
 LIBPCIACCESS="pciaccess >= 0.8.0"
@@ -819,7 +817,9 @@ LIBPIXMAN="pixman-1 >= 0.15.20"
 dnl Pixman is always required, but we separate it out so we can link
 dnl specific modules against it
 PKG_CHECK_MODULES(PIXMAN, $LIBPIXMAN)
-REQUIRED_LIBS="$REQUIRED_LIBS $LIBPIXMAN"
+REQUIRED_LIBS="$REQUIRED_LIBS $LIBPIXMAN $LIBXFONT xau"
+
+REQUIRED_MODULES="[fixesproto >= 4.1] [damageproto >= 1.1] [xcmiscproto >= 1.2.0] [xtrans >= 1.2.2] [bigreqsproto >= 1.1.0] $SDK_REQUIRED_MODULES"
 
 if test "x$CONFIG_UDEV" = xyes &&
  { test "x$CONFIG_DBUS_API" = xyes || test "x$CONFIG_HAL" = xyes; }; then
diff --git a/dix/dixfonts.c b/dix/dixfonts.c
index b51ad84..4a8f113 100644
--- a/dix/dixfonts.c
+++ b/dix/dixfonts.c
@@ -1924,9 +1924,7 @@ InitFonts (void)
 {
     patternCache = MakeFontPatternCache();
 
-    BuiltinRegisterFpeFunctions();
-    FontFileRegisterFpeFunctions();
-    fs_register_fpe_functions();
+    register_fpe_functions();
 }
 
 int
diff --git a/include/dixfont.h b/include/dixfont.h
index cf86f54..617b94a 100644
--- a/include/dixfont.h
+++ b/include/dixfont.h
@@ -141,10 +141,7 @@ extern _X_EXPORT void InitGlyphCaching(void);
 
 extern _X_EXPORT void SetGlyphCachingMode(int /*newmode*/);
 
-/*
- * libXfont/src/builtins/builtin.h
- */
-extern _X_EXPORT void BuiltinRegisterFpeFunctions(void);
+extern _X_EXPORT void register_fpe_functions(void);
 
 /*
  * libXfont stubs.

commit a68a101a730df7f73421555e381a50b074607c5e
Author: Keith Packard <keithp@keithp.com>
Date:   Tue Jun 22 12:13:26 2010 -0700

    Bump to 1.8.99.903 -- 1.9 RC3
    
    Signed-off-by: Keith Packard <keithp@keithp.com>

diff --git a/configure.ac b/configure.ac
index 95a9444..1a1f2d3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,7 +26,7 @@ dnl
 dnl Process this file with autoconf to create configure.
 
 AC_PREREQ(2.57)
-AC_INIT([xorg-server], 1.8.99.902, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
+AC_INIT([xorg-server], 1.8.99.903, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
 RELEASE_DATE="2010-06-22"
 AC_CONFIG_SRCDIR([Makefile.am])
 AM_INIT_AUTOMAKE([foreign dist-bzip2])

commit 2c0159d21788b16607e6ebe4571b57fe78545c2a
Author: Kristian Høgsberg <krh@bitplanet.net>
Date:   Mon Jun 14 09:25:22 2010 -0400

    list.h: Fix list_for_each_entry_safe()
    
    Can't use next as a macro argument since we're accessing the .next field
    of struct list.
    
    Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
    Reviewed-by: Keith Packard <keithp@keithp.com>
    Signed-off-by: Keith Packard <keithp@keithp.com>

diff --git a/include/list.h b/include/list.h
index 89dc29d..4ce20a8 100644
--- a/include/list.h
+++ b/include/list.h
@@ -94,10 +94,10 @@ list_is_empty(struct list *head)
 	 &pos->member != (head);					\
 	 pos = __container_of(pos->member.next, pos, member))
 
-#define list_for_each_entry_safe(pos, next, head, member)		\
+#define list_for_each_entry_safe(pos, tmp, head, member)		\
     for (pos = __container_of((head)->next, pos, member),		\
-	 next = __container_of(pos->member.next, pos, member);		\
+	 tmp = __container_of(pos->member.next, pos, member);		\
 	 &pos->member != (head);					\
-	 pos = next, next = __container_of(next->member.next, next, member))
+	 pos = tmp, tmp = __container_of(pos->member.next, tmp, member))
 
 #endif

commit e2918b67395a48397bf7db545584cc2d4f4e7ccf
Author: Keith Packard <keithp@keithp.com>
Date:   Tue Jun 22 12:11:20 2010 -0700

    Revert "mi: Remove unused overlay support"
    
    This reverts commit 9120e58556014e514eef9dfe43cdea4b74dc66ae.
    
     Whoops, please revert this patch -- overlay is in use in nvidia drivers,
     and it's too late in release cycle to remove it.
    
     I feel really sorry that I kept this patch in my tree. I will submit
    another one, removing only XAA overlay hooks which are not used at all.

diff --git a/hw/xfree86/loader/sdksyms.sh b/hw/xfree86/loader/sdksyms.sh
index 4245031..13c5ae5 100755
--- a/hw/xfree86/loader/sdksyms.sh
+++ b/hw/xfree86/loader/sdksyms.sh
@@ -231,6 +231,7 @@ cat > sdksyms.c << EOF
 #include "miwideline.h"
 #include "mistruct.h"
 #include "mifpoly.h"
+#include "mioverlay.h"
 
 
 /* randr/Makefile.am */
diff --git a/hw/xfree86/xaa/xaaOverlay.c b/hw/xfree86/xaa/xaaOverlay.c
index 58c4a58..4b52bf6 100644
--- a/hw/xfree86/xaa/xaaOverlay.c
+++ b/hw/xfree86/xaa/xaaOverlay.c
@@ -16,6 +16,7 @@
 #include "xaawrap.h"
 #include "gcstruct.h"
 #include "pixmapstr.h"
+#include "mioverlay.h"
 
 #ifdef PANORAMIX
 #include "panoramiX.h"
@@ -36,6 +37,7 @@ XAACopyWindow8_32(
     ScreenPtr pScreen = pWin->drawable.pScreen;
     XAAInfoRecPtr infoRec = 
 	GET_XAAINFORECPTR_FROM_DRAWABLE((&pWin->drawable));
+    Bool doUnderlay = miOverlayCopyUnderlay(pScreen);
     RegionPtr borderClip = &pWin->borderClip;
     Bool freeReg = FALSE;
 
@@ -54,6 +56,9 @@ XAACopyWindow8_32(
 
     pwinRoot = pScreen->root;
 
+    if(doUnderlay)
+	freeReg = miOverlayCollectUnderlayRegions(pWin, &borderClip);
+
     RegionNull(&rgnDst);
 
     dx = ptOldOrg.x - pWin->drawable.x;
@@ -76,7 +81,7 @@ XAACopyWindow8_32(
 	ppt++; pbox++;
     }
     
-    infoRec->ScratchGC.planemask = 0xff000000;
+    infoRec->ScratchGC.planemask = doUnderlay ? 0x00ffffff : 0xff000000;
     infoRec->ScratchGC.alu = GXcopy;
 
     XAADoBitBlt((DrawablePtr)pwinRoot, (DrawablePtr)pwinRoot,
@@ -88,6 +93,25 @@ XAACopyWindow8_32(
 	RegionDestroy(borderClip);
 }
 
+static void
+XAASetColorKey8_32(
+    ScreenPtr pScreen,
+    int nbox,
+    BoxPtr pbox
+){
+    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
+    ScrnInfoPtr pScrn = infoRec->pScrn;
+
+    /* I'm counting on writes being clipped away while switched away.
+       If this isn't going to be true then I need to be wrapping instead. */
+    if(!infoRec->pScrn->vtSema) return;
+
+    (*infoRec->FillSolidRects)(pScrn, pScrn->colorKey << 24, GXcopy, 
+					0xff000000, nbox, pbox);
+  
+    SET_SYNC_FLAG(infoRec);
+}
+
 void
 XAASetupOverlay8_32Planar(ScreenPtr pScreen)
 {
@@ -96,6 +120,9 @@ XAASetupOverlay8_32Planar(ScreenPtr pScreen)
 
     pScreen->CopyWindow = XAACopyWindow8_32;
 
+    if(!(infoRec->FillSolidRectsFlags & NO_PLANEMASK))
+	miOverlaySetTransFunction(pScreen, XAASetColorKey8_32);
+
     infoRec->FullPlanemask = ~0;
     for(i = 0; i < 32; i++) /* haven't thought about this much */
 	infoRec->FullPlanemasks[i] = ~0;
diff --git a/mi/Makefile.am b/mi/Makefile.am
index 8319226..f6dabda 100644
--- a/mi/Makefile.am
+++ b/mi/Makefile.am
@@ -3,7 +3,7 @@ noinst_LTLIBRARIES = libmi.la
 if XORG
 sdk_HEADERS = micmap.h miline.h mipointer.h mi.h mibstore.h \
               migc.h mipointrst.h mizerarc.h micoord.h mifillarc.h \
-              mispans.h miwideline.h mistruct.h mifpoly.h
+              mispans.h miwideline.h mistruct.h mifpoly.h mioverlay.h
 endif
 
 AM_CFLAGS = $(DIX_CFLAGS)
@@ -33,6 +33,8 @@ libmi_la_SOURCES = 	\
 	migc.h		\
 	miglblt.c	\
 	miline.h	\
+	mioverlay.c	\
+	mioverlay.h	\
 	mipointer.c	\
 	mipointer.h	\
 	mipointrst.h	\
diff --git a/mi/mioverlay.c b/mi/mioverlay.c
new file mode 100644
index 0000000..766c5e7
--- /dev/null
+++ b/mi/mioverlay.c
@@ -0,0 +1,1946 @@
+
+#ifdef HAVE_DIX_CONFIG_H


Reply to: