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

xorg-server: Changes to 'ubuntu'



 Xi/xiqueryversion.c                                                       |   53 +++++---
 debian/changelog                                                          |    9 +
 debian/patches/228_autobind_gpu.patch                                     |   23 ---
 debian/patches/dix-allow-pixmap-dirty-helper-to-be-used-for-non-sha.patch |   40 ------
 debian/patches/series                                                     |    4 
 debian/patches/xf86-dont-enable-gpuscreens.patch                          |   64 ---------
 debian/patches/xf86crtc-don-t-use-display-for-vx-vy-for-gpu-screens.patch |   65 ----------
 debian/patches/xserver-call-CSR-for-gpus.patch                            |   46 -------
 dix/getevents.c                                                           |    2 
 dix/touch.c                                                               |    3 
 include/inputstr.h                                                        |    2 
 test/xi2/protocol-xiqueryversion.c                                        |   60 ++++-----
 12 files changed, 80 insertions(+), 291 deletions(-)

New commits:
commit c4370c6a9948e85971f5660e82536bd494b8c310
Author: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Date:   Wed Aug 14 10:52:28 2013 +0200

    release to saucy

diff --git a/debian/changelog b/debian/changelog
index a347918..9e33fb3 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,11 +1,11 @@
-xorg-server (2:1.14.2.901-2ubuntu1) UNRELEASED; urgency=low
+xorg-server (2:1.14.2.901-2ubuntu1) saucy; urgency=low
 
   * Merge from released debian-experimental.
   * Drop upstreamed prime patches.
   * Refresh 228_autobind_gpu.patch.
   * Pick up some more input fixes from upstream.
 
- -- Maarten Lankhorst <maarten.lankhorst@ubuntu.com>  Wed, 14 Aug 2013 10:22:46 +0200
+ -- Maarten Lankhorst <maarten.lankhorst@ubuntu.com>  Wed, 14 Aug 2013 10:52:17 +0200
 
 xorg-server (2:1.14.2.901-2) experimental; urgency=low
 

commit fcf8d6dadf95959dc1ed4547f13f91d97e0ddf49
Author: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Date:   Wed Aug 14 10:33:27 2013 +0200

    Drop upstreamed prime patches and refresh 228_autobind_gpu.patch.

diff --git a/debian/changelog b/debian/changelog
index c9c4d1b..a347918 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
+xorg-server (2:1.14.2.901-2ubuntu1) UNRELEASED; urgency=low
+
+  * Merge from released debian-experimental.
+  * Drop upstreamed prime patches.
+  * Refresh 228_autobind_gpu.patch.
+  * Pick up some more input fixes from upstream.
+
+ -- Maarten Lankhorst <maarten.lankhorst@ubuntu.com>  Wed, 14 Aug 2013 10:22:46 +0200
+
 xorg-server (2:1.14.2.901-2) experimental; urgency=low
 
   * Use libbsd-overlay to get missing declarations on kfreebsd and fix FTBFS.
diff --git a/debian/patches/228_autobind_gpu.patch b/debian/patches/228_autobind_gpu.patch
index c510791..e950c9d 100644
--- a/debian/patches/228_autobind_gpu.patch
+++ b/debian/patches/228_autobind_gpu.patch
@@ -10,32 +10,11 @@ v2: fix if config or slave config is NULL
 v3: fix multi useful slaves
 DO NOT UPSTREAM.
 ---
- dix/dispatch.c                      |  2 --
  hw/xfree86/common/xf86Init.c        | 12 ++++++++++++
  hw/xfree86/common/xf86platformBus.c |  3 +++
  hw/xfree86/modes/xf86Crtc.c         | 32 ++++++++++++++++++++++++++++++++
- 4 files changed, 47 insertions(+), 2 deletions(-)
+ 3 files changed, 47 insertions(+), 0 deletions(-)
 
-diff --git a/dix/dispatch.c b/dix/dispatch.c
-index 0ce10c2..c2ab8f9 100644
---- a/dix/dispatch.c
-+++ b/dix/dispatch.c
-@@ -3933,7 +3933,6 @@ void
- AttachOutputGPU(ScreenPtr pScreen, ScreenPtr new)
- {
-     assert(new->isGPU);
--    assert(!new->current_master);
-     xorg_list_add(&new->output_head, &pScreen->output_slave_list);
-     new->current_master = pScreen;
- }
-@@ -3950,7 +3949,6 @@ void
- AttachOffloadGPU(ScreenPtr pScreen, ScreenPtr new)
- {
-     assert(new->isGPU);
--    assert(!new->current_master);
-     xorg_list_add(&new->offload_head, &pScreen->offload_slave_list);
-     new->current_master = pScreen;
- }
 diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
 index d231ced..89629c1 100644
 --- a/hw/xfree86/common/xf86Init.c
diff --git a/debian/patches/dix-allow-pixmap-dirty-helper-to-be-used-for-non-sha.patch b/debian/patches/dix-allow-pixmap-dirty-helper-to-be-used-for-non-sha.patch
deleted file mode 100644
index e524142..0000000
--- a/debian/patches/dix-allow-pixmap-dirty-helper-to-be-used-for-non-sha.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-From 73fc15d94136a87807c1ce69d56fb8a34c09fe4f Mon Sep 17 00:00:00 2001
-From: Fedora X Ninjas <x@fedoraproject.org>
-Date: Tue, 8 Jan 2013 09:41:36 +1000
-Subject: [PATCH] dix: allow pixmap dirty helper to be used for non-shared
- pixmaps
-
-this allows the pixmap dirty helper to be used for reverse optimus
----
- dix/pixmap.c  | 2 ++
- fb/fbpixmap.c | 1 +
- 2 files changed, 3 insertions(+)
-
-diff --git a/dix/pixmap.c b/dix/pixmap.c
-index 2418812..fe92147 100644
---- a/dix/pixmap.c
-+++ b/dix/pixmap.c
-@@ -243,6 +243,8 @@ Bool PixmapSyncDirtyHelper(PixmapDirtyUpdatePtr dirty, RegionPtr dirty_region)
-     }
- 
-     dst = dirty->slave_dst->master_pixmap;
-+    if (!dst)
-+        dst = dirty->slave_dst;
- 
-     RegionTranslate(dirty_region, -dirty->x, -dirty->y);
-     n = RegionNumRects(dirty_region);
-diff --git a/fb/fbpixmap.c b/fb/fbpixmap.c
-index fbcdca9..0824b64 100644
---- a/fb/fbpixmap.c
-+++ b/fb/fbpixmap.c
-@@ -67,6 +67,7 @@ fbCreatePixmapBpp(ScreenPtr pScreen, int width, int height, int depth, int bpp,
-     pPixmap->devKind = paddedWidth;
-     pPixmap->refcnt = 1;
-     pPixmap->devPrivate.ptr = (pointer) ((char *) pPixmap + base + adjust);
-+    pPixmap->master_pixmap = NULL;
- 
- #ifdef FB_DEBUG
-     pPixmap->devPrivate.ptr =
--- 
-1.8.1
-
diff --git a/debian/patches/series b/debian/patches/series
index f0ed4d3..5002d3e 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -40,7 +40,6 @@ no-nv.patch
 
 ## upstream patches
 os-use-libunwind-to-generate-backtraces.patch
-xf86-dont-enable-gpuscreens.patch
 
 # hybrid graphics fixes for xserver 1.13
 228_autobind_gpu.patch
@@ -48,11 +47,8 @@ xf86-fixup-detection.patch
 xf86-inactive-gpuscreen.patch
 
 # hotplug fixes
-xf86crtc-don-t-use-display-for-vx-vy-for-gpu-screens.patch
 
 # fixes for reverse optimus, cherry-picked from fedora X
-dix-allow-pixmap-dirty-helper-to-be-used-for-non-sha.patch
-xserver-call-CSR-for-gpus.patch
 autoconfig-fixup-tell-changed-so-randr-clients-can-t.patch
 config-add-no-removal.patch
 include-selection-h.patch
diff --git a/debian/patches/xf86-dont-enable-gpuscreens.patch b/debian/patches/xf86-dont-enable-gpuscreens.patch
deleted file mode 100644
index 64531ab..0000000
--- a/debian/patches/xf86-dont-enable-gpuscreens.patch
+++ /dev/null
@@ -1,64 +0,0 @@
-From: Aaron Plattner <aplattner@nvidia.com>
-To: <xorg-devel@lists.x.org>
-Subject: [PATCH] xfree86: don't enable anything in xf86InitialConfiguration
-	for GPU screens
-Date: Tue, 30 Apr 2013 14:30:18 -0700
-
-There's no point in turning on outputs connected to GPU screens during initial
-configuration.  Not only does this cause them to just display black, it also
-confuses clients when these screens are attached to a master screen and RandR
-reports that the outputs are already on.
-
-Also, don't print the warning about no outputs being found on GPU screens,
-since that's expected.
-
-Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
----
-Dave, this fixes the black screen problem with "gpu: call CreateScreenResources
-for GPU screens"
-
- hw/xfree86/modes/xf86Crtc.c | 16 +++++++++++++---
- 1 file changed, 13 insertions(+), 3 deletions(-)
-
-diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
-index 4a490c6..35845e8 100644
---- a/hw/xfree86/modes/xf86Crtc.c
-+++ b/hw/xfree86/modes/xf86Crtc.c
-@@ -1997,6 +1997,14 @@ xf86CollectEnabledOutputs(ScrnInfoPtr scrn, xf86CrtcConfigPtr config,
-     Bool any_enabled = FALSE;
-     int o;
- 
-+    /*
-+     * Don't bother enabling outputs on GPU screens: a client needs to attach
-+     * it to a source provider before setting a mode that scans out a shared
-+     * pixmap.
-+     */
-+    if (scrn->is_gpu)
-+        return FALSE;
-+
-     for (o = 0; o < config->num_output; o++)
-         any_enabled |= enabled[o] = xf86OutputEnabled(config->output[o], TRUE);
- 
-@@ -2466,9 +2474,11 @@ xf86InitialConfiguration(ScrnInfoPtr scrn, Bool canGrow)
- 
-     ret = xf86CollectEnabledOutputs(scrn, config, enabled);
-     if (ret == FALSE && canGrow) {
--        xf86DrvMsg(i, X_WARNING,
--                   "Unable to find connected outputs - setting %dx%d initial framebuffer\n",
--                   NO_OUTPUT_DEFAULT_WIDTH, NO_OUTPUT_DEFAULT_HEIGHT);
-+        if (!scrn->is_gpu)
-+            xf86DrvMsg(i, X_WARNING,
-+		       "Unable to find connected outputs - setting %dx%d "
-+                       "initial framebuffer\n",
-+                       NO_OUTPUT_DEFAULT_WIDTH, NO_OUTPUT_DEFAULT_HEIGHT);
-         have_outputs = FALSE;
-     }
-     else {
--- 
-1.8.2.2
-
-_______________________________________________
-xorg-devel@lists.x.org: X.Org development
-Archives: http://lists.x.org/archives/xorg-devel
-Info: http://lists.x.org/mailman/listinfo/xorg-devel
-
diff --git a/debian/patches/xf86crtc-don-t-use-display-for-vx-vy-for-gpu-screens.patch b/debian/patches/xf86crtc-don-t-use-display-for-vx-vy-for-gpu-screens.patch
deleted file mode 100644
index 36b6a4c..0000000
--- a/debian/patches/xf86crtc-don-t-use-display-for-vx-vy-for-gpu-screens.patch
+++ /dev/null
@@ -1,65 +0,0 @@
-From 2bd6a8491ad3dbd42db66be7ae48f4b6e9c698f2 Mon Sep 17 00:00:00 2001
-From: Fedora X Ninjas <x@fedoraproject.org>
-Date: Wed, 12 Dec 2012 14:02:54 +1000
-Subject: [PATCH] xf86crtc: don't use display for vx/vy for gpu screens
-
----
- hw/xfree86/modes/xf86Crtc.c | 18 +++++++++++-------
- 1 file changed, 11 insertions(+), 7 deletions(-)
-
-diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
-index 6975d2f..2828ee0 100644
---- a/hw/xfree86/modes/xf86Crtc.c
-+++ b/hw/xfree86/modes/xf86Crtc.c
-@@ -2425,11 +2425,11 @@ xf86InitialConfiguration(ScrnInfoPtr scrn, Bool canGrow)
-     config->debug_modes = xf86ReturnOptValBool(config->options,
-                                                OPTION_MODEDEBUG, FALSE);
- 
--    if (scrn->display->virtualX)
-+    if (scrn->display->virtualX && !scrn->is_gpu)
-         width = scrn->display->virtualX;
-     else
-         width = config->maxWidth;
--    if (scrn->display->virtualY)
-+    if (scrn->display->virtualY && !scrn->is_gpu)
-         height = scrn->display->virtualY;
-     else
-         height = config->maxHeight;
-@@ -2497,8 +2497,10 @@ xf86InitialConfiguration(ScrnInfoPtr scrn, Bool canGrow)
- 
-     /* XXX override xf86 common frame computation code */
- 
--    scrn->display->frameX0 = 0;
--    scrn->display->frameY0 = 0;
-+    if (!scrn->is_gpu) {
-+        scrn->display->frameX0 = 0;
-+        scrn->display->frameY0 = 0;
-+    }
- 
-     for (c = 0; c < config->num_crtc; c++) {
-         xf86CrtcPtr crtc = config->crtc[c];
-@@ -2546,7 +2548,7 @@ xf86InitialConfiguration(ScrnInfoPtr scrn, Bool canGrow)
-         }
-     }
- 
--    if (scrn->display->virtualX == 0) {
-+    if (scrn->display->virtualX == 0 || scrn->is_gpu) {
-         /*
-          * Expand virtual size to cover the current config and potential mode
-          * switches, if the driver can't enlarge the screen later.
-@@ -2561,8 +2563,10 @@ xf86InitialConfiguration(ScrnInfoPtr scrn, Bool canGrow)
-             }
-         }
- 
--        scrn->display->virtualX = width;
--        scrn->display->virtualY = height;
-+	if (!scrn->is_gpu) {
-+            scrn->display->virtualX = width;
-+            scrn->display->virtualY = height;
-+	}
-     }
- 
-     if (width > scrn->virtualX)
--- 
-1.8.1
-
diff --git a/debian/patches/xserver-call-CSR-for-gpus.patch b/debian/patches/xserver-call-CSR-for-gpus.patch
deleted file mode 100644
index 8c6fbda..0000000
--- a/debian/patches/xserver-call-CSR-for-gpus.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-From 6aa11e40ec75fb31d0c611f9d578427941379c0d Mon Sep 17 00:00:00 2001
-From: Fedora X Ninjas <x@fedoraproject.org>
-Date: Tue, 8 Jan 2013 09:42:44 +1000
-Subject: [PATCH] xserver: call CSR for gpus
-
----
- dix/main.c                          | 3 +++
- hw/xfree86/common/xf86platformBus.c | 8 ++++++++
- 2 files changed, 11 insertions(+)
-
-diff --git a/dix/main.c b/dix/main.c
-index fb935c9..e558d70 100644
---- a/dix/main.c
-+++ b/dix/main.c
-@@ -211,6 +211,9 @@ main(int argc, char *argv[], char *envp[])
-             ScreenPtr pScreen = screenInfo.gpuscreens[i];
-             if (!CreateScratchPixmapsForScreen(pScreen))
-                 FatalError("failed to create scratch pixmaps");
-+            if (pScreen->CreateScreenResources &&
-+                !(*pScreen->CreateScreenResources) (pScreen))
-+                FatalError("failed to create screen resources");
-         }
- 
-         for (i = 0; i < screenInfo.numScreens; i++) {
-diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c
-index 67d03eb..8f73c3a 100644
---- a/hw/xfree86/common/xf86platformBus.c
-+++ b/hw/xfree86/common/xf86platformBus.c
-@@ -452,6 +452,14 @@ xf86platformAddDevice(int index)
- 
-    CreateScratchPixmapsForScreen(xf86GPUScreens[i]->pScreen);
- 
-+   if (xf86GPUScreens[i]->pScreen->CreateScreenResources &&
-+       !(*xf86GPUScreens[i]->pScreen->CreateScreenResources) (xf86GPUScreens[i]->pScreen)) {
-+       RemoveGPUScreen(xf86GPUScreens[i]->pScreen);
-+       xf86DeleteScreen(xf86GPUScreens[i]);
-+       xf86UnclaimPlatformSlot(&xf86_platform_devices[index], NULL);
-+       xf86NumGPUScreens = old_screens;
-+       return -1;
-+   }
-    /* attach unbound to 0 protocol screen */
-    AttachUnboundGPU(xf86Screens[0]->pScreen, xf86GPUScreens[i]->pScreen);
-    xf86AutoConfigOutputDevice(xf86GPUScreens[i], xf86Screens[0]);
--- 
-1.8.1
-

commit 917c11ff97eb302d3c2d0565c8dd6d93101d6466
Author: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Date:   Tue Jul 30 15:31:24 2013 +0200

    test/xi2: fix protocol-xiqueryversion test
    
    The old code was broken and allowed setting client version >= XIVersion,
    this was fixed in the previous patch, but updating the value for XIVersion
    broke the tests, so fix the tests too.
    
    Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
    Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    (cherry picked from commit b6e5c4669e0db391966deb397e8c975ec7f0124d)

diff --git a/test/xi2/protocol-xiqueryversion.c b/test/xi2/protocol-xiqueryversion.c
index aff0237..ed75c89 100644
--- a/test/xi2/protocol-xiqueryversion.c
+++ b/test/xi2/protocol-xiqueryversion.c
@@ -44,8 +44,8 @@
 #include "extinit.h"            /* for XInputExtensionInit */
 #include "scrnintstr.h"
 #include "xiqueryversion.h"
-
 #include "protocol-common.h"
+#include "exglobals.h"
 
 extern XExtensionVersion XIVersion;
 
@@ -54,8 +54,8 @@ struct test_data {
     int minor_client;
     int major_server;
     int minor_server;
-    int major_cached;
-    int minor_cached;
+    int major_expected;
+    int minor_expected;
 };
 
 static void
@@ -93,13 +93,8 @@ reply_XIQueryVersion_multiple(ClientPtr client, int len, char *data, void *closu
     reply_check_defaults(rep, len, XIQueryVersion);
     assert(rep->length == 0);
 
-    if (versions->major_cached == -1) {
-        versions->major_cached = rep->major_version;
-        versions->minor_cached = rep->minor_version;
-    }
-
-    assert(versions->major_cached == rep->major_version);
-    assert(versions->minor_cached == rep->minor_version);
+    assert(versions->major_expected == rep->major_version);
+    assert(versions->minor_expected == rep->minor_version);
 }
 
 /**
@@ -199,6 +194,7 @@ test_XIQueryVersion_multiple(void)
 {
     xXIQueryVersionReq request;
     ClientRec client;
+    XIClientPtr pXIClient;
     struct test_data versions;
     int rc;
 
@@ -213,28 +209,26 @@ test_XIQueryVersion_multiple(void)
     userdata = (void *) &versions;
 
     /* run 1 */
-    versions.major_cached = -1;
-    versions.minor_cached = -1;
 
-    /* client is lower than server, noncached */
-    request.major_version = 2;
-    request.minor_version = 1;
+    /* client is lower than server, nonexpected */
+    versions.major_expected = request.major_version = 2;
+    versions.minor_expected = request.minor_version = 1;
     rc = ProcXIQueryVersion(&client);
     assert(rc == Success);
 
-    /* client is higher than server, cached */
+    /* client is higher than server, no change */
     request.major_version = 2;
     request.minor_version = 3;
     rc = ProcXIQueryVersion(&client);
     assert(rc == Success);
 
-    /* client is equal, cached */
+    /* client tries to set higher version, stays same */
     request.major_version = 2;
     request.minor_version = 2;
     rc = ProcXIQueryVersion(&client);
     assert(rc == Success);
 
-    /* client is low than cached */
+    /* client tries to set lower version, no change */
     request.major_version = 2;
     request.minor_version = 0;
     rc = ProcXIQueryVersion(&client);
@@ -243,20 +237,24 @@ test_XIQueryVersion_multiple(void)
     /* run 2 */
     client = init_client(request.length, &request);
     XIVersion.major_version = 2;
-    XIVersion.minor_version = 2;
-    versions.major_cached = -1;
-    versions.minor_cached = -1;
+    XIVersion.minor_version = 3;
 
-    request.major_version = 2;
-    request.minor_version = 2;
+    versions.major_expected = request.major_version = 2;
+    versions.minor_expected = request.minor_version = 2;
     rc = ProcXIQueryVersion(&client);
     assert(rc == Success);
 
+    /* client bumps version from 2.2 to 2.3 */
     request.major_version = 2;
-    request.minor_version = 3;
+    versions.minor_expected = request.minor_version = 3;
     rc = ProcXIQueryVersion(&client);
     assert(rc == Success);
 
+    /* real version is changed, too! */
+    pXIClient = dixLookupPrivate(&client.devPrivates, XIClientPrivateKey);
+    assert(pXIClient->minor_version == 3);
+
+    /* client tries to set lower version, no change */
     request.major_version = 2;
     request.minor_version = 1;
     rc = ProcXIQueryVersion(&client);
@@ -265,20 +263,22 @@ test_XIQueryVersion_multiple(void)
     /* run 3 */
     client = init_client(request.length, &request);
     XIVersion.major_version = 2;
-    XIVersion.minor_version = 2;
-    versions.major_cached = -1;
-    versions.minor_cached = -1;
+    XIVersion.minor_version = 3;
 
-    request.major_version = 2;
-    request.minor_version = 3;
+    versions.major_expected = request.major_version = 2;
+    versions.minor_expected = request.minor_version = 3;
     rc = ProcXIQueryVersion(&client);
     assert(rc == Success);
 
     request.major_version = 2;
-    request.minor_version = 2;
+    versions.minor_expected = request.minor_version = 2;
     rc = ProcXIQueryVersion(&client);
     assert(rc == Success);
 
+    /* but real client version must not be lowered */
+    pXIClient = dixLookupPrivate(&client.devPrivates, XIClientPrivateKey);
+    assert(pXIClient->minor_version == 3);
+
     request.major_version = 2;
     request.minor_version = 1;
     rc = ProcXIQueryVersion(&client);

commit 804836c53083fdb9f43be6f51740df5d12d57cb4
Author: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Date:   Tue Jul 30 14:45:21 2013 +0200

    Xi: Clamp XIClient maximal version to XIVersion
    
    Do not allow setting client version to an arbitrary value >= XIVersion.
    Fixes a test error with test/xi2/protocol-xiqueryversion.c, introduced by
    commit 4360514d1c "Xi: Allow clients to ask for 2.3 and then 2.2 without failing"
    
    Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
    Reviewed-by: Keith Packard <keithp@keithp.com>
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    (cherry picked from commit 500e844a24962c9e70abb3d614f1973013b2de73)

diff --git a/Xi/xiqueryversion.c b/Xi/xiqueryversion.c
index 6c7b9c0..c705f78 100644
--- a/Xi/xiqueryversion.c
+++ b/Xi/xiqueryversion.c
@@ -70,12 +70,21 @@ ProcXIQueryVersion(ClientPtr client)
 
     pXIClient = dixLookupPrivate(&client->devPrivates, XIClientPrivateKey);
 
+    if (version_compare(XIVersion.major_version, XIVersion.minor_version,
+                stuff->major_version, stuff->minor_version) > 0) {
+        major = stuff->major_version;
+        minor = stuff->minor_version;
+    } else {
+        major = XIVersion.major_version;
+        minor = XIVersion.minor_version;
+    }
+
     if (pXIClient->major_version) {
 
         /* Check to see if the client has only ever asked
          * for version 2.2 or higher
          */
-        if (version_compare(stuff->major_version, stuff->minor_version, 2, 2) >= 0 &&
+        if (version_compare(major, minor, 2, 2) >= 0 &&
             version_compare(pXIClient->major_version, pXIClient->minor_version, 2, 2) >= 0)
         {
 
@@ -84,16 +93,14 @@ ProcXIQueryVersion(ClientPtr client)
              * version to the client but leave the server internal
              * version set to the highest requested value
              */
-            major = stuff->major_version;
-            minor = stuff->minor_version;
-            if (version_compare(stuff->major_version, stuff->minor_version,
+            if (version_compare(major, minor,
                                 pXIClient->major_version, pXIClient->minor_version) > 0)
             {
-                pXIClient->major_version = stuff->major_version;
-                pXIClient->minor_version = stuff->minor_version;
+                pXIClient->major_version = major;
+                pXIClient->minor_version = minor;
             }
         } else {
-            if (version_compare(stuff->major_version, stuff->minor_version,
+            if (version_compare(major, minor,
                                 pXIClient->major_version, pXIClient->minor_version) < 0) {
 
                 client->errorValue = stuff->major_version;
@@ -103,16 +110,6 @@ ProcXIQueryVersion(ClientPtr client)
             minor = pXIClient->minor_version;
         }
     } else {
-        if (version_compare(XIVersion.major_version, XIVersion.minor_version,
-                    stuff->major_version, stuff->minor_version) > 0) {
-            major = stuff->major_version;
-            minor = stuff->minor_version;
-        }
-        else {
-            major = XIVersion.major_version;
-            minor = XIVersion.minor_version;
-        }
-
         pXIClient->major_version = major;
         pXIClient->minor_version = minor;
     }

commit 7250c310b50c96709f2082e7752fc889557abc26
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Tue Aug 13 10:50:25 2013 +1000

    Revert "test: fix XIQueryVersion check for new behaviour"
    
    This reverts commit cdcb708678c4785cd7b026b90e316691176e5244.

diff --git a/test/xi2/protocol-xiqueryversion.c b/test/xi2/protocol-xiqueryversion.c
index 2289c8d..aff0237 100644
--- a/test/xi2/protocol-xiqueryversion.c
+++ b/test/xi2/protocol-xiqueryversion.c
@@ -96,16 +96,10 @@ reply_XIQueryVersion_multiple(ClientPtr client, int len, char *data, void *closu
     if (versions->major_cached == -1) {
         versions->major_cached = rep->major_version;
         versions->minor_cached = rep->minor_version;
-    } else if (versions->major_cached >= 2 &&
-               versions->minor_cached >= 2) {
-        /* First request was for 2.2 or higher, reply
-           must be 2.2 or higher, whichever requested */
-        assert(rep->major_version >= 2);
-        assert(rep->minor_version >= 2);
-    } else {
-        assert(versions->major_cached == rep->major_version);
-        assert(versions->minor_cached == rep->minor_version);
     }
+
+    assert(versions->major_cached == rep->major_version);
+    assert(versions->minor_cached == rep->minor_version);
 }
 
 /**

commit cdcb708678c4785cd7b026b90e316691176e5244
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Tue Jul 30 08:03:12 2013 +1000

    test: fix XIQueryVersion check for new behaviour
    
    As of 4360514d1cc8e3132f93f56172d291074e8c770f, XIQueryVersion supports
    requesting versions 2.2+ in random order, only 2.0 and 2.1 are restricted.
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    (cherry picked from commit a5abf790183798ad8aa2c29c056df3647777cfbd)

diff --git a/test/xi2/protocol-xiqueryversion.c b/test/xi2/protocol-xiqueryversion.c
index aff0237..2289c8d 100644
--- a/test/xi2/protocol-xiqueryversion.c
+++ b/test/xi2/protocol-xiqueryversion.c
@@ -96,10 +96,16 @@ reply_XIQueryVersion_multiple(ClientPtr client, int len, char *data, void *closu
     if (versions->major_cached == -1) {
         versions->major_cached = rep->major_version;
         versions->minor_cached = rep->minor_version;
+    } else if (versions->major_cached >= 2 &&
+               versions->minor_cached >= 2) {
+        /* First request was for 2.2 or higher, reply
+           must be 2.2 or higher, whichever requested */
+        assert(rep->major_version >= 2);
+        assert(rep->minor_version >= 2);
+    } else {
+        assert(versions->major_cached == rep->major_version);
+        assert(versions->minor_cached == rep->minor_version);
     }
-
-    assert(versions->major_cached == rep->major_version);
-    assert(versions->minor_cached == rep->minor_version);
 }
 
 /**

commit e6da18f67516dcee394cd0eff591a255b59fe544
Author: Keith Packard <keithp@keithp.com>
Date:   Wed Jul 10 22:42:55 2013 -0700

    Xi: Allow clients to ask for 2.3 and then 2.2 without failing
    
    This allows different sub-systems within the same application to
    request different Xi versions without either getting old behaviour
    everywhere or simply failing with a BadValue.
    
    Signed-off-by: Keith Packard <keithp@keithp.com>
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    (cherry picked from commit 4360514d1cc8e3132f93f56172d291074e8c770f)

diff --git a/Xi/xiqueryversion.c b/Xi/xiqueryversion.c
index b807a53..6c7b9c0 100644
--- a/Xi/xiqueryversion.c
+++ b/Xi/xiqueryversion.c
@@ -71,13 +71,37 @@ ProcXIQueryVersion(ClientPtr client)
     pXIClient = dixLookupPrivate(&client->devPrivates, XIClientPrivateKey);
 
     if (pXIClient->major_version) {
-        if (version_compare(stuff->major_version, stuff->minor_version,
-                            pXIClient->major_version, pXIClient->minor_version) < 0) {
-            client->errorValue = stuff->major_version;
-            return BadValue;
+
+        /* Check to see if the client has only ever asked
+         * for version 2.2 or higher
+         */
+        if (version_compare(stuff->major_version, stuff->minor_version, 2, 2) >= 0 &&
+            version_compare(pXIClient->major_version, pXIClient->minor_version, 2, 2) >= 0)
+        {
+
+            /* As of version 2.2, Peter promises to never again break
+             * backward compatibility, so we'll return the requested
+             * version to the client but leave the server internal
+             * version set to the highest requested value
+             */
+            major = stuff->major_version;
+            minor = stuff->minor_version;
+            if (version_compare(stuff->major_version, stuff->minor_version,
+                                pXIClient->major_version, pXIClient->minor_version) > 0)
+            {
+                pXIClient->major_version = stuff->major_version;
+                pXIClient->minor_version = stuff->minor_version;
+            }
+        } else {
+            if (version_compare(stuff->major_version, stuff->minor_version,
+                                pXIClient->major_version, pXIClient->minor_version) < 0) {
+
+                client->errorValue = stuff->major_version;
+                return BadValue;
+            }
+            major = pXIClient->major_version;
+            minor = pXIClient->minor_version;
         }
-        major = pXIClient->major_version;
-        minor = pXIClient->minor_version;
     } else {
         if (version_compare(XIVersion.major_version, XIVersion.minor_version,
                     stuff->major_version, stuff->minor_version) > 0) {

commit 0857f3c72d0d1bf5eac52f084e9a1adf077e7397
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Mon Jul 22 13:43:07 2013 +1000

    dix: set the valuator mask to ensure XI 1.x events have data
    
    XI 1.x only allows for first + num valuators, so if a device sends data for
    valuators 0 and 2+ only (i.e. valuator 1 is missing) we still need to get
    the data for that from somewhere.
    XI 1.x uses the hack of an unset valuator mask to get the right coordinates,
    i.e. we set the value but don't set the mask for it so XI2 events have the
    right mask.
    
    For an absolute device in relative mode, this broke in b28a1af55cf, the
    value was now always 0. This wasn't visible on the cursor, only in an XI 1.x
    client. The GIMP e.g. sees jumps to x/0 every few events.
    
    Drop the condition introduced in b28a1af55cf, data in valuators is always
    absolute, regardless of the mode.
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    (cherry picked from commit 3d8756631070c440cefa31b35fea3d407f187810)

diff --git a/dix/getevents.c b/dix/getevents.c
index dfe4652..dd1b253 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -239,7 +239,7 @@ set_valuators(DeviceIntPtr dev, DeviceEvent *event, ValuatorMask *mask)
                 SetBit(event->valuators.mode, i);
             event->valuators.data[i] = valuator_mask_get_double(mask, i);
         }
-        else if (valuator_get_mode(dev, i) == Absolute)
+        else
             event->valuators.data[i] = dev->valuator->axisVal[i];
     }
 }

commit ef54bd89b17f3dd1f854435339f66d357121c64c
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Wed Jul 24 11:50:00 2013 +1000

    dix: check the xi2mask, not the grab type for touch listeners
    
    grab->type is only non-zero for passive grabs. We're checking an active grab
    here, so we need to check if the touch mask is set on the grab.
    
    Test case: grab the device, then start two simultaneous touches. The
    grabbing client won't see the second touchpoints because grab->type is 0
    and the second touch is not an emulating pointer.
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    (cherry picked from commit 4fb686d6a6777950f0e0d55b848cd2af4cbad372)

diff --git a/dix/touch.c b/dix/touch.c
index a4b6d7e..a7ea213 100644
--- a/dix/touch.c
+++ b/dix/touch.c
@@ -895,8 +895,7 @@ TouchAddActiveGrabListener(DeviceIntPtr dev, TouchPointInfoPtr ti,
 
     if (!ti->emulate_pointer &&
         grab->grabtype == XI2 &&
-        (grab->type != XI_TouchBegin && grab->type != XI_TouchEnd &&
-         grab->type != XI_TouchUpdate))
+        !xi2mask_isset(grab->xi2mask, dev, XI_TouchBegin))
         return;
 
     TouchAddGrabListener(dev, ti, ev, grab);
diff --git a/include/inputstr.h b/include/inputstr.h
index 85be885..2da72c1 100644
--- a/include/inputstr.h
+++ b/include/inputstr.h
@@ -195,7 +195,7 @@ typedef struct _GrabRec {
     unsigned keyboardMode:1;
     unsigned pointerMode:1;
     enum InputLevel grabtype;
-    CARD8 type;                 /* event type */
+    CARD8 type;                 /* event type for passive grabs, 0 for active grabs */
     DetailRec modifiersDetail;
     DeviceIntPtr modifierDevice;
     DetailRec detail;           /* key or button */


Reply to: