$ git diff --patch-with-stat --summary c79e0d31b4eb2be9feaac03c84385e46c138768c..437a8741023c4f52489cfc1a3cf3b74eba848265
...t-pick-sRGB-config-for-32-bit-RGBA-visual.patch | 40 +++++
...ayland-avoid-race-condition-on-new-keymap.patch | 42 +++++
...nsure-correct-ordering-of-post-install-ho.patch | 60 +++++++
0103-animcur-Use-fixed-size-screen-private.patch | 71 ++++++++
...urn-the-next-interval-directly-from-the-t.patch | 38 +++++
...-the-timer-from-the-device-not-the-screen.patch | 189 +++++++++++++++++++++
...-Fix-transitions-between-animated-cursors.patch | 78 +++++++++
...glamor-Specify-GLSL-version-for-xv-shader.patch | 32 ++++
...NULL-value-detection-for-ID_INPUT-being-u.patch | 34 ++++
...-availability-of-monotonic-clock-for-cros.patch | 54 ++++++
...s-Fix-a-type-error-in-the-IPv6-XDMCP-code.patch | 45 +++++
...ee86-add-default-modes-for-16-9-and-16-10.patch | 171 +++++++++++++++++++
...ent-Only-send-PresentCompleteNotify-event.patch | 161 ++++++++++++++++++
...eenInit-Clear-pScreenPriv-dixinfo-when-fr.patch | 34 ++++
...ropagate-damagedDescendants-when-reparent.patch | 101 +++++++++++
...tthread-Force-unlock-when-stopping-thread.patch | 33 ++++
...move-dirty-window-unconditionally-on-unre.patch | 68 ++++++++
...repeat-reflect-case-in-linear-gradient-sh.patch | 57 +++++++
...-glamor-fix-no-reflect-case-for-gradients.patch | 92 ++++++++++
...ve-unused-variables-in-linear-gradient-sh.patch | 34 ++++
...amor-tidy-up-some-gradient-color-formulas.patch | 158 +++++++++++++++++
...Fix-rotation-check-in-ProcRRSetScreenSize.patch | 45 +++++
...n-t-process-cursor-warping-without-an-xwl.patch | 93 ++++++++++
...sign-8-bpc-fbconfigs-for-composite-visual.patch | 47 +++++
...not-call-into-Composite-if-it-is-disabled.patch | 182 ++++++++++++++++++++
x11-server.spec | 32 +++-
26 files changed, 1990 insertions(+), 1 deletion(-)
create mode 100644 0100-glx-do-not-pick-sRGB-config-for-32-bit-RGBA-visual.patch
create mode 100644 0101-xwayland-avoid-race-condition-on-new-keymap.patch
create mode 100644 0102-Xorg.wrap-Ensure-correct-ordering-of-post-install-ho.patch
create mode 100644 0103-animcur-Use-fixed-size-screen-private.patch
create mode 100644 0104-animcur-Return-the-next-interval-directly-from-the-t.patch
create mode 100644 0105-animcur-Run-the-timer-from-the-device-not-the-screen.patch
create mode 100644 0106-animcur-Fix-transitions-between-animated-cursors.patch
create mode 100644 0107-glamor-Specify-GLSL-version-for-xv-shader.patch
create mode 100644 0108-config-fix-NULL-value-detection-for-ID_INPUT-being-u.patch
create mode 100644 0109-build-guess-availability-of-monotonic-clock-for-cros.patch
create mode 100644 0110-os-Fix-a-type-error-in-the-IPv6-XDMCP-code.patch
create mode 100644 0111-xfree86-add-default-modes-for-16-9-and-16-10.patch
create mode 100644 0112-Revert-present-Only-send-PresentCompleteNotify-event.patch
create mode 100644 0113-xf86XvMCScreenInit-Clear-pScreenPriv-dixinfo-when-fr.patch
create mode 100644 0114-composite-Propagate-damagedDescendants-when-reparent.patch
create mode 100644 0115-os-inputthread-Force-unlock-when-stopping-thread.patch
create mode 100644 0116-xwayland-remove-dirty-window-unconditionally-on-unre.patch
create mode 100644 0117-glamor-fix-repeat-reflect-case-in-linear-gradient-sh.patch
create mode 100644 0118-glamor-fix-no-reflect-case-for-gradients.patch
create mode 100644 0119-glamor-remove-unused-variables-in-linear-gradient-sh.patch
create mode 100644 0120-glamor-tidy-up-some-gradient-color-formulas.patch
create mode 100644 0121-randr-Fix-rotation-check-in-ProcRRSetScreenSize.patch
create mode 100644 0122-xwayland-Don-t-process-cursor-warping-without-an-xwl.patch
create mode 100644 0123-glx-Only-assign-8-bpc-fbconfigs-for-composite-visual.patch
create mode 100644 0200-glx-Do-not-call-into-Composite-if-it-is-disabled.patch
diff --git a/0100-glx-do-not-pick-sRGB-config-for-32-bit-RGBA-visual.patch b/0100-glx-do-not-pick-sRGB-config-for-32-bit-RGBA-visual.patch
new file mode 100644
index 0000000..009670c
--- /dev/null
+++ b/0100-glx-do-not-pick-sRGB-config-for-32-bit-RGBA-visual.patch
@@ -0,0 +1,40 @@
+From a13271f2feb6e480b2e698d4efa3b94150a6808b Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Tapani=20P=C3=A4lli?= <tapani.palli@intel.com>
+Date: Tue, 28 Nov 2017 09:23:29 +0200
+Subject: [PATCH 100/123] glx: do not pick sRGB config for 32-bit RGBA visual
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This fixes blending issues seen with kwin and gnome-shell when
+32bit visual has sRGB capability set.
+
+Reviewed-by: Adam Jackson <ajax@redhat.com>
+Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
+Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103699
+Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103646
+Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103655
+(cherry picked from commit c2954b16c8730c7ed8441fd8dba25900f3aed265)
+---
+ glx/glxscreens.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/glx/glxscreens.c b/glx/glxscreens.c
+index 29bacd9..62d66bc 100644
+--- a/glx/glxscreens.c
++++ b/glx/glxscreens.c
+@@ -275,6 +275,11 @@ pickFBConfig(__GLXscreen * pGlxScreen, VisualPtr visual)
+ /* If it's the 32-bit RGBA visual, demand a 32-bit fbconfig. */
+ if (visual->nplanes == 32 && config->rgbBits != 32)
+ continue;
++ /* If it's the 32-bit RGBA visual, do not pick sRGB capable config.
++ * This can cause issues with compositors that are not sRGB aware.
++ */
++ if (visual->nplanes == 32 && config->sRGBCapable == GL_TRUE)
++ continue;
+ /* Can't use the same FBconfig for multiple X visuals. I think. */
+ if (config->visualID != 0)
+ continue;
+--
+2.8.3
+
diff --git a/0101-xwayland-avoid-race-condition-on-new-keymap.patch b/0101-xwayland-avoid-race-condition-on-new-keymap.patch
new file mode 100644
index 0000000..f963b3f
--- /dev/null
+++ b/0101-xwayland-avoid-race-condition-on-new-keymap.patch
@@ -0,0 +1,42 @@
+From 16fd18479d2f617adf0e6de922586441be3808eb Mon Sep 17 00:00:00 2001
+From: Olivier Fourdan <ofourdan@redhat.com>
+Date: Fri, 15 Dec 2017 16:43:47 +0100
+Subject: [PATCH 101/123] xwayland: avoid race condition on new keymap
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+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@redhat.com>
+Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
+Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+(cherry picked from commit 170c95978530f6373bdf4488116902b273f3abf4)
+---
+ hw/xwayland/xwayland-input.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c
+index f2564d5..d96e6f2 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);
+--
+2.8.3
+
diff --git a/0102-Xorg.wrap-Ensure-correct-ordering-of-post-install-ho.patch b/0102-Xorg.wrap-Ensure-correct-ordering-of-post-install-ho.patch
new file mode 100644
index 0000000..fd29acf
--- /dev/null
+++ b/0102-Xorg.wrap-Ensure-correct-ordering-of-post-install-ho.patch
@@ -0,0 +1,60 @@
+From 725b4b46ff59a8db84d8c12fec02c6b1d94b27ce Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Krej=C4=8D=C3=AD?= <lskrejci@gmail.com>
+Date: Sat, 30 Dec 2017 23:46:45 +0100
+Subject: [PATCH 102/123] Xorg.wrap: Ensure correct ordering of post-install
+ hook
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+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@gmail.com>
+Acked-by: Hans de Goede <hdegoede@redhat.com>
+Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
+Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+(cherry picked from commit f615cb62d47cb24ea31718e8226df53ce6651c91)
+---
+ hw/xfree86/Makefile.am | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/hw/xfree86/Makefile.am b/hw/xfree86/Makefile.am
+index b876b79..4587200 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
+
+--
+2.8.3
+
diff --git a/0103-animcur-Use-fixed-size-screen-private.patch b/0103-animcur-Use-fixed-size-screen-private.patch
new file mode 100644
index 0000000..9368336
--- /dev/null
+++ b/0103-animcur-Use-fixed-size-screen-private.patch
@@ -0,0 +1,71 @@
+From 26841b2c9ea03fda8b2d0da254e0344fd2a3afce Mon Sep 17 00:00:00 2001
+From: Adam Jackson <ajax@redhat.com>
+Date: Thu, 26 Oct 2017 13:40:57 -0400
+Subject: [PATCH 103/123] animcur: Use fixed-size screen private
+
+Reviewed-by: Robert Morell <rmorell@nvidia.com>
+Tested-by: Robert Morell <rmorell@nvidia.com>
+Signed-off-by: Adam Jackson <ajax@redhat.com>
+(cherry picked from commit 3abbdb7318018584a27220737bd92081ce8ee67c)
+---
+ render/animcur.c | 16 ++++------------
+ 1 file changed, 4 insertions(+), 12 deletions(-)
+
+diff --git a/render/animcur.c b/render/animcur.c
+index 52e6b8b..3f85f9a 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;
+ }
+
+--
+2.8.3
+
diff --git a/0104-animcur-Return-the-next-interval-directly-from-the-t.patch b/0104-animcur-Return-the-next-interval-directly-from-the-t.patch
new file mode 100644
index 0000000..7603552
--- /dev/null
+++ b/0104-animcur-Return-the-next-interval-directly-from-the-t.patch
@@ -0,0 +1,38 @@
+From 354c48304d27f75b7c33c03a0adb050c37788ccf Mon Sep 17 00:00:00 2001
+From: Adam Jackson <ajax@redhat.com>
+Date: Thu, 26 Oct 2017 13:53:06 -0400
+Subject: [PATCH 104/123] 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@nvidia.com>
+Tested-by: Robert Morell <rmorell@nvidia.com>
+Signed-off-by: Adam Jackson <ajax@redhat.com>
+(cherry picked from commit cc3241a712684f8c7147f5688e9ee3ecb5a93b87)
+---
+ render/animcur.c | 5 ++---
+ 1 file changed, 2 insertions(+), 3 deletions(-)
+
+diff --git a/render/animcur.c b/render/animcur.c
+index 3f85f9a..26a6026 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;
+ }
+
+--
+2.8.3
+
diff --git a/0105-animcur-Run-the-timer-from-the-device-not-the-screen.patch b/0105-animcur-Run-the-timer-from-the-device-not-the-screen.patch
new file mode 100644
index 0000000..c26d970
--- /dev/null
+++ b/0105-animcur-Run-the-timer-from-the-device-not-the-screen.patch
@@ -0,0 +1,189 @@
+From 693f0e21d55d6e9fe792d91e76e4168aa813db71 Mon Sep 17 00:00:00 2001
+From: Adam Jackson <ajax@redhat.com>
+Date: Thu, 26 Oct 2017 15:24:39 -0400
+Subject: [PATCH 105/123] 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@nvidia.com>
+Tested-by: Robert Morell <rmorell@nvidia.com>
+Signed-off-by: Adam Jackson <ajax@redhat.com>
+(cherry picked from commit 094a63d56fbfb9e23210cc9ac538fb198af37cee)
+---
+ render/animcur.c | 87 +++++++++++++++++++-------------------------------------
+ 1 file changed, 29 insertions(+), 58 deletions(-)
+
+diff --git a/render/animcur.c b/render/animcur.c
+index 26a6026..9393b40 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);
+
+--
+2.8.3
+
diff --git a/0106-animcur-Fix-transitions-between-animated-cursors.patch b/0106-animcur-Fix-transitions-between-animated-cursors.patch
new file mode 100644
index 0000000..e95978a
--- /dev/null
+++ b/0106-animcur-Fix-transitions-between-animated-cursors.patch
@@ -0,0 +1,78 @@
+From 5e83ebd76738455c443a66024b0b5eb92930b36c Mon Sep 17 00:00:00 2001
+From: Adam Jackson <ajax@redhat.com>
+Date: Tue, 9 Jan 2018 10:54:05 -0500
+Subject: [PATCH 106/123] 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@redhat.com>
+Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
+Tested-by: Aaron Plattner <aplattner@nvidia.com>
+(cherry picked from commit de60245e05c0d2528d4ff42557a044387e53315c)
+---
+ render/animcur.c | 25 +++++++++++++++----------
+ 1 file changed, 15 insertions(+), 10 deletions(-)
+
+diff --git a/render/animcur.c b/render/animcur.c
+index 9393b40..e585a8f 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);
+--
+2.8.3
+
diff --git a/0107-glamor-Specify-GLSL-version-for-xv-shader.patch b/0107-glamor-Specify-GLSL-version-for-xv-shader.patch
new file mode 100644
index 0000000..53fea7a
--- /dev/null
+++ b/0107-glamor-Specify-GLSL-version-for-xv-shader.patch
@@ -0,0 +1,32 @@
+From 16896d05a6a2a91fd53cf6af56ce5e79f6abb500 Mon Sep 17 00:00:00 2001
+From: Corentin Rossignon <corentin.rossignon@gmail.com>
+Date: Thu, 4 Jan 2018 08:34:01 +0100
+Subject: [PATCH 107/123] 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@gmail.com>
+Bugzilla: https://bugs.freedesktop.org/104405
+Reviewed-by: Adam Jackson <ajax@redhat.com>
+(cherry picked from commit dbfbe58b94ec07a45fd6170f96bffec55051724e)
+---
+ glamor/glamor_xv.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/glamor/glamor_xv.c b/glamor/glamor_xv.c
+index 31320d1..e0375d7 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"
+--
+2.8.3
+
diff --git a/0108-config-fix-NULL-value-detection-for-ID_INPUT-being-u.patch b/0108-config-fix-NULL-value-detection-for-ID_INPUT-being-u.patch
new file mode 100644
index 0000000..dd77208
--- /dev/null
+++ b/0108-config-fix-NULL-value-detection-for-ID_INPUT-being-u.patch
@@ -0,0 +1,34 @@
+From 7cec7fb7bc34ea857e2d40ad32ead8a328dbe1a1 Mon Sep 17 00:00:00 2001
+From: Peter Hutterer <peter.hutterer@who-t.net>
+Date: Fri, 5 Jan 2018 11:58:42 +1000
+Subject: [PATCH 108/123] 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@redhat.com>
+Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+(cherry picked from commit a309323328d9d6e0bf5d9ea1d75920e53b9beef3)
+---
+ config/udev.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/config/udev.c b/config/udev.c
+index e198e86..3a73189 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);
+--
+2.8.3
+
diff --git a/0109-build-guess-availability-of-monotonic-clock-for-cros.patch b/0109-build-guess-availability-of-monotonic-clock-for-cros.patch
new file mode 100644
index 0000000..3a2d25b
--- /dev/null
+++ b/0109-build-guess-availability-of-monotonic-clock-for-cros.patch
@@ -0,0 +1,54 @@
+From 8f11ab2b475623d5c00e146a7d6108f356a16b52 Mon Sep 17 00:00:00 2001
+From: Helmut Grohne <helmut@subdivi.de>
+Date: Thu, 21 Dec 2017 11:48:15 +0100
+Subject: [PATCH 109/123] 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@subdivi.de>
+Bug-Debian: https://bugs.debian.org/882531
+Reviewed-by: Adam Jackson <ajax@redhat.com>
+(cherry picked from commit c601c8faf54ff9e3bcbc653421828d71042deef7)
+---
+ configure.ac | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index 2bfafb1..a9e311b 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()])
+--
+2.8.3
+
diff --git a/0110-os-Fix-a-type-error-in-the-IPv6-XDMCP-code.patch b/0110-os-Fix-a-type-error-in-the-IPv6-XDMCP-code.patch
new file mode 100644
index 0000000..df024c3
--- /dev/null
+++ b/0110-os-Fix-a-type-error-in-the-IPv6-XDMCP-code.patch
@@ -0,0 +1,45 @@
+From 71269c6e57cec82bbf81b1c99c8019098303d6a3 Mon Sep 17 00:00:00 2001
+From: Adam Jackson <ajax@redhat.com>
+Date: Wed, 13 Dec 2017 14:53:56 -0500
+Subject: [PATCH 110/123] os: Fix a type error in the IPv6 XDMCP code
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+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@redhat.com>
+(cherry picked from commit 652913cd9474946bcb29271602bacfd98f46ad0b)
+---
+ os/xdmcp.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/os/xdmcp.c b/os/xdmcp.c
+index 7aeb393..d8c81fb 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);
+ }
+ }
+--
+2.8.3
+
diff --git a/0111-xfree86-add-default-modes-for-16-9-and-16-10.patch b/0111-xfree86-add-default-modes-for-16-9-and-16-10.patch
new file mode 100644
index 0000000..7ca6c2e
--- /dev/null
+++ b/0111-xfree86-add-default-modes-for-16-9-and-16-10.patch
@@ -0,0 +1,171 @@
+From 8be1dbeacf5f29c0b538414e87d47c9d5af08d9d Mon Sep 17 00:00:00 2001
+From: Martin Wilck <mwilck@suse.com>
+Date: Tue, 9 Jan 2018 20:33:09 +0100
+Subject: [PATCH 111/123] 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@suse.com>
+Reviewed-by: Adam Jackson <ajax@redhat.com>
+(cherry picked from commit a5e9bcad7ad0887f804905b482894b85751519fb)
+---
+ hw/xfree86/common/extramodes | 141 +++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 141 insertions(+)
+
+diff --git a/hw/xfree86/common/extramodes b/hw/xfree86/common/extramodes
+index 4505026..006b5cb 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
+--
+2.8.3
+
diff --git a/0112-Revert-present-Only-send-PresentCompleteNotify-event.patch b/0112-Revert-present-Only-send-PresentCompleteNotify-event.patch
new file mode 100644
index 0000000..533b322
--- /dev/null
+++ b/0112-Revert-present-Only-send-PresentCompleteNotify-event.patch
@@ -0,0 +1,161 @@
+From d0d1a694f967af770fba0d36043fd5218ff20984 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Michel=20D=C3=A4nzer?= <michel.daenzer@amd.com>
+Date: Wed, 24 Jan 2018 11:40:50 +0100
+Subject: [PATCH 112/123] Revert "present: Only send PresentCompleteNotify
+ events to the presenting client"
+
+This reverts commit 5c00e693631475679c1c2504e03177652ec7de28.
+
+It broke the Gallium nine state tracker, which makes PresentPixmap
+requests on one display connection and processes the corresponding
+events on another one.
+
+The issue that motivated this change is prevented on the client side by
+https://cgit.freedesktop.org/mesa/mesa/commit/?id=7b0e8264dd21ae05521d08d41fecd84139401fef
+
+Bugzilla: https://bugs.freedesktop.org/104678
+(cherry picked from commit 76732f498f1e73fb081841a04faf068660f3d5c7)
+---
+ present/present.c | 8 ++------
+ present/present_event.c | 5 ++---
+ present/present_priv.h | 5 +----
+ present/present_request.c | 4 ++--
+ 4 files changed, 7 insertions(+), 15 deletions(-)
+
+diff --git a/present/present.c b/present/present.c
+index 86743c5..7d428fc 100644
+--- a/present/present.c
++++ b/present/present.c
+@@ -222,13 +222,13 @@ present_vblank_notify(present_vblank_ptr vblank, CARD8 kind, CARD8 mode, uint64_
+ int n;
+
+ if (vblank->window)
+- present_send_complete_notify(vblank->window, kind, mode, vblank->serial, ust, crtc_msc - vblank->msc_offset, vblank->client);
++ present_send_complete_notify(vblank->window, kind, mode, vblank->serial, ust, crtc_msc - vblank->msc_offset);
+ for (n = 0; n < vblank->num_notifies; n++) {
+ WindowPtr window = vblank->notifies[n].window;
+ CARD32 serial = vblank->notifies[n].serial;
+
+ if (window)
+- present_send_complete_notify(window, kind, mode, serial, ust, crtc_msc - vblank->msc_offset, vblank->client);
++ present_send_complete_notify(window, kind, mode, serial, ust, crtc_msc - vblank->msc_offset);
+ }
+ }
+
+@@ -788,7 +788,6 @@ present_execute(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc)
+ int
+ present_pixmap(WindowPtr window,
+ PixmapPtr pixmap,
+- ClientPtr client,
+ CARD32 serial,
+ RegionPtr valid,
+ RegionPtr update,
+@@ -899,7 +898,6 @@ present_pixmap(WindowPtr window,
+ xorg_list_append(&vblank->window_list, &window_priv->vblank);
+ xorg_list_init(&vblank->event_queue);
+
+- vblank->client = client;
+ vblank->screen = screen;
+ vblank->window = window;
+ vblank->pixmap = pixmap;
+@@ -1019,7 +1017,6 @@ present_abort_vblank(ScreenPtr screen, RRCrtcPtr crtc, uint64_t event_id, uint64
+
+ int
+ present_notify_msc(WindowPtr window,
+- ClientPtr client,
+ CARD32 serial,
+ uint64_t target_msc,
+ uint64_t divisor,
+@@ -1027,7 +1024,6 @@ present_notify_msc(WindowPtr window,
+ {
+ return present_pixmap(window,
+ NULL,
+- client,
+ serial,
+ NULL, NULL,
+ 0, 0,
+diff --git a/present/present_event.c b/present/present_event.c
+index ac6f255..c222dd5 100644
+--- a/present/present_event.c
++++ b/present/present_event.c
+@@ -146,7 +146,7 @@ present_register_complete_notify(present_complete_notify_proc proc)
+ }
+
+ void
+-present_send_complete_notify(WindowPtr window, CARD8 kind, CARD8 mode, CARD32 serial, uint64_t ust, uint64_t msc, ClientPtr client)
++present_send_complete_notify(WindowPtr window, CARD8 kind, CARD8 mode, CARD32 serial, uint64_t ust, uint64_t msc)
+ {
+ present_window_priv_ptr window_priv = present_window_priv(window);
+
+@@ -167,8 +167,7 @@ present_send_complete_notify(WindowPtr window, CARD8 kind, CARD8 mode, CARD32 se
+ present_event_ptr event;
+
+ for (event = window_priv->events; event; event = event->next) {
+- if (event->mask & PresentCompleteNotifyMask &&
+- client == event->client) {
++ if (event->mask & PresentCompleteNotifyMask) {
+ cn.eid = event->id;
+ WriteEventsToClient(event->client, 1, (xEvent *) &cn);
+ }
+diff --git a/present/present_priv.h b/present/present_priv.h
+index 41c37af..dfb4bde 100644
+--- a/present/present_priv.h
++++ b/present/present_priv.h
+@@ -52,7 +52,6 @@ struct present_notify {
+ struct present_vblank {
+ struct xorg_list window_list;
+ struct xorg_list event_queue;
+- ClientPtr client;
+ ScreenPtr screen;
+ WindowPtr window;
+ PixmapPtr pixmap;
+@@ -156,7 +155,6 @@ present_get_window_priv(WindowPtr window, Bool create);
+ int
+ present_pixmap(WindowPtr window,
+ PixmapPtr pixmap,
+- ClientPtr client,
+ CARD32 serial,
+ RegionPtr valid,
+ RegionPtr update,
+@@ -174,7 +172,6 @@ present_pixmap(WindowPtr window,
+
+ int
+ present_notify_msc(WindowPtr window,
+- ClientPtr client,
+ CARD32 serial,
+ uint64_t target_msc,
+ uint64_t divisor,
+@@ -218,7 +215,7 @@ void
+ present_send_config_notify(WindowPtr window, int x, int y, int w, int h, int bw, WindowPtr sibling);
+
+ void
+-present_send_complete_notify(WindowPtr window, CARD8 kind, CARD8 mode, CARD32 serial, uint64_t ust, uint64_t msc, ClientPtr client);
++present_send_complete_notify(WindowPtr window, CARD8 kind, CARD8 mode, CARD32 serial, uint64_t ust, uint64_t msc);
+
+ void
+ present_send_idle_notify(WindowPtr window, CARD32 serial, PixmapPtr pixmap, present_fence_ptr idle_fence);
+diff --git a/present/present_request.c b/present/present_request.c
+index 6997aa8..c7663fc 100644
+--- a/present/present_request.c
++++ b/present/present_request.c
+@@ -135,7 +135,7 @@ proc_present_pixmap(ClientPtr client)
+ return ret;
+ }
+
+- ret = present_pixmap(window, pixmap, client, stuff->serial, valid, update,
++ ret = present_pixmap(window, pixmap, stuff->serial, valid, update,
+ stuff->x_off, stuff->y_off, target_crtc,
+ wait_fence, idle_fence, stuff->options,
+ stuff->target_msc, stuff->divisor, stuff->remainder, notifies, nnotifies);
+@@ -171,7 +171,7 @@ proc_present_notify_msc(ClientPtr client)
+ }
+ }
+
+- return present_notify_msc(window, client, stuff->serial,
++ return present_notify_msc(window, stuff->serial,
+ stuff->target_msc, stuff->divisor, stuff->remainder);
+ }
+
+--
+2.8.3
+
diff --git a/0113-xf86XvMCScreenInit-Clear-pScreenPriv-dixinfo-when-fr.patch b/0113-xf86XvMCScreenInit-Clear-pScreenPriv-dixinfo-when-fr.patch
new file mode 100644
index 0000000..e4074f6
--- /dev/null
+++ b/0113-xf86XvMCScreenInit-Clear-pScreenPriv-dixinfo-when-fr.patch
@@ -0,0 +1,34 @@
+From df319f889ddc952dd065bbb3252d045b90baaf8e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Michel=20D=C3=A4nzer?= <michel.daenzer@amd.com>
+Date: Wed, 24 Jan 2018 12:28:38 +0100
+Subject: [PATCH 113/123] xf86XvMCScreenInit: Clear pScreenPriv->dixinfo when
+ freeing pAdapt
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Fixes double-free later in xf86XvMCCloseScreen, which would generally
+cause fireworks.
+
+Reviewed-by: Adam Jackson <ajax@redhat.com>
+Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
+(cherry picked from commit 75408f53d4e203e462b2f13ea4b06264f0e59ad2)
+---
+ hw/xfree86/common/xf86xvmc.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/hw/xfree86/common/xf86xvmc.c b/hw/xfree86/common/xf86xvmc.c
+index a0a94c7..c67418b 100644
+--- a/hw/xfree86/common/xf86xvmc.c
++++ b/hw/xfree86/common/xf86xvmc.c
+@@ -187,6 +187,7 @@ xf86XvMCScreenInit(ScreenPtr pScreen,
+ }
+ if (!pAdapt[i].xv_adaptor) {
+ /* no adaptor by that name */
++ pScreenPriv->dixinfo = FALSE;
+ free(pAdapt);
+ return FALSE;
+ }
+--
+2.8.3
+
diff --git a/0114-composite-Propagate-damagedDescendants-when-reparent.patch b/0114-composite-Propagate-damagedDescendants-when-reparent.patch
new file mode 100644
index 0000000..8f761a1
--- /dev/null
+++ b/0114-composite-Propagate-damagedDescendants-when-reparent.patch
@@ -0,0 +1,101 @@
+From 5c456b6e2a9a579e67ba577f9147642406f2ce99 Mon Sep 17 00:00:00 2001
+From: Peter Harris <pharris@opentext.com>
+Date: Thu, 14 Dec 2017 12:21:19 -0500
+Subject: [PATCH 114/123] composite: Propagate damagedDescendants when
+ reparented
+
+If a window that is fully covered by an automatic-redirected descendant
+(even implicitly, eg. via BackingStores) is reparented, the automatic
+updates could be broken if the new parent is not marked as having
+damaged descendants.
+
+Fix this issue by propagating the damagedDescendants flag whenever a
+window is reparented.
+
+Reviewed-by: Adam Jackson <ajax@redhat.com>
+Signed-off-by: Peter Harris <pharris@opentext.com>
+(cherry picked from commit d5c23b29487d5ff440abf5ed0beb22c00f21e387)
+---
+ composite/compalloc.c | 21 +++++++++++++--------
+ composite/compint.h | 2 ++
+ composite/compwindow.c | 5 +++++
+ 3 files changed, 20 insertions(+), 8 deletions(-)
+
+diff --git a/composite/compalloc.c b/composite/compalloc.c
+index 05ffc7e..433dc82 100644
+--- a/composite/compalloc.c
++++ b/composite/compalloc.c
+@@ -67,6 +67,18 @@ compBlockHandler(ScreenPtr pScreen, void *pTimeout)
+ cs->BlockHandler = NULL;
+ }
+
++void
++compMarkAncestors(WindowPtr pWin)
++{
++ pWin = pWin->parent;
++ while (pWin) {
++ if (pWin->damagedDescendants)
++ return;
++ pWin->damagedDescendants = TRUE;
++ pWin = pWin->parent;
++ }
++}
++
+ static void
+ compReportDamage(DamagePtr pDamage, RegionPtr pRegion, void *closure)
+ {
+@@ -81,14 +93,7 @@ compReportDamage(DamagePtr pDamage, RegionPtr pRegion, void *closure)
+ }
+ cw->damaged = TRUE;
+
+- /* Mark the ancestors */
+- pWin = pWin->parent;
+- while (pWin) {
+- if (pWin->damagedDescendants)
+- break;
+- pWin->damagedDescendants = TRUE;
+- pWin = pWin->parent;
+- }
++ compMarkAncestors(pWin);
+ }
+
+ static void
+diff --git a/composite/compint.h b/composite/compint.h
+index f05c2d8..89f6507 100644
+--- a/composite/compint.h
++++ b/composite/compint.h
+@@ -236,6 +236,8 @@ Bool
+ compReallocPixmap(WindowPtr pWin, int x, int y,
+ unsigned int w, unsigned int h, int bw);
+
++void compMarkAncestors(WindowPtr pWin);
++
+ /*
+ * compinit.c
+ */
+diff --git a/composite/compwindow.c b/composite/compwindow.c
+index f882381..e74ce66 100644
+--- a/composite/compwindow.c
++++ b/composite/compwindow.c
+@@ -432,6 +432,7 @@ compReparentWindow(WindowPtr pWin, WindowPtr pPriorParent)
+ {
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ CompScreenPtr cs = GetCompScreen(pScreen);
++ CompWindowPtr cw = GetCompWindow(pWin);
+
+ pScreen->ReparentWindow = cs->ReparentWindow;
+ /*
+@@ -469,6 +470,10 @@ compReparentWindow(WindowPtr pWin, WindowPtr pPriorParent)
+ (*pScreen->ReparentWindow) (pWin, pPriorParent);
+ cs->ReparentWindow = pScreen->ReparentWindow;
+ pScreen->ReparentWindow = compReparentWindow;
++
++ if (pWin->damagedDescendants || (cw && cw->damaged))
++ compMarkAncestors(pWin);
++
+ compCheckTree(pWin->drawable.pScreen);
+ }
+
+--
+2.8.3
+
diff --git a/0115-os-inputthread-Force-unlock-when-stopping-thread.patch b/0115-os-inputthread-Force-unlock-when-stopping-thread.patch
new file mode 100644
index 0000000..3ec3343
--- /dev/null
+++ b/0115-os-inputthread-Force-unlock-when-stopping-thread.patch
@@ -0,0 +1,33 @@
+From 9cd243f75dc52e1c649178963ab22583db52cd54 Mon Sep 17 00:00:00 2001
+From: Michal Srb <msrb@suse.com>
+Date: Mon, 27 Nov 2017 09:59:01 +0100
+Subject: [PATCH 115/123] os/inputthread: Force unlock when stopping thread.
+
+The inputthread is kept locked all the time while X server's VT is not active.
+If the X server is terminated while not active, it will be stuck forever in
+InputThreadFini waiting for the thread to join, but it wouldn't because it is
+locked.
+
+Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=103782
+Signed-off-by: Michal Srb <msrb@suse.com>
+Reviewed-by: Adam Jackson <ajax@redhat.com>
+(cherry picked from commit 71348e99a8e6a95542e483b93839168ca8f51f81)
+---
+ os/inputthread.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/os/inputthread.c b/os/inputthread.c
+index 721e863..dc4eb9f 100644
+--- a/os/inputthread.c
++++ b/os/inputthread.c
+@@ -497,6 +497,7 @@ InputThreadFini(void)
+
+ /* Close the pipe to get the input thread to shut down */
+ close(hotplugPipeWrite);
++ input_force_unlock();
+ pthread_join(inputThreadInfo->thread, NULL);
+
+ xorg_list_for_each_entry_safe(dev, next, &inputThreadInfo->devs, node) {
+--
+2.8.3
+
diff --git a/0116-xwayland-remove-dirty-window-unconditionally-on-unre.patch b/0116-xwayland-remove-dirty-window-unconditionally-on-unre.patch
new file mode 100644
index 0000000..56d7e7a
--- /dev/null
+++ b/0116-xwayland-remove-dirty-window-unconditionally-on-unre.patch
@@ -0,0 +1,68 @@
+From f6cd99ed79c17e3aa04b8821d10ca95939bd8675 Mon Sep 17 00:00:00 2001
+From: Olivier Fourdan <ofourdan@redhat.com>
+Date: Wed, 24 Jan 2018 17:45:37 +0100
+Subject: [PATCH 116/123] xwayland: remove dirty window unconditionally on
+ unrealize
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This is a rare occurrence of a crash in Xwayland for which I don't have
+the reproducing steps, just a core file.
+
+The backtrace looks as follow:
+
+ #0 raise () from /usr/lib64/libc.so.6
+ #1 abort () from /usr/lib64/libc.so.6
+ #2 OsAbort () at utils.c:1361
+ #3 AbortServer () at log.c:877
+ #4 FatalError () at log.c:1015
+ #5 OsSigHandler () at osinit.c:154
+ #6 <signal handler called>
+ #7 xwl_glamor_pixmap_get_wl_buffer () at xwayland-glamor.c:162
+ #8 xwl_screen_post_damage () at xwayland.c:514
+ #9 block_handler () at xwayland.c:665
+ #10 BlockHandler () at dixutils.c:388
+ #11 WaitForSomething () at WaitFor.c:219
+ #12 Dispatch () at dispatch.c:422
+ #13 dix_main () at main.c:287
+
+The crash is caused by dereferencing “xwl_pixmap->buffer” in
+xwl_glamor_pixmap_get_wl_buffer() because “xwl_pixmap” is NULL.
+
+Reason for this is because the corresponding pixmap is from the root
+window and xwayland is rootless by default.
+
+This can happen if the window was mapped, redirected, damaged and
+unredirected immediately, before the damage is processed by Xwayland.
+
+Make sure to remove the dirty window from the damage list on unrealize
+to prevent this from happening.
+
+Credit goes to Adam Jackson <ajax@nwnk.net> and Daniel Stone
+<daniel@fooishbar.org> for finding the root cause the issue.
+
+Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
+Reviewed-by: Daniel Stone <daniels@collabora.com>
+(cherry picked from commit 3362422e8413dd9f231cfac50ce0a0862525b1bf)
+---
+ hw/xwayland/xwayland.c | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c
+index 939f339..0e79297 100644
+--- a/hw/xwayland/xwayland.c
++++ b/hw/xwayland/xwayland.c
+@@ -454,8 +454,7 @@ xwl_unrealize_window(WindowPtr window)
+ return ret;
+
+ wl_surface_destroy(xwl_window->surface);
+- if (RegionNotEmpty(DamageRegion(xwl_window->damage)))
+- xorg_list_del(&xwl_window->link_damage);
++ xorg_list_del(&xwl_window->link_damage);
+ DamageUnregister(xwl_window->damage);
+ DamageDestroy(xwl_window->damage);
+ if (xwl_window->frame_callback)
+--
+2.8.3
+
diff --git a/0117-glamor-fix-repeat-reflect-case-in-linear-gradient-sh.patch b/0117-glamor-fix-repeat-reflect-case-in-linear-gradient-sh.patch
new file mode 100644
index 0000000..ad23121
--- /dev/null
+++ b/0117-glamor-fix-repeat-reflect-case-in-linear-gradient-sh.patch
@@ -0,0 +1,57 @@
+From 38e6fb757386e2cb2c51a27e52346473d4ffb9a1 Mon Sep 17 00:00:00 2001
+From: Jeff Smith <whydoubt@gmail.com>
+Date: Fri, 26 Jan 2018 06:25:19 -0600
+Subject: [PATCH 117/123] glamor: fix repeat-reflect case in linear gradient
+ shader
+
+If _pt_distance is negative, it causes the final distance to be negative
+in the repeat-reflect case. Moving the scaling by _pt_distance earlier
+avoids this problem, and simplifies some equations as a bonus.
+
+Bugzilla: https://bugs.freedesktop.org/98508
+Signed-off-by: Jeff Smith <whydoubt@gmail.com>
+Reviewed-by: Adam Jackson <ajax@redhat.com>
+(cherry picked from commit 3e377e238f7257fd01e56a4a25dfd77e033673e4)
+---
+ glamor/glamor_gradient.c | 11 ++++-------
+ 1 file changed, 4 insertions(+), 7 deletions(-)
+
+diff --git a/glamor/glamor_gradient.c b/glamor/glamor_gradient.c
+index 0c97ce7..14ff917 100644
+--- a/glamor/glamor_gradient.c
++++ b/glamor/glamor_gradient.c
+@@ -458,7 +458,6 @@ _glamor_create_linear_gradient_program(ScreenPtr screen, int stops_count,
+ "float get_stop_len()\n"\
+ "{\n"\
+ " vec3 tmp = vec3(source_texture.x, source_texture.y, 1.0);\n"\
+- " float len_percentage;\n"\
+ " float distance;\n"\
+ " float _p1_distance;\n"\
+ " float _pt_distance;\n"\
+@@ -484,19 +483,17 @@ _glamor_create_linear_gradient_program(ScreenPtr screen, int stops_count,
+ " _pt_distance = pt_distance * source_texture_trans.z;\n"\
+ " } \n"\
+ " \n"\
+- " distance = distance - _p1_distance; \n"\
++ " distance = (distance - _p1_distance) / _pt_distance;\n"\
+ " \n"\
+ " if(repeat_type == %d){\n" /* repeat normal*/\
+- " distance = mod(distance, _pt_distance);\n"\
++ " distance = fract(distance);\n"\
+ " }\n"\
+ " \n"\
+ " if(repeat_type == %d) {\n" /* repeat reflect*/\
+- " distance = abs(mod(distance + _pt_distance, 2.0 * _pt_distance) - _pt_distance);\n"\
++ " distance = abs(fract(distance * 0.5 + 0.5) * 2.0 - 1.0);\n"\
+ " }\n"\
+ " \n"\
+- " len_percentage = distance/(_pt_distance);\n"\
+- " \n"\
+- " return len_percentage;\n"\
++ " return distance;\n"\
+ "}\n"\
+ "\n"\
+ "void main()\n"\
+--
+2.8.3
+
diff --git a/0118-glamor-fix-no-reflect-case-for-gradients.patch b/0118-glamor-fix-no-reflect-case-for-gradients.patch
new file mode 100644
index 0000000..cd440b4
--- /dev/null
+++ b/0118-glamor-fix-no-reflect-case-for-gradients.patch
@@ -0,0 +1,92 @@
+From c715645c14ec00cd49e6bb86340351fa97ab6ea0 Mon Sep 17 00:00:00 2001
+From: Jeff Smith <whydoubt@gmail.com>
+Date: Fri, 26 Jan 2018 06:25:20 -0600
+Subject: [PATCH 118/123] glamor: fix no-reflect case for gradients
+
+When compositing a no-reflect gradient, 'before' the gradient is empty,
+but 'after' the gradient is padded with the final color. Both sides are
+supposed to be empty.
+
+This is fixed by moving the virtual stops to match the first and last
+client-supplied stops for no-reflect gradients, then causing everything
+'before' the initial virtual stop and 'after' the final virtual stop to
+emit rgba(0,0,0,0). This does not impact gradients using the other
+reflect modes.
+
+Signed-off-by: Jeff Smith <whydoubt@gmail.com>
+Reviewed-by: Adam Jackson <ajax@redhat.com>
+(cherry picked from commit 5815c7b5951fd46d69e5c40144b64e516c7afdbf)
+---
+ glamor/glamor_gradient.c | 27 ++++++++++++++++-----------
+ 1 file changed, 16 insertions(+), 11 deletions(-)
+
+diff --git a/glamor/glamor_gradient.c b/glamor/glamor_gradient.c
+index 14ff917..e9880e7 100644
+--- a/glamor/glamor_gradient.c
++++ b/glamor/glamor_gradient.c
+@@ -57,10 +57,15 @@ _glamor_create_getcolor_fs_source(ScreenPtr screen, int stops_count,
+ " float new_alpha; \n"\
+ " vec4 gradient_color;\n"\
+ " float percentage; \n"\
+- " for(i = 0; i < n_stop - 1; i++) {\n"\
++ " \n"\
++ " if(stop_len < stops[0])\n"\
++ " return vec4(0.0, 0.0, 0.0, 0.0); \n"\
++ " for(i = 1; i < n_stop; i++) {\n"\
+ " if(stop_len < stops[i])\n"\
+ " break; \n"\
+ " }\n"\
++ " if(i == n_stop)\n"\
++ " return vec4(0.0, 0.0, 0.0, 0.0); \n"\
+ " \n"\
+ " if(stops[i] - stops[i-1] > 2.0)\n"\
+ " percentage = 0.0;\n" /*For comply with pixman, walker->stepper overflow.*/\
+@@ -110,10 +115,10 @@ _glamor_create_getcolor_fs_source(ScreenPtr screen, int stops_count,
+ " float percentage; \n"
+ " \n"
+ " if((stop_len < stop0) && (n_stop >= 1)) {\n"
+- " stop_color_before = stop_color0;\n"
+- " stop_color_after = stop_color0;\n"
+- " stop_after = stop0;\n"
+- " stop_before = stop0;\n"
++ " stop_color_before = vec4(0.0, 0.0, 0.0, 0.0);\n"
++ " stop_color_after = vec4(0.0, 0.0, 0.0, 0.0);\n"
++ " stop_after = 0.0;\n"
++ " stop_before = 0.0;\n"
+ " } else if((stop_len < stop1) && (n_stop >= 2)) {\n"
+ " stop_color_before = stop_color0;\n"
+ " stop_color_after = stop_color1;\n"
+@@ -150,10 +155,10 @@ _glamor_create_getcolor_fs_source(ScreenPtr screen, int stops_count,
+ " stop_after = stop7;\n"
+ " stop_before = stop6;\n"
+ " } else {\n"
+- " stop_color_before = stop_color7;\n"
+- " stop_color_after = stop_color7;\n"
+- " stop_after = stop7;\n"
+- " stop_before = stop7;\n"
++ " stop_color_before = vec4(0.0, 0.0, 0.0, 0.0);\n"
++ " stop_color_after = vec4(0.0, 0.0, 0.0, 0.0);\n"
++ " stop_after = 0.0;\n"
++ " stop_before = 0.0;\n"
+ " }\n"
+ " if(stop_after - stop_before > 2.0)\n"
+ " percentage = 0.0;\n" //For comply with pixman, walker->stepper overflow.
+@@ -758,13 +763,13 @@ _glamor_gradient_set_stops(PicturePtr src_picture, PictGradient *pgradient,
+ stop_colors[1] = 0.0; //G
+ stop_colors[2] = 0.0; //B
+ stop_colors[3] = 0.0; //Alpha
+- n_stops[0] = -(float) INT_MAX; //should be small enough.
++ n_stops[0] = n_stops[1];
+
+ stop_colors[0 + (count - 1) * 4] = 0.0; //R
+ stop_colors[1 + (count - 1) * 4] = 0.0; //G
+ stop_colors[2 + (count - 1) * 4] = 0.0; //B
+ stop_colors[3 + (count - 1) * 4] = 0.0; //Alpha
+- n_stops[count - 1] = (float) INT_MAX; //should be large enough.
++ n_stops[count - 1] = n_stops[count - 2];
+ break;
+ case PIXMAN_REPEAT_NORMAL:
+ REPEAT_FILL_STOPS(0, count - 2);
+--
+2.8.3
+
diff --git a/0119-glamor-remove-unused-variables-in-linear-gradient-sh.patch b/0119-glamor-remove-unused-variables-in-linear-gradient-sh.patch
new file mode 100644
index 0000000..ea89556
--- /dev/null
+++ b/0119-glamor-remove-unused-variables-in-linear-gradient-sh.patch
@@ -0,0 +1,34 @@
+From b41bb8147e706cb8e615842e08a548b7e8afd279 Mon Sep 17 00:00:00 2001
+From: Jeff Smith <whydoubt@gmail.com>
+Date: Fri, 26 Jan 2018 06:25:21 -0600
+Subject: [PATCH 119/123] glamor: remove unused variables in linear gradient
+ shader
+
+Signed-off-by: Jeff Smith <whydoubt@gmail.com>
+Reviewed-by: Adam Jackson <ajax@redhat.com>
+(cherry picked from commit 3bd17dff1ac5a4685a5da92a9982f621effee658)
+---
+ glamor/glamor_gradient.c | 7 -------
+ 1 file changed, 7 deletions(-)
+
+diff --git a/glamor/glamor_gradient.c b/glamor/glamor_gradient.c
+index e9880e7..5deaf5f 100644
+--- a/glamor/glamor_gradient.c
++++ b/glamor/glamor_gradient.c
+@@ -467,13 +467,6 @@ _glamor_create_linear_gradient_program(ScreenPtr screen, int stops_count,
+ " float _p1_distance;\n"\
+ " float _pt_distance;\n"\
+ " float y_dist;\n"\
+- " float stop_after;\n"\
+- " float stop_before;\n"\
+- " vec4 stop_color_before;\n"\
+- " vec4 stop_color_after;\n"\
+- " float new_alpha; \n"\
+- " vec4 gradient_color;\n"\
+- " float percentage; \n"\
+ " vec3 source_texture_trans = transform_mat * tmp;\n"\
+ " \n"\
+ " if(hor_ver == 0) { \n" /*Normal case.*/\
+--
+2.8.3
+
diff --git a/0120-glamor-tidy-up-some-gradient-color-formulas.patch b/0120-glamor-tidy-up-some-gradient-color-formulas.patch
new file mode 100644
index 0000000..0697647
--- /dev/null
+++ b/0120-glamor-tidy-up-some-gradient-color-formulas.patch
@@ -0,0 +1,158 @@
+From cb908a7840487e4b81aa16c5b3a4b609ff1153fc Mon Sep 17 00:00:00 2001
+From: Jeff Smith <whydoubt@gmail.com>
+Date: Fri, 26 Jan 2018 06:25:22 -0600
+Subject: [PATCH 120/123] glamor: tidy up some gradient color formulas
+
+- Avoid some needlessly complex equations for calculating the color at a
+ point in a gradient field.
+- Avoid calculating certain values multiple times.
+- Use similar variable names across the two versions of the get_color
+ function where practical.
+
+Signed-off-by: Jeff Smith <whydoubt@gmail.com>
+Reviewed-by: Adam Jackson <ajax@redhat.com>
+(cherry picked from commit ff410c56bfd6dcdf5d252ef0ba3f4c6fde91774b)
+---
+ glamor/glamor_gradient.c | 66 ++++++++++++++++++++++--------------------------
+ 1 file changed, 30 insertions(+), 36 deletions(-)
+
+diff --git a/glamor/glamor_gradient.c b/glamor/glamor_gradient.c
+index 5deaf5f..f0b7d12 100644
+--- a/glamor/glamor_gradient.c
++++ b/glamor/glamor_gradient.c
+@@ -54,8 +54,9 @@ _glamor_create_getcolor_fs_source(ScreenPtr screen, int stops_count,
+ "vec4 get_color(float stop_len)\n"\
+ "{\n"\
+ " int i = 0;\n"\
+- " float new_alpha; \n"\
++ " vec4 stop_color_before;\n"\
+ " vec4 gradient_color;\n"\
++ " float stop_delta;\n"\
+ " float percentage; \n"\
+ " \n"\
+ " if(stop_len < stops[0])\n"\
+@@ -67,19 +68,19 @@ _glamor_create_getcolor_fs_source(ScreenPtr screen, int stops_count,
+ " if(i == n_stop)\n"\
+ " return vec4(0.0, 0.0, 0.0, 0.0); \n"\
+ " \n"\
+- " if(stops[i] - stops[i-1] > 2.0)\n"\
++ " stop_color_before = stop_colors[i-1];\n"\
++ " stop_delta = stops[i] - stops[i-1];\n"\
++ " if(stop_delta > 2.0)\n"\
+ " percentage = 0.0;\n" /*For comply with pixman, walker->stepper overflow.*/\
+- " else if(stops[i] - stops[i-1] < 0.000001)\n"\
++ " else if(stop_delta < 0.000001)\n"\
+ " percentage = 0.0;\n"\
+ " else \n"\
+- " percentage = (stop_len - stops[i-1])/(stops[i] - stops[i-1]);\n"\
+- " new_alpha = percentage * stop_colors[i].a + \n"\
+- " (1.0-percentage) * stop_colors[i-1].a; \n"\
+- " gradient_color = vec4((percentage * stop_colors[i].rgb \n"\
+- " + (1.0-percentage) * stop_colors[i-1].rgb)*new_alpha, \n"\
+- " new_alpha);\n"\
++ " percentage = (stop_len - stops[i-1])/stop_delta;\n"\
+ " \n"\
+- " return gradient_color;\n"\
++ " gradient_color = stop_color_before;\n"\
++ " if(percentage != 0.0)\n"\
++ " gradient_color += (stop_colors[i] - gradient_color)*percentage;\n"\
++ " return vec4(gradient_color.rgb * gradient_color.a, gradient_color.a);\n"\
+ "}\n"
+
+ /* Because the array access for shader is very slow, the performance is very low
+@@ -106,73 +107,66 @@ _glamor_create_getcolor_fs_source(ScreenPtr screen, int stops_count,
+ "\n"
+ "vec4 get_color(float stop_len)\n"
+ "{\n"
+- " float stop_after;\n"
+- " float stop_before;\n"
+ " vec4 stop_color_before;\n"
+ " vec4 stop_color_after;\n"
+- " float new_alpha; \n"
+ " vec4 gradient_color;\n"
++ " float stop_before;\n"
++ " float stop_delta;\n"
+ " float percentage; \n"
+ " \n"
+ " if((stop_len < stop0) && (n_stop >= 1)) {\n"
+ " stop_color_before = vec4(0.0, 0.0, 0.0, 0.0);\n"
+- " stop_color_after = vec4(0.0, 0.0, 0.0, 0.0);\n"
+- " stop_after = 0.0;\n"
+- " stop_before = 0.0;\n"
++ " stop_delta = 0.0;\n"
+ " } else if((stop_len < stop1) && (n_stop >= 2)) {\n"
+ " stop_color_before = stop_color0;\n"
+ " stop_color_after = stop_color1;\n"
+- " stop_after = stop1;\n"
+ " stop_before = stop0;\n"
++ " stop_delta = stop1 - stop0;\n"
+ " } else if((stop_len < stop2) && (n_stop >= 3)) {\n"
+ " stop_color_before = stop_color1;\n"
+ " stop_color_after = stop_color2;\n"
+- " stop_after = stop2;\n"
+ " stop_before = stop1;\n"
++ " stop_delta = stop2 - stop1;\n"
+ " } else if((stop_len < stop3) && (n_stop >= 4)){\n"
+ " stop_color_before = stop_color2;\n"
+ " stop_color_after = stop_color3;\n"
+- " stop_after = stop3;\n"
+ " stop_before = stop2;\n"
++ " stop_delta = stop3 - stop2;\n"
+ " } else if((stop_len < stop4) && (n_stop >= 5)){\n"
+ " stop_color_before = stop_color3;\n"
+ " stop_color_after = stop_color4;\n"
+- " stop_after = stop4;\n"
+ " stop_before = stop3;\n"
++ " stop_delta = stop4 - stop3;\n"
+ " } else if((stop_len < stop5) && (n_stop >= 6)){\n"
+ " stop_color_before = stop_color4;\n"
+ " stop_color_after = stop_color5;\n"
+- " stop_after = stop5;\n"
+ " stop_before = stop4;\n"
++ " stop_delta = stop5 - stop4;\n"
+ " } else if((stop_len < stop6) && (n_stop >= 7)){\n"
+ " stop_color_before = stop_color5;\n"
+ " stop_color_after = stop_color6;\n"
+- " stop_after = stop6;\n"
+ " stop_before = stop5;\n"
++ " stop_delta = stop6 - stop5;\n"
+ " } else if((stop_len < stop7) && (n_stop >= 8)){\n"
+ " stop_color_before = stop_color6;\n"
+ " stop_color_after = stop_color7;\n"
+- " stop_after = stop7;\n"
+ " stop_before = stop6;\n"
++ " stop_delta = stop7 - stop6;\n"
+ " } else {\n"
+ " stop_color_before = vec4(0.0, 0.0, 0.0, 0.0);\n"
+- " stop_color_after = vec4(0.0, 0.0, 0.0, 0.0);\n"
+- " stop_after = 0.0;\n"
+- " stop_before = 0.0;\n"
++ " stop_delta = 0.0;\n"
+ " }\n"
+- " if(stop_after - stop_before > 2.0)\n"
++ " if(stop_delta > 2.0)\n"
+ " percentage = 0.0;\n" //For comply with pixman, walker->stepper overflow.
+- " else if(stop_after - stop_before < 0.000001)\n"
++ " else if(stop_delta < 0.000001)\n"
+ " percentage = 0.0;\n"
+- " else \n"
+- " percentage = (stop_len - stop_before)/(stop_after - stop_before);\n"
+- " new_alpha = percentage * stop_color_after.a + \n"
+- " (1.0-percentage) * stop_color_before.a; \n"
+- " gradient_color = vec4((percentage * stop_color_after.rgb \n"
+- " + (1.0-percentage) * stop_color_before.rgb)*new_alpha, \n"
+- " new_alpha);\n"
++ " else\n"
++ " percentage = (stop_len - stop_before)/stop_delta;\n"
+ " \n"
+- " return gradient_color;\n"
++ " gradient_color = stop_color_before;\n"
++ " if(percentage != 0.0)\n"
++ " gradient_color += (stop_color_after - gradient_color)*percentage;\n"
++ " return vec4(gradient_color.rgb * gradient_color.a, gradient_color.a);\n"
+ "}\n";
+
+ if (use_array) {
+--
+2.8.3
+
diff --git a/0121-randr-Fix-rotation-check-in-ProcRRSetScreenSize.patch b/0121-randr-Fix-rotation-check-in-ProcRRSetScreenSize.patch
new file mode 100644
index 0000000..5489140
--- /dev/null
+++ b/0121-randr-Fix-rotation-check-in-ProcRRSetScreenSize.patch
@@ -0,0 +1,45 @@
+From 61d3f56877b23241757490efcdb759b905caca1d Mon Sep 17 00:00:00 2001
+From: Alex Goins <agoins@nvidia.com>
+Date: Mon, 8 Jan 2018 18:44:25 -0800
+Subject: [PATCH 121/123] randr: Fix rotation check in ProcRRSetScreenSize()
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+ProcRRSetScreenSize() does bounds checking to ensure that none of the CRTCs have
+a viewport that extends beyond the new screen size. In doing so, it accounts for
+if the CRTC is rotated 90 or 270 degrees, swapping width and height.
+
+However, it does so by testing if crtc->rotation is equal to RR_Rotate_90 or
+RR_Rotate_270. crtc->rotation is a bit mask, and it includes reflection as well
+as rotation. If a CRTC is reflected as well as rotated, it will incorrectly fail
+this test, resulting in incorrect dimensions being used to verify the validity
+of the new screen size. In some cases, this can cause valid uses of
+ProcRRSetScreenSize() to fail with BadMatch.
+
+This patch fixes the issue by testing that the bits RR_Rotate_90 or
+RR_Rotate_270 are set, rather than testing for equality.
+
+Signed-off-by: Alex Goins <agoins@nvidia.com>
+Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
+(cherry picked from commit 6b26a7bda9efa93440734ede0382a3e9a6761365)
+---
+ randr/rrscreen.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/randr/rrscreen.c b/randr/rrscreen.c
+index 0c70b28..d059ce7 100644
+--- a/randr/rrscreen.c
++++ b/randr/rrscreen.c
+@@ -272,7 +272,7 @@ ProcRRSetScreenSize(ClientPtr client)
+ int source_height = mode->mode.height;
+ Rotation rotation = crtc->rotation;
+
+- if (rotation == RR_Rotate_90 || rotation == RR_Rotate_270) {
++ if (rotation & (RR_Rotate_90 | RR_Rotate_270)) {
+ source_width = mode->mode.height;
+ source_height = mode->mode.width;
+ }
+--
+2.8.3
+
diff --git a/0122-xwayland-Don-t-process-cursor-warping-without-an-xwl.patch b/0122-xwayland-Don-t-process-cursor-warping-without-an-xwl.patch
new file mode 100644
index 0000000..7f001e1
--- /dev/null
+++ b/0122-xwayland-Don-t-process-cursor-warping-without-an-xwl.patch
@@ -0,0 +1,93 @@
+From e96bd477395af3c2c3157ebda0f55ea4b672a114 Mon Sep 17 00:00:00 2001
+From: Lyude Paul <lyude@redhat.com>
+Date: Tue, 6 Feb 2018 12:41:47 -0500
+Subject: [PATCH 122/123] xwayland: Don't process cursor warping without an
+ xwl_seat
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Unfortunately, on my machine Xwayland immediately crashes when I try to
+start it. gdb backtrace:
+
+ #0 0x00007ffff74f0e79 in wl_proxy_marshal () from target:/lib64/libwayland-client.so.0
+ #1 0x0000000000413172 in zwp_confined_pointer_v1_destroy (zwp_confined_pointer_v1=0x700000000)
+ at hw/xwayland/Xwayland@exe/pointer-constraints-unstable-v1-client-protocol.h:612
+ #2 0x0000000000418bc0 in xwl_seat_destroy_confined_pointer (xwl_seat=0x8ba2a0)
+ at /home/lyudess/Projects/xserver/hw/xwayland/xwayland-input.c:2839
+ #3 0x0000000000418c09 in xwl_seat_unconfine_pointer (xwl_seat=0x8ba2a0)
+ at /home/lyudess/Projects/xserver/hw/xwayland/xwayland-input.c:2849
+ #4 0x0000000000410d97 in xwl_cursor_confined_to (device=0xa5a000, screen=0x8b9d80, window=0x9bdb70)
+ at /home/lyudess/Projects/xserver/hw/xwayland/xwayland.c:328
+ #5 0x00000000004a8571 in ConfineCursorToWindow (pDev=0xa5a000, pWin=0x9bdb70, generateEvents=1,
+ confineToScreen=0) at /home/lyudess/Projects/xserver/dix/events.c:900
+ #6 0x00000000004a94b7 in ScreenRestructured (pScreen=0x8b9d80)
+ at /home/lyudess/Projects/xserver/dix/events.c:1387
+ #7 0x0000000000502386 in RRScreenSizeNotify (pScreen=0x8b9d80)
+ at /home/lyudess/Projects/xserver/randr/rrscreen.c:160
+ #8 0x000000000041a83c in update_screen_size (xwl_output=0x8e7670, width=3840, height=2160)
+ at /home/lyudess/Projects/xserver/hw/xwayland/xwayland-output.c:203
+ #9 0x000000000041a9f0 in apply_output_change (xwl_output=0x8e7670)
+ at /home/lyudess/Projects/xserver/hw/xwayland/xwayland-output.c:252
+ #10 0x000000000041aaeb in xdg_output_handle_done (data=0x8e7670, xdg_output=0x8e7580)
+ at /home/lyudess/Projects/xserver/hw/xwayland/xwayland-output.c:307
+ #11 0x00007ffff50e9d1e in ffi_call_unix64 () at ../src/x86/unix64.S:76
+ #12 0x00007ffff50e968f in ffi_call (cif=<optimized out>, fn=<optimized out>, rvalue=<optimized out>,
+ avalue=<optimized out>) at ../src/x86/ffi64.c:525
+ #13 0x00007ffff74f3d8b in wl_closure_invoke () from target:/lib64/libwayland-client.so.0
+ #14 0x00007ffff74f0928 in dispatch_event.isra () from target:/lib64/libwayland-client.so.0
+ #15 0x00007ffff74f1be4 in wl_display_dispatch_queue_pending () from target:/lib64/libwayland-client.so.0
+ #16 0x00007ffff74f200b in wl_display_roundtrip_queue () from target:/lib64/libwayland-client.so.0
+ #17 0x0000000000418cad in InitInput (argc=12, argv=0x7fffffffd9c8)
+ at /home/lyudess/Projects/xserver/hw/xwayland/xwayland-input.c:2867
+ #18 0x00000000004a20e3 in dix_main (argc=12, argv=0x7fffffffd9c8, envp=0x7fffffffda30)
+ at /home/lyudess/Projects/xserver/dix/main.c:250
+ #19 0x0000000000420cb2 in main (argc=12, argv=0x7fffffffd9c8, envp=0x7fffffffda30)
+ at /home/lyudess/Projects/xserver/dix/stubmain.c:34
+
+This appears to be the result of xwl_cursor_confined_to() and
+xwl_screen_get_default_seat(). While not against protocol, mutter ends
+up sending xdg_output before wl_seat. xwl_screen_get_default_seat()
+makes the naïve assumption that we always have a valid seat, we end up
+returning a pointer to the empty list itself instead of an actual seat
+and causing ourselves to segfault.
+
+So, actually return NULL in xwl_screen_get_default_seat() if the seat
+list is empty, and skip any pointer confinement processing in
+xwl_cursor_confined_to() when we don't have a seat setup yet.
+
+Signed-off-by: Lyude Paul <lyude@redhat.com>
+Reviewed-by: Adam Jackson <ajax@redhat.com>
+(cherry picked from commit 98edb9a35e2cdd61355656b82975d7f2b6a9f0e6)
+---
+ hw/xwayland/xwayland.c | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c
+index 0e79297..d0bdf36 100644
+--- a/hw/xwayland/xwayland.c
++++ b/hw/xwayland/xwayland.c
+@@ -159,6 +159,9 @@ xwl_window_from_window(WindowPtr window)
+ static struct xwl_seat *
+ xwl_screen_get_default_seat(struct xwl_screen *xwl_screen)
+ {
++ if (xorg_list_is_empty(&xwl_screen->seat_list))
++ return NULL;
++
+ return container_of(xwl_screen->seat_list.prev,
+ struct xwl_seat,
+ link);
+@@ -218,6 +221,10 @@ xwl_cursor_confined_to(DeviceIntPtr device,
+ if (!xwl_seat)
+ xwl_seat = xwl_screen_get_default_seat(xwl_screen);
+
++ /* xwl_seat hasn't been setup yet, don't do anything just yet */
++ if (!xwl_seat)
++ return;
++
+ if (window == screen->root) {
+ xwl_seat_unconfine_pointer(xwl_seat);
+ return;
+--
+2.8.3
+
diff --git a/0123-glx-Only-assign-8-bpc-fbconfigs-for-composite-visual.patch b/0123-glx-Only-assign-8-bpc-fbconfigs-for-composite-visual.patch
new file mode 100644
index 0000000..2210b6e
--- /dev/null
+++ b/0123-glx-Only-assign-8-bpc-fbconfigs-for-composite-visual.patch
@@ -0,0 +1,47 @@
+From 56547b196660e246e37132960723819972b99c8c Mon Sep 17 00:00:00 2001
+From: Mario Kleiner <mario.kleiner.de@gmail.com>
+Date: Mon, 5 Feb 2018 11:20:41 +0100
+Subject: [PATCH 123/123] glx: Only assign 8 bpc fbconfigs for composite
+ visuals.
+
+Commit 91c42093b248 ("glx: Duplicate relevant fbconfigs for
+compositing visuals") adds many new depth 32 fbconfigs as
+composite visuals. On a X-Screen running at depth 24, this
+also adds bgra 10-10-10-2 fbconigs, as they also have
+config.rgbBits == 32, but these are not displayable on a
+depth 24 screen, leading to visually corrupted desktops
+under some compositors, e.g., fdo bug 104597 "Compton
+weird colors" when running compton with
+"compton --backend glx".
+
+Be more conservative for now and only select fbconfigs with
+8 bpc red, green, blue components for composite visuals.
+
+Fixes: 91c42093b248 ("glx: Duplicate relevant fbconfigs for
+ compositing visuals")
+Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104597
+Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
+Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
+Reviewed-by: Adam Jackson <ajax@redhat.com>
+(cherry picked from commit bebcc8477c8070ade9dd4be7299c718baeab3d7a)
+---
+ glx/glxdricommon.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/glx/glxdricommon.c b/glx/glxdricommon.c
+index d3136e8..dbf199c 100644
+--- a/glx/glxdricommon.c
++++ b/glx/glxdricommon.c
+@@ -218,6 +218,9 @@ createModeFromConfig(const __DRIcoreExtension * core,
+ if (duplicateForComp &&
+ (render_type_is_pbuffer_only(renderType) ||
+ config->config.rgbBits != 32 ||
++ config->config.redBits != 8 ||
++ config->config.greenBits != 8 ||
++ config->config.blueBits != 8 ||
+ config->config.visualRating != GLX_NONE ||
+ config->config.sampleBuffers != 0)) {
+ free(config);
+--
+2.8.3
+
diff --git a/0200-glx-Do-not-call-into-Composite-if-it-is-disabled.patch b/0200-glx-Do-not-call-into-Composite-if-it-is-disabled.patch
new file mode 100644
index 0000000..7d921e8
--- /dev/null
+++ b/0200-glx-Do-not-call-into-Composite-if-it-is-disabled.patch
@@ -0,0 +1,182 @@
+From 1326ee0bc5eb858c3c00847b3ba65134e4ca2e2d Mon Sep 17 00:00:00 2001
+From: Michal Srb <msrb@suse.com>
+Date: Tue, 13 Feb 2018 10:33:30 +0100
+Subject: [PATCH] glx: Do not call into Composite if it is disabled.
+
+Otherwise X server crashes if GLX is enabled and Composite disabled. For
+example the compIsAlternateVisual function will try to lookup CompScreenPtr
+using the CompScreenPrivateKey, but that was never initialized if Composite is
+disabled.
+
+Fixes: f84e59a4f4. ("glx: Duplicate relevant fbconfigs for compositing visuals")
+Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104993
+Signed-off-by: Michal Srb <msrb@suse.com>
+---
+ glx/glxdricommon.c | 63 +++++++++++++++++++++++++++++-------------------------
+ glx/glxscreens.c | 33 +++++++++++++++++-----------
+ 2 files changed, 55 insertions(+), 41 deletions(-)
+
+diff --git a/glx/glxdricommon.c b/glx/glxdricommon.c
+index a6602f9..1baf082 100644
+--- a/glx/glxdricommon.c
++++ b/glx/glxdricommon.c
+@@ -35,6 +35,7 @@
+ #include <GL/glxtokens.h>
+ #include <GL/internal/dri_interface.h>
+ #include <os.h>
++#include "extinit.h"
+ #include "glxserver.h"
+ #include "glxext.h"
+ #include "glxcontext.h"
+@@ -183,28 +184,30 @@ createModeFromConfig(const __DRIcoreExtension * core,
+ config->config.yInverted = GL_TRUE;
+
+ #ifdef COMPOSITE
+- /*
+- * Here we decide what fbconfigs will be duplicated for compositing.
+- * fgbconfigs marked with duplicatedForConf will be reserved for
+- * compositing visuals.
+- * It might look strange to do this decision this late when translation
+- * from a __DRIConfig is already done, but using the __DRIConfig
+- * accessor function becomes worse both with respect to code complexity
+- * and CPU usage.
+- */
+- if (duplicateForComp &&
+- (render_type_is_pbuffer_only(renderType) ||
+- config->config.rgbBits != 32 ||
+- config->config.redBits != 8 ||
+- config->config.greenBits != 8 ||
+- config->config.blueBits != 8 ||
+- config->config.visualRating != GLX_NONE ||
+- config->config.sampleBuffers != 0)) {
+- free(config);
+- return NULL;
+- }
++ if (!noCompositeExtension) {
++ /*
++ * Here we decide what fbconfigs will be duplicated for compositing.
++ * fgbconfigs marked with duplicatedForConf will be reserved for
++ * compositing visuals.
++ * It might look strange to do this decision this late when translation
++ * from a __DRIConfig is already done, but using the __DRIConfig
++ * accessor function becomes worse both with respect to code complexity
++ * and CPU usage.
++ */
++ if (duplicateForComp &&
++ (render_type_is_pbuffer_only(renderType) ||
++ config->config.rgbBits != 32 ||
++ config->config.redBits != 8 ||
++ config->config.greenBits != 8 ||
++ config->config.blueBits != 8 ||
++ config->config.visualRating != GLX_NONE ||
++ config->config.sampleBuffers != 0)) {
++ free(config);
++ return NULL;
++ }
+
+- config->config.duplicatedForComp = duplicateForComp;
++ config->config.duplicatedForComp = duplicateForComp;
++ }
+ #endif
+
+ return &config->config;
+@@ -238,14 +241,16 @@ glxConvertConfigs(const __DRIcoreExtension * core,
+ }
+
+ #ifdef COMPOSITE
+- /* Duplicate fbconfigs for use with compositing visuals */
+- for (i = 0; configs[i]; i++) {
+- tail->next = createModeFromConfig(core, configs[i], GLX_TRUE_COLOR,
+- GL_TRUE);
+- if (tail->next == NULL)
+- continue;
+-
+- tail = tail->next;
++ if (!noCompositeExtension) {
++ /* Duplicate fbconfigs for use with compositing visuals */
++ for (i = 0; configs[i]; i++) {
++ tail->next = createModeFromConfig(core, configs[i], GLX_TRUE_COLOR,
++ GL_TRUE);
++ if (tail->next == NULL)
++ continue;
++
++ tail = tail->next;
++ }
+ }
+ #endif
+
+diff --git a/glx/glxscreens.c b/glx/glxscreens.c
+index 596d972..5cd9fcf 100644
+--- a/glx/glxscreens.c
++++ b/glx/glxscreens.c
+@@ -38,6 +38,7 @@
+ #include <os.h>
+ #include <colormapst.h>
+
++#include "extinit.h"
+ #include "privates.h"
+ #include "glxserver.h"
+ #include "glxutil.h"
+@@ -280,10 +281,12 @@ pickFBConfig(__GLXscreen * pGlxScreen, VisualPtr visual)
+ if (config->visualID != 0)
+ continue;
+ #ifdef COMPOSITE
+- /* Use only duplicated configs for compIsAlternateVisuals */
+- if (!!compIsAlternateVisual(pGlxScreen->pScreen, visual->vid) !=
+- !!config->duplicatedForComp)
+- continue;
++ if (!noCompositeExtension) {
++ /* Use only duplicated configs for compIsAlternateVisuals */
++ if (!!compIsAlternateVisual(pGlxScreen->pScreen, visual->vid) !=
++ !!config->duplicatedForComp)
++ continue;
++ }
+ #endif
+ /*
+ * If possible, use the same swapmethod for all built-in visual
+@@ -353,8 +356,10 @@ __glXScreenInit(__GLXscreen * pGlxScreen, ScreenPtr pScreen)
+ pGlxScreen->visuals[pGlxScreen->numVisuals++] = config;
+ config->visualID = visual->vid;
+ #ifdef COMPOSITE
+- if (compIsAlternateVisual(pScreen, visual->vid))
+- config->visualSelectGroup++;
++ if (!noCompositeExtension) {
++ if (compIsAlternateVisual(pScreen, visual->vid))
++ config->visualSelectGroup++;
++ }
+ #endif
+ }
+ }
+@@ -376,10 +381,12 @@ __glXScreenInit(__GLXscreen * pGlxScreen, ScreenPtr pScreen)
+ */
+ depth = config->redBits + config->greenBits + config->blueBits;
+ #ifdef COMPOSITE
+- if (config->duplicatedForComp) {
+- depth += config->alphaBits;
+- config->visualSelectGroup++;
+- }
++ if (!noCompositeExtension) {
++ if (config->duplicatedForComp) {
++ depth += config->alphaBits;
++ config->visualSelectGroup++;
++ }
++ }
+ #endif
+ /* Make sure that our FBconfig's depth can actually be displayed
+ * (corresponds to an existing visual).
+@@ -404,8 +411,10 @@ __glXScreenInit(__GLXscreen * pGlxScreen, ScreenPtr pScreen)
+ continue;
+
+ #ifdef COMPOSITE
+- if (config->duplicatedForComp)
+- (void) CompositeRegisterAlternateVisuals(pScreen, &visual->vid, 1);
++ if (!noCompositeExtension) {
++ if (config->duplicatedForComp)
++ (void) CompositeRegisterAlternateVisuals(pScreen, &visual->vid, 1);
++ }
+ #endif
+ pGlxScreen->visuals[pGlxScreen->numVisuals++] = config;
+ initGlxVisual(visual, config);
+--
+2.8.3
+
diff --git a/x11-server.spec b/x11-server.spec
index 3ebf0c7..d776b97 100644
--- a/x11-server.spec
+++ b/x11-server.spec
@@ -32,7 +32,7 @@ Version: 1.19.6
%if %{git}
Release: 0.%{git}.1
%else
-Release: 2
+Release: 4
%endif
Summary: X11 servers
Group: System/X11
@@ -199,6 +199,34 @@ Patch6027: 0027-xfree86-Add-options-support-for-OutputClass-Options.patch
Patch6028: 0028-xfree86-xf86platformProbe-split-finding-pci-info-and.patch
Patch6029: 0029-xfree86-Allow-overriding-primary-GPU-detection-from-.patch
Patch6030: 0030-xfree86-Add-ModulePath-support-for-OutputClass-confi.patch
+Patch6031: 0100-glx-do-not-pick-sRGB-config-for-32-bit-RGBA-visual.patch
+Patch6032: 0101-xwayland-avoid-race-condition-on-new-keymap.patch
+Patch6033: 0102-Xorg.wrap-Ensure-correct-ordering-of-post-install-ho.patch
+Patch6034: 0103-animcur-Use-fixed-size-screen-private.patch
+Patch6035: 0104-animcur-Return-the-next-interval-directly-from-the-t.patch
+Patch6036: 0105-animcur-Run-the-timer-from-the-device-not-the-screen.patch
+Patch6037: 0106-animcur-Fix-transitions-between-animated-cursors.patch
+Patch6038: 0107-glamor-Specify-GLSL-version-for-xv-shader.patch
+Patch6039: 0108-config-fix-NULL-value-detection-for-ID_INPUT-being-u.patch
+Patch6040: 0109-build-guess-availability-of-monotonic-clock-for-cros.patch
+Patch6041: 0110-os-Fix-a-type-error-in-the-IPv6-XDMCP-code.patch
+Patch6042: 0111-xfree86-add-default-modes-for-16-9-and-16-10.patch
+Patch6043: 0112-Revert-present-Only-send-PresentCompleteNotify-event.patch
+Patch6044: 0113-xf86XvMCScreenInit-Clear-pScreenPriv-dixinfo-when-fr.patch
+Patch6045: 0114-composite-Propagate-damagedDescendants-when-reparent.patch
+Patch6046: 0115-os-inputthread-Force-unlock-when-stopping-thread.patch
+Patch6047: 0116-xwayland-remove-dirty-window-unconditionally-on-unre.patch
+Patch6048: 0117-glamor-fix-repeat-reflect-case-in-linear-gradient-sh.patch
+Patch6049: 0118-glamor-fix-no-reflect-case-for-gradients.patch
+Patch6050: 0119-glamor-remove-unused-variables-in-linear-gradient-sh.patch
+Patch6051: 0120-glamor-tidy-up-some-gradient-color-formulas.patch
+Patch6052: 0121-randr-Fix-rotation-check-in-ProcRRSetScreenSize.patch
+Patch6053: 0122-xwayland-Don-t-process-cursor-warping-without-an-xwl.patch
+Patch6054: 0123-glx-Only-assign-8-bpc-fbconfigs-for-composite-visual.patch
+
+
+# (tpg) fix bug https://issues.openmandriva.org/show_bug.cgi?id=2363
+Patch7000: 0200-glx-Do-not-call-into-Composite-if-it-is-disabled.patch
%description
X11 servers.
@@ -349,6 +377,7 @@ Requires: udev
Conflicts: drakx-kbd-mouse-x11 < 0.66
Conflicts: compiz < 0.5.0-1mdv2007.1
Obsoletes: x11-server13-xorg <= 1.2.99.905
+Requires: dri-drivers
# minimum libxfont needed for xserver-1.9:
Requires: libxfont >= 1.4.2
@@ -416,6 +445,7 @@ Summary: A X server for Wayland
Group: System/X11
License: MIT
Requires: x11-server-common = %{EVRD}
+Requires: dri-drivers
%description xwayland
Wayland is a complete window system in itself, but even so, if we're migrating