xserver: Branch 'server-1.19-branch' - 11 commits

Adam Jackson ajax at kemper.freedesktop.org
Mon Jan 22 19:22:02 UTC 2018


 config/udev.c                |    2 
 configure.ac                 |    7 ++
 glamor/glamor_xv.c           |    2 
 hw/xfree86/Makefile.am       |    4 -
 hw/xfree86/common/extramodes |  141 +++++++++++++++++++++++++++++++++++++++++++
 hw/xwayland/xwayland-input.c |    2 
 os/xdmcp.c                   |    2 
 render/animcur.c             |  119 +++++++++++++-----------------------
 8 files changed, 198 insertions(+), 81 deletions(-)

New commits:
commit 8be1dbeacf5f29c0b538414e87d47c9d5af08d9d
Author: Martin Wilck <mwilck at suse.com>
Date:   Tue Jan 9 20:33:09 2018 +0100

    xfree86: add default modes for 16:9 and 16:10
    
    Improve the user experience for users with wide screens by adding standard
    16:9 and 16:10 modes to extramodes, as suggested previously
    (https://lists.x.org/archives/xorg-devel/2016-February/048866.html).
    Tested successfully on my laptop. Feedback welcome.
    
    See also https://bugs.freedesktop.org/show_bug.cgi?id=37858.
    
    Signed-off-by: Martin Wilck <mwilck at suse.com>
    Reviewed-by: Adam Jackson <ajax at redhat.com>
    (cherry picked from commit a5e9bcad7ad0887f804905b482894b85751519fb)

diff --git a/hw/xfree86/common/extramodes b/hw/xfree86/common/extramodes
index 450502670..006b5cba1 100644
--- a/hw/xfree86/common/extramodes
+++ b/hw/xfree86/common/extramodes
@@ -25,3 +25,144 @@ Modeline "2048x1536" 340.48  2048 2216 2440 2832  1536 1537 1540 1603 -hsync +vs
 # 2048x1536 @ 85Hz (VESA GTF) hsync: 137.0kHz
 Modeline "2048x1536" 388.04  2048 2216 2440 2832  1536 1537 1540 1612 -hsync +vsync
 
+### 16:9 modelines generated by cvt
+
+# 640x360 59.32 Hz (CVT 0.23M9-R) hsync: 22.19 kHz; pclk: 17.75 MHz
+Modeline "640x360R"   17.75  640 688 720 800  360 363 368 374 +hsync -vsync
+
+# 640x360 59.84 Hz (CVT 0.23M9) hsync: 22.50 kHz; pclk: 18.00 MHz
+Modeline "640x360"   18.00  640 664 720 800  360 363 368 376 -hsync +vsync
+
+# 720x405 58.99 Hz (CVT 0.29M9-R) hsync: 24.72 kHz; pclk: 21.75 MHz
+Modeline "720x405R"   21.75  720 768 800 880  405 408 413 419 +hsync -vsync
+
+# 720x405 59.51 Hz (CVT 0.29M9) hsync: 25.11 kHz; pclk: 22.50 MHz
+Modeline "720x405"   22.50  720 744 808 896  405 408 413 422 -hsync +vsync
+
+# 864x486 59.57 Hz (CVT 0.42M9-R) hsync: 29.79 kHz; pclk: 30.50 MHz
+Modeline "864x486R"   30.50  864 912 944 1024  486 489 494 500 +hsync -vsync
+
+# 864x486 59.92 Hz (CVT 0.42M9) hsync: 30.32 kHz; pclk: 32.50 MHz
+Modeline "864x486"   32.50  864 888 968 1072  486 489 494 506 -hsync +vsync
+
+# 960x540 59.82 Hz (CVT 0.52M9-R) hsync: 33.26 kHz; pclk: 37.25 MHz
+Modeline "960x540R"   37.25  960 1008 1040 1120  540 543 548 556 +hsync -vsync
+
+# 960x540 59.63 Hz (CVT 0.52M9) hsync: 33.51 kHz; pclk: 40.75 MHz
+Modeline "960x540"   40.75  960 992 1088 1216  540 543 548 562 -hsync +vsync
+
+# 1024x576 59.82 Hz (CVT 0.59M9-R) hsync: 35.47 kHz; pclk: 42.00 MHz
+Modeline "1024x576R"   42.00  1024 1072 1104 1184  576 579 584 593 +hsync -vsync
+
+# 1024x576 59.90 Hz (CVT 0.59M9) hsync: 35.88 kHz; pclk: 46.50 MHz
+Modeline "1024x576"   46.50  1024 1064 1160 1296  576 579 584 599 -hsync +vsync
+
+# 1280x720 59.74 Hz (CVT 0.92M9-R) hsync: 44.27 kHz; pclk: 63.75 MHz
+Modeline "1280x720R"   63.75  1280 1328 1360 1440  720 723 728 741 +hsync -vsync
+
+# 1280x720 59.86 Hz (CVT 0.92M9) hsync: 44.77 kHz; pclk: 74.50 MHz
+Modeline "1280x720"   74.50  1280 1344 1472 1664  720 723 728 748 -hsync +vsync
+
+# 1368x768 59.85 Hz (CVT) hsync: 47.28 kHz; pclk: 72.25 MHz
+Modeline "1368x768R"   72.25  1368 1416 1448 1528  768 771 781 790 +hsync -vsync
+
+# 1368x768 59.88 Hz (CVT) hsync: 47.79 kHz; pclk: 85.25 MHz
+Modeline "1368x768"   85.25  1368 1440 1576 1784  768 771 781 798 -hsync +vsync
+
+# 1600x900 59.82 Hz (CVT 1.44M9-R) hsync: 55.40 kHz; pclk: 97.50 MHz
+Modeline "1600x900R"   97.50  1600 1648 1680 1760  900 903 908 926 +hsync -vsync
+
+# 1600x900 59.95 Hz (CVT 1.44M9) hsync: 55.99 kHz; pclk: 118.25 MHz
+Modeline "1600x900"  118.25  1600 1696 1856 2112  900 903 908 934 -hsync +vsync
+
+# 1920x1080 59.93 Hz (CVT 2.07M9-R) hsync: 66.59 kHz; pclk: 138.50 MHz
+Modeline "1920x1080R"  138.50  1920 1968 2000 2080  1080 1083 1088 1111 +hsync -vsync
+
+# 1920x1080 59.96 Hz (CVT 2.07M9) hsync: 67.16 kHz; pclk: 173.00 MHz
+Modeline "1920x1080"  173.00  1920 2048 2248 2576  1080 1083 1088 1120 -hsync +vsync
+
+# 2048x1152 59.91 Hz (CVT 2.36M9-R) hsync: 70.99 kHz; pclk: 156.75 MHz
+Modeline "2048x1152R"  156.75  2048 2096 2128 2208  1152 1155 1160 1185 +hsync -vsync
+
+# 2048x1152 59.90 Hz (CVT 2.36M9) hsync: 71.58 kHz; pclk: 197.00 MHz
+Modeline "2048x1152"  197.00  2048 2184 2400 2752  1152 1155 1160 1195 -hsync +vsync
+
+# 2560x1440 59.95 Hz (CVT 3.69M9-R) hsync: 88.79 kHz; pclk: 241.50 MHz
+Modeline "2560x1440R"  241.50  2560 2608 2640 2720  1440 1443 1448 1481 +hsync -vsync
+
+# 2560x1440 59.96 Hz (CVT 3.69M9) hsync: 89.52 kHz; pclk: 312.25 MHz
+Modeline "2560x1440"  312.25  2560 2752 3024 3488  1440 1443 1448 1493 -hsync +vsync
+
+# 2880x1620 59.97 Hz (CVT 4.67M9-R) hsync: 99.92 kHz; pclk: 303.75 MHz
+Modeline "2880x1620R"  303.75  2880 2928 2960 3040  1620 1623 1628 1666 +hsync -vsync
+
+# 2880x1620 59.96 Hz (CVT 4.67M9) hsync: 100.67 kHz; pclk: 396.25 MHz
+Modeline "2880x1620"  396.25  2880 3096 3408 3936  1620 1623 1628 1679 -hsync +vsync
+
+# 3200x1800 59.94 Hz (CVT 5.76M9-R) hsync: 111.01 kHz; pclk: 373.00 MHz
+Modeline "3200x1800R"  373.00  3200 3248 3280 3360  1800 1803 1808 1852 +hsync -vsync
+
+# 3200x1800 59.96 Hz (CVT 5.76M9) hsync: 111.82 kHz; pclk: 492.00 MHz
+Modeline "3200x1800"  492.00  3200 3456 3800 4400  1800 1803 1808 1865 -hsync +vsync
+
+# 3840x2160 59.97 Hz (CVT 8.29M9-R) hsync: 133.25 kHz; pclk: 533.00 MHz
+Modeline "3840x2160R"  533.00  3840 3888 3920 4000  2160 2163 2168 2222 +hsync -vsync
+
+# 3840x2160 59.98 Hz (CVT 8.29M9) hsync: 134.18 kHz; pclk: 712.75 MHz
+Modeline "3840x2160"  712.75  3840 4160 4576 5312  2160 2163 2168 2237 -hsync +vsync
+
+# 4096x2304 59.98 Hz (CVT 9.44M9-R) hsync: 142.15 kHz; pclk: 605.00 MHz
+Modeline "4096x2304R"  605.00  4096 4144 4176 4256  2304 2307 2312 2370 +hsync -vsync
+
+# 4096x2304 59.99 Hz (CVT 9.44M9) hsync: 143.13 kHz; pclk: 813.00 MHz
+Modeline "4096x2304"  813.00  4096 4440 4888 5680  2304 2307 2312 2386 -hsync +vsync
+
+# 5120x2880 59.99 Hz (CVT 14.75M9-R) hsync: 177.70 kHz; pclk: 938.25 MHz
+Modeline "5120x2880R"  938.25  5120 5168 5200 5280  2880 2883 2888 2962 +hsync -vsync
+
+# 5120x2880 59.99 Hz (CVT 14.75M9) hsync: 178.88 kHz; pclk: 1276.50 MHz
+Modeline "5120x2880"  1276.50  5120 5560 6128 7136  2880 2883 2888 2982 -hsync +vsync
+
+# 7680x4320 59.99 Hz (CVT 33.18M9-R) hsync: 266.55 kHz; pclk: 2089.75 MHz
+Modeline "7680x4320R"  2089.75  7680 7728 7760 7840  4320 4323 4328 4443 +hsync -vsync
+
+# 7680x4320 59.99 Hz (CVT 33.18M9) hsync: 268.22 kHz; pclk: 2892.50 MHz
+Modeline "7680x4320"  2892.50  7680 8376 9232 10784  4320 4323 4328 4471 -hsync +vsync
+
+# 15360x8640 59.99 Hz (CVT 132.71M9-R) hsync: 533.10 kHz; pclk: 8273.75 MHz
+Modeline "15360x8640R"  8273.75  15360 15408 15440 15520  8640 8643 8648 8886 +hsync -vsync
+
+# 15360x8640 60.00 Hz (CVT 132.71M9) hsync: 536.27 kHz; pclk: 11669.25 MHz
+Modeline "15360x8640"  11669.25  15360 16824 18560 21760  8640 8643 8648 8938 -hsync +vsync
+
+## 16:10 modelines generated by cvt
+
+# 1280x800 59.91 Hz (CVT 1.02MA-R) hsync: 49.31 kHz; pclk: 71.00 MHz
+Modeline "1280x800R"   71.00  1280 1328 1360 1440  800 803 809 823 +hsync -vsync
+
+# 1280x800 59.81 Hz (CVT 1.02MA) hsync: 49.70 kHz; pclk: 83.50 MHz
+Modeline "1280x800"   83.50  1280 1352 1480 1680  800 803 809 831 -hsync +vsync
+
+# 1400x900 59.88 Hz (CVT) hsync: 55.45 kHz; pclk: 86.50 MHz
+Modeline "1400x900R"   86.50  1400 1448 1480 1560  900 903 913 926 +hsync -vsync
+
+# 1400x900 59.96 Hz (CVT) hsync: 56.01 kHz; pclk: 103.50 MHz
+Modeline "1400x900"  103.50  1400 1480 1624 1848  900 903 913 934 -hsync +vsync
+
+# 1680x1050 59.88 Hz (CVT 1.76MA-R) hsync: 64.67 kHz; pclk: 119.00 MHz
+Modeline "1680x1050R"  119.00  1680 1728 1760 1840  1050 1053 1059 1080 +hsync -vsync
+
+# 1680x1050 59.95 Hz (CVT 1.76MA) hsync: 65.29 kHz; pclk: 146.25 MHz
+Modeline "1680x1050"  146.25  1680 1784 1960 2240  1050 1053 1059 1089 -hsync +vsync
+
+# 1920x1200 59.95 Hz (CVT 2.30MA-R) hsync: 74.04 kHz; pclk: 154.00 MHz
+Modeline "1920x1200R"  154.00  1920 1968 2000 2080  1200 1203 1209 1235 +hsync -vsync
+
+# 1920x1200 59.88 Hz (CVT 2.30MA) hsync: 74.56 kHz; pclk: 193.25 MHz
+Modeline "1920x1200"  193.25  1920 2056 2256 2592  1200 1203 1209 1245 -hsync +vsync
+
+# 2560x1600 59.97 Hz (CVT 4.10MA-R) hsync: 98.71 kHz; pclk: 268.50 MHz
+Modeline "2560x1600R"  268.50  2560 2608 2640 2720  1600 1603 1609 1646 +hsync -vsync
+
+# 2560x1600 59.99 Hz (CVT 4.10MA) hsync: 99.46 kHz; pclk: 348.50 MHz
+Modeline "2560x1600"  348.50  2560 2760 3032 3504  1600 1603 1609 1658 -hsync +vsync
commit 71269c6e57cec82bbf81b1c99c8019098303d6a3
Author: Adam Jackson <ajax at redhat.com>
Date:   Wed Dec 13 14:53:56 2017 -0500

    os: Fix a type error in the IPv6 XDMCP code
    
    Building with strict-aliasing rightly chirps here:
    
    ../os/xdmcp.c: In function ‘XdmcpRegisterConnection’:
    ../os/xdmcp.c:489:31: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
                         &((struct sockaddr_in6 *) &address)->sin6_addr.s6_addr[12];
                                   ^~~~~~~~~~~~
    
    We have "const char *address", so &address here is a char ** (i.e., it
    points to the slot on the stack containing the pointer to the character
    array passed in as an argument). Casting that to a struct sockaddr_in6 *
    is wrong, because it means that area of the stack will be reinterpreted
    as a struct sockaddr_in6.
    
    Instead, cast address, not &address.
    
    Signed-off-by: Adam Jackson <ajax at redhat.com>
    (cherry picked from commit 652913cd9474946bcb29271602bacfd98f46ad0b)

diff --git a/os/xdmcp.c b/os/xdmcp.c
index 7aeb393e6..d8c81fbf8 100644
--- a/os/xdmcp.c
+++ b/os/xdmcp.c
@@ -486,7 +486,7 @@ XdmcpRegisterConnection(int type, const char *address, int addrlen)
                      IN6_IS_ADDR_V4MAPPED((const struct in6_addr *) address)) {
                 fromAddr = &((struct sockaddr_in *) &FromAddress)->sin_addr;
                 regAddr =
-                    &((struct sockaddr_in6 *) &address)->sin6_addr.s6_addr[12];
+                    &((struct sockaddr_in6 *) address)->sin6_addr.s6_addr[12];
                 regAddrlen = sizeof(struct in_addr);
             }
         }
commit 8f11ab2b475623d5c00e146a7d6108f356a16b52
Author: Helmut Grohne <helmut at subdivi.de>
Date:   Thu Dec 21 11:48:15 2017 +0100

    build: guess availability of monotonic clock for cross compilation
    
    When cross compiling, the value of MONOTONIC_CLOCK would be "cross
    compiling", because AC_RUN_IFELSE doesn't work. However when enabling
    wayland, a monotonic clock is required and configure aborts.
    
    We change detection of CLOCK_MONOTONIC to degrade it gracefully from a
    run check to a declaration check in case of cross compilation based on
    the assumption that most systems will have a monotonic clock and those
    that don't won't be able to run Xwayland anyway. The trade-off
    essentially is either "always fail cross compilation" or "produce an
    unusable Xwayland for unusual platform" and this commit switches to the
    latter.
    
    Signed-off-by: Helmut Grohne <helmut at subdivi.de>
    Bug-Debian: https://bugs.debian.org/882531
    Reviewed-by: Adam Jackson <ajax at redhat.com>
    (cherry picked from commit c601c8faf54ff9e3bcbc653421828d71042deef7)

diff --git a/configure.ac b/configure.ac
index 2bfafb140..a9e311b51 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1066,6 +1066,10 @@ int main(int argc, char *argv[[]]) {
     ])], [MONOTONIC_CLOCK=yes], [MONOTONIC_CLOCK=no],
        [MONOTONIC_CLOCK="cross compiling"])
 
+    if test "$MONOTONIC_CLOCK" = "cross compiling"; then
+        AC_CHECK_DECL([CLOCK_MONOTONIC],[MONOTONIC_CLOCK="guessing yes"],[MONOTONIC_CLOCK=no],[#include <time.h>])
+    fi
+
     LIBS="$LIBS_SAVE"
     CPPFLAGS="$CPPFLAGS_SAVE"
 else
@@ -1073,6 +1077,9 @@ else
 fi
 
 AC_MSG_RESULT([$MONOTONIC_CLOCK])
+if test "$MONOTONIC_CLOCK" = "guessing yes"; then
+	MONOTONIC_CLOCK=yes
+fi
 
 if test "x$MONOTONIC_CLOCK" = xyes; then
     AC_DEFINE(MONOTONIC_CLOCK, 1, [Have monotonic clock from clock_gettime()])
commit 7cec7fb7bc34ea857e2d40ad32ead8a328dbe1a1
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Fri Jan 5 11:58:42 2018 +1000

    config: fix NULL value detection for ID_INPUT being unset
    
    Erroneous condition caused us to keep going with all devices that didn't have
    ID_INPUT set.
    
    Fixes: 5aad81445c8c3d6
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104382
    Reviewed-by: Adam Jackson <ajax at redhat.com>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    (cherry picked from commit a309323328d9d6e0bf5d9ea1d75920e53b9beef3)

diff --git a/config/udev.c b/config/udev.c
index e198e8609..3a73189e2 100644
--- a/config/udev.c
+++ b/config/udev.c
@@ -135,7 +135,7 @@ device_added(struct udev_device *udev_device)
 #endif
 
     value = udev_device_get_property_value(udev_device, "ID_INPUT");
-    if (value && !strcmp(value, "0")) {
+    if (!value || !strcmp(value, "0")) {
         LogMessageVerb(X_INFO, 10,
                        "config/udev: ignoring device %s without "
                        "property ID_INPUT set\n", path);
commit 16896d05a6a2a91fd53cf6af56ce5e79f6abb500
Author: Corentin Rossignon <corentin.rossignon at gmail.com>
Date:   Thu Jan 4 08:34:01 2018 +0100

    glamor: Specify GLSL version for xv shader
    
    SAMPLE is a GLSL keyword in newer OpenGL version.
    This fix issue with gnome-shell and playing video using xv
    
    Signed-off-by: Corentin Rossignon <corentin.rossignon at gmail.com>
    Bugzilla: https://bugs.freedesktop.org/104405
    Reviewed-by: Adam Jackson <ajax at redhat.com>
    (cherry picked from commit dbfbe58b94ec07a45fd6170f96bffec55051724e)

diff --git a/glamor/glamor_xv.c b/glamor/glamor_xv.c
index 31320d124..e0375d7cd 100644
--- a/glamor/glamor_xv.c
+++ b/glamor/glamor_xv.c
@@ -62,6 +62,8 @@ typedef struct tagREF_TRANSFORM {
 static const glamor_facet glamor_facet_xv_planar = {
     .name = "xv_planar",
 
+    .version = 120,
+
     .source_name = "v_texcoord0",
     .vs_vars = ("attribute vec2 position;\n"
                 "attribute vec2 v_texcoord0;\n"
commit 5e83ebd76738455c443a66024b0b5eb92930b36c
Author: Adam Jackson <ajax at redhat.com>
Date:   Tue Jan 9 10:54:05 2018 -0500

    animcur: Fix transitions between animated cursors
    
    We weren't cancelling the old timer when changing cursors, making things
    go all crashy. Logically we could always cancel the timer first, but
    then we'd have to call TimerSet to re-arm ourselves, and GetTimeInMillis
    is potentially expensive.
    
    Reported-by: https://devtalk.nvidia.com/default/topic/1028172/linux/titan-v-ubuntu-16-04lts-and-387-34-driver-crashes-badly/post/5230967/#5230967
    Signed-off-by: Adam Jackson <ajax at redhat.com>
    Reviewed-by: Aaron Plattner <aplattner at nvidia.com>
    Tested-by: Aaron Plattner <aplattner at nvidia.com>
    (cherry picked from commit de60245e05c0d2528d4ff42557a044387e53315c)

diff --git a/render/animcur.c b/render/animcur.c
index 9393b4018..e585a8f23 100644
--- a/render/animcur.c
+++ b/render/animcur.c
@@ -152,11 +152,20 @@ AnimCurTimerNotify(OsTimerPtr timer, CARD32 now, void *arg)
     return ac->elts[elt].delay;
 }
 
+static void
+AnimCurCancelTimer(DeviceIntPtr pDev)
+{
+    CursorPtr cur = pDev->spriteInfo->anim.pCursor;
+
+    if (IsAnimCur(cur))
+        TimerCancel(GetAnimCur(cur)->timer);
+}
+
 static Bool
 AnimCurDisplayCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
 {
     AnimCurScreenPtr as = GetAnimCurScreen(pScreen);
-    Bool ret;
+    Bool ret = TRUE;
 
     if (IsFloating(pDev))
         return FALSE;
@@ -166,8 +175,10 @@ AnimCurDisplayCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
         if (pCursor != pDev->spriteInfo->anim.pCursor) {
             AnimCurPtr ac = GetAnimCur(pCursor);
 
-            ret = (*pScreen->DisplayCursor)
-                (pDev, pScreen, ac->elts[0].pCursor);
+            AnimCurCancelTimer(pDev);
+            ret = (*pScreen->DisplayCursor) (pDev, pScreen,
+                                             ac->elts[0].pCursor);
+
             if (ret) {
                 pDev->spriteInfo->anim.elt = 0;
                 pDev->spriteInfo->anim.time =
@@ -179,15 +190,9 @@ AnimCurDisplayCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
                                      AnimCurTimerNotify, pDev);
             }
         }
-        else
-            ret = TRUE;
     }
     else {
-        CursorPtr old = pDev->spriteInfo->anim.pCursor;
-
-        if (old && IsAnimCur(old))
-            TimerCancel(GetAnimCur(old)->timer);
-
+        AnimCurCancelTimer(pDev);
         pDev->spriteInfo->anim.pCursor = 0;
         pDev->spriteInfo->anim.pScreen = 0;
         ret = (*pScreen->DisplayCursor) (pDev, pScreen, pCursor);
commit 693f0e21d55d6e9fe792d91e76e4168aa813db71
Author: Adam Jackson <ajax at redhat.com>
Date:   Thu Oct 26 15:24:39 2017 -0400

    animcur: Run the timer from the device, not the screen
    
    This is very slightly more efficient since the callback now doesn't need
    to walk every input device, instead we know exactly which device's
    cursor is being updated. AnimCurTimerNotify() gets outdented nicely as a
    result. A more important side effect is that we can stop using the
    TimerAbsolute mode and just pass in the relative delay.
    
    In AnimCurSetCursorPosition, we no longer need to rearm the timer with
    the new screen; it is enough to update the device's state. In
    AnimCurDisplayCursor we need to notice when we're switching from
    animated cursor to regular and cancel the existing timer.
    
    Reviewed-by: Robert Morell <rmorell at nvidia.com>
    Tested-by: Robert Morell <rmorell at nvidia.com>
    Signed-off-by: Adam Jackson <ajax at redhat.com>
    (cherry picked from commit 094a63d56fbfb9e23210cc9ac538fb198af37cee)

diff --git a/render/animcur.c b/render/animcur.c
index 26a6026ae..9393b4018 100644
--- a/render/animcur.c
+++ b/render/animcur.c
@@ -55,6 +55,7 @@ typedef struct _AnimCurElt {
 typedef struct _AnimCur {
     int nelt;                   /* number of elements in the elts array */
     AnimCurElt *elts;           /* actually allocated right after the structure */
+    OsTimerPtr timer;
 } AnimCurRec, *AnimCurPtr;
 
 typedef struct _AnimScrPriv {
@@ -65,8 +66,6 @@ typedef struct _AnimScrPriv {
     RealizeCursorProcPtr RealizeCursor;
     UnrealizeCursorProcPtr UnrealizeCursor;
     RecolorCursorProcPtr RecolorCursor;
-    OsTimerPtr timer;
-    Bool timer_set;
 } AnimCurScreenRec, *AnimCurScreenPtr;
 
 static unsigned char empty[4];
@@ -130,49 +129,27 @@ AnimCurCursorLimits(DeviceIntPtr pDev,
 static CARD32
 AnimCurTimerNotify(OsTimerPtr timer, CARD32 now, void *arg)
 {
-    ScreenPtr pScreen = arg;
+    DeviceIntPtr dev = arg;
+    ScreenPtr pScreen = dev->spriteInfo->anim.pScreen;
     AnimCurScreenPtr as = GetAnimCurScreen(pScreen);
-    DeviceIntPtr dev;
-    Bool activeDevice = FALSE;
-    CARD32 soonest = ~0;       /* earliest time to wakeup again */
-
-    for (dev = inputInfo.devices; dev; dev = dev->next) {
-        if (IsPointerDevice(dev) && pScreen == dev->spriteInfo->anim.pScreen) {
-            if (!activeDevice)
-                activeDevice = TRUE;
-
-            if ((INT32) (now - dev->spriteInfo->anim.time) >= 0) {
-                AnimCurPtr ac = GetAnimCur(dev->spriteInfo->anim.pCursor);
-                int elt = (dev->spriteInfo->anim.elt + 1) % ac->nelt;
-                DisplayCursorProcPtr DisplayCursor;
-
-                /*
-                 * Not a simple Unwrap/Wrap as this
-                 * isn't called along the DisplayCursor
-                 * wrapper chain.
-                 */
-                DisplayCursor = pScreen->DisplayCursor;
-                pScreen->DisplayCursor = as->DisplayCursor;
-                (void) (*pScreen->DisplayCursor) (dev,
-                                                  pScreen,
-                                                  ac->elts[elt].pCursor);
-                as->DisplayCursor = pScreen->DisplayCursor;
-                pScreen->DisplayCursor = DisplayCursor;
-
-                dev->spriteInfo->anim.elt = elt;
-                dev->spriteInfo->anim.time = now + ac->elts[elt].delay;
-            }
 
-            if (soonest > dev->spriteInfo->anim.time)
-                soonest = dev->spriteInfo->anim.time;
-        }
-    }
+    AnimCurPtr ac = GetAnimCur(dev->spriteInfo->anim.pCursor);
+    int elt = (dev->spriteInfo->anim.elt + 1) % ac->nelt;
+    DisplayCursorProcPtr DisplayCursor = pScreen->DisplayCursor;
 
-    if (activeDevice)
-        return soonest - now;
+    /*
+     * Not a simple Unwrap/Wrap as this isn't called along the DisplayCursor
+     * wrapper chain.
+     */
+    pScreen->DisplayCursor = as->DisplayCursor;
+    (void) (*pScreen->DisplayCursor) (dev, pScreen, ac->elts[elt].pCursor);
+    as->DisplayCursor = pScreen->DisplayCursor;
+    pScreen->DisplayCursor = DisplayCursor;
 
-    as->timer_set = FALSE;
-    return 0;
+    dev->spriteInfo->anim.elt = elt;
+    dev->spriteInfo->anim.time = now + ac->elts[elt].delay;
+
+    return ac->elts[elt].delay;
 }
 
 static Bool
@@ -198,17 +175,19 @@ AnimCurDisplayCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
                 pDev->spriteInfo->anim.pCursor = pCursor;
                 pDev->spriteInfo->anim.pScreen = pScreen;
 
-                if (!as->timer_set) {
-                    TimerSet(as->timer, TimerAbsolute, pDev->spriteInfo->anim.time,
-                             AnimCurTimerNotify, pScreen);
-                    as->timer_set = TRUE;
-                }
+                ac->timer = TimerSet(ac->timer, 0, ac->elts[0].delay,
+                                     AnimCurTimerNotify, pDev);
             }
         }
         else
             ret = TRUE;
     }
     else {
+        CursorPtr old = pDev->spriteInfo->anim.pCursor;
+
+        if (old && IsAnimCur(old))
+            TimerCancel(GetAnimCur(old)->timer);
+
         pDev->spriteInfo->anim.pCursor = 0;
         pDev->spriteInfo->anim.pScreen = 0;
         ret = (*pScreen->DisplayCursor) (pDev, pScreen, pCursor);
@@ -227,12 +206,6 @@ AnimCurSetCursorPosition(DeviceIntPtr pDev,
     Unwrap(as, pScreen, SetCursorPosition);
     if (pDev->spriteInfo->anim.pCursor) {
         pDev->spriteInfo->anim.pScreen = pScreen;
-
-        if (!as->timer_set) {
-            TimerSet(as->timer, TimerAbsolute, pDev->spriteInfo->anim.time,
-                     AnimCurTimerNotify, pScreen);
-            as->timer_set = TRUE;
-        }
     }
     ret = (*pScreen->SetCursorPosition) (pDev, pScreen, x, y, generateEvent);
     Wrap(as, pScreen, SetCursorPosition, AnimCurSetCursorPosition);
@@ -307,11 +280,6 @@ AnimCurInit(ScreenPtr pScreen)
         return FALSE;
 
     as = GetAnimCurScreen(pScreen);
-    as->timer = TimerSet(NULL, TimerAbsolute, 0, AnimCurTimerNotify, pScreen);
-    if (!as->timer) {
-        return FALSE;
-    }
-    as->timer_set = FALSE;
 
     Wrap(as, pScreen, CloseScreen, AnimCurCloseScreen);
 
@@ -359,10 +327,14 @@ AnimCursorCreate(CursorPtr *cursors, CARD32 *deltas, int ncursor,
 
     pCursor->id = cid;
 
+    ac = GetAnimCur(pCursor);
+    ac->timer = TimerSet(NULL, 0, 0, AnimCurTimerNotify, NULL);
+
     /* security creation/labeling check */
     rc = XaceHook(XACE_RESOURCE_ACCESS, client, cid, RT_CURSOR, pCursor,
                   RT_NONE, NULL, DixCreateAccess);
     if (rc != Success) {
+        TimerFree(ac->timer);
         dixFiniPrivates(pCursor, PRIVATE_CURSOR);
         free(pCursor);
         return rc;
@@ -372,7 +344,6 @@ AnimCursorCreate(CursorPtr *cursors, CARD32 *deltas, int ncursor,
      * Fill in the AnimCurRec
      */
     animCursorBits.refcnt++;
-    ac = GetAnimCur(pCursor);
     ac->nelt = ncursor;
     ac->elts = (AnimCurElt *) (ac + 1);
 
commit 354c48304d27f75b7c33c03a0adb050c37788ccf
Author: Adam Jackson <ajax at redhat.com>
Date:   Thu Oct 26 13:53:06 2017 -0400

    animcur: Return the next interval directly from the timer callback
    
    If the return value is non-zero here, DoTimer() will automatically rearm
    the timer for the new (relative) delay. 'soonest' is in absolute time,
    so subtract off 'now' and return that.
    
    Reviewed-by: Robert Morell <rmorell at nvidia.com>
    Tested-by: Robert Morell <rmorell at nvidia.com>
    Signed-off-by: Adam Jackson <ajax at redhat.com>
    (cherry picked from commit cc3241a712684f8c7147f5688e9ee3ecb5a93b87)

diff --git a/render/animcur.c b/render/animcur.c
index 3f85f9a4f..26a6026ae 100644
--- a/render/animcur.c
+++ b/render/animcur.c
@@ -169,10 +169,9 @@ AnimCurTimerNotify(OsTimerPtr timer, CARD32 now, void *arg)
     }
 
     if (activeDevice)
-        TimerSet(as->timer, TimerAbsolute, soonest, AnimCurTimerNotify, pScreen);
-    else
-        as->timer_set = FALSE;
+        return soonest - now;
 
+    as->timer_set = FALSE;
     return 0;
 }
 
commit 26841b2c9ea03fda8b2d0da254e0344fd2a3afce
Author: Adam Jackson <ajax at redhat.com>
Date:   Thu Oct 26 13:40:57 2017 -0400

    animcur: Use fixed-size screen private
    
    Reviewed-by: Robert Morell <rmorell at nvidia.com>
    Tested-by: Robert Morell <rmorell at nvidia.com>
    Signed-off-by: Adam Jackson <ajax at redhat.com>
    (cherry picked from commit 3abbdb7318018584a27220737bd92081ce8ee67c)

diff --git a/render/animcur.c b/render/animcur.c
index 52e6b8b79..3f85f9a4f 100644
--- a/render/animcur.c
+++ b/render/animcur.c
@@ -77,12 +77,9 @@ static CursorBits animCursorBits = {
 
 static DevPrivateKeyRec AnimCurScreenPrivateKeyRec;
 
-#define AnimCurScreenPrivateKey (&AnimCurScreenPrivateKeyRec)
-
 #define IsAnimCur(c)	    ((c) && ((c)->bits == &animCursorBits))
 #define GetAnimCur(c)	    ((AnimCurPtr) ((((char *)(c) + CURSOR_REC_SIZE))))
-#define GetAnimCurScreen(s) ((AnimCurScreenPtr)dixLookupPrivate(&(s)->devPrivates, AnimCurScreenPrivateKey))
-#define SetAnimCurScreen(s,p) dixSetPrivate(&(s)->devPrivates, AnimCurScreenPrivateKey, p)
+#define GetAnimCurScreen(s) ((AnimCurScreenPtr)dixLookupPrivate(&(s)->devPrivates, &AnimCurScreenPrivateKeyRec))
 
 #define Wrap(as,s,elt,func) (((as)->elt = (s)->elt), (s)->elt = func)
 #define Unwrap(as,s,elt)    ((s)->elt = (as)->elt)
@@ -101,9 +98,7 @@ AnimCurCloseScreen(ScreenPtr pScreen)
     Unwrap(as, pScreen, RealizeCursor);
     Unwrap(as, pScreen, UnrealizeCursor);
     Unwrap(as, pScreen, RecolorCursor);
-    SetAnimCurScreen(pScreen, 0);
     ret = (*pScreen->CloseScreen) (pScreen);
-    free(as);
     return ret;
 }
 
@@ -308,15 +303,13 @@ AnimCurInit(ScreenPtr pScreen)
 {
     AnimCurScreenPtr as;
 
-    if (!dixRegisterPrivateKey(&AnimCurScreenPrivateKeyRec, PRIVATE_SCREEN, 0))
+    if (!dixRegisterPrivateKey(&AnimCurScreenPrivateKeyRec, PRIVATE_SCREEN,
+                               sizeof(AnimCurScreenRec)))
         return FALSE;
 
-    as = (AnimCurScreenPtr) malloc(sizeof(AnimCurScreenRec));
-    if (!as)
-        return FALSE;
+    as = GetAnimCurScreen(pScreen);
     as->timer = TimerSet(NULL, TimerAbsolute, 0, AnimCurTimerNotify, pScreen);
     if (!as->timer) {
-        free(as);
         return FALSE;
     }
     as->timer_set = FALSE;
@@ -329,7 +322,6 @@ AnimCurInit(ScreenPtr pScreen)
     Wrap(as, pScreen, RealizeCursor, AnimCurRealizeCursor);
     Wrap(as, pScreen, UnrealizeCursor, AnimCurUnrealizeCursor);
     Wrap(as, pScreen, RecolorCursor, AnimCurRecolorCursor);
-    SetAnimCurScreen(pScreen, as);
     return TRUE;
 }
 
commit 725b4b46ff59a8db84d8c12fec02c6b1d94b27ce
Author: Lukáš Krejčí <lskrejci at gmail.com>
Date:   Sat Dec 30 23:46:45 2017 +0100

    Xorg.wrap: Ensure correct ordering of post-install hook
    
    The install rule of Xorg.wrap is currently a dependency of the
    install-data target instead of the install-exec target. The build also
    uses install-exec-hook to change the ownership and set the SUID bit on
    the Xorg.wrap binary. The problem is that install-exec-hook is only
    ordered respective to the install-exec target, the rules of install-data
    may or may not have been executed.
    
    If install-exec-hook runs before the Xorg.wrap binary is in place,
    a message similar to the following will be present in the build log:
    
    chown: cannot access '/pkgdir/usr/lib/xorg-server/Xorg.wrap': No such file or directory
    make[6]: [Makefile:1151: install-exec-hook] Error 1 (ignored)
    
    All that needs to be done is to change the name of the program variable
    to contain 'exec' for the install rule to depend on the install-exec
    target.
    
    Excerpt from the Automake manual, chapter 12.2 The Two Parts of Install:
    "Any variable using a user-defined directory prefix with ‘exec’ in the
    name (e.g., myexecbin_PROGRAMS) is installed by install-exec. All other
    user-defined prefixes are installed by install-data."
    
    https://bugs.freedesktop.org/show_bug.cgi?id=104419
    
    Signed-off-by: Lukáš Krejčí <lskrejci at gmail.com>
    Acked-by: Hans de Goede <hdegoede at redhat.com>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    (cherry picked from commit f615cb62d47cb24ea31718e8226df53ce6651c91)

diff --git a/hw/xfree86/Makefile.am b/hw/xfree86/Makefile.am
index b876b79ab..458720052 100644
--- a/hw/xfree86/Makefile.am
+++ b/hw/xfree86/Makefile.am
@@ -84,8 +84,8 @@ Xorg_DEPENDENCIES = $(LOCAL_LIBS)
 Xorg_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG)
 
 if SUID_WRAPPER
-wrapdir = $(SUID_WRAPPER_DIR)
-wrap_PROGRAMS = Xorg.wrap
+wrapexecdir = $(SUID_WRAPPER_DIR)
+wrapexec_PROGRAMS = Xorg.wrap
 Xorg_wrap_SOURCES = xorg-wrapper.c
 endif
 
commit 16fd18479d2f617adf0e6de922586441be3808eb
Author: Olivier Fourdan <ofourdan at redhat.com>
Date:   Fri Dec 15 16:43:47 2017 +0100

    xwayland: avoid race condition on new keymap
    
    When the Wayland compositor notifies of a new keymap, for the first X11
    client using the keyboard, the last slave keyboard used might still not
    be set (i.e. “lastSlave” is still NULL).
    
    As a result, the new keymap is not applied, and the first X11 window
    will have the wrong keymap set initially.
    
    Apply the new keymap to the master keyboard as long as there's one.
    
    Bugzilla: https://bugzilla.gnome.org/show_bug.cgi?id=791383
    Signed-off-by: Olivier Fourdan <ofourdan at redhat.com>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    (cherry picked from commit 170c95978530f6373bdf4488116902b273f3abf4)

diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c
index f2564d5d3..d96e6f2a4 100644
--- a/hw/xwayland/xwayland-input.c
+++ b/hw/xwayland/xwayland-input.c
@@ -639,7 +639,7 @@ keyboard_handle_keymap(void *data, struct wl_keyboard *keyboard,
     XkbDeviceApplyKeymap(xwl_seat->keyboard, xkb);
 
     master = GetMaster(xwl_seat->keyboard, MASTER_KEYBOARD);
-    if (master && master->lastSlave == xwl_seat->keyboard)
+    if (master)
         XkbDeviceApplyKeymap(master, xkb);
 
     XkbFreeKeyboard(xkb, XkbAllComponentsMask, TRUE);


More information about the xorg-commit mailing list