diff --git a/SOURCES/0001-Fix-segfault-on-probing-a-non-PCI-platform-device-on.patch b/SOURCES/0001-Fix-segfault-on-probing-a-non-PCI-platform-device-on.patch index e7b35ce..30554b9 100644 --- a/SOURCES/0001-Fix-segfault-on-probing-a-non-PCI-platform-device-on.patch +++ b/SOURCES/0001-Fix-segfault-on-probing-a-non-PCI-platform-device-on.patch @@ -27,5 +27,5 @@ index cef47da03d..dadbac6c8f 100644 } -- -2.20.1 +2.21.0 diff --git a/SOURCES/0001-composite-Additional-paranoia-in-compDestroyDamage.patch b/SOURCES/0001-composite-Additional-paranoia-in-compDestroyDamage.patch new file mode 100644 index 0000000..52e9e62 --- /dev/null +++ b/SOURCES/0001-composite-Additional-paranoia-in-compDestroyDamage.patch @@ -0,0 +1,25 @@ +From 58610d84853d1aa778230df731ce9036f1b32577 Mon Sep 17 00:00:00 2001 +From: Adam Jackson +Date: Tue, 13 Aug 2019 14:00:48 -0400 +Subject: [PATCH] composite: Additional paranoia in compDestroyDamage + +--- + composite/compalloc.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/composite/compalloc.c b/composite/compalloc.c +index 57c1693..04cf70c 100644 +--- a/composite/compalloc.c ++++ b/composite/compalloc.c +@@ -97,6 +97,8 @@ compDestroyDamage(DamagePtr pDamage, void *closure) + CompWindowPtr cw = GetCompWindow(pWin); + + cw->damage = 0; ++ cw->damaged = 0; ++ cw->damageRegistered = 0; + } + + static Bool +-- +2.21.0 + diff --git a/SOURCES/0001-composite-Remove-excess-compUnredirectWindow.patch b/SOURCES/0001-composite-Remove-excess-compUnredirectWindow.patch new file mode 100644 index 0000000..4583f40 --- /dev/null +++ b/SOURCES/0001-composite-Remove-excess-compUnredirectWindow.patch @@ -0,0 +1,31 @@ +From d84e9d5abfb571ba29f7ddf2a1cd3b7706702139 Mon Sep 17 00:00:00 2001 +From: Adam Jackson +Date: Mon, 5 Aug 2019 14:35:40 -0400 +Subject: [PATCH] composite: Remove excess compUnredirectWindow + +--- + composite/compwindow.c | 8 -------- + 1 file changed, 8 deletions(-) + +diff --git a/composite/compwindow.c b/composite/compwindow.c +index 9005d85..31d39e9 100644 +--- a/composite/compwindow.c ++++ b/composite/compwindow.c +@@ -656,14 +656,6 @@ compDestroyWindow(WindowPtr pWin) + CompSubwindowsPtr csw; + Bool ret; + +- /* +- * Take down bs explicitly, to get ->backStorage cleared +- */ +- if (pWin->backingStore != NotUseful) { +- pWin->backingStore = NotUseful; +- pScreen->ChangeWindowAttributes(pWin, CWBackingStore); +- } +- + pScreen->DestroyWindow = cs->DestroyWindow; + while ((cw = GetCompWindow(pWin))) + FreeResource(cw->clients->id, RT_NONE); +-- +2.21.0 + diff --git a/SOURCES/0001-dix-Optimize-setting-backing-store-state.patch b/SOURCES/0001-dix-Optimize-setting-backing-store-state.patch new file mode 100644 index 0000000..796ba20 --- /dev/null +++ b/SOURCES/0001-dix-Optimize-setting-backing-store-state.patch @@ -0,0 +1,61 @@ +From c2c9450bc7b324e58ea6b77d0d7e1d2d18f35646 Mon Sep 17 00:00:00 2001 +From: Adam Jackson +Date: Tue, 30 Jul 2019 21:26:49 -0400 +Subject: [PATCH xserver] dix: Optimize setting backing store state + +Extra special RHEL 7.7+ edition +--- + composite/compinit.c | 15 +++++---------- + dix/window.c | 6 ++++++ + 2 files changed, 11 insertions(+), 10 deletions(-) + +diff --git a/composite/compinit.c b/composite/compinit.c +index 2a4de4a22..149f354a6 100644 +--- a/composite/compinit.c ++++ b/composite/compinit.c +@@ -120,20 +120,15 @@ compCheckBackingStore(WindowPtr pWin) + (pWin->backingStore == Always) || + (pWin->backingStore == WhenMapped && pWin->viewable); + +- if (should && !pWin->backStorage) { ++ if (should) { + compCheckPaintable(pWin); +- if (Success == compRedirectWindow(serverClient, pWin, +- CompositeRedirectAutomatic)) +- pWin->backStorage = TRUE; ++ compRedirectWindow(serverClient, pWin, CompositeRedirectAutomatic); + } +- else if (!should && pWin->backStorage) { ++ else if (!should) { + compCheckPaintable(pWin); +- if (Success == compUnredirectWindow(serverClient, pWin, +- CompositeRedirectAutomatic)) +- pWin->backStorage = FALSE; ++ compUnredirectWindow(serverClient, pWin, CompositeRedirectAutomatic); + } +- pWin->paintable = pWin->viewable || +- (pWin->backingStore == Always && pWin->backStorage); ++ compCheckPaintable(pWin); /* XXX before and after? really? */ + } + + /* Fake backing store via automatic redirection */ +diff --git a/dix/window.c b/dix/window.c +index 34bed93d9..30ae5db89 100644 +--- a/dix/window.c ++++ b/dix/window.c +@@ -1342,6 +1342,12 @@ ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client) + client->errorValue = val; + goto PatchUp; + } ++ /* if we're not actually changing the window's state, hide ++ * CWBackingStore from vmaskCopy so it doesn't get passed to ++ * ->ChangeWindowAttributes below ++ */ ++ if (pWin->backingStore == val) ++ continue; + pWin->backingStore = val; + pWin->forcedBS = FALSE; + break; +-- +2.21.0 + diff --git a/SOURCES/0001-dri2-Set-fallback-driver-names-for-Intel-and-AMD-chi.patch b/SOURCES/0001-dri2-Set-fallback-driver-names-for-Intel-and-AMD-chi.patch new file mode 100644 index 0000000..b2d36e7 --- /dev/null +++ b/SOURCES/0001-dri2-Set-fallback-driver-names-for-Intel-and-AMD-chi.patch @@ -0,0 +1,55 @@ +From 2a9268e4a0ba7b062ded4d361be3119d887aac41 Mon Sep 17 00:00:00 2001 +From: Adam Jackson +Date: Tue, 3 Sep 2019 11:20:58 -0400 +Subject: [PATCH xserver] dri2: Set fallback driver names for Intel and AMD + chips +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +i965 and radeonsi, respectively, are the drivers that have been +receiving new hardware support. It's really silly to need to update the +server side to know specific new devices IDs every time a new ASIC comes +out. + +Reviewed-by: Michel Dänzer +--- + hw/xfree86/dri2/pci_ids/pci_id_driver_map.h | 9 ++------- + 1 file changed, 2 insertions(+), 7 deletions(-) + +diff --git a/hw/xfree86/dri2/pci_ids/pci_id_driver_map.h b/hw/xfree86/dri2/pci_ids/pci_id_driver_map.h +index da7ea1c1e..04f372279 100644 +--- a/hw/xfree86/dri2/pci_ids/pci_id_driver_map.h ++++ b/hw/xfree86/dri2/pci_ids/pci_id_driver_map.h +@@ -45,12 +45,6 @@ static const int r600_chip_ids[] = { + #undef CHIPSET + }; + +-static const int radeonsi_chip_ids[] = { +-#define CHIPSET(chip, name, family) chip, +-#include "pci_ids/radeonsi_pci_ids.h" +-#undef CHIPSET +-}; +- + static const int virtio_gpu_chip_ids[] = { + #define CHIPSET(chip, name, family) chip, + #include "pci_ids/virtio_gpu_pci_ids.h" +@@ -71,13 +65,14 @@ static const struct { + } driver_map[] = { + { 0x8086, "i915", i915_chip_ids, ARRAY_SIZE(i915_chip_ids) }, + { 0x8086, "i965", i965_chip_ids, ARRAY_SIZE(i965_chip_ids) }, ++ { 0x8086, "i965", NULL, -1 }, + #ifndef DRIVER_MAP_GALLIUM_ONLY + { 0x1002, "radeon", r100_chip_ids, ARRAY_SIZE(r100_chip_ids) }, + { 0x1002, "r200", r200_chip_ids, ARRAY_SIZE(r200_chip_ids) }, + #endif + { 0x1002, "r300", r300_chip_ids, ARRAY_SIZE(r300_chip_ids) }, + { 0x1002, "r600", r600_chip_ids, ARRAY_SIZE(r600_chip_ids) }, +- { 0x1002, "radeonsi", radeonsi_chip_ids, ARRAY_SIZE(radeonsi_chip_ids) }, ++ { 0x1002, "radeonsi", NULL, -1 }, + { 0x10de, "nouveau", NULL, -1 }, + { 0x1af4, "virtio_gpu", virtio_gpu_chip_ids, ARRAY_SIZE(virtio_gpu_chip_ids) }, + { 0x15ad, "vmwgfx", vmwgfx_chip_ids, ARRAY_SIZE(vmwgfx_chip_ids) }, +-- +2.23.0 + diff --git a/SOURCES/0001-linux-Fix-platform-device-PCI-detection-for-complex-.patch b/SOURCES/0001-linux-Fix-platform-device-PCI-detection-for-complex-.patch new file mode 100644 index 0000000..9c0a311 --- /dev/null +++ b/SOURCES/0001-linux-Fix-platform-device-PCI-detection-for-complex-.patch @@ -0,0 +1,45 @@ +From b6e18eb57f3dd104704d0a5ec3d2f051645b9068 Mon Sep 17 00:00:00 2001 +From: Adam Jackson +Date: Wed, 19 Jun 2019 14:23:56 -0400 +Subject: [PATCH xserver] linux: Fix platform device PCI detection for complex + bus topologies + +Suppose you're in a Hyper-V guest and are trying to use PCI passthrough. +The ID_PATH that udev will construct for that looks something like +"acpi-VMBUS:00-pci-b8c8:00:00.0", and obviously looking for "pci-" in +the first four characters of that is going to not work. + +Instead, strstr. I suppose it's possible you could have _multiple_ PCI +buses in the path, in which case you'd want strrstr, if that were a +thing. +--- + config/udev.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/config/udev.c b/config/udev.c +index 314acba6ce..6e11aa3b88 100644 +--- a/config/udev.c ++++ b/config/udev.c +@@ -474,7 +474,7 @@ config_udev_odev_setup_attribs(struct udev_device *udev_device, const char *path + config_odev_probe_proc_ptr probe_callback) + { + struct OdevAttributes *attribs = config_odev_allocate_attributes(); +- const char *value; ++ const char *value, *str; + + attribs->path = XNFstrdup(path); + attribs->syspath = XNFstrdup(syspath); +@@ -482,8 +482,8 @@ config_udev_odev_setup_attribs(struct udev_device *udev_device, const char *path + attribs->minor = minor; + + value = udev_device_get_property_value(udev_device, "ID_PATH"); +- if (value && !strncmp(value, "pci-", 4)) { +- attribs->busid = XNFstrdup(value); ++ if (value && (str = strstr(value, "pci-"))) { ++ attribs->busid = XNFstrdup(str); + attribs->busid[3] = ':'; + } + +-- +2.21.0 + diff --git a/SOURCES/0001-linux-Make-platform-device-probe-less-fragile.patch b/SOURCES/0001-linux-Make-platform-device-probe-less-fragile.patch new file mode 100644 index 0000000..38bf933 --- /dev/null +++ b/SOURCES/0001-linux-Make-platform-device-probe-less-fragile.patch @@ -0,0 +1,142 @@ +From 0816e8fca6194dfb4cc94c3a7fcb2c7f2a921386 Mon Sep 17 00:00:00 2001 +From: Adam Jackson +Date: Tue, 18 Sep 2018 14:37:51 -0400 +Subject: [PATCH xserver] linux: Make platform device probe less fragile + +At the point where xf86BusProbe runs we haven't yet taken our own VT, +which means we can't perform drm "master" operations on the device. This +is tragic, because we need master to fish the bus id string out of the +kernel, which we can only do after drmSetInterfaceVersion, which for +some reason stores that string on the device not the file handle and +thus needs master access. + +Fortunately we know the format of the busid string, and it happens to +almost be the same as the ID_PATH variable from udev. Use that instead +and stop calling drmSetInterfaceVersion. + +Reviewed-by: Peter Hutterer +Signed-off-by: Adam Jackson +--- + config/udev.c | 17 ++++++++++++----- + hw/xfree86/os-support/linux/lnx_platform.c | 20 ++------------------ + 2 files changed, 14 insertions(+), 23 deletions(-) + +diff --git a/config/udev.c b/config/udev.c +index 3a73189e25..8c6c4b6665 100644 +--- a/config/udev.c ++++ b/config/udev.c +@@ -56,7 +56,7 @@ static struct udev_monitor *udev_monitor; + + #ifdef CONFIG_UDEV_KMS + static void +-config_udev_odev_setup_attribs(const char *path, const char *syspath, ++config_udev_odev_setup_attribs(struct udev_device *udev_device, const char *path, const char *syspath, + int major, int minor, + config_odev_probe_proc_ptr probe_callback); + #endif +@@ -128,7 +128,7 @@ device_added(struct udev_device *udev_device) + + LogMessage(X_INFO, "config/udev: Adding drm device (%s)\n", path); + +- config_udev_odev_setup_attribs(path, syspath, major(devnum), ++ config_udev_odev_setup_attribs(udev_device, path, syspath, major(devnum), + minor(devnum), NewGPUDeviceRequest); + return; + } +@@ -322,7 +322,7 @@ device_removed(struct udev_device *device) + + LogMessage(X_INFO, "config/udev: removing GPU device %s %s\n", + syspath, path); +- config_udev_odev_setup_attribs(path, syspath, major(devnum), ++ config_udev_odev_setup_attribs(device, path, syspath, major(devnum), + minor(devnum), DeleteGPUDeviceRequest); + /* Retry vtenter after a drm node removal */ + systemd_logind_vtenter(); +@@ -465,17 +465,24 @@ config_udev_fini(void) + #ifdef CONFIG_UDEV_KMS + + static void +-config_udev_odev_setup_attribs(const char *path, const char *syspath, ++config_udev_odev_setup_attribs(struct udev_device *udev_device, const char *path, const char *syspath, + int major, int minor, + config_odev_probe_proc_ptr probe_callback) + { + struct OdevAttributes *attribs = config_odev_allocate_attributes(); ++ const char *value; + + attribs->path = XNFstrdup(path); + attribs->syspath = XNFstrdup(syspath); + attribs->major = major; + attribs->minor = minor; + ++ value = udev_device_get_property_value(udev_device, "ID_PATH"); ++ if (value && !strncmp(value, "pci-", 4)) { ++ attribs->busid = XNFstrdup(value); ++ attribs->busid[3] = ':'; ++ } ++ + /* ownership of attribs is passed to probe layer */ + probe_callback(attribs); + } +@@ -516,7 +523,7 @@ config_udev_odev_probe(config_odev_probe_proc_ptr probe_callback) + else if (!check_seat(udev_device)) + goto no_probe; + +- config_udev_odev_setup_attribs(path, syspath, major(devnum), ++ config_udev_odev_setup_attribs(udev_device, path, syspath, major(devnum), + minor(devnum), probe_callback); + no_probe: + udev_device_unref(udev_device); +diff --git a/hw/xfree86/os-support/linux/lnx_platform.c b/hw/xfree86/os-support/linux/lnx_platform.c +index 70374ace88..e623062192 100644 +--- a/hw/xfree86/os-support/linux/lnx_platform.c ++++ b/hw/xfree86/os-support/linux/lnx_platform.c +@@ -23,13 +23,13 @@ + static Bool + get_drm_info(struct OdevAttributes *attribs, char *path, int delayed_index) + { +- drmSetVersion sv; + drmVersionPtr v; +- char *buf; + int fd; + int err = 0; + Bool paused, server_fd = FALSE; + ++ LogMessage(X_INFO, "Platform probe for %s\n", attribs->syspath); ++ + fd = systemd_logind_take_fd(attribs->major, attribs->minor, path, &paused); + if (fd != -1) { + if (paused) { +@@ -48,18 +48,6 @@ get_drm_info(struct OdevAttributes *attribs, char *path, int delayed_index) + if (fd == -1) + return FALSE; + +- sv.drm_di_major = 1; +- sv.drm_di_minor = 4; +- sv.drm_dd_major = -1; /* Don't care */ +- sv.drm_dd_minor = -1; /* Don't care */ +- +- err = drmSetInterfaceVersion(fd, &sv); +- if (err) { +- xf86Msg(X_ERROR, "%s: failed to set DRM interface version 1.4: %s\n", +- path, strerror(-err)); +- goto out; +- } +- + /* for a delayed probe we've already added the device */ + if (delayed_index == -1) { + xf86_add_platform_device(attribs, FALSE); +@@ -69,10 +57,6 @@ get_drm_info(struct OdevAttributes *attribs, char *path, int delayed_index) + if (server_fd) + xf86_platform_devices[delayed_index].flags |= XF86_PDEV_SERVER_FD; + +- buf = drmGetBusid(fd); +- xf86_platform_odev_attributes(delayed_index)->busid = XNFstrdup(buf); +- drmFreeBusid(buf); +- + v = drmGetVersion(fd); + if (!v) { + xf86Msg(X_ERROR, "%s: failed to query DRM version\n", path); +-- +2.21.0 + diff --git a/SPECS/xorg-x11-server.spec b/SPECS/xorg-x11-server.spec index 7c9bf2f..3fd5065 100644 --- a/SPECS/xorg-x11-server.spec +++ b/SPECS/xorg-x11-server.spec @@ -42,7 +42,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.20.4 -Release: 7%{?gitdate:.%{gitdate}}%{?dist} +Release: 10%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org License: MIT Group: User Interface/X @@ -100,6 +100,9 @@ Patch9710: 0001-modesetting-software-cursor-hack.patch # Bug 1599885 - RFE: enable backing store's Always mode Patch9750: 0001-composite-Implement-backing-store-Always.patch +Patch9751: 0001-dix-Optimize-setting-backing-store-state.patch +Patch9752: 0001-composite-Remove-excess-compUnredirectWindow.patch +Patch9753: 0001-composite-Additional-paranoia-in-compDestroyDamage.patch #Patch9751: 0001-glamor_egl-Don-t-initialize-on-llvmpipe.patch #Patch9752: 0001-xwayland-Don-t-initialize-glamor-on-llvmpipe.patch @@ -111,9 +114,12 @@ Patch9756: 0001-xfree86-LeaveVT-from-xf86CrtcCloseScreen.patch # Startx will have segment fault with hyper-V environment Patch9759: 0001-Fix-segfault-on-probing-a-non-PCI-platform-device-on.patch +Patch9760: 0001-linux-Make-platform-device-probe-less-fragile.patch +# ... which also needs https://gitlab.freedesktop.org/xorg/xserver/merge_requests/217 +Patch9761: 0001-linux-Fix-platform-device-PCI-detection-for-complex-.patch # Bug 1640207 - Qt5 scroll misbehaving after XTest button event -Patch9758: 0001-dix-leave-last.valuators-alone-on-slave-switch.patch +Patch9770: 0001-dix-leave-last.valuators-alone-on-slave-switch.patch # Bug 1612924 - upstream backport for allow monitors to be enabled connected Patch9800: 0001-xf86-set-status-to-connected-for-monitors-enabled-in.patch @@ -121,6 +127,9 @@ Patch9800: 0001-xf86-set-status-to-connected-for-monitors-enabled-in.patch # Bug 1680120 - upstream backport to fix user switching Patch9900: 0001-xfree86-Only-switch-to-original-VT-if-it-is-active.patch +# Bug 1763001 - Xorg.#.log show "(EE) modeset(0): [DRI2] No driver mapping found..." +Patch9910: 0001-dri2-Set-fallback-driver-names-for-Intel-and-AMD-chi.patch + %global moduledir %{_libdir}/xorg/modules %global drimoduledir %{_libdir}/dri %global sdkdir %{_includedir}/xorg @@ -602,6 +611,15 @@ rm -rf $RPM_BUILD_ROOT %{xserver_source_dir} %changelog +* Wed Jan 08 2020 Adam Jackson - 1.20.4-10 +- Set fallback DRI2 driver names for Intel and AMD + +* Tue Aug 13 2019 Adam Jackson - 1.20.4-9 +- Fix a crash when destroying a redirected window with backing store + +* Wed Jun 19 2019 Adam Jackson - 1.20.4-8 +- Fix platform device PCI detection with complex bus topologies + * Tue May 28 2019 Adam Jackson - 1.20.4-7 - Fix a segfault with non-PCI platform devices (and other cases)