commit e9e6351ba7aa68dc494c79dcad9e093a32a040b4
Author: Dave Airlie <airlied(a)gmail.com>
Date: Sun Feb 1 09:09:26 2015 +1000
upstream release 1.16.3 + two backport fixes
0001-dix-Allow-zero-height-PutImage-requests.patch | 34 +++++
...attempt-to-fix-primary-on-slave-output-v2.patch | 146 ++++++++++++++++++++
...-Respect-seat-assignments-when-assigned-d.patch | 86 ++++++++++++
sources | 2 +-
xorg-x11-server.spec | 10 ++-
5 files changed, 276 insertions(+), 2 deletions(-)
---
diff --git a/0001-dix-Allow-zero-height-PutImage-requests.patch
b/0001-dix-Allow-zero-height-PutImage-requests.patch
new file mode 100644
index 0000000..757d8b8
--- /dev/null
+++ b/0001-dix-Allow-zero-height-PutImage-requests.patch
@@ -0,0 +1,34 @@
+From f39ac527baab8a38d023e3a8416757ccfcead42a Mon Sep 17 00:00:00 2001
+From: Keith Packard <keithp(a)keithp.com>
+Date: Sat, 3 Jan 2015 08:46:45 -0800
+Subject: [PATCH] dix: Allow zero-height PutImage requests
+
+The length checking code validates PutImage height and byte width by
+making sure that byte-width >= INT32_MAX / height. If height is zero,
+this generates a divide by zero exception. Allow zero height requests
+explicitly, bypassing the INT32_MAX check.
+
+Signed-off-by: Keith Packard <keithp(a)keithp.com>
+Reviewed-by: Alan Coopersmith <alan.coopersmith(a)oracle.com>
+(cherry picked from commit dc777c346d5d452a53b13b917c45f6a1bad2f20b)
+Signed-off-by: Julien Cristau <jcristau(a)debian.org>
+---
+ dix/dispatch.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/dix/dispatch.c b/dix/dispatch.c
+index 01820bc..4e24e62 100644
+--- a/dix/dispatch.c
++++ b/dix/dispatch.c
+@@ -1956,7 +1956,7 @@ ProcPutImage(ClientPtr client)
+ tmpImage = (char *) &stuff[1];
+ lengthProto = length;
+
+- if (lengthProto >= (INT32_MAX / stuff->height))
++ if (stuff->height != 0 && lengthProto >= (INT32_MAX /
stuff->height))
+ return BadLength;
+
+ if ((bytes_to_int32(lengthProto * stuff->height) +
+--
+2.1.0
+
diff --git a/0001-randr-attempt-to-fix-primary-on-slave-output-v2.patch
b/0001-randr-attempt-to-fix-primary-on-slave-output-v2.patch
new file mode 100644
index 0000000..1e272d9
--- /dev/null
+++ b/0001-randr-attempt-to-fix-primary-on-slave-output-v2.patch
@@ -0,0 +1,146 @@
+From b3ef430c7896db4d3bd1249d5341342424532539 Mon Sep 17 00:00:00 2001
+From: Dave Airlie <airlied(a)redhat.com>
+Date: Wed, 7 Jan 2015 09:19:27 +1000
+Subject: [PATCH 1/2] randr: attempt to fix primary on slave output (v2)
+
+If the user wants to set one of the slave devices as
+the primary output, we shouldn't fail to do so,
+we were returning BadMatch which was tripping up
+gnome-settings-daemon and bad things ensues.
+
+Fix all the places we use primaryOutput to work
+out primaryCrtc and take it into a/c when slave
+gpus are in use.
+
+v2: review from Aaron, fix indent, unhide has_primary from
+macro. I left the int vs Bool alone to be consistent with
+code below, a future patch could fix both.
+
+Signed-off-by: Dave Airlie <airlied(a)redhat.com>
+Reviewed-by: Aaron Plattner <aplattner(a)nvidia.com>
+Signed-off-by: Keith Packard <keithp(a)keithp.com>
+---
+ randr/rroutput.c | 6 +++++-
+ randr/rrscreen.c | 22 ++++++++++++++++++----
+ randr/rrxinerama.c | 12 ++++++++++--
+ 3 files changed, 33 insertions(+), 7 deletions(-)
+
+diff --git a/randr/rroutput.c b/randr/rroutput.c
+index f824f50..1649309 100644
+--- a/randr/rroutput.c
++++ b/randr/rroutput.c
+@@ -540,7 +540,11 @@ ProcRRSetOutputPrimary(ClientPtr client)
+ if (stuff->output) {
+ VERIFY_RR_OUTPUT(stuff->output, output, DixReadAccess);
+
+- if (output->pScreen != pWin->drawable.pScreen) {
++ if (!output->pScreen->isGPU && output->pScreen !=
pWin->drawable.pScreen) {
++ client->errorValue = stuff->window;
++ return BadMatch;
++ }
++ if (output->pScreen->isGPU &&
output->pScreen->current_master != pWin->drawable.pScreen) {
+ client->errorValue = stuff->window;
+ return BadMatch;
+ }
+diff --git a/randr/rrscreen.c b/randr/rrscreen.c
+index 36179ae..e7ea49d 100644
+--- a/randr/rrscreen.c
++++ b/randr/rrscreen.c
+@@ -322,8 +322,13 @@ static inline void swap_modeinfos(xRRModeInfo *modeinfos, int i)
+ swapl(&modeinfos[i].modeFlags);
+ }
+
+-#define update_arrays(gpuscreen, pScrPriv) do { \
++#define update_arrays(gpuscreen, pScrPriv, primary_crtc, has_primary) do { \
+ for (j = 0; j < pScrPriv->numCrtcs; j++) { \
++ if (has_primary && \
++ primary_crtc == pScrPriv->crtcs[j]) { \
++ has_primary = 0; \
++ continue; \
++ }\
+ crtcs[crtc_count] = pScrPriv->crtcs[j]->id; \
+ if (client->swapped) \
+ swapl(&crtcs[crtc_count]); \
+@@ -366,9 +371,11 @@ rrGetMultiScreenResources(ClientPtr client, Bool query, ScreenPtr
pScreen)
+ unsigned long extraLen;
+ CARD8 *extra;
+ RRCrtc *crtcs;
++ RRCrtcPtr primary_crtc = NULL;
+ RROutput *outputs;
+ xRRModeInfo *modeinfos;
+ CARD8 *names;
++ int has_primary = 0;
+
+ /* we need to iterate all the GPU masters and all their output slaves */
+ total_crtcs = 0;
+@@ -426,18 +433,25 @@ rrGetMultiScreenResources(ClientPtr client, Bool query, ScreenPtr
pScreen)
+ modeinfos = (xRRModeInfo *)(outputs + total_outputs);
+ names = (CARD8 *)(modeinfos + total_modes);
+
+- /* TODO primary */
+ crtc_count = 0;
+ output_count = 0;
+ mode_count = 0;
+
+ pScrPriv = rrGetScrPriv(pScreen);
+- update_arrays(pScreen, pScrPriv);
++ if (pScrPriv->primaryOutput && pScrPriv->primaryOutput->crtc) {
++ has_primary = 1;
++ primary_crtc = pScrPriv->primaryOutput->crtc;
++ crtcs[0] = pScrPriv->primaryOutput->crtc->id;
++ if (client->swapped)
++ swapl(&crtcs[0]);
++ crtc_count = 1;
++ }
++ update_arrays(pScreen, pScrPriv, primary_crtc, has_primary);
+
+ xorg_list_for_each_entry(iter, &pScreen->output_slave_list, output_head) {
+ pScrPriv = rrGetScrPriv(iter);
+
+- update_arrays(iter, pScrPriv);
++ update_arrays(iter, pScrPriv, primary_crtc, has_primary);
+ }
+
+ assert(bytes_to_int32((char *) names - (char *) extra) == rep.length);
+diff --git a/randr/rrxinerama.c b/randr/rrxinerama.c
+index 76d728c..363cead 100644
+--- a/randr/rrxinerama.c
++++ b/randr/rrxinerama.c
+@@ -344,15 +344,17 @@ ProcRRXineramaQueryScreens(ClientPtr client)
+ ScreenPtr slave;
+ rrScrPriv(pScreen);
+ int has_primary = 0;
++ RRCrtcPtr primary_crtc = NULL;
+
+ if (pScrPriv->primaryOutput && pScrPriv->primaryOutput->crtc)
{
+ has_primary = 1;
++ primary_crtc = pScrPriv->primaryOutput->crtc;
+ RRXineramaWriteCrtc(client, pScrPriv->primaryOutput->crtc);
+ }
+
+ for (i = 0; i < pScrPriv->numCrtcs; i++) {
+ if (has_primary &&
+- pScrPriv->primaryOutput->crtc == pScrPriv->crtcs[i]) {
++ primary_crtc == pScrPriv->crtcs[i]) {
+ has_primary = 0;
+ continue;
+ }
+@@ -362,8 +364,14 @@ ProcRRXineramaQueryScreens(ClientPtr client)
+ xorg_list_for_each_entry(slave, &pScreen->output_slave_list, output_head)
{
+ rrScrPrivPtr pSlavePriv;
+ pSlavePriv = rrGetScrPriv(slave);
+- for (i = 0; i < pSlavePriv->numCrtcs; i++)
++ for (i = 0; i < pSlavePriv->numCrtcs; i++) {
++ if (has_primary &&
++ primary_crtc == pSlavePriv->crtcs[i]) {
++ has_primary = 0;
++ continue;
++ }
+ RRXineramaWriteCrtc(client, pSlavePriv->crtcs[i]);
++ }
+ }
+ }
+
+--
+2.1.0
+
diff --git a/0002-config-udev-Respect-seat-assignments-when-assigned-d.patch
b/0002-config-udev-Respect-seat-assignments-when-assigned-d.patch
new file mode 100644
index 0000000..e2ba03b
--- /dev/null
+++ b/0002-config-udev-Respect-seat-assignments-when-assigned-d.patch
@@ -0,0 +1,86 @@
+From c38c1f7e76b3ec85404c7897ce2aadb28645198c Mon Sep 17 00:00:00 2001
+From: Dave Airlie <airlied(a)redhat.com>
+Date: Fri, 30 Jan 2015 09:59:49 +1000
+Subject: [PATCH 2/2] config/udev: Respect seat assignments when assigned
+ devices
+
+Jonathan Dieter posted a few patches to do this inside the Xorg
+server but it makes no sense to do it there, just have the code
+we use to probe the device list at startup check seat assignments
+using the same code we check at hotplug time.
+
+Bugilla:
https://bugzilla.redhat.com/show_bug.cgi?id=1183654
+Reviewed-by: Peter Hutterer <peter.hutterer(a)who-t.net>
+Acked-by: Hans de Goede <hdegoede(a)redhat.com>
+Tested-by: Jonathan Dieter <jdieter(a)lesbg.com>
+Signed-off-by: Dave Airlie <airlied(a)redhat.com>
+Signed-off-by: Keith Packard <keithp(a)keithp.com>
+---
+ config/udev.c | 30 +++++++++++++++++++++---------
+ 1 file changed, 21 insertions(+), 9 deletions(-)
+
+diff --git a/config/udev.c b/config/udev.c
+index a1b72c1..71215af 100644
+--- a/config/udev.c
++++ b/config/udev.c
+@@ -69,6 +69,24 @@ static const char *itoa(int i)
+ return itoa_buf;
+ }
+
++static Bool
++check_seat(struct udev_device *udev_device)
++{
++ const char *dev_seat;
++
++ dev_seat = udev_device_get_property_value(udev_device, "ID_SEAT");
++ if (!dev_seat)
++ dev_seat = "seat0";
++
++ if (SeatId && strcmp(dev_seat, SeatId))
++ return FALSE;
++
++ if (!SeatId && strcmp(dev_seat, "seat0"))
++ return FALSE;
++
++ return TRUE;
++}
++
+ static void
+ device_added(struct udev_device *udev_device)
+ {
+@@ -83,7 +101,6 @@ device_added(struct udev_device *udev_device)
+ struct udev_list_entry *set, *entry;
+ struct udev_device *parent;
+ int rc;
+- const char *dev_seat;
+ dev_t devnum;
+
+ path = udev_device_get_devnode(udev_device);
+@@ -93,14 +110,7 @@ device_added(struct udev_device *udev_device)
+ if (!path || !syspath)
+ return;
+
+- dev_seat = udev_device_get_property_value(udev_device, "ID_SEAT");
+- if (!dev_seat)
+- dev_seat = "seat0";
+-
+- if (SeatId && strcmp(dev_seat, SeatId))
+- return;
+-
+- if (!SeatId && strcmp(dev_seat, "seat0"))
++ if (!check_seat(udev_device))
+ return;
+
+ devnum = udev_device_get_devnum(udev_device);
+@@ -506,6 +516,8 @@ config_udev_odev_probe(config_odev_probe_proc_ptr probe_callback)
+ goto no_probe;
+ else if (strncmp(sysname, "card", 4) != 0)
+ goto no_probe;
++ else if (!check_seat(udev_device))
++ goto no_probe;
+
+ config_udev_odev_setup_attribs(path, syspath, major(devnum),
+ minor(devnum), probe_callback);
+--
+2.1.0
+
diff --git a/sources b/sources
index 8919c54..c5a2d0c 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-82cbcf6755787962e943d8e23495358d xorg-server-1.16.2.901.tar.bz2
+afd93977235584a9caa7528a737c1b52 xorg-server-1.16.3.tar.bz2
diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec
index 2087984..65a86d8 100644
--- a/xorg-x11-server.spec
+++ b/xorg-x11-server.spec
@@ -41,7 +41,7 @@
Summary: X.Org X11 X server
Name: xorg-x11-server
-Version: 1.16.2.901
+Version: 1.16.3
Release: 1%{?gitdate:.%{gitdate}}%{dist}
URL:
http://www.x.org
License: MIT
@@ -99,8 +99,13 @@ Patch10000:
0001-Fedora-hack-Make-the-suid-root-wrapper-always-start-.patch
# submitted
http://lists.x.org/archives/xorg-devel/2014-July/042936.html
Patch10200: 0001-xwayland-Snap-damage-reports-to-the-bounding-box.patch
+# alread in stable
+Patch10250: 0001-dix-Allow-zero-height-PutImage-requests.patch
# already in master:
Patch10300: glamor-add-shm-sync-fence-support.patch
+Patch10301: 0001-randr-attempt-to-fix-primary-on-slave-output-v2.patch
+Patch10302: 0002-config-udev-Respect-seat-assignments-when-assigned-d.patch
+
%global moduledir %{_libdir}/xorg/modules
%global drimoduledir %{_libdir}/dri
%global sdkdir %{_includedir}/xorg
@@ -639,6 +644,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete
%changelog
+* Sun Feb 01 2015 Dave Airlie <airlied(a)redhat.com 1.16.3-1
+- upstream release 1.16.3 + two backport fixes
+
* Wed Dec 10 2014 Dave Airlie <airlied(a)redhat.com> 1.16.2.901-1
- upstream security release. 1.16.2.901