From 3a9dd861fd2a9b9f2e38d8b7d995e1f45f6b074e Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Wed, 20 Dec 2017 15:49:54 -0500 Subject: [PATCH 001/131] xserver 1.19.6 --- sources | 2 +- xorg-x11-server.spec | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/sources b/sources index 1192868..59caaa3 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (xorg-server-1.19.5.tar.bz2) = 928dea5850b98cd815004cfa133eca23cfa9521920c934c68a92787f2cae13cca1534eee772a4fb74b8ae8cb92662b5d68b95b834c8aa8ec57cd57cb4e5dd45c +SHA512 (xorg-server-1.19.6.tar.bz2) = 38519a8d0af9dd034045fc346959496dd718fa59b6188307974797a1cd9c349deb54987f6232ea8396baf810dcc710c0ff191f76ed2186cae4d44921b3680412 diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index a62ad4f..545f575 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -44,7 +44,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server -Version: 1.19.5 +Version: 1.19.6 Release: 1%{?gitdate:.%{gitdate}}%{dist} URL: http://www.x.org License: MIT @@ -617,6 +617,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Wed Dec 20 2017 Adam Jackson - 1.19.6-1 +- xserver 1.19.6 + * Thu Oct 12 2017 Adam Jackson - 1.19.5-1 - xserver 1.19.5 From dbeed8684be7af0bdf8194993904d0cad893296a Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 11 Jan 2018 08:15:54 +1000 Subject: [PATCH 002/131] Fix handling of devices with ID_INPUT=null --- ...value-detection-for-ID_INPUT-being-u.patch | 33 +++++++++++++++++++ xorg-x11-server.spec | 8 ++++- 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 0001-config-fix-NULL-value-detection-for-ID_INPUT-being-u.patch diff --git a/0001-config-fix-NULL-value-detection-for-ID_INPUT-being-u.patch b/0001-config-fix-NULL-value-detection-for-ID_INPUT-being-u.patch new file mode 100644 index 0000000..15ba8e7 --- /dev/null +++ b/0001-config-fix-NULL-value-detection-for-ID_INPUT-being-u.patch @@ -0,0 +1,33 @@ +From a309323328d9d6e0bf5d9ea1d75920e53b9beef3 Mon Sep 17 00:00:00 2001 +From: Peter Hutterer +Date: Fri, 5 Jan 2018 11:58:42 +1000 +Subject: [PATCH xserver] 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 +Signed-off-by: Peter Hutterer +--- + config/udev.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/config/udev.c b/config/udev.c +index e198e8609..3a73189e2 100644 +--- a/config/udev.c ++++ b/config/udev.c +@@ -135,7 +135,7 @@ device_added(struct udev_device *udev_device) + #endif + + value = udev_device_get_property_value(udev_device, "ID_INPUT"); +- if (value && !strcmp(value, "0")) { ++ if (!value || !strcmp(value, "0")) { + LogMessageVerb(X_INFO, 10, + "config/udev: ignoring device %s without " + "property ID_INPUT set\n", path); +-- +2.14.3 + diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 545f575..119ab79 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -45,7 +45,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.19.6 -Release: 1%{?gitdate:.%{gitdate}}%{dist} +Release: 2%{?gitdate:.%{gitdate}}%{dist} URL: http://www.x.org License: MIT Group: User Interface/X @@ -125,6 +125,9 @@ Patch10000: 0001-Fedora-hack-Make-the-suid-root-wrapper-always-start-.patch # Default to xf86-video-modesetting on GeForce 8 and newer Patch10001: 0001-xfree86-use-modesetting-driver-by-default-on-GeForce.patch +# Upstream commit a309323328d9d6e0bf +Patch10002: 0001-config-fix-NULL-value-detection-for-ID_INPUT-being-u.patch + %global moduledir %{_libdir}/xorg/modules %global drimoduledir %{_libdir}/dri %global sdkdir %{_includedir}/xorg @@ -617,6 +620,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Thu Jan 11 2018 Peter Hutterer 1.19.6-2 +- Fix handling of devices with ID_INPUT=null + * Wed Dec 20 2017 Adam Jackson - 1.19.6-1 - xserver 1.19.6 From 8dd9953946e48fe5fc574b79d9d200ca93256e17 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Mon, 22 Jan 2018 11:56:57 -0500 Subject: [PATCH 003/131] %undefine _strict_symbol_defs_build --- xorg-x11-server.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 119ab79..eadbfa8 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -10,6 +10,7 @@ # X.org requires lazy relocations to work. %undefine _hardened_build +%undefine _strict_symbol_defs_build #global gitdate 20161026 %global stable_abi 1 From f3307b88b09c23aa41ca114eb5e4fdbb569aa046 Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Mon, 5 Feb 2018 11:40:28 +0100 Subject: [PATCH 004/131] Do not generate a core on Wayland socket issues Exit without a FatalError() on Wayland socket errors to avoid issues being filed against Xwayland for all Wayland compositor issues. --- ...-up-cleanly-on-Wayland-socket-errors.patch | 99 +++++++++++++++++++ xorg-x11-server.spec | 8 +- 2 files changed, 106 insertions(+), 1 deletion(-) create mode 100644 0001-xwayland-Give-up-cleanly-on-Wayland-socket-errors.patch diff --git a/0001-xwayland-Give-up-cleanly-on-Wayland-socket-errors.patch b/0001-xwayland-Give-up-cleanly-on-Wayland-socket-errors.patch new file mode 100644 index 0000000..5f2efe8 --- /dev/null +++ b/0001-xwayland-Give-up-cleanly-on-Wayland-socket-errors.patch @@ -0,0 +1,99 @@ +From fe46cbea0f19959d469ca4d1f09be379dc7b1e45 Mon Sep 17 00:00:00 2001 +From: Olivier Fourdan +Date: Tue, 21 Nov 2017 14:45:13 +0100 +Subject: [PATCH xserver] =?UTF-8?q?xwayland:=20Give=20up=20=E2=80=9Ccleanl?= + =?UTF-8?q?y=E2=80=9C=20on=20Wayland=20socket=20errors?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Xwayland is a pretty standard Wayland client, we want to be able to +capture core dumps on crashes. + +Yet using "-core" causes any FatalError() to generate a core dump, +meaning that we would get a core file for all Wayland server crashes, +which would generate a lot of false positives. + +Instead of using FatalError() on Wayland socket errors, give up cleanly +to avoid dumping core files when "-core" is used. + +See also: https://bugzilla.gnome.org/show_bug.cgi?id=790502 + and: https://bugzilla.gnome.org/show_bug.cgi?id=789086 + +Reviewed-by: Adam Jackson +Signed-off-by: Olivier Fourdan +--- + hw/xwayland/xwayland.c | 26 +++++++++++++++++++++----- + 1 file changed, 21 insertions(+), 5 deletions(-) + +diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c +index 638022180..c5a3ae7ae 100644 +--- a/hw/xwayland/xwayland.c ++++ b/hw/xwayland/xwayland.c +@@ -73,6 +73,22 @@ ddxBeforeReset(void) + } + #endif + ++ _X_NORETURN ++static void _X_ATTRIBUTE_PRINTF(1, 2) ++xwl_give_up(const char *f, ...) ++{ ++ va_list args; ++ ++ va_start(args, f); ++ VErrorFSigSafe(f, args); ++ va_end(args); ++ ++ CloseWellKnownConnections(); ++ OsCleanup(TRUE); ++ fflush(stderr); ++ exit(1); ++} ++ + void + ddxUseMsg(void) + { +@@ -719,13 +735,13 @@ xwl_read_events (struct xwl_screen *xwl_screen) + + ret = wl_display_read_events(xwl_screen->display); + if (ret == -1) +- FatalError("failed to read Wayland events: %s\n", strerror(errno)); ++ xwl_give_up("failed to read Wayland events: %s\n", strerror(errno)); + + xwl_screen->prepare_read = 0; + + ret = wl_display_dispatch_pending(xwl_screen->display); + if (ret == -1) +- FatalError("failed to dispatch Wayland events: %s\n", strerror(errno)); ++ xwl_give_up("failed to dispatch Wayland events: %s\n", strerror(errno)); + } + + static int +@@ -752,7 +768,7 @@ xwl_dispatch_events (struct xwl_screen *xwl_screen) + wl_display_prepare_read(xwl_screen->display) == -1) { + ret = wl_display_dispatch_pending(xwl_screen->display); + if (ret == -1) +- FatalError("failed to dispatch Wayland events: %s\n", ++ xwl_give_up("failed to dispatch Wayland events: %s\n", + strerror(errno)); + } + +@@ -761,13 +777,13 @@ xwl_dispatch_events (struct xwl_screen *xwl_screen) + pollout: + ready = xwl_display_pollout(xwl_screen, 5); + if (ready == -1 && errno != EINTR) +- FatalError("error polling on XWayland fd: %s\n", strerror(errno)); ++ xwl_give_up("error polling on XWayland fd: %s\n", strerror(errno)); + + if (ready > 0) + ret = wl_display_flush(xwl_screen->display); + + if (ret == -1 && errno != EAGAIN) +- FatalError("failed to write to XWayland fd: %s\n", strerror(errno)); ++ xwl_give_up("failed to write to XWayland fd: %s\n", strerror(errno)); + + xwl_screen->wait_flush = (ready == 0 || ready == -1 || ret == -1); + } +-- +2.14.3 + diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index eadbfa8..d58ea4a 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -46,7 +46,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.19.6 -Release: 2%{?gitdate:.%{gitdate}}%{dist} +Release: 3%{?gitdate:.%{gitdate}}%{dist} URL: http://www.x.org License: MIT Group: User Interface/X @@ -105,6 +105,9 @@ Patch9910: 0010-xwayland-Unconditionally-initialize-lists-in-init_ta.patch Patch9911: 0011-xwayland-Correct-off-by-one-error-in-tablet-button-n.patch Patch9912: 0012-xwayland-Implement-tablet_tool_wheel-for-scrolling.patch +# Upstream commit fe46cbe for Xwayland - Not in server-1.19-branch +Patch9950: 0001-xwayland-Give-up-cleanly-on-Wayland-socket-errors.patch + # From Debian use intel ddx driver only for gen4 and older chipsets %if 0%{?fedora} > 25 || 0%{?rhel} > 7 Patch20: 06_use-intel-only-on-pre-gen4.diff @@ -621,6 +624,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Tue Jan 30 2018 Olivier Fourdan 1.19.6-3 +- Avoid generating a core file when the Wayland compositor is gone. + * Thu Jan 11 2018 Peter Hutterer 1.19.6-2 - Fix handling of devices with ID_INPUT=null From bcdafa232ecf94daf3f575976a1937743d076d18 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 9 Feb 2018 21:59:07 +0000 Subject: [PATCH 005/131] - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- xorg-x11-server.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index d58ea4a..d642338 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -46,7 +46,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.19.6 -Release: 3%{?gitdate:.%{gitdate}}%{dist} +Release: 4%{?gitdate:.%{gitdate}}%{dist} URL: http://www.x.org License: MIT Group: User Interface/X @@ -624,6 +624,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Fri Feb 09 2018 Fedora Release Engineering - 1.19.6-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + * Tue Jan 30 2018 Olivier Fourdan 1.19.6-3 - Avoid generating a core file when the Wayland compositor is gone. From 9e2c567908b1be08fc8930ba0ae7d02301773cdd Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Tue, 13 Feb 2018 16:56:36 +0100 Subject: [PATCH 006/131] xwayland and xvfb-run fixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit xwayland: avoid race condition on new keymap xwayland: Keep separate variables for pointer and tablet foci xvfb-run: Add support for “ --auto-display” command line option --- ...parate-variables-for-pointer-and-tab.patch | 135 ++++++++++++++++++ ...d-avoid-race-condition-on-new-keymap.patch | 41 ++++++ xorg-x11-server.spec | 11 +- xvfb-run.sh | 31 ++-- 4 files changed, 209 insertions(+), 9 deletions(-) create mode 100644 0001-xwayland-Keep-separate-variables-for-pointer-and-tab.patch create mode 100644 0001-xwayland-avoid-race-condition-on-new-keymap.patch diff --git a/0001-xwayland-Keep-separate-variables-for-pointer-and-tab.patch b/0001-xwayland-Keep-separate-variables-for-pointer-and-tab.patch new file mode 100644 index 0000000..571fc93 --- /dev/null +++ b/0001-xwayland-Keep-separate-variables-for-pointer-and-tab.patch @@ -0,0 +1,135 @@ +From 60f4646ae10f0b57790fce46682baa531512b53e Mon Sep 17 00:00:00 2001 +From: Carlos Garnacho +Date: Mon, 4 Dec 2017 16:55:13 +0100 +Subject: [PATCH xserver] xwayland: Keep separate variables for pointer and + tablet foci + +The tablet/stylus interfaces reused xwl_seat->focus_window, which +would leave a somewhat inconsistent state of that variable for +wl_pointer purposes (basically, everything) if the pointer happened +to lay on the same surface than the stylus while proximity_out +happens. + +We just want the stylus xwl_window to correctly determine we have +stylus focus, and to correctly translate surface-local coordinates +to root coordinates, this can be done using a different variable. + +Signed-off-by: Carlos Garnacho +Acked-by: Jason Gerecke +Tested-by: Olivier Fourdan +--- + hw/xwayland/xwayland-input.c | 20 ++++++++++---------- + hw/xwayland/xwayland.c | 2 ++ + hw/xwayland/xwayland.h | 1 + + 3 files changed, 13 insertions(+), 10 deletions(-) + +diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c +index 68e365051..439903032 100644 +--- a/hw/xwayland/xwayland-input.c ++++ b/hw/xwayland/xwayland-input.c +@@ -1514,7 +1514,7 @@ tablet_tool_proximity_in(void *data, struct zwp_tablet_tool_v2 *tool, + return; + + xwl_tablet_tool->proximity_in_serial = serial; +- xwl_seat->focus_window = wl_surface_get_user_data(wl_surface); ++ xwl_seat->tablet_focus_window = wl_surface_get_user_data(wl_surface); + + xwl_tablet_tool_set_cursor(xwl_tablet_tool); + } +@@ -1526,7 +1526,7 @@ tablet_tool_proximity_out(void *data, struct zwp_tablet_tool_v2 *tool) + struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; + + xwl_tablet_tool->proximity_in_serial = 0; +- xwl_seat->focus_window = NULL; ++ xwl_seat->tablet_focus_window = NULL; + + xwl_tablet_tool->pressure = 0; + xwl_tablet_tool->tilt_x = 0; +@@ -1568,11 +1568,11 @@ tablet_tool_motion(void *data, struct zwp_tablet_tool_v2 *tool, + int sx = wl_fixed_to_int(x); + int sy = wl_fixed_to_int(y); + +- if (!xwl_seat->focus_window) ++ if (!xwl_seat->tablet_focus_window) + return; + +- dx = xwl_seat->focus_window->window->drawable.x; +- dy = xwl_seat->focus_window->window->drawable.y; ++ dx = xwl_seat->tablet_focus_window->window->drawable.x; ++ dy = xwl_seat->tablet_focus_window->window->drawable.y; + + xwl_tablet_tool->x = dx + sx; + xwl_tablet_tool->y = dy + sy; +@@ -1585,7 +1585,7 @@ tablet_tool_pressure(void *data, struct zwp_tablet_tool_v2 *tool, + struct xwl_tablet_tool *xwl_tablet_tool = data; + struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; + +- if (!xwl_seat->focus_window) ++ if (!xwl_seat->tablet_focus_window) + return; + + /* normalized to 65535 already */ +@@ -1605,7 +1605,7 @@ tablet_tool_tilt(void *data, struct zwp_tablet_tool_v2 *tool, + struct xwl_tablet_tool *xwl_tablet_tool = data; + struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; + +- if (!xwl_seat->focus_window) ++ if (!xwl_seat->tablet_focus_window) + return; + + xwl_tablet_tool->tilt_x = wl_fixed_to_double(tilt_x); +@@ -1620,7 +1620,7 @@ tablet_tool_rotation(void *data, struct zwp_tablet_tool_v2 *tool, + struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; + double rotation = wl_fixed_to_double(angle); + +- if (!xwl_seat->focus_window) ++ if (!xwl_seat->tablet_focus_window) + return; + + /* change origin (buttons facing right [libinput +90 degrees]) and +@@ -1639,7 +1639,7 @@ tablet_tool_slider(void *data, struct zwp_tablet_tool_v2 *tool, + struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; + float position = position_raw / 65535.0; + +- if (!xwl_seat->focus_window) ++ if (!xwl_seat->tablet_focus_window) + return; + + xwl_tablet_tool->slider = (position * 1799.0f) - 900.0f; +@@ -1652,7 +1652,7 @@ tablet_tool_wheel(void *data, struct zwp_tablet_tool_v2 *tool, + struct xwl_tablet_tool *xwl_tablet_tool = data; + struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; + +- if (!xwl_seat->focus_window) ++ if (!xwl_seat->tablet_focus_window) + return; + + xwl_tablet_tool->wheel_clicks = clicks; +diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c +index 79deead8d..638022180 100644 +--- a/hw/xwayland/xwayland.c ++++ b/hw/xwayland/xwayland.c +@@ -545,6 +545,8 @@ xwl_unrealize_window(WindowPtr window) + xorg_list_for_each_entry(xwl_seat, &xwl_screen->seat_list, link) { + if (xwl_seat->focus_window && xwl_seat->focus_window->window == window) + xwl_seat->focus_window = NULL; ++ if (xwl_seat->tablet_focus_window && xwl_seat->tablet_focus_window->window == window) ++ xwl_seat->tablet_focus_window = NULL; + if (xwl_seat->last_xwindow == window) + xwl_seat->last_xwindow = NullWindow; + if (xwl_seat->cursor_confinement_window && +diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h +index 3adee82fa..e6eb37bec 100644 +--- a/hw/xwayland/xwayland.h ++++ b/hw/xwayland/xwayland.h +@@ -154,6 +154,7 @@ struct xwl_seat { + struct zwp_tablet_seat_v2 *tablet_seat; + struct wl_array keys; + struct xwl_window *focus_window; ++ struct xwl_window *tablet_focus_window; + uint32_t id; + uint32_t pointer_enter_serial; + struct xorg_list link; +-- +2.14.3 + diff --git a/0001-xwayland-avoid-race-condition-on-new-keymap.patch b/0001-xwayland-avoid-race-condition-on-new-keymap.patch new file mode 100644 index 0000000..3acf65c --- /dev/null +++ b/0001-xwayland-avoid-race-condition-on-new-keymap.patch @@ -0,0 +1,41 @@ +From 170c95978530f6373bdf4488116902b273f3abf4 Mon Sep 17 00:00:00 2001 +From: Olivier Fourdan +Date: Fri, 15 Dec 2017 16:43:47 +0100 +Subject: [PATCH xserver] 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 +Reviewed-by: Peter Hutterer +Signed-off-by: Peter Hutterer +--- + 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 439903032..c613690cd 100644 +--- a/hw/xwayland/xwayland-input.c ++++ b/hw/xwayland/xwayland-input.c +@@ -710,7 +710,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.14.3 + diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index d642338..2169679 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -46,7 +46,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.19.6 -Release: 4%{?gitdate:.%{gitdate}}%{dist} +Release: 5%{?gitdate:.%{gitdate}}%{dist} URL: http://www.x.org License: MIT Group: User Interface/X @@ -107,6 +107,10 @@ Patch9912: 0012-xwayland-Implement-tablet_tool_wheel-for-scrolling.patch # Upstream commit fe46cbe for Xwayland - Not in server-1.19-branch Patch9950: 0001-xwayland-Give-up-cleanly-on-Wayland-socket-errors.patch +# Upstream commit 60f4646a for Xwayland - Not in xorg-server-1.19.6 +Patch9951: 0001-xwayland-Keep-separate-variables-for-pointer-and-tab.patch +# Upstream commit 16fd1847 for Xwayland - Not in xorg-server-1.19.6 +Patch9952: 0001-xwayland-avoid-race-condition-on-new-keymap.patch # From Debian use intel ddx driver only for gen4 and older chipsets %if 0%{?fedora} > 25 || 0%{?rhel} > 7 @@ -624,6 +628,11 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Tue Feb 13 2018 Olivier Fourdan 1.19.6-5 +- xwayland: avoid race condition on new keymap +- xwayland: Keep separate variables for pointer and tablet foci (rhbz#1519961) +- xvfb-run now support command line option “--auto-display” + * Fri Feb 09 2018 Fedora Release Engineering - 1.19.6-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild diff --git a/xvfb-run.sh b/xvfb-run.sh index de5fa39..473688c 100644 --- a/xvfb-run.sh +++ b/xvfb-run.sh @@ -64,7 +64,10 @@ Usage: $PROGNAME [OPTION ...] COMMAND Run COMMAND (usually an X client) in a virtual X server environment. Options: -a --auto-servernum try to get a free server number, starting at - --server-num + --server-num (deprecated, use --auto-display + instead) +-d --auto-display use the X server to find a display number + automatically -e FILE --error-file=FILE file used to store xauth errors and Xvfb output (default: $ERRORFILE) -f FILE --auth-file=FILE file used to store auth cookie @@ -97,7 +100,7 @@ find_free_servernum() { } # Parse the command line. -ARGS=$(getopt --options +ae:f:hn:lp:s:w: \ +ARGS=$(getopt --options +ade:f:hn:lp:s:w: \ --long auto-servernum,error-file:auth-file:,help,server-num:,listen-tcp,xauth-protocol:,server-args:,wait: \ --name "$PROGNAME" -- "$@") GETOPT_STATUS=$? @@ -112,6 +115,7 @@ eval set -- "$ARGS" while :; do case "$1" in -a|--auto-servernum) SERVERNUM=$(find_free_servernum) ;; + -d|--auto-display) AUTO_DISPLAY=1 ;; -e|--error-file) ERRORFILE="$2"; shift ;; -f|--auth-file) AUTHFILE="$2"; shift ;; -h|--help) SHOWHELP="yes" ;; @@ -138,28 +142,39 @@ if [ -z "$*" ]; then exit 2 fi -if ! type xauth >/dev/null; then +if ! which xauth >/dev/null; then error "xauth command not found" exit 3 fi +# Set up the temp dir for the pid and X authorization file +XVFB_RUN_TMPDIR="$(mktemp --directory --tmpdir $PROGNAME.XXXXXX)" # If the user did not specify an X authorization file to use, set up a temporary # directory to house one. if [ -z "$AUTHFILE" ]; then - XVFB_RUN_TMPDIR="$(mktemp --directory --tmpdir $PROGNAME.XXXXXX)" AUTHFILE=$(mktemp -p "$XVFB_RUN_TMPDIR" Xauthority.XXXXXX) fi # Start Xvfb. MCOOKIE=$(mcookie) +if [ -z "$AUTO_DISPLAY" ]; then + # Old style using a pre-computed SERVERNUM + XAUTHORITY=$AUTHFILE Xvfb ":$SERVERNUM" $XVFBARGS $LISTENTCP >>"$ERRORFILE" \ + 2>&1 & + XVFBPID=$! +else + # New style using Xvfb to provide a free display + PIDFILE=$(mktemp -p "$XVFB_RUN_TMPDIR" pid.XXXXXX) + SERVERNUM=$(XAUTHORITY=$AUTHFILE Xvfb -displayfd 1 $XVFBARGS $LISTENTCP \ + 2>"$ERRORFILE" & echo $! > $PIDFILE) + XVFBPID=$(cat $PIDFILE) +fi +sleep "$STARTWAIT" + XAUTHORITY=$AUTHFILE xauth source - << EOF >>"$ERRORFILE" 2>&1 add :$SERVERNUM $XAUTHPROTO $MCOOKIE EOF -XAUTHORITY=$AUTHFILE Xvfb ":$SERVERNUM" $XVFBARGS $LISTENTCP >>"$ERRORFILE" \ - 2>&1 & -XVFBPID=$! -sleep "$STARTWAIT" # Start the command and save its exit status. set +e From 120f876308f601b32a3b1185cddf455601194759 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Mon, 2 Apr 2018 16:56:07 -0400 Subject: [PATCH 007/131] xserver 1.20 RC3 --- ... => 0001-autobind-GPUs-to-the-screen.patch | 83 ++- ...value-detection-for-ID_INPUT-being-u.patch | 33 -- ..._gl-as-vdpau_driver-for-Intel-i965-G.patch | 158 ------ ...-devlist-returned-by-xf86MatchDevice.patch | 39 -- ...on-wayland-protocols-to-build-tablet.patch | 73 --- ...-up-cleanly-on-Wayland-socket-errors.patch | 99 ---- ...parate-variables-for-pointer-and-tab.patch | 135 ----- ...d-avoid-race-condition-on-new-keymap.patch | 41 -- ...putClassMatches-take-a-xf86_platform.patch | 45 -- ...-wp_tablet_manager-if-available-and-.patch | 166 ------ ...ions-support-for-OutputClass-Options.patch | 190 ------- ...and-Listen-for-wp_tablet_seat-events.patch | 173 ------ ...formProbe-split-finding-pci-info-and.patch | 61 --- 0004-xwayland-Handle-wp_tablet-events.patch | 211 -------- ...erriding-primary-GPU-detection-from-.patch | 91 ---- ...edundant-ServerIsNotSeat0-check-from.patch | 31 -- 0005-xwayland-Handle-tablet_tool-events.patch | 374 ------------- ...lePath-support-for-OutputClass-confi.patch | 183 ------- ...ing-unclaimed-devices-as-GPU-devices.patch | 89 --- ...le-button-events-after-motion-events.patch | 121 ----- ...der-to-find-atleast-1-non-GPU-Screen.patch | 122 ----- ...or-cursor-management-into-xwl_cursor.patch | 213 -------- ...-cursor-on-tablet-tools-in-proximity.patch | 208 ------- 0009-xwayland-add-tablet-pad-support.patch | 511 ------------------ ...tionally-initialize-lists-in-init_ta.patch | 74 --- ...-off-by-one-error-in-tablet-button-n.patch | 39 -- ...ment-tablet_tool_wheel-for-scrolling.patch | 78 --- sources | 2 +- xorg-x11-server.spec | 54 +- 29 files changed, 47 insertions(+), 3650 deletions(-) rename xserver-autobind-hotplug.patch => 0001-autobind-GPUs-to-the-screen.patch (84%) delete mode 100644 0001-config-fix-NULL-value-detection-for-ID_INPUT-being-u.patch delete mode 100644 0001-xf86-dri2-Use-va_gl-as-vdpau_driver-for-Intel-i965-G.patch delete mode 100644 0001-xfree86-Free-devlist-returned-by-xf86MatchDevice.patch delete mode 100644 0001-xwayland-Depend-on-wayland-protocols-to-build-tablet.patch delete mode 100644 0001-xwayland-Give-up-cleanly-on-Wayland-socket-errors.patch delete mode 100644 0001-xwayland-Keep-separate-variables-for-pointer-and-tab.patch delete mode 100644 0001-xwayland-avoid-race-condition-on-new-keymap.patch delete mode 100644 0002-xfree86-Make-OutputClassMatches-take-a-xf86_platform.patch delete mode 100644 0002-xwayland-Bind-to-wp_tablet_manager-if-available-and-.patch delete mode 100644 0003-xfree86-Add-options-support-for-OutputClass-Options.patch delete mode 100644 0003-xwayland-Listen-for-wp_tablet_seat-events.patch delete mode 100644 0004-xfree86-xf86platformProbe-split-finding-pci-info-and.patch delete mode 100644 0004-xwayland-Handle-wp_tablet-events.patch delete mode 100644 0005-xfree86-Allow-overriding-primary-GPU-detection-from-.patch delete mode 100644 0005-xfree86-Remove-redundant-ServerIsNotSeat0-check-from.patch delete mode 100644 0005-xwayland-Handle-tablet_tool-events.patch delete mode 100644 0006-xfree86-Add-ModulePath-support-for-OutputClass-confi.patch delete mode 100644 0006-xfree86-Make-adding-unclaimed-devices-as-GPU-devices.patch delete mode 100644 0006-xwayland-handle-button-events-after-motion-events.patch delete mode 100644 0007-xfree86-Try-harder-to-find-atleast-1-non-GPU-Screen.patch delete mode 100644 0007-xwayland-Refactor-cursor-management-into-xwl_cursor.patch delete mode 100644 0008-xwayland-update-cursor-on-tablet-tools-in-proximity.patch delete mode 100644 0009-xwayland-add-tablet-pad-support.patch delete mode 100644 0010-xwayland-Unconditionally-initialize-lists-in-init_ta.patch delete mode 100644 0011-xwayland-Correct-off-by-one-error-in-tablet-button-n.patch delete mode 100644 0012-xwayland-Implement-tablet_tool_wheel-for-scrolling.patch diff --git a/xserver-autobind-hotplug.patch b/0001-autobind-GPUs-to-the-screen.patch similarity index 84% rename from xserver-autobind-hotplug.patch rename to 0001-autobind-GPUs-to-the-screen.patch index 8025cbd..86b96a2 100644 --- a/xserver-autobind-hotplug.patch +++ b/0001-autobind-GPUs-to-the-screen.patch @@ -1,7 +1,7 @@ -From 4471df41ea6e94834a2b10643ca7fcd69682d276 Mon Sep 17 00:00:00 2001 +From 471289fa1dc359555ceed6302f7d9605ab6be3ea Mon Sep 17 00:00:00 2001 From: Dave Airlie -Date: Fri, 17 Aug 2012 09:49:24 +1000 -Subject: [PATCH xserver v3] autobind GPUs to the screen +Date: Mon, 2 Apr 2018 16:49:02 -0400 +Subject: [PATCH] autobind GPUs to the screen This is a modified version of a patch we've been carry-ing in Fedora and RHEL for years now. This patch automatically adds secondary GPUs to the @@ -34,15 +34,6 @@ xorg.conf snippet. Signed-off-by: Dave Airlie [hdegoede@redhat.com: Make configurable, fix with nvidia, submit upstream] Signed-off-by: Hans de Goede ---- -Changes in v2: --Make the default enabled instead of installing a xorg.conf - snippet which enables it unconditionally -Changes in v3: --Handle GPUScreen autoconfig in randr/rrprovider.c, looking at - rrScrPriv->provider, rather then in hw/xfree86/modes/xf86Crtc.c - looking at xf86CrtcConfig->provider. This fixes the autoconfig not - working with the nvidia binary driver --- hw/xfree86/common/xf86Config.c | 19 +++++++++++++++++++ hw/xfree86/common/xf86Globals.c | 2 ++ @@ -57,18 +48,18 @@ Changes in v3: 10 files changed, 85 insertions(+) diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c -index 21daf1a..df3ca50 100644 +index 2c1d335..d7d7c2e 100644 --- a/hw/xfree86/common/xf86Config.c +++ b/hw/xfree86/common/xf86Config.c -@@ -719,6 +719,7 @@ typedef enum { +@@ -643,6 +643,7 @@ typedef enum { FLAG_DRI2, FLAG_USE_SIGIO, FLAG_AUTO_ADD_GPU, + FLAG_AUTO_BIND_GPU, FLAG_MAX_CLIENTS, FLAG_IGLX, - } FlagValues; -@@ -778,6 +779,8 @@ static OptionInfoRec FlagOptions[] = { + FLAG_DEBUG, +@@ -699,6 +700,8 @@ static OptionInfoRec FlagOptions[] = { {0}, FALSE}, {FLAG_AUTO_ADD_GPU, "AutoAddGPU", OPTV_BOOLEAN, {0}, FALSE}, @@ -77,7 +68,7 @@ index 21daf1a..df3ca50 100644 {FLAG_MAX_CLIENTS, "MaxClients", OPTV_INTEGER, {0}, FALSE }, {FLAG_IGLX, "IndirectGLX", OPTV_BOOLEAN, -@@ -857,6 +860,22 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts) +@@ -779,6 +782,22 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts) } xf86Msg(from, "%sutomatically adding GPU devices\n", xf86Info.autoAddGPU ? "A" : "Not a"); @@ -101,10 +92,10 @@ index 21daf1a..df3ca50 100644 * Set things up based on the config file information. Some of these * settings may be overridden later when the command line options are diff --git a/hw/xfree86/common/xf86Globals.c b/hw/xfree86/common/xf86Globals.c -index e962b75..0d1e31b 100644 +index e890f05..7b27b4c 100644 --- a/hw/xfree86/common/xf86Globals.c +++ b/hw/xfree86/common/xf86Globals.c -@@ -136,6 +136,7 @@ xf86InfoRec xf86Info = { +@@ -131,6 +131,7 @@ xf86InfoRec xf86Info = { #else .autoAddGPU = FALSE, #endif @@ -112,7 +103,7 @@ index e962b75..0d1e31b 100644 }; const char *xf86ConfigFile = NULL; -@@ -197,6 +198,7 @@ Bool xf86FlipPixels = FALSE; +@@ -191,6 +192,7 @@ Bool xf86FlipPixels = FALSE; Gamma xf86Gamma = { 0.0, 0.0, 0.0 }; Bool xf86AllowMouseOpenFail = FALSE; @@ -121,7 +112,7 @@ index e962b75..0d1e31b 100644 #ifdef XF86VIDMODE Bool xf86VidModeDisabled = FALSE; diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c -index a544b65..b0cba3d 100644 +index ea42ec9..ec255b6 100644 --- a/hw/xfree86/common/xf86Init.c +++ b/hw/xfree86/common/xf86Init.c @@ -76,6 +76,7 @@ @@ -130,12 +121,13 @@ index a544b65..b0cba3d 100644 #include "xf86InPriv.h" +#include "xf86Crtc.h" #include "picturestr.h" - - #include "xf86Bus.h" -@@ -298,6 +299,19 @@ xf86PrivsElevated(void) + #include "randrstr.h" + #include "glxvndabi.h" +@@ -237,6 +238,19 @@ xf86PrivsElevated(void) + return PrivsElevated(); } - static void ++static void +xf86AutoConfigOutputDevices(void) +{ + int i; @@ -148,11 +140,10 @@ index a544b65..b0cba3d 100644 + xf86ScrnToScreen(xf86Screens[0])); +} + -+static void - InstallSignalHandlers(void) + static void + TrapSignals(void) { - /* -@@ -871,6 +885,8 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv) +@@ -770,6 +784,8 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv) for (i = 0; i < xf86NumGPUScreens; i++) AttachUnboundGPU(xf86Screens[0]->pScreen, xf86GPUScreens[i]->pScreen); @@ -161,7 +152,7 @@ index a544b65..b0cba3d 100644 xf86VGAarbiterWrapFunctions(); if (sigio_blocked) input_unlock(); -@@ -1389,6 +1405,10 @@ ddxProcessArgument(int argc, char **argv, int i) +@@ -1278,6 +1294,10 @@ ddxProcessArgument(int argc, char **argv, int i) xf86Info.iglxFrom = X_CMDLINE; return 0; } @@ -173,7 +164,7 @@ index a544b65..b0cba3d 100644 /* OS-specific processing */ return xf86ProcessArgument(argc, argv, i); diff --git a/hw/xfree86/common/xf86Priv.h b/hw/xfree86/common/xf86Priv.h -index c1f8a18..9a3d0df 100644 +index 4fe2b5f..6566622 100644 --- a/hw/xfree86/common/xf86Priv.h +++ b/hw/xfree86/common/xf86Priv.h @@ -46,6 +46,7 @@ @@ -185,22 +176,22 @@ index c1f8a18..9a3d0df 100644 #ifdef XF86VIDMODE extern _X_EXPORT Bool xf86VidModeDisabled; diff --git a/hw/xfree86/common/xf86Privstr.h b/hw/xfree86/common/xf86Privstr.h -index c29b3cc..4c5f54b 100644 +index 21c2e1f..6c71863 100644 --- a/hw/xfree86/common/xf86Privstr.h +++ b/hw/xfree86/common/xf86Privstr.h -@@ -102,6 +102,7 @@ typedef struct { - MessageType dri2From; +@@ -98,6 +98,7 @@ typedef struct { Bool autoAddGPU; + const char *debug; + Bool autoBindGPU; } xf86InfoRec, *xf86InfoPtr; - #ifdef DPMSExtension + /* ISC's cc can't handle ~ of UL constants, so explicitly type cast them. */ diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c -index 063e81c..42789ca 100644 +index cef47da..913a324 100644 --- a/hw/xfree86/common/xf86platformBus.c +++ b/hw/xfree86/common/xf86platformBus.c -@@ -48,6 +48,7 @@ +@@ -49,6 +49,7 @@ #include "Pci.h" #include "xf86platformBus.h" #include "xf86Config.h" @@ -208,7 +199,7 @@ index 063e81c..42789ca 100644 #include "randrstr.h" int platformSlotClaimed; -@@ -579,6 +580,9 @@ xf86platformAddDevice(int index) +@@ -665,6 +666,9 @@ xf86platformAddDevice(int index) } /* attach unbound to 0 protocol screen */ AttachUnboundGPU(xf86Screens[0]->pScreen, xf86GPUScreens[i]->pScreen); @@ -219,7 +210,7 @@ index 063e81c..42789ca 100644 RRResourcesChanged(xf86Screens[0]->pScreen); RRTellChanged(xf86Screens[0]->pScreen); diff --git a/hw/xfree86/man/Xorg.man b/hw/xfree86/man/Xorg.man -index def9bfc..8df6b7d 100644 +index 13a9dc3..745f986 100644 --- a/hw/xfree86/man/Xorg.man +++ b/hw/xfree86/man/Xorg.man @@ -283,6 +283,13 @@ is a comma separated list of directories to search for @@ -237,10 +228,10 @@ index def9bfc..8df6b7d 100644 Disable Silken Mouse support. .TP 8 diff --git a/hw/xfree86/man/xorg.conf.man b/hw/xfree86/man/xorg.conf.man -index 7d0c524..3e596e4 100644 +index 9589262..8d51e06 100644 --- a/hw/xfree86/man/xorg.conf.man +++ b/hw/xfree86/man/xorg.conf.man -@@ -673,6 +673,12 @@ Enabled by default. +@@ -672,6 +672,12 @@ Enabled by default. If this option is disabled, then no GPU devices will be added from the udev backend. Enabled by default. (May need to be disabled to setup Xinerama). .TP 7 @@ -254,10 +245,10 @@ index 7d0c524..3e596e4 100644 This option controls whether the log is flushed and/or synced to disk after each message. diff --git a/randr/randrstr.h b/randr/randrstr.h -index 706e9a7..66999d5 100644 +index f94174b..092d726 100644 --- a/randr/randrstr.h +++ b/randr/randrstr.h -@@ -976,6 +976,9 @@ RRProviderLookup(XID id, RRProviderPtr *provider_p); +@@ -1039,6 +1039,9 @@ RRProviderLookup(XID id, RRProviderPtr *provider_p); extern _X_EXPORT void RRDeliverProviderEvent(ClientPtr client, WindowPtr pWin, RRProviderPtr provider); @@ -268,10 +259,10 @@ index 706e9a7..66999d5 100644 extern _X_EXPORT void diff --git a/randr/rrprovider.c b/randr/rrprovider.c -index f9df67e..abc5685 100644 +index e4bc2bf..e04c18f 100644 --- a/randr/rrprovider.c +++ b/randr/rrprovider.c -@@ -482,3 +482,25 @@ RRDeliverProviderEvent(ClientPtr client, WindowPtr pWin, RRProviderPtr provider) +@@ -485,3 +485,25 @@ RRDeliverProviderEvent(ClientPtr client, WindowPtr pWin, RRProviderPtr provider) WriteEventsToClient(client, 1, (xEvent *) &pe); } @@ -298,5 +289,5 @@ index f9df67e..abc5685 100644 + pScrPriv->rrProviderSetOffloadSink(pScreen, provider, master_provider); +} -- -2.9.3 +2.16.2 diff --git a/0001-config-fix-NULL-value-detection-for-ID_INPUT-being-u.patch b/0001-config-fix-NULL-value-detection-for-ID_INPUT-being-u.patch deleted file mode 100644 index 15ba8e7..0000000 --- a/0001-config-fix-NULL-value-detection-for-ID_INPUT-being-u.patch +++ /dev/null @@ -1,33 +0,0 @@ -From a309323328d9d6e0bf5d9ea1d75920e53b9beef3 Mon Sep 17 00:00:00 2001 -From: Peter Hutterer -Date: Fri, 5 Jan 2018 11:58:42 +1000 -Subject: [PATCH xserver] 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 -Signed-off-by: Peter Hutterer ---- - config/udev.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/config/udev.c b/config/udev.c -index e198e8609..3a73189e2 100644 ---- a/config/udev.c -+++ b/config/udev.c -@@ -135,7 +135,7 @@ device_added(struct udev_device *udev_device) - #endif - - value = udev_device_get_property_value(udev_device, "ID_INPUT"); -- if (value && !strcmp(value, "0")) { -+ if (!value || !strcmp(value, "0")) { - LogMessageVerb(X_INFO, 10, - "config/udev: ignoring device %s without " - "property ID_INPUT set\n", path); --- -2.14.3 - diff --git a/0001-xf86-dri2-Use-va_gl-as-vdpau_driver-for-Intel-i965-G.patch b/0001-xf86-dri2-Use-va_gl-as-vdpau_driver-for-Intel-i965-G.patch deleted file mode 100644 index b0a44e4..0000000 --- a/0001-xf86-dri2-Use-va_gl-as-vdpau_driver-for-Intel-i965-G.patch +++ /dev/null @@ -1,158 +0,0 @@ -From 27043630ebb54fd1915c5d1814ab62079ca3eca9 Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Thu, 23 Mar 2017 12:54:07 +0100 -Subject: [PATCH xserver] xf86: dri2: Use va_gl as vdpau_driver for Intel i965 - GPUs - -The modesetting driver (which now often is used with Intel GPUs), -relies on dri2_probe_driver_name() to get the dri and vdpau driver -names, before this commit it would always assign the same name to -the 2 names. But the vdpau driver for i965 GPUs should be va_gl -(i915 does not support vdpau at all). - -This commit modifies the used lookup table and dri2_probe_driver_name() -to set the vdpau_driver to va_gl for i965 GPUs, it leaves the 2 -names the same for all other GPUs. - -Note this commit adds a FIXME comment for a memory leak in -dri2_probe_driver_name(), that leak was already present and fixing -it falls outside of the scope of this commit. - -BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1413733 -Cc: kwizart@gmail.com -Signed-off-by: Hans de Goede ---- - hw/xfree86/dri2/dri2.c | 36 +++++++++++++++++++---------- - hw/xfree86/dri2/pci_ids/pci_id_driver_map.h | 21 +++++++++-------- - 2 files changed, 35 insertions(+), 22 deletions(-) - -diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c -index 2165603..d0366746 100644 ---- a/hw/xfree86/dri2/dri2.c -+++ b/hw/xfree86/dri2/dri2.c -@@ -1437,14 +1437,19 @@ get_prime_id(void) - - #include "pci_ids/pci_id_driver_map.h" - --static char * --dri2_probe_driver_name(ScreenPtr pScreen, DRI2InfoPtr info) -+static void -+dri2_probe_driver_name(ScreenPtr pScreen, DRI2InfoPtr info, -+ const char **dri_driver_ret, -+ const char **vdpau_driver_ret) - { - ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); - EntityInfoPtr pEnt = xf86GetEntityInfo(pScrn->entityList[0]); - struct pci_device *pdev = NULL; - int i, j; - -+ *dri_driver_ret = NULL; -+ *vdpau_driver_ret = NULL; -+ - if (pEnt) - pdev = xf86GetPciInfoForEntity(pEnt->index); - -@@ -1454,30 +1459,37 @@ dri2_probe_driver_name(ScreenPtr pScreen, DRI2InfoPtr info) - */ - if (!pdev) { - drmVersionPtr version = drmGetVersion(info->fd); -- char *kernel_driver; - - if (!version) { - xf86DrvMsg(pScreen->myNum, X_ERROR, - "[DRI2] Couldn't drmGetVersion() on non-PCI device, " - "no driver name found.\n"); -- return NULL; -+ return; - } - -- kernel_driver = strndup(version->name, version->name_len); -+ /* FIXME this gets leaked */ -+ *dri_driver_ret = strndup(version->name, version->name_len); -+ *vdpau_driver_ret = *dri_driver_ret; - drmFreeVersion(version); -- return kernel_driver; -+ return; - } - - for (i = 0; driver_map[i].driver; i++) { - if (pdev->vendor_id != driver_map[i].vendor_id) - continue; - -- if (driver_map[i].num_chips_ids == -1) -- return strdup(driver_map[i].driver); -+ if (driver_map[i].num_chips_ids == -1) { -+ *dri_driver_ret = driver_map[i].driver; -+ *vdpau_driver_ret = driver_map[i].vdpau_driver; -+ return; -+ } - - for (j = 0; j < driver_map[i].num_chips_ids; j++) { -- if (driver_map[i].chip_ids[j] == pdev->device_id) -- return strdup(driver_map[i].driver); -+ if (driver_map[i].chip_ids[j] == pdev->device_id) { -+ *dri_driver_ret = driver_map[i].driver; -+ *vdpau_driver_ret = driver_map[i].vdpau_driver; -+ return; -+ } - } - } - -@@ -1485,7 +1497,6 @@ dri2_probe_driver_name(ScreenPtr pScreen, DRI2InfoPtr info) - "[DRI2] No driver mapping found for PCI device " - "0x%04x / 0x%04x\n", - pdev->vendor_id, pdev->device_id); -- return NULL; - } - - Bool -@@ -1606,7 +1617,8 @@ DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info) - if (info->driverName) { - ds->driverNames[0] = info->driverName; - } else { -- ds->driverNames[0] = ds->driverNames[1] = dri2_probe_driver_name(pScreen, info); -+ dri2_probe_driver_name(pScreen, info, -+ &ds->driverNames[0], &ds->driverNames[1]); - if (!ds->driverNames[0]) - return FALSE; - } -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 da7ea1c..7036d10 100644 ---- a/hw/xfree86/dri2/pci_ids/pci_id_driver_map.h -+++ b/hw/xfree86/dri2/pci_ids/pci_id_driver_map.h -@@ -66,21 +66,22 @@ static const int vmwgfx_chip_ids[] = { - static const struct { - int vendor_id; - const char *driver; -+ const char *vdpau_driver; - const int *chip_ids; - int num_chips_ids; - } driver_map[] = { -- { 0x8086, "i915", i915_chip_ids, ARRAY_SIZE(i915_chip_ids) }, -- { 0x8086, "i965", i965_chip_ids, ARRAY_SIZE(i965_chip_ids) }, -+ { 0x8086, "i915", "i915", i915_chip_ids, ARRAY_SIZE(i915_chip_ids) }, -+ { 0x8086, "i965", "va_gl", i965_chip_ids, ARRAY_SIZE(i965_chip_ids) }, - #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) }, -+ { 0x1002, "radeon", "radeon", r100_chip_ids, ARRAY_SIZE(r100_chip_ids) }, -+ { 0x1002, "r200", "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) }, -- { 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) }, -+ { 0x1002, "r300", "r300", r300_chip_ids, ARRAY_SIZE(r300_chip_ids) }, -+ { 0x1002, "r600","r600", r600_chip_ids, ARRAY_SIZE(r600_chip_ids) }, -+ { 0x1002, "radeonsi", "radeonsi", radeonsi_chip_ids, ARRAY_SIZE(radeonsi_chip_ids) }, -+ { 0x10de, "nouveau", "nouveau", NULL, -1 }, -+ { 0x1af4, "virtio_gpu", "virtio_gpu", virtio_gpu_chip_ids, ARRAY_SIZE(virtio_gpu_chip_ids) }, -+ { 0x15ad, "vmwgfx", "vmwgfx", vmwgfx_chip_ids, ARRAY_SIZE(vmwgfx_chip_ids) }, - { 0x0000, NULL, NULL, 0 }, - }; - --- -2.9.3 - diff --git a/0001-xfree86-Free-devlist-returned-by-xf86MatchDevice.patch b/0001-xfree86-Free-devlist-returned-by-xf86MatchDevice.patch deleted file mode 100644 index 36a3730..0000000 --- a/0001-xfree86-Free-devlist-returned-by-xf86MatchDevice.patch +++ /dev/null @@ -1,39 +0,0 @@ -From c57c1e53ea3d76ebba5b2a23b7260817d3e6b921 Mon Sep 17 00:00:00 2001 -From: Hans De Goede -Date: Mon, 12 Dec 2016 17:03:12 +0100 -Subject: [PATCH xserver 1/6] xfree86: Free devlist returned by xf86MatchDevice - -xf86MatchDevice returns a dynamically allocated list of GDevPtr-s, -free this when we're done with it. - -Reviewed-by: Adam Jackson -Signed-off-by: Hans de Goede ---- - hw/xfree86/common/xf86platformBus.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c -index 063e81c..16d934f 100644 ---- a/hw/xfree86/common/xf86platformBus.c -+++ b/hw/xfree86/common/xf86platformBus.c -@@ -479,6 +479,8 @@ xf86platformProbeDev(DriverPtr drvp) - isGPUDevice(devList[i]) ? PLATFORM_PROBE_GPU_SCREEN : 0); - } - -+ free(devList); -+ - return foundScreen; - } - -@@ -505,6 +507,8 @@ xf86platformAddGPUDevices(DriverPtr drvp) - } - } - -+ free(devList); -+ - return foundScreen; - } - --- -2.9.3 - diff --git a/0001-xwayland-Depend-on-wayland-protocols-to-build-tablet.patch b/0001-xwayland-Depend-on-wayland-protocols-to-build-tablet.patch deleted file mode 100644 index e16b405..0000000 --- a/0001-xwayland-Depend-on-wayland-protocols-to-build-tablet.patch +++ /dev/null @@ -1,73 +0,0 @@ -From 7f22271ca7ace43f6fa1168a2acea9af6f2d5896 Mon Sep 17 00:00:00 2001 -From: Jason Gerecke -Date: Thu, 13 Oct 2016 10:39:46 -0700 -Subject: [PATCH xserver 01/12] xwayland: Depend on wayland-protocols to build - tablet protocol headers - -Signed-off-by: Jason Gerecke -Signed-off-by: Carlos Garnacho -Reviewed-by: Peter Hutterer -Signed-off-by: Peter Hutterer -Acked-by: Ping Cheng -(cherry picked from commit 89c841915ac4fba6d2a5ad0051c778f1a76ffbf3) ---- - configure.ac | 2 +- - hw/xwayland/Makefile.am | 9 ++++++++- - hw/xwayland/xwayland-input.c | 1 + - 3 files changed, 10 insertions(+), 2 deletions(-) - -diff --git a/configure.ac b/configure.ac -index e6c5b35de..d34e10538 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -2503,7 +2503,7 @@ AM_CONDITIONAL(XFAKESERVER, [test "x$KDRIVE" = xyes && test "x$XFAKE" = xyes]) - - dnl Xwayland DDX - --XWAYLANDMODULES="wayland-client >= 1.3.0 wayland-protocols >= 1.1 $LIBDRM epoxy" -+XWAYLANDMODULES="wayland-client >= 1.3.0 wayland-protocols >= 1.5 $LIBDRM epoxy" - if test "x$XF86VIDMODE" = xyes; then - XWAYLANDMODULES="$XWAYLANDMODULES $VIDMODEPROTO" - fi -diff --git a/hw/xwayland/Makefile.am b/hw/xwayland/Makefile.am -index a3c9fce48..e376f09dd 100644 ---- a/hw/xwayland/Makefile.am -+++ b/hw/xwayland/Makefile.am -@@ -56,7 +56,9 @@ Xwayland_built_sources += \ - relative-pointer-unstable-v1-client-protocol.h \ - relative-pointer-unstable-v1-protocol.c \ - pointer-constraints-unstable-v1-client-protocol.h \ -- pointer-constraints-unstable-v1-protocol.c -+ pointer-constraints-unstable-v1-protocol.c \ -+ tablet-unstable-v2-client-protocol.h \ -+ tablet-unstable-v2-protocol.c - - nodist_Xwayland_SOURCES = $(Xwayland_built_sources) - CLEANFILES = $(Xwayland_built_sources) -@@ -79,6 +81,11 @@ pointer-constraints-unstable-v1-protocol.c : $(WAYLAND_PROTOCOLS_DATADIR)/unstab - pointer-constraints-unstable-v1-client-protocol.h : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml - $(AM_V_GEN)$(WAYLAND_SCANNER) client-header < $< > $@ - -+tablet-unstable-v2-protocol.c: $(WAYLAND_PROTOCOLS_DATADIR)/unstable/tablet/tablet-unstable-v2.xml -+ $(AM_V_GEN)$(WAYLAND_SCANNER) code < $< > $@ -+tablet-unstable-v2-client-protocol.h: $(WAYLAND_PROTOCOLS_DATADIR)/unstable/tablet/tablet-unstable-v2.xml -+ $(AM_V_GEN)$(WAYLAND_SCANNER) client-header < $< > $@ -+ - %-protocol.c : %.xml - $(AM_V_GEN)$(WAYLAND_SCANNER) code < $< > $@ - -diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c -index f2564d5d3..8fdc875ea 100644 ---- a/hw/xwayland/xwayland-input.c -+++ b/hw/xwayland/xwayland-input.c -@@ -34,6 +34,7 @@ - #include - #include - #include -+#include "tablet-unstable-v2-client-protocol.h" - - /* Copied from mipointer.c */ - #define MIPOINTER(dev) \ --- -2.13.5 - diff --git a/0001-xwayland-Give-up-cleanly-on-Wayland-socket-errors.patch b/0001-xwayland-Give-up-cleanly-on-Wayland-socket-errors.patch deleted file mode 100644 index 5f2efe8..0000000 --- a/0001-xwayland-Give-up-cleanly-on-Wayland-socket-errors.patch +++ /dev/null @@ -1,99 +0,0 @@ -From fe46cbea0f19959d469ca4d1f09be379dc7b1e45 Mon Sep 17 00:00:00 2001 -From: Olivier Fourdan -Date: Tue, 21 Nov 2017 14:45:13 +0100 -Subject: [PATCH xserver] =?UTF-8?q?xwayland:=20Give=20up=20=E2=80=9Ccleanl?= - =?UTF-8?q?y=E2=80=9C=20on=20Wayland=20socket=20errors?= -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Xwayland is a pretty standard Wayland client, we want to be able to -capture core dumps on crashes. - -Yet using "-core" causes any FatalError() to generate a core dump, -meaning that we would get a core file for all Wayland server crashes, -which would generate a lot of false positives. - -Instead of using FatalError() on Wayland socket errors, give up cleanly -to avoid dumping core files when "-core" is used. - -See also: https://bugzilla.gnome.org/show_bug.cgi?id=790502 - and: https://bugzilla.gnome.org/show_bug.cgi?id=789086 - -Reviewed-by: Adam Jackson -Signed-off-by: Olivier Fourdan ---- - hw/xwayland/xwayland.c | 26 +++++++++++++++++++++----- - 1 file changed, 21 insertions(+), 5 deletions(-) - -diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index 638022180..c5a3ae7ae 100644 ---- a/hw/xwayland/xwayland.c -+++ b/hw/xwayland/xwayland.c -@@ -73,6 +73,22 @@ ddxBeforeReset(void) - } - #endif - -+ _X_NORETURN -+static void _X_ATTRIBUTE_PRINTF(1, 2) -+xwl_give_up(const char *f, ...) -+{ -+ va_list args; -+ -+ va_start(args, f); -+ VErrorFSigSafe(f, args); -+ va_end(args); -+ -+ CloseWellKnownConnections(); -+ OsCleanup(TRUE); -+ fflush(stderr); -+ exit(1); -+} -+ - void - ddxUseMsg(void) - { -@@ -719,13 +735,13 @@ xwl_read_events (struct xwl_screen *xwl_screen) - - ret = wl_display_read_events(xwl_screen->display); - if (ret == -1) -- FatalError("failed to read Wayland events: %s\n", strerror(errno)); -+ xwl_give_up("failed to read Wayland events: %s\n", strerror(errno)); - - xwl_screen->prepare_read = 0; - - ret = wl_display_dispatch_pending(xwl_screen->display); - if (ret == -1) -- FatalError("failed to dispatch Wayland events: %s\n", strerror(errno)); -+ xwl_give_up("failed to dispatch Wayland events: %s\n", strerror(errno)); - } - - static int -@@ -752,7 +768,7 @@ xwl_dispatch_events (struct xwl_screen *xwl_screen) - wl_display_prepare_read(xwl_screen->display) == -1) { - ret = wl_display_dispatch_pending(xwl_screen->display); - if (ret == -1) -- FatalError("failed to dispatch Wayland events: %s\n", -+ xwl_give_up("failed to dispatch Wayland events: %s\n", - strerror(errno)); - } - -@@ -761,13 +777,13 @@ xwl_dispatch_events (struct xwl_screen *xwl_screen) - pollout: - ready = xwl_display_pollout(xwl_screen, 5); - if (ready == -1 && errno != EINTR) -- FatalError("error polling on XWayland fd: %s\n", strerror(errno)); -+ xwl_give_up("error polling on XWayland fd: %s\n", strerror(errno)); - - if (ready > 0) - ret = wl_display_flush(xwl_screen->display); - - if (ret == -1 && errno != EAGAIN) -- FatalError("failed to write to XWayland fd: %s\n", strerror(errno)); -+ xwl_give_up("failed to write to XWayland fd: %s\n", strerror(errno)); - - xwl_screen->wait_flush = (ready == 0 || ready == -1 || ret == -1); - } --- -2.14.3 - diff --git a/0001-xwayland-Keep-separate-variables-for-pointer-and-tab.patch b/0001-xwayland-Keep-separate-variables-for-pointer-and-tab.patch deleted file mode 100644 index 571fc93..0000000 --- a/0001-xwayland-Keep-separate-variables-for-pointer-and-tab.patch +++ /dev/null @@ -1,135 +0,0 @@ -From 60f4646ae10f0b57790fce46682baa531512b53e Mon Sep 17 00:00:00 2001 -From: Carlos Garnacho -Date: Mon, 4 Dec 2017 16:55:13 +0100 -Subject: [PATCH xserver] xwayland: Keep separate variables for pointer and - tablet foci - -The tablet/stylus interfaces reused xwl_seat->focus_window, which -would leave a somewhat inconsistent state of that variable for -wl_pointer purposes (basically, everything) if the pointer happened -to lay on the same surface than the stylus while proximity_out -happens. - -We just want the stylus xwl_window to correctly determine we have -stylus focus, and to correctly translate surface-local coordinates -to root coordinates, this can be done using a different variable. - -Signed-off-by: Carlos Garnacho -Acked-by: Jason Gerecke -Tested-by: Olivier Fourdan ---- - hw/xwayland/xwayland-input.c | 20 ++++++++++---------- - hw/xwayland/xwayland.c | 2 ++ - hw/xwayland/xwayland.h | 1 + - 3 files changed, 13 insertions(+), 10 deletions(-) - -diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c -index 68e365051..439903032 100644 ---- a/hw/xwayland/xwayland-input.c -+++ b/hw/xwayland/xwayland-input.c -@@ -1514,7 +1514,7 @@ tablet_tool_proximity_in(void *data, struct zwp_tablet_tool_v2 *tool, - return; - - xwl_tablet_tool->proximity_in_serial = serial; -- xwl_seat->focus_window = wl_surface_get_user_data(wl_surface); -+ xwl_seat->tablet_focus_window = wl_surface_get_user_data(wl_surface); - - xwl_tablet_tool_set_cursor(xwl_tablet_tool); - } -@@ -1526,7 +1526,7 @@ tablet_tool_proximity_out(void *data, struct zwp_tablet_tool_v2 *tool) - struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; - - xwl_tablet_tool->proximity_in_serial = 0; -- xwl_seat->focus_window = NULL; -+ xwl_seat->tablet_focus_window = NULL; - - xwl_tablet_tool->pressure = 0; - xwl_tablet_tool->tilt_x = 0; -@@ -1568,11 +1568,11 @@ tablet_tool_motion(void *data, struct zwp_tablet_tool_v2 *tool, - int sx = wl_fixed_to_int(x); - int sy = wl_fixed_to_int(y); - -- if (!xwl_seat->focus_window) -+ if (!xwl_seat->tablet_focus_window) - return; - -- dx = xwl_seat->focus_window->window->drawable.x; -- dy = xwl_seat->focus_window->window->drawable.y; -+ dx = xwl_seat->tablet_focus_window->window->drawable.x; -+ dy = xwl_seat->tablet_focus_window->window->drawable.y; - - xwl_tablet_tool->x = dx + sx; - xwl_tablet_tool->y = dy + sy; -@@ -1585,7 +1585,7 @@ tablet_tool_pressure(void *data, struct zwp_tablet_tool_v2 *tool, - struct xwl_tablet_tool *xwl_tablet_tool = data; - struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; - -- if (!xwl_seat->focus_window) -+ if (!xwl_seat->tablet_focus_window) - return; - - /* normalized to 65535 already */ -@@ -1605,7 +1605,7 @@ tablet_tool_tilt(void *data, struct zwp_tablet_tool_v2 *tool, - struct xwl_tablet_tool *xwl_tablet_tool = data; - struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; - -- if (!xwl_seat->focus_window) -+ if (!xwl_seat->tablet_focus_window) - return; - - xwl_tablet_tool->tilt_x = wl_fixed_to_double(tilt_x); -@@ -1620,7 +1620,7 @@ tablet_tool_rotation(void *data, struct zwp_tablet_tool_v2 *tool, - struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; - double rotation = wl_fixed_to_double(angle); - -- if (!xwl_seat->focus_window) -+ if (!xwl_seat->tablet_focus_window) - return; - - /* change origin (buttons facing right [libinput +90 degrees]) and -@@ -1639,7 +1639,7 @@ tablet_tool_slider(void *data, struct zwp_tablet_tool_v2 *tool, - struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; - float position = position_raw / 65535.0; - -- if (!xwl_seat->focus_window) -+ if (!xwl_seat->tablet_focus_window) - return; - - xwl_tablet_tool->slider = (position * 1799.0f) - 900.0f; -@@ -1652,7 +1652,7 @@ tablet_tool_wheel(void *data, struct zwp_tablet_tool_v2 *tool, - struct xwl_tablet_tool *xwl_tablet_tool = data; - struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; - -- if (!xwl_seat->focus_window) -+ if (!xwl_seat->tablet_focus_window) - return; - - xwl_tablet_tool->wheel_clicks = clicks; -diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index 79deead8d..638022180 100644 ---- a/hw/xwayland/xwayland.c -+++ b/hw/xwayland/xwayland.c -@@ -545,6 +545,8 @@ xwl_unrealize_window(WindowPtr window) - xorg_list_for_each_entry(xwl_seat, &xwl_screen->seat_list, link) { - if (xwl_seat->focus_window && xwl_seat->focus_window->window == window) - xwl_seat->focus_window = NULL; -+ if (xwl_seat->tablet_focus_window && xwl_seat->tablet_focus_window->window == window) -+ xwl_seat->tablet_focus_window = NULL; - if (xwl_seat->last_xwindow == window) - xwl_seat->last_xwindow = NullWindow; - if (xwl_seat->cursor_confinement_window && -diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h -index 3adee82fa..e6eb37bec 100644 ---- a/hw/xwayland/xwayland.h -+++ b/hw/xwayland/xwayland.h -@@ -154,6 +154,7 @@ struct xwl_seat { - struct zwp_tablet_seat_v2 *tablet_seat; - struct wl_array keys; - struct xwl_window *focus_window; -+ struct xwl_window *tablet_focus_window; - uint32_t id; - uint32_t pointer_enter_serial; - struct xorg_list link; --- -2.14.3 - diff --git a/0001-xwayland-avoid-race-condition-on-new-keymap.patch b/0001-xwayland-avoid-race-condition-on-new-keymap.patch deleted file mode 100644 index 3acf65c..0000000 --- a/0001-xwayland-avoid-race-condition-on-new-keymap.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 170c95978530f6373bdf4488116902b273f3abf4 Mon Sep 17 00:00:00 2001 -From: Olivier Fourdan -Date: Fri, 15 Dec 2017 16:43:47 +0100 -Subject: [PATCH xserver] 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 -Reviewed-by: Peter Hutterer -Signed-off-by: Peter Hutterer ---- - 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 439903032..c613690cd 100644 ---- a/hw/xwayland/xwayland-input.c -+++ b/hw/xwayland/xwayland-input.c -@@ -710,7 +710,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.14.3 - diff --git a/0002-xfree86-Make-OutputClassMatches-take-a-xf86_platform.patch b/0002-xfree86-Make-OutputClassMatches-take-a-xf86_platform.patch deleted file mode 100644 index 89ce17c..0000000 --- a/0002-xfree86-Make-OutputClassMatches-take-a-xf86_platform.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 08b84d72878e43401e99059c3c926dfa42a360c3 Mon Sep 17 00:00:00 2001 -From: Hans De Goede -Date: Mon, 12 Dec 2016 17:03:13 +0100 -Subject: [PATCH xserver 2/6] xfree86: Make OutputClassMatches take a - xf86_platform_device - -Make OutputClassMatches directly take a xf86_platform_device as argument, -rather then an index into xf86_platform_devices. This makes things -easier for callers which already have a xf86_platform_device pointer. - -Reviewed-by: Adam Jackson -Signed-off-by: Hans de Goede ---- - hw/xfree86/common/xf86platformBus.c | 7 ++++--- - 1 file changed, 4 insertions(+), 3 deletions(-) - -diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c -index 16d934f..25a9040 100644 ---- a/hw/xfree86/common/xf86platformBus.c -+++ b/hw/xfree86/common/xf86platformBus.c -@@ -214,9 +214,10 @@ MatchToken(const char *value, struct xorg_list *patterns, - } - - static Bool --OutputClassMatches(const XF86ConfOutputClassPtr oclass, int index) -+OutputClassMatches(const XF86ConfOutputClassPtr oclass, -+ struct xf86_platform_device *dev) - { -- char *driver = xf86_platform_odev_attributes(index)->driver; -+ char *driver = dev->attribs->driver; - - if (!MatchToken(driver, &oclass->match_driver, strcmp)) - return FALSE; -@@ -234,7 +235,7 @@ xf86OutputClassDriverList(int index, char *matches[], int nmatches) - return 0; - - for (cl = xf86configptr->conf_outputclass_lst; cl; cl = cl->list.next) { -- if (OutputClassMatches(cl, index)) { -+ if (OutputClassMatches(cl, &xf86_platform_devices[index])) { - char *path = xf86_platform_odev_attributes(index)->path; - - xf86Msg(X_INFO, "Applying OutputClass \"%s\" to %s\n", --- -2.9.3 - diff --git a/0002-xwayland-Bind-to-wp_tablet_manager-if-available-and-.patch b/0002-xwayland-Bind-to-wp_tablet_manager-if-available-and-.patch deleted file mode 100644 index 9e750cb..0000000 --- a/0002-xwayland-Bind-to-wp_tablet_manager-if-available-and-.patch +++ /dev/null @@ -1,166 +0,0 @@ -From 8dcc03fb4a5db18fb52377ee578a2a673d691a1e Mon Sep 17 00:00:00 2001 -From: Jason Gerecke -Date: Fri, 15 Jan 2016 17:29:37 -0800 -Subject: [PATCH xserver 02/12] xwayland: Bind to wp_tablet_manager if - available and get its seats - -If we're notified about the existence of the wp_tablet_manager interface, -we bind to it so that we can make use of any tablets that are (or later -become) available. For each seat that exists or comes into existance at -a later point, obtain the associated tablet_seat. - -Signed-off-by: Jason Gerecke -Signed-off-by: Carlos Garnacho -Reviewed-by: Peter Hutterer -Signed-off-by: Peter Hutterer -Acked-by: Ping Cheng -(cherry picked from commit 7d48b758a601ce0252ebd21297a7c42263adfaaf) ---- - hw/xwayland/xwayland-input.c | 59 ++++++++++++++++++++++++++++++++++++++++++++ - hw/xwayland/xwayland.c | 2 ++ - hw/xwayland/xwayland.h | 4 +++ - 3 files changed, 65 insertions(+) - -diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c -index 8fdc875ea..1d2be978e 100644 ---- a/hw/xwayland/xwayland-input.c -+++ b/hw/xwayland/xwayland-input.c -@@ -63,6 +63,12 @@ static void - xwl_seat_destroy_confined_pointer(struct xwl_seat *xwl_seat); - - static void -+init_tablet_manager_seat(struct xwl_screen *xwl_screen, -+ struct xwl_seat *xwl_seat); -+static void -+release_tablet_manager_seat(struct xwl_seat *xwl_seat); -+ -+static void - xwl_pointer_control(DeviceIntPtr device, PtrCtrl *ctrl) - { - /* Nothing to do, dix handles all settings */ -@@ -1147,6 +1153,9 @@ create_input_device(struct xwl_screen *xwl_screen, uint32_t id, uint32_t version - - xwl_seat->cursor = wl_compositor_create_surface(xwl_screen->compositor); - wl_seat_add_listener(xwl_seat->seat, &seat_listener, xwl_seat); -+ -+ init_tablet_manager_seat(xwl_screen, xwl_seat); -+ - wl_array_init(&xwl_seat->keys); - - xorg_list_init(&xwl_seat->touches); -@@ -1170,6 +1179,8 @@ xwl_seat_destroy(struct xwl_seat *xwl_seat) - free (p); - } - -+ release_tablet_manager_seat(xwl_seat); -+ - wl_seat_destroy(xwl_seat->seat); - wl_surface_destroy(xwl_seat->cursor); - if (xwl_seat->cursor_frame_cb) -@@ -1178,6 +1189,52 @@ xwl_seat_destroy(struct xwl_seat *xwl_seat) - free(xwl_seat); - } - -+ -+static void -+init_tablet_manager_seat(struct xwl_screen *xwl_screen, -+ struct xwl_seat *xwl_seat) -+{ -+ if (!xwl_screen->tablet_manager) -+ return; -+ -+ xwl_seat->tablet_seat = -+ zwp_tablet_manager_v2_get_tablet_seat(xwl_screen->tablet_manager, -+ xwl_seat->seat); -+} -+ -+static void -+release_tablet_manager_seat(struct xwl_seat *xwl_seat) -+{ -+ if (xwl_seat->tablet_seat) { -+ zwp_tablet_seat_v2_destroy(xwl_seat->tablet_seat); -+ xwl_seat->tablet_seat = NULL; -+ } -+} -+ -+static void -+init_tablet_manager(struct xwl_screen *xwl_screen, uint32_t id, uint32_t version) -+{ -+ struct xwl_seat *xwl_seat; -+ -+ xwl_screen->tablet_manager = wl_registry_bind(xwl_screen->registry, -+ id, -+ &zwp_tablet_manager_v2_interface, -+ min(version,1)); -+ -+ xorg_list_for_each_entry(xwl_seat, &xwl_screen->seat_list, link) { -+ init_tablet_manager_seat(xwl_screen, xwl_seat); -+ } -+} -+ -+void -+xwl_screen_release_tablet_manager(struct xwl_screen *xwl_screen) -+{ -+ if (xwl_screen->tablet_manager) { -+ zwp_tablet_manager_v2_destroy(xwl_screen->tablet_manager); -+ xwl_screen->tablet_manager = NULL; -+ } -+} -+ - static void - init_relative_pointer_manager(struct xwl_screen *xwl_screen, - uint32_t id, uint32_t version) -@@ -1211,6 +1268,8 @@ input_handler(void *data, struct wl_registry *registry, uint32_t id, - init_relative_pointer_manager(xwl_screen, id, version); - } else if (strcmp(interface, "zwp_pointer_constraints_v1") == 0) { - init_pointer_constraints(xwl_screen, id, version); -+ } else if (strcmp(interface, "zwp_tablet_manager_v2") == 0) { -+ init_tablet_manager(xwl_screen, id, version); - } - } - -diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index 939f3392c..fa7b81c7a 100644 ---- a/hw/xwayland/xwayland.c -+++ b/hw/xwayland/xwayland.c -@@ -130,6 +130,8 @@ xwl_close_screen(ScreenPtr screen) - &xwl_screen->seat_list, link) - xwl_seat_destroy(xwl_seat); - -+ xwl_screen_release_tablet_manager(xwl_screen); -+ - RemoveNotifyFd(xwl_screen->wayland_fd); - - wl_display_disconnect(xwl_screen->display); -diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h -index 5e5624be0..2752d731c 100644 ---- a/hw/xwayland/xwayland.h -+++ b/hw/xwayland/xwayland.h -@@ -76,6 +76,7 @@ struct xwl_screen { - struct wl_registry *registry; - struct wl_registry *input_registry; - struct wl_compositor *compositor; -+ struct zwp_tablet_manager_v2 *tablet_manager; - struct wl_shm *shm; - struct wl_shell *shell; - struct zwp_relative_pointer_manager_v1 *relative_pointer_manager; -@@ -137,6 +138,7 @@ struct xwl_seat { - struct zwp_relative_pointer_v1 *wp_relative_pointer; - struct wl_keyboard *wl_keyboard; - struct wl_touch *wl_touch; -+ struct zwp_tablet_seat_v2 *tablet_seat; - struct wl_array keys; - struct xwl_window *focus_window; - uint32_t id; -@@ -241,6 +243,8 @@ Bool xwl_screen_init_glamor(struct xwl_screen *xwl_screen, - uint32_t id, uint32_t version); - struct wl_buffer *xwl_glamor_pixmap_get_wl_buffer(PixmapPtr pixmap); - -+void xwl_screen_release_tablet_manager(struct xwl_screen *xwl_screen); -+ - #ifdef XV - /* glamor Xv Adaptor */ - Bool xwl_glamor_xv_init(ScreenPtr pScreen); --- -2.13.5 - diff --git a/0003-xfree86-Add-options-support-for-OutputClass-Options.patch b/0003-xfree86-Add-options-support-for-OutputClass-Options.patch deleted file mode 100644 index b18f9b9..0000000 --- a/0003-xfree86-Add-options-support-for-OutputClass-Options.patch +++ /dev/null @@ -1,190 +0,0 @@ -From 9cd3cc75269d9196898487b5712ee47b8291e077 Mon Sep 17 00:00:00 2001 -From: Hans De Goede -Date: Mon, 12 Dec 2016 17:03:14 +0100 -Subject: [PATCH xserver 3/6] xfree86: Add options support for OutputClass - Options - -Add support for setting options in OutputClass Sections and having these -applied to any matching output devices. - -Reviewed-by: Adam Jackson -Signed-off-by: Hans de Goede ---- - hw/xfree86/common/xf86Option.c | 5 ++++- - hw/xfree86/common/xf86platformBus.c | 42 +++++++++++++++++++++++++++++++++++++ - hw/xfree86/common/xf86platformBus.h | 2 ++ - hw/xfree86/man/xorg.conf.man | 10 +++++++++ - hw/xfree86/parser/OutputClass.c | 6 ++++++ - hw/xfree86/parser/xf86Parser.h | 1 + - 6 files changed, 65 insertions(+), 1 deletion(-) - -diff --git a/hw/xfree86/common/xf86Option.c b/hw/xfree86/common/xf86Option.c -index 0e8bc1f..929724d 100644 ---- a/hw/xfree86/common/xf86Option.c -+++ b/hw/xfree86/common/xf86Option.c -@@ -44,6 +44,7 @@ - #include "xf86Xinput.h" - #include "xf86Optrec.h" - #include "xf86Parser.h" -+#include "xf86platformBus.h" /* For OutputClass functions */ - #include "optionstr.h" - - static Bool ParseOptionValue(int scrnIndex, XF86OptionPtr options, -@@ -64,7 +65,7 @@ static Bool ParseOptionValue(int scrnIndex, XF86OptionPtr options, - * - * The order of precedence for options is: - * -- * extraOpts, display, confScreen, monitor, device -+ * extraOpts, display, confScreen, monitor, device, outputClassOptions - */ - - void -@@ -79,6 +80,8 @@ xf86CollectOptions(ScrnInfoPtr pScrn, XF86OptionPtr extraOpts) - pScrn->options = NULL; - - for (i = pScrn->numEntities - 1; i >= 0; i--) { -+ xf86MergeOutputClassOptions(pScrn->entityList[i], &pScrn->options); -+ - device = xf86GetDevFromEntity(pScrn->entityList[i], - pScrn->entityInstanceList[i]); - if (device && device->options) { -diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c -index 25a9040..a698c6c 100644 ---- a/hw/xfree86/common/xf86platformBus.c -+++ b/hw/xfree86/common/xf86platformBus.c -@@ -310,6 +310,48 @@ xf86platformProbe(void) - return 0; - } - -+void -+xf86MergeOutputClassOptions(int entityIndex, void **options) -+{ -+ const EntityPtr entity = xf86Entities[entityIndex]; -+ struct xf86_platform_device *dev = NULL; -+ XF86ConfOutputClassPtr cl; -+ XF86OptionPtr classopts; -+ int i = 0; -+ -+ switch (entity->bus.type) { -+ case BUS_PLATFORM: -+ dev = entity->bus.id.plat; -+ break; -+ case BUS_PCI: -+ for (i = 0; i < xf86_num_platform_devices; i++) { -+ if (MATCH_PCI_DEVICES(xf86_platform_devices[i].pdev, -+ entity->bus.id.pci)) { -+ dev = &xf86_platform_devices[i]; -+ break; -+ } -+ } -+ break; -+ default: -+ xf86Msg(X_DEBUG, "xf86MergeOutputClassOptions unsupported bus type %d\n", -+ entity->bus.type); -+ } -+ -+ if (!dev) -+ return; -+ -+ for (cl = xf86configptr->conf_outputclass_lst; cl; cl = cl->list.next) { -+ if (!OutputClassMatches(cl, dev) || !cl->option_lst) -+ continue; -+ -+ xf86Msg(X_INFO, "Applying OutputClass \"%s\" options to %s\n", -+ cl->identifier, dev->attribs->path); -+ -+ classopts = xf86optionListDup(cl->option_lst); -+ *options = xf86optionListMerge(*options, classopts); -+ } -+} -+ - static int - xf86ClaimPlatformSlot(struct xf86_platform_device * d, DriverPtr drvp, - int chipset, GDevPtr dev, Bool active) -diff --git a/hw/xfree86/common/xf86platformBus.h b/hw/xfree86/common/xf86platformBus.h -index 0f5c0ef..70d9ec8 100644 ---- a/hw/xfree86/common/xf86platformBus.h -+++ b/hw/xfree86/common/xf86platformBus.h -@@ -42,6 +42,7 @@ struct xf86_platform_device { - int xf86platformProbe(void); - int xf86platformProbeDev(DriverPtr drvp); - int xf86platformAddGPUDevices(DriverPtr drvp); -+void xf86MergeOutputClassOptions(int entityIndex, void **options); - - extern int xf86_num_platform_devices; - extern struct xf86_platform_device *xf86_platform_devices; -@@ -161,6 +162,7 @@ extern void xf86platformPrimary(void); - #else - - static inline int xf86platformAddGPUDevices(DriverPtr drvp) { return FALSE; } -+static inline void xf86MergeOutputClassOptions(int index, void **options) {} - - #endif - -diff --git a/hw/xfree86/man/xorg.conf.man b/hw/xfree86/man/xorg.conf.man -index 7d0c524..8928a53 100644 ---- a/hw/xfree86/man/xorg.conf.man -+++ b/hw/xfree86/man/xorg.conf.man -@@ -1280,6 +1280,16 @@ For example: - Check the case-sensitive string - .RI \*q matchdriver \*q - against the kernel driver of the device. -+.PP -+When an output device has been matched to the -+.B OutputClass -+section, any -+.B Option -+entries are applied to the device. See the -+.B Device -+section below for a description of the remaining -+.B Option -+entries. - .SH "DEVICE SECTION" - The config file may have multiple - .B Device -diff --git a/hw/xfree86/parser/OutputClass.c b/hw/xfree86/parser/OutputClass.c -index 8064e0c..f813ee6 100644 ---- a/hw/xfree86/parser/OutputClass.c -+++ b/hw/xfree86/parser/OutputClass.c -@@ -36,6 +36,7 @@ static const xf86ConfigSymTabRec OutputClassTab[] = { - {ENDSECTION, "endsection"}, - {IDENTIFIER, "identifier"}, - {DRIVER, "driver"}, -+ {OPTION, "option"}, - {MATCH_DRIVER, "matchdriver"}, - {-1, ""}, - }; -@@ -60,6 +61,8 @@ xf86freeOutputClassList(XF86ConfOutputClassPtr ptr) - free(group); - } - -+ xf86optionListFree(ptr->option_lst); -+ - prev = ptr; - ptr = ptr->list.next; - free(prev); -@@ -112,6 +115,9 @@ xf86parseOutputClassSection(void) - else - ptr->driver = xf86_lex_val.str; - break; -+ case OPTION: -+ ptr->option_lst = xf86parseOption(ptr->option_lst); -+ break; - case MATCH_DRIVER: - if (xf86getSubToken(&(ptr->comment)) != STRING) - Error(QUOTE_MSG, "MatchDriver"); -diff --git a/hw/xfree86/parser/xf86Parser.h b/hw/xfree86/parser/xf86Parser.h -index 9c4b403..897edab 100644 ---- a/hw/xfree86/parser/xf86Parser.h -+++ b/hw/xfree86/parser/xf86Parser.h -@@ -338,6 +338,7 @@ typedef struct { - char *identifier; - char *driver; - struct xorg_list match_driver; -+ XF86OptionPtr option_lst; - char *comment; - } XF86ConfOutputClassRec, *XF86ConfOutputClassPtr; - --- -2.9.3 - diff --git a/0003-xwayland-Listen-for-wp_tablet_seat-events.patch b/0003-xwayland-Listen-for-wp_tablet_seat-events.patch deleted file mode 100644 index 308331f..0000000 --- a/0003-xwayland-Listen-for-wp_tablet_seat-events.patch +++ /dev/null @@ -1,173 +0,0 @@ -From 243eadc7979e35756a4f0e349ee97bbbd3a268c3 Mon Sep 17 00:00:00 2001 -From: Jason Gerecke -Date: Fri, 14 Oct 2016 14:50:18 -0700 -Subject: [PATCH xserver 03/12] xwayland: Listen for wp_tablet_seat events - -The wp_tablet_seat interface provides us with notifications as tablets, -tools, and pads are connected to the system. Add listener functions and -store references to the obtained devices. - -Signed-off-by: Jason Gerecke -Signed-off-by: Carlos Garnacho -Reviewed-by: Peter Hutterer -Signed-off-by: Peter Hutterer -Acked-by: Ping Cheng -(cherry picked from commit 47c4415912b5b16b115135be365beb370858df76) ---- - hw/xwayland/xwayland-input.c | 94 ++++++++++++++++++++++++++++++++++++++++++++ - hw/xwayland/xwayland.h | 22 +++++++++++ - 2 files changed, 116 insertions(+) - -diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c -index 1d2be978e..d5d12933c 100644 ---- a/hw/xwayland/xwayland-input.c -+++ b/hw/xwayland/xwayland-input.c -@@ -1191,6 +1191,69 @@ xwl_seat_destroy(struct xwl_seat *xwl_seat) - - - static void -+tablet_seat_handle_add_tablet(void *data, struct zwp_tablet_seat_v2 *tablet_seat, -+ struct zwp_tablet_v2 *tablet) -+{ -+ struct xwl_seat *xwl_seat = data; -+ struct xwl_tablet *xwl_tablet; -+ -+ xwl_tablet = calloc(sizeof *xwl_tablet, 1); -+ if (xwl_tablet == NULL) { -+ ErrorF("%s ENOMEM\n", __func__); -+ return; -+ } -+ -+ xwl_tablet->tablet = tablet; -+ xwl_tablet->seat = xwl_seat; -+ -+ xorg_list_add(&xwl_tablet->link, &xwl_seat->tablets); -+} -+ -+static void -+tablet_seat_handle_add_tool(void *data, struct zwp_tablet_seat_v2 *tablet_seat, -+ struct zwp_tablet_tool_v2 *tool) -+{ -+ struct xwl_seat *xwl_seat = data; -+ struct xwl_tablet_tool *xwl_tablet_tool; -+ -+ xwl_tablet_tool = calloc(sizeof *xwl_tablet_tool, 1); -+ if (xwl_tablet_tool == NULL) { -+ ErrorF("%s ENOMEM\n", __func__); -+ return; -+ } -+ -+ xwl_tablet_tool->tool = tool; -+ xwl_tablet_tool->seat = xwl_seat; -+ -+ xorg_list_add(&xwl_tablet_tool->link, &xwl_seat->tablet_tools); -+} -+ -+static void -+tablet_seat_handle_add_pad(void *data, struct zwp_tablet_seat_v2 *tablet_seat, -+ struct zwp_tablet_pad_v2 *pad) -+{ -+ struct xwl_seat *xwl_seat = data; -+ struct xwl_tablet_pad *xwl_tablet_pad; -+ -+ xwl_tablet_pad = calloc(sizeof *xwl_tablet_pad, 1); -+ if (xwl_tablet_pad == NULL) { -+ ErrorF("%s ENOMEM\n", __func__); -+ return; -+ } -+ -+ xwl_tablet_pad->pad = pad; -+ xwl_tablet_pad->seat = xwl_seat; -+ -+ xorg_list_add(&xwl_tablet_pad->link, &xwl_seat->tablet_pads); -+} -+ -+static const struct zwp_tablet_seat_v2_listener tablet_seat_listener = { -+ tablet_seat_handle_add_tablet, -+ tablet_seat_handle_add_tool, -+ tablet_seat_handle_add_pad -+}; -+ -+static void - init_tablet_manager_seat(struct xwl_screen *xwl_screen, - struct xwl_seat *xwl_seat) - { -@@ -1200,11 +1263,42 @@ init_tablet_manager_seat(struct xwl_screen *xwl_screen, - xwl_seat->tablet_seat = - zwp_tablet_manager_v2_get_tablet_seat(xwl_screen->tablet_manager, - xwl_seat->seat); -+ -+ xorg_list_init(&xwl_seat->tablets); -+ xorg_list_init(&xwl_seat->tablet_tools); -+ xorg_list_init(&xwl_seat->tablet_pads); -+ -+ zwp_tablet_seat_v2_add_listener(xwl_seat->tablet_seat, &tablet_seat_listener, xwl_seat); - } - - static void - release_tablet_manager_seat(struct xwl_seat *xwl_seat) - { -+ struct xwl_tablet *xwl_tablet, *next_xwl_tablet; -+ struct xwl_tablet_tool *xwl_tablet_tool, *next_xwl_tablet_tool; -+ struct xwl_tablet_pad *xwl_tablet_pad, *next_xwl_tablet_pad; -+ -+ xorg_list_for_each_entry_safe(xwl_tablet_pad, next_xwl_tablet_pad, -+ &xwl_seat->tablet_pads, link) { -+ xorg_list_del(&xwl_tablet_pad->link); -+ zwp_tablet_pad_v2_destroy(xwl_tablet_pad->pad); -+ free(xwl_tablet_pad); -+ } -+ -+ xorg_list_for_each_entry_safe(xwl_tablet_tool, next_xwl_tablet_tool, -+ &xwl_seat->tablet_tools, link) { -+ xorg_list_del(&xwl_tablet_tool->link); -+ zwp_tablet_tool_v2_destroy(xwl_tablet_tool->tool); -+ free(xwl_tablet_tool); -+ } -+ -+ xorg_list_for_each_entry_safe(xwl_tablet, next_xwl_tablet, -+ &xwl_seat->tablets, link) { -+ xorg_list_del(&xwl_tablet->link); -+ zwp_tablet_v2_destroy(xwl_tablet->tablet); -+ free(xwl_tablet); -+ } -+ - if (xwl_seat->tablet_seat) { - zwp_tablet_seat_v2_destroy(xwl_seat->tablet_seat); - xwl_seat->tablet_seat = NULL; -diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h -index 2752d731c..a7f30b3c8 100644 ---- a/hw/xwayland/xwayland.h -+++ b/hw/xwayland/xwayland.h -@@ -174,6 +174,28 @@ struct xwl_seat { - double dx_unaccel; - double dy_unaccel; - } pending_pointer_event; -+ -+ struct xorg_list tablets; -+ struct xorg_list tablet_tools; -+ struct xorg_list tablet_pads; -+}; -+ -+struct xwl_tablet { -+ struct xorg_list link; -+ struct zwp_tablet_v2 *tablet; -+ struct xwl_seat *seat; -+}; -+ -+struct xwl_tablet_tool { -+ struct xorg_list link; -+ struct zwp_tablet_tool_v2 *tool; -+ struct xwl_seat *seat; -+}; -+ -+struct xwl_tablet_pad { -+ struct xorg_list link; -+ struct zwp_tablet_pad_v2 *pad; -+ struct xwl_seat *seat; - }; - - struct xwl_output { --- -2.13.5 - diff --git a/0004-xfree86-xf86platformProbe-split-finding-pci-info-and.patch b/0004-xfree86-xf86platformProbe-split-finding-pci-info-and.patch deleted file mode 100644 index 03d404e..0000000 --- a/0004-xfree86-xf86platformProbe-split-finding-pci-info-and.patch +++ /dev/null @@ -1,61 +0,0 @@ -From ab1a65b7755d081b41188104b21f4d21eaa3187b Mon Sep 17 00:00:00 2001 -From: Hans De Goede -Date: Mon, 12 Dec 2016 17:03:15 +0100 -Subject: [PATCH xserver 4/6] xfree86: xf86platformProbe: split finding - pci-info and setting primary GPU - -This is a preparation patch for allowing an OutputClass section to -override the default primary GPU device selection. - -Reviewed-by: Adam Jackson -Signed-off-by: Hans de Goede ---- - hw/xfree86/common/xf86platformBus.c | 23 +++++++++++++++-------- - 1 file changed, 15 insertions(+), 8 deletions(-) - -diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c -index a698c6c..39b3248 100644 ---- a/hw/xfree86/common/xf86platformBus.c -+++ b/hw/xfree86/common/xf86platformBus.c -@@ -145,16 +145,9 @@ platform_find_pci_info(struct xf86_platform_device *pd, char *busid) - - iter = pci_slot_match_iterator_create(&devmatch); - info = pci_device_next(iter); -- if (info) { -+ if (info) - pd->pdev = info; -- pci_device_probe(info); -- if (pci_device_is_boot_vga(info)) { -- primaryBus.type = BUS_PLATFORM; -- primaryBus.id.plat = pd; -- } -- } - pci_iterator_destroy(iter); -- - } - - static Bool -@@ -307,6 +300,20 @@ xf86platformProbe(void) - platform_find_pci_info(&xf86_platform_devices[i], busid); - } - } -+ -+ for (i = 0; i < xf86_num_platform_devices; i++) { -+ struct xf86_platform_device *dev = &xf86_platform_devices[i]; -+ -+ if (!dev->pdev) -+ continue; -+ -+ pci_device_probe(dev->pdev); -+ if (pci_device_is_boot_vga(dev->pdev)) { -+ primaryBus.type = BUS_PLATFORM; -+ primaryBus.id.plat = dev; -+ } -+ } -+ - return 0; - } - --- -2.9.3 - diff --git a/0004-xwayland-Handle-wp_tablet-events.patch b/0004-xwayland-Handle-wp_tablet-events.patch deleted file mode 100644 index 4fb4453..0000000 --- a/0004-xwayland-Handle-wp_tablet-events.patch +++ /dev/null @@ -1,211 +0,0 @@ -From 591b08b3311c5217969a8ceb3ed58b58fabc4891 Mon Sep 17 00:00:00 2001 -From: Jason Gerecke -Date: Fri, 15 Jan 2016 17:01:38 -0800 -Subject: [PATCH xserver 04/12] xwayland: Handle wp_tablet events - -Creates and maintains the canonical trio of X devices (stylus, eraser, -and cursor) to be shared by all connected tablets. A per-tablet trio -could be created instead, but there are very few benefits to such a -configuration since all tablets still ultimately share control of a -single master pointer. - -The three X devices are modeled after those created by xf86-input-wacom -but use a generic maximum X and Y that should be large enough to -accurately represent values from even the largest currently-available -tablets. - -Signed-off-by: Jason Gerecke -Signed-off-by: Carlos Garnacho -Reviewed-by: Peter Hutterer -Signed-off-by: Peter Hutterer -Acked-by: Ping Cheng -(cherry picked from commit 5812d1c28f4fb7b7de8b96a81415a21425561fd4) ---- - hw/xwayland/xwayland-input.c | 142 +++++++++++++++++++++++++++++++++++++++++++ - hw/xwayland/xwayland.h | 3 + - 2 files changed, 145 insertions(+) - -diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c -index d5d12933c..64655de5f 100644 ---- a/hw/xwayland/xwayland-input.c -+++ b/hw/xwayland/xwayland-input.c -@@ -294,6 +294,75 @@ xwl_touch_proc(DeviceIntPtr device, int what) - #undef NTOUCHPOINTS - } - -+static int -+xwl_tablet_proc(DeviceIntPtr device, int what) -+{ -+#define NBUTTONS 9 -+#define NAXES 6 -+ Atom btn_labels[NBUTTONS] = { 0 }; -+ Atom axes_labels[NAXES] = { 0 }; -+ BYTE map[NBUTTONS + 1] = { 0 }; -+ int i; -+ -+ switch (what) { -+ case DEVICE_INIT: -+ device->public.on = FALSE; -+ -+ for (i = 1; i <= NBUTTONS; i++) -+ map[i] = i; -+ -+ axes_labels[0] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_X); -+ axes_labels[1] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_Y); -+ axes_labels[2] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_PRESSURE); -+ axes_labels[3] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_TILT_X); -+ axes_labels[4] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_TILT_Y); -+ axes_labels[5] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_WHEEL); -+ -+ if (!InitValuatorClassDeviceStruct(device, NAXES, axes_labels, -+ GetMotionHistorySize(), Absolute)) -+ return BadValue; -+ -+ /* Valuators - match the xf86-input-wacom ranges */ -+ InitValuatorAxisStruct(device, 0, axes_labels[0], -+ 0, 262143, 10000, 0, 10000, Absolute); -+ InitValuatorAxisStruct(device, 1, axes_labels[1], -+ 0, 262143, 10000, 0, 10000, Absolute); -+ /* pressure */ -+ InitValuatorAxisStruct(device, 2, axes_labels[2], -+ 0, 65535, 1, 0, 1, Absolute); -+ /* tilt x */ -+ InitValuatorAxisStruct(device, 3, axes_labels[3], -+ -64, 63, 57, 0, 57, Absolute); -+ /* tilt y */ -+ InitValuatorAxisStruct(device, 4, axes_labels[4], -+ -64, 63, 57, 0, 57, Absolute); -+ /* abs wheel (airbrush) or rotation (artpen) */ -+ InitValuatorAxisStruct(device, 5, axes_labels[5], -+ -900, 899, 1, 0, 1, Absolute); -+ -+ if (!InitPtrFeedbackClassDeviceStruct(device, xwl_pointer_control)) -+ return BadValue; -+ -+ if (!InitButtonClassDeviceStruct(device, NBUTTONS, btn_labels, map)) -+ return BadValue; -+ -+ return Success; -+ -+ case DEVICE_ON: -+ device->public.on = TRUE; -+ return Success; -+ -+ case DEVICE_OFF: -+ case DEVICE_CLOSE: -+ device->public.on = FALSE; -+ return Success; -+ } -+ -+ return BadMatch; -+#undef NAXES -+#undef NBUTTONS -+} -+ - static void - pointer_handle_enter(void *data, struct wl_pointer *pointer, - uint32_t serial, struct wl_surface *surface, -@@ -1189,6 +1258,77 @@ xwl_seat_destroy(struct xwl_seat *xwl_seat) - free(xwl_seat); - } - -+static void -+tablet_handle_name(void *data, struct zwp_tablet_v2 *tablet, const char *name) -+{ -+} -+ -+static void -+tablet_handle_id(void *data, struct zwp_tablet_v2 *tablet, uint32_t vid, -+ uint32_t pid) -+{ -+} -+ -+static void -+tablet_handle_path(void *data, struct zwp_tablet_v2 *tablet, const char *path) -+{ -+} -+ -+static void -+tablet_handle_done(void *data, struct zwp_tablet_v2 *tablet) -+{ -+ struct xwl_tablet *xwl_tablet = data; -+ struct xwl_seat *xwl_seat = xwl_tablet->seat; -+ -+ if (xwl_seat->stylus == NULL) { -+ xwl_seat->stylus = add_device(xwl_seat, "xwayland-stylus", xwl_tablet_proc); -+ ActivateDevice(xwl_seat->stylus, TRUE); -+ } -+ EnableDevice(xwl_seat->stylus, TRUE); -+ -+ if (xwl_seat->eraser == NULL) { -+ xwl_seat->eraser = add_device(xwl_seat, "xwayland-eraser", xwl_tablet_proc); -+ ActivateDevice(xwl_seat->eraser, TRUE); -+ } -+ EnableDevice(xwl_seat->eraser, TRUE); -+ -+ if (xwl_seat->puck == NULL) { -+ xwl_seat->puck = add_device(xwl_seat, "xwayland-cursor", xwl_tablet_proc); -+ ActivateDevice(xwl_seat->puck, TRUE); -+ } -+ EnableDevice(xwl_seat->puck, TRUE); -+} -+ -+static void -+tablet_handle_removed(void *data, struct zwp_tablet_v2 *tablet) -+{ -+ struct xwl_tablet *xwl_tablet = data; -+ struct xwl_seat *xwl_seat = xwl_tablet->seat; -+ -+ xorg_list_del(&xwl_tablet->link); -+ -+ /* The tablet is merely disabled, not removed. The next tablet -+ will re-use the same X devices */ -+ if (xorg_list_is_empty(&xwl_seat->tablets)) { -+ if (xwl_seat->stylus) -+ DisableDevice(xwl_seat->stylus, TRUE); -+ if (xwl_seat->eraser) -+ DisableDevice(xwl_seat->eraser, TRUE); -+ if (xwl_seat->puck) -+ DisableDevice(xwl_seat->puck, TRUE); -+ } -+ -+ zwp_tablet_v2_destroy(tablet); -+ free(xwl_tablet); -+} -+ -+static const struct zwp_tablet_v2_listener tablet_listener = { -+ tablet_handle_name, -+ tablet_handle_id, -+ tablet_handle_path, -+ tablet_handle_done, -+ tablet_handle_removed -+}; - - static void - tablet_seat_handle_add_tablet(void *data, struct zwp_tablet_seat_v2 *tablet_seat, -@@ -1207,6 +1347,8 @@ tablet_seat_handle_add_tablet(void *data, struct zwp_tablet_seat_v2 *tablet_seat - xwl_tablet->seat = xwl_seat; - - xorg_list_add(&xwl_tablet->link, &xwl_seat->tablets); -+ -+ zwp_tablet_v2_add_listener(tablet, &tablet_listener, xwl_tablet); - } - - static void -diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h -index a7f30b3c8..e7e62882b 100644 ---- a/hw/xwayland/xwayland.h -+++ b/hw/xwayland/xwayland.h -@@ -132,6 +132,9 @@ struct xwl_seat { - DeviceIntPtr relative_pointer; - DeviceIntPtr keyboard; - DeviceIntPtr touch; -+ DeviceIntPtr stylus; -+ DeviceIntPtr eraser; -+ DeviceIntPtr puck; - struct xwl_screen *xwl_screen; - struct wl_seat *seat; - struct wl_pointer *wl_pointer; --- -2.13.5 - diff --git a/0005-xfree86-Allow-overriding-primary-GPU-detection-from-.patch b/0005-xfree86-Allow-overriding-primary-GPU-detection-from-.patch deleted file mode 100644 index afa47e4..0000000 --- a/0005-xfree86-Allow-overriding-primary-GPU-detection-from-.patch +++ /dev/null @@ -1,91 +0,0 @@ -From d75ffcdbf8c1e3c8e0d46debcd533a9f2560f0a8 Mon Sep 17 00:00:00 2001 -From: Hans De Goede -Date: Mon, 12 Dec 2016 17:03:16 +0100 -Subject: [PATCH xserver 5/6] xfree86: Allow overriding primary GPU detection - from an OutputClass section - -Allow using: - -Option "PrimaryGPU" "yes" - -In an OutputClass section to override the default primary GPU device -selection which selects the GPU used as output by the firmware. - -If multiple output devices match an OutputClass section with -the PrimaryGPU option set, the first one enumerated becomes the -primary GPU. - -Reviewed-by: Adam Jackson -Signed-off-by: Hans de Goede ---- - hw/xfree86/common/xf86platformBus.c | 19 +++++++++++++++++++ - hw/xfree86/man/xorg.conf.man | 12 +++++++++++- - 2 files changed, 30 insertions(+), 1 deletion(-) - -diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c -index 39b3248..fc17d15 100644 ---- a/hw/xfree86/common/xf86platformBus.c -+++ b/hw/xfree86/common/xf86platformBus.c -@@ -286,6 +286,7 @@ xf86platformProbe(void) - { - int i; - Bool pci = TRUE; -+ XF86ConfOutputClassPtr cl; - - config_odev_probe(xf86PlatformDeviceProbe); - -@@ -301,6 +302,24 @@ xf86platformProbe(void) - } - } - -+ /* First see if there is an OutputClass match marking a device as primary */ -+ for (i = 0; i < xf86_num_platform_devices; i++) { -+ struct xf86_platform_device *dev = &xf86_platform_devices[i]; -+ for (cl = xf86configptr->conf_outputclass_lst; cl; cl = cl->list.next) { -+ if (!OutputClassMatches(cl, dev)) -+ continue; -+ -+ if (xf86CheckBoolOption(cl->option_lst, "PrimaryGPU", FALSE)) { -+ xf86Msg(X_CONFIG, "OutputClass \"%s\" setting %s as PrimaryGPU\n", -+ cl->identifier, dev->attribs->path); -+ primaryBus.type = BUS_PLATFORM; -+ primaryBus.id.plat = dev; -+ return 0; -+ } -+ } -+ } -+ -+ /* Then check for pci_device_is_boot_vga() */ - for (i = 0; i < xf86_num_platform_devices; i++) { - struct xf86_platform_device *dev = &xf86_platform_devices[i]; - -diff --git a/hw/xfree86/man/xorg.conf.man b/hw/xfree86/man/xorg.conf.man -index 8928a53..79b71a8 100644 ---- a/hw/xfree86/man/xorg.conf.man -+++ b/hw/xfree86/man/xorg.conf.man -@@ -1285,11 +1285,21 @@ When an output device has been matched to the - .B OutputClass - section, any - .B Option --entries are applied to the device. See the -+entries are applied to the device. One -+.B OutputClass -+specific -+.B Option -+is recognized. See the - .B Device - section below for a description of the remaining - .B Option - entries. -+.TP 7 -+.BI "Option \*qPrimaryGPU\*q \*q" boolean \*q -+This option specifies that the matched device should be treated as the -+primary GPU, replacing the selection of the GPU used as output by the -+firmware. If multiple output devices match an OutputClass section with -+the PrimaryGPU option set, the first one enumerated becomes the primary GPU. - .SH "DEVICE SECTION" - The config file may have multiple - .B Device --- -2.9.3 - diff --git a/0005-xfree86-Remove-redundant-ServerIsNotSeat0-check-from.patch b/0005-xfree86-Remove-redundant-ServerIsNotSeat0-check-from.patch deleted file mode 100644 index 424e400..0000000 --- a/0005-xfree86-Remove-redundant-ServerIsNotSeat0-check-from.patch +++ /dev/null @@ -1,31 +0,0 @@ -From c17e544b271ced65483692103d39ed1188d4ca25 Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Tue, 27 Sep 2016 14:30:10 +0200 -Subject: [PATCH xserver v2 5/7] xfree86: Remove redundant ServerIsNotSeat0 - check from xf86CallDriverProbe - -If foundScreen is TRUE, then all the code below the removed if -will not execute until we reach the return foundScreen; at the -end, so this entire if block is redundant. - -Signed-off-by: Hans de Goede ---- - hw/xfree86/common/xf86Bus.c | 2 -- - 1 file changed, 2 deletions(-) - -diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c -index 5b93940..27c6b1b 100644 ---- a/hw/xfree86/common/xf86Bus.c -+++ b/hw/xfree86/common/xf86Bus.c -@@ -82,8 +82,6 @@ xf86CallDriverProbe(DriverPtr drv, Bool detect_only) - if (!xf86DoConfigure && drv->platformProbe != NULL) { - foundScreen = xf86platformProbeDev(drv); - } -- if (ServerIsNotSeat0() && foundScreen) -- return foundScreen; - #endif - - #ifdef XSERVER_LIBPCIACCESS --- -2.9.3 - diff --git a/0005-xwayland-Handle-tablet_tool-events.patch b/0005-xwayland-Handle-tablet_tool-events.patch deleted file mode 100644 index 5ebc618..0000000 --- a/0005-xwayland-Handle-tablet_tool-events.patch +++ /dev/null @@ -1,374 +0,0 @@ -From 4354336014ca0c29270a6cdf83e9f9e5fe16080e Mon Sep 17 00:00:00 2001 -From: Jason Gerecke -Date: Fri, 14 Oct 2016 14:31:46 -0700 -Subject: [PATCH xserver 05/12] xwayland: Handle tablet_tool events - -Translates Wayland tablet events into corresponding X11 tablet events. As -with the prior commit, these events are modeled after those created by the -xf86-input-wacom driver to maximize compatibility with existing applications. - -Signed-off-by: Jason Gerecke -Signed-off-by: Carlos Garnacho -Reviewed-by: Peter Hutterer -Signed-off-by: Peter Hutterer -Acked-by: Ping Cheng -(cherry picked from commit 8a1defcc634daddbb3570519d69ec5c9e39a8b56) ---- - hw/xwayland/xwayland-input.c | 313 +++++++++++++++++++++++++++++++++++++++++++ - hw/xwayland/xwayland.h | 9 ++ - 2 files changed, 322 insertions(+) - -diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c -index 64655de5f..142862f7e 100644 ---- a/hw/xwayland/xwayland-input.c -+++ b/hw/xwayland/xwayland-input.c -@@ -1331,6 +1331,317 @@ static const struct zwp_tablet_v2_listener tablet_listener = { - }; - - static void -+tablet_tool_receive_type(void *data, struct zwp_tablet_tool_v2 *tool, -+ uint32_t type) -+{ -+ struct xwl_tablet_tool *xwl_tablet_tool = data; -+ struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; -+ -+ switch (type) { -+ case ZWP_TABLET_TOOL_V2_TYPE_ERASER: -+ xwl_tablet_tool->xdevice = xwl_seat->eraser; -+ break; -+ case ZWP_TABLET_TOOL_V2_TYPE_MOUSE: -+ case ZWP_TABLET_TOOL_V2_TYPE_LENS: -+ xwl_tablet_tool->xdevice = xwl_seat->puck; -+ break; -+ default: -+ xwl_tablet_tool->xdevice = xwl_seat->stylus; -+ break; -+ } -+} -+ -+static void -+tablet_tool_receive_hardware_serial(void *data, struct zwp_tablet_tool_v2 *tool, -+ uint32_t hi, uint32_t low) -+{ -+} -+ -+static void -+tablet_tool_receive_hardware_id_wacom(void *data, struct zwp_tablet_tool_v2 *tool, -+ uint32_t hi, uint32_t low) -+{ -+} -+ -+static void -+tablet_tool_receive_capability(void *data, struct zwp_tablet_tool_v2 *tool, -+ uint32_t capability) -+{ -+} -+ -+static void -+tablet_tool_receive_done(void *data, struct zwp_tablet_tool_v2 *tool) -+{ -+} -+ -+static void -+tablet_tool_receive_removed(void *data, struct zwp_tablet_tool_v2 *tool) -+{ -+ struct xwl_tablet_tool *xwl_tablet_tool = data; -+ -+ xorg_list_del(&xwl_tablet_tool->link); -+ zwp_tablet_tool_v2_destroy(tool); -+ free(xwl_tablet_tool); -+} -+ -+static void -+tablet_tool_proximity_in(void *data, struct zwp_tablet_tool_v2 *tool, -+ uint32_t serial, struct zwp_tablet_v2 *tablet, -+ struct wl_surface *wl_surface) -+{ -+ struct xwl_tablet_tool *xwl_tablet_tool = data; -+ struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; -+ -+ /* There's a race here where if we create and then immediately -+ * destroy a surface, we might end up in a state where the Wayland -+ * compositor sends us an event for a surface that doesn't exist. -+ * -+ * Don't process enter events in this case. -+ * -+ * see pointer_handle_enter() -+ */ -+ if (wl_surface == NULL) -+ return; -+ -+ xwl_seat->focus_window = wl_surface_get_user_data(wl_surface); -+} -+ -+static void -+tablet_tool_proximity_out(void *data, struct zwp_tablet_tool_v2 *tool) -+{ -+ struct xwl_tablet_tool *xwl_tablet_tool = data; -+ struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; -+ -+ xwl_seat->focus_window = NULL; -+ -+ xwl_tablet_tool->pressure = 0; -+ xwl_tablet_tool->tilt_x = 0; -+ xwl_tablet_tool->tilt_y = 0; -+ xwl_tablet_tool->rotation = 0; -+ xwl_tablet_tool->slider = 0; -+} -+ -+static void -+tablet_tool_down(void *data, struct zwp_tablet_tool_v2 *tool, uint32_t serial) -+{ -+ struct xwl_tablet_tool *xwl_tablet_tool = data; -+ struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; -+ ValuatorMask mask; -+ -+ xwl_seat->xwl_screen->serial = serial; -+ -+ valuator_mask_zero(&mask); -+ QueuePointerEvents(xwl_tablet_tool->xdevice, ButtonPress, 1, 0, &mask); -+} -+ -+static void -+tablet_tool_up(void *data, struct zwp_tablet_tool_v2 *tool) -+{ -+ struct xwl_tablet_tool *xwl_tablet_tool = data; -+ ValuatorMask mask; -+ -+ valuator_mask_zero(&mask); -+ QueuePointerEvents(xwl_tablet_tool->xdevice, ButtonRelease, 1, 0, &mask); -+} -+ -+static void -+tablet_tool_motion(void *data, struct zwp_tablet_tool_v2 *tool, -+ wl_fixed_t x, wl_fixed_t y) -+{ -+ struct xwl_tablet_tool *xwl_tablet_tool = data; -+ struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; -+ int32_t dx, dy; -+ int sx = wl_fixed_to_int(x); -+ int sy = wl_fixed_to_int(y); -+ -+ if (!xwl_seat->focus_window) -+ return; -+ -+ dx = xwl_seat->focus_window->window->drawable.x; -+ dy = xwl_seat->focus_window->window->drawable.y; -+ -+ xwl_tablet_tool->x = dx + sx; -+ xwl_tablet_tool->y = dy + sy; -+} -+ -+static void -+tablet_tool_pressure(void *data, struct zwp_tablet_tool_v2 *tool, -+ uint32_t pressure) -+{ -+ struct xwl_tablet_tool *xwl_tablet_tool = data; -+ struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; -+ -+ if (!xwl_seat->focus_window) -+ return; -+ -+ /* normalized to 65535 already */ -+ xwl_tablet_tool->pressure = pressure; -+} -+ -+static void -+tablet_tool_distance(void *data, struct zwp_tablet_tool_v2 *tool, -+ uint32_t distance_raw) -+{ -+} -+ -+static void -+tablet_tool_tilt(void *data, struct zwp_tablet_tool_v2 *tool, -+ wl_fixed_t tilt_x, wl_fixed_t tilt_y) -+{ -+ struct xwl_tablet_tool *xwl_tablet_tool = data; -+ struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; -+ -+ if (!xwl_seat->focus_window) -+ return; -+ -+ xwl_tablet_tool->tilt_x = wl_fixed_to_double(tilt_x); -+ xwl_tablet_tool->tilt_y = wl_fixed_to_double(tilt_y); -+} -+ -+static void -+tablet_tool_rotation(void *data, struct zwp_tablet_tool_v2 *tool, -+ wl_fixed_t angle) -+{ -+ struct xwl_tablet_tool *xwl_tablet_tool = data; -+ struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; -+ double rotation = wl_fixed_to_double(angle); -+ -+ if (!xwl_seat->focus_window) -+ return; -+ -+ /* change origin (buttons facing right [libinput +90 degrees]) and -+ * scaling (5 points per degree) to match wacom driver behavior -+ */ -+ rotation = remainderf(rotation + 90.0f, 360.0f); -+ rotation *= 5.0f; -+ xwl_tablet_tool->rotation = rotation; -+} -+ -+static void -+tablet_tool_slider(void *data, struct zwp_tablet_tool_v2 *tool, -+ int32_t position_raw) -+{ -+ struct xwl_tablet_tool *xwl_tablet_tool = data; -+ struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; -+ float position = position_raw / 65535.0; -+ -+ if (!xwl_seat->focus_window) -+ return; -+ -+ xwl_tablet_tool->slider = (position * 1799.0f) - 900.0f; -+} -+ -+static void -+tablet_tool_wheel(void *data, struct zwp_tablet_tool_v2 *tool, -+ wl_fixed_t degrees, int32_t clicks) -+{ -+} -+ -+static void -+tablet_tool_button_state(void *data, struct zwp_tablet_tool_v2 *tool, -+ uint32_t serial, uint32_t button, uint32_t state) -+{ -+ struct xwl_tablet_tool *xwl_tablet_tool = data; -+ struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; -+ int xbtn = 0; -+ ValuatorMask mask; -+ -+ /* BTN_0 .. BTN_9 */ -+ if (button >= 0x100 && button <= 0x109) { -+ xbtn = button - 0x100 + 1; -+ } -+ /* BTN_A .. BTN_Z */ -+ else if (button >= 0x130 && button <= 0x135) { -+ xbtn = button - 0x130 + 10; -+ } -+ /* BTN_BASE .. BTN_BASE6 */ -+ else if (button >= 0x126 && button <= 0x12b) { -+ xbtn = button - 0x126 + 16; -+ } -+ else { -+ switch (button) { -+ case 0x110: /* BTN_LEFT */ -+ case 0x14a: /* BTN_TOUCH */ -+ xbtn = 1; -+ break; -+ -+ case 0x112: /* BTN_MIDDLE */ -+ case 0x14b: /* BTN_STYLUS */ -+ xbtn = 2; -+ break; -+ -+ case 0x111: /* BTN_RIGHT */ -+ case 0x14c: /* BTN_STYLUS2 */ -+ xbtn = 3; -+ break; -+ -+ case 0x113: /* BTN_SIDE */ -+ case 0x116: /* BTN_BACK */ -+ xbtn = 8; -+ break; -+ -+ case 0x114: /* BTN_EXTRA */ -+ case 0x115: /* BTN_FORWARD */ -+ xbtn = 9; -+ break; -+ } -+ } -+ -+ if (!xbtn) { -+ ErrorF("unknown tablet button number %d\n", button); -+ return; -+ } -+ -+ xwl_seat->xwl_screen->serial = serial; -+ -+ valuator_mask_zero(&mask); -+ QueuePointerEvents(xwl_tablet_tool->xdevice, -+ state ? ButtonPress : ButtonRelease, xbtn, 0, &mask); -+} -+ -+static void -+tablet_tool_frame(void *data, struct zwp_tablet_tool_v2 *tool, uint32_t time) -+{ -+ struct xwl_tablet_tool *xwl_tablet_tool = data; -+ ValuatorMask mask; -+ -+ valuator_mask_zero(&mask); -+ valuator_mask_set(&mask, 0, xwl_tablet_tool->x); -+ valuator_mask_set(&mask, 1, xwl_tablet_tool->y); -+ valuator_mask_set(&mask, 2, xwl_tablet_tool->pressure); -+ valuator_mask_set(&mask, 3, xwl_tablet_tool->tilt_x); -+ valuator_mask_set(&mask, 4, xwl_tablet_tool->tilt_y); -+ valuator_mask_set(&mask, 5, xwl_tablet_tool->rotation + xwl_tablet_tool->slider); -+ -+ /* FIXME: Store button mask in xwl_tablet_tool and send events *HERE* if -+ changed */ -+ QueuePointerEvents(xwl_tablet_tool->xdevice, MotionNotify, 0, -+ POINTER_ABSOLUTE | POINTER_SCREEN, &mask); -+} -+ -+static const struct zwp_tablet_tool_v2_listener tablet_tool_listener = { -+ tablet_tool_receive_type, -+ tablet_tool_receive_hardware_serial, -+ tablet_tool_receive_hardware_id_wacom, -+ tablet_tool_receive_capability, -+ tablet_tool_receive_done, -+ tablet_tool_receive_removed, -+ tablet_tool_proximity_in, -+ tablet_tool_proximity_out, -+ tablet_tool_down, -+ tablet_tool_up, -+ tablet_tool_motion, -+ tablet_tool_pressure, -+ tablet_tool_distance, -+ tablet_tool_tilt, -+ tablet_tool_rotation, -+ tablet_tool_slider, -+ tablet_tool_wheel, -+ tablet_tool_button_state, -+ tablet_tool_frame -+}; -+ -+static void - tablet_seat_handle_add_tablet(void *data, struct zwp_tablet_seat_v2 *tablet_seat, - struct zwp_tablet_v2 *tablet) - { -@@ -1368,6 +1679,8 @@ tablet_seat_handle_add_tool(void *data, struct zwp_tablet_seat_v2 *tablet_seat, - xwl_tablet_tool->seat = xwl_seat; - - xorg_list_add(&xwl_tablet_tool->link, &xwl_seat->tablet_tools); -+ -+ zwp_tablet_tool_v2_add_listener(tool, &tablet_tool_listener, xwl_tablet_tool); - } - - static void -diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h -index e7e62882b..fb9ac4804 100644 ---- a/hw/xwayland/xwayland.h -+++ b/hw/xwayland/xwayland.h -@@ -193,6 +193,15 @@ struct xwl_tablet_tool { - struct xorg_list link; - struct zwp_tablet_tool_v2 *tool; - struct xwl_seat *seat; -+ -+ DeviceIntPtr xdevice; -+ uint32_t x; -+ uint32_t y; -+ uint32_t pressure; -+ float tilt_x; -+ float tilt_y; -+ float rotation; -+ float slider; - }; - - struct xwl_tablet_pad { --- -2.13.5 - diff --git a/0006-xfree86-Add-ModulePath-support-for-OutputClass-confi.patch b/0006-xfree86-Add-ModulePath-support-for-OutputClass-confi.patch deleted file mode 100644 index 6ba4018..0000000 --- a/0006-xfree86-Add-ModulePath-support-for-OutputClass-confi.patch +++ /dev/null @@ -1,183 +0,0 @@ -From b5dffbbac193aa640ffcfa0a431c21b862854e53 Mon Sep 17 00:00:00 2001 -From: Hans De Goede -Date: Mon, 12 Dec 2016 17:03:17 +0100 -Subject: [PATCH xserver 6/6] xfree86: Add ModulePath support for OutputClass - config Sections - -Allow OutputClass config snippets to modify the module-path. - -Note that any specified ModulePaths will be pre-pended to the normal -ModulePath. The idea behind this is that any output hardware specific -modules should have preference over the normal modules. - -One use-case for this is the nvidia binary driver, this allows a -config snippet like this: - -Section "OutputClass" - MatchDriver "nvidia" - Modulepath "/usr/lib64/nvidia/modules" -EndSection - -To get the nvidia glx specific glx module loaded, but only when the -nvidia kernel driver is loaded. - -Together with the glvnd work done recently, this allows the nouveau -+ mesa and nvidia-binary userspace stacks to co-exist on the same -system without any ldconfig / xorg.conf tweaking and the xserver will -automatically do the right thing depending on which kernel driver -(nouveau or nvidia) is loaded. - -Reviewed-by: Adam Jackson -Signed-off-by: Hans de Goede ---- - hw/xfree86/common/xf86platformBus.c | 23 +++++++++++++++++++++++ - hw/xfree86/loader/loadmod.c | 1 + - hw/xfree86/man/xorg.conf.man | 16 ++++++++++++++++ - hw/xfree86/parser/OutputClass.c | 15 +++++++++++++++ - hw/xfree86/parser/xf86Parser.h | 1 + - 5 files changed, 56 insertions(+) - -diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c -index fc17d15..0b5795f 100644 ---- a/hw/xfree86/common/xf86platformBus.c -+++ b/hw/xfree86/common/xf86platformBus.c -@@ -40,6 +40,7 @@ - #include "hotplug.h" - #include "systemd-logind.h" - -+#include "loaderProcs.h" - #include "xf86.h" - #include "xf86_OSproc.h" - #include "xf86Priv.h" -@@ -287,6 +288,7 @@ xf86platformProbe(void) - int i; - Bool pci = TRUE; - XF86ConfOutputClassPtr cl; -+ char *old_path, *path = NULL; - - config_odev_probe(xf86PlatformDeviceProbe); - -@@ -300,8 +302,29 @@ xf86platformProbe(void) - if (pci && (strncmp(busid, "pci:", 4) == 0)) { - platform_find_pci_info(&xf86_platform_devices[i], busid); - } -+ -+ /* -+ * Deal with OutputClass ModulePath directives, these must be -+ * processed before we do any module loading. -+ */ -+ for (cl = xf86configptr->conf_outputclass_lst; cl; cl = cl->list.next) { -+ if (!OutputClassMatches(cl, &xf86_platform_devices[i])) -+ continue; -+ -+ if (cl->modulepath && xf86ModPathFrom != X_CMDLINE) { -+ old_path = path; -+ XNFasprintf(&path, "%s,%s", cl->modulepath, -+ path ? path : xf86ModulePath); -+ free(old_path); -+ xf86Msg(X_CONFIG, "OutputClass \"%s\" ModulePath extended to \"%s\"\n", -+ cl->identifier, path); -+ LoaderSetPath(path); -+ } -+ } - } - -+ free(path); -+ - /* First see if there is an OutputClass match marking a device as primary */ - for (i = 0; i < xf86_num_platform_devices; i++) { - struct xf86_platform_device *dev = &xf86_platform_devices[i]; -diff --git a/hw/xfree86/loader/loadmod.c b/hw/xfree86/loader/loadmod.c -index 8bf6836..940f5fc 100644 ---- a/hw/xfree86/loader/loadmod.c -+++ b/hw/xfree86/loader/loadmod.c -@@ -184,6 +184,7 @@ LoaderSetPath(const char *path) - if (!path) - return; - -+ FreeStringList(defaultPathList); - defaultPathList = InitPathList(path); - } - -diff --git a/hw/xfree86/man/xorg.conf.man b/hw/xfree86/man/xorg.conf.man -index 79b71a8..00ebf56 100644 ---- a/hw/xfree86/man/xorg.conf.man -+++ b/hw/xfree86/man/xorg.conf.man -@@ -1300,6 +1300,22 @@ This option specifies that the matched device should be treated as the - primary GPU, replacing the selection of the GPU used as output by the - firmware. If multiple output devices match an OutputClass section with - the PrimaryGPU option set, the first one enumerated becomes the primary GPU. -+.PP -+A -+.B OutputClass -+Section may contain -+.B ModulePath -+entries. When an output device matches an -+.B OutputClass -+section, any -+.B ModulePath -+entries in that -+.B OutputClass -+are pre-pended to the search path for loadable Xorg server modules. See -+.B ModulePath -+in the -+.B Files -+section for more info. - .SH "DEVICE SECTION" - The config file may have multiple - .B Device -diff --git a/hw/xfree86/parser/OutputClass.c b/hw/xfree86/parser/OutputClass.c -index f813ee6..01b348f 100644 ---- a/hw/xfree86/parser/OutputClass.c -+++ b/hw/xfree86/parser/OutputClass.c -@@ -36,6 +36,7 @@ static const xf86ConfigSymTabRec OutputClassTab[] = { - {ENDSECTION, "endsection"}, - {IDENTIFIER, "identifier"}, - {DRIVER, "driver"}, -+ {MODULEPATH, "modulepath"}, - {OPTION, "option"}, - {MATCH_DRIVER, "matchdriver"}, - {-1, ""}, -@@ -53,6 +54,7 @@ xf86freeOutputClassList(XF86ConfOutputClassPtr ptr) - TestFree(ptr->identifier); - TestFree(ptr->comment); - TestFree(ptr->driver); -+ TestFree(ptr->modulepath); - - xorg_list_for_each_entry_safe(group, next, &ptr->match_driver, entry) { - xorg_list_del(&group->entry); -@@ -115,6 +117,19 @@ xf86parseOutputClassSection(void) - else - ptr->driver = xf86_lex_val.str; - break; -+ case MODULEPATH: -+ if (xf86getSubToken(&(ptr->comment)) != STRING) -+ Error(QUOTE_MSG, "ModulePath"); -+ if (ptr->modulepath) { -+ char *path; -+ XNFasprintf(&path, "%s,%s", ptr->modulepath, xf86_lex_val.str); -+ free(xf86_lex_val.str); -+ free(ptr->modulepath); -+ ptr->modulepath = path; -+ } else { -+ ptr->modulepath = xf86_lex_val.str; -+ } -+ break; - case OPTION: - ptr->option_lst = xf86parseOption(ptr->option_lst); - break; -diff --git a/hw/xfree86/parser/xf86Parser.h b/hw/xfree86/parser/xf86Parser.h -index 897edab..e014048 100644 ---- a/hw/xfree86/parser/xf86Parser.h -+++ b/hw/xfree86/parser/xf86Parser.h -@@ -337,6 +337,7 @@ typedef struct { - GenericListRec list; - char *identifier; - char *driver; -+ char *modulepath; - struct xorg_list match_driver; - XF86OptionPtr option_lst; - char *comment; --- -2.9.3 - diff --git a/0006-xfree86-Make-adding-unclaimed-devices-as-GPU-devices.patch b/0006-xfree86-Make-adding-unclaimed-devices-as-GPU-devices.patch deleted file mode 100644 index c0af28d..0000000 --- a/0006-xfree86-Make-adding-unclaimed-devices-as-GPU-devices.patch +++ /dev/null @@ -1,89 +0,0 @@ -From 74bc0fff3a6ca233e56b3fb2971bca97b5a4f8b5 Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Fri, 30 Sep 2016 11:59:04 +0200 -Subject: [PATCH xserver v2 6/7] xfree86: Make adding unclaimed devices as GPU - devices a separate step - -This is primarily a preparation patch for fixing the xserver exiting with -a "no screens found" error even though there are supported video cards, -due to the server not recognizing any card as the primary card. - -This also fixes the (mostly theoretical) case of a platformBus capable -driver adding a device as GPUscreen before a driver which only supports -the old PCI probe method gets a chance to claim it as a normal screen. - -Signed-off-by: Hans de Goede ---- - hw/xfree86/common/xf86Bus.c | 4 ++++ - hw/xfree86/common/xf86platformBus.c | 15 +++++++++++++++ - hw/xfree86/common/xf86platformBus.h | 6 ++++++ - 3 files changed, 25 insertions(+) - -diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c -index 27c6b1b..a3a9898 100644 ---- a/hw/xfree86/common/xf86Bus.c -+++ b/hw/xfree86/common/xf86Bus.c -@@ -125,6 +125,10 @@ xf86BusConfig(void) - xf86CallDriverProbe(xf86DriverList[i], FALSE); - } - -+ for (i = 0; i < xf86NumDrivers; i++) { -+ xf86platformAddGPUDevices(xf86DriverList[i]); -+ } -+ - /* If nothing was detected, return now */ - if (xf86NumScreens == 0) { - xf86Msg(X_ERROR, "No devices detected.\n"); -diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c -index 39fb1dd..8dd0d5d 100644 ---- a/hw/xfree86/common/xf86platformBus.c -+++ b/hw/xfree86/common/xf86platformBus.c -@@ -475,6 +475,21 @@ xf86platformProbeDev(DriverPtr drvp) - isGPUDevice(devList[i]) ? PLATFORM_PROBE_GPU_SCREEN : 0); - } - -+ return foundScreen; -+} -+ -+int -+xf86platformAddGPUDevices(DriverPtr drvp) -+{ -+ Bool foundScreen = FALSE; -+ GDevPtr *devList; -+ int j; -+ -+ if (!drvp->platformProbe) -+ return FALSE; -+ -+ xf86MatchDevice(drvp->driverName, &devList); -+ - /* if autoaddgpu devices is enabled then go find any unclaimed platform - * devices and add them as GPU screens */ - if (xf86Info.autoAddGPU) { -diff --git a/hw/xfree86/common/xf86platformBus.h b/hw/xfree86/common/xf86platformBus.h -index a7335b9..0f5c0ef 100644 ---- a/hw/xfree86/common/xf86platformBus.h -+++ b/hw/xfree86/common/xf86platformBus.h -@@ -41,6 +41,7 @@ struct xf86_platform_device { - #ifdef XSERVER_PLATFORM_BUS - int xf86platformProbe(void); - int xf86platformProbeDev(DriverPtr drvp); -+int xf86platformAddGPUDevices(DriverPtr drvp); - - extern int xf86_num_platform_devices; - extern struct xf86_platform_device *xf86_platform_devices; -@@ -156,6 +157,11 @@ xf86PlatformMatchDriver(char *matches[], int nmatches); - - extern void xf86platformVTProbe(void); - extern void xf86platformPrimary(void); -+ -+#else -+ -+static inline int xf86platformAddGPUDevices(DriverPtr drvp) { return FALSE; } -+ - #endif - - #endif --- -2.9.3 - diff --git a/0006-xwayland-handle-button-events-after-motion-events.patch b/0006-xwayland-handle-button-events-after-motion-events.patch deleted file mode 100644 index 97b0c48..0000000 --- a/0006-xwayland-handle-button-events-after-motion-events.patch +++ /dev/null @@ -1,121 +0,0 @@ -From 317ce1201a2ec848f9066294ea544b756f735385 Mon Sep 17 00:00:00 2001 -From: Peter Hutterer -Date: Tue, 7 Feb 2017 12:23:46 +1000 -Subject: [PATCH xserver 06/12] xwayland: handle button events after motion - events - -Make sure the button events are sent after the motion events into the new -position. - -Signed-off-by: Peter Hutterer -Acked-by: Ping Cheng -(cherry picked from commit 773b04748d0c839bc8b12e33f74bb8d11c447f5b) ---- - hw/xwayland/xwayland-input.c | 44 +++++++++++++++++++++++++++++++++++++------- - hw/xwayland/xwayland.h | 3 +++ - 2 files changed, 40 insertions(+), 7 deletions(-) - -diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c -index 142862f7e..50da10839 100644 ---- a/hw/xwayland/xwayland-input.c -+++ b/hw/xwayland/xwayland-input.c -@@ -34,6 +34,7 @@ - #include - #include - #include -+#include - #include "tablet-unstable-v2-client-protocol.h" - - /* Copied from mipointer.c */ -@@ -1543,8 +1544,8 @@ tablet_tool_button_state(void *data, struct zwp_tablet_tool_v2 *tool, - { - struct xwl_tablet_tool *xwl_tablet_tool = data; - struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; -+ uint32_t *mask = &xwl_tablet_tool->buttons_now; - int xbtn = 0; -- ValuatorMask mask; - - /* BTN_0 .. BTN_9 */ - if (button >= 0x100 && button <= 0x109) { -@@ -1592,11 +1593,14 @@ tablet_tool_button_state(void *data, struct zwp_tablet_tool_v2 *tool, - return; - } - -- xwl_seat->xwl_screen->serial = serial; -+ BUG_RETURN(xbtn >= 8 * sizeof(*mask)); - -- valuator_mask_zero(&mask); -- QueuePointerEvents(xwl_tablet_tool->xdevice, -- state ? ButtonPress : ButtonRelease, xbtn, 0, &mask); -+ if (state) -+ SetBit(mask, xbtn); -+ else -+ ClearBit(mask, xbtn); -+ -+ xwl_seat->xwl_screen->serial = serial; - } - - static void -@@ -1604,6 +1608,8 @@ tablet_tool_frame(void *data, struct zwp_tablet_tool_v2 *tool, uint32_t time) - { - struct xwl_tablet_tool *xwl_tablet_tool = data; - ValuatorMask mask; -+ uint32_t released, pressed, diff; -+ int button; - - valuator_mask_zero(&mask); - valuator_mask_set(&mask, 0, xwl_tablet_tool->x); -@@ -1613,10 +1619,34 @@ tablet_tool_frame(void *data, struct zwp_tablet_tool_v2 *tool, uint32_t time) - valuator_mask_set(&mask, 4, xwl_tablet_tool->tilt_y); - valuator_mask_set(&mask, 5, xwl_tablet_tool->rotation + xwl_tablet_tool->slider); - -- /* FIXME: Store button mask in xwl_tablet_tool and send events *HERE* if -- changed */ - QueuePointerEvents(xwl_tablet_tool->xdevice, MotionNotify, 0, - POINTER_ABSOLUTE | POINTER_SCREEN, &mask); -+ -+ valuator_mask_zero(&mask); -+ -+ diff = xwl_tablet_tool->buttons_prev ^ xwl_tablet_tool->buttons_now; -+ released = diff & ~xwl_tablet_tool->buttons_now; -+ pressed = diff & xwl_tablet_tool->buttons_now; -+ -+ button = 1; -+ while (released) { -+ if (released & 0x1) -+ QueuePointerEvents(xwl_tablet_tool->xdevice, -+ ButtonRelease, button, 0, &mask); -+ button++; -+ released >>= 1; -+ } -+ -+ button = 1; -+ while (pressed) { -+ if (pressed & 0x1) -+ QueuePointerEvents(xwl_tablet_tool->xdevice, -+ ButtonPress, button, 0, &mask); -+ button++; -+ pressed >>= 1; -+ } -+ -+ xwl_tablet_tool->buttons_prev = xwl_tablet_tool->buttons_now; - } - - static const struct zwp_tablet_tool_v2_listener tablet_tool_listener = { -diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h -index fb9ac4804..bb119dad7 100644 ---- a/hw/xwayland/xwayland.h -+++ b/hw/xwayland/xwayland.h -@@ -202,6 +202,9 @@ struct xwl_tablet_tool { - float tilt_y; - float rotation; - float slider; -+ -+ uint32_t buttons_now, -+ buttons_prev; - }; - - struct xwl_tablet_pad { --- -2.13.5 - diff --git a/0007-xfree86-Try-harder-to-find-atleast-1-non-GPU-Screen.patch b/0007-xfree86-Try-harder-to-find-atleast-1-non-GPU-Screen.patch deleted file mode 100644 index 75dda14..0000000 --- a/0007-xfree86-Try-harder-to-find-atleast-1-non-GPU-Screen.patch +++ /dev/null @@ -1,122 +0,0 @@ -From 02bcb6f189c4ad8b2e73ce99cfa3c10f0c244a88 Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Fri, 30 Sep 2016 12:29:09 +0200 -Subject: [PATCH xserver v2 7/7] xfree86: Try harder to find atleast 1 non GPU - Screen - -If we did not find any non GPU Screens, try again ignoring the notion -of any video devices being the primary device. This fixes Xorg exiting -with a "no screens found" error when using virtio-vga in a -virtual-machine and when using a device driven by simpledrm. - -This is a somewhat ugly solution, but it is the best I can come up with -without major surgery to the bus and probe code. - -Signed-off-by: Hans de Goede ---- - hw/xfree86/common/xf86.h | 1 + - hw/xfree86/common/xf86Bus.c | 26 +++++++++++++++++++++++--- - hw/xfree86/common/xf86Globals.c | 1 + - hw/xfree86/common/xf86pciBus.c | 4 ++++ - hw/xfree86/common/xf86platformBus.c | 4 ++++ - 5 files changed, 33 insertions(+), 3 deletions(-) - -diff --git a/hw/xfree86/common/xf86.h b/hw/xfree86/common/xf86.h -index e54c811..f724688 100644 ---- a/hw/xfree86/common/xf86.h -+++ b/hw/xfree86/common/xf86.h -@@ -55,6 +55,7 @@ - extern _X_EXPORT int xf86DoConfigure; - extern _X_EXPORT int xf86DoShowOptions; - extern _X_EXPORT Bool xf86DoConfigurePass1; -+extern _X_EXPORT Bool xf86ProbeIgnorePrimary; - extern _X_EXPORT Bool xorgHWAccess; - - extern _X_EXPORT DevPrivateKeyRec xf86ScreenKeyRec; -diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c -index a3a9898..9836803 100644 ---- a/hw/xfree86/common/xf86Bus.c -+++ b/hw/xfree86/common/xf86Bus.c -@@ -117,14 +117,34 @@ xf86BusConfig(void) - int i, j; - - /* -- * Now call each of the Probe functions. Each successful probe will -- * result in an extra entry added to the xf86Screens[] list for each -- * instance of the hardware found. -+ * 3 step probe to (hopefully) ensure that we always find at least 1 -+ * (non GPU) screen: -+ * -+ * 1. Call each drivers probe function normally, -+ * Each successful probe will result in an extra entry added to the -+ * xf86Screens[] list for each instance of the hardware found. - */ - for (i = 0; i < xf86NumDrivers; i++) { - xf86CallDriverProbe(xf86DriverList[i], FALSE); - } - -+ /* -+ * 2. If no Screens were found, call each drivers probe function with -+ * ignorePrimary = TRUE, to ensure that we do actually get a -+ * Screen if there is atleast one supported video card. -+ */ -+ if (xf86NumScreens == 0) { -+ xf86ProbeIgnorePrimary = TRUE; -+ for (i = 0; i < xf86NumDrivers && xf86NumScreens == 0; i++) { -+ xf86CallDriverProbe(xf86DriverList[i], FALSE); -+ } -+ xf86ProbeIgnorePrimary = FALSE; -+ } -+ -+ /* -+ * 3. Call xf86platformAddGPUDevices() to add any additional video cards as -+ * GPUScreens (GPUScreens are only supported by platformBus drivers). -+ */ - for (i = 0; i < xf86NumDrivers; i++) { - xf86platformAddGPUDevices(xf86DriverList[i]); - } -diff --git a/hw/xfree86/common/xf86Globals.c b/hw/xfree86/common/xf86Globals.c -index 07cfabf..e962b75 100644 ---- a/hw/xfree86/common/xf86Globals.c -+++ b/hw/xfree86/common/xf86Globals.c -@@ -152,6 +152,7 @@ XF86ConfigPtr xf86configptr = NULL; - Bool xf86Resetting = FALSE; - Bool xf86Initialising = FALSE; - Bool xf86DoConfigure = FALSE; -+Bool xf86ProbeIgnorePrimary = FALSE; - Bool xf86DoShowOptions = FALSE; - DriverPtr *xf86DriverList = NULL; - int xf86NumDrivers = 0; -diff --git a/hw/xfree86/common/xf86pciBus.c b/hw/xfree86/common/xf86pciBus.c -index 8158c2b..9adfee5 100644 ---- a/hw/xfree86/common/xf86pciBus.c -+++ b/hw/xfree86/common/xf86pciBus.c -@@ -352,6 +352,10 @@ xf86ComparePciBusString(const char *busID, int bus, int device, int func) - Bool - xf86IsPrimaryPci(struct pci_device *pPci) - { -+ /* Add max. 1 screen for the IgnorePrimary fallback path */ -+ if (xf86ProbeIgnorePrimary && xf86NumScreens == 0) -+ return TRUE; -+ - if (primaryBus.type == BUS_PCI) - return pPci == primaryBus.id.pci; - #ifdef XSERVER_PLATFORM_BUS -diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c -index 8dd0d5d..063e81c 100644 ---- a/hw/xfree86/common/xf86platformBus.c -+++ b/hw/xfree86/common/xf86platformBus.c -@@ -114,6 +114,10 @@ xf86_find_platform_device_by_devnum(int major, int minor) - static Bool - xf86IsPrimaryPlatform(struct xf86_platform_device *plat) - { -+ /* Add max. 1 screen for the IgnorePrimary fallback path */ -+ if (xf86ProbeIgnorePrimary && xf86NumScreens == 0) -+ return TRUE; -+ - if (primaryBus.type == BUS_PLATFORM) - return plat == primaryBus.id.plat; - #ifdef XSERVER_LIBPCIACCESS --- -2.9.3 - diff --git a/0007-xwayland-Refactor-cursor-management-into-xwl_cursor.patch b/0007-xwayland-Refactor-cursor-management-into-xwl_cursor.patch deleted file mode 100644 index c3bcd11..0000000 --- a/0007-xwayland-Refactor-cursor-management-into-xwl_cursor.patch +++ /dev/null @@ -1,213 +0,0 @@ -From 94a88b752a9373656bb0f62897513c8f5e552127 Mon Sep 17 00:00:00 2001 -From: Carlos Garnacho -Date: Fri, 4 Nov 2016 19:36:10 +0100 -Subject: [PATCH xserver 07/12] xwayland: Refactor cursor management into - xwl_cursor - -This struct takes away the cursor info in xwl_seat, and has -an update function so we can share the frame handling code -across several xwl_cursors. - -Signed-off-by: Carlos Garnacho -Reviewed-by: Peter Hutterer -Signed-off-by: Peter Hutterer -Acked-by: Ping Cheng -(cherry picked from commit 6d1ad39fe6c18220dd39b0653fd1e4145140e2dc) ---- - hw/xwayland/xwayland-cursor.c | 39 ++++++++++++++++++++------------------- - hw/xwayland/xwayland-input.c | 38 +++++++++++++++++++++++++++++++------- - hw/xwayland/xwayland.h | 11 ++++++++--- - 3 files changed, 59 insertions(+), 29 deletions(-) - -diff --git a/hw/xwayland/xwayland-cursor.c b/hw/xwayland/xwayland-cursor.c -index f334f1ca5..fdae3ce85 100644 ---- a/hw/xwayland/xwayland-cursor.c -+++ b/hw/xwayland/xwayland-cursor.c -@@ -96,11 +96,11 @@ xwl_unrealize_cursor(DeviceIntPtr device, ScreenPtr screen, CursorPtr cursor) - } - - static void --clear_cursor_frame_callback(struct xwl_seat *xwl_seat) -+clear_cursor_frame_callback(struct xwl_cursor *xwl_cursor) - { -- if (xwl_seat->cursor_frame_cb) { -- wl_callback_destroy (xwl_seat->cursor_frame_cb); -- xwl_seat->cursor_frame_cb = NULL; -+ if (xwl_cursor->frame_cb) { -+ wl_callback_destroy (xwl_cursor->frame_cb); -+ xwl_cursor->frame_cb = NULL; - } - } - -@@ -109,12 +109,12 @@ frame_callback(void *data, - struct wl_callback *callback, - uint32_t time) - { -- struct xwl_seat *xwl_seat = data; -+ struct xwl_cursor *xwl_cursor = data; - -- clear_cursor_frame_callback(xwl_seat); -- if (xwl_seat->cursor_needs_update) { -- xwl_seat->cursor_needs_update = FALSE; -- xwl_seat_set_cursor(xwl_seat); -+ clear_cursor_frame_callback(xwl_cursor); -+ if (xwl_cursor->needs_update) { -+ xwl_cursor->needs_update = FALSE; -+ xwl_cursor->update_proc(xwl_cursor); - } - } - -@@ -125,6 +125,7 @@ static const struct wl_callback_listener frame_listener = { - void - xwl_seat_set_cursor(struct xwl_seat *xwl_seat) - { -+ struct xwl_cursor *xwl_cursor = &xwl_seat->cursor; - PixmapPtr pixmap; - CursorPtr cursor; - int stride; -@@ -135,13 +136,13 @@ xwl_seat_set_cursor(struct xwl_seat *xwl_seat) - if (!xwl_seat->x_cursor) { - wl_pointer_set_cursor(xwl_seat->wl_pointer, - xwl_seat->pointer_enter_serial, NULL, 0, 0); -- clear_cursor_frame_callback(xwl_seat); -- xwl_seat->cursor_needs_update = FALSE; -+ clear_cursor_frame_callback(xwl_cursor); -+ xwl_cursor->needs_update = FALSE; - return; - } - -- if (xwl_seat->cursor_frame_cb) { -- xwl_seat->cursor_needs_update = TRUE; -+ if (xwl_cursor->frame_cb) { -+ xwl_cursor->needs_update = TRUE; - return; - } - -@@ -159,19 +160,19 @@ xwl_seat_set_cursor(struct xwl_seat *xwl_seat) - - wl_pointer_set_cursor(xwl_seat->wl_pointer, - xwl_seat->pointer_enter_serial, -- xwl_seat->cursor, -+ xwl_cursor->surface, - xwl_seat->x_cursor->bits->xhot, - xwl_seat->x_cursor->bits->yhot); -- wl_surface_attach(xwl_seat->cursor, -+ wl_surface_attach(xwl_cursor->surface, - xwl_shm_pixmap_get_wl_buffer(pixmap), 0, 0); -- wl_surface_damage(xwl_seat->cursor, 0, 0, -+ wl_surface_damage(xwl_cursor->surface, 0, 0, - xwl_seat->x_cursor->bits->width, - xwl_seat->x_cursor->bits->height); - -- xwl_seat->cursor_frame_cb = wl_surface_frame(xwl_seat->cursor); -- wl_callback_add_listener(xwl_seat->cursor_frame_cb, &frame_listener, xwl_seat); -+ xwl_cursor->frame_cb = wl_surface_frame(xwl_cursor->surface); -+ wl_callback_add_listener(xwl_cursor->frame_cb, &frame_listener, xwl_cursor); - -- wl_surface_commit(xwl_seat->cursor); -+ wl_surface_commit(xwl_cursor->surface); - } - - static void -diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c -index 50da10839..bb520e891 100644 ---- a/hw/xwayland/xwayland-input.c -+++ b/hw/xwayland/xwayland-input.c -@@ -424,9 +424,9 @@ pointer_handle_enter(void *data, struct wl_pointer *pointer, - * of our surfaces might not have been shown. In that case we'll - * have a cursor surface frame callback pending which we need to - * clear so that we can continue submitting new cursor frames. */ -- if (xwl_seat->cursor_frame_cb) { -- wl_callback_destroy(xwl_seat->cursor_frame_cb); -- xwl_seat->cursor_frame_cb = NULL; -+ if (xwl_seat->cursor.frame_cb) { -+ wl_callback_destroy(xwl_seat->cursor.frame_cb); -+ xwl_seat->cursor.frame_cb = NULL; - xwl_seat_set_cursor(xwl_seat); - } - -@@ -1203,6 +1203,31 @@ static const struct wl_seat_listener seat_listener = { - }; - - static void -+xwl_cursor_init(struct xwl_cursor *xwl_cursor, struct xwl_screen *xwl_screen, -+ void (* update_proc)(struct xwl_cursor *)) -+{ -+ xwl_cursor->surface = wl_compositor_create_surface(xwl_screen->compositor); -+ xwl_cursor->update_proc = update_proc; -+ xwl_cursor->frame_cb = NULL; -+ xwl_cursor->needs_update = FALSE; -+} -+ -+static void -+xwl_cursor_release(struct xwl_cursor *xwl_cursor) -+{ -+ wl_surface_destroy(xwl_cursor->surface); -+ if (xwl_cursor->frame_cb) -+ wl_callback_destroy(xwl_cursor->frame_cb); -+} -+ -+static void -+xwl_seat_update_cursor(struct xwl_cursor *xwl_cursor) -+{ -+ struct xwl_seat *xwl_seat = wl_container_of(xwl_cursor, xwl_seat, cursor); -+ xwl_seat_set_cursor(xwl_seat); -+} -+ -+static void - create_input_device(struct xwl_screen *xwl_screen, uint32_t id, uint32_t version) - { - struct xwl_seat *xwl_seat; -@@ -1221,7 +1246,8 @@ create_input_device(struct xwl_screen *xwl_screen, uint32_t id, uint32_t version - &wl_seat_interface, min(version, 5)); - xwl_seat->id = id; - -- xwl_seat->cursor = wl_compositor_create_surface(xwl_screen->compositor); -+ xwl_cursor_init(&xwl_seat->cursor, xwl_seat->xwl_screen, -+ xwl_seat_update_cursor); - wl_seat_add_listener(xwl_seat->seat, &seat_listener, xwl_seat); - - init_tablet_manager_seat(xwl_screen, xwl_seat); -@@ -1252,9 +1278,7 @@ xwl_seat_destroy(struct xwl_seat *xwl_seat) - release_tablet_manager_seat(xwl_seat); - - wl_seat_destroy(xwl_seat->seat); -- wl_surface_destroy(xwl_seat->cursor); -- if (xwl_seat->cursor_frame_cb) -- wl_callback_destroy(xwl_seat->cursor_frame_cb); -+ xwl_cursor_release(&xwl_seat->cursor); - wl_array_release(&xwl_seat->keys); - free(xwl_seat); - } -diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h -index bb119dad7..bfa5f47c7 100644 ---- a/hw/xwayland/xwayland.h -+++ b/hw/xwayland/xwayland.h -@@ -127,6 +127,13 @@ struct xwl_pointer_warp_emulator { - struct zwp_locked_pointer_v1 *locked_pointer; - }; - -+struct xwl_cursor { -+ void (* update_proc) (struct xwl_cursor *); -+ struct wl_surface *surface; -+ struct wl_callback *frame_cb; -+ Bool needs_update; -+}; -+ - struct xwl_seat { - DeviceIntPtr pointer; - DeviceIntPtr relative_pointer; -@@ -148,9 +155,7 @@ struct xwl_seat { - uint32_t pointer_enter_serial; - struct xorg_list link; - CursorPtr x_cursor; -- struct wl_surface *cursor; -- struct wl_callback *cursor_frame_cb; -- Bool cursor_needs_update; -+ struct xwl_cursor cursor; - WindowPtr last_xwindow; - - struct xorg_list touches; --- -2.13.5 - diff --git a/0008-xwayland-update-cursor-on-tablet-tools-in-proximity.patch b/0008-xwayland-update-cursor-on-tablet-tools-in-proximity.patch deleted file mode 100644 index fa5472c..0000000 --- a/0008-xwayland-update-cursor-on-tablet-tools-in-proximity.patch +++ /dev/null @@ -1,208 +0,0 @@ -From 78a4493bc8e60da7b97342660dd1ff6de844e951 Mon Sep 17 00:00:00 2001 -From: Carlos Garnacho -Date: Fri, 4 Nov 2016 19:58:04 +0100 -Subject: [PATCH xserver 08/12] xwayland: update cursor on tablet tools in - proximity - -Each xwl_tablet_tool gets a xwl_cursor, as on wayland each of those -will get an independent cursor that can be set through -zwp_tablet_tool.set_cursor. - -However, all tools (and the pointer) share conceptually the same VCP -on Xwayland, so have cursor changes trigger a xwl_cursor update on -every tool (and the pointer, again). Maybe Xwayland could keep track -of the most recent device and only update that cursor to get better -visual results, but this is simpler, and it's going to be odd -anyway... - -Signed-off-by: Carlos Garnacho -Reviewed-by: Peter Hutterer -Signed-off-by: Peter Hutterer -Acked-by: Ping Cheng -(cherry picked from commit f471b5b8eb451b442554517c7cb6f0aa90d218c4) ---- - hw/xwayland/xwayland-cursor.c | 56 +++++++++++++++++++++++++++++++++++++++++++ - hw/xwayland/xwayland-input.c | 17 +++++++++++++ - hw/xwayland/xwayland.h | 5 ++++ - 3 files changed, 78 insertions(+) - -diff --git a/hw/xwayland/xwayland-cursor.c b/hw/xwayland/xwayland-cursor.c -index fdae3ce85..c95f4e830 100644 ---- a/hw/xwayland/xwayland-cursor.c -+++ b/hw/xwayland/xwayland-cursor.c -@@ -175,11 +175,62 @@ xwl_seat_set_cursor(struct xwl_seat *xwl_seat) - wl_surface_commit(xwl_cursor->surface); - } - -+void -+xwl_tablet_tool_set_cursor(struct xwl_tablet_tool *xwl_tablet_tool) -+{ -+ struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; -+ struct xwl_cursor *xwl_cursor = &xwl_tablet_tool->cursor; -+ PixmapPtr pixmap; -+ CursorPtr cursor; -+ int stride; -+ -+ if (!xwl_seat->x_cursor) { -+ zwp_tablet_tool_v2_set_cursor(xwl_tablet_tool->tool, -+ xwl_tablet_tool->proximity_in_serial, -+ NULL, 0, 0); -+ return; -+ } -+ -+ if (xwl_cursor->frame_cb) { -+ xwl_cursor->needs_update = TRUE; -+ return; -+ } -+ -+ cursor = xwl_seat->x_cursor; -+ pixmap = dixGetPrivate(&cursor->devPrivates, &xwl_cursor_private_key); -+ if (!pixmap) -+ return; -+ -+ stride = cursor->bits->width * 4; -+ if (cursor->bits->argb) -+ memcpy(pixmap->devPrivate.ptr, -+ cursor->bits->argb, cursor->bits->height * stride); -+ else -+ expand_source_and_mask(cursor, pixmap->devPrivate.ptr); -+ -+ zwp_tablet_tool_v2_set_cursor(xwl_tablet_tool->tool, -+ xwl_tablet_tool->proximity_in_serial, -+ xwl_cursor->surface, -+ xwl_seat->x_cursor->bits->xhot, -+ xwl_seat->x_cursor->bits->yhot); -+ wl_surface_attach(xwl_cursor->surface, -+ xwl_shm_pixmap_get_wl_buffer(pixmap), 0, 0); -+ wl_surface_damage(xwl_cursor->surface, 0, 0, -+ xwl_seat->x_cursor->bits->width, -+ xwl_seat->x_cursor->bits->height); -+ -+ xwl_cursor->frame_cb = wl_surface_frame(xwl_cursor->surface); -+ wl_callback_add_listener(xwl_cursor->frame_cb, &frame_listener, xwl_cursor); -+ -+ wl_surface_commit(xwl_cursor->surface); -+} -+ - static void - xwl_set_cursor(DeviceIntPtr device, - ScreenPtr screen, CursorPtr cursor, int x, int y) - { - struct xwl_seat *xwl_seat; -+ struct xwl_tablet_tool *xwl_tablet_tool; - Bool cursor_visibility_changed; - - xwl_seat = device->public.devicePrivate; -@@ -194,6 +245,11 @@ xwl_set_cursor(DeviceIntPtr device, - xwl_seat_cursor_visibility_changed(xwl_seat); - - xwl_seat_set_cursor(xwl_seat); -+ -+ xorg_list_for_each_entry(xwl_tablet_tool, &xwl_seat->tablet_tools, link) { -+ if (xwl_tablet_tool->proximity_in_serial != 0) -+ xwl_tablet_tool_set_cursor(xwl_tablet_tool); -+ } - } - - static void -diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c -index bb520e891..77cd42789 100644 ---- a/hw/xwayland/xwayland-input.c -+++ b/hw/xwayland/xwayland-input.c -@@ -1405,6 +1405,7 @@ tablet_tool_receive_removed(void *data, struct zwp_tablet_tool_v2 *tool) - struct xwl_tablet_tool *xwl_tablet_tool = data; - - xorg_list_del(&xwl_tablet_tool->link); -+ xwl_cursor_release(&xwl_tablet_tool->cursor); - zwp_tablet_tool_v2_destroy(tool); - free(xwl_tablet_tool); - } -@@ -1428,7 +1429,10 @@ tablet_tool_proximity_in(void *data, struct zwp_tablet_tool_v2 *tool, - if (wl_surface == NULL) - return; - -+ xwl_tablet_tool->proximity_in_serial = serial; - xwl_seat->focus_window = wl_surface_get_user_data(wl_surface); -+ -+ xwl_tablet_tool_set_cursor(xwl_tablet_tool); - } - - static void -@@ -1437,6 +1441,7 @@ tablet_tool_proximity_out(void *data, struct zwp_tablet_tool_v2 *tool) - struct xwl_tablet_tool *xwl_tablet_tool = data; - struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; - -+ xwl_tablet_tool->proximity_in_serial = 0; - xwl_seat->focus_window = NULL; - - xwl_tablet_tool->pressure = 0; -@@ -1717,10 +1722,20 @@ tablet_seat_handle_add_tablet(void *data, struct zwp_tablet_seat_v2 *tablet_seat - } - - static void -+xwl_tablet_tool_update_cursor(struct xwl_cursor *xwl_cursor) -+{ -+ struct xwl_tablet_tool *xwl_tablet_tool = wl_container_of(xwl_cursor, -+ xwl_tablet_tool, -+ cursor); -+ xwl_tablet_tool_set_cursor(xwl_tablet_tool); -+} -+ -+static void - tablet_seat_handle_add_tool(void *data, struct zwp_tablet_seat_v2 *tablet_seat, - struct zwp_tablet_tool_v2 *tool) - { - struct xwl_seat *xwl_seat = data; -+ struct xwl_screen *xwl_screen = xwl_seat->xwl_screen; - struct xwl_tablet_tool *xwl_tablet_tool; - - xwl_tablet_tool = calloc(sizeof *xwl_tablet_tool, 1); -@@ -1731,6 +1746,8 @@ tablet_seat_handle_add_tool(void *data, struct zwp_tablet_seat_v2 *tablet_seat, - - xwl_tablet_tool->tool = tool; - xwl_tablet_tool->seat = xwl_seat; -+ xwl_cursor_init(&xwl_tablet_tool->cursor, xwl_screen, -+ xwl_tablet_tool_update_cursor); - - xorg_list_add(&xwl_tablet_tool->link, &xwl_seat->tablet_tools); - -diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h -index bfa5f47c7..02a218c43 100644 ---- a/hw/xwayland/xwayland.h -+++ b/hw/xwayland/xwayland.h -@@ -44,6 +44,7 @@ - - #include "relative-pointer-unstable-v1-client-protocol.h" - #include "pointer-constraints-unstable-v1-client-protocol.h" -+#include "tablet-unstable-v2-client-protocol.h" - - struct xwl_screen { - int width; -@@ -200,6 +201,7 @@ struct xwl_tablet_tool { - struct xwl_seat *seat; - - DeviceIntPtr xdevice; -+ uint32_t proximity_in_serial; - uint32_t x; - uint32_t y; - uint32_t pressure; -@@ -210,6 +212,8 @@ struct xwl_tablet_tool { - - uint32_t buttons_now, - buttons_prev; -+ -+ struct xwl_cursor cursor; - }; - - struct xwl_tablet_pad { -@@ -237,6 +241,7 @@ Bool xwl_screen_init_cursor(struct xwl_screen *xwl_screen); - - struct xwl_screen *xwl_screen_get(ScreenPtr screen); - -+void xwl_tablet_tool_set_cursor(struct xwl_tablet_tool *tool); - void xwl_seat_set_cursor(struct xwl_seat *xwl_seat); - - void xwl_seat_destroy(struct xwl_seat *xwl_seat); --- -2.13.5 - diff --git a/0009-xwayland-add-tablet-pad-support.patch b/0009-xwayland-add-tablet-pad-support.patch deleted file mode 100644 index 8158d92..0000000 --- a/0009-xwayland-add-tablet-pad-support.patch +++ /dev/null @@ -1,511 +0,0 @@ -From 6f79f4993d351a891a715e994ab9574542e64b35 Mon Sep 17 00:00:00 2001 -From: Peter Hutterer -Date: Tue, 7 Feb 2017 15:04:46 +1000 -Subject: [PATCH xserver 09/12] xwayland: add tablet pad support - -Hooked up a bit differently to the other tools. Those tools can be static for -all and be re-used. The wacom driver initializes the pad with the correct -number of buttons though and we can't do this until we have the pad done event. - -If the tablet is removed and we plug a different one in, we should initialize -that correctly, so unlike the other tools the pad is properly removed and -re-initialized on plug. - -Signed-off-by: Peter Hutterer -Acked-by: Ping Cheng -(cherry picked from commit 8475e6360ce31551d50fd63a26f7a44d1e8928f2) ---- - hw/xwayland/xwayland-input.c | 417 +++++++++++++++++++++++++++++++++++++++++++ - hw/xwayland/xwayland.h | 28 +++ - 2 files changed, 445 insertions(+) - -diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c -index 77cd42789..8011b965c 100644 ---- a/hw/xwayland/xwayland-input.c -+++ b/hw/xwayland/xwayland-input.c -@@ -1341,6 +1341,7 @@ tablet_handle_removed(void *data, struct zwp_tablet_v2 *tablet) - DisableDevice(xwl_seat->eraser, TRUE); - if (xwl_seat->puck) - DisableDevice(xwl_seat->puck, TRUE); -+ /* pads are removed separately */ - } - - zwp_tablet_v2_destroy(tablet); -@@ -1701,6 +1702,418 @@ static const struct zwp_tablet_tool_v2_listener tablet_tool_listener = { - }; - - static void -+tablet_pad_ring_destroy(struct xwl_tablet_pad_ring *ring) -+{ -+ zwp_tablet_pad_ring_v2_destroy(ring->ring); -+ xorg_list_del(&ring->link); -+ free(ring); -+} -+ -+static void -+tablet_pad_ring_source(void *data, -+ struct zwp_tablet_pad_ring_v2 *zwp_tablet_pad_ring_v2, -+ uint32_t source) -+{ -+} -+ -+static void -+tablet_pad_ring_angle(void *data, -+ struct zwp_tablet_pad_ring_v2 *zwp_tablet_pad_ring_v2, -+ wl_fixed_t degrees) -+{ -+ struct xwl_tablet_pad_ring *ring = data; -+ struct xwl_tablet_pad *pad = ring->group->pad; -+ double deg = wl_fixed_to_double(degrees); -+ ValuatorMask mask; -+ -+ valuator_mask_zero(&mask); -+ valuator_mask_set(&mask, 5 + ring->index, deg/360.0 * 71); -+ QueuePointerEvents(pad->xdevice, MotionNotify, 0, 0, &mask); -+} -+ -+static void -+tablet_pad_ring_stop(void *data, -+ struct zwp_tablet_pad_ring_v2 *zwp_tablet_pad_ring_v2) -+{ -+} -+ -+static void -+tablet_pad_ring_frame(void *data, -+ struct zwp_tablet_pad_ring_v2 *zwp_tablet_pad_ring_v2, -+ uint32_t time) -+{ -+} -+ -+static const struct zwp_tablet_pad_ring_v2_listener tablet_pad_ring_listener = { -+ tablet_pad_ring_source, -+ tablet_pad_ring_angle, -+ tablet_pad_ring_stop, -+ tablet_pad_ring_frame, -+}; -+ -+ -+static void -+tablet_pad_strip_destroy(struct xwl_tablet_pad_strip *strip) -+{ -+ zwp_tablet_pad_strip_v2_destroy(strip->strip); -+ xorg_list_del(&strip->link); -+ free(strip); -+} -+ -+static void -+tablet_pad_strip_source(void *data, -+ struct zwp_tablet_pad_strip_v2 *zwp_tablet_pad_strip_v2, -+ uint32_t source) -+{ -+} -+ -+static void -+tablet_pad_strip_position(void *data, -+ struct zwp_tablet_pad_strip_v2 *zwp_tablet_pad_strip_v2, -+ uint32_t position) -+{ -+ struct xwl_tablet_pad_strip *strip = data; -+ struct xwl_tablet_pad *pad = strip->group->pad; -+ ValuatorMask mask; -+ -+ valuator_mask_zero(&mask); -+ valuator_mask_set(&mask, 3 + strip->index, position/65535.0 * 2048); -+ QueuePointerEvents(pad->xdevice, MotionNotify, 0, 0, &mask); -+} -+ -+static void -+tablet_pad_strip_stop(void *data, -+ struct zwp_tablet_pad_strip_v2 *zwp_tablet_pad_strip_v2) -+{ -+} -+ -+static void -+tablet_pad_strip_frame(void *data, -+ struct zwp_tablet_pad_strip_v2 *zwp_tablet_pad_strip_v2, -+ uint32_t time) -+{ -+} -+ -+static const struct zwp_tablet_pad_strip_v2_listener tablet_pad_strip_listener = { -+ tablet_pad_strip_source, -+ tablet_pad_strip_position, -+ tablet_pad_strip_stop, -+ tablet_pad_strip_frame, -+}; -+ -+static void -+tablet_pad_group_destroy(struct xwl_tablet_pad_group *group) -+{ -+ struct xwl_tablet_pad_ring *r, *tr; -+ struct xwl_tablet_pad_strip *s, *ts; -+ -+ xorg_list_for_each_entry_safe(r, tr, -+ &group->pad_group_ring_list, -+ link) -+ tablet_pad_ring_destroy(r); -+ -+ xorg_list_for_each_entry_safe(s, ts, -+ &group->pad_group_strip_list, -+ link) -+ tablet_pad_strip_destroy(s); -+ -+ zwp_tablet_pad_group_v2_destroy(group->group); -+ xorg_list_del(&group->link); -+ free(group); -+} -+ -+static void -+tablet_pad_group_buttons(void *data, -+ struct zwp_tablet_pad_group_v2 *zwp_tablet_pad_group_v2, -+ struct wl_array *buttons) -+{ -+ -+} -+ -+static void -+tablet_pad_group_ring(void *data, -+ struct zwp_tablet_pad_group_v2 *zwp_tablet_pad_group_v2, -+ struct zwp_tablet_pad_ring_v2 *wp_ring) -+{ -+ static unsigned int ring_index = 0; -+ struct xwl_tablet_pad_group *group = data; -+ struct xwl_tablet_pad_ring *ring; -+ -+ ring = calloc(1, sizeof *ring); -+ if (ring == NULL) { -+ ErrorF("%s ENOMEM\n", __func__); -+ return; -+ } -+ -+ ring->index = ring_index++; -+ ring->group = group; -+ ring->ring = wp_ring; -+ -+ xorg_list_add(&ring->link, &group->pad_group_ring_list); -+ -+ zwp_tablet_pad_ring_v2_add_listener(wp_ring, &tablet_pad_ring_listener, -+ ring); -+} -+ -+static void -+tablet_pad_group_strip(void *data, -+ struct zwp_tablet_pad_group_v2 *zwp_tablet_pad_group_v2, -+ struct zwp_tablet_pad_strip_v2 *wp_strip) -+{ -+ static unsigned int strip_index = 0; -+ struct xwl_tablet_pad_group *group = data; -+ struct xwl_tablet_pad_strip *strip; -+ -+ strip = calloc(1, sizeof *strip); -+ if (strip == NULL) { -+ ErrorF("%s ENOMEM\n", __func__); -+ return; -+ } -+ -+ strip->index = strip_index++; -+ strip->group = group; -+ strip->strip = wp_strip; -+ -+ xorg_list_add(&strip->link, &group->pad_group_strip_list); -+ -+ zwp_tablet_pad_strip_v2_add_listener(wp_strip, &tablet_pad_strip_listener, -+ strip); -+} -+ -+static void -+tablet_pad_group_modes(void *data, -+ struct zwp_tablet_pad_group_v2 *zwp_tablet_pad_group_v2, -+ uint32_t modes) -+{ -+ -+} -+ -+static void -+tablet_pad_group_done(void *data, -+ struct zwp_tablet_pad_group_v2 *zwp_tablet_pad_group_v2) -+{ -+ -+} -+ -+static void -+tablet_pad_group_mode_switch(void *data, -+ struct zwp_tablet_pad_group_v2 *zwp_tablet_pad_group_v2, -+ uint32_t time, -+ uint32_t serial, -+ uint32_t mode) -+{ -+ -+} -+ -+static struct zwp_tablet_pad_group_v2_listener tablet_pad_group_listener = { -+ tablet_pad_group_buttons, -+ tablet_pad_group_ring, -+ tablet_pad_group_strip, -+ tablet_pad_group_modes, -+ tablet_pad_group_done, -+ tablet_pad_group_mode_switch, -+}; -+ -+static int -+xwl_tablet_pad_proc(DeviceIntPtr device, int what) -+{ -+ struct xwl_tablet_pad *pad = device->public.devicePrivate; -+ /* Axis layout mirrors that of xf86-input-wacom to have better -+ compatibility with existing clients */ -+#define NAXES 7 -+ Atom axes_labels[NAXES] = { 0 }; -+ BYTE map[MAX_BUTTONS + 1]; -+ int i = 0; -+ Atom btn_labels[MAX_BUTTONS] = { 0 }; /* btn labels are meaningless */ -+ int nbuttons; -+ -+ switch (what) { -+ case DEVICE_INIT: -+ device->public.on = FALSE; -+ -+ axes_labels[0] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_X); -+ axes_labels[1] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_Y); -+ /* The others have no good mapping */ -+ -+ if (!InitValuatorClassDeviceStruct(device, NAXES, axes_labels, -+ GetMotionHistorySize(), Absolute)) -+ return BadValue; -+ -+ for (i = 1; i <= MAX_BUTTONS; i++) -+ map[i] = i; -+ -+ /* We need at least 7 buttons to allow scrolling */ -+ nbuttons = min(max(pad->nbuttons + 4, 7), MAX_BUTTONS); -+ -+ if (!InitButtonClassDeviceStruct(device, nbuttons, -+ btn_labels, map)) -+ return BadValue; -+ -+ /* Valuators */ -+ InitValuatorAxisStruct(device, 0, axes_labels[0], -+ 0, 100, 1, 0, 1, Absolute); -+ InitValuatorAxisStruct(device, 1, axes_labels[1], -+ 0, 100, 1, 0, 1, Absolute); -+ /* Pressure - unused, for backwards compat only */ -+ InitValuatorAxisStruct(device, 2, axes_labels[2], -+ 0, 2048, 1, 0, 1, Absolute); -+ /* strip x */ -+ InitValuatorAxisStruct(device, 3, axes_labels[3], -+ 0, 2048, 1, 0, 1, Absolute); -+ /* strip y */ -+ InitValuatorAxisStruct(device, 4, axes_labels[4], -+ 0, 2048, 1, 0, 1, Absolute); -+ /* ring */ -+ InitValuatorAxisStruct(device, 5, axes_labels[5], -+ 0, 71, 1, 0, 1, Absolute); -+ /* ring2 */ -+ InitValuatorAxisStruct(device, 6, axes_labels[6], -+ 0, 71, 1, 0, 1, Absolute); -+ -+ if (!InitPtrFeedbackClassDeviceStruct(device, xwl_pointer_control)) -+ return BadValue; -+ -+ return Success; -+ -+ case DEVICE_ON: -+ device->public.on = TRUE; -+ return Success; -+ -+ case DEVICE_OFF: -+ case DEVICE_CLOSE: -+ device->public.on = FALSE; -+ return Success; -+ } -+ -+ return BadMatch; -+#undef NAXES -+} -+ -+static void -+tablet_pad_group(void *data, -+ struct zwp_tablet_pad_v2 *zwp_tablet_pad_v2, -+ struct zwp_tablet_pad_group_v2 *pad_group) -+{ -+ struct xwl_tablet_pad *pad = data; -+ struct xwl_tablet_pad_group *group; -+ -+ group = calloc(1, sizeof *group); -+ if (pad == NULL) { -+ ErrorF("%s ENOMEM\n", __func__); -+ return; -+ } -+ -+ group->pad = pad; -+ group->group = pad_group; -+ xorg_list_init(&group->pad_group_ring_list); -+ xorg_list_init(&group->pad_group_strip_list); -+ -+ xorg_list_add(&group->link, &pad->pad_group_list); -+ -+ zwp_tablet_pad_group_v2_add_listener(pad_group, -+ &tablet_pad_group_listener, -+ group); -+} -+ -+static void -+tablet_pad_path(void *data, -+ struct zwp_tablet_pad_v2 *zwp_tablet_pad_v2, -+ const char *path) -+{ -+ -+} -+ -+static void -+tablet_pad_buttons(void *data, -+ struct zwp_tablet_pad_v2 *zwp_tablet_pad_v2, -+ uint32_t buttons) -+{ -+ struct xwl_tablet_pad *pad = data; -+ -+ pad->nbuttons = buttons; -+} -+ -+static void -+tablet_pad_done(void *data, -+ struct zwp_tablet_pad_v2 *zwp_tablet_pad_v2) -+{ -+ struct xwl_tablet_pad *pad = data; -+ -+ pad->xdevice = add_device(pad->seat, "xwayland-pad", -+ xwl_tablet_pad_proc); -+ pad->xdevice->public.devicePrivate = pad; -+ ActivateDevice(pad->xdevice, TRUE); -+ EnableDevice(pad->xdevice, TRUE); -+} -+ -+static void -+tablet_pad_button(void *data, -+ struct zwp_tablet_pad_v2 *zwp_tablet_pad_v2, -+ uint32_t time, -+ uint32_t button, -+ uint32_t state) -+{ -+ struct xwl_tablet_pad *pad = data; -+ ValuatorMask mask; -+ -+ button++; /* wayland index vs X's 1-offset */ -+ /* skip scroll wheel buttons 4-7 */ -+ button = button > 3 ? button + 4 : button; -+ -+ valuator_mask_zero(&mask); -+ QueuePointerEvents(pad->xdevice, -+ state ? ButtonPress : ButtonRelease, button, 0, &mask); -+} -+ -+static void -+tablet_pad_enter(void *data, -+ struct zwp_tablet_pad_v2 *zwp_tablet_pad_v2, -+ uint32_t serial, -+ struct zwp_tablet_v2 *tablet, -+ struct wl_surface *surface) -+{ -+ /* pairs the pad with the tablet but also to set the focus. We -+ * don't care about the pairing and always use X's focus */ -+} -+ -+static void -+tablet_pad_leave(void *data, -+ struct zwp_tablet_pad_v2 *zwp_tablet_pad_v2, -+ uint32_t serial, -+ struct wl_surface *surface) -+{ -+ /* pairs the pad with the tablet but also to set the focus. We -+ * don't care about the pairing and always use X's focus */ -+} -+ -+static void -+tablet_pad_removed(void *data, -+ struct zwp_tablet_pad_v2 *zwp_tablet_pad_v2) -+{ -+ struct xwl_tablet_pad *pad = data; -+ struct xwl_tablet_pad_group *g, *tg; -+ -+ xorg_list_for_each_entry_safe(g, tg, &pad->pad_group_list, link) -+ tablet_pad_group_destroy(g); -+ -+ RemoveDevice(pad->xdevice, TRUE); -+ xorg_list_del(&pad->link); -+ zwp_tablet_pad_v2_destroy(pad->pad); -+ free(pad); -+} -+ -+static const struct zwp_tablet_pad_v2_listener tablet_pad_listener = { -+ tablet_pad_group, -+ tablet_pad_path, -+ tablet_pad_buttons, -+ tablet_pad_done, -+ tablet_pad_button, -+ tablet_pad_enter, -+ tablet_pad_leave, -+ tablet_pad_removed, -+}; -+ -+static void - tablet_seat_handle_add_tablet(void *data, struct zwp_tablet_seat_v2 *tablet_seat, - struct zwp_tablet_v2 *tablet) - { -@@ -1769,8 +2182,12 @@ tablet_seat_handle_add_pad(void *data, struct zwp_tablet_seat_v2 *tablet_seat, - - xwl_tablet_pad->pad = pad; - xwl_tablet_pad->seat = xwl_seat; -+ xorg_list_init(&xwl_tablet_pad->pad_group_list); - - xorg_list_add(&xwl_tablet_pad->link, &xwl_seat->tablet_pads); -+ -+ zwp_tablet_pad_v2_add_listener(pad, &tablet_pad_listener, -+ xwl_tablet_pad); - } - - static const struct zwp_tablet_seat_v2_listener tablet_seat_listener = { -diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h -index 02a218c43..250564f73 100644 ---- a/hw/xwayland/xwayland.h -+++ b/hw/xwayland/xwayland.h -@@ -216,10 +216,38 @@ struct xwl_tablet_tool { - struct xwl_cursor cursor; - }; - -+struct xwl_tablet_pad_ring { -+ unsigned int index; -+ struct xorg_list link; -+ struct xwl_tablet_pad_group *group; -+ struct zwp_tablet_pad_ring_v2 *ring; -+}; -+ -+struct xwl_tablet_pad_strip { -+ unsigned int index; -+ struct xorg_list link; -+ struct xwl_tablet_pad_group *group; -+ struct zwp_tablet_pad_strip_v2 *strip; -+}; -+ -+struct xwl_tablet_pad_group { -+ struct xorg_list link; -+ struct xwl_tablet_pad *pad; -+ struct zwp_tablet_pad_group_v2 *group; -+ -+ struct xorg_list pad_group_ring_list; -+ struct xorg_list pad_group_strip_list; -+}; -+ - struct xwl_tablet_pad { - struct xorg_list link; - struct zwp_tablet_pad_v2 *pad; - struct xwl_seat *seat; -+ -+ DeviceIntPtr xdevice; -+ -+ unsigned int nbuttons; -+ struct xorg_list pad_group_list; - }; - - struct xwl_output { --- -2.13.5 - diff --git a/0010-xwayland-Unconditionally-initialize-lists-in-init_ta.patch b/0010-xwayland-Unconditionally-initialize-lists-in-init_ta.patch deleted file mode 100644 index 739b5a4..0000000 --- a/0010-xwayland-Unconditionally-initialize-lists-in-init_ta.patch +++ /dev/null @@ -1,74 +0,0 @@ -From 81d85fb95d71c0d781328506f1417e7b92c68b97 Mon Sep 17 00:00:00 2001 -From: Lyude -Date: Thu, 4 May 2017 18:04:31 -0400 -Subject: [PATCH xserver 10/12] xwayland: Unconditionally initialize lists in - init_tablet_manager_seat() - -In the event that xwayland gets launched on a wayland compositor that -doesn't yet have support for wp_tablet_manager, we end up skipping the -initialization of the lists. This is wrong, because regardless of -whether or not a tablet is present we still attempt to traverse these -lists later in xwl_set_cursor(), expecting that if the lists are empty -from no tablet manager that we simply won't execute any loop iterations. - -(EE) -(EE) Backtrace: -(EE) 0: Xwayland (OsSigHandler+0x3b) [0x4982f9] -(EE) 1: /lib64/libpthread.so.0 (__restore_rt+0x0) [0x7f73722545bf] -(EE) 2: Xwayland (xwl_set_cursor+0x9f) [0x429974] -(EE) 3: Xwayland (miPointerUpdateSprite+0x261) [0x4fe1ca] -(EE) 4: Xwayland (mieqProcessInputEvents+0x239) [0x4f8d33] -(EE) 5: Xwayland (ProcessInputEvents+0x9) [0x4282f0] -(EE) 6: Xwayland (Dispatch+0x42) [0x43e2d4] -(EE) 7: Xwayland (dix_main+0x5c9) [0x44c6dc] -(EE) 8: Xwayland (main+0x28) [0x61c523] -(EE) 9: /lib64/libc.so.6 (__libc_start_main+0xf1) [0x7f7371e9d401] -(EE) 10: Xwayland (_start+0x2a) [0x4208fa] -(EE) 11: ? (?+0x2a) [0x2a] -(EE) -(EE) Segmentation fault at address 0x28 -(EE) -Fatal server error: -(EE) Caught signal 11 (Segmentation fault). Server aborting -(EE) - -Reproduced when trying to run upstream xwayland under fedora 25's weston -package. - -Signed-off-by: Lyude -Reviewed-by: Peter Hutterer -Signed-off-by: Peter Hutterer -(cherry picked from commit a06bb73053d9df56d9070ce325a43af3a3c7a6a2) ---- - hw/xwayland/xwayland-input.c | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c -index 8011b965c..ee932be60 100644 ---- a/hw/xwayland/xwayland-input.c -+++ b/hw/xwayland/xwayland-input.c -@@ -2200,6 +2200,10 @@ static void - init_tablet_manager_seat(struct xwl_screen *xwl_screen, - struct xwl_seat *xwl_seat) - { -+ xorg_list_init(&xwl_seat->tablets); -+ xorg_list_init(&xwl_seat->tablet_tools); -+ xorg_list_init(&xwl_seat->tablet_pads); -+ - if (!xwl_screen->tablet_manager) - return; - -@@ -2207,10 +2211,6 @@ init_tablet_manager_seat(struct xwl_screen *xwl_screen, - zwp_tablet_manager_v2_get_tablet_seat(xwl_screen->tablet_manager, - xwl_seat->seat); - -- xorg_list_init(&xwl_seat->tablets); -- xorg_list_init(&xwl_seat->tablet_tools); -- xorg_list_init(&xwl_seat->tablet_pads); -- - zwp_tablet_seat_v2_add_listener(xwl_seat->tablet_seat, &tablet_seat_listener, xwl_seat); - } - --- -2.13.5 - diff --git a/0011-xwayland-Correct-off-by-one-error-in-tablet-button-n.patch b/0011-xwayland-Correct-off-by-one-error-in-tablet-button-n.patch deleted file mode 100644 index 76e95ec..0000000 --- a/0011-xwayland-Correct-off-by-one-error-in-tablet-button-n.patch +++ /dev/null @@ -1,39 +0,0 @@ -From edcc95e914079485b7d693cecbfc436d084ad47d Mon Sep 17 00:00:00 2001 -From: Jason Gerecke -Date: Fri, 9 Jun 2017 16:02:06 -0700 -Subject: [PATCH xserver 11/12] xwayland: Correct off-by-one error in tablet - button numbering - -The 'tablet_tool_frame' function treats the button masks as though they -are zero-indexed, but 'tablet_tool_button_state' treats them as one- -indexed. The result is that an e.g. middle click event recieved from -Wayland will be sent from the X server as a right-click instead. - -Fixes: 773b04748d0 ("xwayland: handle button events after motion events") -Signed-off-by: Jason Gerecke -Reviewed-by: Peter Hutterer -Signed-off-by: Peter Hutterer -(cherry picked from commit fbc9814975fe82be25becf1a55d4f8d34298a956) ---- - hw/xwayland/xwayland-input.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c -index ee932be60..a6d7d9356 100644 ---- a/hw/xwayland/xwayland-input.c -+++ b/hw/xwayland/xwayland-input.c -@@ -1626,9 +1626,9 @@ tablet_tool_button_state(void *data, struct zwp_tablet_tool_v2 *tool, - BUG_RETURN(xbtn >= 8 * sizeof(*mask)); - - if (state) -- SetBit(mask, xbtn); -+ SetBit(mask, xbtn - 1); - else -- ClearBit(mask, xbtn); -+ ClearBit(mask, xbtn - 1); - - xwl_seat->xwl_screen->serial = serial; - } --- -2.13.5 - diff --git a/0012-xwayland-Implement-tablet_tool_wheel-for-scrolling.patch b/0012-xwayland-Implement-tablet_tool_wheel-for-scrolling.patch deleted file mode 100644 index 097bcb4..0000000 --- a/0012-xwayland-Implement-tablet_tool_wheel-for-scrolling.patch +++ /dev/null @@ -1,78 +0,0 @@ -From d03bf0d1759d7d113216a0311e794b5adb0845de Mon Sep 17 00:00:00 2001 -From: Jason Gerecke -Date: Fri, 9 Jun 2017 16:02:07 -0700 -Subject: [PATCH xserver 12/12] xwayland: Implement tablet_tool_wheel for - scrolling - -The 'tablet_tool_wheel' function for tablet scrolling was added back in -8a1defcc634 but left unimplemented. This commit fills in the necessary -details, using the "clicks" count as the number of discrete scroll up/down -events to send. - -Signed-off-by: Jason Gerecke -Reviewed-by: Peter Hutterer -Signed-off-by: Peter Hutterer -(cherry picked from commit 7c7a540f1e1d6b5466e1c9aa28476a2d7273d5ed) ---- - hw/xwayland/xwayland-input.c | 24 ++++++++++++++++++++++++ - hw/xwayland/xwayland.h | 2 ++ - 2 files changed, 26 insertions(+) - -diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c -index a6d7d9356..0cf318623 100644 ---- a/hw/xwayland/xwayland-input.c -+++ b/hw/xwayland/xwayland-input.c -@@ -1566,6 +1566,13 @@ static void - tablet_tool_wheel(void *data, struct zwp_tablet_tool_v2 *tool, - wl_fixed_t degrees, int32_t clicks) - { -+ struct xwl_tablet_tool *xwl_tablet_tool = data; -+ struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; -+ -+ if (!xwl_seat->focus_window) -+ return; -+ -+ xwl_tablet_tool->wheel_clicks = clicks; - } - - static void -@@ -1677,6 +1684,23 @@ tablet_tool_frame(void *data, struct zwp_tablet_tool_v2 *tool, uint32_t time) - } - - xwl_tablet_tool->buttons_prev = xwl_tablet_tool->buttons_now; -+ -+ while (xwl_tablet_tool->wheel_clicks) { -+ if (xwl_tablet_tool->wheel_clicks < 0) { -+ button = 4; -+ xwl_tablet_tool->wheel_clicks++; -+ } -+ else { -+ button = 5; -+ xwl_tablet_tool->wheel_clicks--; -+ } -+ -+ QueuePointerEvents(xwl_tablet_tool->xdevice, -+ ButtonPress, button, 0, &mask); -+ QueuePointerEvents(xwl_tablet_tool->xdevice, -+ ButtonRelease, button, 0, &mask); -+ -+ } - } - - static const struct zwp_tablet_tool_v2_listener tablet_tool_listener = { -diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h -index 250564f73..135aa8761 100644 ---- a/hw/xwayland/xwayland.h -+++ b/hw/xwayland/xwayland.h -@@ -213,6 +213,8 @@ struct xwl_tablet_tool { - uint32_t buttons_now, - buttons_prev; - -+ int32_t wheel_clicks; -+ - struct xwl_cursor cursor; - }; - --- -2.13.5 - diff --git a/sources b/sources index 59caaa3..b06c799 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (xorg-server-1.19.6.tar.bz2) = 38519a8d0af9dd034045fc346959496dd718fa59b6188307974797a1cd9c349deb54987f6232ea8396baf810dcc710c0ff191f76ed2186cae4d44921b3680412 +SHA512 (xorg-server-1.19.99.903.tar.bz2) = 6884d7a477fdab118d61ed22d264d7ee03117673fdd40e63bc1eccc5109f23a058c9a1fc08aa9215b2c7fe1e6a677adfde4aadc1cbbec559b3edc024baf87444 diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 2169679..d068d26 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -20,7 +20,7 @@ # source because rpm is a terrible language. %global ansic_major 0 %global ansic_minor 4 -%global videodrv_major 23 +%global videodrv_major 24 %global videodrv_minor 0 %global xinput_major 24 %global xinput_minor 1 @@ -45,8 +45,8 @@ Summary: X.Org X11 X server Name: xorg-x11-server -Version: 1.19.6 -Release: 5%{?gitdate:.%{gitdate}}%{dist} +Version: 1.19.99.903 +Release: 1%{?gitdate:.%{gitdate}}%{dist} URL: http://www.x.org License: MIT Group: User Interface/X @@ -78,54 +78,18 @@ Source31: xserver-sdk-abi-requires.git # maintainer convenience script Source40: driver-abi-rebuild.sh -# Various fixes pending upstream -Patch2: 0005-xfree86-Remove-redundant-ServerIsNotSeat0-check-from.patch -Patch3: 0006-xfree86-Make-adding-unclaimed-devices-as-GPU-devices.patch -Patch4: 0007-xfree86-Try-harder-to-find-atleast-1-non-GPU-Screen.patch - -# Patches for better integration with the nvidia driver, pending upstream -Patch11: 0001-xfree86-Free-devlist-returned-by-xf86MatchDevice.patch -Patch12: 0002-xfree86-Make-OutputClassMatches-take-a-xf86_platform.patch -Patch13: 0003-xfree86-Add-options-support-for-OutputClass-Options.patch -Patch14: 0004-xfree86-xf86platformProbe-split-finding-pci-info-and.patch -Patch15: 0005-xfree86-Allow-overriding-primary-GPU-detection-from-.patch -Patch16: 0006-xfree86-Add-ModulePath-support-for-OutputClass-confi.patch - -# Backport tablet support for Xwayland - *NOT* in server-1.19-branch -Patch9901: 0001-xwayland-Depend-on-wayland-protocols-to-build-tablet.patch -Patch9902: 0002-xwayland-Bind-to-wp_tablet_manager-if-available-and-.patch -Patch9903: 0003-xwayland-Listen-for-wp_tablet_seat-events.patch -Patch9904: 0004-xwayland-Handle-wp_tablet-events.patch -Patch9905: 0005-xwayland-Handle-tablet_tool-events.patch -Patch9906: 0006-xwayland-handle-button-events-after-motion-events.patch -Patch9907: 0007-xwayland-Refactor-cursor-management-into-xwl_cursor.patch -Patch9908: 0008-xwayland-update-cursor-on-tablet-tools-in-proximity.patch -Patch9909: 0009-xwayland-add-tablet-pad-support.patch -Patch9910: 0010-xwayland-Unconditionally-initialize-lists-in-init_ta.patch -Patch9911: 0011-xwayland-Correct-off-by-one-error-in-tablet-button-n.patch -Patch9912: 0012-xwayland-Implement-tablet_tool_wheel-for-scrolling.patch - -# Upstream commit fe46cbe for Xwayland - Not in server-1.19-branch -Patch9950: 0001-xwayland-Give-up-cleanly-on-Wayland-socket-errors.patch -# Upstream commit 60f4646a for Xwayland - Not in xorg-server-1.19.6 -Patch9951: 0001-xwayland-Keep-separate-variables-for-pointer-and-tab.patch -# Upstream commit 16fd1847 for Xwayland - Not in xorg-server-1.19.6 -Patch9952: 0001-xwayland-avoid-race-condition-on-new-keymap.patch - # From Debian use intel ddx driver only for gen4 and older chipsets %if 0%{?fedora} > 25 || 0%{?rhel} > 7 Patch20: 06_use-intel-only-on-pre-gen4.diff %endif -# Submitted upstream -Patch21: 0001-xf86-dri2-Use-va_gl-as-vdpau_driver-for-Intel-i965-G.patch - -#Patch6044: xserver-1.6.99-hush-prerelease-warning.patch +# XXX needs rebase, but also va_gl should probably just be the default +# Patch21: 0001-xf86-dri2-Use-va_gl-as-vdpau_driver-for-Intel-i965-G.patch Patch7025: 0001-Always-install-vbe-and-int10-sdk-headers.patch # Submitted upstream, but not going anywhere -Patch7027: xserver-autobind-hotplug.patch +Patch7027: 0001-autobind-GPUs-to-the-screen.patch # because the display-managers are not ready yet, do not upstream Patch10000: 0001-Fedora-hack-Make-the-suid-root-wrapper-always-start-.patch @@ -133,9 +97,6 @@ Patch10000: 0001-Fedora-hack-Make-the-suid-root-wrapper-always-start-.patch # Default to xf86-video-modesetting on GeForce 8 and newer Patch10001: 0001-xfree86-use-modesetting-driver-by-default-on-GeForce.patch -# Upstream commit a309323328d9d6e0bf -Patch10002: 0001-config-fix-NULL-value-detection-for-ID_INPUT-being-u.patch - %global moduledir %{_libdir}/xorg/modules %global drimoduledir %{_libdir}/dri %global sdkdir %{_includedir}/xorg @@ -628,6 +589,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Mon Apr 02 2018 Adam Jackson - 1.19.99.903-1 +- xserver 1.20 RC3 + * Tue Feb 13 2018 Olivier Fourdan 1.19.6-5 - xwayland: avoid race condition on new keymap - xwayland: Keep separate variables for pointer and tablet foci (rhbz#1519961) From 3e9561ab1dd4605f039bc7208b0f0be12838a277 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Tue, 10 Apr 2018 16:15:08 -0400 Subject: [PATCH 008/131] xserver 1.20 RC4 --- sources | 2 +- xorg-x11-server.spec | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/sources b/sources index b06c799..d1c0024 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (xorg-server-1.19.99.903.tar.bz2) = 6884d7a477fdab118d61ed22d264d7ee03117673fdd40e63bc1eccc5109f23a058c9a1fc08aa9215b2c7fe1e6a677adfde4aadc1cbbec559b3edc024baf87444 +SHA512 (xorg-server-1.19.99.904.tar.bz2) = b9dccc777d0a30c6b40bddffe1f359dde4103539c6598f04bf8cf5f59e6770229221a199c1866b4eba0cf8d2d87fe878985bbd2e3c6ec5b65e3f16195ea8d57e diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index d068d26..f4c211b 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -45,7 +45,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server -Version: 1.19.99.903 +Version: 1.19.99.904 Release: 1%{?gitdate:.%{gitdate}}%{dist} URL: http://www.x.org License: MIT @@ -589,6 +589,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Tue Apr 10 2018 Adam Jackson - 1.19.99.904-1 +- xserver 1.20 RC4 + * Mon Apr 02 2018 Adam Jackson - 1.19.99.903-1 - xserver 1.20 RC3 From 17fe3265bd75420c58747903f86d7825b45fc07e Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Thu, 12 Apr 2018 16:54:33 +0200 Subject: [PATCH 009/131] Re-fix "use type instead of which in xvfb-run" The fix for rhbz#1443357 was overridden inadvertently --- xorg-x11-server.spec | 6 +++++- xvfb-run.sh | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index f4c211b..87d13cb 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -46,7 +46,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.19.99.904 -Release: 1%{?gitdate:.%{gitdate}}%{dist} +Release: 2%{?gitdate:.%{gitdate}}%{dist} URL: http://www.x.org License: MIT Group: User Interface/X @@ -589,6 +589,10 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Thu Apr 12 2018 Olivier Fourdan - 1.19.99.904-2 +- Re-fix "use type instead of which in xvfb-run (rhbz#1443357)" which + was overridden inadvertently + * Tue Apr 10 2018 Adam Jackson - 1.19.99.904-1 - xserver 1.20 RC4 diff --git a/xvfb-run.sh b/xvfb-run.sh index 473688c..b5cb02c 100644 --- a/xvfb-run.sh +++ b/xvfb-run.sh @@ -142,7 +142,7 @@ if [ -z "$*" ]; then exit 2 fi -if ! which xauth >/dev/null; then +if ! type xauth >/dev/null; then error "xauth command not found" exit 3 fi From 58b85adf7f1ea3d66e175dde1918e5d1a647700d Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Fri, 13 Apr 2018 16:20:10 -0400 Subject: [PATCH 010/131] Tweak libunwind conditionals --- xorg-x11-server.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 87d13cb..ec3e446 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -157,7 +157,7 @@ BuildRequires: libdrm-devel >= 2.4.0 kernel-headers BuildRequires: audit-libs-devel libselinux-devel >= 2.0.86-1 BuildRequires: libudev-devel -%if 0%{?fedora} > 24 || 0%{?rhel} > 7 +%if 0%{?fedora} > 24 # libunwind is Exclusive for the following arches %ifarch aarch64 %{arm} hppa ia64 mips ppc ppc64 %{ix86} x86_64 BuildRequires: libunwind-devel From 01bf953d1da9a14981f6ab7a29a37d8ed0cf2d31 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Tue, 24 Apr 2018 17:20:22 -0400 Subject: [PATCH 011/131] xserver 1.20 RC5 --- sources | 2 +- xorg-x11-server.spec | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/sources b/sources index d1c0024..60cc64e 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (xorg-server-1.19.99.904.tar.bz2) = b9dccc777d0a30c6b40bddffe1f359dde4103539c6598f04bf8cf5f59e6770229221a199c1866b4eba0cf8d2d87fe878985bbd2e3c6ec5b65e3f16195ea8d57e +SHA512 (xorg-server-1.19.99.905.tar.bz2) = 9a6f173835989f7562debfbadae0077d75e35bfad5be1f78931fe46ac43df20591162950b27e2c813fd857114f98247be28d357566e45e5d3ac6b60873d94466 diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index ec3e446..dac991c 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -45,8 +45,8 @@ Summary: X.Org X11 X server Name: xorg-x11-server -Version: 1.19.99.904 -Release: 2%{?gitdate:.%{gitdate}}%{dist} +Version: 1.19.99.905 +Release: 1%{?gitdate:.%{gitdate}}%{dist} URL: http://www.x.org License: MIT Group: User Interface/X @@ -589,6 +589,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Tue Apr 24 2018 Adam Jackson - 1.19.99.905-1 +- xserver 1.20 RC5 + * Thu Apr 12 2018 Olivier Fourdan - 1.19.99.904-2 - Re-fix "use type instead of which in xvfb-run (rhbz#1443357)" which was overridden inadvertently From 117a24dd8ff07007cec2b7bcc4d31ee3e4fbcdfe Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Wed, 25 Apr 2018 11:48:14 -0400 Subject: [PATCH 012/131] Fix xvfb-run's default depth to be 24 --- xorg-x11-server.spec | 5 ++++- xvfb-run.sh | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index dac991c..8c21273 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -46,7 +46,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.19.99.905 -Release: 1%{?gitdate:.%{gitdate}}%{dist} +Release: 2%{?gitdate:.%{gitdate}}%{dist} URL: http://www.x.org License: MIT Group: User Interface/X @@ -589,6 +589,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Wed Apr 25 2018 Adam Jackson - 1.19.99.905-2 +- Fix xvfb-run's default depth to be 24 + * Tue Apr 24 2018 Adam Jackson - 1.19.99.905-1 - xserver 1.20 RC5 diff --git a/xvfb-run.sh b/xvfb-run.sh index b5cb02c..9d088c1 100644 --- a/xvfb-run.sh +++ b/xvfb-run.sh @@ -31,7 +31,7 @@ SERVERNUM=99 AUTHFILE= ERRORFILE=/dev/null STARTWAIT=3 -XVFBARGS="-screen 0 640x480x8" +XVFBARGS="-screen 0 640x480x24" LISTENTCP="-nolisten tcp" XAUTHPROTO=. From f0e985518abc3778f71f27b2de916f8c8f062390 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Thu, 10 May 2018 12:56:54 -0400 Subject: [PATCH 013/131] xserver 1.20 --- sources | 2 +- xorg-x11-server.spec | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/sources b/sources index 60cc64e..37ac689 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (xorg-server-1.19.99.905.tar.bz2) = 9a6f173835989f7562debfbadae0077d75e35bfad5be1f78931fe46ac43df20591162950b27e2c813fd857114f98247be28d357566e45e5d3ac6b60873d94466 +SHA512 (xorg-server-1.20.0.tar.bz2) = 1489e8511c9da682ef0460182dfeeddd241c72d4ef4d206d9706f1e39572c09953df851fab18cefb65a1ee4c6710c6ba13c63c9c9fc0bc1b5f12c50780412cde diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 8c21273..2faeb68 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -45,8 +45,8 @@ Summary: X.Org X11 X server Name: xorg-x11-server -Version: 1.19.99.905 -Release: 2%{?gitdate:.%{gitdate}}%{dist} +Version: 1.20.0 +Release: 1%{?gitdate:.%{gitdate}}%{dist} URL: http://www.x.org License: MIT Group: User Interface/X @@ -141,6 +141,7 @@ BuildRequires: libXi-devel libXpm-devel libXaw-devel libXfixes-devel BuildRequires: wayland-devel BuildRequires: wayland-protocols-devel +BuildRequires: pkgconfig(wayland-eglstream-protocols) BuildRequires: pkgconfig(wayland-client) >= 1.3.0 BuildRequires: pkgconfig(epoxy) %if 0%{?fedora} > 24 || 0%{?rhel} > 7 @@ -389,6 +390,7 @@ autoreconf -f -v --install || exit 1 %configure %{xservers} \ --enable-dependency-tracking \ + --enable-xwayland-eglstream \ --disable-static \ --with-pic \ %{?no_int10} --with-int10=x86emu \ @@ -589,6 +591,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Thu May 10 2018 Adam Jackson - 1.20.0-1 +- xserver 1.20 + * Wed Apr 25 2018 Adam Jackson - 1.19.99.905-2 - Fix xvfb-run's default depth to be 24 From 8833777f42ea5526f23bffbfcc5794478fbd7a0a Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Thu, 10 May 2018 15:48:37 -0400 Subject: [PATCH 014/131] spec file cleanups Renumber patches, remove single-use macros and always-true conditionals, trim old changelog, etc. --- xorg-x11-server.spec | 513 ++----------------------------------------- 1 file changed, 20 insertions(+), 493 deletions(-) diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 2faeb68..f39c243 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -79,46 +79,20 @@ Source31: xserver-sdk-abi-requires.git Source40: driver-abi-rebuild.sh # From Debian use intel ddx driver only for gen4 and older chipsets -%if 0%{?fedora} > 25 || 0%{?rhel} > 7 -Patch20: 06_use-intel-only-on-pre-gen4.diff -%endif +Patch1: 06_use-intel-only-on-pre-gen4.diff +# Default to xf86-video-modesetting on GeForce 8 and newer +Patch2: 0001-xfree86-use-modesetting-driver-by-default-on-GeForce.patch # XXX needs rebase, but also va_gl should probably just be the default -# Patch21: 0001-xf86-dri2-Use-va_gl-as-vdpau_driver-for-Intel-i965-G.patch +# Patch3: 0001-xf86-dri2-Use-va_gl-as-vdpau_driver-for-Intel-i965-G.patch -Patch7025: 0001-Always-install-vbe-and-int10-sdk-headers.patch +Patch4: 0001-Always-install-vbe-and-int10-sdk-headers.patch # Submitted upstream, but not going anywhere -Patch7027: 0001-autobind-GPUs-to-the-screen.patch +Patch5: 0001-autobind-GPUs-to-the-screen.patch # because the display-managers are not ready yet, do not upstream -Patch10000: 0001-Fedora-hack-Make-the-suid-root-wrapper-always-start-.patch - -# Default to xf86-video-modesetting on GeForce 8 and newer -Patch10001: 0001-xfree86-use-modesetting-driver-by-default-on-GeForce.patch - -%global moduledir %{_libdir}/xorg/modules -%global drimoduledir %{_libdir}/dri -%global sdkdir %{_includedir}/xorg - -#ifarch s390 s390x -#global with_hw_servers 0 -#else -%global with_hw_servers 1 -#endif - -%if %{with_hw_servers} -%global enable_xorg --enable-xorg -%else -%global enable_xorg --disable-xorg -%endif - -%ifnarch %{ix86} x86_64 -%global no_int10 --disable-vbe --disable-int10-module -%endif - -%global kdrive --enable-kdrive --enable-xephyr --disable-xfake --disable-xfbdev -%global xservers --enable-xvfb --enable-xnest %{kdrive} %{enable_xorg} +Patch6: 0001-Fedora-hack-Make-the-suid-root-wrapper-always-start-.patch BuildRequires: systemtap-sdt-devel BuildRequires: git @@ -144,9 +118,7 @@ BuildRequires: wayland-protocols-devel BuildRequires: pkgconfig(wayland-eglstream-protocols) BuildRequires: pkgconfig(wayland-client) >= 1.3.0 BuildRequires: pkgconfig(epoxy) -%if 0%{?fedora} > 24 || 0%{?rhel} > 7 BuildRequires: pkgconfig(xshmfence) >= 1.1 -%endif BuildRequires: libXv-devel BuildRequires: pixman-devel >= 0.30.0 BuildRequires: libpciaccess-devel >= 0.13.1 openssl-devel bison flex flex-devel @@ -158,20 +130,14 @@ BuildRequires: libdrm-devel >= 2.4.0 kernel-headers BuildRequires: audit-libs-devel libselinux-devel >= 2.0.86-1 BuildRequires: libudev-devel -%if 0%{?fedora} > 24 # libunwind is Exclusive for the following arches %ifarch aarch64 %{arm} hppa ia64 mips ppc ppc64 %{ix86} x86_64 BuildRequires: libunwind-devel %endif -%endif BuildRequires: pkgconfig(xcb-aux) pkgconfig(xcb-image) pkgconfig(xcb-icccm) BuildRequires: pkgconfig(xcb-keysyms) pkgconfig(xcb-renderutil) -# All server subpackages have a virtual provide for the name of the server -# they deliver. The Xorg one is versioned, the others are intentionally -# unversioned. - %description X.Org X11 X server @@ -186,7 +152,6 @@ Requires: xkeyboard-config xkbcomp Common files shared among all X servers. -%if %{with_hw_servers} %package Xorg Summary: Xorg X server Group: User Interface/X @@ -211,10 +176,8 @@ Obsoletes: xorg-x11-glamor < %{version}-%{release} Provides: xorg-x11-glamor = %{version}-%{release} Obsoletes: xorg-x11-drv-modesetting < %{version}-%{release} Provides: xorg-x11-drv-modesetting = %{version}-%{release} -%if 0%{?fedora} > 24 || 0%{?rhel} > 7 # Dropped from F25 Obsoletes: xorg-x11-drv-vmmouse < 13.1.0-4 -%endif Requires: xorg-x11-server-common >= %{version}-%{release} Requires: system-setup-keyboard @@ -224,7 +187,6 @@ X.org X11 is an open source implementation of the X Window System. It provides the basic low level functionality which full fledged graphical user interfaces (GUIs) such as GNOME and KDE are designed upon. -%endif %package Xnest @@ -302,7 +264,6 @@ Requires: xorg-x11-server-common >= %{version}-%{release} Xwayland is an X server for running X clients under Wayland. -%if %{with_hw_servers} %package devel Summary: SDK for X server driver module development Group: User Interface/X @@ -319,7 +280,6 @@ The SDK package provides the developmental files which are necessary for developing X server driver modules, and for compiling driver modules outside of the standard X11 source code tree. Developers writing video drivers, input drivers, or other X modules should install this package. -%endif %package source @@ -340,7 +300,7 @@ cp %{SOURCE1} .gitignore %{expand:%__scm_setup_git -q} %autopatch -%if %{with_hw_servers} && 0%{?stable_abi} +%if 0%{?stable_abi} # check the ABI in the source against what we expect. getmajor() { grep -i ^#define.ABI.$1_VERSION hw/xfree86/common/xf86Module.h | @@ -365,28 +325,17 @@ test `getminor extension` == %{extension_minor} %build +%ifnarch %{ix86} x86_64 +%global no_int10 --disable-vbe --disable-int10-module +%endif + +%global kdrive --enable-kdrive --enable-xephyr --disable-xfake --disable-xfbdev +%global xservers --enable-xvfb --enable-xnest %{kdrive} --enable-xorg %global default_font_path "catalogue:/etc/X11/fontpath.d,built-ins" - -%if %{with_hw_servers} %global dri_flags --enable-dri --enable-dri2 %{?!rhel:--enable-dri3} --enable-suid-wrapper --enable-glamor -%else -%global dri_flags --disable-dri --disable-dri2 -%endif - -%if 0%{?fedora} > 24 || 0%{?rhel} > 7 %global bodhi_flags --with-vendor-name="Fedora Project" -%global wayland --enable-xwayland -%endif -# ick -%if 0%{?fedora} < 20 || 0%{?rhel} <= 7 -sed -i 's/WAYLAND_SCANNER_RULES.*//g' configure.ac -%endif - -# --with-pie ? autoreconf -f -v --install || exit 1 -# export CFLAGS="${RPM_OPT_FLAGS}" -# XXX without dtrace %configure %{xservers} \ --enable-dependency-tracking \ @@ -395,7 +344,7 @@ autoreconf -f -v --install || exit 1 --with-pic \ %{?no_int10} --with-int10=x86emu \ --with-default-font-path=%{default_font_path} \ - --with-module-dir=%{moduledir} \ + --with-module-dir=%{_libdir}/xorg/modules \ --with-builderstring="Build ID: %{name} %{version}-%{release}" \ --with-os-name="$(hostname -s) $(uname -r)" \ --with-xkb-output=%{_localstatedir}/lib/xkb \ @@ -405,7 +354,7 @@ autoreconf -f -v --install || exit 1 --enable-config-udev \ --disable-unit-tests \ --enable-dmx \ - %{?wayland} \ + --enable-xwayland \ %{dri_flags} %{?bodhi_flags} \ ${CONFIGURE} @@ -413,10 +362,8 @@ make V=1 %{?_smp_mflags} %install -%make_install moduledir=%{moduledir} +%make_install -%if %{with_hw_servers} -rm -rf $RPM_BUILD_ROOT%{_libdir}/xorg/modules/multimedia/ mkdir -p $RPM_BUILD_ROOT%{_libdir}/xorg/modules/{drivers,input} mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/pam.d @@ -429,8 +376,6 @@ install -m 644 %{SOURCE4} $RPM_BUILD_ROOT%{_datadir}/X11/xorg.conf.d # relies on it more or less. mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/X11/xorg.conf.d -mkdir -p $RPM_BUILD_ROOT%{_bindir} - %if %{stable_abi} install -m 755 %{SOURCE30} $RPM_BUILD_ROOT%{_bindir}/xserver-sdk-abi-requires %else @@ -439,11 +384,12 @@ sed -e s/@MAJOR@/%{gitdate}/g -e s/@MINOR@/%{minor_serial}/g %{SOURCE31} > \ chmod 755 $RPM_BUILD_ROOT%{_bindir}/xserver-sdk-abi-requires %endif -%endif +install -m 0755 %{SOURCE20} $RPM_BUILD_ROOT%{_bindir}/xvfb-run # Make the source package %global xserver_source_dir %{_datadir}/xorg-x11-server-source %global inst_srcdir %{buildroot}/%{xserver_source_dir} + mkdir -p %{inst_srcdir}/{Xext,xkb,GL,hw/{xquartz/bundle,xfree86/common}} mkdir -p %{inst_srcdir}/{hw/dmx/doc,man,doc,hw/dmx/doxygen} cp {,%{inst_srcdir}/}hw/xquartz/bundle/cpprules.in @@ -455,27 +401,13 @@ cp {,%{inst_srcdir}/}hw/xfree86/Xorg.sh.in cp xkb/README.compiled %{inst_srcdir}/xkb cp hw/xfree86/xorgconf.cpp %{inst_srcdir}/hw/xfree86 -install -m 0755 %{SOURCE20} $RPM_BUILD_ROOT%{_bindir}/xvfb-run - find . -type f | egrep '.*\.(c|h|am|ac|inc|m4|h.in|pc.in|man.pre|pl|txt)$' | xargs tar cf - | (cd %{inst_srcdir} && tar xf -) -# SLEDGEHAMMER find %{inst_srcdir}/hw/xfree86 -name \*.c -delete # Remove unwanted files/dirs { - rm -f $RPM_BUILD_ROOT%{_libdir}/X11/Options - rm -f $RPM_BUILD_ROOT%{_bindir}/in? - rm -f $RPM_BUILD_ROOT%{_bindir}/ioport - rm -f $RPM_BUILD_ROOT%{_bindir}/out? - rm -f $RPM_BUILD_ROOT%{_bindir}/pcitweak - rm -f $RPM_BUILD_ROOT%{_mandir}/man1/pcitweak.1* find $RPM_BUILD_ROOT -type f -name '*.la' | xargs rm -f -- || : -%if !%{with_hw_servers} - rm -f $RPM_BUILD_ROOT%{_libdir}/pkgconfig/xorg-server.pc - rm -f $RPM_BUILD_ROOT%{_datadir}/aclocal/xorg-server.m4 - rm -rf $RPM_BUILD_ROOT%{_defaultdocdir}/xorg-server -%endif # wtf %ifnarch %{ix86} x86_64 rm -f $RPM_BUILD_ROOT%{_libdir}/xorg/modules/lib{int10,vbe}.so @@ -497,7 +429,6 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %global Xorgperms %attr(0711,root,root) %caps(cap_sys_admin,cap_sys_rawio,cap_dac_override=pe) %endif -%if %{with_hw_servers} %files Xorg %config %attr(0644,root,root) %{_sysconfdir}/pam.d/xserver %{_bindir}/X @@ -538,8 +469,6 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %dir %{_sysconfdir}/X11/xorg.conf.d %dir %{_datadir}/X11/xorg.conf.d %{_datadir}/X11/xorg.conf.d/10-quirks.conf -%endif - %files Xnest %{_bindir}/Xnest @@ -575,16 +504,14 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %files Xwayland %{_bindir}/Xwayland -%if %{with_hw_servers} %files devel %doc COPYING #{_docdir}/xorg-server %{_bindir}/xserver-sdk-abi-requires %{_libdir}/pkgconfig/xorg-server.pc %dir %{_includedir}/xorg -%{sdkdir}/*.h +%{_includedir}/xorg/*.h %{_datadir}/aclocal/xorg-server.m4 -%endif %files source %{xserver_source_dir} @@ -715,403 +642,3 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete - Add some extra fixes which are pending upstream - This also adds PointerWarping emulation to Xwayland, which should improve compatiblity with many games - -* Wed Oct 5 2016 Hans de Goede - 1.19.0-0.2.20160929 -- Add a fix from upstream to fix xterm crash under Xwayland (fdo#97974) -- Add a fix from upstream to fix glamor / xwayland not working with glvnd -- Add a fix from upstream to fix input devices no longer working - after a vt-switch - -* Thu Sep 29 2016 Hans de Goede - 1.19.0-0.1.20160929 -- Rebase to current git master (1.19-rc1+) -- Drop Obsoletes for the driver packages removed from F21 (its been 2 - years since they have been removed now) - -* Thu Sep 08 2016 Adam Jackson 1.18.4-6 -- Backport GLX_EXT_libglvnd support from 1.19 - -* Thu Sep 01 2016 Peter Hutterer 1.18.4-5 -- Fall back to libinput if the module is missing - -* Thu Aug 25 2016 Hans de Goede - 1.18.4-4 -- Fix (undo) server ABI breakage from 1.18.4-3 - -* Thu Aug 25 2016 Hans de Goede - 1.18.4-3 -- Various switchable-graphics / prime fixes from upstream, mostly - related to using the modesetting driver in prime setups -- Fix Xorg -configure not working (rhbz#1368502) - -* Fri Aug 19 2016 Kalev Lember - 1.18.4-2 -- Backport a number of XWayland fixes from master - -* Tue Jul 19 2016 Adam Jackson - 1.18.4-1 -- xserver 1.18.4 - -* Mon Jul 04 2016 Olivier Fourdan 1.18.3-8 -- Fix segfault in Xwayland due to cursor update after unrealize (#1338979) - -* Tue Jun 28 2016 Peter Hutterer 1.18.3-7 -- Fix segfault caused by forced indicator update (#1335439) - -* Fri Jun 17 2016 Hans de Goede - 1.18.3-6 -- Add switchable-graphics / prime fixes from f24 branch -- Add some more switchable-graphics / prime fixes from upstream - -* Mon Jun 13 2016 Adam Jackson - 1.18.3-5 -- Restore DRI1 for now - -* Mon May 09 2016 Adam Jackson - 1.18.3-4 -- Move a symbol from DRI1 to DRI2 code to fix ati/openchrome - -* Thu May 05 2016 Peter Hutterer 1.18.3-3 -- Fix NumLock indicator light turning off after layout change (#1047151) - -* Thu Apr 14 2016 Adam Jackson - 1.18.3-2 -- Stop building DRI1 support -- Don't build DRI2 on s390{,x} - -* Mon Apr 04 2016 Adam Jackson 1.18.3-1 -- xserver 1.18.3 - -* Thu Mar 17 2016 Adam Jackson 1.18.2-2 -- Fix red tint artifacts in glamor -- Fix a performance cliff in present triggered by plasma -- Silence some xf86vidmode log spam - -* Fri Mar 11 2016 Adam Jackson 1.18.2-1 -- xserver 1.18.2 - -* Wed Mar 09 2016 Peter Hutterer 1.18.1-3 -- Stop bug warnings on three-finger pinch gestures (#1282252) - -* Mon Feb 15 2016 Dave Airlie 1.18.1-2 -- fix issues with reverse prime and present. - -* Mon Feb 08 2016 Adam Jackson 1.18.1-1 -- xserver 1.18.1 - -* Fri Feb 05 2016 Fedora Release Engineering - 1.18.0-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild - -* Mon Nov 16 2015 Hans de Goede - 1.18.0-2 -- Fix Xorg.wrap kms detection to so that the server does not always run - as root - -* Mon Nov 09 2015 Adam Jackson 1.18.0-1 -- xserver 1.18.0 - -* Tue Oct 27 2015 Dave Airlie 1.18.0-0.6 -- update to git snapshot of 1.7.99.902 (1.18.0 rc2) - -* Wed Oct 14 2015 Hans de Goede - 1.18.0-0.5 -- Fix xorg sometimes crashing on machine poweroff/shutdown (#1269210) - -* Thu Sep 24 2015 Rex Dieter 1.18.0-0.4 -- pull in candidate fix for clients getting stuck waiting indefinitely - for an idle event when a CRTC is turned off (#1256082,#1258084) - -* Tue Sep 22 2015 Dave Airlie 1.18.0-0.3 -- hack to fix GLX_MESA_copy_sub_buffer regression (#1265395) - -* Mon Sep 07 2015 Dave Airlie 1.18.0-0.2 -- update to git snapshot of 1.7.99 (1.18.0 rc1) - -* Wed Jul 29 2015 Dave Airlie 1.18.0-0.1 -- git snapshot of what will be 1.18.0 (should be ABI stable) - -* Wed Jul 15 2015 Dave Airlie 1.17.2-2 -- fix bug with glamor and PRIME where server would crash - -* Tue Jun 16 2015 Adam Jackson 1.17.2-1 -- xserver 1.17.2 - -* Tue Jun 16 2015 Dave Airlie 1.17.1-16 -- fix bug with glamor and overlapping copies - -* Wed Jun 10 2015 Ray Strode 1.17.1-15 -- CVE-2015-3164 - -* Tue May 26 2015 Peter Hutterer 1.17.1-14 -- Add the unaccelerated valuator masks, fixes nonmoving mouse in SDL - (#1208992) - -* Wed May 20 2015 Kalev Lember - 1.17.1-13 -- Obsolete xorg-x11-drv-void - -* Tue May 19 2015 Hans de Goede - 1.17.1-12 -- Fix "start -- vt7" not working fix breaking headless setups (#1203780) - -* Sat May 02 2015 Adel Gadllah - 1.17.1-11 -- modesetting: Fix software cursor fallback (#1205725) - -* Thu Apr 30 2015 Hans de Goede - 1.17.1-10 -- Fix "start -- vt7" not working (#1203780) - -* Sat Apr 11 2015 Ray Strode 1.17.1-9 -- Handle logind timeouts more gracefuly. -- Bump timeouts so they don't happen in practice - Fixes X on some old optimus and other hybrid hardware - Related: #1209347 - -* Thu Apr 09 2015 Adam Jackson 1.17.1-8 -- Fix endian detection code (#1206060) - -* Wed Mar 18 2015 Hans de Goede - 1.17.1-7 -- Modify the server wrapper to not always start the server as root. - Callers of the server which start it in a way which is compatible with the - server running without root rights can now set a XORG_RUN_AS_USER_OK env - variable and then the wrapper will behave as if needs_root_rights = auto - is specified, unless overriden from Xwrapper.config - -* Wed Mar 04 2015 Adam Jackson 1.17.1-6 -- Fix int10 interrupt vector setup - -* Mon Mar 02 2015 Dave Airlie 1.17.1-5 -- omg, define something to 0 makes it work, security. - -* Mon Mar 02 2015 Dave Airlie 1.17.1-4 -- require lazy relocations to work, remove cement - -* Sat Feb 21 2015 Till Maas - 1.17.1-3 -- Rebuilt for Fedora 23 Change - https://fedoraproject.org/wiki/Changes/Harden_all_packages_with_position-independent_code - -* Tue Feb 17 2015 Dave Airlie 1.17.1-2 -- fix regression in SI:localuser handling - -* Wed Feb 11 2015 Hans de Goede - 1.17.1-1 -- New upstream release 1.17.1 (rhbz#1144404) -- xorg-x11-drv-modesetting is now included in xorg-x11-server-Xorg, - obsolete it -- Fix xorg-x11-drv-r128 obsoletes (rhbz#1176791) - -* Fri Feb 06 2015 Peter Hutterer 1.16.2.901-3 -- CVE-2015-0255: unchecked XKB string lengths - -* Thu Feb 05 2015 Ray Strode 1.16.2.901-2 -- Add patch from ickle to fix flicker on login / durin vt switch - see https://bugzilla.gnome.org/show_bug.cgi?id=737226 - -* Wed Dec 10 2014 Dave Airlie 1.16.2.901-1 -- upstream security release. 1.16.2.901 - -* Fri Nov 21 2014 Dave Airlie 1.16.2-1 -- New upstream bugfix release 1.16.2 - -* Fri Nov 21 2014 Dave Airlie 1.16.1-2 -- backport glamor DRI3 sync integration from upstream - -* Fri Oct 3 2014 Hans de Goede - 1.16.1-1 -- New upstream bugfix release 1.16.1 (rhbz#1144404) - -* Thu Sep 11 2014 Adam Jackson 1.16.0-10 -- Only send GLX_BufferSwapComplete for PresentCompleteKindPixmap - -* Wed Sep 10 2014 Hans de Goede - 1.16.0-9 -- Fixup Xwayland summary, remove . at end of summaries (rhbz#1140225) - -* Tue Sep 09 2014 Kalev Lember - 1.16.0-8 -- Update the versions of obsoletes for dropped drivers - -* Tue Sep 2 2014 Hans de Goede - 1.16.0-7 -- Drop Fedora specific xorg-non-pci.patch, replace with solution from - upstream - -* Thu Aug 28 2014 Hans de Goede - 1.16.0-6 -- drop no longer valid configure arguments (rhbz#1133350) - -* Mon Aug 25 2014 Peter Robinson 1.16.0-5 -- re-add support for non pci platform devices - -* Mon Aug 18 2014 Fedora Release Engineering - 1.16.0-4 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild - -* Fri Aug 8 2014 Hans de Goede - 1.16.0-3 -- Really fix conditionals to allow building on F-20 (rhbz#1127351) - -* Thu Aug 7 2014 Hans de Goede - 1.16.0-2 -- Fix xwayland conditionals to allow building on F-20 (rhbz#1127351) - -* Mon Jul 28 2014 Hans de Goede - 1.16.0-1 -- Update to 1.16.0 - -* Thu Jul 17 2014 Adam Jackson 1.15.99.904-4 -- Add Obsoletes for video drivers dropped in F21+ - -* Fri Jul 11 2014 Hans de Goede - 1.15.99.904-3 -- Fix startx crash introduced by 1.15.99.904 (rhbz#1118540) - -* Fri Jul 11 2014 Peter Hutterer 1.15.99.904-2 -- Don't force the screensaver off on DPMS unblank - -* Tue Jul 8 2014 Hans de Goede - 1.15.99.904-1 -- Update to 1.15.99.904 - -* Wed Jul 2 2014 Hans de Goede - 1.15.99.903-5 -- Fix code including glamor.h not compiling due to strndup re-definition - -* Wed Jul 02 2014 Adam Jackson 1.15.99.903-4 -- Snap xwayland damage reports to the bounding box - -* Wed Jul 2 2014 Hans de Goede - 1.15.99.903-3 -- Fix xvfb crash on client disconnect (rhbz#1113128) - -* Thu Jun 19 2014 Dennis Gilmore - 1.15.99.903-2 -- add support for non pci platform devices - -* Wed Jun 11 2014 Hans de Goede - 1.15.99.903-1 -- Update to 1.15.99.903 -- This bumps the videodrv ABI once more, so all drivers must be rebuild - -* Sun Jun 08 2014 Fedora Release Engineering - 1.15.99.902-8.20140428 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild - -* Wed May 21 2014 Adam Jackson 1.15.99.902-7 -- Don't try to build Xwayland in F20 -- Fix shadowfb initialization to, er, work - -* Wed May 14 2014 Peter Hutterer - 1.15.99.902-6.20140428 -- Revert button mapping for Evoluent Vertical mouse, the default mapping - matches the manufacturer's documentation (#612140) - -* Mon Apr 28 2014 Hans de Goede - 1.15.99.902-5.20140428 -- Add hw/xfree86/Xorg.sh.in to xorg-x11-server-source - -* Mon Apr 28 2014 Hans de Goede - 1.15.99.902-4.20140428 -- Git snapshot 20140428 -- This fixes the silent hardware cursor API break in 1.15.99.902 (#1090897) - -* Fri Apr 25 2014 Hans de Goede - 1.15.99.902-3 -- Add missing BuildRequires for dbus-devel, libepoxy-devel, mesa-libEGL-devel, - mesa-libgbm-devel and systemd-devel -- Fix compilation of int10 module on arm - -* Wed Apr 23 2014 Hans de Goede - 1.15.99.902-2 -- Add --enable-glamor to configure flags - -* Thu Apr 17 2014 Hans de Goede - 1.15.99.902-1 -- Update to 1.15.99.902 -- Drop the Xwayland as extension patch-set -- Add a new xorg-x11-server-Xwayland package with the new standalone Xwayland - server - -* Fri Feb 28 2014 Peter Hutterer 1.15.0-5 -- Search all parent devices for a PnPID. - -* Mon Feb 17 2014 Adam Williamson - 1.15.0-4 -- fix xwayland crash under mutter (RH #1065109 , BGO #724443) - -* Wed Feb 05 2014 Peter Hutterer 1.15.0-3 -- Prevent out-of-bounds access in check_butmap_change (#1061466) - -* Tue Jan 14 2014 Adam Jackson 1.15.0-2 -- exa-only-draw-valid-trapezoids.patch: Fix crash in exa. - -* Mon Jan 13 2014 Adam Jackson 1.15.0-1 -- xserver 1.15.0 - -* Tue Dec 17 2013 Adam Jackson 1.14.99.904-1 -- 1.15RC4 -- Re-disable int10 on arm - -* Mon Dec 2 2013 Peter Robinson 1.14.99.902-2 -- Add aarch64 to platforms that have libunwind - -* Wed Nov 20 2013 Adam Jackson 1.14.99.902-1 -- 1.15RC2 - -* Mon Nov 18 2013 Adam Jackson 1.14.99.901-6 -- Prefer fbdev to vesa, fixes fallback path on UEFI - -* Fri Nov 08 2013 Adam Jackson 1.14.99.901-5 -- Restore XkbCopyDeviceKeymap for (older) tigervnc - -* Fri Nov 08 2013 Adam Jackson 1.14.99.901-4 -- Explicitly enable DRI2 - -* Thu Nov 07 2013 Adam Jackson 1.14.99.901-3 -- Merge Xinerama+{Damage,Render,Composite} fix series - -* Thu Nov 07 2013 Adam Jackson 1.14.99.901-2 -- Fix build with --disable-present - -* Thu Nov 07 2013 Adam Jackson 1.14.99.901-1 -- 1.15RC1 - -* Mon Oct 28 2013 Adam Jackson 1.14.99.3-2 -- Don't build xwayland in RHEL - -* Fri Oct 25 2013 Adam Jackson 1.14.99.3-1 -- xserver 1.14.99.3 -- xwayland branch refresh -- Drop some F17-era Obsoletes -- Update BuildReqs to match reality - -* Wed Oct 23 2013 Peter Hutterer 1.14.3-6 -- Fix Xdmx cursor jumps (#1019821) - -* Tue Oct 08 2013 Adam Jackson 1.14.3-5 -- Snap wayland damage reports to the bounding box - -* Thu Oct 03 2013 Adam Jackson 1.14.3-4 -- Fix up fixing up the driver list after filtering out non-wayland - -* Wed Oct 02 2013 Adam Jackson 1.14.3-3 -- Only look at wayland-capable drivers when run with -wayland - -* Mon Sep 23 2013 Adam Jackson 1.14.3-2 -- xwayland support - -* Mon Sep 16 2013 Peter Hutterer 1.14.3-1 -- xserver 1.14.3 - -* Tue Jul 30 2013 Peter Hutterer 1.14.2-9 -- Fix active touch grabs, second touchpoint didn't get sent to client -- Fix version mismatch for XI 2.2+ clients (where a library supports > 2.2 - but another version than the originally requested one). - -* Tue Jul 30 2013 Dave Airlie 1.14.2-8 -- fixes for multi-monitor reverse optimus - -* Mon Jul 22 2013 Peter Hutterer 1.14.2-7 -- Fix erroneous valuator 1 coordinate when an absolute device in relative - mode doesn't send y coordinates. - -* Fri Jul 19 2013 Peter Hutterer 1.14.2-6 -- Add new version of the resolution-based scaling patch - scale y down - instead of x up. That gives almost the same behaviour as current - synaptics. Drop the synaptics quirk, this needs to be now removed from the - driver. - -* Mon Jul 15 2013 Peter Hutterer 1.14.2-5 -- Fix logspam when trying to free a non-existant grab. -- Update touch patch to upstream version (from fdo #66720) -- re-add xephyr resizable patch, got lost in rebase (#976995) - -* Fri Jul 12 2013 Dave Airlie 1.14.2-4 -- reapply dropped patch to fix regression (#981953) - -* Tue Jul 09 2013 Peter Hutterer 1.14.2-3 -- Fix crash on 32-bit with virtual box guest additions (#972095) - -* Tue Jul 09 2013 Peter Hutterer 1.14.2-2 -- Fix crash in gnome-shell when tapping a menu twice (fdo #66720) - -* Thu Jul 04 2013 Peter Hutterer 1.14.2-1 -- xorg-server 1.4.2 -- drop merged patches -- Add a quirk to set the synaptics resolution to 0 by default. The pre-scale - patch in the server clashes with synaptics inaccurate resolution numbers, - causing the touchpad movement to be stunted. - -* Thu Jun 06 2013 Peter Hutterer 1.14.1.901-2 -- Backport the touch grab race condition patches from fdo #56578 - -* Thu Jun 06 2013 Peter Hutterer 1.14.1.901-1 -- xserver 1.14.2RC1 - -* Tue Jun 04 2013 Peter Hutterer 1.14.1-4 -- Update quirks for trackballs and the La-VIEW Technology Naos 5000 mouse From 00b4ee574b37ae83f9b5b6071a83f09ca32dbf7f Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Wed, 16 May 2018 14:40:33 -0400 Subject: [PATCH 015/131] Xorg Requires: xorg-x11-drv-libinput --- xorg-x11-server.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index f39c243..b6cc406 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -46,7 +46,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.20.0 -Release: 1%{?gitdate:.%{gitdate}}%{dist} +Release: 2%{?gitdate:.%{gitdate}}%{dist} URL: http://www.x.org License: MIT Group: User Interface/X @@ -181,6 +181,7 @@ Obsoletes: xorg-x11-drv-vmmouse < 13.1.0-4 Requires: xorg-x11-server-common >= %{version}-%{release} Requires: system-setup-keyboard +Requires: xorg-x11-drv-libinput %description Xorg X.org X11 is an open source implementation of the X Window System. It @@ -518,6 +519,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Wed May 16 2018 Adam Jackson - 1.20.0-2 +- Xorg Requires: xorg-x11-drv-libinput + * Thu May 10 2018 Adam Jackson - 1.20.0-1 - xserver 1.20 From a24c5faafd0103ebdec48707f24444f9e2c1c239 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Fri, 1 Jun 2018 17:48:51 -0700 Subject: [PATCH 016/131] Backport fixes for RHBZ#1579067 --- xorg-x11-server.spec | 9 ++- ...from-glamor_fds_from_pixmap-on-error.patch | 54 +++++++++++++++++ ...ixmap-error-in-glamor_fd_from_pixmap.patch | 58 +++++++++++++++++++ 3 files changed, 120 insertions(+), 1 deletion(-) create mode 100644 xserver-1-2-glamor-Always-return-0-from-glamor_fds_from_pixmap-on-error.patch create mode 100644 xserver-2-2-glamor-Propagate-glamor_fds_from_pixmap-error-in-glamor_fd_from_pixmap.patch diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index b6cc406..009f925 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -46,7 +46,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.20.0 -Release: 2%{?gitdate:.%{gitdate}}%{dist} +Release: 3%{?gitdate:.%{gitdate}}%{dist} URL: http://www.x.org License: MIT Group: User Interface/X @@ -94,6 +94,10 @@ Patch5: 0001-autobind-GPUs-to-the-screen.patch # because the display-managers are not ready yet, do not upstream Patch6: 0001-Fedora-hack-Make-the-suid-root-wrapper-always-start-.patch +# new test fixes for RHBZ#1579067 +Patch7: xserver-1-2-glamor-Always-return-0-from-glamor_fds_from_pixmap-on-error.patch +Patch8: xserver-2-2-glamor-Propagate-glamor_fds_from_pixmap-error-in-glamor_fd_from_pixmap.patch + BuildRequires: systemtap-sdt-devel BuildRequires: git BuildRequires: automake autoconf libtool pkgconfig @@ -519,6 +523,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Fri Jun 01 2018 Adam Williamson - 1.20.0-3 +- Backport fixes for RHBZ#1579067 + * Wed May 16 2018 Adam Jackson - 1.20.0-2 - Xorg Requires: xorg-x11-drv-libinput diff --git a/xserver-1-2-glamor-Always-return-0-from-glamor_fds_from_pixmap-on-error.patch b/xserver-1-2-glamor-Always-return-0-from-glamor_fds_from_pixmap-on-error.patch new file mode 100644 index 0000000..32672f2 --- /dev/null +++ b/xserver-1-2-glamor-Always-return-0-from-glamor_fds_from_pixmap-on-error.patch @@ -0,0 +1,54 @@ +From patchwork Wed May 23 09:43:32 2018 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 8bit +Subject: [xserver, + 1/2] glamor: Always return 0 from glamor_fds_from_pixmap on error +From: =?utf-8?q?Michel_D=C3=A4nzer?= +X-Patchwork-Id: 224909 +Message-Id: <20180523094333.11076-1-michel@daenzer.net> +To: =?UTF-8?q?Louis-Francis=20Ratt=C3=A9-Boulianne?= , + Daniel Stone +Cc: xorg-devel@lists.x.org +Date: Wed, 23 May 2018 11:43:32 +0200 + +From: Michel Dänzer + +This matches what glamor_egl_fds_from_pixmap and dri3_fds_from_pixmap do +and what proc_dri3_buffers_from_pixmap expects. + +Fixes: c8c276c9569b "glamor: Implement PixmapFromBuffers and + BuffersFromPixmap" +Signed-off-by: Michel Dänzer +--- + glamor/glamor.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/glamor/glamor.c b/glamor/glamor.c +index d984d20f3..e2c74d17a 100644 +--- a/glamor/glamor.c ++++ b/glamor/glamor.c +@@ -836,20 +836,20 @@ glamor_fds_from_pixmap(ScreenPtr screen, PixmapPtr pixmap, int *fds, + glamor_get_screen_private(pixmap->drawable.pScreen); + + if (!glamor_priv->dri3_enabled) +- return -1; ++ return 0; + switch (pixmap_priv->type) { + case GLAMOR_TEXTURE_DRM: + case GLAMOR_TEXTURE_ONLY: + if (!glamor_pixmap_ensure_fbo(pixmap, pixmap->drawable.depth == 30 ? + GL_RGB10_A2 : GL_RGBA, 0)) +- return -1; ++ return 0; + return glamor_egl_fds_from_pixmap(screen, pixmap, fds, + strides, offsets, + modifier); + default: + break; + } +- return -1; ++ return 0; + } + + _X_EXPORT int diff --git a/xserver-2-2-glamor-Propagate-glamor_fds_from_pixmap-error-in-glamor_fd_from_pixmap.patch b/xserver-2-2-glamor-Propagate-glamor_fds_from_pixmap-error-in-glamor_fd_from_pixmap.patch new file mode 100644 index 0000000..ab92d3f --- /dev/null +++ b/xserver-2-2-glamor-Propagate-glamor_fds_from_pixmap-error-in-glamor_fd_from_pixmap.patch @@ -0,0 +1,58 @@ +From patchwork Wed May 23 09:43:33 2018 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 8bit +Subject: [xserver, 2/2] glamor: Propagate glamor_fds_from_pixmap error in + glamor_fd_from_pixmap +From: =?utf-8?q?Michel_D=C3=A4nzer?= +X-Patchwork-Id: 224910 +Message-Id: <20180523094333.11076-2-michel@daenzer.net> +To: =?UTF-8?q?Louis-Francis=20Ratt=C3=A9-Boulianne?= , + Daniel Stone +Cc: xorg-devel@lists.x.org +Date: Wed, 23 May 2018 11:43:33 +0200 + +From: Michel Dänzer + +glamor_fds_from_pixmap returns 0 on error, but we were treating that as +success, continuing with uninitialized stride and fd values. + +Also bail if the offset isn't 0, same as in dri3_fd_from_pixmap. + +Fixes: c8c276c9569b "glamor: Implement PixmapFromBuffers and + BuffersFromPixmap" +Signed-off-by: Michel Dänzer +Reviewed-by: Emil Velikov +--- + glamor/glamor.c | 16 +++++++--------- + 1 file changed, 7 insertions(+), 9 deletions(-) + +diff --git a/glamor/glamor.c b/glamor/glamor.c +index e2c74d17a..63f0947fa 100644 +--- a/glamor/glamor.c ++++ b/glamor/glamor.c +@@ -865,17 +865,15 @@ glamor_fd_from_pixmap(ScreenPtr screen, + &modifier); + + /* Pixmaps with multi-planes/modifier are not supported in this interface */ +- if (ret > 1) { +- while (ret > 0) +- close(fds[--ret]); +- return -1; ++ if (ret == 1 && offsets[0] == 0) { ++ *stride = strides[0]; ++ *size = pixmap->drawable.height * *stride; ++ return fds[0]; + } + +- ret = fds[0]; +- *stride = strides[0]; +- *size = pixmap->drawable.height * *stride; +- +- return ret; ++ while (ret > 0) ++ close(fds[--ret]); ++ return -1; + } + + _X_EXPORT int From 228641ed26dc55956944bd1e68641cf9acc44598 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Tue, 12 Jun 2018 09:40:38 -0400 Subject: [PATCH 017/131] Xorg and Xwayland Requires: libEGL --- xorg-x11-server.spec | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 009f925..1a96816 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -46,7 +46,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.20.0 -Release: 3%{?gitdate:.%{gitdate}}%{dist} +Release: 4%{?gitdate:.%{gitdate}}%{dist} URL: http://www.x.org License: MIT Group: User Interface/X @@ -186,6 +186,7 @@ Obsoletes: xorg-x11-drv-vmmouse < 13.1.0-4 Requires: xorg-x11-server-common >= %{version}-%{release} Requires: system-setup-keyboard Requires: xorg-x11-drv-libinput +Requires: libEGL %description Xorg X.org X11 is an open source implementation of the X Window System. It @@ -264,6 +265,7 @@ Render and Composite. Summary: Wayland X Server Group: User Interface/X Requires: xorg-x11-server-common >= %{version}-%{release} +Requires: libEGL %description Xwayland Xwayland is an X server for running X clients under Wayland. @@ -523,6 +525,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Tue Jun 12 2018 Adam Jackson - 1.20.0-4 +- Xorg and Xwayland Requires: libEGL + * Fri Jun 01 2018 Adam Williamson - 1.20.0-3 - Backport fixes for RHBZ#1579067 From 63ad72a19e11ce0e83c349e25c46f0077ccbec1e Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 14 Jul 2018 09:30:47 +0000 Subject: [PATCH 018/131] - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- xorg-x11-server.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 1a96816..30a1fc5 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -46,7 +46,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.20.0 -Release: 4%{?gitdate:.%{gitdate}}%{dist} +Release: 5%{?gitdate:.%{gitdate}}%{dist} URL: http://www.x.org License: MIT Group: User Interface/X @@ -525,6 +525,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Sat Jul 14 2018 Fedora Release Engineering - 1.20.0-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + * Tue Jun 12 2018 Adam Jackson - 1.20.0-4 - Xorg and Xwayland Requires: libEGL From a237e8dbd7dbe6682c7f2b305201d71c2efb1e83 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Thu, 9 Aug 2018 10:29:54 -0400 Subject: [PATCH 019/131] xserver 1.20.1 --- sources | 1 + xorg-x11-server.spec | 13 +++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/sources b/sources index 37ac689..a8f856c 100644 --- a/sources +++ b/sources @@ -1 +1,2 @@ SHA512 (xorg-server-1.20.0.tar.bz2) = 1489e8511c9da682ef0460182dfeeddd241c72d4ef4d206d9706f1e39572c09953df851fab18cefb65a1ee4c6710c6ba13c63c9c9fc0bc1b5f12c50780412cde +SHA512 (xorg-server-1.20.1.tar.bz2) = ef2b93a61683c8ca8d1f14b771e70db65ba119a73db8a46e7cdbf2ac2243e3f4b2732068eb5aa5d7b76f460db995a3c04390870198a5210ec30df4360ad9f94b diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 30a1fc5..5e2184a 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -45,8 +45,8 @@ Summary: X.Org X11 X server Name: xorg-x11-server -Version: 1.20.0 -Release: 5%{?gitdate:.%{gitdate}}%{dist} +Version: 1.20.1 +Release: 1%{?gitdate:.%{gitdate}}%{dist} URL: http://www.x.org License: MIT Group: User Interface/X @@ -94,10 +94,6 @@ Patch5: 0001-autobind-GPUs-to-the-screen.patch # because the display-managers are not ready yet, do not upstream Patch6: 0001-Fedora-hack-Make-the-suid-root-wrapper-always-start-.patch -# new test fixes for RHBZ#1579067 -Patch7: xserver-1-2-glamor-Always-return-0-from-glamor_fds_from_pixmap-on-error.patch -Patch8: xserver-2-2-glamor-Propagate-glamor_fds_from_pixmap-error-in-glamor_fd_from_pixmap.patch - BuildRequires: systemtap-sdt-devel BuildRequires: git BuildRequires: automake autoconf libtool pkgconfig @@ -136,8 +132,10 @@ BuildRequires: audit-libs-devel libselinux-devel >= 2.0.86-1 BuildRequires: libudev-devel # libunwind is Exclusive for the following arches %ifarch aarch64 %{arm} hppa ia64 mips ppc ppc64 %{ix86} x86_64 +%if !0%{?rhel} BuildRequires: libunwind-devel %endif +%endif BuildRequires: pkgconfig(xcb-aux) pkgconfig(xcb-image) pkgconfig(xcb-icccm) BuildRequires: pkgconfig(xcb-keysyms) pkgconfig(xcb-renderutil) @@ -525,6 +523,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Thu Aug 09 2018 Adam Jackson - 1.20.1-1 +- xserver 1.20.1 + * Sat Jul 14 2018 Fedora Release Engineering - 1.20.0-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild From b25ac7f75c6e165ca5aa6cd97fc13f7280f3289d Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Mon, 10 Sep 2018 16:39:25 +0200 Subject: [PATCH 020/131] Patches from upstream for Xwayland --- ...direct-context-in-CreateContextAttri.patch | 60 ++++++++++++++ 0001-present-fix-freed-pointer-access.patch | 80 ++++++++++++++++++ ...xwl_present_window-from-privates-on-.patch | 81 +++++++++++++++++++ ...ayland-fix-access-to-invalid-pointer.patch | 78 ++++++++++++++++++ xorg-x11-server.spec | 11 ++- 5 files changed, 309 insertions(+), 1 deletion(-) create mode 100644 0001-glx-check-for-indirect-context-in-CreateContextAttri.patch create mode 100644 0001-present-fix-freed-pointer-access.patch create mode 100644 0001-xwayland-Remove-xwl_present_window-from-privates-on-.patch create mode 100644 0001-xwayland-fix-access-to-invalid-pointer.patch diff --git a/0001-glx-check-for-indirect-context-in-CreateContextAttri.patch b/0001-glx-check-for-indirect-context-in-CreateContextAttri.patch new file mode 100644 index 0000000..7c51440 --- /dev/null +++ b/0001-glx-check-for-indirect-context-in-CreateContextAttri.patch @@ -0,0 +1,60 @@ +From 2881ce563661043ef0ee1163c63c120f3622e6d1 Mon Sep 17 00:00:00 2001 +From: Olivier Fourdan +Date: Wed, 5 Sep 2018 15:06:55 +0200 +Subject: [PATCH xserver] glx: check for indirect context in + CreateContextAttribsARB() + +Commit 99f0365b "Add a command line argument for disabling indirect GLX" +added a test to check if indirect context are enabled in +`DoCreateContext()` but `__glXDisp_CreateContextAttribsARB()` doesn't +use `DoCreateContext()` and doesn't check if indirect context is +enabled. + +As a result, clients can still manage to create indirect contexts using +`glXCreateContextAttribsARB()` even if indirect contexts are disabled, +which can possibly crash Xservers such as Xwayland or Xephyr when the +context is destroyed. + +To avoid the issue, check for `enableIndirectGLX` in +`__glXDisp_CreateContextAttribsARB()` as well. + +Fixes: 99f0365b "Add a command line argument for disabling indirect GLX" +Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107508 +Signed-off-by: Olivier Fourdan +--- + glx/createcontext.c | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +diff --git a/glx/createcontext.c b/glx/createcontext.c +index 7d09c3a1c..24b02ddfb 100644 +--- a/glx/createcontext.c ++++ b/glx/createcontext.c +@@ -28,6 +28,7 @@ + #include "glxserver.h" + #include "glxext.h" + #include "indirect_dispatch.h" ++#include "opaque.h" + + #define ALL_VALID_FLAGS \ + (GLX_CONTEXT_DEBUG_BIT_ARB | GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB \ +@@ -320,6 +321,17 @@ __glXDisp_CreateContextAttribsARB(__GLXclientState * cl, GLbyte * pc) + err = BadAlloc; + } + else { ++ /* Only allow creating indirect GLX contexts if allowed by ++ * server command line. Indirect GLX is of limited use (since ++ * it's only GL 1.4), it's slower than direct contexts, and ++ * it's a massive attack surface for buffer overflow type ++ * errors. ++ */ ++ if (!enableIndirectGLX) { ++ client->errorValue = req->isDirect; ++ return BadValue; ++ } ++ + ctx = glxScreen->createContext(glxScreen, config, shareCtx, + req->numAttribs, (uint32_t *) attribs, + &err); +-- +2.19.0.rc1 + diff --git a/0001-present-fix-freed-pointer-access.patch b/0001-present-fix-freed-pointer-access.patch new file mode 100644 index 0000000..8c28ee8 --- /dev/null +++ b/0001-present-fix-freed-pointer-access.patch @@ -0,0 +1,80 @@ +From 259f838af4aae2c240d0ea9c05073a86718990d7 Mon Sep 17 00:00:00 2001 +From: Lionel Landwerlin +Date: Mon, 27 Aug 2018 01:04:45 +0100 +Subject: [PATCH xserver] present: fix freed pointer access + +When a vblank has been marked as aborted, it's going to be free in the +flip_notify function when stopped. We can't notify it after it's +stopped because the pointer is invalid. + +Valgrind backtrace: + +==5331== Invalid read of size 8 +==5331== at 0x212B4D: present_vblank_notify (present_vblank.c:34) +==5331== by 0x21439B: present_wnmd_flip_notify (present_wnmd.c:194) +==5331== by 0x21439B: present_wnmd_event_notify (present_wnmd.c:228) +==5331== by 0x156216: xwl_present_sync_callback (xwayland-present.c:282) +==5331== by 0x6570FCD: ffi_call_unix64 (in /usr/lib/x86_64-linux-gnu/libffi.so.6.0.4) +==5331== by 0x657093E: ffi_call (in /usr/lib/x86_64-linux-gnu/libffi.so.6.0.4) +==5331== by 0x4DDB183: ??? (in /usr/lib/x86_64-linux-gnu/libwayland-client.so.0.3.0) +==5331== by 0x4DD79D8: ??? (in /usr/lib/x86_64-linux-gnu/libwayland-client.so.0.3.0) +==5331== by 0x4DD8EA3: wl_display_dispatch_queue_pending (in /usr/lib/x86_64-linux-gnu/libwayland-client.so.0.3.0) +==5331== by 0x14BCCA: xwl_read_events (xwayland.c:814) +==5331== by 0x2AC0D0: ospoll_wait (ospoll.c:651) +==5331== by 0x2A5322: WaitForSomething (WaitFor.c:208) +==5331== by 0x27574B: Dispatch (dispatch.c:421) +==5331== Address 0x1b44dc98 is 40 bytes inside a block of size 184 free'd +==5331== at 0x48369EB: free (vg_replace_malloc.c:530) +==5331== by 0x213B0A: present_wnmd_free_idle_vblanks (present_wnmd.c:118) +==5331== by 0x213B0A: present_wnmd_flips_stop (present_wnmd.c:161) +==5331== by 0x2143EF: present_wnmd_flip_notify (present_wnmd.c:192) +==5331== by 0x2143EF: present_wnmd_event_notify (present_wnmd.c:228) +==5331== by 0x156216: xwl_present_sync_callback (xwayland-present.c:282) +==5331== by 0x6570FCD: ffi_call_unix64 (in /usr/lib/x86_64-linux-gnu/libffi.so.6.0.4) +==5331== by 0x657093E: ffi_call (in /usr/lib/x86_64-linux-gnu/libffi.so.6.0.4) +==5331== by 0x4DDB183: ??? (in /usr/lib/x86_64-linux-gnu/libwayland-client.so.0.3.0) +==5331== by 0x4DD79D8: ??? (in /usr/lib/x86_64-linux-gnu/libwayland-client.so.0.3.0) +==5331== by 0x4DD8EA3: wl_display_dispatch_queue_pending (in /usr/lib/x86_64-linux-gnu/libwayland-client.so.0.3.0) +==5331== by 0x14BCCA: xwl_read_events (xwayland.c:814) +==5331== by 0x2AC0D0: ospoll_wait (ospoll.c:651) +==5331== by 0x2A5322: WaitForSomething (WaitFor.c:208) +==5331== Block was alloc'd at +==5331== at 0x48377D5: calloc (vg_replace_malloc.c:711) +==5331== by 0x212D9F: present_vblank_create (present_vblank.c:69) +==5331== by 0x214014: present_wnmd_pixmap (present_wnmd.c:610) +==5331== by 0x21576C: proc_present_pixmap (present_request.c:150) +==5331== by 0x27599D: Dispatch (dispatch.c:479) +==5331== by 0x279945: dix_main (main.c:276) +==5331== by 0x633AB16: (below main) (libc-start.c:310) + +v2: Still notify aborted flips (Roman) + +Signed-off-by: Lionel Landwerlin +Reviewed-by: Daniel Stone +Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107314 +Reviewed-by: Roman Gilg +Tested-by: Roman Gilg +--- + present/present_wnmd.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/present/present_wnmd.c b/present/present_wnmd.c +index 035ae8ffe..8f3836440 100644 +--- a/present/present_wnmd.c ++++ b/present/present_wnmd.c +@@ -188,10 +188,11 @@ present_wnmd_flip_notify(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_ + window_priv->flip_active = vblank; + window_priv->flip_pending = NULL; + ++ present_vblank_notify(vblank, PresentCompleteKindPixmap, PresentCompleteModeFlip, ust, crtc_msc); ++ + if (vblank->abort_flip) + present_wnmd_flips_stop(window); + +- present_vblank_notify(vblank, PresentCompleteKindPixmap, PresentCompleteModeFlip, ust, crtc_msc); + present_wnmd_flip_try_ready(window); + } + +-- +2.19.0.rc1 + diff --git a/0001-xwayland-Remove-xwl_present_window-from-privates-on-.patch b/0001-xwayland-Remove-xwl_present_window-from-privates-on-.patch new file mode 100644 index 0000000..1575cb0 --- /dev/null +++ b/0001-xwayland-Remove-xwl_present_window-from-privates-on-.patch @@ -0,0 +1,81 @@ +From 90ac51f3e44d8d433741dc0f0495e79cc6e5fd51 Mon Sep 17 00:00:00 2001 +From: Olivier Fourdan +Date: Wed, 5 Sep 2018 09:34:12 +0200 +Subject: [PATCH xserver] xwayland: Remove xwl_present_window from privates on + cleanup + +Xwayland's `xwl_destroy_window()` invokes `xwl_present_cleanup()` +before the common `DestroyWindow()`. + +But then `DestroyWindow()` calls `present_destroy_window()` which will +possibly end up in `xwl_present_abort_vblank()` which will try to access +data that was previously freed by `xwl_present_cleanup()`: + + Invalid read of size 8 + at 0x434184: xwl_present_abort_vblank (xwayland-present.c:378) + by 0x53785B: present_wnmd_abort_vblank (present_wnmd.c:651) + by 0x53695A: present_free_window_vblank (present_screen.c:87) + by 0x53695A: present_destroy_window (present_screen.c:152) + by 0x42A90D: xwl_destroy_window (xwayland.c:653) + by 0x584298: compDestroyWindow (compwindow.c:613) + by 0x53CEE3: damageDestroyWindow (damage.c:1570) + by 0x4F1BB8: DbeDestroyWindow (dbe.c:1326) + by 0x46F7F6: FreeWindowResources (window.c:1031) + by 0x472847: DeleteWindow (window.c:1099) + by 0x46B54C: doFreeResource (resource.c:880) + by 0x46C706: FreeClientResources (resource.c:1146) + by 0x446ADE: CloseDownClient (dispatch.c:3473) + Address 0x182abde0 is 80 bytes inside a block of size 112 free'd + at 0x4C2FDAC: free (vg_replace_malloc.c:530) + by 0x42A937: xwl_destroy_window (xwayland.c:647) + by 0x584298: compDestroyWindow (compwindow.c:613) + by 0x53CEE3: damageDestroyWindow (damage.c:1570) + by 0x4F1BB8: DbeDestroyWindow (dbe.c:1326) + by 0x46F7F6: FreeWindowResources (window.c:1031) + by 0x472847: DeleteWindow (window.c:1099) + by 0x46B54C: doFreeResource (resource.c:880) + by 0x46C706: FreeClientResources (resource.c:1146) + by 0x446ADE: CloseDownClient (dispatch.c:3473) + by 0x446DA5: ProcKillClient (dispatch.c:3279) + by 0x4476AF: Dispatch (dispatch.c:479) + Block was alloc'd at + at 0x4C30B06: calloc (vg_replace_malloc.c:711) + by 0x433F46: xwl_present_window_get_priv (xwayland-present.c:54) + by 0x434228: xwl_present_get_crtc (xwayland-present.c:302) + by 0x539728: proc_present_query_capabilities (present_request.c:227) + by 0x4476AF: Dispatch (dispatch.c:479) + by 0x44B5B5: dix_main (main.c:276) + by 0x75F611A: (below main) (libc-start.c:308) + +This is because `xwl_present_cleanup()` frees the memory but does not +remove it from the window's privates, and `xwl_present_abort_vblank()` +will still find it and hence try to access that freed memory... + +Remove `xwl_present_window` from window's privates on cleanup so that no +other function can find and reuse that data once it's freed. + +Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1616269 +Signed-off-by: Olivier Fourdan +--- + hw/xwayland/xwayland-present.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c +index 81e0eb9ce..316e04443 100644 +--- a/hw/xwayland/xwayland-present.c ++++ b/hw/xwayland/xwayland-present.c +@@ -147,6 +147,11 @@ xwl_present_cleanup(WindowPtr window) + /* Clear timer */ + xwl_present_free_timer(xwl_present_window); + ++ /* Remove from privates so we don't try to access it later */ ++ dixSetPrivate(&window->devPrivates, ++ &xwl_present_window_private_key, ++ NULL); ++ + free(xwl_present_window); + } + +-- +2.19.0.rc1 + diff --git a/0001-xwayland-fix-access-to-invalid-pointer.patch b/0001-xwayland-fix-access-to-invalid-pointer.patch new file mode 100644 index 0000000..a6026ba --- /dev/null +++ b/0001-xwayland-fix-access-to-invalid-pointer.patch @@ -0,0 +1,78 @@ +From b3f6dc6892ca554ecb57f4289182a3e29915a2c6 Mon Sep 17 00:00:00 2001 +From: Lionel Landwerlin +Date: Tue, 28 Aug 2018 21:30:05 +0100 +Subject: [PATCH xserver] xwayland: fix access to invalid pointer + +xwl_output->randr_crtc is used in the update_screen_size() function : + +==5331== Invalid read of size 4 +==5331== at 0x15263D: update_screen_size (xwayland-output.c:190) +==5331== by 0x152C48: xwl_output_remove (xwayland-output.c:413) +==5331== by 0x6570FCD: ffi_call_unix64 (in /usr/lib/x86_64-linux-gnu/libffi.so.6.0.4) +==5331== by 0x657093E: ffi_call (in /usr/lib/x86_64-linux-gnu/libffi.so.6.0.4) +==5331== by 0x4DDB183: ??? (in /usr/lib/x86_64-linux-gnu/libwayland-client.so.0.3.0) +==5331== by 0x4DD79D8: ??? (in /usr/lib/x86_64-linux-gnu/libwayland-client.so.0.3.0) +==5331== by 0x4DD8EA3: wl_display_dispatch_queue_pending (in /usr/lib/x86_64-linux-gnu/libwayland-client.so.0.3.0) +==5331== by 0x14BCCA: xwl_read_events (xwayland.c:814) +==5331== by 0x2AC0D0: ospoll_wait (ospoll.c:651) +==5331== by 0x2A5322: WaitForSomething (WaitFor.c:208) +==5331== by 0x27574B: Dispatch (dispatch.c:421) +==5331== by 0x279945: dix_main (main.c:276) +==5331== Address 0x1aacb5f4 is 36 bytes inside a block of size 154 free'd +==5331== at 0x48369EB: free (vg_replace_malloc.c:530) +==5331== by 0x1F8AE8: RROutputDestroyResource (rroutput.c:421) +==5331== by 0x29A2AC: doFreeResource (resource.c:880) +==5331== by 0x29AE5B: FreeResource (resource.c:910) +==5331== by 0x152BE0: xwl_output_remove (xwayland-output.c:408) +==5331== by 0x6570FCD: ffi_call_unix64 (in /usr/lib/x86_64-linux-gnu/libffi.so.6.0.4) +==5331== by 0x657093E: ffi_call (in /usr/lib/x86_64-linux-gnu/libffi.so.6.0.4) +==5331== by 0x4DDB183: ??? (in /usr/lib/x86_64-linux-gnu/libwayland-client.so.0.3.0) +==5331== by 0x4DD79D8: ??? (in /usr/lib/x86_64-linux-gnu/libwayland-client.so.0.3.0) +==5331== by 0x4DD8EA3: wl_display_dispatch_queue_pending (in /usr/lib/x86_64-linux-gnu/libwayland-client.so.0.3.0) +==5331== by 0x14BCCA: xwl_read_events (xwayland.c:814) +==5331== by 0x2AC0D0: ospoll_wait (ospoll.c:651) +==5331== Block was alloc'd at +==5331== at 0x48357BF: malloc (vg_replace_malloc.c:299) +==5331== by 0x1F93E0: RROutputCreate (rroutput.c:83) +==5331== by 0x152A75: xwl_output_create (xwayland-output.c:361) +==5331== by 0x14BE59: registry_global (xwayland.c:764) +==5331== by 0x6570FCD: ffi_call_unix64 (in /usr/lib/x86_64-linux-gnu/libffi.so.6.0.4) +==5331== by 0x657093E: ffi_call (in /usr/lib/x86_64-linux-gnu/libffi.so.6.0.4) +==5331== by 0x4DDB183: ??? (in /usr/lib/x86_64-linux-gnu/libwayland-client.so.0.3.0) +==5331== by 0x4DD79D8: ??? (in /usr/lib/x86_64-linux-gnu/libwayland-client.so.0.3.0) +==5331== by 0x4DD8EA3: wl_display_dispatch_queue_pending (in /usr/lib/x86_64-linux-gnu/libwayland-client.so.0.3.0) +==5331== by 0x14BCCA: xwl_read_events (xwayland.c:814) +==5331== by 0x2AC0D0: ospoll_wait (ospoll.c:651) +==5331== by 0x2A5322: WaitForSomething (WaitFor.c:208) + +Signed-off-by: Lionel Landwerlin +Reviewed-by: Daniel Stone +--- + hw/xwayland/xwayland-output.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/hw/xwayland/xwayland-output.c b/hw/xwayland/xwayland-output.c +index 0d2ec7890..cc68f0340 100644 +--- a/hw/xwayland/xwayland-output.c ++++ b/hw/xwayland/xwayland-output.c +@@ -404,14 +404,15 @@ xwl_output_remove(struct xwl_output *xwl_output) + int width = 0, height = 0; + Bool need_rotate = (xwl_output->xdg_output == NULL); + +- RRCrtcDestroy(xwl_output->randr_crtc); +- RROutputDestroy(xwl_output->randr_output); + xorg_list_del(&xwl_output->link); + + xorg_list_for_each_entry(it, &xwl_screen->output_list, link) + output_get_new_size(it, need_rotate, &height, &width); + update_screen_size(xwl_output, width, height); + ++ RRCrtcDestroy(xwl_output->randr_crtc); ++ RROutputDestroy(xwl_output->randr_output); ++ + xwl_output_destroy(xwl_output); + } + +-- +2.19.0.rc1 + diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 5e2184a..e7ec848 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -46,7 +46,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.20.1 -Release: 1%{?gitdate:.%{gitdate}}%{dist} +Release: 2%{?gitdate:.%{gitdate}}%{dist} URL: http://www.x.org License: MIT Group: User Interface/X @@ -94,6 +94,12 @@ Patch5: 0001-autobind-GPUs-to-the-screen.patch # because the display-managers are not ready yet, do not upstream Patch6: 0001-Fedora-hack-Make-the-suid-root-wrapper-always-start-.patch +# Submitted upstream +Patch7: 0001-xwayland-Remove-xwl_present_window-from-privates-on-.patch +Patch8: 0001-xwayland-fix-access-to-invalid-pointer.patch +Patch9: 0001-present-fix-freed-pointer-access.patch +Patch10: 0001-glx-check-for-indirect-context-in-CreateContextAttri.patch + BuildRequires: systemtap-sdt-devel BuildRequires: git BuildRequires: automake autoconf libtool pkgconfig @@ -523,6 +529,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Mon Sep 10 2018 Olivier Fourdan - 1.20.1-2 +- Include patches from upstream to fix Xwayland crashes + * Thu Aug 09 2018 Adam Jackson - 1.20.1-1 - xserver 1.20.1 From 72455413e33fb1b8b9ae807cade12d2492114477 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Thu, 13 Sep 2018 11:15:29 +1000 Subject: [PATCH 021/131] Build with PIE enabled (this doesn't enable bind now) --- xorg-x11-server.spec | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index e7ec848..e56a72e 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -46,7 +46,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.20.1 -Release: 2%{?gitdate:.%{gitdate}}%{dist} +Release: 3%{?gitdate:.%{gitdate}}%{dist} URL: http://www.x.org License: MIT Group: User Interface/X @@ -336,6 +336,10 @@ test `getminor extension` == %{extension_minor} %build +export CFLAGS="$RPM_OPT_FLAGS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1" +export CXXFLAGS="$RPM_OPT_FLAGS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1" +export LDFLAGS="$RPM_LD_FLAGS -specs=/usr/lib/rpm/redhat/redhat-hardened-ld" + %ifnarch %{ix86} x86_64 %global no_int10 --disable-vbe --disable-int10-module %endif @@ -529,6 +533,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Thu Sep 13 2018 Dave Airlie - 1.20.1-3 +- Build with PIE enabled (this doesn't enable bind now) + * Mon Sep 10 2018 Olivier Fourdan - 1.20.1-2 - Include patches from upstream to fix Xwayland crashes From f57420c8b5d91c7de0ad1839947c71ea89b1ec31 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Thu, 4 Oct 2018 14:21:41 +0200 Subject: [PATCH 022/131] Rebase patch to use va_gl as vdpau driver on i965 GPUs, re-fix rhbz#1413733 --- ..._gl-as-vdpau_driver-for-Intel-i965-G.patch | 152 ++++++++++++++++++ xorg-x11-server.spec | 10 +- 2 files changed, 159 insertions(+), 3 deletions(-) create mode 100644 0001-xf86-dri2-Use-va_gl-as-vdpau_driver-for-Intel-i965-G.patch diff --git a/0001-xf86-dri2-Use-va_gl-as-vdpau_driver-for-Intel-i965-G.patch b/0001-xf86-dri2-Use-va_gl-as-vdpau_driver-for-Intel-i965-G.patch new file mode 100644 index 0000000..cce0348 --- /dev/null +++ b/0001-xf86-dri2-Use-va_gl-as-vdpau_driver-for-Intel-i965-G.patch @@ -0,0 +1,152 @@ +From acf5a0100c98a040e5e07a79ecf4a83627da770e Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Thu, 23 Mar 2017 12:54:07 +0100 +Subject: [PATCH xserver] xf86: dri2: Use va_gl as vdpau_driver for Intel i965 + GPUs + +The modesetting driver (which now often is used with Intel GPUs), +relies on dri2_probe_driver_name() to get the dri and vdpau driver +names, before this commit it would always assign the same name to +the 2 names. But the vdpau driver for i965 GPUs should be va_gl +(i915 does not support vdpau at all). + +This commit modifies the used lookup table and dri2_probe_driver_name() +to set the vdpau_driver to va_gl for i965 GPUs, it leaves the 2 +names the same for all other GPUs. + +Note this commit adds a FIXME comment for a memory leak in +dri2_probe_driver_name(), that leak was already present and fixing +it falls outside of the scope of this commit. + +BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1413733 +Cc: kwizart@gmail.com +Signed-off-by: Hans de Goede +--- + hw/xfree86/dri2/dri2.c | 31 +++++++++++++-------- + hw/xfree86/dri2/pci_ids/pci_id_driver_map.h | 21 +++++++------- + 2 files changed, 31 insertions(+), 21 deletions(-) + +diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c +index 6619e3aa7..1f8ad14bc 100644 +--- a/hw/xfree86/dri2/dri2.c ++++ b/hw/xfree86/dri2/dri2.c +@@ -1437,14 +1437,18 @@ get_prime_id(void) + + #include "pci_ids/pci_id_driver_map.h" + +-static char * +-dri2_probe_driver_name(ScreenPtr pScreen, DRI2InfoPtr info) ++static void ++dri2_probe_driver_name(ScreenPtr pScreen, DRI2InfoPtr info, ++ const char **dri_driver_ret, ++ const char **vdpau_driver_ret) + { + #ifdef WITH_LIBDRM + int i, j; +- char *driver = NULL; + drmDevicePtr dev; + ++ *dri_driver_ret = NULL; ++ *vdpau_driver_ret = NULL; ++ + /* For non-PCI devices and drmGetDevice fail, just assume that + * the 3D driver is named the same as the kernel driver. This is + * currently true for vc4 and msm (freedreno). +@@ -1456,12 +1460,14 @@ dri2_probe_driver_name(ScreenPtr pScreen, DRI2InfoPtr info) + xf86DrvMsg(pScreen->myNum, X_ERROR, + "[DRI2] Couldn't drmGetVersion() on non-PCI device, " + "no driver name found.\n"); +- return NULL; ++ return; + } + +- driver = strndup(version->name, version->name_len); ++ /* FIXME this gets leaked */ ++ *dri_driver_ret = strndup(version->name, version->name_len); ++ *vdpau_driver_ret = *dri_driver_ret; + drmFreeVersion(version); +- return driver; ++ return; + } + + for (i = 0; driver_map[i].driver; i++) { +@@ -1469,13 +1475,15 @@ dri2_probe_driver_name(ScreenPtr pScreen, DRI2InfoPtr info) + continue; + + if (driver_map[i].num_chips_ids == -1) { +- driver = strdup(driver_map[i].driver); ++ *dri_driver_ret = driver_map[i].driver; ++ *vdpau_driver_ret = driver_map[i].vdpau_driver; + goto out; + } + + for (j = 0; j < driver_map[i].num_chips_ids; j++) { + if (driver_map[i].chip_ids[j] == dev->deviceinfo.pci->device_id) { +- driver = strdup(driver_map[i].driver); ++ *dri_driver_ret = driver_map[i].driver; ++ *vdpau_driver_ret = driver_map[i].vdpau_driver; + goto out; + } + } +@@ -1487,9 +1495,9 @@ dri2_probe_driver_name(ScreenPtr pScreen, DRI2InfoPtr info) + dev->deviceinfo.pci->vendor_id, dev->deviceinfo.pci->device_id); + out: + drmFreeDevice(&dev); +- return driver; + #else +- return NULL; ++ *dri_driver_ret = NULL; ++ *vdpau_driver_ret = NULL; + #endif + } + +@@ -1610,7 +1618,8 @@ DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info) + if (info->driverName) { + ds->driverNames[0] = info->driverName; + } else { +- ds->driverNames[0] = ds->driverNames[1] = dri2_probe_driver_name(pScreen, info); ++ dri2_probe_driver_name(pScreen, info, ++ &ds->driverNames[0], &ds->driverNames[1]); + if (!ds->driverNames[0]) + return FALSE; + } +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..7036d1003 100644 +--- a/hw/xfree86/dri2/pci_ids/pci_id_driver_map.h ++++ b/hw/xfree86/dri2/pci_ids/pci_id_driver_map.h +@@ -66,21 +66,22 @@ static const int vmwgfx_chip_ids[] = { + static const struct { + int vendor_id; + const char *driver; ++ const char *vdpau_driver; + const int *chip_ids; + int num_chips_ids; + } driver_map[] = { +- { 0x8086, "i915", i915_chip_ids, ARRAY_SIZE(i915_chip_ids) }, +- { 0x8086, "i965", i965_chip_ids, ARRAY_SIZE(i965_chip_ids) }, ++ { 0x8086, "i915", "i915", i915_chip_ids, ARRAY_SIZE(i915_chip_ids) }, ++ { 0x8086, "i965", "va_gl", i965_chip_ids, ARRAY_SIZE(i965_chip_ids) }, + #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) }, ++ { 0x1002, "radeon", "radeon", r100_chip_ids, ARRAY_SIZE(r100_chip_ids) }, ++ { 0x1002, "r200", "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) }, +- { 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) }, ++ { 0x1002, "r300", "r300", r300_chip_ids, ARRAY_SIZE(r300_chip_ids) }, ++ { 0x1002, "r600","r600", r600_chip_ids, ARRAY_SIZE(r600_chip_ids) }, ++ { 0x1002, "radeonsi", "radeonsi", radeonsi_chip_ids, ARRAY_SIZE(radeonsi_chip_ids) }, ++ { 0x10de, "nouveau", "nouveau", NULL, -1 }, ++ { 0x1af4, "virtio_gpu", "virtio_gpu", virtio_gpu_chip_ids, ARRAY_SIZE(virtio_gpu_chip_ids) }, ++ { 0x15ad, "vmwgfx", "vmwgfx", vmwgfx_chip_ids, ARRAY_SIZE(vmwgfx_chip_ids) }, + { 0x0000, NULL, NULL, 0 }, + }; + +-- +2.19.0 + diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index e56a72e..611a431 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -46,7 +46,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.20.1 -Release: 3%{?gitdate:.%{gitdate}}%{dist} +Release: 4%{?gitdate:.%{gitdate}}%{dist} URL: http://www.x.org License: MIT Group: User Interface/X @@ -83,8 +83,9 @@ Patch1: 06_use-intel-only-on-pre-gen4.diff # Default to xf86-video-modesetting on GeForce 8 and newer Patch2: 0001-xfree86-use-modesetting-driver-by-default-on-GeForce.patch -# XXX needs rebase, but also va_gl should probably just be the default -# Patch3: 0001-xf86-dri2-Use-va_gl-as-vdpau_driver-for-Intel-i965-G.patch +# Default to va_gl on intel i965 as we use the modesetting drv there +# va_gl should probably just be the default everywhere ? +Patch3: 0001-xf86-dri2-Use-va_gl-as-vdpau_driver-for-Intel-i965-G.patch Patch4: 0001-Always-install-vbe-and-int10-sdk-headers.patch @@ -533,6 +534,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Thu Oct 4 2018 Hans de Goede - 1.20.1-4 +- Rebase patch to use va_gl as vdpau driver on i965 GPUs, re-fix rhbz#1413733 + * Thu Sep 13 2018 Dave Airlie - 1.20.1-3 - Build with PIE enabled (this doesn't enable bind now) From 60bd7d1fb56c3be0d51c777b88b28c8b220a6ceb Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Mon, 15 Oct 2018 12:13:44 -0400 Subject: [PATCH 023/131] xserver 1.20.2 --- ...direct-context-in-CreateContextAttri.patch | 60 -------------- 0001-present-fix-freed-pointer-access.patch | 80 ------------------ ...xwl_present_window-from-privates-on-.patch | 81 ------------------- ...ayland-fix-access-to-invalid-pointer.patch | 78 ------------------ sources | 3 +- xorg-x11-server.spec | 13 ++- 6 files changed, 6 insertions(+), 309 deletions(-) delete mode 100644 0001-glx-check-for-indirect-context-in-CreateContextAttri.patch delete mode 100644 0001-present-fix-freed-pointer-access.patch delete mode 100644 0001-xwayland-Remove-xwl_present_window-from-privates-on-.patch delete mode 100644 0001-xwayland-fix-access-to-invalid-pointer.patch diff --git a/0001-glx-check-for-indirect-context-in-CreateContextAttri.patch b/0001-glx-check-for-indirect-context-in-CreateContextAttri.patch deleted file mode 100644 index 7c51440..0000000 --- a/0001-glx-check-for-indirect-context-in-CreateContextAttri.patch +++ /dev/null @@ -1,60 +0,0 @@ -From 2881ce563661043ef0ee1163c63c120f3622e6d1 Mon Sep 17 00:00:00 2001 -From: Olivier Fourdan -Date: Wed, 5 Sep 2018 15:06:55 +0200 -Subject: [PATCH xserver] glx: check for indirect context in - CreateContextAttribsARB() - -Commit 99f0365b "Add a command line argument for disabling indirect GLX" -added a test to check if indirect context are enabled in -`DoCreateContext()` but `__glXDisp_CreateContextAttribsARB()` doesn't -use `DoCreateContext()` and doesn't check if indirect context is -enabled. - -As a result, clients can still manage to create indirect contexts using -`glXCreateContextAttribsARB()` even if indirect contexts are disabled, -which can possibly crash Xservers such as Xwayland or Xephyr when the -context is destroyed. - -To avoid the issue, check for `enableIndirectGLX` in -`__glXDisp_CreateContextAttribsARB()` as well. - -Fixes: 99f0365b "Add a command line argument for disabling indirect GLX" -Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107508 -Signed-off-by: Olivier Fourdan ---- - glx/createcontext.c | 12 ++++++++++++ - 1 file changed, 12 insertions(+) - -diff --git a/glx/createcontext.c b/glx/createcontext.c -index 7d09c3a1c..24b02ddfb 100644 ---- a/glx/createcontext.c -+++ b/glx/createcontext.c -@@ -28,6 +28,7 @@ - #include "glxserver.h" - #include "glxext.h" - #include "indirect_dispatch.h" -+#include "opaque.h" - - #define ALL_VALID_FLAGS \ - (GLX_CONTEXT_DEBUG_BIT_ARB | GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB \ -@@ -320,6 +321,17 @@ __glXDisp_CreateContextAttribsARB(__GLXclientState * cl, GLbyte * pc) - err = BadAlloc; - } - else { -+ /* Only allow creating indirect GLX contexts if allowed by -+ * server command line. Indirect GLX is of limited use (since -+ * it's only GL 1.4), it's slower than direct contexts, and -+ * it's a massive attack surface for buffer overflow type -+ * errors. -+ */ -+ if (!enableIndirectGLX) { -+ client->errorValue = req->isDirect; -+ return BadValue; -+ } -+ - ctx = glxScreen->createContext(glxScreen, config, shareCtx, - req->numAttribs, (uint32_t *) attribs, - &err); --- -2.19.0.rc1 - diff --git a/0001-present-fix-freed-pointer-access.patch b/0001-present-fix-freed-pointer-access.patch deleted file mode 100644 index 8c28ee8..0000000 --- a/0001-present-fix-freed-pointer-access.patch +++ /dev/null @@ -1,80 +0,0 @@ -From 259f838af4aae2c240d0ea9c05073a86718990d7 Mon Sep 17 00:00:00 2001 -From: Lionel Landwerlin -Date: Mon, 27 Aug 2018 01:04:45 +0100 -Subject: [PATCH xserver] present: fix freed pointer access - -When a vblank has been marked as aborted, it's going to be free in the -flip_notify function when stopped. We can't notify it after it's -stopped because the pointer is invalid. - -Valgrind backtrace: - -==5331== Invalid read of size 8 -==5331== at 0x212B4D: present_vblank_notify (present_vblank.c:34) -==5331== by 0x21439B: present_wnmd_flip_notify (present_wnmd.c:194) -==5331== by 0x21439B: present_wnmd_event_notify (present_wnmd.c:228) -==5331== by 0x156216: xwl_present_sync_callback (xwayland-present.c:282) -==5331== by 0x6570FCD: ffi_call_unix64 (in /usr/lib/x86_64-linux-gnu/libffi.so.6.0.4) -==5331== by 0x657093E: ffi_call (in /usr/lib/x86_64-linux-gnu/libffi.so.6.0.4) -==5331== by 0x4DDB183: ??? (in /usr/lib/x86_64-linux-gnu/libwayland-client.so.0.3.0) -==5331== by 0x4DD79D8: ??? (in /usr/lib/x86_64-linux-gnu/libwayland-client.so.0.3.0) -==5331== by 0x4DD8EA3: wl_display_dispatch_queue_pending (in /usr/lib/x86_64-linux-gnu/libwayland-client.so.0.3.0) -==5331== by 0x14BCCA: xwl_read_events (xwayland.c:814) -==5331== by 0x2AC0D0: ospoll_wait (ospoll.c:651) -==5331== by 0x2A5322: WaitForSomething (WaitFor.c:208) -==5331== by 0x27574B: Dispatch (dispatch.c:421) -==5331== Address 0x1b44dc98 is 40 bytes inside a block of size 184 free'd -==5331== at 0x48369EB: free (vg_replace_malloc.c:530) -==5331== by 0x213B0A: present_wnmd_free_idle_vblanks (present_wnmd.c:118) -==5331== by 0x213B0A: present_wnmd_flips_stop (present_wnmd.c:161) -==5331== by 0x2143EF: present_wnmd_flip_notify (present_wnmd.c:192) -==5331== by 0x2143EF: present_wnmd_event_notify (present_wnmd.c:228) -==5331== by 0x156216: xwl_present_sync_callback (xwayland-present.c:282) -==5331== by 0x6570FCD: ffi_call_unix64 (in /usr/lib/x86_64-linux-gnu/libffi.so.6.0.4) -==5331== by 0x657093E: ffi_call (in /usr/lib/x86_64-linux-gnu/libffi.so.6.0.4) -==5331== by 0x4DDB183: ??? (in /usr/lib/x86_64-linux-gnu/libwayland-client.so.0.3.0) -==5331== by 0x4DD79D8: ??? (in /usr/lib/x86_64-linux-gnu/libwayland-client.so.0.3.0) -==5331== by 0x4DD8EA3: wl_display_dispatch_queue_pending (in /usr/lib/x86_64-linux-gnu/libwayland-client.so.0.3.0) -==5331== by 0x14BCCA: xwl_read_events (xwayland.c:814) -==5331== by 0x2AC0D0: ospoll_wait (ospoll.c:651) -==5331== by 0x2A5322: WaitForSomething (WaitFor.c:208) -==5331== Block was alloc'd at -==5331== at 0x48377D5: calloc (vg_replace_malloc.c:711) -==5331== by 0x212D9F: present_vblank_create (present_vblank.c:69) -==5331== by 0x214014: present_wnmd_pixmap (present_wnmd.c:610) -==5331== by 0x21576C: proc_present_pixmap (present_request.c:150) -==5331== by 0x27599D: Dispatch (dispatch.c:479) -==5331== by 0x279945: dix_main (main.c:276) -==5331== by 0x633AB16: (below main) (libc-start.c:310) - -v2: Still notify aborted flips (Roman) - -Signed-off-by: Lionel Landwerlin -Reviewed-by: Daniel Stone -Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107314 -Reviewed-by: Roman Gilg -Tested-by: Roman Gilg ---- - present/present_wnmd.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/present/present_wnmd.c b/present/present_wnmd.c -index 035ae8ffe..8f3836440 100644 ---- a/present/present_wnmd.c -+++ b/present/present_wnmd.c -@@ -188,10 +188,11 @@ present_wnmd_flip_notify(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_ - window_priv->flip_active = vblank; - window_priv->flip_pending = NULL; - -+ present_vblank_notify(vblank, PresentCompleteKindPixmap, PresentCompleteModeFlip, ust, crtc_msc); -+ - if (vblank->abort_flip) - present_wnmd_flips_stop(window); - -- present_vblank_notify(vblank, PresentCompleteKindPixmap, PresentCompleteModeFlip, ust, crtc_msc); - present_wnmd_flip_try_ready(window); - } - --- -2.19.0.rc1 - diff --git a/0001-xwayland-Remove-xwl_present_window-from-privates-on-.patch b/0001-xwayland-Remove-xwl_present_window-from-privates-on-.patch deleted file mode 100644 index 1575cb0..0000000 --- a/0001-xwayland-Remove-xwl_present_window-from-privates-on-.patch +++ /dev/null @@ -1,81 +0,0 @@ -From 90ac51f3e44d8d433741dc0f0495e79cc6e5fd51 Mon Sep 17 00:00:00 2001 -From: Olivier Fourdan -Date: Wed, 5 Sep 2018 09:34:12 +0200 -Subject: [PATCH xserver] xwayland: Remove xwl_present_window from privates on - cleanup - -Xwayland's `xwl_destroy_window()` invokes `xwl_present_cleanup()` -before the common `DestroyWindow()`. - -But then `DestroyWindow()` calls `present_destroy_window()` which will -possibly end up in `xwl_present_abort_vblank()` which will try to access -data that was previously freed by `xwl_present_cleanup()`: - - Invalid read of size 8 - at 0x434184: xwl_present_abort_vblank (xwayland-present.c:378) - by 0x53785B: present_wnmd_abort_vblank (present_wnmd.c:651) - by 0x53695A: present_free_window_vblank (present_screen.c:87) - by 0x53695A: present_destroy_window (present_screen.c:152) - by 0x42A90D: xwl_destroy_window (xwayland.c:653) - by 0x584298: compDestroyWindow (compwindow.c:613) - by 0x53CEE3: damageDestroyWindow (damage.c:1570) - by 0x4F1BB8: DbeDestroyWindow (dbe.c:1326) - by 0x46F7F6: FreeWindowResources (window.c:1031) - by 0x472847: DeleteWindow (window.c:1099) - by 0x46B54C: doFreeResource (resource.c:880) - by 0x46C706: FreeClientResources (resource.c:1146) - by 0x446ADE: CloseDownClient (dispatch.c:3473) - Address 0x182abde0 is 80 bytes inside a block of size 112 free'd - at 0x4C2FDAC: free (vg_replace_malloc.c:530) - by 0x42A937: xwl_destroy_window (xwayland.c:647) - by 0x584298: compDestroyWindow (compwindow.c:613) - by 0x53CEE3: damageDestroyWindow (damage.c:1570) - by 0x4F1BB8: DbeDestroyWindow (dbe.c:1326) - by 0x46F7F6: FreeWindowResources (window.c:1031) - by 0x472847: DeleteWindow (window.c:1099) - by 0x46B54C: doFreeResource (resource.c:880) - by 0x46C706: FreeClientResources (resource.c:1146) - by 0x446ADE: CloseDownClient (dispatch.c:3473) - by 0x446DA5: ProcKillClient (dispatch.c:3279) - by 0x4476AF: Dispatch (dispatch.c:479) - Block was alloc'd at - at 0x4C30B06: calloc (vg_replace_malloc.c:711) - by 0x433F46: xwl_present_window_get_priv (xwayland-present.c:54) - by 0x434228: xwl_present_get_crtc (xwayland-present.c:302) - by 0x539728: proc_present_query_capabilities (present_request.c:227) - by 0x4476AF: Dispatch (dispatch.c:479) - by 0x44B5B5: dix_main (main.c:276) - by 0x75F611A: (below main) (libc-start.c:308) - -This is because `xwl_present_cleanup()` frees the memory but does not -remove it from the window's privates, and `xwl_present_abort_vblank()` -will still find it and hence try to access that freed memory... - -Remove `xwl_present_window` from window's privates on cleanup so that no -other function can find and reuse that data once it's freed. - -Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1616269 -Signed-off-by: Olivier Fourdan ---- - hw/xwayland/xwayland-present.c | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c -index 81e0eb9ce..316e04443 100644 ---- a/hw/xwayland/xwayland-present.c -+++ b/hw/xwayland/xwayland-present.c -@@ -147,6 +147,11 @@ xwl_present_cleanup(WindowPtr window) - /* Clear timer */ - xwl_present_free_timer(xwl_present_window); - -+ /* Remove from privates so we don't try to access it later */ -+ dixSetPrivate(&window->devPrivates, -+ &xwl_present_window_private_key, -+ NULL); -+ - free(xwl_present_window); - } - --- -2.19.0.rc1 - diff --git a/0001-xwayland-fix-access-to-invalid-pointer.patch b/0001-xwayland-fix-access-to-invalid-pointer.patch deleted file mode 100644 index a6026ba..0000000 --- a/0001-xwayland-fix-access-to-invalid-pointer.patch +++ /dev/null @@ -1,78 +0,0 @@ -From b3f6dc6892ca554ecb57f4289182a3e29915a2c6 Mon Sep 17 00:00:00 2001 -From: Lionel Landwerlin -Date: Tue, 28 Aug 2018 21:30:05 +0100 -Subject: [PATCH xserver] xwayland: fix access to invalid pointer - -xwl_output->randr_crtc is used in the update_screen_size() function : - -==5331== Invalid read of size 4 -==5331== at 0x15263D: update_screen_size (xwayland-output.c:190) -==5331== by 0x152C48: xwl_output_remove (xwayland-output.c:413) -==5331== by 0x6570FCD: ffi_call_unix64 (in /usr/lib/x86_64-linux-gnu/libffi.so.6.0.4) -==5331== by 0x657093E: ffi_call (in /usr/lib/x86_64-linux-gnu/libffi.so.6.0.4) -==5331== by 0x4DDB183: ??? (in /usr/lib/x86_64-linux-gnu/libwayland-client.so.0.3.0) -==5331== by 0x4DD79D8: ??? (in /usr/lib/x86_64-linux-gnu/libwayland-client.so.0.3.0) -==5331== by 0x4DD8EA3: wl_display_dispatch_queue_pending (in /usr/lib/x86_64-linux-gnu/libwayland-client.so.0.3.0) -==5331== by 0x14BCCA: xwl_read_events (xwayland.c:814) -==5331== by 0x2AC0D0: ospoll_wait (ospoll.c:651) -==5331== by 0x2A5322: WaitForSomething (WaitFor.c:208) -==5331== by 0x27574B: Dispatch (dispatch.c:421) -==5331== by 0x279945: dix_main (main.c:276) -==5331== Address 0x1aacb5f4 is 36 bytes inside a block of size 154 free'd -==5331== at 0x48369EB: free (vg_replace_malloc.c:530) -==5331== by 0x1F8AE8: RROutputDestroyResource (rroutput.c:421) -==5331== by 0x29A2AC: doFreeResource (resource.c:880) -==5331== by 0x29AE5B: FreeResource (resource.c:910) -==5331== by 0x152BE0: xwl_output_remove (xwayland-output.c:408) -==5331== by 0x6570FCD: ffi_call_unix64 (in /usr/lib/x86_64-linux-gnu/libffi.so.6.0.4) -==5331== by 0x657093E: ffi_call (in /usr/lib/x86_64-linux-gnu/libffi.so.6.0.4) -==5331== by 0x4DDB183: ??? (in /usr/lib/x86_64-linux-gnu/libwayland-client.so.0.3.0) -==5331== by 0x4DD79D8: ??? (in /usr/lib/x86_64-linux-gnu/libwayland-client.so.0.3.0) -==5331== by 0x4DD8EA3: wl_display_dispatch_queue_pending (in /usr/lib/x86_64-linux-gnu/libwayland-client.so.0.3.0) -==5331== by 0x14BCCA: xwl_read_events (xwayland.c:814) -==5331== by 0x2AC0D0: ospoll_wait (ospoll.c:651) -==5331== Block was alloc'd at -==5331== at 0x48357BF: malloc (vg_replace_malloc.c:299) -==5331== by 0x1F93E0: RROutputCreate (rroutput.c:83) -==5331== by 0x152A75: xwl_output_create (xwayland-output.c:361) -==5331== by 0x14BE59: registry_global (xwayland.c:764) -==5331== by 0x6570FCD: ffi_call_unix64 (in /usr/lib/x86_64-linux-gnu/libffi.so.6.0.4) -==5331== by 0x657093E: ffi_call (in /usr/lib/x86_64-linux-gnu/libffi.so.6.0.4) -==5331== by 0x4DDB183: ??? (in /usr/lib/x86_64-linux-gnu/libwayland-client.so.0.3.0) -==5331== by 0x4DD79D8: ??? (in /usr/lib/x86_64-linux-gnu/libwayland-client.so.0.3.0) -==5331== by 0x4DD8EA3: wl_display_dispatch_queue_pending (in /usr/lib/x86_64-linux-gnu/libwayland-client.so.0.3.0) -==5331== by 0x14BCCA: xwl_read_events (xwayland.c:814) -==5331== by 0x2AC0D0: ospoll_wait (ospoll.c:651) -==5331== by 0x2A5322: WaitForSomething (WaitFor.c:208) - -Signed-off-by: Lionel Landwerlin -Reviewed-by: Daniel Stone ---- - hw/xwayland/xwayland-output.c | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - -diff --git a/hw/xwayland/xwayland-output.c b/hw/xwayland/xwayland-output.c -index 0d2ec7890..cc68f0340 100644 ---- a/hw/xwayland/xwayland-output.c -+++ b/hw/xwayland/xwayland-output.c -@@ -404,14 +404,15 @@ xwl_output_remove(struct xwl_output *xwl_output) - int width = 0, height = 0; - Bool need_rotate = (xwl_output->xdg_output == NULL); - -- RRCrtcDestroy(xwl_output->randr_crtc); -- RROutputDestroy(xwl_output->randr_output); - xorg_list_del(&xwl_output->link); - - xorg_list_for_each_entry(it, &xwl_screen->output_list, link) - output_get_new_size(it, need_rotate, &height, &width); - update_screen_size(xwl_output, width, height); - -+ RRCrtcDestroy(xwl_output->randr_crtc); -+ RROutputDestroy(xwl_output->randr_output); -+ - xwl_output_destroy(xwl_output); - } - --- -2.19.0.rc1 - diff --git a/sources b/sources index a8f856c..8e757f8 100644 --- a/sources +++ b/sources @@ -1,2 +1 @@ -SHA512 (xorg-server-1.20.0.tar.bz2) = 1489e8511c9da682ef0460182dfeeddd241c72d4ef4d206d9706f1e39572c09953df851fab18cefb65a1ee4c6710c6ba13c63c9c9fc0bc1b5f12c50780412cde -SHA512 (xorg-server-1.20.1.tar.bz2) = ef2b93a61683c8ca8d1f14b771e70db65ba119a73db8a46e7cdbf2ac2243e3f4b2732068eb5aa5d7b76f460db995a3c04390870198a5210ec30df4360ad9f94b +SHA512 (xorg-server-1.20.2.tar.bz2) = 1c87d78b14529dd4b438ef038118c8540d1d17bdd58bf08ec5408a2ddbe8d0dda48033a9a9477cfc2c4c304dd1078fa40968a03c4d0cd3398359dd0fadb8e7c7 diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 611a431..751e663 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -45,8 +45,8 @@ Summary: X.Org X11 X server Name: xorg-x11-server -Version: 1.20.1 -Release: 4%{?gitdate:.%{gitdate}}%{dist} +Version: 1.20.2 +Release: 1%{?gitdate:.%{gitdate}}%{dist} URL: http://www.x.org License: MIT Group: User Interface/X @@ -95,12 +95,6 @@ Patch5: 0001-autobind-GPUs-to-the-screen.patch # because the display-managers are not ready yet, do not upstream Patch6: 0001-Fedora-hack-Make-the-suid-root-wrapper-always-start-.patch -# Submitted upstream -Patch7: 0001-xwayland-Remove-xwl_present_window-from-privates-on-.patch -Patch8: 0001-xwayland-fix-access-to-invalid-pointer.patch -Patch9: 0001-present-fix-freed-pointer-access.patch -Patch10: 0001-glx-check-for-indirect-context-in-CreateContextAttri.patch - BuildRequires: systemtap-sdt-devel BuildRequires: git BuildRequires: automake autoconf libtool pkgconfig @@ -534,6 +528,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Mon Oct 15 2018 Adam Jackson - 1.20.2-1 +- xserver 1.20.2 + * Thu Oct 4 2018 Hans de Goede - 1.20.1-4 - Rebase patch to use va_gl as vdpau driver on i965 GPUs, re-fix rhbz#1413733 From e38c5484bc06294f9938092446eadb032c2d5d9c Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Tue, 16 Oct 2018 14:53:03 -0400 Subject: [PATCH 024/131] %{?dist} not %{dist} --- xorg-x11-server.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 751e663..f8805de 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -46,7 +46,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.20.2 -Release: 1%{?gitdate:.%{gitdate}}%{dist} +Release: 1%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org License: MIT Group: User Interface/X From 71d71362b9725ad3995a3e78f8a19ff46082320f Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Thu, 1 Nov 2018 11:42:36 -0400 Subject: [PATCH 025/131] xserver 1.20.3 --- ...-do-not-crash-if-gbm_bo_create-fails.patch | 72 +++++++++++++++++++ xorg-x11-server.spec | 8 ++- 2 files changed, 79 insertions(+), 1 deletion(-) create mode 100644 0001-xwayland-do-not-crash-if-gbm_bo_create-fails.patch diff --git a/0001-xwayland-do-not-crash-if-gbm_bo_create-fails.patch b/0001-xwayland-do-not-crash-if-gbm_bo_create-fails.patch new file mode 100644 index 0000000..69d5b9f --- /dev/null +++ b/0001-xwayland-do-not-crash-if-gbm_bo_create-fails.patch @@ -0,0 +1,72 @@ +From d2af650a280f94d7ddd155cb499110ab45135100 Mon Sep 17 00:00:00 2001 +From: Olivier Fourdan +Date: Fri, 19 Oct 2018 16:04:32 +0200 +Subject: [PATCH xserver] xwayland: do not crash if `gbm_bo_create()` fails + +The function `xwl_glamor_gbm_create_pixmap()` first creates a buffer +objects and then creates the xwl_pixmap from it. + +However, `xwl_glamor_gbm_create_pixmap_for_bo()` is not called if the +buffer object creation fails, and `xwl_glamor_gbm_create_pixmap()` +simply returns `glamor_create_pixmap()`. + +The problem with this is that if `xwl_glamor_gbm_create_pixmap_for_bo()` +is not called then neither is `xwl_pixmap_set_private()` and further +calls to `xwl_pixmap_get()` will return NULL and cause a NULL pointer +dereference if the return value is not checked: + + #0 xwl_glamor_gbm_get_wl_buffer_for_pixmap () + at hw/xwayland/xwayland-glamor-gbm.c:248 + #1 xwl_window_post_damage () at hw/xwayland/xwayland.c:697 + #2 xwl_display_post_damage () at hw/xwayland/xwayland.c:759 + #3 block_handler () at hw/xwayland/xwayland.c:890 + #4 BlockHandler () at dix/dixutils.c:388 + #5 WaitForSomething () at os/WaitFor.c:201 + #6 Dispatch () at dix/dispatch.c:421 + #7 dix_main () at dix/main.c:276 + #8 __libc_start_main () at ../csu/libc-start.c:308 + #9 _start () + + (gdb) print xwl_pixmap + $1 = (struct xwl_pixmap *) 0x0 + +Make sure we check for `xwl_pixmap_get()` returned value where relevant +and fail gracefully if this is the case. + +See also: https://gitlab.gnome.org/GNOME/mutter/issues/340 + +Signed-off-by: Olivier Fourdan +Reviewed-by: Marco Trevisan +Reviewed-by: Peter Hutterer +(cherry picked from commit 036794bebce72a3fa2f95996d2e537ff568e0ff1) +--- + hw/xwayland/xwayland-glamor-gbm.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/hw/xwayland/xwayland-glamor-gbm.c b/hw/xwayland/xwayland-glamor-gbm.c +index 6aa1e4641d..5f8a68fd8c 100644 +--- a/hw/xwayland/xwayland-glamor-gbm.c ++++ b/hw/xwayland/xwayland-glamor-gbm.c +@@ -244,6 +244,9 @@ xwl_glamor_gbm_get_wl_buffer_for_pixmap(PixmapPtr pixmap, + uint64_t modifier; + int i; + ++ if (xwl_pixmap == NULL) ++ return NULL; ++ + if (xwl_pixmap->buffer) { + /* Buffer already exists. Return it and inform caller if interested. */ + if (created) +@@ -494,6 +497,9 @@ glamor_egl_fds_from_pixmap(ScreenPtr screen, PixmapPtr pixmap, int *fds, + + xwl_pixmap = xwl_pixmap_get(pixmap); + ++ if (xwl_pixmap == NULL) ++ return 0; ++ + if (!xwl_pixmap->bo) + return 0; + +-- +2.19.1 + diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index f8805de..0ee723e 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -45,7 +45,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server -Version: 1.20.2 +Version: 1.20.3 Release: 1%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org License: MIT @@ -95,6 +95,9 @@ Patch5: 0001-autobind-GPUs-to-the-screen.patch # because the display-managers are not ready yet, do not upstream Patch6: 0001-Fedora-hack-Make-the-suid-root-wrapper-always-start-.patch +# https://gitlab.freedesktop.org/ajax/xserver/tree/server-1.20-branch +Patch7: 0001-xwayland-do-not-crash-if-gbm_bo_create-fails.patch + BuildRequires: systemtap-sdt-devel BuildRequires: git BuildRequires: automake autoconf libtool pkgconfig @@ -528,6 +531,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Thu Nov 01 2018 Adam Jackson - 1.20.3-1 +- xserver 1.20.3 + * Mon Oct 15 2018 Adam Jackson - 1.20.2-1 - xserver 1.20.2 From d9ffe4889f8dae330d83c475aeb11dd4a406ea1b Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Thu, 1 Nov 2018 12:00:08 -0400 Subject: [PATCH 026/131] Upload the tarball --- sources | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources b/sources index 8e757f8..22e83a2 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (xorg-server-1.20.2.tar.bz2) = 1c87d78b14529dd4b438ef038118c8540d1d17bdd58bf08ec5408a2ddbe8d0dda48033a9a9477cfc2c4c304dd1078fa40968a03c4d0cd3398359dd0fadb8e7c7 +SHA512 (xorg-server-1.20.3.tar.bz2) = ee44554f86df4297f54c5871fe7a18954eeef4338775a25f36d6577b279c4775f61128da71b86cfaeadcc080838d6749dede138d4db178866579da2056543fba From e625aaaade31df6b43fffa8021f28cd313bc71a8 Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Thu, 6 Dec 2018 11:32:15 +0100 Subject: [PATCH 027/131] Xwayland/Present fixes from master upstream --- ..._present_reset_timer-in-xwl_present_.patch | 59 +++++ ...xwl_present_events_notify-to-xwl_pre.patch | 61 +++++ ...e-synchronous-Present-flips-from-xwl.patch | 139 ++++++++++++ ...-xwl_window-present_window-with-pres.patch | 213 ++++++++++++++++++ ...and-Add-xwl_present_unrealize_window.patch | 77 +++++++ ...eed-xwl_window-anymore-in-xwl_presen.patch | 36 +++ ...ake-buffer-release-queue-into-accoun.patch | 37 +++ xorg-x11-server.spec | 14 +- 8 files changed, 635 insertions(+), 1 deletion(-) create mode 100644 0001-xwayland-Use-xwl_present_reset_timer-in-xwl_present_.patch create mode 100644 0002-xwayland-Rename-xwl_present_events_notify-to-xwl_pre.patch create mode 100644 0003-xwayland-Complete-synchronous-Present-flips-from-xwl.patch create mode 100644 0004-xwayland-Replace-xwl_window-present_window-with-pres.patch create mode 100644 0005-xwayland-Add-xwl_present_unrealize_window.patch create mode 100644 0006-xwayland-Don-t-need-xwl_window-anymore-in-xwl_presen.patch create mode 100644 0007-xwayland-Don-t-take-buffer-release-queue-into-accoun.patch diff --git a/0001-xwayland-Use-xwl_present_reset_timer-in-xwl_present_.patch b/0001-xwayland-Use-xwl_present_reset_timer-in-xwl_present_.patch new file mode 100644 index 0000000..6c4bee9 --- /dev/null +++ b/0001-xwayland-Use-xwl_present_reset_timer-in-xwl_present_.patch @@ -0,0 +1,59 @@ +From 26eb8a0020ebf0e3a550f98be5f58820db765b2f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michel=20D=C3=A4nzer?= +Date: Wed, 24 Oct 2018 11:23:05 +0200 +Subject: [PATCH xserver 1/7] xwayland: Use xwl_present_reset_timer in + xwl_present_timer_callback + +Apart from simplifying the code, this should also prevent a condition +(which might only be possible with the following fix) reported in +https://gitlab.freedesktop.org/wayland/weston/issues/115#note_52467: + +1. xwl_present_timer_callback indirectly calls xwl_present_reset_timer + -> xwl_present_free_timer +2. xwl_present_timer_callback then returns a non-0 value, so DoTimer + calls TimerSet with the old xwl_present_window->frame_timer pointer + which was freed in step 1 => use after free + +Calling xwl_present_reset_timer explicitly passes NULL to TimerSet if +step 1 freed xwl_present_window->frame_timer, and it will allocate a new +one. + +(cherry picked from commit 5e8b9a3a563047e3998d45e761f7a50e4b0f6cb3) +--- + hw/xwayland/xwayland-present.c | 13 ++----------- + 1 file changed, 2 insertions(+), 11 deletions(-) + +diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c +index 316e04443..7539c1636 100644 +--- a/hw/xwayland/xwayland-present.c ++++ b/hw/xwayland/xwayland-present.c +@@ -216,24 +216,15 @@ xwl_present_timer_callback(OsTimerPtr timer, + void *arg) + { + struct xwl_present_window *xwl_present_window = arg; +- WindowPtr present_window = xwl_present_window->window; +- struct xwl_window *xwl_window = xwl_window_from_window(present_window); + + xwl_present_window->frame_timer_firing = TRUE; + xwl_present_window->msc++; + xwl_present_window->ust = GetTimeInMicros(); + + xwl_present_events_notify(xwl_present_window); ++ xwl_present_reset_timer(xwl_present_window); + +- if (xwl_present_has_events(xwl_present_window)) { +- /* Still events, restart timer */ +- return xwl_present_is_flipping(present_window, xwl_window) ? TIMER_LEN_FLIP : +- TIMER_LEN_COPY; +- } else { +- /* No more events, do not restart timer and delete it instead */ +- xwl_present_free_timer(xwl_present_window); +- return 0; +- } ++ return 0; + } + + static void +-- +2.19.2 + diff --git a/0002-xwayland-Rename-xwl_present_events_notify-to-xwl_pre.patch b/0002-xwayland-Rename-xwl_present_events_notify-to-xwl_pre.patch new file mode 100644 index 0000000..0ca192f --- /dev/null +++ b/0002-xwayland-Rename-xwl_present_events_notify-to-xwl_pre.patch @@ -0,0 +1,61 @@ +From bd4b3eb727b14133929d7bf04fed3829a632fc5b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michel=20D=C3=A4nzer?= +Date: Thu, 18 Oct 2018 17:36:24 +0200 +Subject: [PATCH xserver 2/7] xwayland: Rename xwl_present_events_notify to + xwl_present_msc_bump + +And consolidate more code from xwl_present_timer_callback and +xwl_present_frame_callback in it. + +(cherry picked from commit 2bfc46d4147dc0bec4cdbb80431a0f4cc1d3b030) +--- + hw/xwayland/xwayland-present.c | 15 ++++++--------- + 1 file changed, 6 insertions(+), 9 deletions(-) + +diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c +index 7539c1636..117ce781d 100644 +--- a/hw/xwayland/xwayland-present.c ++++ b/hw/xwayland/xwayland-present.c +@@ -192,11 +192,13 @@ static const struct wl_buffer_listener xwl_present_release_listener = { + }; + + static void +-xwl_present_events_notify(struct xwl_present_window *xwl_present_window) ++xwl_present_msc_bump(struct xwl_present_window *xwl_present_window) + { +- uint64_t msc = xwl_present_window->msc; ++ uint64_t msc = ++xwl_present_window->msc; + struct xwl_present_event *event, *tmp; + ++ xwl_present_window->ust = GetTimeInMicros(); ++ + xorg_list_for_each_entry_safe(event, tmp, + &xwl_present_window->event_list, + list) { +@@ -218,10 +220,8 @@ xwl_present_timer_callback(OsTimerPtr timer, + struct xwl_present_window *xwl_present_window = arg; + + xwl_present_window->frame_timer_firing = TRUE; +- xwl_present_window->msc++; +- xwl_present_window->ust = GetTimeInMicros(); + +- xwl_present_events_notify(xwl_present_window); ++ xwl_present_msc_bump(xwl_present_window); + xwl_present_reset_timer(xwl_present_window); + + return 0; +@@ -242,10 +242,7 @@ xwl_present_frame_callback(void *data, + return; + } + +- xwl_present_window->msc++; +- xwl_present_window->ust = GetTimeInMicros(); +- +- xwl_present_events_notify(xwl_present_window); ++ xwl_present_msc_bump(xwl_present_window); + + /* we do not need the timer anymore for this frame, + * reset it for potentially the next one +-- +2.19.2 + diff --git a/0003-xwayland-Complete-synchronous-Present-flips-from-xwl.patch b/0003-xwayland-Complete-synchronous-Present-flips-from-xwl.patch new file mode 100644 index 0000000..0b7f351 --- /dev/null +++ b/0003-xwayland-Complete-synchronous-Present-flips-from-xwl.patch @@ -0,0 +1,139 @@ +From 908c3b4c291e62e63677a75e125f6fd7706493aa Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michel=20D=C3=A4nzer?= +Date: Thu, 18 Oct 2018 17:42:01 +0200 +Subject: [PATCH xserver 3/7] xwayland: Complete "synchronous" Present flips + from xwl_present_msc_bump + +Completing them from xwl_present_sync_callback had at least two issues: + +* It was before the MSC was incremented in xwl_present_frame_callback, + so the MSC value in the completion event could be lower than the + target specified by the client. This could cause hangs with the Mesa + Vulkan drivers. +* It allowed clients to run at a frame-rate higher than the Wayland + compositor's frame-rate, wasting energy on generating frames which + were never displayed. This isn't expected to happen unless the client + specified PresentOptionAsync (in which case flips are still completed + from xwl_present_sync_callback, allowing higher frame-rates). + +v2: +* Make xwl_present_has_events return true when there's a pending + "synchronous" flip, so those complete after at most ~1 second even if + the Wayland server doesn't send a frame event. + +Bugzilla: https://bugs.freedesktop.org/106713 +(cherry picked from commit ace551d8a2603e37b18237a52f62d627c75d9e2a) +--- + hw/xwayland/xwayland-present.c | 51 +++++++++++++++++++++++++++++----- + hw/xwayland/xwayland.h | 1 + + 2 files changed, 45 insertions(+), 7 deletions(-) + +diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c +index 117ce781d..4f517d46b 100644 +--- a/hw/xwayland/xwayland-present.c ++++ b/hw/xwayland/xwayland-present.c +@@ -85,7 +85,8 @@ xwl_present_timer_callback(OsTimerPtr timer, + static inline Bool + xwl_present_has_events(struct xwl_present_window *xwl_present_window) + { +- return !xorg_list_is_empty(&xwl_present_window->event_list) || ++ return !!xwl_present_window->sync_flip || ++ !xorg_list_is_empty(&xwl_present_window->event_list) || + !xorg_list_is_empty(&xwl_present_window->release_queue); + } + +@@ -139,6 +140,16 @@ xwl_present_cleanup(WindowPtr window) + } + + /* Clear remaining buffer releases and inform Present about free ressources */ ++ event = xwl_present_window->sync_flip; ++ xwl_present_window->sync_flip = NULL; ++ if (event) { ++ if (event->buffer_released) { ++ free(event); ++ } else { ++ event->pending = FALSE; ++ event->abort = TRUE; ++ } ++ } + xorg_list_for_each_entry_safe(event, tmp, &xwl_present_window->release_queue, list) { + xorg_list_del(&event->list); + event->abort = TRUE; +@@ -199,6 +210,24 @@ xwl_present_msc_bump(struct xwl_present_window *xwl_present_window) + + xwl_present_window->ust = GetTimeInMicros(); + ++ event = xwl_present_window->sync_flip; ++ xwl_present_window->sync_flip = NULL; ++ if (event) { ++ event->pending = FALSE; ++ ++ present_wnmd_event_notify(xwl_present_window->window, event->event_id, ++ xwl_present_window->ust, msc); ++ ++ if (event->buffer_released) { ++ /* If the buffer was already released, clean up now */ ++ present_wnmd_event_notify(xwl_present_window->window, event->event_id, ++ xwl_present_window->ust, msc); ++ free(event); ++ } else { ++ xorg_list_add(&event->list, &xwl_present_window->release_queue); ++ } ++ } ++ + xorg_list_for_each_entry_safe(event, tmp, + &xwl_present_window->event_list, + list) { +@@ -454,12 +483,17 @@ xwl_present_flip(WindowPtr present_window, + event->event_id = event_id; + event->xwl_present_window = xwl_present_window; + event->buffer = buffer; +- event->target_msc = xwl_present_window->msc; ++ event->target_msc = target_msc; + event->pending = TRUE; + event->abort = FALSE; + event->buffer_released = FALSE; + +- xorg_list_add(&event->list, &xwl_present_window->release_queue); ++ if (sync_flip) { ++ xorg_list_init(&event->list); ++ xwl_present_window->sync_flip = event; ++ } else { ++ xorg_list_add(&event->list, &xwl_present_window->release_queue); ++ } + + if (buffer_created) + wl_buffer_add_listener(buffer, &xwl_present_release_listener, NULL); +@@ -488,10 +522,13 @@ xwl_present_flip(WindowPtr present_window, + + wl_surface_commit(xwl_window->surface); + +- xwl_present_window->sync_callback = wl_display_sync(xwl_window->xwl_screen->display); +- wl_callback_add_listener(xwl_present_window->sync_callback, +- &xwl_present_sync_listener, +- event); ++ if (!sync_flip) { ++ xwl_present_window->sync_callback = ++ wl_display_sync(xwl_window->xwl_screen->display); ++ wl_callback_add_listener(xwl_present_window->sync_callback, ++ &xwl_present_sync_listener, ++ event); ++ } + + wl_display_flush(xwl_window->xwl_screen->display); + return TRUE; +diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h +index 67819e178..3f4a601fe 100644 +--- a/hw/xwayland/xwayland.h ++++ b/hw/xwayland/xwayland.h +@@ -188,6 +188,7 @@ struct xwl_window { + #ifdef GLAMOR_HAS_GBM + struct xwl_present_window { + struct xwl_screen *xwl_screen; ++ struct xwl_present_event *sync_flip; + WindowPtr window; + struct xorg_list link; + +-- +2.19.2 + diff --git a/0004-xwayland-Replace-xwl_window-present_window-with-pres.patch b/0004-xwayland-Replace-xwl_window-present_window-with-pres.patch new file mode 100644 index 0000000..352946f --- /dev/null +++ b/0004-xwayland-Replace-xwl_window-present_window-with-pres.patch @@ -0,0 +1,213 @@ +From 5a1cb0989274fd745569a60c28c9a5ca729cabf6 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michel=20D=C3=A4nzer?= +Date: Thu, 1 Nov 2018 18:44:24 +0100 +Subject: [PATCH xserver 4/7] xwayland: Replace xwl_window::present_window with + ::present_flipped + +There's no need to keep track of the window which last performed a +Present flip. This fixes crashes due to the assertion in +xwl_present_flips_stop failing. Fixes issue #10. + +The damage generated by a flip only needs to be ignored once, then +xwl_window::present_flipped can be cleared. This may fix freezing in +the (hypothetical) scenario where Present flips are performed on a +window, followed by other drawing requests using the window as the +destination, but nothing triggering xwl_present_flips_stop. The damage +from the latter drawing requests would continue being ignored. + +(cherry picked from commit 6b016d58d23d16eaae9908a92ed90547d1926317) +--- + hw/xwayland/xwayland-present.c | 56 ++++++++-------------------------- + hw/xwayland/xwayland.c | 17 ++++++++--- + hw/xwayland/xwayland.h | 4 ++- + 3 files changed, 27 insertions(+), 50 deletions(-) + +diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c +index 4f517d46b..e6dca5ed0 100644 +--- a/hw/xwayland/xwayland-present.c ++++ b/hw/xwayland/xwayland-present.c +@@ -90,24 +90,19 @@ xwl_present_has_events(struct xwl_present_window *xwl_present_window) + !xorg_list_is_empty(&xwl_present_window->release_queue); + } + +-static inline Bool +-xwl_present_is_flipping(WindowPtr window, struct xwl_window *xwl_window) +-{ +- return xwl_window && xwl_window->present_window == window; +-} +- + static void + xwl_present_reset_timer(struct xwl_present_window *xwl_present_window) + { + if (xwl_present_has_events(xwl_present_window)) { +- WindowPtr present_window = xwl_present_window->window; +- Bool is_flipping = xwl_present_is_flipping(present_window, +- xwl_window_from_window(present_window)); ++ CARD32 timeout; ++ ++ if (xwl_present_window->frame_callback) ++ timeout = TIMER_LEN_FLIP; ++ else ++ timeout = TIMER_LEN_COPY; + + xwl_present_window->frame_timer = TimerSet(xwl_present_window->frame_timer, +- 0, +- is_flipping ? TIMER_LEN_FLIP : +- TIMER_LEN_COPY, ++ 0, timeout, + &xwl_present_timer_callback, + xwl_present_window); + } else { +@@ -118,16 +113,12 @@ xwl_present_reset_timer(struct xwl_present_window *xwl_present_window) + void + xwl_present_cleanup(WindowPtr window) + { +- struct xwl_window *xwl_window = xwl_window_from_window(window); + struct xwl_present_window *xwl_present_window = xwl_present_window_priv(window); + struct xwl_present_event *event, *tmp; + + if (!xwl_present_window) + return; + +- if (xwl_window && xwl_window->present_window == window) +- xwl_window->present_window = NULL; +- + if (xwl_present_window->frame_callback) { + wl_callback_destroy(xwl_present_window->frame_callback); + xwl_present_window->frame_callback = NULL; +@@ -361,10 +352,6 @@ xwl_present_queue_vblank(WindowPtr present_window, + if (!xwl_window) + return BadMatch; + +- if (xwl_window->present_window && +- xwl_window->present_window != present_window) +- return BadMatch; +- + event = malloc(sizeof *event); + if (!event) + return BadAlloc; +@@ -433,13 +420,6 @@ xwl_present_check_flip2(RRCrtcPtr crtc, + if (!xwl_window) + return FALSE; + +- /* +- * Do not flip if there is already another child window doing flips. +- */ +- if (xwl_window->present_window && +- xwl_window->present_window != present_window) +- return FALSE; +- + /* + * We currently only allow flips of windows, that have the same + * dimensions as their xwl_window parent window. For the case of +@@ -476,8 +456,6 @@ xwl_present_flip(WindowPtr present_window, + if (!event) + return FALSE; + +- xwl_window->present_window = present_window; +- + buffer = xwl_glamor_pixmap_get_wl_buffer(pixmap, &buffer_created); + + event->event_id = event_id; +@@ -502,13 +480,6 @@ xwl_present_flip(WindowPtr present_window, + /* We can flip directly to the main surface (full screen window without clips) */ + wl_surface_attach(xwl_window->surface, buffer, 0, 0); + +- if (!xwl_present_window->frame_timer || +- xwl_present_window->frame_timer_firing) { +- /* Realign timer */ +- xwl_present_window->frame_timer_firing = FALSE; +- xwl_present_reset_timer(xwl_present_window); +- } +- + if (!xwl_present_window->frame_callback) { + xwl_present_window->frame_callback = wl_surface_frame(xwl_window->surface); + wl_callback_add_listener(xwl_present_window->frame_callback, +@@ -516,6 +487,10 @@ xwl_present_flip(WindowPtr present_window, + xwl_present_window); + } + ++ /* Realign timer */ ++ xwl_present_window->frame_timer_firing = FALSE; ++ xwl_present_reset_timer(xwl_present_window); ++ + wl_surface_damage(xwl_window->surface, 0, 0, + damage_box->x2 - damage_box->x1, + damage_box->y2 - damage_box->y1); +@@ -531,22 +506,15 @@ xwl_present_flip(WindowPtr present_window, + } + + wl_display_flush(xwl_window->xwl_screen->display); ++ xwl_window->present_flipped = TRUE; + return TRUE; + } + + static void + xwl_present_flips_stop(WindowPtr window) + { +- struct xwl_window *xwl_window = xwl_window_from_window(window); + struct xwl_present_window *xwl_present_window = xwl_present_window_priv(window); + +- if (!xwl_window) +- return; +- +- assert(xwl_window->present_window == window); +- +- xwl_window->present_window = NULL; +- + /* Change back to the fast refresh rate */ + xwl_present_reset_timer(xwl_present_window); + } +diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c +index 96b4db18c..988b8e17d 100644 +--- a/hw/xwayland/xwayland.c ++++ b/hw/xwayland/xwayland.c +@@ -370,6 +370,18 @@ damage_report(DamagePtr pDamage, RegionPtr pRegion, void *data) + struct xwl_window *xwl_window = data; + struct xwl_screen *xwl_screen = xwl_window->xwl_screen; + ++#ifdef GLAMOR_HAS_GBM ++ if (xwl_window->present_flipped) { ++ /* This damage is from a Present flip, which already committed a new ++ * buffer for the surface, so we don't need to do anything in response ++ */ ++ RegionEmpty(DamageRegion(pDamage)); ++ xorg_list_del(&xwl_window->link_damage); ++ xwl_window->present_flipped = FALSE; ++ return; ++ } ++#endif ++ + xorg_list_add(&xwl_window->link_damage, &xwl_screen->damage_window_list); + } + +@@ -721,11 +733,6 @@ xwl_screen_post_damage(struct xwl_screen *xwl_screen) + + xorg_list_for_each_entry_safe(xwl_window, next_xwl_window, + &xwl_screen->damage_window_list, link_damage) { +-#ifdef GLAMOR_HAS_GBM +- /* Present on the main surface. So don't commit here as well. */ +- if (xwl_window->present_window) +- continue; +-#endif + /* If we're waiting on a frame callback from the server, + * don't attach a new buffer. */ + if (xwl_window->frame_callback) +diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h +index 3f4a601fe..a79f836ad 100644 +--- a/hw/xwayland/xwayland.h ++++ b/hw/xwayland/xwayland.h +@@ -182,7 +182,9 @@ struct xwl_window { + struct xorg_list link_damage; + struct wl_callback *frame_callback; + Bool allow_commits; +- WindowPtr present_window; ++#ifdef GLAMOR_HAS_GBM ++ Bool present_flipped; ++#endif + }; + + #ifdef GLAMOR_HAS_GBM +-- +2.19.2 + diff --git a/0005-xwayland-Add-xwl_present_unrealize_window.patch b/0005-xwayland-Add-xwl_present_unrealize_window.patch new file mode 100644 index 0000000..025a74c --- /dev/null +++ b/0005-xwayland-Add-xwl_present_unrealize_window.patch @@ -0,0 +1,77 @@ +From cd243d4c858d9193ba0eeab778c488b74505d0e1 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michel=20D=C3=A4nzer?= +Date: Thu, 1 Nov 2018 18:24:28 +0100 +Subject: [PATCH xserver 5/7] xwayland: Add xwl_present_unrealize_window + +When a window is unrealized, a pending frame callback may never be +called, which could result in repeatedly freezing until the frame timer +fires after a second. + +Fixes these symptoms when switching from fullscreen to windowed mode in +sauerbraten. + +(cherry picked from commit 8c9538573cb9a342897eb3fb4b0c1e4ed917bd0e) +--- + hw/xwayland/xwayland-present.c | 16 ++++++++++++++++ + hw/xwayland/xwayland.c | 5 +++++ + hw/xwayland/xwayland.h | 1 + + 3 files changed, 22 insertions(+) + +diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c +index e6dca5ed0..7e49cb366 100644 +--- a/hw/xwayland/xwayland-present.c ++++ b/hw/xwayland/xwayland-present.c +@@ -519,6 +519,22 @@ xwl_present_flips_stop(WindowPtr window) + xwl_present_reset_timer(xwl_present_window); + } + ++void ++xwl_present_unrealize_window(WindowPtr window) ++{ ++ struct xwl_present_window *xwl_present_window = xwl_present_window_priv(window); ++ ++ if (!xwl_present_window || !xwl_present_window->frame_callback) ++ return; ++ ++ /* The pending frame callback may never be called, so drop it and shorten ++ * the frame timer interval. ++ */ ++ wl_callback_destroy(xwl_present_window->frame_callback); ++ xwl_present_window->frame_callback = NULL; ++ xwl_present_reset_timer(xwl_present_window); ++} ++ + static present_wnmd_info_rec xwl_present_info = { + .version = PRESENT_SCREEN_INFO_VERSION, + .get_crtc = xwl_present_get_crtc, +diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c +index 988b8e17d..7e6e0ab25 100644 +--- a/hw/xwayland/xwayland.c ++++ b/hw/xwayland/xwayland.c +@@ -609,6 +609,11 @@ xwl_unrealize_window(WindowPtr window) + xwl_screen->UnrealizeWindow = screen->UnrealizeWindow; + screen->UnrealizeWindow = xwl_unrealize_window; + ++#ifdef GLAMOR_HAS_GBM ++ if (xwl_screen->present) ++ xwl_present_unrealize_window(window); ++#endif ++ + xwl_window = xwl_window_get(window); + if (!xwl_window) + return ret; +diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h +index a79f836ad..463622669 100644 +--- a/hw/xwayland/xwayland.h ++++ b/hw/xwayland/xwayland.h +@@ -454,6 +454,7 @@ void xwl_glamor_egl_make_current(struct xwl_screen *xwl_screen); + #ifdef GLAMOR_HAS_GBM + Bool xwl_present_init(ScreenPtr screen); + void xwl_present_cleanup(WindowPtr window); ++void xwl_present_unrealize_window(WindowPtr window); + #endif /* GLAMOR_HAS_GBM */ + + #ifdef XV +-- +2.19.2 + diff --git a/0006-xwayland-Don-t-need-xwl_window-anymore-in-xwl_presen.patch b/0006-xwayland-Don-t-need-xwl_window-anymore-in-xwl_presen.patch new file mode 100644 index 0000000..0915df9 --- /dev/null +++ b/0006-xwayland-Don-t-need-xwl_window-anymore-in-xwl_presen.patch @@ -0,0 +1,36 @@ +From 679aa2a629e09aba00f26c819431e7d3a9113834 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michel=20D=C3=A4nzer?= +Date: Fri, 9 Nov 2018 17:18:53 +0100 +Subject: [PATCH xserver 6/7] xwayland: Don't need xwl_window anymore in + xwl_present_queue_vblank + +Fixes issue #12. Presumably the problem was that Present operations on +unmapped windows were executed immediately instead of only when reaching +the target MSC. + +(cherry picked from commit f541615342ce6bfb0e6d4e68deb3a924a87e8ba9) +--- + hw/xwayland/xwayland-present.c | 4 ---- + 1 file changed, 4 deletions(-) + +diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c +index 7e49cb366..eea7415f3 100644 +--- a/hw/xwayland/xwayland-present.c ++++ b/hw/xwayland/xwayland-present.c +@@ -345,13 +345,9 @@ xwl_present_queue_vblank(WindowPtr present_window, + uint64_t event_id, + uint64_t msc) + { +- struct xwl_window *xwl_window = xwl_window_from_window(present_window); + struct xwl_present_window *xwl_present_window = xwl_present_window_get_priv(present_window); + struct xwl_present_event *event; + +- if (!xwl_window) +- return BadMatch; +- + event = malloc(sizeof *event); + if (!event) + return BadAlloc; +-- +2.19.2 + diff --git a/0007-xwayland-Don-t-take-buffer-release-queue-into-accoun.patch b/0007-xwayland-Don-t-take-buffer-release-queue-into-accoun.patch new file mode 100644 index 0000000..545b3e9 --- /dev/null +++ b/0007-xwayland-Don-t-take-buffer-release-queue-into-accoun.patch @@ -0,0 +1,37 @@ +From 354ed9fa48118026456ec2bc64136993f3c53606 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michel=20D=C3=A4nzer?= +Date: Thu, 15 Nov 2018 17:16:59 +0100 +Subject: [PATCH xserver 7/7] xwayland: Don't take buffer release queue into + account for frame timer + +The buffer release queue has two kinds of entries: + +* Pending async flips. +* Completed flips waiting for their buffer to be released by the Wayland + compositor. + +xwl_present_timer_callback neither completes async flips nor releases +buffers, so the timer isn't needed for the buffer release queue. + +(cherry picked from commit e6cd1c9bdefe83e7d99b703a68d26eebb451f889) +--- + hw/xwayland/xwayland-present.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c +index eea7415f3..594e2e822 100644 +--- a/hw/xwayland/xwayland-present.c ++++ b/hw/xwayland/xwayland-present.c +@@ -86,8 +86,7 @@ static inline Bool + xwl_present_has_events(struct xwl_present_window *xwl_present_window) + { + return !!xwl_present_window->sync_flip || +- !xorg_list_is_empty(&xwl_present_window->event_list) || +- !xorg_list_is_empty(&xwl_present_window->release_queue); ++ !xorg_list_is_empty(&xwl_present_window->event_list); + } + + static void +-- +2.19.2 + diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 0ee723e..55383d5 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -46,7 +46,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.20.3 -Release: 1%{?gitdate:.%{gitdate}}%{?dist} +Release: 2%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org License: MIT Group: User Interface/X @@ -98,6 +98,15 @@ Patch6: 0001-Fedora-hack-Make-the-suid-root-wrapper-always-start-.patch # https://gitlab.freedesktop.org/ajax/xserver/tree/server-1.20-branch Patch7: 0001-xwayland-do-not-crash-if-gbm_bo_create-fails.patch +# Xwayland/Present fixes from master upstream +Patch11: 0001-xwayland-Use-xwl_present_reset_timer-in-xwl_present_.patch +Patch12: 0002-xwayland-Rename-xwl_present_events_notify-to-xwl_pre.patch +Patch13: 0003-xwayland-Complete-synchronous-Present-flips-from-xwl.patch +Patch14: 0004-xwayland-Replace-xwl_window-present_window-with-pres.patch +Patch15: 0005-xwayland-Add-xwl_present_unrealize_window.patch +Patch16: 0006-xwayland-Don-t-need-xwl_window-anymore-in-xwl_presen.patch +Patch17: 0007-xwayland-Don-t-take-buffer-release-queue-into-accoun.patch + BuildRequires: systemtap-sdt-devel BuildRequires: git BuildRequires: automake autoconf libtool pkgconfig @@ -531,6 +540,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Thu Dec 06 2018 Olivier Fourdan - 1.20.3-2 +- Xwayland/Present fixes from master upstream + * Thu Nov 01 2018 Adam Jackson - 1.20.3-1 - xserver 1.20.3 From 914938e9682a41b1571bc4416d366a9ff74e4742 Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Fri, 11 Jan 2019 13:24:07 +0100 Subject: [PATCH 028/131] More Xwayland/Present fixes from upstream --- ...d-Fix-use-after-free-on-CRTC-removal.patch | 69 +++++++++++++++++++ ...g-leaks-in-xwl_present_sync_callback.patch | 48 +++++++++++++ ...wayland-handle-case-without-any-crtc.patch | 62 +++++++++++++++++ xorg-x11-server.spec | 10 ++- 4 files changed, 188 insertions(+), 1 deletion(-) create mode 100644 0001-present-wnmd-Fix-use-after-free-on-CRTC-removal.patch create mode 100644 0001-xwayland-Plug-leaks-in-xwl_present_sync_callback.patch create mode 100644 0001-xwayland-handle-case-without-any-crtc.patch diff --git a/0001-present-wnmd-Fix-use-after-free-on-CRTC-removal.patch b/0001-present-wnmd-Fix-use-after-free-on-CRTC-removal.patch new file mode 100644 index 0000000..9ac7ea8 --- /dev/null +++ b/0001-present-wnmd-Fix-use-after-free-on-CRTC-removal.patch @@ -0,0 +1,69 @@ +From f89518e17f7d507734af212785e0b3e47954f603 Mon Sep 17 00:00:00 2001 +From: Olivier Fourdan +Date: Mon, 22 Oct 2018 11:48:25 +0200 +Subject: [PATCH xserver] present/wnmd: Fix use after free on CRTC removal + +Xwayland will add and remove CRTCs as Wayland outputs are added or +removed. + +If there is a pending flip when this occurs, the +`xwl_present_sync_callback()` will be triggered after the Xwayland +output's RRCtrcPtr has been destroyed, hence causing a crash in Xwayland +while trying to use freed memory: + + #1 abort () + #2 OsAbort () at utils.c:1350 + #3 AbortServer () at log.c:877 + #4 FatalError () at log.c:1015 + #5 OsSigHandler () at osinit.c:156 + #6 + #7 dixGetPrivate () at ../include/privates.h:122 + #8 dixLookupPrivate () at ../include/privates.h:166 + #9 present_screen_priv () at present_priv.h:198 + #10 present_wnmd_flip () at present_wnmd.c:358 + #11 present_wnmd_execute () at present_wnmd.c:466 + #12 present_wnmd_re_execute () at present_wnmd.c:80 + #13 xwl_present_sync_callback () at xwayland-present.c:287 + #14 ffi_call_unix64 () from /lib64/libffi.so.6 + #15 ffi_call () from /lib64/libffi.so.6 + #16 wl_closure_invoke () at src/connection.c:1006 + #17 dispatch_event () at src/wayland-client.c:1427 + #18 dispatch_queue () at src/wayland-client.c:1573 + #19 wl_display_dispatch_queue_pending () at src/wayland-client.c:1815 + #20 wl_display_dispatch_pending () at src/wayland-client.c:1878 + #21 xwl_read_events () at xwayland.c:814 + #22 ospoll_wait () at ospoll.c:651 + #23 WaitForSomething () at WaitFor.c:208 + #24 Dispatch () at ../include/list.h:220 + #25 dix_main () at main.c:276 + +To avoid the issue, get the `ScreenPtr` from the window instead of the +CRTC that might have been just freed, `xwl_present_flip()` has no use +for the CRTC anyway. + +Bugzilla: https://bugs.freedesktop.org/108249 +Suggested-by: Michel Daenzer +Signed-off-by: Olivier Fourdan +Reviewed-by: Michel Daenzer +Reviewed-by: Peter Hutterer +(cherry picked from commit b768b7d6cec41b8b320c468ec41aab5a8b49b27b) +--- + present/present_wnmd.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/present/present_wnmd.c b/present/present_wnmd.c +index 8f3836440..2c6412a72 100644 +--- a/present/present_wnmd.c ++++ b/present/present_wnmd.c +@@ -354,7 +354,7 @@ present_wnmd_flip(WindowPtr window, + Bool sync_flip, + RegionPtr damage) + { +- ScreenPtr screen = crtc->pScreen; ++ ScreenPtr screen = window->drawable.pScreen; + present_screen_priv_ptr screen_priv = present_screen_priv(screen); + + return (*screen_priv->wnmd_info->flip) (window, +-- +2.20.1 + diff --git a/0001-xwayland-Plug-leaks-in-xwl_present_sync_callback.patch b/0001-xwayland-Plug-leaks-in-xwl_present_sync_callback.patch new file mode 100644 index 0000000..b2b89af --- /dev/null +++ b/0001-xwayland-Plug-leaks-in-xwl_present_sync_callback.patch @@ -0,0 +1,48 @@ +From 64f5e6ec2d297f90e9b9785a1cb7285d609a1877 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michel=20D=C3=A4nzer?= +Date: Fri, 19 Oct 2018 18:27:37 +0200 +Subject: [PATCH xserver] xwayland: Plug leaks in xwl_present_sync_callback + +xwl_present_window->sync_callback was leaked. + +The event memory was leaked if the corresponding buffer had already been +released. + +(cherry picked from commit cb0de153bf0c486da7e968ab0f258c9c0c9ed34a) +--- + hw/xwayland/xwayland-present.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c +index 316e04443..fb5c6499e 100644 +--- a/hw/xwayland/xwayland-present.c ++++ b/hw/xwayland/xwayland-present.c +@@ -274,6 +274,9 @@ xwl_present_sync_callback(void *data, + struct xwl_present_event *event = data; + struct xwl_present_window *xwl_present_window = event->xwl_present_window; + ++ wl_callback_destroy(xwl_present_window->sync_callback); ++ xwl_present_window->sync_callback = NULL; ++ + event->pending = FALSE; + + if (event->abort) { +@@ -289,12 +292,14 @@ xwl_present_sync_callback(void *data, + xwl_present_window->ust, + xwl_present_window->msc); + +- if (event->buffer_released) ++ if (event->buffer_released) { + /* If the buffer was already released, send the event now again */ + present_wnmd_event_notify(xwl_present_window->window, + event->event_id, + xwl_present_window->ust, + xwl_present_window->msc); ++ xwl_present_free_event(event); ++ } + } + + static const struct wl_callback_listener xwl_present_sync_listener = { +-- +2.20.1 + diff --git a/0001-xwayland-handle-case-without-any-crtc.patch b/0001-xwayland-handle-case-without-any-crtc.patch new file mode 100644 index 0000000..8985ec6 --- /dev/null +++ b/0001-xwayland-handle-case-without-any-crtc.patch @@ -0,0 +1,62 @@ +From a352f979545723054b0a74862a56dc53b1be93fb Mon Sep 17 00:00:00 2001 +From: Olivier Fourdan +Date: Tue, 8 Jan 2019 12:48:53 +0100 +Subject: [PATCH xserver] xwayland: handle case without any crtc +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Xwayland creates and destroys the CRTC along with the Wayland outputs, +so there is possibly a case where the number of CRTC drops to 0. + +However, `xwl_present_get_crtc()` always return `crtcs[0]` which is +invalid when `numCrtcs` is 0. + +That leads to crash if a client queries the Present capabilities when +there is no CRTC, the backtrace looks like: + + #0 raise() from libc.so + #1 abort() from libc.so + #2 OsAbort() at utils.c:1350 + #3 AbortServer() at log.c:879 + #4 FatalError() at log.c:1017 + #5 OsSigHandler() at osinit.c:156 + #6 OsSigHandler() at osinit.c:110 + #7 + #8 main_arena() from libc.so + #9 proc_present_query_capabilities() at present_request.c:236 + #10 Dispatch() at dispatch.c:478 + #11 dix_main() at main.c:276 + +To avoid returning an invalid pointer (`crtcs[0]`) in that case, simply +check for `numCrtcs` being 0 and return `NULL` in that case. + +Thanks to Michel Dänzer for pointing this as a +possible cause of the crash. + +Signed-off-by: Olivier Fourdan +Reviewed-by: Michel Dänzer +Bugzilla: https://bugzilla.redhat.com/1609181 +(cherry picked from commit e8295c50209f2963fa2823e8de7e8363a38cd2d1) +--- + hw/xwayland/xwayland-present.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c +index 980034db4..74fe84672 100644 +--- a/hw/xwayland/xwayland-present.c ++++ b/hw/xwayland/xwayland-present.c +@@ -323,6 +323,10 @@ xwl_present_get_crtc(WindowPtr present_window) + return NULL; + + rr_private = rrGetScrPriv(present_window->drawable.pScreen); ++ ++ if (rr_private->numCrtcs == 0) ++ return NULL; ++ + return rr_private->crtcs[0]; + } + +-- +2.20.1 + diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 55383d5..ad810d4 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -46,7 +46,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.20.3 -Release: 2%{?gitdate:.%{gitdate}}%{?dist} +Release: 3%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org License: MIT Group: User Interface/X @@ -106,6 +106,11 @@ Patch14: 0004-xwayland-Replace-xwl_window-present_window-with-pres.patch Patch15: 0005-xwayland-Add-xwl_present_unrealize_window.patch Patch16: 0006-xwayland-Don-t-need-xwl_window-anymore-in-xwl_presen.patch Patch17: 0007-xwayland-Don-t-take-buffer-release-queue-into-accoun.patch +Patch18: 0001-xwayland-Plug-leaks-in-xwl_present_sync_callback.patch +# https://bugzilla.redhat.com/show_bug.cgi?id=1609181 +Patch19: 0001-xwayland-handle-case-without-any-crtc.patch +# https://bugzilla.redhat.com/show_bug.cgi?id=1661748 +Patch20: 0001-present-wnmd-Fix-use-after-free-on-CRTC-removal.patch BuildRequires: systemtap-sdt-devel BuildRequires: git @@ -540,6 +545,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Fri Jan 11 2019 Olivier Fourdan - 1.20.3-3 +- More Xwayland/Present fixes from upstream (rhbz#1609181, rhbz#1661748) + * Thu Dec 06 2018 Olivier Fourdan - 1.20.3-2 - Xwayland/Present fixes from master upstream From 00ee1ad93f39977bbdf49546cd66c62396962037 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Mon, 28 Jan 2019 20:18:31 +0100 Subject: [PATCH 029/131] Remove obsolete Group tag References: https://fedoraproject.org/wiki/Changes/Remove_Group_Tag --- xorg-x11-server.spec | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index ad810d4..cb01446 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -49,7 +49,6 @@ Version: 1.20.3 Release: 3%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org License: MIT -Group: User Interface/X #VCS: git:git://git.freedesktop.org/git/xorg/xserver %if 0%{?gitdate} @@ -164,7 +163,6 @@ X.Org X11 X server %package common Summary: Xorg server common files -Group: User Interface/X Requires: pixman >= 0.30.0 Requires: xkeyboard-config xkbcomp @@ -174,7 +172,6 @@ Common files shared among all X servers. %package Xorg Summary: Xorg X server -Group: User Interface/X Provides: Xorg = %{version}-%{release} Provides: Xserver # HdG: This should be moved to the wrapper package once the wrapper gets @@ -213,7 +210,6 @@ upon. %package Xnest Summary: A nested server -Group: User Interface/X Requires: xorg-x11-server-common >= %{version}-%{release} Provides: Xnest @@ -227,7 +223,6 @@ applications without running them on their real X server. %package Xdmx Summary: Distributed Multihead X Server and utilities -Group: User Interface/X Requires: xorg-x11-server-common >= %{version}-%{release} Provides: Xdmx @@ -244,7 +239,6 @@ application for Xdmx would be to unify a 4 by 4 grid of 1280x1024 displays %package Xvfb Summary: A X Windows System virtual framebuffer X server -Group: User Interface/X # xvfb-run is GPLv2, rest is MIT License: MIT and GPLv2 Requires: xorg-x11-server-common >= %{version}-%{release} @@ -262,7 +256,6 @@ is normally used for testing servers. %package Xephyr Summary: A nested server -Group: User Interface/X Requires: xorg-x11-server-common >= %{version}-%{release} Provides: Xephyr @@ -279,7 +272,6 @@ Render and Composite. %package Xwayland Summary: Wayland X Server -Group: User Interface/X Requires: xorg-x11-server-common >= %{version}-%{release} Requires: libEGL @@ -289,7 +281,6 @@ Xwayland is an X server for running X clients under Wayland. %package devel Summary: SDK for X server driver module development -Group: User Interface/X Requires: xorg-x11-util-macros Requires: xorg-x11-proto-devel Requires: libXfont2-devel @@ -307,7 +298,6 @@ drivers, input drivers, or other X modules should install this package. %package source Summary: Xserver source code required to build VNC server (Xvnc) -Group: Development/Libraries BuildArch: noarch %description source From ad1a5b36a8744b416b9d176a33b7f1c34cfa38fc Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sun, 3 Feb 2019 12:43:37 +0000 Subject: [PATCH 030/131] - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- xorg-x11-server.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index cb01446..ad7c1c7 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -46,7 +46,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.20.3 -Release: 3%{?gitdate:.%{gitdate}}%{?dist} +Release: 4%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org License: MIT @@ -535,6 +535,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Sun Feb 03 2019 Fedora Release Engineering - 1.20.3-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + * Fri Jan 11 2019 Olivier Fourdan - 1.20.3-3 - More Xwayland/Present fixes from upstream (rhbz#1609181, rhbz#1661748) From 2a3298614e255a3b06a6ff8a9a5b3f212ae9ca98 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Tue, 26 Feb 2019 15:04:39 -0500 Subject: [PATCH 031/131] xserver 1.20.4 --- ...d-Fix-use-after-free-on-CRTC-removal.patch | 69 ------ ...setting-driver-by-default-on-GeForce.patch | 2 +- ...g-leaks-in-xwl_present_sync_callback.patch | 48 ---- ..._present_reset_timer-in-xwl_present_.patch | 59 ----- ...-do-not-crash-if-gbm_bo_create-fails.patch | 72 ------ ...wayland-handle-case-without-any-crtc.patch | 62 ----- ...xwl_present_events_notify-to-xwl_pre.patch | 61 ----- ...e-synchronous-Present-flips-from-xwl.patch | 139 ------------ ...-xwl_window-present_window-with-pres.patch | 213 ------------------ ...and-Add-xwl_present_unrealize_window.patch | 77 ------- ...eed-xwl_window-anymore-in-xwl_presen.patch | 36 --- ...ake-buffer-release-queue-into-accoun.patch | 37 --- xorg-x11-server.spec | 24 +- 13 files changed, 6 insertions(+), 893 deletions(-) delete mode 100644 0001-present-wnmd-Fix-use-after-free-on-CRTC-removal.patch delete mode 100644 0001-xwayland-Plug-leaks-in-xwl_present_sync_callback.patch delete mode 100644 0001-xwayland-Use-xwl_present_reset_timer-in-xwl_present_.patch delete mode 100644 0001-xwayland-do-not-crash-if-gbm_bo_create-fails.patch delete mode 100644 0001-xwayland-handle-case-without-any-crtc.patch delete mode 100644 0002-xwayland-Rename-xwl_present_events_notify-to-xwl_pre.patch delete mode 100644 0003-xwayland-Complete-synchronous-Present-flips-from-xwl.patch delete mode 100644 0004-xwayland-Replace-xwl_window-present_window-with-pres.patch delete mode 100644 0005-xwayland-Add-xwl_present_unrealize_window.patch delete mode 100644 0006-xwayland-Don-t-need-xwl_window-anymore-in-xwl_presen.patch delete mode 100644 0007-xwayland-Don-t-take-buffer-release-queue-into-accoun.patch diff --git a/0001-present-wnmd-Fix-use-after-free-on-CRTC-removal.patch b/0001-present-wnmd-Fix-use-after-free-on-CRTC-removal.patch deleted file mode 100644 index 9ac7ea8..0000000 --- a/0001-present-wnmd-Fix-use-after-free-on-CRTC-removal.patch +++ /dev/null @@ -1,69 +0,0 @@ -From f89518e17f7d507734af212785e0b3e47954f603 Mon Sep 17 00:00:00 2001 -From: Olivier Fourdan -Date: Mon, 22 Oct 2018 11:48:25 +0200 -Subject: [PATCH xserver] present/wnmd: Fix use after free on CRTC removal - -Xwayland will add and remove CRTCs as Wayland outputs are added or -removed. - -If there is a pending flip when this occurs, the -`xwl_present_sync_callback()` will be triggered after the Xwayland -output's RRCtrcPtr has been destroyed, hence causing a crash in Xwayland -while trying to use freed memory: - - #1 abort () - #2 OsAbort () at utils.c:1350 - #3 AbortServer () at log.c:877 - #4 FatalError () at log.c:1015 - #5 OsSigHandler () at osinit.c:156 - #6 - #7 dixGetPrivate () at ../include/privates.h:122 - #8 dixLookupPrivate () at ../include/privates.h:166 - #9 present_screen_priv () at present_priv.h:198 - #10 present_wnmd_flip () at present_wnmd.c:358 - #11 present_wnmd_execute () at present_wnmd.c:466 - #12 present_wnmd_re_execute () at present_wnmd.c:80 - #13 xwl_present_sync_callback () at xwayland-present.c:287 - #14 ffi_call_unix64 () from /lib64/libffi.so.6 - #15 ffi_call () from /lib64/libffi.so.6 - #16 wl_closure_invoke () at src/connection.c:1006 - #17 dispatch_event () at src/wayland-client.c:1427 - #18 dispatch_queue () at src/wayland-client.c:1573 - #19 wl_display_dispatch_queue_pending () at src/wayland-client.c:1815 - #20 wl_display_dispatch_pending () at src/wayland-client.c:1878 - #21 xwl_read_events () at xwayland.c:814 - #22 ospoll_wait () at ospoll.c:651 - #23 WaitForSomething () at WaitFor.c:208 - #24 Dispatch () at ../include/list.h:220 - #25 dix_main () at main.c:276 - -To avoid the issue, get the `ScreenPtr` from the window instead of the -CRTC that might have been just freed, `xwl_present_flip()` has no use -for the CRTC anyway. - -Bugzilla: https://bugs.freedesktop.org/108249 -Suggested-by: Michel Daenzer -Signed-off-by: Olivier Fourdan -Reviewed-by: Michel Daenzer -Reviewed-by: Peter Hutterer -(cherry picked from commit b768b7d6cec41b8b320c468ec41aab5a8b49b27b) ---- - present/present_wnmd.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/present/present_wnmd.c b/present/present_wnmd.c -index 8f3836440..2c6412a72 100644 ---- a/present/present_wnmd.c -+++ b/present/present_wnmd.c -@@ -354,7 +354,7 @@ present_wnmd_flip(WindowPtr window, - Bool sync_flip, - RegionPtr damage) - { -- ScreenPtr screen = crtc->pScreen; -+ ScreenPtr screen = window->drawable.pScreen; - present_screen_priv_ptr screen_priv = present_screen_priv(screen); - - return (*screen_priv->wnmd_info->flip) (window, --- -2.20.1 - diff --git a/0001-xfree86-use-modesetting-driver-by-default-on-GeForce.patch b/0001-xfree86-use-modesetting-driver-by-default-on-GeForce.patch index 1b1306e..be83429 100644 --- a/0001-xfree86-use-modesetting-driver-by-default-on-GeForce.patch +++ b/0001-xfree86-use-modesetting-driver-by-default-on-GeForce.patch @@ -24,7 +24,7 @@ index 8158c2b62..78d1c947d 100644 @@ -1190,6 +1191,25 @@ xf86VideoPtrToDriverList(struct pci_device *dev, int idx = 0; - #ifdef __linux__ + #if defined(__linux__) || defined(__NetBSD__) + char busid[32]; + int fd; + diff --git a/0001-xwayland-Plug-leaks-in-xwl_present_sync_callback.patch b/0001-xwayland-Plug-leaks-in-xwl_present_sync_callback.patch deleted file mode 100644 index b2b89af..0000000 --- a/0001-xwayland-Plug-leaks-in-xwl_present_sync_callback.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 64f5e6ec2d297f90e9b9785a1cb7285d609a1877 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Michel=20D=C3=A4nzer?= -Date: Fri, 19 Oct 2018 18:27:37 +0200 -Subject: [PATCH xserver] xwayland: Plug leaks in xwl_present_sync_callback - -xwl_present_window->sync_callback was leaked. - -The event memory was leaked if the corresponding buffer had already been -released. - -(cherry picked from commit cb0de153bf0c486da7e968ab0f258c9c0c9ed34a) ---- - hw/xwayland/xwayland-present.c | 7 ++++++- - 1 file changed, 6 insertions(+), 1 deletion(-) - -diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c -index 316e04443..fb5c6499e 100644 ---- a/hw/xwayland/xwayland-present.c -+++ b/hw/xwayland/xwayland-present.c -@@ -274,6 +274,9 @@ xwl_present_sync_callback(void *data, - struct xwl_present_event *event = data; - struct xwl_present_window *xwl_present_window = event->xwl_present_window; - -+ wl_callback_destroy(xwl_present_window->sync_callback); -+ xwl_present_window->sync_callback = NULL; -+ - event->pending = FALSE; - - if (event->abort) { -@@ -289,12 +292,14 @@ xwl_present_sync_callback(void *data, - xwl_present_window->ust, - xwl_present_window->msc); - -- if (event->buffer_released) -+ if (event->buffer_released) { - /* If the buffer was already released, send the event now again */ - present_wnmd_event_notify(xwl_present_window->window, - event->event_id, - xwl_present_window->ust, - xwl_present_window->msc); -+ xwl_present_free_event(event); -+ } - } - - static const struct wl_callback_listener xwl_present_sync_listener = { --- -2.20.1 - diff --git a/0001-xwayland-Use-xwl_present_reset_timer-in-xwl_present_.patch b/0001-xwayland-Use-xwl_present_reset_timer-in-xwl_present_.patch deleted file mode 100644 index 6c4bee9..0000000 --- a/0001-xwayland-Use-xwl_present_reset_timer-in-xwl_present_.patch +++ /dev/null @@ -1,59 +0,0 @@ -From 26eb8a0020ebf0e3a550f98be5f58820db765b2f Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Michel=20D=C3=A4nzer?= -Date: Wed, 24 Oct 2018 11:23:05 +0200 -Subject: [PATCH xserver 1/7] xwayland: Use xwl_present_reset_timer in - xwl_present_timer_callback - -Apart from simplifying the code, this should also prevent a condition -(which might only be possible with the following fix) reported in -https://gitlab.freedesktop.org/wayland/weston/issues/115#note_52467: - -1. xwl_present_timer_callback indirectly calls xwl_present_reset_timer - -> xwl_present_free_timer -2. xwl_present_timer_callback then returns a non-0 value, so DoTimer - calls TimerSet with the old xwl_present_window->frame_timer pointer - which was freed in step 1 => use after free - -Calling xwl_present_reset_timer explicitly passes NULL to TimerSet if -step 1 freed xwl_present_window->frame_timer, and it will allocate a new -one. - -(cherry picked from commit 5e8b9a3a563047e3998d45e761f7a50e4b0f6cb3) ---- - hw/xwayland/xwayland-present.c | 13 ++----------- - 1 file changed, 2 insertions(+), 11 deletions(-) - -diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c -index 316e04443..7539c1636 100644 ---- a/hw/xwayland/xwayland-present.c -+++ b/hw/xwayland/xwayland-present.c -@@ -216,24 +216,15 @@ xwl_present_timer_callback(OsTimerPtr timer, - void *arg) - { - struct xwl_present_window *xwl_present_window = arg; -- WindowPtr present_window = xwl_present_window->window; -- struct xwl_window *xwl_window = xwl_window_from_window(present_window); - - xwl_present_window->frame_timer_firing = TRUE; - xwl_present_window->msc++; - xwl_present_window->ust = GetTimeInMicros(); - - xwl_present_events_notify(xwl_present_window); -+ xwl_present_reset_timer(xwl_present_window); - -- if (xwl_present_has_events(xwl_present_window)) { -- /* Still events, restart timer */ -- return xwl_present_is_flipping(present_window, xwl_window) ? TIMER_LEN_FLIP : -- TIMER_LEN_COPY; -- } else { -- /* No more events, do not restart timer and delete it instead */ -- xwl_present_free_timer(xwl_present_window); -- return 0; -- } -+ return 0; - } - - static void --- -2.19.2 - diff --git a/0001-xwayland-do-not-crash-if-gbm_bo_create-fails.patch b/0001-xwayland-do-not-crash-if-gbm_bo_create-fails.patch deleted file mode 100644 index 69d5b9f..0000000 --- a/0001-xwayland-do-not-crash-if-gbm_bo_create-fails.patch +++ /dev/null @@ -1,72 +0,0 @@ -From d2af650a280f94d7ddd155cb499110ab45135100 Mon Sep 17 00:00:00 2001 -From: Olivier Fourdan -Date: Fri, 19 Oct 2018 16:04:32 +0200 -Subject: [PATCH xserver] xwayland: do not crash if `gbm_bo_create()` fails - -The function `xwl_glamor_gbm_create_pixmap()` first creates a buffer -objects and then creates the xwl_pixmap from it. - -However, `xwl_glamor_gbm_create_pixmap_for_bo()` is not called if the -buffer object creation fails, and `xwl_glamor_gbm_create_pixmap()` -simply returns `glamor_create_pixmap()`. - -The problem with this is that if `xwl_glamor_gbm_create_pixmap_for_bo()` -is not called then neither is `xwl_pixmap_set_private()` and further -calls to `xwl_pixmap_get()` will return NULL and cause a NULL pointer -dereference if the return value is not checked: - - #0 xwl_glamor_gbm_get_wl_buffer_for_pixmap () - at hw/xwayland/xwayland-glamor-gbm.c:248 - #1 xwl_window_post_damage () at hw/xwayland/xwayland.c:697 - #2 xwl_display_post_damage () at hw/xwayland/xwayland.c:759 - #3 block_handler () at hw/xwayland/xwayland.c:890 - #4 BlockHandler () at dix/dixutils.c:388 - #5 WaitForSomething () at os/WaitFor.c:201 - #6 Dispatch () at dix/dispatch.c:421 - #7 dix_main () at dix/main.c:276 - #8 __libc_start_main () at ../csu/libc-start.c:308 - #9 _start () - - (gdb) print xwl_pixmap - $1 = (struct xwl_pixmap *) 0x0 - -Make sure we check for `xwl_pixmap_get()` returned value where relevant -and fail gracefully if this is the case. - -See also: https://gitlab.gnome.org/GNOME/mutter/issues/340 - -Signed-off-by: Olivier Fourdan -Reviewed-by: Marco Trevisan -Reviewed-by: Peter Hutterer -(cherry picked from commit 036794bebce72a3fa2f95996d2e537ff568e0ff1) ---- - hw/xwayland/xwayland-glamor-gbm.c | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/hw/xwayland/xwayland-glamor-gbm.c b/hw/xwayland/xwayland-glamor-gbm.c -index 6aa1e4641d..5f8a68fd8c 100644 ---- a/hw/xwayland/xwayland-glamor-gbm.c -+++ b/hw/xwayland/xwayland-glamor-gbm.c -@@ -244,6 +244,9 @@ xwl_glamor_gbm_get_wl_buffer_for_pixmap(PixmapPtr pixmap, - uint64_t modifier; - int i; - -+ if (xwl_pixmap == NULL) -+ return NULL; -+ - if (xwl_pixmap->buffer) { - /* Buffer already exists. Return it and inform caller if interested. */ - if (created) -@@ -494,6 +497,9 @@ glamor_egl_fds_from_pixmap(ScreenPtr screen, PixmapPtr pixmap, int *fds, - - xwl_pixmap = xwl_pixmap_get(pixmap); - -+ if (xwl_pixmap == NULL) -+ return 0; -+ - if (!xwl_pixmap->bo) - return 0; - --- -2.19.1 - diff --git a/0001-xwayland-handle-case-without-any-crtc.patch b/0001-xwayland-handle-case-without-any-crtc.patch deleted file mode 100644 index 8985ec6..0000000 --- a/0001-xwayland-handle-case-without-any-crtc.patch +++ /dev/null @@ -1,62 +0,0 @@ -From a352f979545723054b0a74862a56dc53b1be93fb Mon Sep 17 00:00:00 2001 -From: Olivier Fourdan -Date: Tue, 8 Jan 2019 12:48:53 +0100 -Subject: [PATCH xserver] xwayland: handle case without any crtc -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Xwayland creates and destroys the CRTC along with the Wayland outputs, -so there is possibly a case where the number of CRTC drops to 0. - -However, `xwl_present_get_crtc()` always return `crtcs[0]` which is -invalid when `numCrtcs` is 0. - -That leads to crash if a client queries the Present capabilities when -there is no CRTC, the backtrace looks like: - - #0 raise() from libc.so - #1 abort() from libc.so - #2 OsAbort() at utils.c:1350 - #3 AbortServer() at log.c:879 - #4 FatalError() at log.c:1017 - #5 OsSigHandler() at osinit.c:156 - #6 OsSigHandler() at osinit.c:110 - #7 - #8 main_arena() from libc.so - #9 proc_present_query_capabilities() at present_request.c:236 - #10 Dispatch() at dispatch.c:478 - #11 dix_main() at main.c:276 - -To avoid returning an invalid pointer (`crtcs[0]`) in that case, simply -check for `numCrtcs` being 0 and return `NULL` in that case. - -Thanks to Michel Dänzer for pointing this as a -possible cause of the crash. - -Signed-off-by: Olivier Fourdan -Reviewed-by: Michel Dänzer -Bugzilla: https://bugzilla.redhat.com/1609181 -(cherry picked from commit e8295c50209f2963fa2823e8de7e8363a38cd2d1) ---- - hw/xwayland/xwayland-present.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c -index 980034db4..74fe84672 100644 ---- a/hw/xwayland/xwayland-present.c -+++ b/hw/xwayland/xwayland-present.c -@@ -323,6 +323,10 @@ xwl_present_get_crtc(WindowPtr present_window) - return NULL; - - rr_private = rrGetScrPriv(present_window->drawable.pScreen); -+ -+ if (rr_private->numCrtcs == 0) -+ return NULL; -+ - return rr_private->crtcs[0]; - } - --- -2.20.1 - diff --git a/0002-xwayland-Rename-xwl_present_events_notify-to-xwl_pre.patch b/0002-xwayland-Rename-xwl_present_events_notify-to-xwl_pre.patch deleted file mode 100644 index 0ca192f..0000000 --- a/0002-xwayland-Rename-xwl_present_events_notify-to-xwl_pre.patch +++ /dev/null @@ -1,61 +0,0 @@ -From bd4b3eb727b14133929d7bf04fed3829a632fc5b Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Michel=20D=C3=A4nzer?= -Date: Thu, 18 Oct 2018 17:36:24 +0200 -Subject: [PATCH xserver 2/7] xwayland: Rename xwl_present_events_notify to - xwl_present_msc_bump - -And consolidate more code from xwl_present_timer_callback and -xwl_present_frame_callback in it. - -(cherry picked from commit 2bfc46d4147dc0bec4cdbb80431a0f4cc1d3b030) ---- - hw/xwayland/xwayland-present.c | 15 ++++++--------- - 1 file changed, 6 insertions(+), 9 deletions(-) - -diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c -index 7539c1636..117ce781d 100644 ---- a/hw/xwayland/xwayland-present.c -+++ b/hw/xwayland/xwayland-present.c -@@ -192,11 +192,13 @@ static const struct wl_buffer_listener xwl_present_release_listener = { - }; - - static void --xwl_present_events_notify(struct xwl_present_window *xwl_present_window) -+xwl_present_msc_bump(struct xwl_present_window *xwl_present_window) - { -- uint64_t msc = xwl_present_window->msc; -+ uint64_t msc = ++xwl_present_window->msc; - struct xwl_present_event *event, *tmp; - -+ xwl_present_window->ust = GetTimeInMicros(); -+ - xorg_list_for_each_entry_safe(event, tmp, - &xwl_present_window->event_list, - list) { -@@ -218,10 +220,8 @@ xwl_present_timer_callback(OsTimerPtr timer, - struct xwl_present_window *xwl_present_window = arg; - - xwl_present_window->frame_timer_firing = TRUE; -- xwl_present_window->msc++; -- xwl_present_window->ust = GetTimeInMicros(); - -- xwl_present_events_notify(xwl_present_window); -+ xwl_present_msc_bump(xwl_present_window); - xwl_present_reset_timer(xwl_present_window); - - return 0; -@@ -242,10 +242,7 @@ xwl_present_frame_callback(void *data, - return; - } - -- xwl_present_window->msc++; -- xwl_present_window->ust = GetTimeInMicros(); -- -- xwl_present_events_notify(xwl_present_window); -+ xwl_present_msc_bump(xwl_present_window); - - /* we do not need the timer anymore for this frame, - * reset it for potentially the next one --- -2.19.2 - diff --git a/0003-xwayland-Complete-synchronous-Present-flips-from-xwl.patch b/0003-xwayland-Complete-synchronous-Present-flips-from-xwl.patch deleted file mode 100644 index 0b7f351..0000000 --- a/0003-xwayland-Complete-synchronous-Present-flips-from-xwl.patch +++ /dev/null @@ -1,139 +0,0 @@ -From 908c3b4c291e62e63677a75e125f6fd7706493aa Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Michel=20D=C3=A4nzer?= -Date: Thu, 18 Oct 2018 17:42:01 +0200 -Subject: [PATCH xserver 3/7] xwayland: Complete "synchronous" Present flips - from xwl_present_msc_bump - -Completing them from xwl_present_sync_callback had at least two issues: - -* It was before the MSC was incremented in xwl_present_frame_callback, - so the MSC value in the completion event could be lower than the - target specified by the client. This could cause hangs with the Mesa - Vulkan drivers. -* It allowed clients to run at a frame-rate higher than the Wayland - compositor's frame-rate, wasting energy on generating frames which - were never displayed. This isn't expected to happen unless the client - specified PresentOptionAsync (in which case flips are still completed - from xwl_present_sync_callback, allowing higher frame-rates). - -v2: -* Make xwl_present_has_events return true when there's a pending - "synchronous" flip, so those complete after at most ~1 second even if - the Wayland server doesn't send a frame event. - -Bugzilla: https://bugs.freedesktop.org/106713 -(cherry picked from commit ace551d8a2603e37b18237a52f62d627c75d9e2a) ---- - hw/xwayland/xwayland-present.c | 51 +++++++++++++++++++++++++++++----- - hw/xwayland/xwayland.h | 1 + - 2 files changed, 45 insertions(+), 7 deletions(-) - -diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c -index 117ce781d..4f517d46b 100644 ---- a/hw/xwayland/xwayland-present.c -+++ b/hw/xwayland/xwayland-present.c -@@ -85,7 +85,8 @@ xwl_present_timer_callback(OsTimerPtr timer, - static inline Bool - xwl_present_has_events(struct xwl_present_window *xwl_present_window) - { -- return !xorg_list_is_empty(&xwl_present_window->event_list) || -+ return !!xwl_present_window->sync_flip || -+ !xorg_list_is_empty(&xwl_present_window->event_list) || - !xorg_list_is_empty(&xwl_present_window->release_queue); - } - -@@ -139,6 +140,16 @@ xwl_present_cleanup(WindowPtr window) - } - - /* Clear remaining buffer releases and inform Present about free ressources */ -+ event = xwl_present_window->sync_flip; -+ xwl_present_window->sync_flip = NULL; -+ if (event) { -+ if (event->buffer_released) { -+ free(event); -+ } else { -+ event->pending = FALSE; -+ event->abort = TRUE; -+ } -+ } - xorg_list_for_each_entry_safe(event, tmp, &xwl_present_window->release_queue, list) { - xorg_list_del(&event->list); - event->abort = TRUE; -@@ -199,6 +210,24 @@ xwl_present_msc_bump(struct xwl_present_window *xwl_present_window) - - xwl_present_window->ust = GetTimeInMicros(); - -+ event = xwl_present_window->sync_flip; -+ xwl_present_window->sync_flip = NULL; -+ if (event) { -+ event->pending = FALSE; -+ -+ present_wnmd_event_notify(xwl_present_window->window, event->event_id, -+ xwl_present_window->ust, msc); -+ -+ if (event->buffer_released) { -+ /* If the buffer was already released, clean up now */ -+ present_wnmd_event_notify(xwl_present_window->window, event->event_id, -+ xwl_present_window->ust, msc); -+ free(event); -+ } else { -+ xorg_list_add(&event->list, &xwl_present_window->release_queue); -+ } -+ } -+ - xorg_list_for_each_entry_safe(event, tmp, - &xwl_present_window->event_list, - list) { -@@ -454,12 +483,17 @@ xwl_present_flip(WindowPtr present_window, - event->event_id = event_id; - event->xwl_present_window = xwl_present_window; - event->buffer = buffer; -- event->target_msc = xwl_present_window->msc; -+ event->target_msc = target_msc; - event->pending = TRUE; - event->abort = FALSE; - event->buffer_released = FALSE; - -- xorg_list_add(&event->list, &xwl_present_window->release_queue); -+ if (sync_flip) { -+ xorg_list_init(&event->list); -+ xwl_present_window->sync_flip = event; -+ } else { -+ xorg_list_add(&event->list, &xwl_present_window->release_queue); -+ } - - if (buffer_created) - wl_buffer_add_listener(buffer, &xwl_present_release_listener, NULL); -@@ -488,10 +522,13 @@ xwl_present_flip(WindowPtr present_window, - - wl_surface_commit(xwl_window->surface); - -- xwl_present_window->sync_callback = wl_display_sync(xwl_window->xwl_screen->display); -- wl_callback_add_listener(xwl_present_window->sync_callback, -- &xwl_present_sync_listener, -- event); -+ if (!sync_flip) { -+ xwl_present_window->sync_callback = -+ wl_display_sync(xwl_window->xwl_screen->display); -+ wl_callback_add_listener(xwl_present_window->sync_callback, -+ &xwl_present_sync_listener, -+ event); -+ } - - wl_display_flush(xwl_window->xwl_screen->display); - return TRUE; -diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h -index 67819e178..3f4a601fe 100644 ---- a/hw/xwayland/xwayland.h -+++ b/hw/xwayland/xwayland.h -@@ -188,6 +188,7 @@ struct xwl_window { - #ifdef GLAMOR_HAS_GBM - struct xwl_present_window { - struct xwl_screen *xwl_screen; -+ struct xwl_present_event *sync_flip; - WindowPtr window; - struct xorg_list link; - --- -2.19.2 - diff --git a/0004-xwayland-Replace-xwl_window-present_window-with-pres.patch b/0004-xwayland-Replace-xwl_window-present_window-with-pres.patch deleted file mode 100644 index 352946f..0000000 --- a/0004-xwayland-Replace-xwl_window-present_window-with-pres.patch +++ /dev/null @@ -1,213 +0,0 @@ -From 5a1cb0989274fd745569a60c28c9a5ca729cabf6 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Michel=20D=C3=A4nzer?= -Date: Thu, 1 Nov 2018 18:44:24 +0100 -Subject: [PATCH xserver 4/7] xwayland: Replace xwl_window::present_window with - ::present_flipped - -There's no need to keep track of the window which last performed a -Present flip. This fixes crashes due to the assertion in -xwl_present_flips_stop failing. Fixes issue #10. - -The damage generated by a flip only needs to be ignored once, then -xwl_window::present_flipped can be cleared. This may fix freezing in -the (hypothetical) scenario where Present flips are performed on a -window, followed by other drawing requests using the window as the -destination, but nothing triggering xwl_present_flips_stop. The damage -from the latter drawing requests would continue being ignored. - -(cherry picked from commit 6b016d58d23d16eaae9908a92ed90547d1926317) ---- - hw/xwayland/xwayland-present.c | 56 ++++++++-------------------------- - hw/xwayland/xwayland.c | 17 ++++++++--- - hw/xwayland/xwayland.h | 4 ++- - 3 files changed, 27 insertions(+), 50 deletions(-) - -diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c -index 4f517d46b..e6dca5ed0 100644 ---- a/hw/xwayland/xwayland-present.c -+++ b/hw/xwayland/xwayland-present.c -@@ -90,24 +90,19 @@ xwl_present_has_events(struct xwl_present_window *xwl_present_window) - !xorg_list_is_empty(&xwl_present_window->release_queue); - } - --static inline Bool --xwl_present_is_flipping(WindowPtr window, struct xwl_window *xwl_window) --{ -- return xwl_window && xwl_window->present_window == window; --} -- - static void - xwl_present_reset_timer(struct xwl_present_window *xwl_present_window) - { - if (xwl_present_has_events(xwl_present_window)) { -- WindowPtr present_window = xwl_present_window->window; -- Bool is_flipping = xwl_present_is_flipping(present_window, -- xwl_window_from_window(present_window)); -+ CARD32 timeout; -+ -+ if (xwl_present_window->frame_callback) -+ timeout = TIMER_LEN_FLIP; -+ else -+ timeout = TIMER_LEN_COPY; - - xwl_present_window->frame_timer = TimerSet(xwl_present_window->frame_timer, -- 0, -- is_flipping ? TIMER_LEN_FLIP : -- TIMER_LEN_COPY, -+ 0, timeout, - &xwl_present_timer_callback, - xwl_present_window); - } else { -@@ -118,16 +113,12 @@ xwl_present_reset_timer(struct xwl_present_window *xwl_present_window) - void - xwl_present_cleanup(WindowPtr window) - { -- struct xwl_window *xwl_window = xwl_window_from_window(window); - struct xwl_present_window *xwl_present_window = xwl_present_window_priv(window); - struct xwl_present_event *event, *tmp; - - if (!xwl_present_window) - return; - -- if (xwl_window && xwl_window->present_window == window) -- xwl_window->present_window = NULL; -- - if (xwl_present_window->frame_callback) { - wl_callback_destroy(xwl_present_window->frame_callback); - xwl_present_window->frame_callback = NULL; -@@ -361,10 +352,6 @@ xwl_present_queue_vblank(WindowPtr present_window, - if (!xwl_window) - return BadMatch; - -- if (xwl_window->present_window && -- xwl_window->present_window != present_window) -- return BadMatch; -- - event = malloc(sizeof *event); - if (!event) - return BadAlloc; -@@ -433,13 +420,6 @@ xwl_present_check_flip2(RRCrtcPtr crtc, - if (!xwl_window) - return FALSE; - -- /* -- * Do not flip if there is already another child window doing flips. -- */ -- if (xwl_window->present_window && -- xwl_window->present_window != present_window) -- return FALSE; -- - /* - * We currently only allow flips of windows, that have the same - * dimensions as their xwl_window parent window. For the case of -@@ -476,8 +456,6 @@ xwl_present_flip(WindowPtr present_window, - if (!event) - return FALSE; - -- xwl_window->present_window = present_window; -- - buffer = xwl_glamor_pixmap_get_wl_buffer(pixmap, &buffer_created); - - event->event_id = event_id; -@@ -502,13 +480,6 @@ xwl_present_flip(WindowPtr present_window, - /* We can flip directly to the main surface (full screen window without clips) */ - wl_surface_attach(xwl_window->surface, buffer, 0, 0); - -- if (!xwl_present_window->frame_timer || -- xwl_present_window->frame_timer_firing) { -- /* Realign timer */ -- xwl_present_window->frame_timer_firing = FALSE; -- xwl_present_reset_timer(xwl_present_window); -- } -- - if (!xwl_present_window->frame_callback) { - xwl_present_window->frame_callback = wl_surface_frame(xwl_window->surface); - wl_callback_add_listener(xwl_present_window->frame_callback, -@@ -516,6 +487,10 @@ xwl_present_flip(WindowPtr present_window, - xwl_present_window); - } - -+ /* Realign timer */ -+ xwl_present_window->frame_timer_firing = FALSE; -+ xwl_present_reset_timer(xwl_present_window); -+ - wl_surface_damage(xwl_window->surface, 0, 0, - damage_box->x2 - damage_box->x1, - damage_box->y2 - damage_box->y1); -@@ -531,22 +506,15 @@ xwl_present_flip(WindowPtr present_window, - } - - wl_display_flush(xwl_window->xwl_screen->display); -+ xwl_window->present_flipped = TRUE; - return TRUE; - } - - static void - xwl_present_flips_stop(WindowPtr window) - { -- struct xwl_window *xwl_window = xwl_window_from_window(window); - struct xwl_present_window *xwl_present_window = xwl_present_window_priv(window); - -- if (!xwl_window) -- return; -- -- assert(xwl_window->present_window == window); -- -- xwl_window->present_window = NULL; -- - /* Change back to the fast refresh rate */ - xwl_present_reset_timer(xwl_present_window); - } -diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index 96b4db18c..988b8e17d 100644 ---- a/hw/xwayland/xwayland.c -+++ b/hw/xwayland/xwayland.c -@@ -370,6 +370,18 @@ damage_report(DamagePtr pDamage, RegionPtr pRegion, void *data) - struct xwl_window *xwl_window = data; - struct xwl_screen *xwl_screen = xwl_window->xwl_screen; - -+#ifdef GLAMOR_HAS_GBM -+ if (xwl_window->present_flipped) { -+ /* This damage is from a Present flip, which already committed a new -+ * buffer for the surface, so we don't need to do anything in response -+ */ -+ RegionEmpty(DamageRegion(pDamage)); -+ xorg_list_del(&xwl_window->link_damage); -+ xwl_window->present_flipped = FALSE; -+ return; -+ } -+#endif -+ - xorg_list_add(&xwl_window->link_damage, &xwl_screen->damage_window_list); - } - -@@ -721,11 +733,6 @@ xwl_screen_post_damage(struct xwl_screen *xwl_screen) - - xorg_list_for_each_entry_safe(xwl_window, next_xwl_window, - &xwl_screen->damage_window_list, link_damage) { --#ifdef GLAMOR_HAS_GBM -- /* Present on the main surface. So don't commit here as well. */ -- if (xwl_window->present_window) -- continue; --#endif - /* If we're waiting on a frame callback from the server, - * don't attach a new buffer. */ - if (xwl_window->frame_callback) -diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h -index 3f4a601fe..a79f836ad 100644 ---- a/hw/xwayland/xwayland.h -+++ b/hw/xwayland/xwayland.h -@@ -182,7 +182,9 @@ struct xwl_window { - struct xorg_list link_damage; - struct wl_callback *frame_callback; - Bool allow_commits; -- WindowPtr present_window; -+#ifdef GLAMOR_HAS_GBM -+ Bool present_flipped; -+#endif - }; - - #ifdef GLAMOR_HAS_GBM --- -2.19.2 - diff --git a/0005-xwayland-Add-xwl_present_unrealize_window.patch b/0005-xwayland-Add-xwl_present_unrealize_window.patch deleted file mode 100644 index 025a74c..0000000 --- a/0005-xwayland-Add-xwl_present_unrealize_window.patch +++ /dev/null @@ -1,77 +0,0 @@ -From cd243d4c858d9193ba0eeab778c488b74505d0e1 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Michel=20D=C3=A4nzer?= -Date: Thu, 1 Nov 2018 18:24:28 +0100 -Subject: [PATCH xserver 5/7] xwayland: Add xwl_present_unrealize_window - -When a window is unrealized, a pending frame callback may never be -called, which could result in repeatedly freezing until the frame timer -fires after a second. - -Fixes these symptoms when switching from fullscreen to windowed mode in -sauerbraten. - -(cherry picked from commit 8c9538573cb9a342897eb3fb4b0c1e4ed917bd0e) ---- - hw/xwayland/xwayland-present.c | 16 ++++++++++++++++ - hw/xwayland/xwayland.c | 5 +++++ - hw/xwayland/xwayland.h | 1 + - 3 files changed, 22 insertions(+) - -diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c -index e6dca5ed0..7e49cb366 100644 ---- a/hw/xwayland/xwayland-present.c -+++ b/hw/xwayland/xwayland-present.c -@@ -519,6 +519,22 @@ xwl_present_flips_stop(WindowPtr window) - xwl_present_reset_timer(xwl_present_window); - } - -+void -+xwl_present_unrealize_window(WindowPtr window) -+{ -+ struct xwl_present_window *xwl_present_window = xwl_present_window_priv(window); -+ -+ if (!xwl_present_window || !xwl_present_window->frame_callback) -+ return; -+ -+ /* The pending frame callback may never be called, so drop it and shorten -+ * the frame timer interval. -+ */ -+ wl_callback_destroy(xwl_present_window->frame_callback); -+ xwl_present_window->frame_callback = NULL; -+ xwl_present_reset_timer(xwl_present_window); -+} -+ - static present_wnmd_info_rec xwl_present_info = { - .version = PRESENT_SCREEN_INFO_VERSION, - .get_crtc = xwl_present_get_crtc, -diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index 988b8e17d..7e6e0ab25 100644 ---- a/hw/xwayland/xwayland.c -+++ b/hw/xwayland/xwayland.c -@@ -609,6 +609,11 @@ xwl_unrealize_window(WindowPtr window) - xwl_screen->UnrealizeWindow = screen->UnrealizeWindow; - screen->UnrealizeWindow = xwl_unrealize_window; - -+#ifdef GLAMOR_HAS_GBM -+ if (xwl_screen->present) -+ xwl_present_unrealize_window(window); -+#endif -+ - xwl_window = xwl_window_get(window); - if (!xwl_window) - return ret; -diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h -index a79f836ad..463622669 100644 ---- a/hw/xwayland/xwayland.h -+++ b/hw/xwayland/xwayland.h -@@ -454,6 +454,7 @@ void xwl_glamor_egl_make_current(struct xwl_screen *xwl_screen); - #ifdef GLAMOR_HAS_GBM - Bool xwl_present_init(ScreenPtr screen); - void xwl_present_cleanup(WindowPtr window); -+void xwl_present_unrealize_window(WindowPtr window); - #endif /* GLAMOR_HAS_GBM */ - - #ifdef XV --- -2.19.2 - diff --git a/0006-xwayland-Don-t-need-xwl_window-anymore-in-xwl_presen.patch b/0006-xwayland-Don-t-need-xwl_window-anymore-in-xwl_presen.patch deleted file mode 100644 index 0915df9..0000000 --- a/0006-xwayland-Don-t-need-xwl_window-anymore-in-xwl_presen.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 679aa2a629e09aba00f26c819431e7d3a9113834 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Michel=20D=C3=A4nzer?= -Date: Fri, 9 Nov 2018 17:18:53 +0100 -Subject: [PATCH xserver 6/7] xwayland: Don't need xwl_window anymore in - xwl_present_queue_vblank - -Fixes issue #12. Presumably the problem was that Present operations on -unmapped windows were executed immediately instead of only when reaching -the target MSC. - -(cherry picked from commit f541615342ce6bfb0e6d4e68deb3a924a87e8ba9) ---- - hw/xwayland/xwayland-present.c | 4 ---- - 1 file changed, 4 deletions(-) - -diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c -index 7e49cb366..eea7415f3 100644 ---- a/hw/xwayland/xwayland-present.c -+++ b/hw/xwayland/xwayland-present.c -@@ -345,13 +345,9 @@ xwl_present_queue_vblank(WindowPtr present_window, - uint64_t event_id, - uint64_t msc) - { -- struct xwl_window *xwl_window = xwl_window_from_window(present_window); - struct xwl_present_window *xwl_present_window = xwl_present_window_get_priv(present_window); - struct xwl_present_event *event; - -- if (!xwl_window) -- return BadMatch; -- - event = malloc(sizeof *event); - if (!event) - return BadAlloc; --- -2.19.2 - diff --git a/0007-xwayland-Don-t-take-buffer-release-queue-into-accoun.patch b/0007-xwayland-Don-t-take-buffer-release-queue-into-accoun.patch deleted file mode 100644 index 545b3e9..0000000 --- a/0007-xwayland-Don-t-take-buffer-release-queue-into-accoun.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 354ed9fa48118026456ec2bc64136993f3c53606 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Michel=20D=C3=A4nzer?= -Date: Thu, 15 Nov 2018 17:16:59 +0100 -Subject: [PATCH xserver 7/7] xwayland: Don't take buffer release queue into - account for frame timer - -The buffer release queue has two kinds of entries: - -* Pending async flips. -* Completed flips waiting for their buffer to be released by the Wayland - compositor. - -xwl_present_timer_callback neither completes async flips nor releases -buffers, so the timer isn't needed for the buffer release queue. - -(cherry picked from commit e6cd1c9bdefe83e7d99b703a68d26eebb451f889) ---- - hw/xwayland/xwayland-present.c | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) - -diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c -index eea7415f3..594e2e822 100644 ---- a/hw/xwayland/xwayland-present.c -+++ b/hw/xwayland/xwayland-present.c -@@ -86,8 +86,7 @@ static inline Bool - xwl_present_has_events(struct xwl_present_window *xwl_present_window) - { - return !!xwl_present_window->sync_flip || -- !xorg_list_is_empty(&xwl_present_window->event_list) || -- !xorg_list_is_empty(&xwl_present_window->release_queue); -+ !xorg_list_is_empty(&xwl_present_window->event_list); - } - - static void --- -2.19.2 - diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index ad7c1c7..8b0a10c 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -45,8 +45,8 @@ Summary: X.Org X11 X server Name: xorg-x11-server -Version: 1.20.3 -Release: 4%{?gitdate:.%{gitdate}}%{?dist} +Version: 1.20.4 +Release: 1%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org License: MIT @@ -94,23 +94,6 @@ Patch5: 0001-autobind-GPUs-to-the-screen.patch # because the display-managers are not ready yet, do not upstream Patch6: 0001-Fedora-hack-Make-the-suid-root-wrapper-always-start-.patch -# https://gitlab.freedesktop.org/ajax/xserver/tree/server-1.20-branch -Patch7: 0001-xwayland-do-not-crash-if-gbm_bo_create-fails.patch - -# Xwayland/Present fixes from master upstream -Patch11: 0001-xwayland-Use-xwl_present_reset_timer-in-xwl_present_.patch -Patch12: 0002-xwayland-Rename-xwl_present_events_notify-to-xwl_pre.patch -Patch13: 0003-xwayland-Complete-synchronous-Present-flips-from-xwl.patch -Patch14: 0004-xwayland-Replace-xwl_window-present_window-with-pres.patch -Patch15: 0005-xwayland-Add-xwl_present_unrealize_window.patch -Patch16: 0006-xwayland-Don-t-need-xwl_window-anymore-in-xwl_presen.patch -Patch17: 0007-xwayland-Don-t-take-buffer-release-queue-into-accoun.patch -Patch18: 0001-xwayland-Plug-leaks-in-xwl_present_sync_callback.patch -# https://bugzilla.redhat.com/show_bug.cgi?id=1609181 -Patch19: 0001-xwayland-handle-case-without-any-crtc.patch -# https://bugzilla.redhat.com/show_bug.cgi?id=1661748 -Patch20: 0001-present-wnmd-Fix-use-after-free-on-CRTC-removal.patch - BuildRequires: systemtap-sdt-devel BuildRequires: git BuildRequires: automake autoconf libtool pkgconfig @@ -535,6 +518,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Tue Feb 26 2019 Adam Jackson - 1.20.4-1 +- xserver 1.20.4 + * Sun Feb 03 2019 Fedora Release Engineering - 1.20.3-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild From cac57f572a9a8879036c4b79feef5739602886de Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Tue, 26 Feb 2019 16:15:49 -0500 Subject: [PATCH 032/131] Update sources --- sources | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources b/sources index 22e83a2..00e1fdb 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (xorg-server-1.20.3.tar.bz2) = ee44554f86df4297f54c5871fe7a18954eeef4338775a25f36d6577b279c4775f61128da71b86cfaeadcc080838d6749dede138d4db178866579da2056543fba +SHA512 (xorg-server-1.20.4.tar.bz2) = f1c92ef6d7613e0636973d3395b48dfdad42230847ab1c8b1cea84647a968f649f9aba97bdb01c10ee8351cbe954d4e6ca4a0fc84bb8fa662d49c8ba2aee00a8 From d3c0c12b95e21fa0e574b339c42e2755d605bbb6 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Thu, 21 Mar 2019 10:46:27 -0400 Subject: [PATCH 033/131] Backport an Xwayland crash fix in the Present code --- ...-Destroy-sync_callback-in-xwl_presen.patch | 36 +++++++++++++++++++ xorg-x11-server.spec | 7 +++- 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 0001-xwayland-present-Destroy-sync_callback-in-xwl_presen.patch diff --git a/0001-xwayland-present-Destroy-sync_callback-in-xwl_presen.patch b/0001-xwayland-present-Destroy-sync_callback-in-xwl_presen.patch new file mode 100644 index 0000000..58c78d2 --- /dev/null +++ b/0001-xwayland-present-Destroy-sync_callback-in-xwl_presen.patch @@ -0,0 +1,36 @@ +From 2e18eec6f03cc4d9d5bf62853c65d341b363f4b3 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michel=20D=C3=A4nzer?= +Date: Fri, 8 Mar 2019 18:49:04 +0100 +Subject: [PATCH xserver] xwayland/present: Destroy sync_callback in + xwl_present_cleanup + +xwl_present_cleanup frees the struct xwl_present_window memory, +so if there's a pending callback, we have to destroy it to prevent +use-after-free in xwl_present_sync_callback. + +Should fix issue #645. + +Reviewed-by: Olivier Fourdan +--- + hw/xwayland/xwayland-present.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c +index 192f59a653..a1b3109cc2 100644 +--- a/hw/xwayland/xwayland-present.c ++++ b/hw/xwayland/xwayland-present.c +@@ -123,6 +123,11 @@ xwl_present_cleanup(WindowPtr window) + xwl_present_window->frame_callback = NULL; + } + ++ if (xwl_present_window->sync_callback) { ++ wl_callback_destroy(xwl_present_window->sync_callback); ++ xwl_present_window->sync_callback = NULL; ++ } ++ + /* Clear remaining events */ + xorg_list_for_each_entry_safe(event, tmp, &xwl_present_window->event_list, list) { + xorg_list_del(&event->list); +-- +2.20.1 + diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 8b0a10c..da6af0b 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -46,7 +46,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.20.4 -Release: 1%{?gitdate:.%{gitdate}}%{?dist} +Release: 2%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org License: MIT @@ -94,6 +94,8 @@ Patch5: 0001-autobind-GPUs-to-the-screen.patch # because the display-managers are not ready yet, do not upstream Patch6: 0001-Fedora-hack-Make-the-suid-root-wrapper-always-start-.patch +Patch10: 0001-xwayland-present-Destroy-sync_callback-in-xwl_presen.patch + BuildRequires: systemtap-sdt-devel BuildRequires: git BuildRequires: automake autoconf libtool pkgconfig @@ -518,6 +520,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Thu Mar 21 2019 Adam Jackson - 1.20.4-2 +- Backport an Xwayland crash fix in the Present code + * Tue Feb 26 2019 Adam Jackson - 1.20.4-1 - xserver 1.20.4 From 324f637f1ed824430a6dee1ba2895b5eadd476ab Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 27 Mar 2019 14:16:32 +1000 Subject: [PATCH 034/131] Fix a Qt scrolling bug, don't reset the valuator on slave switch --- ...last.valuators-alone-on-slave-switch.patch | 89 +++++++++++++++++++ xorg-x11-server.spec | 8 +- 2 files changed, 96 insertions(+), 1 deletion(-) create mode 100644 0001-dix-leave-last.valuators-alone-on-slave-switch.patch diff --git a/0001-dix-leave-last.valuators-alone-on-slave-switch.patch b/0001-dix-leave-last.valuators-alone-on-slave-switch.patch new file mode 100644 index 0000000..10c7177 --- /dev/null +++ b/0001-dix-leave-last.valuators-alone-on-slave-switch.patch @@ -0,0 +1,89 @@ +From 13f9b07039484927532d913dbccc664679235bf6 Mon Sep 17 00:00:00 2001 +From: Peter Hutterer +Date: Mon, 25 Mar 2019 13:19:41 +1000 +Subject: [PATCH xserver] dix: leave last.valuators alone on slave switch + +Terms: +dev->last.valuator[] is the last value given to us by the driver +dev->valuator.axisVal[] is the last value sent to the client +dev->last.scroll[] is the abs value of the scroll axis as given by the driver, + used for button emulation calculation (and the remainder) + +This function updates the device's last.valuator state based on the current +master axis state. This way, relative motion continues fluidly when switching +between devices. Before mouse 2 comes into effect, it's valuator state is +updated to wherever the pointer currently is so the relative event applies on +top of that. + +This can only work for x/y axes, all other axes aren't guaranteed to have the +same meaning and/or may not be present: +- xtest device: no valuator 2 +- mouse: valuator 2 is horizontal scroll axis +- tablet: valuator 2 is pressure + +Scaling the current value from the pressure range into the range for +horizontal scrolling makes no sense. And it causes scroll jumps: + +- scroll down, last.valuator == axisVal == 20 +- xdotool click 1, the XTest device doesn't have that valuator +- scroll up + - updateSlaveDeviceCoords reset last.valuator to 0 (axisVal == 20) + - DeviceClassesChangedEvent includes value 20 for the axis + - event is processed, last.value changes from 0 to -1 + - axisVal is updated to -1, causing a jump of -21 + +The same applies when we switch from tablet to mouse wheel if the pressure +value is 0 on proximity out (basically guaranteed). So let's drop this code +altogether and only leave the scaling for the relative x/y motion. + +Signed-off-by: Peter Hutterer +--- + dix/getevents.c | 25 +------------------------ + 1 file changed, 1 insertion(+), 24 deletions(-) + +diff --git a/dix/getevents.c b/dix/getevents.c +index d8955969a..f83dac709 100644 +--- a/dix/getevents.c ++++ b/dix/getevents.c +@@ -331,9 +331,6 @@ rescaleValuatorAxis(double coord, AxisInfoPtr from, AxisInfoPtr to, + static void + updateSlaveDeviceCoords(DeviceIntPtr master, DeviceIntPtr pDev) + { +- int i; +- DeviceIntPtr lastSlave; +- + /* master->last.valuators[0]/[1] is in desktop-wide coords and the actual + * position of the pointer */ + pDev->last.valuators[0] = master->last.valuators[0]; +@@ -358,27 +355,7 @@ updateSlaveDeviceCoords(DeviceIntPtr master, DeviceIntPtr pDev) + screenInfo.height); + } + +- /* calculate the other axis as well based on info from the old +- * slave-device. If the old slave had less axes than this one, +- * last.valuators is reset to 0. +- */ +- if ((lastSlave = master->last.slave) && lastSlave->valuator) { +- for (i = 2; i < pDev->valuator->numAxes; i++) { +- if (i >= lastSlave->valuator->numAxes) { +- pDev->last.valuators[i] = 0; +- valuator_mask_set_double(pDev->last.scroll, i, 0); +- } +- else { +- double val = pDev->last.valuators[i]; +- +- val = rescaleValuatorAxis(val, lastSlave->valuator->axes + i, +- pDev->valuator->axes + i, 0, 0); +- pDev->last.valuators[i] = val; +- valuator_mask_set_double(pDev->last.scroll, i, val); +- } +- } +- } +- ++ /* other axes are left as-is */ + } + + /** +-- +2.20.1 + diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index da6af0b..0c99958 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -46,7 +46,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.20.4 -Release: 2%{?gitdate:.%{gitdate}}%{?dist} +Release: 3%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org License: MIT @@ -96,6 +96,9 @@ Patch6: 0001-Fedora-hack-Make-the-suid-root-wrapper-always-start-.patch Patch10: 0001-xwayland-present-Destroy-sync_callback-in-xwl_presen.patch +# https://gitlab.freedesktop.org/xorg/xserver/merge_requests/152 +Patch11: 0001-dix-leave-last.valuators-alone-on-slave-switch.patch + BuildRequires: systemtap-sdt-devel BuildRequires: git BuildRequires: automake autoconf libtool pkgconfig @@ -520,6 +523,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Wed Mar 27 2019 Peter Hutterer 1.20.4-3 +- Fix a Qt scrolling bug, don't reset the valuator on slave switch + * Thu Mar 21 2019 Adam Jackson - 1.20.4-2 - Backport an Xwayland crash fix in the Present code From c0df45f1ace609cea750c69a7128e85a112a40e2 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Tue, 23 Apr 2019 19:39:25 -0400 Subject: [PATCH 035/131] Fix some non-atomic modesetting calls to be atomic --- ...-Weaksauce-atomic-property-debugging.patch | 64 +++++ ...agate-more-failure-in-drmmode_set_mo.patch | 31 +++ ...ing-Factor-out-drmmode_target_output.patch | 64 +++++ ...atomic-instead-of-per-crtc-walks-whe.patch | 245 ++++++++++++++++++ xorg-x11-server.spec | 13 +- 5 files changed, 416 insertions(+), 1 deletion(-) create mode 100644 0001-modesetting-Weaksauce-atomic-property-debugging.patch create mode 100644 0002-modesetting-Propagate-more-failure-in-drmmode_set_mo.patch create mode 100644 0003-modesetting-Factor-out-drmmode_target_output.patch create mode 100644 0004-modesetting-Use-atomic-instead-of-per-crtc-walks-whe.patch diff --git a/0001-modesetting-Weaksauce-atomic-property-debugging.patch b/0001-modesetting-Weaksauce-atomic-property-debugging.patch new file mode 100644 index 0000000..7c9b9a0 --- /dev/null +++ b/0001-modesetting-Weaksauce-atomic-property-debugging.patch @@ -0,0 +1,64 @@ +From 6915752b2da77c29bf8c861a6d4f2383e667323b Mon Sep 17 00:00:00 2001 +From: Adam Jackson +Date: Fri, 5 Oct 2018 14:07:46 -0400 +Subject: [PATCH xserver 1/4] modesetting: Weaksauce atomic property debugging + +This would be a good idea to have around for troubleshooting purposes, +but this particular patch is Not Good. + +Signed-off-by: Adam Jackson +--- + hw/xfree86/drivers/modesetting/drmmode_display.c | 16 +++++++++++++--- + 1 file changed, 13 insertions(+), 3 deletions(-) + +diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c +index cb48aa46b..a8d989a24 100644 +--- a/hw/xfree86/drivers/modesetting/drmmode_display.c ++++ b/hw/xfree86/drivers/modesetting/drmmode_display.c +@@ -415,6 +415,13 @@ drmmode_ConvertToKMode(ScrnInfoPtr scrn, + drmModeModeInfo * kmode, DisplayModePtr mode); + + ++static int ++drmmodeatomicaddproperty(drmModeAtomicReqPtr req, uint32_t obj, uint32_t prop, uint64_t value) ++{ ++ ErrorF("Adding to %p: %x %x %lx\n", req, obj, prop, value); ++ return drmModeAtomicAddProperty(req, obj, prop, value); ++} ++ + static int + plane_add_prop(drmModeAtomicReq *req, drmmode_crtc_private_ptr drmmode_crtc, + enum drmmode_plane_property prop, uint64_t val) +@@ -425,7 +432,8 @@ plane_add_prop(drmModeAtomicReq *req, drmmode_crtc_private_ptr drmmode_crtc, + if (!info) + return -1; + +- ret = drmModeAtomicAddProperty(req, drmmode_crtc->plane_id, ++ ErrorF("Setting %s\n", info->name); ++ ret = drmmodeatomicaddproperty(req, drmmode_crtc->plane_id, + info->prop_id, val); + return (ret <= 0) ? -1 : 0; + } +@@ -467,7 +475,8 @@ crtc_add_prop(drmModeAtomicReq *req, drmmode_crtc_private_ptr drmmode_crtc, + if (!info) + return -1; + +- ret = drmModeAtomicAddProperty(req, drmmode_crtc->mode_crtc->crtc_id, ++ ErrorF("Setting %s\n", info->name); ++ ret = drmmodeatomicaddproperty(req, drmmode_crtc->mode_crtc->crtc_id, + info->prop_id, val); + return (ret <= 0) ? -1 : 0; + } +@@ -482,7 +491,8 @@ connector_add_prop(drmModeAtomicReq *req, drmmode_output_private_ptr drmmode_out + if (!info) + return -1; + +- ret = drmModeAtomicAddProperty(req, drmmode_output->output_id, ++ ErrorF("Setting %s\n", info->name); ++ ret = drmmodeatomicaddproperty(req, drmmode_output->output_id, + info->prop_id, val); + return (ret <= 0) ? -1 : 0; + } +-- +2.20.1 + diff --git a/0002-modesetting-Propagate-more-failure-in-drmmode_set_mo.patch b/0002-modesetting-Propagate-more-failure-in-drmmode_set_mo.patch new file mode 100644 index 0000000..47195a1 --- /dev/null +++ b/0002-modesetting-Propagate-more-failure-in-drmmode_set_mo.patch @@ -0,0 +1,31 @@ +From e262c8ae0039710422c11ae254ddb4ae7e6fac02 Mon Sep 17 00:00:00 2001 +From: Adam Jackson +Date: Fri, 5 Oct 2018 14:03:54 -0400 +Subject: [PATCH xserver 2/4] modesetting: Propagate more failure in + drmmode_set_mode_major + +It's possible that actually setting the mode would fail even though the +check succeeded. We would throw away the error in this case, which would +probably make recovery a bit difficult. + +Signed-off-by: Adam Jackson +--- + hw/xfree86/drivers/modesetting/drmmode_display.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c +index a8d989a24..33f6cea3b 100644 +--- a/hw/xfree86/drivers/modesetting/drmmode_display.c ++++ b/hw/xfree86/drivers/modesetting/drmmode_display.c +@@ -1540,7 +1540,7 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode, + + /* if we only tested the mode previously, really set it now */ + if (can_test) +- drmmode_crtc_set_mode(crtc, FALSE); ++ ret = drmmode_crtc_set_mode(crtc, FALSE); + ms->pending_modeset = FALSE; + } + +-- +2.20.1 + diff --git a/0003-modesetting-Factor-out-drmmode_target_output.patch b/0003-modesetting-Factor-out-drmmode_target_output.patch new file mode 100644 index 0000000..fee4296 --- /dev/null +++ b/0003-modesetting-Factor-out-drmmode_target_output.patch @@ -0,0 +1,64 @@ +From e7f0961638818df8ee91edfae0378a02f7177e9f Mon Sep 17 00:00:00 2001 +From: Adam Jackson +Date: Fri, 5 Oct 2018 14:00:33 -0400 +Subject: [PATCH xserver 3/4] modesetting: Factor out drmmode_target_output + +Signed-off-by: Adam Jackson +--- + .../drivers/modesetting/drmmode_display.c | 26 ++++++++++++------- + 1 file changed, 16 insertions(+), 10 deletions(-) + +diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c +index 33f6cea3b..7924aa396 100644 +--- a/hw/xfree86/drivers/modesetting/drmmode_display.c ++++ b/hw/xfree86/drivers/modesetting/drmmode_display.c +@@ -757,6 +757,21 @@ drmmode_crtc_disable(xf86CrtcPtr crtc) + return ret; + } + ++static xf86OutputPtr ++drmmode_target_output(ScrnInfoPtr scrn, xf86CrtcPtr crtc) ++{ ++ xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); ++ int o; ++ ++ if (config->output[config->compat_output]->crtc == crtc) ++ return config->output[config->compat_output]; ++ ++ for (o = 0; o < config->num_output; o++) ++ if (config->output[o]->crtc == crtc) ++ return config->output[o]; ++ ++ return NULL; ++} + static int + drmmode_crtc_set_mode(xf86CrtcPtr crtc, Bool test_only) + { +@@ -3448,7 +3463,6 @@ drmmode_set_desired_modes(ScrnInfoPtr pScrn, drmmode_ptr drmmode, Bool set_hw) + xf86CrtcPtr crtc = config->crtc[c]; + drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; + xf86OutputPtr output = NULL; +- int o; + + /* Skip disabled CRTCs */ + if (!crtc->enabled) { +@@ -3459,15 +3473,7 @@ drmmode_set_desired_modes(ScrnInfoPtr pScrn, drmmode_ptr drmmode, Bool set_hw) + continue; + } + +- if (config->output[config->compat_output]->crtc == crtc) +- output = config->output[config->compat_output]; +- else { +- for (o = 0; o < config->num_output; o++) +- if (config->output[o]->crtc == crtc) { +- output = config->output[o]; +- break; +- } +- } ++ output = drmmode_target_output(pScrn, crtc); + /* paranoia */ + if (!output) + continue; +-- +2.20.1 + diff --git a/0004-modesetting-Use-atomic-instead-of-per-crtc-walks-whe.patch b/0004-modesetting-Use-atomic-instead-of-per-crtc-walks-whe.patch new file mode 100644 index 0000000..3cc6d8d --- /dev/null +++ b/0004-modesetting-Use-atomic-instead-of-per-crtc-walks-whe.patch @@ -0,0 +1,245 @@ +From e4e389447c59c89d39a5a78a5f19cdfd22d7699c Mon Sep 17 00:00:00 2001 +From: Adam Jackson +Date: Fri, 5 Oct 2018 14:09:35 -0400 +Subject: [PATCH xserver 4/4] modesetting: Use atomic instead of per-crtc walks + where we can + +drmmode_set_desired_modes (reachable from CreateScreenResources, +EnterVT, etc.) currently works by doing ->set_mode_major on each CRTC. +This is silly, as atomic lets us configure every CRTC at once. It's also +fragile, because we're not trying very hard to ensure the intermediate +states are valid. + +This patch introduces drmmode_set_mode_atomic, which blasts the entire +RANDR state into the kernel in an... atomic... fashion. We change +drmmode_set_desired_modes and drmmode_xf86crtc_resize to use this +instead of walking each CRTC. We also change drmmode_crtc_set_mode to +use this, so that client RANDR requests (operating CRTC-at-a-time, since +RANDR doesn't have atomic changes yet) use the same code paths. + +Signed-off-by: Adam Jackson +--- + .../drivers/modesetting/drmmode_display.c | 179 +++++++++++------- + 1 file changed, 109 insertions(+), 70 deletions(-) + +diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c +index 7924aa396..020678155 100644 +--- a/hw/xfree86/drivers/modesetting/drmmode_display.c ++++ b/hw/xfree86/drivers/modesetting/drmmode_display.c +@@ -772,6 +772,96 @@ drmmode_target_output(ScrnInfoPtr scrn, xf86CrtcPtr crtc) + + return NULL; + } ++ ++static int ++drmmode_set_mode_atomic(ScrnInfoPtr scrn, modesettingPtr ms, Bool test_only) ++{ ++ xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); ++ drmModeAtomicReq *req = drmModeAtomicAlloc(); ++ uint32_t flags = DRM_MODE_ATOMIC_ALLOW_MODESET; ++ int i, j, ret = 0; ++ ++ if (!req) ++ return 1; ++ ++ for (i = 0; i < xf86_config->num_crtc; i++) { ++ xf86CrtcPtr crtc = xf86_config->crtc[i]; ++ drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; ++ Bool active = crtc->enabled; ++ uint32_t fb_id; ++ int x, y; ++ drmModeModeInfo kmode; ++ ++ if (active) { ++ drmmode_ConvertToKMode(crtc->scrn, &kmode, &crtc->desiredMode); ++ ret |= drm_mode_ensure_blob(crtc, kmode); ++ ++ /* XXX this probably doesn't belong here */ ++ if (!crtc->mode.HDisplay && crtc->desiredMode.HDisplay) ++ memcpy(&crtc->mode, &crtc->desiredMode, sizeof(crtc->mode)); ++ } ++ ++ ret |= !drmmode_crtc_get_fb_id(crtc, &fb_id, &x, &y); ++ ret |= crtc_add_prop(req, drmmode_crtc, ++ DRMMODE_CRTC_ACTIVE, active); ++ ret |= crtc_add_prop(req, drmmode_crtc, ++ DRMMODE_CRTC_MODE_ID, ++ active ? drmmode_crtc->current_mode->blob_id : 0); ++ ret |= plane_add_props(req, crtc, active ? fb_id : 0, x, y); ++ } ++ ++ for (i = 0; i < xf86_config->num_output; i++) { ++ xf86OutputPtr output = xf86_config->output[i]; ++ drmmode_output_private_ptr drmmode_output = output->driver_private; ++ drmmode_crtc_private_ptr drm_crtc = ++ output->crtc ? output->crtc->driver_private : NULL; ++ ++ if (drmmode_output->output_id == -1) ++ continue; ++ ++ ret |= connector_add_prop(req, drmmode_output, ++ DRMMODE_CONNECTOR_CRTC_ID, ++ drm_crtc ? drm_crtc->mode_crtc->crtc_id : 0); ++ } ++ ++ if (test_only) ++ flags |= DRM_MODE_ATOMIC_TEST_ONLY; ++ ++ if (ret == 0) ++ ret = drmModeAtomicCommit(ms->fd, req, flags, NULL); ++ ++ if (ret == 0 && !test_only) { ++ for (i = 0; i < xf86_config->num_crtc; i++) { ++ xf86CrtcPtr crtc = xf86_config->crtc[i]; ++ for (j = 0; i < xf86_config->num_output; i++) { ++ xf86OutputPtr output = xf86_config->output[j]; ++ drmmode_output_private_ptr drmmode_output = ++ output->driver_private; ++ ++ if (output->crtc == crtc) ++ drmmode_output->current_crtc = crtc; ++ else if (drmmode_output->current_crtc == crtc) ++ drmmode_output->current_crtc = NULL; ++ } ++ } ++ } ++ ++ if (ret == 0 && test_only) { ++ for (i = 0; i < xf86_config->num_crtc; i++) { ++ xf86CrtcPtr crtc = xf86_config->crtc[i]; ++ crtc->mode = crtc->desiredMode; ++ crtc->rotation = crtc->desiredRotation; ++ crtc->x = crtc->desiredX; ++ crtc->y = crtc->desiredY; ++ if (!xf86CrtcRotate(crtc)) ++ ret = 1; ++ } ++ } ++ ++ drmModeAtomicFree(req); ++ return ret; ++} ++ + static int + drmmode_crtc_set_mode(xf86CrtcPtr crtc, Bool test_only) + { +@@ -786,73 +876,12 @@ drmmode_crtc_set_mode(xf86CrtcPtr crtc, Bool test_only) + int x, y; + int i, ret = 0; + ++ if (ms->atomic_modeset) ++ return drmmode_set_mode_atomic(crtc->scrn, ms, test_only); ++ + if (!drmmode_crtc_get_fb_id(crtc, &fb_id, &x, &y)) + return 1; + +- if (ms->atomic_modeset) { +- drmModeAtomicReq *req = drmModeAtomicAlloc(); +- Bool active; +- uint32_t flags = DRM_MODE_ATOMIC_ALLOW_MODESET; +- +- if (!req) +- return 1; +- +- ret |= crtc_add_dpms_props(req, crtc, DPMSModeOn, &active); +- ret |= plane_add_props(req, crtc, active ? fb_id : 0, x, y); +- +- /* Orphaned CRTCs need to be disabled right now in atomic mode */ +- for (i = 0; i < xf86_config->num_crtc; i++) { +- xf86CrtcPtr other_crtc = xf86_config->crtc[i]; +- drmmode_crtc_private_ptr other_drmmode_crtc = other_crtc->driver_private; +- int lost_outputs = 0; +- int remaining_outputs = 0; +- int j; +- +- if (other_crtc == crtc) +- continue; +- +- for (j = 0; j < xf86_config->num_output; j++) { +- xf86OutputPtr output = xf86_config->output[j]; +- drmmode_output_private_ptr drmmode_output = output->driver_private; +- +- if (drmmode_output->current_crtc == other_crtc) { +- if (output->crtc == crtc) +- lost_outputs++; +- else +- remaining_outputs++; +- } +- } +- +- if (lost_outputs > 0 && remaining_outputs == 0) { +- ret |= crtc_add_prop(req, other_drmmode_crtc, +- DRMMODE_CRTC_ACTIVE, 0); +- ret |= crtc_add_prop(req, other_drmmode_crtc, +- DRMMODE_CRTC_MODE_ID, 0); +- } +- } +- +- if (test_only) +- flags |= DRM_MODE_ATOMIC_TEST_ONLY; +- +- if (ret == 0) +- ret = drmModeAtomicCommit(ms->fd, req, flags, NULL); +- +- if (ret == 0 && !test_only) { +- for (i = 0; i < xf86_config->num_output; i++) { +- xf86OutputPtr output = xf86_config->output[i]; +- drmmode_output_private_ptr drmmode_output = output->driver_private; +- +- if (output->crtc == crtc) +- drmmode_output->current_crtc = crtc; +- else if (drmmode_output->current_crtc == crtc) +- drmmode_output->current_crtc = NULL; +- } +- } +- +- drmModeAtomicFree(req); +- return ret; +- } +- + output_ids = calloc(sizeof(uint32_t), xf86_config->num_output); + if (!output_ids) + return -1; +@@ -3199,14 +3228,19 @@ drmmode_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height) + if (!drmmode_glamor_handle_new_screen_pixmap(drmmode)) + goto fail; + +- for (i = 0; i < xf86_config->num_crtc; i++) { +- xf86CrtcPtr crtc = xf86_config->crtc[i]; ++ if (ms->atomic_modeset) { ++ if (drmmode_set_mode_atomic(scrn, ms, FALSE)) ++ goto fail; ++ } else { ++ for (i = 0; i < xf86_config->num_crtc; i++) { ++ xf86CrtcPtr crtc = xf86_config->crtc[i]; + +- if (!crtc->enabled) +- continue; ++ if (!crtc->enabled) ++ continue; + +- drmmode_set_mode_major(crtc, &crtc->mode, +- crtc->rotation, crtc->x, crtc->y); ++ drmmode_set_mode_major(crtc, &crtc->mode, ++ crtc->rotation, crtc->x, crtc->y); ++ } + } + + if (old_fb_id) { +@@ -3457,8 +3491,13 @@ Bool + drmmode_set_desired_modes(ScrnInfoPtr pScrn, drmmode_ptr drmmode, Bool set_hw) + { + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); ++ modesettingPtr ms = modesettingPTR(pScrn); + int c; + ++ /* drmmode_set_mode_atomic returns 0 on success, we return TRUE */ ++ if (ms->atomic_modeset) ++ return !drmmode_set_mode_atomic(pScrn, ms, /* test_only = */ !set_hw); ++ + for (c = 0; c < config->num_crtc; c++) { + xf86CrtcPtr crtc = config->crtc[c]; + drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; +-- +2.20.1 + diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 0c99958..4231e02 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -46,7 +46,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.20.4 -Release: 3%{?gitdate:.%{gitdate}}%{?dist} +Release: 4%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org License: MIT @@ -99,6 +99,14 @@ Patch10: 0001-xwayland-present-Destroy-sync_callback-in-xwl_presen.patch # https://gitlab.freedesktop.org/xorg/xserver/merge_requests/152 Patch11: 0001-dix-leave-last.valuators-alone-on-slave-switch.patch +# test for https://bugzilla.redhat.com/show_bug.cgi?id=1697591 +# see also https://gitlab.freedesktop.org/xorg/xserver/merge_requests/36 +#Patch21: 0001-modesetting-Weaksauce-atomic-property-debugging.patch +Patch22: 0002-modesetting-Propagate-more-failure-in-drmmode_set_mo.patch +Patch23: 0003-modesetting-Factor-out-drmmode_target_output.patch +Patch24: 0004-modesetting-Use-atomic-instead-of-per-crtc-walks-whe.patch + + BuildRequires: systemtap-sdt-devel BuildRequires: git BuildRequires: automake autoconf libtool pkgconfig @@ -523,6 +531,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Tue Apr 23 2019 Adam Jackson - 1.20.4-4 +- Fix some non-atomic modesetting calls to be atomic + * Wed Mar 27 2019 Peter Hutterer 1.20.4-3 - Fix a Qt scrolling bug, don't reset the valuator on slave switch From 9b1cb6ee152f427597c229487314bc1c799e369f Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Thu, 30 May 2019 14:41:00 -0400 Subject: [PATCH 036/131] xserver 1.20.5 --- sources | 2 +- xorg-x11-server.spec | 12 +++++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/sources b/sources index 00e1fdb..9b15990 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (xorg-server-1.20.4.tar.bz2) = f1c92ef6d7613e0636973d3395b48dfdad42230847ab1c8b1cea84647a968f649f9aba97bdb01c10ee8351cbe954d4e6ca4a0fc84bb8fa662d49c8ba2aee00a8 +SHA512 (xorg-server-1.20.5.tar.bz2) = 625f0626b122cf95600abe382c3217348999357a0e2d2443092f1b67cff1c98d7ef09303884ceaeac181e0555dc56b0d4d44bda45cc464dac2d9a50c5b32d631 diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 4231e02..301d3e6 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -45,8 +45,8 @@ Summary: X.Org X11 X server Name: xorg-x11-server -Version: 1.20.4 -Release: 4%{?gitdate:.%{gitdate}}%{?dist} +Version: 1.20.5 +Release: 1%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org License: MIT @@ -94,11 +94,6 @@ Patch5: 0001-autobind-GPUs-to-the-screen.patch # because the display-managers are not ready yet, do not upstream Patch6: 0001-Fedora-hack-Make-the-suid-root-wrapper-always-start-.patch -Patch10: 0001-xwayland-present-Destroy-sync_callback-in-xwl_presen.patch - -# https://gitlab.freedesktop.org/xorg/xserver/merge_requests/152 -Patch11: 0001-dix-leave-last.valuators-alone-on-slave-switch.patch - # test for https://bugzilla.redhat.com/show_bug.cgi?id=1697591 # see also https://gitlab.freedesktop.org/xorg/xserver/merge_requests/36 #Patch21: 0001-modesetting-Weaksauce-atomic-property-debugging.patch @@ -531,6 +526,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Thu May 30 2019 Adam Jackson - 1.20.5-1 +- xserver 1.20.5 + * Tue Apr 23 2019 Adam Jackson - 1.20.4-4 - Fix some non-atomic modesetting calls to be atomic From 9f7e9a83a5b544c3e06f7627af74960ac463a499 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 6 Jun 2019 09:20:27 +1000 Subject: [PATCH 037/131] Return AlreadyGrabbed for keycodes > 255 (#1697804) --- ...urn-AlreadyGrabbed-for-key-grabs-255.patch | 42 +++++++++++++++++++ xorg-x11-server.spec | 7 +++- 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 0001-Xi-return-AlreadyGrabbed-for-key-grabs-255.patch diff --git a/0001-Xi-return-AlreadyGrabbed-for-key-grabs-255.patch b/0001-Xi-return-AlreadyGrabbed-for-key-grabs-255.patch new file mode 100644 index 0000000..9c846d0 --- /dev/null +++ b/0001-Xi-return-AlreadyGrabbed-for-key-grabs-255.patch @@ -0,0 +1,42 @@ +From 0ad717edcf372425ddf2ba9926857419ab62f4f5 Mon Sep 17 00:00:00 2001 +From: Peter Hutterer +Date: Wed, 29 May 2019 16:19:55 +1000 +Subject: [PATCH xserver] Xi: return AlreadyGrabbed for key grabs > 255 + +We can't have high keycodes because everything in XKB relies on 8 bits. XI2's +API allows for 32-bit keycodes so we have to take those but nothing in the +server is really ready for this. The effect of this right now is that any high +keycode grab is clipped to 255 and thus ends up grabbing a different key +instead. + +https://bugzilla.redhat.com/show_bug.cgi?id=1697804 + +Signed-off-by: Peter Hutterer +--- + Xi/xipassivegrab.c | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +diff --git a/Xi/xipassivegrab.c b/Xi/xipassivegrab.c +index 65d5870f6..d30f51f3c 100644 +--- a/Xi/xipassivegrab.c ++++ b/Xi/xipassivegrab.c +@@ -203,8 +203,14 @@ ProcXIPassiveGrabDevice(ClientPtr client) + ¶m, XI2, &mask); + break; + case XIGrabtypeKeycode: +- status = GrabKey(client, dev, mod_dev, stuff->detail, +- ¶m, XI2, &mask); ++ /* XI2 allows 32-bit keycodes but thanks to XKB we can never ++ * implement this. Just return an error for all keycodes that ++ * cannot work anyway */ ++ if (stuff->detail > 255) ++ status = XIAlreadyGrabbed; ++ else ++ status = GrabKey(client, dev, mod_dev, stuff->detail, ++ ¶m, XI2, &mask); + break; + case XIGrabtypeEnter: + case XIGrabtypeFocusIn: +-- +2.21.0 + diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 301d3e6..049b269 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -46,7 +46,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.20.5 -Release: 1%{?gitdate:.%{gitdate}}%{?dist} +Release: 2%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org License: MIT @@ -101,6 +101,8 @@ Patch22: 0002-modesetting-Propagate-more-failure-in-drmmode_set_mo.patch Patch23: 0003-modesetting-Factor-out-drmmode_target_output.patch Patch24: 0004-modesetting-Use-atomic-instead-of-per-crtc-walks-whe.patch +# https://bugzilla.redhat.com/show_bug.cgi?id=1697804 +Patch25: 0001-Xi-return-AlreadyGrabbed-for-key-grabs-255.patch BuildRequires: systemtap-sdt-devel BuildRequires: git @@ -526,6 +528,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Thu Jun 06 2019 Peter Hutterer 1.20.5-2 +- Return AlreadyGrabbed for keycodes > 255 (#1697804) + * Thu May 30 2019 Adam Jackson - 1.20.5-1 - xserver 1.20.5 From 84ed0d0988af057178ec4da15d043010830d5fee Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Fri, 28 Jun 2019 17:02:00 +0200 Subject: [PATCH 038/131] Fix downstream regression and backport fixes --- ...ap-exportable-from-gbm_bo_from_pixma.patch | 89 ++++++++++++ ...a-crash-on-pointer-enter-with-a-grab.patch | 53 +++++++ ...-Check-status-in-GBM-pixmap-creation.patch | 137 ++++++++++++++++++ ...cheduled-frames-after-hiding-tablet-.patch | 38 +++++ xorg-x11-server.spec | 24 ++- 5 files changed, 337 insertions(+), 4 deletions(-) create mode 100644 0001-glamor-Make-pixmap-exportable-from-gbm_bo_from_pixma.patch create mode 100644 0001-xwayland-Avoid-a-crash-on-pointer-enter-with-a-grab.patch create mode 100644 0001-xwayland-Check-status-in-GBM-pixmap-creation.patch create mode 100644 0001-xwayland-Reset-scheduled-frames-after-hiding-tablet-.patch diff --git a/0001-glamor-Make-pixmap-exportable-from-gbm_bo_from_pixma.patch b/0001-glamor-Make-pixmap-exportable-from-gbm_bo_from_pixma.patch new file mode 100644 index 0000000..ea31a81 --- /dev/null +++ b/0001-glamor-Make-pixmap-exportable-from-gbm_bo_from_pixma.patch @@ -0,0 +1,89 @@ +From 6e199e4613e149cd5d5ce69cdd6a259744b6cb44 Mon Sep 17 00:00:00 2001 +From: Olivier Fourdan +Date: Fri, 26 Apr 2019 13:37:09 +0200 +Subject: [PATCH xserver] glamor: Make pixmap exportable from + `gbm_bo_from_pixmap()` + +If a pixmap is not exportable, `glamor_gbm_bo_from_pixmap()` would fail +and the modesettings driver would consequently fail to do its page flip, +which both prevents Present from working and also fill up the logs with +error messages such as: + + (EE) modeset(0): Failed to get GBM bo for flip to new front. + (EE) modeset(0): present flip failed + +Refactor the code so that `glamor_gbm_bo_from_pixmap()` takes care of +making the pixmap exportable. + +Signed-off-by: Olivier Fourdan +Signed-off-by: Yuxuan Shui yshui@hadean.com +See-also: https://gitlab.freedesktop.org/xorg/xserver/merge_requests/131 +Closes: https://gitlab.freedesktop.org/xorg/xserver/issues/68 +Fixes: 86b2d8740a "glamor: Reallocate pixmap storage without modifiers + if necessary" +(cherry picked from commit 26fe29f4fa53cbb7d51892e2cf397c084093812f) +--- + glamor/glamor_egl.c | 19 ++++++++++++++----- + 1 file changed, 14 insertions(+), 5 deletions(-) + +diff --git a/glamor/glamor_egl.c b/glamor/glamor_egl.c +index d3c678d6b..9a619a133 100644 +--- a/glamor/glamor_egl.c ++++ b/glamor/glamor_egl.c +@@ -355,8 +355,8 @@ glamor_make_pixmap_exportable(PixmapPtr pixmap, Bool modifiers_ok) + return TRUE; + } + +-struct gbm_bo * +-glamor_gbm_bo_from_pixmap(ScreenPtr screen, PixmapPtr pixmap) ++static struct gbm_bo * ++glamor_gbm_bo_from_pixmap_internal(ScreenPtr screen, PixmapPtr pixmap) + { + struct glamor_egl_screen_private *glamor_egl = + glamor_egl_get_screen_private(xf86ScreenToScrn(screen)); +@@ -370,6 +370,15 @@ glamor_gbm_bo_from_pixmap(ScreenPtr screen, PixmapPtr pixmap) + pixmap_priv->image, 0); + } + ++struct gbm_bo * ++glamor_gbm_bo_from_pixmap(ScreenPtr screen, PixmapPtr pixmap) ++{ ++ if (!glamor_make_pixmap_exportable(pixmap, TRUE)) ++ return NULL; ++ ++ return glamor_gbm_bo_from_pixmap_internal(screen, pixmap); ++} ++ + int + glamor_egl_fds_from_pixmap(ScreenPtr screen, PixmapPtr pixmap, int *fds, + uint32_t *strides, uint32_t *offsets, +@@ -385,7 +394,7 @@ glamor_egl_fds_from_pixmap(ScreenPtr screen, PixmapPtr pixmap, int *fds, + if (!glamor_make_pixmap_exportable(pixmap, TRUE)) + return 0; + +- bo = glamor_gbm_bo_from_pixmap(screen, pixmap); ++ bo = glamor_gbm_bo_from_pixmap_internal(screen, pixmap); + if (!bo) + return 0; + +@@ -423,7 +432,7 @@ glamor_egl_fd_from_pixmap(ScreenPtr screen, PixmapPtr pixmap, + if (!glamor_make_pixmap_exportable(pixmap, FALSE)) + return -1; + +- bo = glamor_gbm_bo_from_pixmap(screen, pixmap); ++ bo = glamor_gbm_bo_from_pixmap_internal(screen, pixmap); + if (!bo) + return -1; + +@@ -452,7 +461,7 @@ glamor_egl_fd_name_from_pixmap(ScreenPtr screen, + if (!glamor_make_pixmap_exportable(pixmap, FALSE)) + goto failure; + +- bo = glamor_gbm_bo_from_pixmap(screen, pixmap); ++ bo = glamor_gbm_bo_from_pixmap_internal(screen, pixmap); + if (!bo) + goto failure; + +-- +2.21.0 + diff --git a/0001-xwayland-Avoid-a-crash-on-pointer-enter-with-a-grab.patch b/0001-xwayland-Avoid-a-crash-on-pointer-enter-with-a-grab.patch new file mode 100644 index 0000000..7983893 --- /dev/null +++ b/0001-xwayland-Avoid-a-crash-on-pointer-enter-with-a-grab.patch @@ -0,0 +1,53 @@ +From 6711b5c6fdf0581c77150306fff909d7bc63b8a4 Mon Sep 17 00:00:00 2001 +From: Olivier Fourdan +Date: Thu, 9 May 2019 10:36:19 +0200 +Subject: [PATCH xserver] xwayland: Avoid a crash on pointer enter with a grab + +On pointer enter notification, Xwayland checks for an existing pointer +warp with a `NULL` sprite. + +In turn, `xwl_pointer_warp_emulator_maybe_lock()` checks for an existing +grab and the destination window using `XYToWindow()` which does not +check for the actual sprite not being `NULL`. + +So, in some cases, when the pointer enters the surface and there is an +existing X11 grab which is not an ownerEvents grab, Xwayland would crash +trying to dereference the `NULL` sprite pointer: + + #0 __GI_raise () + #1 __GI_abort () at abort.c:79 + #2 OsAbort () at utils.c:1351 + #3 AbortServer () at log.c:879 + #4 FatalError () at log.c:1017 + #5 OsSigHandler () at osinit.c:156 + #6 OsSigHandler () at osinit.c:110 + #7 + #8 XYToWindow (pSprite=0x0, x=0, y=0) at events.c:2880 + #9 xwl_pointer_warp_emulator_maybe_lock () at xwayland-input.c:2673 + #10 pointer_handle_enter () at xwayland-input.c:434 + +Avoid the crash by simply checking for the sprite being not `NULL` in +`xwl_pointer_warp_emulator_maybe_lock()` + +Signed-off-by: Olivier Fourdan +Bugzilla: https://bugzilla.redhat.com/1708119 +(cherry picked from commit 0a07446318f248b65fcbc8ab8a73ead51153f09e) +--- + hw/xwayland/xwayland-input.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c +index fbbcb39cc..fa46ac3e7 100644 +--- a/hw/xwayland/xwayland-input.c ++++ b/hw/xwayland/xwayland-input.c +@@ -2667,6 +2667,7 @@ xwl_pointer_warp_emulator_maybe_lock(struct xwl_pointer_warp_emulator *warp_emul + */ + if (pointer_grab && + !pointer_grab->ownerEvents && ++ sprite && + XYToWindow(sprite, x, y) != xwl_seat->focus_window->window) + return; + +-- +2.21.0 + diff --git a/0001-xwayland-Check-status-in-GBM-pixmap-creation.patch b/0001-xwayland-Check-status-in-GBM-pixmap-creation.patch new file mode 100644 index 0000000..bdbfdda --- /dev/null +++ b/0001-xwayland-Check-status-in-GBM-pixmap-creation.patch @@ -0,0 +1,137 @@ +From 34ad57e570f96dfe4bc493f14726b7a0ae6d45f9 Mon Sep 17 00:00:00 2001 +From: Olivier Fourdan +Date: Tue, 12 Mar 2019 15:38:03 +0100 +Subject: [PATCH xserver] xwayland: Check status in GBM pixmap creation + +The current code in `xwl_glamor_gbm_create_pixmap_for_bo()` may fail in +several cases that are not checked for: + + - `eglCreateImageKHR()` may have failed to create the image, + - `glEGLImageTargetTexture2DOES()` may fail and set an error, + - `glamor_set_pixmap_texture()` may fail for very large pixmaps + because the corresponding FBO could not be created. + +Trying to upload content to a pixmap with no texture will crash Mesa, +glamor and Xwayland, e.g.: + + XXX fail to create fbo. + (EE) + (EE) Backtrace: + (EE) 0: Xwayland (OsSigHandler+0x29) + (EE) 1: libpthread.so.0 (funlockfile+0x50) + (EE) 2: libc.so.6 (__memmove_avx_unaligned_erms+0x215) + (EE) 3: dri/i965_dri.so (_mesa_format_convert+0xab3) + (EE) 4: dri/i965_dri.so (_mesa_texstore+0x205) + (EE) 5: dri/i965_dri.so (store_texsubimage+0x28c) + (EE) 6: dri/i965_dri.so (intel_upload_tex+0x13b) + (EE) 7: dri/i965_dri.so (texture_sub_image+0x134) + (EE) 8: dri/i965_dri.so (texsubimage_err+0x150) + (EE) 9: dri/i965_dri.so (_mesa_TexSubImage2D+0x48) + (EE) 10: Xwayland (glamor_upload_boxes+0x246) + (EE) 11: Xwayland (glamor_copy+0x4d1) + (EE) 12: Xwayland (miCopyRegion+0x96) + (EE) 13: Xwayland (miDoCopy+0x43c) + (EE) 14: Xwayland (glamor_copy_area+0x24) + (EE) 15: Xwayland (damageCopyArea+0xba) + (EE) 16: Xwayland (compCopyWindow+0x31c) + (EE) 17: Xwayland (damageCopyWindow+0xd3) + (EE) 18: Xwayland (miResizeWindow+0x7b7) + (EE) 19: Xwayland (compResizeWindow+0x3a) + (EE) 20: Xwayland (ConfigureWindow+0xa96) + (EE) 21: Xwayland (ProcConfigureWindow+0x7d) + (EE) 22: Xwayland (Dispatch+0x320) + (EE) 23: Xwayland (dix_main+0x366) + (EE) 24: libc.so.6 (__libc_start_main+0xf3) + (EE) 25: Xwayland (_start+0x2e) + (EE) + Fatal server error: + (EE) Caught signal 11 (Segmentation fault). Server aborting + (EE) + +Check for the possible cases of failure above and fallback to the +regular glamor pixmap creation when an error is detected. + +Signed-off-by: Olivier Fourdan +Closes: https://gitlab.freedesktop.org/xorg/xserver/issues/661 +(cherry picked from commit fc6380a11be4c6202ed72f241dd9ee8c7c24671d) +--- + hw/xwayland/xwayland-glamor-gbm.c | 34 +++++++++++++++++++++++++++---- + 1 file changed, 30 insertions(+), 4 deletions(-) + +diff --git a/hw/xwayland/xwayland-glamor-gbm.c b/hw/xwayland/xwayland-glamor-gbm.c +index a211e0915..80146ab6e 100644 +--- a/hw/xwayland/xwayland-glamor-gbm.c ++++ b/hw/xwayland/xwayland-glamor-gbm.c +@@ -169,6 +169,8 @@ xwl_glamor_gbm_create_pixmap_for_bo(ScreenPtr screen, struct gbm_bo *bo, + xwl_screen->egl_context, + EGL_NATIVE_PIXMAP_KHR, + xwl_pixmap->bo, NULL); ++ if (xwl_pixmap->image == EGL_NO_IMAGE_KHR) ++ goto error; + + glGenTextures(1, &xwl_pixmap->texture); + glBindTexture(GL_TEXTURE_2D, xwl_pixmap->texture); +@@ -176,14 +178,31 @@ xwl_glamor_gbm_create_pixmap_for_bo(ScreenPtr screen, struct gbm_bo *bo, + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + + glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, xwl_pixmap->image); +- glBindTexture(GL_TEXTURE_2D, 0); ++ if (eglGetError() != EGL_SUCCESS) ++ goto error; + +- xwl_pixmap_set_private(pixmap, xwl_pixmap); ++ glBindTexture(GL_TEXTURE_2D, 0); + + glamor_set_pixmap_texture(pixmap, xwl_pixmap->texture); ++ /* `set_pixmap_texture()` may fail silently if the FBO creation failed, ++ * so we check again the texture to be sure it worked. ++ */ ++ if (!glamor_get_pixmap_texture(pixmap)) ++ goto error; ++ + glamor_set_pixmap_type(pixmap, GLAMOR_TEXTURE_DRM); ++ xwl_pixmap_set_private(pixmap, xwl_pixmap); + + return pixmap; ++ ++error: ++ if (xwl_pixmap->image != EGL_NO_IMAGE_KHR) ++ eglDestroyImageKHR(xwl_screen->egl_display, xwl_pixmap->image); ++ if (pixmap) ++ glamor_destroy_pixmap(pixmap); ++ free(xwl_pixmap); ++ ++ return NULL; + } + + static PixmapPtr +@@ -194,6 +213,7 @@ xwl_glamor_gbm_create_pixmap(ScreenPtr screen, + struct xwl_screen *xwl_screen = xwl_screen_get(screen); + struct xwl_gbm_private *xwl_gbm = xwl_gbm_get(xwl_screen); + struct gbm_bo *bo; ++ PixmapPtr pixmap = NULL; + + if (width > 0 && height > 0 && depth >= 15 && + (hint == 0 || +@@ -219,10 +239,16 @@ xwl_glamor_gbm_create_pixmap(ScreenPtr screen, + } + + if (bo) +- return xwl_glamor_gbm_create_pixmap_for_bo(screen, bo, depth); ++ pixmap = xwl_glamor_gbm_create_pixmap_for_bo(screen, bo, depth); ++ ++ if (!pixmap) ++ gbm_bo_destroy(bo); + } + +- return glamor_create_pixmap(screen, width, height, depth, hint); ++ if (!pixmap) ++ pixmap = glamor_create_pixmap(screen, width, height, depth, hint); ++ ++ return pixmap; + } + + static Bool +-- +2.21.0 + diff --git a/0001-xwayland-Reset-scheduled-frames-after-hiding-tablet-.patch b/0001-xwayland-Reset-scheduled-frames-after-hiding-tablet-.patch new file mode 100644 index 0000000..93cf411 --- /dev/null +++ b/0001-xwayland-Reset-scheduled-frames-after-hiding-tablet-.patch @@ -0,0 +1,38 @@ +From c86222d4bd94892f3bf3c5947c19793ca18bd9e2 Mon Sep 17 00:00:00 2001 +From: Carlos Garnacho +Date: Wed, 22 May 2019 17:51:04 +0200 +Subject: [PATCH xserver] xwayland: Reset scheduled frames after hiding tablet + cursor + +Hiding the tablet tool cursor results in it being hidden forever after. +This is due to the stale frame callback that will neither be disposed +or replaced. This can be reproduced in krita (X11) as the pointer +cursor is hidden while over the canvas. + +Clearing the frame callback ensures the correct behavior in future +xwl_tablet_tool_set_cursor() calls (i.e. a new cursor surface being +displayed, and a new frame callback created), and is 1:1 +with xwl_seat_set_cursor() for pointers. + +Signed-off-by: Carlos Garnacho +(cherry picked from commit dea4a74621294391ce5901bb3339e1b8e7151efc) +--- + hw/xwayland/xwayland-cursor.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/hw/xwayland/xwayland-cursor.c b/hw/xwayland/xwayland-cursor.c +index cf8395f1d..66720bcc0 100644 +--- a/hw/xwayland/xwayland-cursor.c ++++ b/hw/xwayland/xwayland-cursor.c +@@ -188,6 +188,8 @@ xwl_tablet_tool_set_cursor(struct xwl_tablet_tool *xwl_tablet_tool) + zwp_tablet_tool_v2_set_cursor(xwl_tablet_tool->tool, + xwl_tablet_tool->proximity_in_serial, + NULL, 0, 0); ++ clear_cursor_frame_callback(xwl_cursor); ++ xwl_cursor->needs_update = FALSE; + return; + } + +-- +2.21.0 + diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 049b269..2784b14 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -46,7 +46,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.20.5 -Release: 2%{?gitdate:.%{gitdate}}%{?dist} +Release: 3%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org License: MIT @@ -96,14 +96,24 @@ Patch6: 0001-Fedora-hack-Make-the-suid-root-wrapper-always-start-.patch # test for https://bugzilla.redhat.com/show_bug.cgi?id=1697591 # see also https://gitlab.freedesktop.org/xorg/xserver/merge_requests/36 +# ofourdan> Disabling those for now, causing regressions (#1714981, #1723715) #Patch21: 0001-modesetting-Weaksauce-atomic-property-debugging.patch -Patch22: 0002-modesetting-Propagate-more-failure-in-drmmode_set_mo.patch -Patch23: 0003-modesetting-Factor-out-drmmode_target_output.patch -Patch24: 0004-modesetting-Use-atomic-instead-of-per-crtc-walks-whe.patch +#Patch22: 0002-modesetting-Propagate-more-failure-in-drmmode_set_mo.patch +#Patch23: 0003-modesetting-Factor-out-drmmode_target_output.patch +#Patch24: 0004-modesetting-Use-atomic-instead-of-per-crtc-walks-whe.patch # https://bugzilla.redhat.com/show_bug.cgi?id=1697804 Patch25: 0001-Xi-return-AlreadyGrabbed-for-key-grabs-255.patch +# From current server-1.20-branch: +# https://bugzilla.redhat.com/1708119 +Patch26: 0001-xwayland-Avoid-a-crash-on-pointer-enter-with-a-grab.patch +# https://bugzilla.redhat.com/1691745 +Patch27: 0001-xwayland-Check-status-in-GBM-pixmap-creation.patch +# https://bugzilla.redhat.com/1645553 +Patch28: 0001-glamor-Make-pixmap-exportable-from-gbm_bo_from_pixma.patch +Patch29: 0001-xwayland-Reset-scheduled-frames-after-hiding-tablet-.patch + BuildRequires: systemtap-sdt-devel BuildRequires: git BuildRequires: automake autoconf libtool pkgconfig @@ -528,6 +538,12 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Fri Jun 28 2019 Olivier Fourdan 1.20.5-3 +- Remove atomic downstream patches causing regressions (#1714981, #1723715) +- Xwayland crashes (#1708119, #1691745) +- Cursor issue with tablet on Xwayland +- Xorg/modesetting issue with flipping pixmaps with Present (#1645553) + * Thu Jun 06 2019 Peter Hutterer 1.20.5-2 - Return AlreadyGrabbed for keycodes > 255 (#1697804) From 5160bab94ce1c786057215d7d8c5adf1dbb7953c Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Mon, 8 Jul 2019 09:20:44 +0200 Subject: [PATCH 039/131] Fix regression causing screen tearing with xserver 1.20.5 Resolves: rhbz#1726419 --- ...cmd-Check-that-the-flip-and-screen-p.patch | 49 +++++++++++++++++++ xorg-x11-server.spec | 10 +++- 2 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 0001-Revert-present-scmd-Check-that-the-flip-and-screen-p.patch diff --git a/0001-Revert-present-scmd-Check-that-the-flip-and-screen-p.patch b/0001-Revert-present-scmd-Check-that-the-flip-and-screen-p.patch new file mode 100644 index 0000000..29ae6f5 --- /dev/null +++ b/0001-Revert-present-scmd-Check-that-the-flip-and-screen-p.patch @@ -0,0 +1,49 @@ +From 8d2c776b2e14b3edcb27ced96cda7bede82c39cc Mon Sep 17 00:00:00 2001 +From: Olivier Fourdan +Date: Thu, 4 Jul 2019 08:42:15 +0200 +Subject: [PATCH xserver] Revert "present/scmd: Check that the flip and screen + pixmap pitches match" + +This reverts commit ef91da2757050652c724f6e674e8b1acf5d0cb31. +Closes: https://gitlab.freedesktop.org/xorg/xserver/issues/839 +--- + present/present_scmd.c | 8 +++----- + 1 file changed, 3 insertions(+), 5 deletions(-) + +diff --git a/present/present_scmd.c b/present/present_scmd.c +index 7c2f80997..8417d0925 100644 +--- a/present/present_scmd.c ++++ b/present/present_scmd.c +@@ -78,7 +78,7 @@ present_check_flip(RRCrtcPtr crtc, + PresentFlipReason *reason) + { + ScreenPtr screen = window->drawable.pScreen; +- PixmapPtr screen_pixmap, window_pixmap; ++ PixmapPtr window_pixmap; + WindowPtr root = screen->root; + present_screen_priv_ptr screen_priv = present_screen_priv(screen); + +@@ -99,9 +99,8 @@ present_check_flip(RRCrtcPtr crtc, + return FALSE; + + /* Make sure the window hasn't been redirected with Composite */ +- screen_pixmap = screen->GetScreenPixmap(screen); + window_pixmap = screen->GetWindowPixmap(window); +- if (window_pixmap != screen_pixmap && ++ if (window_pixmap != screen->GetScreenPixmap(screen) && + window_pixmap != screen_priv->flip_pixmap && + window_pixmap != present_flip_pending_pixmap(screen)) + return FALSE; +@@ -127,8 +126,7 @@ present_check_flip(RRCrtcPtr crtc, + window->drawable.x != pixmap->screen_x || window->drawable.y != pixmap->screen_y || + #endif + window->drawable.width != pixmap->drawable.width || +- window->drawable.height != pixmap->drawable.height || +- pixmap->devKind != screen_pixmap->devKind) { ++ window->drawable.height != pixmap->drawable.height) { + return FALSE; + } + +-- +2.21.0 + diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 2784b14..c835096 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -46,7 +46,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.20.5 -Release: 3%{?gitdate:.%{gitdate}}%{?dist} +Release: 4%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org License: MIT @@ -114,6 +114,10 @@ Patch27: 0001-xwayland-Check-status-in-GBM-pixmap-creation.patch Patch28: 0001-glamor-Make-pixmap-exportable-from-gbm_bo_from_pixma.patch Patch29: 0001-xwayland-Reset-scheduled-frames-after-hiding-tablet-.patch +# https://gitlab.freedesktop.org/xorg/xserver/issues/839 +# https://bugzilla.redhat.com/1726419 +Patch30: 0001-Revert-present-scmd-Check-that-the-flip-and-screen-p.patch + BuildRequires: systemtap-sdt-devel BuildRequires: git BuildRequires: automake autoconf libtool pkgconfig @@ -538,6 +542,10 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Mon Jul 8 2019 Olivier Fourdan 1.20.5-4 +- Fix regression causing screen tearing with upstream xserver 1.20.5 + (rhbz#1726419) + * Fri Jun 28 2019 Olivier Fourdan 1.20.5-3 - Remove atomic downstream patches causing regressions (#1714981, #1723715) - Xwayland crashes (#1708119, #1691745) From 945c62ac33976cb9f779de7ba86d791e0014bbba Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Wed, 3 Jul 2019 11:30:01 +0200 Subject: [PATCH 040/131] Fix build on ARM with glibc - Do not include on ARM with glibc to avoid compilation failure. - Do not force vbe and int10 sdk headers as this enables int10 which does not build on ARM without --- ...ys-install-vbe-and-int10-sdk-headers.patch | 37 ------------ ...t-include-sys-io.h-on-ARM-with-glibc.patch | 59 +++++++++++++++++++ xorg-x11-server.spec | 13 +++- 3 files changed, 69 insertions(+), 40 deletions(-) delete mode 100644 0001-Always-install-vbe-and-int10-sdk-headers.patch create mode 100644 0001-compiler.h-Do-not-include-sys-io.h-on-ARM-with-glibc.patch diff --git a/0001-Always-install-vbe-and-int10-sdk-headers.patch b/0001-Always-install-vbe-and-int10-sdk-headers.patch deleted file mode 100644 index c613eb8..0000000 --- a/0001-Always-install-vbe-and-int10-sdk-headers.patch +++ /dev/null @@ -1,37 +0,0 @@ -From e96a83d9b1b5a52a41213c7a4840dc96b4f5b06f Mon Sep 17 00:00:00 2001 -From: Adam Jackson -Date: Wed, 15 Aug 2012 12:35:21 -0400 -Subject: [PATCH] Always install vbe and int10 sdk headers - -Signed-off-by: Adam Jackson ---- - hw/xfree86/Makefile.am | 12 ++---------- - 1 file changed, 2 insertions(+), 10 deletions(-) - -diff --git a/hw/xfree86/Makefile.am b/hw/xfree86/Makefile.am -index b876b79..a170b58 100644 ---- a/hw/xfree86/Makefile.am -+++ b/hw/xfree86/Makefile.am -@@ -26,17 +26,9 @@ if VGAHW - VGAHW_SUBDIR = vgahw - endif - --if VBE --VBE_SUBDIR = vbe --endif -- --if INT10MODULE --INT10_SUBDIR = int10 --endif -- --SUBDIRS = common ddc x86emu $(INT10_SUBDIR) os-support parser \ -+SUBDIRS = common ddc x86emu int10 os-support parser \ - ramdac $(VGAHW_SUBDIR) loader modes $(DRI_SUBDIR) \ -- $(DRI2_SUBDIR) . $(VBE_SUBDIR) i2c dixmods xkb \ -+ $(DRI2_SUBDIR) . vbe i2c dixmods xkb \ - fbdevhw shadowfb exa $(XF86UTILS_SUBDIR) doc man \ - $(GLAMOR_EGL_SUBDIR) drivers - --- -2.13.6 - diff --git a/0001-compiler.h-Do-not-include-sys-io.h-on-ARM-with-glibc.patch b/0001-compiler.h-Do-not-include-sys-io.h-on-ARM-with-glibc.patch new file mode 100644 index 0000000..ba70119 --- /dev/null +++ b/0001-compiler.h-Do-not-include-sys-io.h-on-ARM-with-glibc.patch @@ -0,0 +1,59 @@ +From cffdd3984369ec7e31c87f9240c1485ab6370a8f Mon Sep 17 00:00:00 2001 +From: Olivier Fourdan +Date: Mon, 1 Jul 2019 13:20:39 +0200 +Subject: [PATCH] compiler.h: Do not include sys/io.h on ARM with glibc + + on ARM hasn't worked for a long, long time, so it was removed +it from glibc upstream. + +Remove the include to avoid a compilation failure on ARM with glibc. + +Signed-off-by: Olivier Fourdan +--- + hw/xfree86/common/compiler.h | 30 ------------------------------ + 1 file changed, 30 deletions(-) + +diff --git a/hw/xfree86/common/compiler.h b/hw/xfree86/common/compiler.h +index 7144c6a..2b2008b 100644 +--- a/hw/xfree86/common/compiler.h ++++ b/hw/xfree86/common/compiler.h +@@ -758,36 +758,6 @@ inl(unsigned short port) + return xf86ReadMmio32Le((void *) ioBase, port); + } + +-#elif defined(__arm__) && defined(__linux__) +- +-/* for Linux on ARM, we use the LIBC inx/outx routines */ +-/* note that the appropriate setup via "ioperm" needs to be done */ +-/* *before* any inx/outx is done. */ +- +-#include +- +-static __inline__ void +-xf_outb(unsigned short port, unsigned char val) +-{ +- outb(val, port); +-} +- +-static __inline__ void +-xf_outw(unsigned short port, unsigned short val) +-{ +- outw(val, port); +-} +- +-static __inline__ void +-xf_outl(unsigned short port, unsigned int val) +-{ +- outl(val, port); +-} +- +-#define outb xf_outb +-#define outw xf_outw +-#define outl xf_outl +- + #elif defined(__nds32__) + + /* +-- +2.21.0 + diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index c835096..a9ca269 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -46,7 +46,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.20.5 -Release: 4%{?gitdate:.%{gitdate}}%{?dist} +Release: 5%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org License: MIT @@ -86,8 +86,6 @@ Patch2: 0001-xfree86-use-modesetting-driver-by-default-on-GeForce.patch # va_gl should probably just be the default everywhere ? Patch3: 0001-xf86-dri2-Use-va_gl-as-vdpau_driver-for-Intel-i965-G.patch -Patch4: 0001-Always-install-vbe-and-int10-sdk-headers.patch - # Submitted upstream, but not going anywhere Patch5: 0001-autobind-GPUs-to-the-screen.patch @@ -118,6 +116,10 @@ Patch29: 0001-xwayland-Reset-scheduled-frames-after-hiding-tablet-.patch # https://bugzilla.redhat.com/1726419 Patch30: 0001-Revert-present-scmd-Check-that-the-flip-and-screen-p.patch +# Build failure with recent glibc +# https://gitlab.freedesktop.org/xorg/xserver/issues/840 +Patch31: 0001-compiler.h-Do-not-include-sys-io.h-on-ARM-with-glibc.patch + BuildRequires: systemtap-sdt-devel BuildRequires: git BuildRequires: automake autoconf libtool pkgconfig @@ -542,6 +544,11 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Mon Jul 8 2019 Olivier Fourdan 1.20.5-5 +- Do not include on ARM with glibc to avoid compilation failure. +- Do not force vbe and int10 sdk headers as this enables int10 which does + not build on ARM without + * Mon Jul 8 2019 Olivier Fourdan 1.20.5-4 - Fix regression causing screen tearing with upstream xserver 1.20.5 (rhbz#1726419) From cf7f90e3c6a4101c5b228a1f9e123f4a6e8a9a97 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 27 Jul 2019 04:32:10 +0000 Subject: [PATCH 041/131] - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- xorg-x11-server.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index a9ca269..72b77a0 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -46,7 +46,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.20.5 -Release: 5%{?gitdate:.%{gitdate}}%{?dist} +Release: 6%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org License: MIT @@ -544,6 +544,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Sat Jul 27 2019 Fedora Release Engineering - 1.20.5-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + * Mon Jul 8 2019 Olivier Fourdan 1.20.5-5 - Do not include on ARM with glibc to avoid compilation failure. - Do not force vbe and int10 sdk headers as this enables int10 which does From 7730e12c9e6c0653c631d4ab01bc2d51c5f48142 Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Tue, 10 Sep 2019 15:56:14 +0200 Subject: [PATCH 042/131] Pick latest fixes from xserver stable branch upstream resolves: rhbz#1729925 --- ...evice-active-grab-to-deliver-touch-e.patch | 76 ++++++ 0002-dri2-Sync-i965_pci_ids.h-from-mesa.patch | 136 ++++++++++ ...pdate-screen-pixmap-on-output-resize.patch | 80 ++++++ ...-Expand-the-RANDR-screen-size-limits.patch | 36 +++ 0005-xwayland-Do-not-free-a-NULL-GBM-bo.patch | 56 ++++ ...ce-inside-of-SyncCreate-export-SyncC.patch | 244 ++++++++++++++++++ ...-GLX-Add-a-per-client-vendor-mapping.patch | 92 +++++++ ...-sending-client-for-looking-up-XID-s.patch | 114 ++++++++ ...tion-to-change-a-clients-vendor-list.patch | 114 ++++++++ ...GlxServerExports-major-minor-Version.patch | 35 +++ 0011-miext-sync-Fix-needless-ABI-change.patch | 39 +++ ...-context-validation-in-xorgGlxMakeCu.patch | 40 +++ ...e-DamagePtr-into-separate-window-dat.patch | 173 +++++++++++++ ...r-surface-creation-into-a-separate-f.patch | 125 +++++++++ ...the-case-of-windows-being-realized-b.patch | 91 +++++++ xorg-x11-server.spec | 22 +- 16 files changed, 1472 insertions(+), 1 deletion(-) create mode 100644 0001-Xi-Use-current-device-active-grab-to-deliver-touch-e.patch create mode 100644 0002-dri2-Sync-i965_pci_ids.h-from-mesa.patch create mode 100644 0003-xwayland-Update-screen-pixmap-on-output-resize.patch create mode 100644 0004-xwayland-Expand-the-RANDR-screen-size-limits.patch create mode 100644 0005-xwayland-Do-not-free-a-NULL-GBM-bo.patch create mode 100644 0006-xsync-Add-resource-inside-of-SyncCreate-export-SyncC.patch create mode 100644 0007-GLX-Add-a-per-client-vendor-mapping.patch create mode 100644 0008-GLX-Use-the-sending-client-for-looking-up-XID-s.patch create mode 100644 0009-GLX-Add-a-function-to-change-a-clients-vendor-list.patch create mode 100644 0010-GLX-Set-GlxServerExports-major-minor-Version.patch create mode 100644 0011-miext-sync-Fix-needless-ABI-change.patch create mode 100644 0012-glx-Fix-previous-context-validation-in-xorgGlxMakeCu.patch create mode 100644 0013-xwayland-Separate-DamagePtr-into-separate-window-dat.patch create mode 100644 0014-xwayland-Refactor-surface-creation-into-a-separate-f.patch create mode 100644 0015-xwayland-Handle-the-case-of-windows-being-realized-b.patch diff --git a/0001-Xi-Use-current-device-active-grab-to-deliver-touch-e.patch b/0001-Xi-Use-current-device-active-grab-to-deliver-touch-e.patch new file mode 100644 index 0000000..3253151 --- /dev/null +++ b/0001-Xi-Use-current-device-active-grab-to-deliver-touch-e.patch @@ -0,0 +1,76 @@ +From 98e3db2ac43d4a3f13475cb160c8ce0155ac7d61 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= +Date: Fri, 26 Oct 2018 19:52:49 +0200 +Subject: [PATCH xserver 01/15] Xi: Use current device active grab to deliver + touch events if any + +When Retrieving touch delivery data we need to check if we have an active +grab on such device, and in that case use it to delivery events. +If we don't do this, when rejecting the touch events in DeactivatePointerGrab, +we will end-up in creating an implicit grab that will change the device +deviceGrab's state, causing a recursion during TouchEndTouch. + +Fixes #7 + +https://bugs.freedesktop.org/show_bug.cgi?id=96536 +(cherry picked from commit 35e5a76cc1d02801fadd49d12e60664b02e4bebc) +--- + Xi/exevents.c | 21 ++++++++------------- + 1 file changed, 8 insertions(+), 13 deletions(-) + +diff --git a/Xi/exevents.c b/Xi/exevents.c +index 17d751e31..659816a46 100644 +--- a/Xi/exevents.c ++++ b/Xi/exevents.c +@@ -1293,14 +1293,21 @@ RetrieveTouchDeliveryData(DeviceIntPtr dev, TouchPointInfoPtr ti, + int rc; + InputClients *iclients = NULL; + *mask = NULL; ++ *grab = NULL; + + if (listener->type == LISTENER_GRAB || + listener->type == LISTENER_POINTER_GRAB) { +- + *grab = listener->grab; + + BUG_RETURN_VAL(!*grab, FALSE); ++ } ++ else if (ti->emulate_pointer && dev->deviceGrab.grab && ++ !dev->deviceGrab.fromPassiveGrab) { ++ /* There may be an active pointer grab on the device */ ++ *grab = dev->deviceGrab.grab; ++ } + ++ if (*grab) { + *client = rClient(*grab); + *win = (*grab)->window; + *mask = (*grab)->xi2mask; +@@ -1357,8 +1364,6 @@ RetrieveTouchDeliveryData(DeviceIntPtr dev, TouchPointInfoPtr ti, + /* if owner selected, oclients is NULL */ + *client = oclients ? rClient(oclients) : wClient(*win); + } +- +- *grab = NULL; + } + + return TRUE; +@@ -1498,16 +1503,6 @@ DeliverEmulatedMotionEvent(DeviceIntPtr dev, TouchPointInfoPtr ti, + &mask)) + return; + +- /* There may be a pointer grab on the device */ +- if (!grab) { +- grab = dev->deviceGrab.grab; +- if (grab) { +- win = grab->window; +- mask = grab->xi2mask; +- client = rClient(grab); +- } +- } +- + DeliverTouchEmulatedEvent(dev, ti, (InternalEvent*)&motion, &ti->listeners[0], client, + win, grab, mask); + } +-- +2.21.0 + diff --git a/0002-dri2-Sync-i965_pci_ids.h-from-mesa.patch b/0002-dri2-Sync-i965_pci_ids.h-from-mesa.patch new file mode 100644 index 0000000..c861390 --- /dev/null +++ b/0002-dri2-Sync-i965_pci_ids.h-from-mesa.patch @@ -0,0 +1,136 @@ +From 1804e7327113d128ac9a759da55fd3de0b9f8c35 Mon Sep 17 00:00:00 2001 +From: Matt Roper +Date: Wed, 26 Jun 2019 09:34:46 -0700 +Subject: [PATCH xserver 02/15] dri2: Sync i965_pci_ids.h from mesa + +Copied from Mesa with no modifications. + +This update brings in a significant number of new platform ID's. + +Syncs with mesa up to commit e334a595e ("intel/icl: Add new ICL +PCI-IDs"). + +Signed-off-by: Matt Roper +(cherry picked from commit a8d9ebeb43583e8d8ef182ac15adbdce256d4867) +--- + hw/xfree86/dri2/pci_ids/i965_pci_ids.h | 53 +++++++++++++++++++++----- + 1 file changed, 43 insertions(+), 10 deletions(-) + +diff --git a/hw/xfree86/dri2/pci_ids/i965_pci_ids.h b/hw/xfree86/dri2/pci_ids/i965_pci_ids.h +index 1ef1a0edf..646df447b 100644 +--- a/hw/xfree86/dri2/pci_ids/i965_pci_ids.h ++++ b/hw/xfree86/dri2/pci_ids/i965_pci_ids.h +@@ -1,3 +1,4 @@ ++#ifndef IRIS + CHIPSET(0x29A2, i965, "Intel(R) 965G") + CHIPSET(0x2992, i965, "Intel(R) 965Q") + CHIPSET(0x2982, i965, "Intel(R) 965G") +@@ -91,6 +92,11 @@ CHIPSET(0x0F32, byt, "Intel(R) Bay Trail") + CHIPSET(0x0F33, byt, "Intel(R) Bay Trail") + CHIPSET(0x0157, byt, "Intel(R) Bay Trail") + CHIPSET(0x0155, byt, "Intel(R) Bay Trail") ++CHIPSET(0x22B0, chv, "Intel(R) HD Graphics (Cherrytrail)") ++CHIPSET(0x22B1, chv, "Intel(R) HD Graphics XXX (Braswell)") /* Overridden in brw_get_renderer_string */ ++CHIPSET(0x22B2, chv, "Intel(R) HD Graphics (Cherryview)") ++CHIPSET(0x22B3, chv, "Intel(R) HD Graphics (Cherryview)") ++#endif + CHIPSET(0x1602, bdw_gt1, "Intel(R) Broadwell GT1") + CHIPSET(0x1606, bdw_gt1, "Intel(R) Broadwell GT1") + CHIPSET(0x160A, bdw_gt1, "Intel(R) Broadwell GT1") +@@ -109,10 +115,6 @@ CHIPSET(0x162A, bdw_gt3, "Intel(R) Iris Pro P6300 (Broadwell GT3e)") + CHIPSET(0x162B, bdw_gt3, "Intel(R) Iris 6100 (Broadwell GT3)") + CHIPSET(0x162D, bdw_gt3, "Intel(R) Broadwell GT3") + CHIPSET(0x162E, bdw_gt3, "Intel(R) Broadwell GT3") +-CHIPSET(0x22B0, chv, "Intel(R) HD Graphics (Cherrytrail)") +-CHIPSET(0x22B1, chv, "Intel(R) HD Graphics XXX (Braswell)") /* Overridden in brw_get_renderer_string */ +-CHIPSET(0x22B2, chv, "Intel(R) HD Graphics (Cherryview)") +-CHIPSET(0x22B3, chv, "Intel(R) HD Graphics (Cherryview)") + CHIPSET(0x1902, skl_gt1, "Intel(R) HD Graphics 510 (Skylake GT1)") + CHIPSET(0x1906, skl_gt1, "Intel(R) HD Graphics 510 (Skylake GT1)") + CHIPSET(0x190A, skl_gt1, "Intel(R) Skylake GT1") +@@ -156,7 +158,6 @@ CHIPSET(0x5912, kbl_gt2, "Intel(R) HD Graphics 630 (Kaby Lake GT2)") + CHIPSET(0x5916, kbl_gt2, "Intel(R) HD Graphics 620 (Kaby Lake GT2)") + CHIPSET(0x591A, kbl_gt2, "Intel(R) HD Graphics P630 (Kaby Lake GT2)") + CHIPSET(0x591B, kbl_gt2, "Intel(R) HD Graphics 630 (Kaby Lake GT2)") +-CHIPSET(0x591C, kbl_gt2, "Intel(R) Kaby Lake GT2") + CHIPSET(0x591D, kbl_gt2, "Intel(R) HD Graphics P630 (Kaby Lake GT2)") + CHIPSET(0x591E, kbl_gt2, "Intel(R) HD Graphics 615 (Kaby Lake GT2)") + CHIPSET(0x5921, kbl_gt2, "Intel(R) Kabylake GT2F") +@@ -164,13 +165,15 @@ CHIPSET(0x5923, kbl_gt3, "Intel(R) Kabylake GT3") + CHIPSET(0x5926, kbl_gt3, "Intel(R) Iris Plus Graphics 640 (Kaby Lake GT3e)") + CHIPSET(0x5927, kbl_gt3, "Intel(R) Iris Plus Graphics 650 (Kaby Lake GT3e)") + CHIPSET(0x593B, kbl_gt4, "Intel(R) Kabylake GT4") ++CHIPSET(0x591C, kbl_gt2, "Intel(R) Amber Lake (Kabylake) GT2") ++CHIPSET(0x87C0, kbl_gt2, "Intel(R) Amber Lake (Kabylake) GT2") ++CHIPSET(0x87CA, cfl_gt2, "Intel(R) Amber Lake (Coffeelake) GT2") + CHIPSET(0x3184, glk, "Intel(R) UHD Graphics 605 (Geminilake)") + CHIPSET(0x3185, glk_2x6, "Intel(R) UHD Graphics 600 (Geminilake 2x6)") + CHIPSET(0x3E90, cfl_gt1, "Intel(R) UHD Graphics 610 (Coffeelake 2x6 GT1)") + CHIPSET(0x3E93, cfl_gt1, "Intel(R) UHD Graphics 610 (Coffeelake 2x6 GT1)") + CHIPSET(0x3E99, cfl_gt1, "Intel(R) HD Graphics (Coffeelake 2x6 GT1)") +-CHIPSET(0x3EA1, cfl_gt1, "Intel(R) HD Graphics (Coffeelake 2x6 GT1)") +-CHIPSET(0x3EA4, cfl_gt1, "Intel(R) HD Graphics (Coffeelake 2x6 GT1)") ++CHIPSET(0x3E9C, cfl_gt1, "Intel(R) HD Graphics (Coffeelake 2x6 GT1)") + CHIPSET(0x3E91, cfl_gt2, "Intel(R) UHD Graphics 630 (Coffeelake 3x8 GT2)") + CHIPSET(0x3E92, cfl_gt2, "Intel(R) UHD Graphics 630 (Coffeelake 3x8 GT2)") + CHIPSET(0x3E96, cfl_gt2, "Intel(R) HD Graphics (Coffeelake 3x8 GT2)") +@@ -178,14 +181,34 @@ CHIPSET(0x3E98, cfl_gt2, "Intel(R) UHD Graphics 630 (Coffeelake 3x8 GT2)") + CHIPSET(0x3E9A, cfl_gt2, "Intel(R) HD Graphics (Coffeelake 3x8 GT2)") + CHIPSET(0x3E9B, cfl_gt2, "Intel(R) UHD Graphics 630 (Coffeelake 3x8 GT2)") + CHIPSET(0x3E94, cfl_gt2, "Intel(R) HD Graphics (Coffeelake 3x8 GT2)") +-CHIPSET(0x3EA0, cfl_gt2, "Intel(R) HD Graphics (Coffeelake 3x8 GT2)") +-CHIPSET(0x3EA3, cfl_gt2, "Intel(R) HD Graphics (Coffeelake 3x8 GT2)") + CHIPSET(0x3EA9, cfl_gt2, "Intel(R) HD Graphics (Coffeelake 3x8 GT2)") +-CHIPSET(0x3EA2, cfl_gt3, "Intel(R) HD Graphics (Coffeelake 3x8 GT3)") + CHIPSET(0x3EA5, cfl_gt3, "Intel(R) HD Graphics (Coffeelake 3x8 GT3)") + CHIPSET(0x3EA6, cfl_gt3, "Intel(R) HD Graphics (Coffeelake 3x8 GT3)") + CHIPSET(0x3EA7, cfl_gt3, "Intel(R) HD Graphics (Coffeelake 3x8 GT3)") + CHIPSET(0x3EA8, cfl_gt3, "Intel(R) HD Graphics (Coffeelake 3x8 GT3)") ++CHIPSET(0x3EA1, cfl_gt1, "Intel(R) HD Graphics (Whiskey Lake 2x6 GT1)") ++CHIPSET(0x3EA4, cfl_gt1, "Intel(R) HD Graphics (Whiskey Lake 3x8 GT1)") ++CHIPSET(0x3EA0, cfl_gt2, "Intel(R) HD Graphics (Whiskey Lake 3x8 GT2)") ++CHIPSET(0x3EA3, cfl_gt2, "Intel(R) HD Graphics (Whiskey Lake 3x8 GT2)") ++CHIPSET(0x3EA2, cfl_gt3, "Intel(R) HD Graphics (Whiskey Lake 3x8 GT3)") ++CHIPSET(0x9B21, cfl_gt1, "Intel(R) HD Graphics (Comet Lake 2x6 GT1)") ++CHIPSET(0x9BA0, cfl_gt1, "Intel(R) HD Graphics (Comet Lake 2x6 GT1)") ++CHIPSET(0x9BA2, cfl_gt1, "Intel(R) HD Graphics (Comet Lake 2x6 GT1)") ++CHIPSET(0x9BA4, cfl_gt1, "Intel(R) HD Graphics (Comet Lake 2x6 GT1)") ++CHIPSET(0x9BA5, cfl_gt1, "Intel(R) HD Graphics (Comet Lake 2x6 GT1)") ++CHIPSET(0x9BA8, cfl_gt1, "Intel(R) HD Graphics (Comet Lake 2x6 GT1)") ++CHIPSET(0x9BAA, cfl_gt1, "Intel(R) HD Graphics (Comet Lake 2x6 GT1)") ++CHIPSET(0x9BAB, cfl_gt1, "Intel(R) HD Graphics (Comet Lake 2x6 GT1)") ++CHIPSET(0x9BAC, cfl_gt1, "Intel(R) HD Graphics (Comet Lake 2x6 GT1)") ++CHIPSET(0x9B41, cfl_gt2, "Intel(R) HD Graphics (Comet Lake 3x8 GT2)") ++CHIPSET(0x9BC0, cfl_gt2, "Intel(R) HD Graphics (Comet Lake 3x8 GT2)") ++CHIPSET(0x9BC2, cfl_gt2, "Intel(R) HD Graphics (Comet Lake 3x8 GT2)") ++CHIPSET(0x9BC4, cfl_gt2, "Intel(R) HD Graphics (Comet Lake 3x8 GT2)") ++CHIPSET(0x9BC5, cfl_gt2, "Intel(R) HD Graphics (Comet Lake 3x8 GT2)") ++CHIPSET(0x9BC8, cfl_gt2, "Intel(R) HD Graphics (Comet Lake 3x8 GT2)") ++CHIPSET(0x9BCA, cfl_gt2, "Intel(R) HD Graphics (Comet Lake 3x8 GT2)") ++CHIPSET(0x9BCB, cfl_gt2, "Intel(R) HD Graphics (Comet Lake 3x8 GT2)") ++CHIPSET(0x9BCC, cfl_gt2, "Intel(R) HD Graphics (Comet Lake 3x8 GT2)") + CHIPSET(0x5A49, cnl_2x8, "Intel(R) HD Graphics (Cannonlake 2x8 GT0.5)") + CHIPSET(0x5A4A, cnl_2x8, "Intel(R) HD Graphics (Cannonlake 2x8 GT0.5)") + CHIPSET(0x5A41, cnl_3x8, "Intel(R) HD Graphics (Cannonlake 3x8 GT1)") +@@ -201,8 +224,18 @@ CHIPSET(0x5A54, cnl_5x8, "Intel(R) HD Graphics (Cannonlake 5x8 GT2)") + CHIPSET(0x8A50, icl_8x8, "Intel(R) HD Graphics (Ice Lake 8x8 GT2)") + CHIPSET(0x8A51, icl_8x8, "Intel(R) HD Graphics (Ice Lake 8x8 GT2)") + CHIPSET(0x8A52, icl_8x8, "Intel(R) HD Graphics (Ice Lake 8x8 GT2)") ++CHIPSET(0x8A53, icl_8x8, "Intel(R) HD Graphics (Ice Lake 8x8 GT2)") ++CHIPSET(0x8A54, icl_6x8, "Intel(R) HD Graphics (Ice Lake 6x8 GT1.5)") ++CHIPSET(0x8A56, icl_4x8, "Intel(R) HD Graphics (Ice Lake 4x8 GT1)") ++CHIPSET(0x8A57, icl_6x8, "Intel(R) HD Graphics (Ice Lake 6x8 GT1.5)") ++CHIPSET(0x8A58, icl_4x8, "Intel(R) HD Graphics (Ice Lake 4x8 GT1)") ++CHIPSET(0x8A59, icl_6x8, "Intel(R) HD Graphics (Ice Lake 6x8 GT1.5)") + CHIPSET(0x8A5A, icl_6x8, "Intel(R) HD Graphics (Ice Lake 6x8 GT1.5)") + CHIPSET(0x8A5B, icl_4x8, "Intel(R) HD Graphics (Ice Lake 4x8 GT1)") + CHIPSET(0x8A5C, icl_6x8, "Intel(R) HD Graphics (Ice Lake 6x8 GT1.5)") + CHIPSET(0x8A5D, icl_4x8, "Intel(R) HD Graphics (Ice Lake 4x8 GT1)") + CHIPSET(0x8A71, icl_1x8, "Intel(R) HD Graphics (Ice Lake 1x8 GT0.5)") ++CHIPSET(0x4500, ehl_4x8, "Intel(R) HD Graphics (Elkhart Lake 4x8)") ++CHIPSET(0x4571, ehl_4x8, "Intel(R) HD Graphics (Elkhart Lake 4x8)") ++CHIPSET(0x4551, ehl_4x4, "Intel(R) HD Graphics (Elkhart Lake 4x4)") ++CHIPSET(0x4541, ehl_2x4, "Intel(R) HD Graphics (Elkhart Lake 2x4)") +-- +2.21.0 + diff --git a/0003-xwayland-Update-screen-pixmap-on-output-resize.patch b/0003-xwayland-Update-screen-pixmap-on-output-resize.patch new file mode 100644 index 0000000..7aac779 --- /dev/null +++ b/0003-xwayland-Update-screen-pixmap-on-output-resize.patch @@ -0,0 +1,80 @@ +From 44c693f45d6abd6f7f3bd2f756d35811db143af7 Mon Sep 17 00:00:00 2001 +From: Olivier Fourdan +Date: Fri, 28 Jun 2019 16:55:11 +0200 +Subject: [PATCH xserver 03/15] xwayland: Update screen pixmap on output resize +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Running Xwayland non-rootless and resizing the output would lead to a +crash while trying to update the larger areas of the root window. + +Make sure we resize the backing pixmap according to the new output size +to avoid the crash. + +Signed-off-by: Olivier Fourdan +Closes: https://gitlab.freedesktop.org/xorg/xserver/issues/834 +Reviewed-by: Michel Dänzer +(cherry picked from commit ce9455b5ee389b100a9b7da76b79690d97211b7a) +--- + hw/xwayland/xwayland-output.c | 37 +++++++++++++++++++++++++++++++++++ + 1 file changed, 37 insertions(+) + +diff --git a/hw/xwayland/xwayland-output.c b/hw/xwayland/xwayland-output.c +index cc68f0340..9d33ed862 100644 +--- a/hw/xwayland/xwayland-output.c ++++ b/hw/xwayland/xwayland-output.c +@@ -171,6 +171,40 @@ approximate_mmpd(struct xwl_screen *xwl_screen) + return 25.4 / DEFAULT_DPI; + } + ++static int ++xwl_set_pixmap_visit_window(WindowPtr window, void *data) ++{ ++ ScreenPtr screen = window->drawable.pScreen; ++ ++ if (screen->GetWindowPixmap(window) == data) { ++ screen->SetWindowPixmap(window, screen->GetScreenPixmap(screen)); ++ return WT_WALKCHILDREN; ++ } ++ ++ return WT_DONTWALKCHILDREN; ++} ++ ++static void ++update_backing_pixmaps(struct xwl_screen *xwl_screen, int width, int height) ++{ ++ ScreenPtr pScreen = xwl_screen->screen; ++ WindowPtr pRoot = pScreen->root; ++ PixmapPtr old_pixmap, new_pixmap; ++ ++ old_pixmap = pScreen->GetScreenPixmap(pScreen); ++ new_pixmap = pScreen->CreatePixmap(pScreen, width, height, ++ pScreen->rootDepth, ++ CREATE_PIXMAP_USAGE_BACKING_PIXMAP); ++ pScreen->SetScreenPixmap(new_pixmap); ++ ++ if (old_pixmap) { ++ TraverseTree(pRoot, xwl_set_pixmap_visit_window, old_pixmap); ++ pScreen->DestroyPixmap(old_pixmap); ++ } ++ ++ pScreen->ResizeWindow(pRoot, 0, 0, width, height, NULL); ++} ++ + static void + update_screen_size(struct xwl_output *xwl_output, int width, int height) + { +@@ -180,6 +214,9 @@ update_screen_size(struct xwl_output *xwl_output, int width, int height) + if (xwl_screen->root_clip_mode == ROOT_CLIP_FULL) + SetRootClip(xwl_screen->screen, ROOT_CLIP_NONE); + ++ if (!xwl_screen->rootless && xwl_screen->screen->root) ++ update_backing_pixmaps (xwl_screen, width, height); ++ + xwl_screen->width = width; + xwl_screen->height = height; + xwl_screen->screen->width = width; +-- +2.21.0 + diff --git a/0004-xwayland-Expand-the-RANDR-screen-size-limits.patch b/0004-xwayland-Expand-the-RANDR-screen-size-limits.patch new file mode 100644 index 0000000..066eb45 --- /dev/null +++ b/0004-xwayland-Expand-the-RANDR-screen-size-limits.patch @@ -0,0 +1,36 @@ +From df7ee10d9812897b297c67fde29f0b134ffba3ec Mon Sep 17 00:00:00 2001 +From: Adam Jackson +Date: Mon, 15 Jul 2019 11:38:44 -0400 +Subject: [PATCH xserver 04/15] xwayland: Expand the RANDR screen size limits +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +There's not really a good way to query this from the wayland server, so +just set the maximum to the X11 protocol limits. While we're at it, +lower the minimum screen size to something implausibly small too, just +in case. + +Fixes: xorg/xserver#850 +Reviewed-by: Michel Dänzer +(cherry picked from commit d0850241c6218f61127c45c2f95d6e791c3fea44) +--- + hw/xwayland/xwayland-output.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/hw/xwayland/xwayland-output.c b/hw/xwayland/xwayland-output.c +index 9d33ed862..aa6f37864 100644 +--- a/hw/xwayland/xwayland-output.c ++++ b/hw/xwayland/xwayland-output.c +@@ -476,7 +476,7 @@ xwl_screen_init_output(struct xwl_screen *xwl_screen) + if (!RRScreenInit(xwl_screen->screen)) + return FALSE; + +- RRScreenSetSizeRange(xwl_screen->screen, 320, 200, 8192, 8192); ++ RRScreenSetSizeRange(xwl_screen->screen, 16, 16, 32767, 32767); + + rp = rrGetScrPriv(xwl_screen->screen); + rp->rrGetInfo = xwl_randr_get_info; +-- +2.21.0 + diff --git a/0005-xwayland-Do-not-free-a-NULL-GBM-bo.patch b/0005-xwayland-Do-not-free-a-NULL-GBM-bo.patch new file mode 100644 index 0000000..fd50a63 --- /dev/null +++ b/0005-xwayland-Do-not-free-a-NULL-GBM-bo.patch @@ -0,0 +1,56 @@ +From dfd51be3ca2a244bbca27a95310b60e0c14940df Mon Sep 17 00:00:00 2001 +From: Olivier Fourdan +Date: Tue, 23 Jul 2019 11:01:47 +0200 +Subject: [PATCH xserver 05/15] xwayland: Do not free a NULL GBM bo +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Both `gbm_bo_create()` and `gbm_bo_create_with_modifiers()` can fail and +return `NULL`. + +If that occurs, `xwl_glamor_gbm_create_pixmap()` will not create a +pixmap for the (NULL) GBM bo, but would still try to free the bo which +leads to a crash in mesa: + + [...] + #7 + #8 in gbm_bo_destroy (bo=0x0) at ../src/gbm/main/gbm.c:439 + #9 in xwl_glamor_gbm_create_pixmap () at xwayland-glamor-gbm.c:245 + #10 in ProcCreatePixmap () at dispatch.c:1440 + #11 in Dispatch () at dispatch.c:478 + #12 in dix_main () at main.c:276 + +To avoid the crash, only free the GBM bo if not `NULL`. + +Signed-off-by: Olivier Fourdan +Reviewed-by: Michel Dänzer +Bugzilla: https://bugzilla.redhat.com/1729925 +(cherry picked from commit d9ec525059dbe96fc893c73c0362be2a6dd73e85) +--- + hw/xwayland/xwayland-glamor-gbm.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/hw/xwayland/xwayland-glamor-gbm.c b/hw/xwayland/xwayland-glamor-gbm.c +index 80146ab6e..291e060cf 100644 +--- a/hw/xwayland/xwayland-glamor-gbm.c ++++ b/hw/xwayland/xwayland-glamor-gbm.c +@@ -238,11 +238,12 @@ xwl_glamor_gbm_create_pixmap(ScreenPtr screen, + GBM_BO_USE_SCANOUT | GBM_BO_USE_RENDERING); + } + +- if (bo) ++ if (bo) { + pixmap = xwl_glamor_gbm_create_pixmap_for_bo(screen, bo, depth); + +- if (!pixmap) +- gbm_bo_destroy(bo); ++ if (!pixmap) ++ gbm_bo_destroy(bo); ++ } + } + + if (!pixmap) +-- +2.21.0 + diff --git a/0006-xsync-Add-resource-inside-of-SyncCreate-export-SyncC.patch b/0006-xsync-Add-resource-inside-of-SyncCreate-export-SyncC.patch new file mode 100644 index 0000000..0e21998 --- /dev/null +++ b/0006-xsync-Add-resource-inside-of-SyncCreate-export-SyncC.patch @@ -0,0 +1,244 @@ +From 82f01ad7869e3f2be51e41a8246dab5982bbc36a Mon Sep 17 00:00:00 2001 +From: Alex Goins +Date: Wed, 10 Apr 2019 13:48:02 -0500 +Subject: [PATCH xserver 06/15] xsync: Add resource inside of SyncCreate, + export SyncCreate + +As shown by DRI3 adding the SyncCreateFenceFromFD() function, extensions may +want to create a fence, then initialize it in their own way. This currently +can't be done without adding a function directly to Xext/sync.c due to the fact +that the RTFence resource type is private and there is no external interface to +add to it. + +To facilitate other X extensions creating fences and initializing them, this +change exports SyncCreate() and adds the resource directly within it. Callers no +longer need to call AddResource() after SyncCreate(), they only need to +initialize the SyncObject. + +To prevent FreeFence() and FreeCounter() from segfaulting if the call to +AddResource() fails before the sync object is initialized, this adds a new +'initialized' parameter to SyncObject that, when FALSE, causes FreeFence() and +FreeCounter() to skip de-initialization and simply free the object. +Initialization after adding the resource shouldn't otherwise be a problem due to +the single-threaded nature of X. + +Signed-off-by: Alex Goins +Reviewed-by: James Jones +Signed-off-by: Aaron Plattner +(cherry picked from commit 7f962c70b6d9c346477f23f6c15211e749110078) +--- + Xext/sync.c | 50 +++++++++++++++++++++++------------------- + Xext/syncsdk.h | 3 +++ + miext/sync/misync.c | 27 +++++++++++++---------- + miext/sync/misync.h | 1 + + miext/sync/misyncstr.h | 5 +++-- + 5 files changed, 51 insertions(+), 35 deletions(-) + +diff --git a/Xext/sync.c b/Xext/sync.c +index 8f22a865b..fd2ceb042 100644 +--- a/Xext/sync.c ++++ b/Xext/sync.c +@@ -881,18 +881,21 @@ SyncChangeAlarmAttributes(ClientPtr client, SyncAlarm * pAlarm, Mask mask, + return Success; + } + +-static SyncObject * ++SyncObject * + SyncCreate(ClientPtr client, XID id, unsigned char type) + { + SyncObject *pSync; ++ RESTYPE resType; + + switch (type) { + case SYNC_COUNTER: + pSync = malloc(sizeof(SyncCounter)); ++ resType = RTCounter; + break; + case SYNC_FENCE: + pSync = (SyncObject *) dixAllocateObjectWithPrivates(SyncFence, + PRIVATE_SYNC_FENCE); ++ resType = RTFence; + break; + default: + return NULL; +@@ -901,6 +904,11 @@ SyncCreate(ClientPtr client, XID id, unsigned char type) + if (!pSync) + return NULL; + ++ pSync->initialized = FALSE; ++ ++ if (!AddResource(id, resType, (void *) pSync)) ++ return NULL; ++ + pSync->client = client; + pSync->id = id; + pSync->pTriglist = NULL; +@@ -923,13 +931,10 @@ SyncCreateFenceFromFD(ClientPtr client, DrawablePtr pDraw, XID id, int fd, BOOL + + status = miSyncInitFenceFromFD(pDraw, pFence, fd, initially_triggered); + if (status != Success) { +- dixFreeObjectWithPrivates(pFence, PRIVATE_SYNC_FENCE); ++ FreeResource(pFence->sync.id, RT_NONE); + return status; + } + +- if (!AddResource(id, RTFence, (void *) pFence)) +- return BadAlloc; +- + return Success; + #else + return BadImplementation; +@@ -957,8 +962,7 @@ SyncCreateCounter(ClientPtr client, XSyncCounter id, int64_t initialvalue) + pCounter->value = initialvalue; + pCounter->pSysCounterInfo = NULL; + +- if (!AddResource(id, RTCounter, (void *) pCounter)) +- return NULL; ++ pCounter->sync.initialized = TRUE; + + return pCounter; + } +@@ -1137,21 +1141,26 @@ static int + FreeCounter(void *env, XID id) + { + SyncCounter *pCounter = (SyncCounter *) env; +- SyncTriggerList *ptl, *pnext; + + pCounter->sync.beingDestroyed = TRUE; +- /* tell all the counter's triggers that the counter has been destroyed */ +- for (ptl = pCounter->sync.pTriglist; ptl; ptl = pnext) { +- (*ptl->pTrigger->CounterDestroyed) (ptl->pTrigger); +- pnext = ptl->next; +- free(ptl); /* destroy the trigger list as we go */ +- } +- if (IsSystemCounter(pCounter)) { +- xorg_list_del(&pCounter->pSysCounterInfo->entry); +- free(pCounter->pSysCounterInfo->name); +- free(pCounter->pSysCounterInfo->private); +- free(pCounter->pSysCounterInfo); ++ ++ if (pCounter->sync.initialized) { ++ SyncTriggerList *ptl, *pnext; ++ ++ /* tell all the counter's triggers that counter has been destroyed */ ++ for (ptl = pCounter->sync.pTriglist; ptl; ptl = pnext) { ++ (*ptl->pTrigger->CounterDestroyed) (ptl->pTrigger); ++ pnext = ptl->next; ++ free(ptl); /* destroy the trigger list as we go */ ++ } ++ if (IsSystemCounter(pCounter)) { ++ xorg_list_del(&pCounter->pSysCounterInfo->entry); ++ free(pCounter->pSysCounterInfo->name); ++ free(pCounter->pSysCounterInfo->private); ++ free(pCounter->pSysCounterInfo); ++ } + } ++ + free(pCounter); + return Success; + } +@@ -1889,9 +1898,6 @@ ProcSyncCreateFence(ClientPtr client) + + miSyncInitFence(pDraw->pScreen, pFence, stuff->initially_triggered); + +- if (!AddResource(stuff->fid, RTFence, (void *) pFence)) +- return BadAlloc; +- + return Success; + } + +diff --git a/Xext/syncsdk.h b/Xext/syncsdk.h +index f1b99d010..c88285cb1 100644 +--- a/Xext/syncsdk.h ++++ b/Xext/syncsdk.h +@@ -29,6 +29,9 @@ + extern _X_EXPORT int + SyncVerifyFence(SyncFence ** ppFence, XID fid, ClientPtr client, Mask mode); + ++extern _X_EXPORT SyncObject* ++ SyncCreate(ClientPtr client, XID id, unsigned char type); ++ + #define VERIFY_SYNC_FENCE(pFence, fid, client, mode) \ + do { \ + int rc; \ +diff --git a/miext/sync/misync.c b/miext/sync/misync.c +index 490fa0b17..0931803f6 100644 +--- a/miext/sync/misync.c ++++ b/miext/sync/misync.c +@@ -101,24 +101,29 @@ miSyncInitFence(ScreenPtr pScreen, SyncFence * pFence, Bool initially_triggered) + pFence->funcs = miSyncFenceFuncs; + + pScreenPriv->funcs.CreateFence(pScreen, pFence, initially_triggered); ++ ++ pFence->sync.initialized = TRUE; + } + + void + miSyncDestroyFence(SyncFence * pFence) + { +- ScreenPtr pScreen = pFence->pScreen; +- SyncScreenPrivPtr pScreenPriv = SYNC_SCREEN_PRIV(pScreen); +- SyncTriggerList *ptl, *pNext; +- + pFence->sync.beingDestroyed = TRUE; +- /* tell all the fence's triggers that the counter has been destroyed */ +- for (ptl = pFence->sync.pTriglist; ptl; ptl = pNext) { +- (*ptl->pTrigger->CounterDestroyed) (ptl->pTrigger); +- pNext = ptl->next; +- free(ptl); /* destroy the trigger list as we go */ +- } + +- pScreenPriv->funcs.DestroyFence(pScreen, pFence); ++ if (pFence->sync.initialized) { ++ ScreenPtr pScreen = pFence->pScreen; ++ SyncScreenPrivPtr pScreenPriv = SYNC_SCREEN_PRIV(pScreen); ++ SyncTriggerList *ptl, *pNext; ++ ++ /* tell all the fence's triggers that the counter has been destroyed */ ++ for (ptl = pFence->sync.pTriglist; ptl; ptl = pNext) { ++ (*ptl->pTrigger->CounterDestroyed) (ptl->pTrigger); ++ pNext = ptl->next; ++ free(ptl); /* destroy the trigger list as we go */ ++ } ++ ++ pScreenPriv->funcs.DestroyFence(pScreen, pFence); ++ } + + dixFreeObjectWithPrivates(pFence, PRIVATE_SYNC_FENCE); + } +diff --git a/miext/sync/misync.h b/miext/sync/misync.h +index dc78c5fdb..f7082d5ea 100644 +--- a/miext/sync/misync.h ++++ b/miext/sync/misync.h +@@ -28,6 +28,7 @@ + #ifndef _MISYNC_H_ + #define _MISYNC_H_ + ++typedef struct _SyncObject SyncObject; + typedef struct _SyncFence SyncFence; + typedef struct _SyncTrigger SyncTrigger; + +diff --git a/miext/sync/misyncstr.h b/miext/sync/misyncstr.h +index 2eab2aa57..2a6e84a96 100644 +--- a/miext/sync/misyncstr.h ++++ b/miext/sync/misyncstr.h +@@ -38,13 +38,14 @@ + #define SYNC_COUNTER 0 + #define SYNC_FENCE 1 + +-typedef struct _SyncObject { ++struct _SyncObject { + ClientPtr client; /* Owning client. 0 for system counters */ + struct _SyncTriggerList *pTriglist; /* list of triggers */ + XID id; /* resource ID */ + unsigned char type; /* SYNC_* */ ++ Bool initialized; /* FALSE if created but not initialized */ + Bool beingDestroyed; /* in process of going away */ +-} SyncObject; ++}; + + typedef struct _SyncCounter { + SyncObject sync; /* Common sync object data */ +-- +2.21.0 + diff --git a/0007-GLX-Add-a-per-client-vendor-mapping.patch b/0007-GLX-Add-a-per-client-vendor-mapping.patch new file mode 100644 index 0000000..47bf2f1 --- /dev/null +++ b/0007-GLX-Add-a-per-client-vendor-mapping.patch @@ -0,0 +1,92 @@ +From 1fdb7cbce538f0b37304a3cfc9fae4ff2fe9ece9 Mon Sep 17 00:00:00 2001 +From: Kyle Brenneman +Date: Thu, 19 Oct 2017 15:14:51 -0600 +Subject: [PATCH xserver 07/15] GLX: Add a per-client vendor mapping. + +Each client now has its own (screen, vendor) mapping. + +Currently, it's just a copy of the global mapping, but later changes will allow +it to change. + +Signed-off-by: Aaron Plattner +Reviewed-by: Aaron Plattner +Reviewed-by: Adam Jackson +(cherry picked from commit 37a36a6b5b887d5c5a17a6931ceba8ad5d1bb6d5) +--- + glx/vndext.c | 11 ++++++++++- + glx/vndserver.h | 5 +++++ + glx/vndservermapping.c | 19 +++++++++++++++---- + 3 files changed, 30 insertions(+), 5 deletions(-) + +diff --git a/glx/vndext.c b/glx/vndext.c +index d7936467b..20c0648cc 100644 +--- a/glx/vndext.c ++++ b/glx/vndext.c +@@ -139,8 +139,17 @@ GlxGetClientData(ClientPtr client) + { + GlxClientPriv *cl = xglvGetClientPrivate(client); + if (cl == NULL) { +- cl = calloc(1, sizeof(GlxClientPriv)); ++ cl = calloc(1, sizeof(GlxClientPriv) ++ + screenInfo.numScreens * sizeof(GlxServerVendor *)); + if (cl != NULL) { ++ int i; ++ ++ cl->vendors = (GlxServerVendor **) (cl + 1); ++ for (i=0; ivendors[i] = GlxGetVendorForScreen(NULL, screenInfo.screens[i]); ++ } ++ + xglvSetClientPrivate(client, cl); + } + } +diff --git a/glx/vndserver.h b/glx/vndserver.h +index a175656ae..78246d212 100644 +--- a/glx/vndserver.h ++++ b/glx/vndserver.h +@@ -57,6 +57,11 @@ typedef struct GlxContextTagInfoRec { + typedef struct GlxClientPrivRec { + GlxContextTagInfo *contextTags; + unsigned int contextTagCount; ++ ++ /** ++ * The vendor handles for each screen. ++ */ ++ GlxServerVendor **vendors; + } GlxClientPriv; + + extern int GlxErrorBase; +diff --git a/glx/vndservermapping.c b/glx/vndservermapping.c +index fd3be92d9..778656bb6 100644 +--- a/glx/vndservermapping.c ++++ b/glx/vndservermapping.c +@@ -187,10 +187,21 @@ Bool GlxSetScreenVendor(ScreenPtr screen, GlxServerVendor *vendor) + + GlxServerVendor *GlxGetVendorForScreen(ClientPtr client, ScreenPtr screen) + { +- GlxScreenPriv *priv = GlxGetScreen(screen); +- if (priv != NULL) { +- return priv->vendor; ++ // Note that the client won't be sending GPU screen numbers, so we don't ++ // need per-client mappings for them. ++ if (client != NULL && !screen->isGPU) { ++ GlxClientPriv *cl = GlxGetClientData(client); ++ if (cl != NULL) { ++ return cl->vendors[screen->myNum]; ++ } else { ++ return NULL; ++ } + } else { +- return NULL; ++ GlxScreenPriv *priv = GlxGetScreen(screen); ++ if (priv != NULL) { ++ return priv->vendor; ++ } else { ++ return NULL; ++ } + } + } +-- +2.21.0 + diff --git a/0008-GLX-Use-the-sending-client-for-looking-up-XID-s.patch b/0008-GLX-Use-the-sending-client-for-looking-up-XID-s.patch new file mode 100644 index 0000000..5daa350 --- /dev/null +++ b/0008-GLX-Use-the-sending-client-for-looking-up-XID-s.patch @@ -0,0 +1,114 @@ +From abeae4a6d356653d50026707ecc2afceac83631e Mon Sep 17 00:00:00 2001 +From: Kyle Brenneman +Date: Wed, 8 May 2019 08:44:54 -0600 +Subject: [PATCH xserver 08/15] GLX: Use the sending client for looking up + XID's + +When GlxGetXIDMap looks up an unknown XID, it will now look up a vendor based +on the screen number for the XID and the client that sent the current request. + +In GlxGetXIDMap, if the XID is for a regular X window, then it won't be in the +(XID -> vendor) mapping, so we have to look up a vendor by screen number. + +With this change, GlxGetXIDMap will use the (screen -> vendor) map for +whichever client sent the current request, instead of using the global +(screen -> vendor) map. + +Since GlxGetXIDMap doesn't take a ClientPtr argument, GlxDispatchRequest will +store the client for the current request in a global variable. That way, the +ABI for GLXVND doesn't need to change. + +v2: Fix an error check in GlxDispatchRequest. + +Signed-off-by: Aaron Plattner +Reviewed-by: Aaron Plattner +Reviewed-by: Adam Jackson +(cherry picked from commit 8b67ec7cc6fda243480a5a8ca118b66242f3eb2c) +--- + glx/vndcmds.c | 13 +++++++++++-- + glx/vndserver.h | 7 +++++++ + glx/vndservermapping.c | 12 ++++++++---- + 3 files changed, 26 insertions(+), 6 deletions(-) + +diff --git a/glx/vndcmds.c b/glx/vndcmds.c +index f0779d14a..21c6fef9e 100644 +--- a/glx/vndcmds.c ++++ b/glx/vndcmds.c +@@ -468,15 +468,24 @@ void GlxDispatchReset(void) + int GlxDispatchRequest(ClientPtr client) + { + REQUEST(xReq); ++ int result; ++ + if (GlxExtensionEntry->base == 0) + return BadRequest; ++ ++ GlxSetRequestClient(client); ++ + if (stuff->data < OPCODE_ARRAY_LEN) { + if (dispatchFuncs[stuff->data] == NULL) { + // Try to find a dispatch stub. + dispatchFuncs[stuff->data] = GetVendorDispatchFunc(stuff->data, 0); + } +- return dispatchFuncs[stuff->data](client); ++ result = dispatchFuncs[stuff->data](client); + } else { +- return dispatch_GLXSingle(client); ++ result = dispatch_GLXSingle(client); + } ++ ++ GlxSetRequestClient(NULL); ++ ++ return result; + } +diff --git a/glx/vndserver.h b/glx/vndserver.h +index 78246d212..613fef0fe 100644 +--- a/glx/vndserver.h ++++ b/glx/vndserver.h +@@ -95,6 +95,13 @@ Bool GlxAddXIDMap(XID id, GlxServerVendor *vendor); + GlxServerVendor * GlxGetXIDMap(XID id); + void GlxRemoveXIDMap(XID id); + ++/** ++ * Records the client that sent the current request. This is needed in ++ * GlxGetXIDMap to know which client's (screen -> vendor) mapping to use for a ++ * regular X window. ++ */ ++void GlxSetRequestClient(ClientPtr client); ++ + GlxContextTagInfo *GlxAllocContextTag(ClientPtr client, GlxServerVendor *vendor); + GlxContextTagInfo *GlxLookupContextTag(ClientPtr client, GLXContextTag tag); + void GlxFreeContextTag(GlxContextTagInfo *tagInfo); +diff --git a/glx/vndservermapping.c b/glx/vndservermapping.c +index 778656bb6..4efab8b81 100644 +--- a/glx/vndservermapping.c ++++ b/glx/vndservermapping.c +@@ -33,6 +33,13 @@ + + #include "vndservervendor.h" + ++static ClientPtr requestClient = NULL; ++ ++void GlxSetRequestClient(ClientPtr client) ++{ ++ requestClient = client; ++} ++ + static GlxServerVendor *LookupXIDMapResource(XID id) + { + void *ptr = NULL; +@@ -59,10 +66,7 @@ GlxServerVendor *GlxGetXIDMap(XID id) + DixGetAttrAccess); + if (rv == Success && ptr != NULL) { + DrawablePtr draw = (DrawablePtr) ptr; +- GlxScreenPriv *screenPriv = GlxGetScreen(draw->pScreen); +- if (screenPriv != NULL) { +- vendor = screenPriv->vendor; +- } ++ vendor = GlxGetVendorForScreen(requestClient, draw->pScreen); + } + } + return vendor; +-- +2.21.0 + diff --git a/0009-GLX-Add-a-function-to-change-a-clients-vendor-list.patch b/0009-GLX-Add-a-function-to-change-a-clients-vendor-list.patch new file mode 100644 index 0000000..961ac10 --- /dev/null +++ b/0009-GLX-Add-a-function-to-change-a-clients-vendor-list.patch @@ -0,0 +1,114 @@ +From d3034ef2f5121d85ae766a73fda4e523399043a9 Mon Sep 17 00:00:00 2001 +From: Kyle Brenneman +Date: Thu, 2 May 2019 07:17:21 -0600 +Subject: [PATCH xserver 09/15] GLX: Add a function to change a clients vendor + list. + +Add a new function, GlxServerExports::setClientScreenVendor, which will change +the vendor that handles GLX requests for a screen, but only for requests from +a specific client. + +v2: Increment the GLXVND minor version number. +v3: Note the GLXVND version requirement for setClientScreenVendor. + +Signed-off-by: Aaron Plattner +Reviewed-by: Aaron Plattner +Reviewed-by: Adam Jackson +(cherry picked from commit 56c0a71fdd94a008e5d746261f70a713c4767f93) +--- + glx/vndext.c | 1 + + glx/vndserver.h | 1 + + glx/vndservermapping.c | 21 +++++++++++++++++++++ + include/glxvndabi.h | 13 ++++++++++++- + 4 files changed, 35 insertions(+), 1 deletion(-) + +diff --git a/glx/vndext.c b/glx/vndext.c +index 20c0648cc..582e60b6e 100644 +--- a/glx/vndext.c ++++ b/glx/vndext.c +@@ -324,6 +324,7 @@ _X_EXPORT const GlxServerExports glxServer = { + .getContextTagPrivate = GlxGetContextTagPrivate, + .getVendorForScreen = GlxGetVendorForScreen, + .forwardRequest = GlxForwardRequest, ++ .setClientScreenVendor = GlxSetClientScreenVendor, + }; + + const GlxServerExports * +diff --git a/glx/vndserver.h b/glx/vndserver.h +index 613fef0fe..772b458a1 100644 +--- a/glx/vndserver.h ++++ b/glx/vndserver.h +@@ -107,6 +107,7 @@ GlxContextTagInfo *GlxLookupContextTag(ClientPtr client, GLXContextTag tag); + void GlxFreeContextTag(GlxContextTagInfo *tagInfo); + + Bool GlxSetScreenVendor(ScreenPtr screen, GlxServerVendor *vendor); ++Bool GlxSetClientScreenVendor(ClientPtr client, ScreenPtr screen, GlxServerVendor *vendor); + GlxScreenPriv *GlxGetScreen(ScreenPtr pScreen); + GlxServerVendor *GlxGetVendorForScreen(ClientPtr client, ScreenPtr screen); + +diff --git a/glx/vndservermapping.c b/glx/vndservermapping.c +index 4efab8b81..04788ffbd 100644 +--- a/glx/vndservermapping.c ++++ b/glx/vndservermapping.c +@@ -189,6 +189,27 @@ Bool GlxSetScreenVendor(ScreenPtr screen, GlxServerVendor *vendor) + return TRUE; + } + ++Bool GlxSetClientScreenVendor(ClientPtr client, ScreenPtr screen, GlxServerVendor *vendor) ++{ ++ GlxClientPriv *cl; ++ ++ if (screen == NULL || screen->isGPU) { ++ return FALSE; ++ } ++ ++ cl = GlxGetClientData(client); ++ if (cl == NULL) { ++ return FALSE; ++ } ++ ++ if (vendor != NULL) { ++ cl->vendors[screen->myNum] = vendor; ++ } else { ++ cl->vendors[screen->myNum] = GlxGetVendorForScreen(NULL, screen); ++ } ++ return TRUE; ++} ++ + GlxServerVendor *GlxGetVendorForScreen(ClientPtr client, ScreenPtr screen) + { + // Note that the client won't be sending GPU screen numbers, so we don't +diff --git a/include/glxvndabi.h b/include/glxvndabi.h +index b78306d23..71f36e722 100644 +--- a/include/glxvndabi.h ++++ b/include/glxvndabi.h +@@ -75,7 +75,7 @@ + * will still work. + */ + #define GLXSERVER_VENDOR_ABI_MAJOR_VERSION 0 +-#define GLXSERVER_VENDOR_ABI_MINOR_VERSION 0 ++#define GLXSERVER_VENDOR_ABI_MINOR_VERSION 1 + + #if defined(__cplusplus) + extern "C" { +@@ -236,6 +236,17 @@ typedef struct GlxServerExportsRec { + * \param client The client. + */ + int (* forwardRequest) (GlxServerVendor *vendor, ClientPtr client); ++ ++ /** ++ * Sets the vendor library to use for a screen for a specific client. ++ * ++ * This function changes which vendor should handle GLX requests for a ++ * screen. Unlike \c setScreenVendor, this function can be called at any ++ * time, and only applies to requests from a single client. ++ * ++ * This function is available in GLXVND version 0.1 or later. ++ */ ++ Bool (* setClientScreenVendor) (ClientPtr client, ScreenPtr screen, GlxServerVendor *vendor); + } GlxServerExports; + + extern _X_EXPORT const GlxServerExports glxServer; +-- +2.21.0 + diff --git a/0010-GLX-Set-GlxServerExports-major-minor-Version.patch b/0010-GLX-Set-GlxServerExports-major-minor-Version.patch new file mode 100644 index 0000000..036950a --- /dev/null +++ b/0010-GLX-Set-GlxServerExports-major-minor-Version.patch @@ -0,0 +1,35 @@ +From 39b3005c329bc63676df72c43529d641bf305bcd Mon Sep 17 00:00:00 2001 +From: Aaron Plattner +Date: Tue, 21 May 2019 10:50:42 -0700 +Subject: [PATCH xserver 10/15] GLX: Set GlxServerExports::{major,minor}Version + +Commit 56c0a71fdd94a008e5d746261f70a713c4767f93 incremented the +GLXSERVER_VENDOR_ABI_MINOR_VERSION define, but this define was not actually +being used to set glxServer.minorVersion. + +Update the initializer for glxServer to use the correct version numbers. + +Signed-off-by: Aaron Plattner +(cherry picked from commit b4231d69028adc8123801a7552b40a15ea928d1b) +--- + glx/vndext.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/glx/vndext.c b/glx/vndext.c +index 582e60b6e..0513733b6 100644 +--- a/glx/vndext.c ++++ b/glx/vndext.c +@@ -304,8 +304,8 @@ GlxFreeServerImports(GlxServerImports *imports) + } + + _X_EXPORT const GlxServerExports glxServer = { +- .majorVersion = 0, +- .minorVersion = 0, ++ .majorVersion = GLXSERVER_VENDOR_ABI_MAJOR_VERSION, ++ .minorVersion = GLXSERVER_VENDOR_ABI_MINOR_VERSION, + + .extensionInitCallback = &vndInitCallbackListPtr, + +-- +2.21.0 + diff --git a/0011-miext-sync-Fix-needless-ABI-change.patch b/0011-miext-sync-Fix-needless-ABI-change.patch new file mode 100644 index 0000000..855dd6a --- /dev/null +++ b/0011-miext-sync-Fix-needless-ABI-change.patch @@ -0,0 +1,39 @@ +From 8449c8623d6208b77e76596e8b10250817d3e8ab Mon Sep 17 00:00:00 2001 +From: Adam Jackson +Date: Mon, 19 Aug 2019 14:27:54 -0400 +Subject: [PATCH xserver 11/15] miext/sync: Fix needless ABI change + +The initialized field was added in: + + commit 82f01ad7869e3f2be51e41a8246dab5982bbc36a + Author: Alex Goins + Date: Wed Apr 10 13:48:02 2019 -0500 + + xsync: Add resource inside of SyncCreate, export SyncCreate + +But it added this field not at the end of SyncObject. It may not have +been _usefully_ possible to create those from another extension prior to +that commit, but that's still an ABI-incompatible change. + +(cherry picked from commit 194ba38728b34a76885275dae153057c8afaf72e) +--- + miext/sync/misyncstr.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/miext/sync/misyncstr.h b/miext/sync/misyncstr.h +index 2a6e84a96..ea48a4519 100644 +--- a/miext/sync/misyncstr.h ++++ b/miext/sync/misyncstr.h +@@ -43,8 +43,8 @@ struct _SyncObject { + struct _SyncTriggerList *pTriglist; /* list of triggers */ + XID id; /* resource ID */ + unsigned char type; /* SYNC_* */ +- Bool initialized; /* FALSE if created but not initialized */ + Bool beingDestroyed; /* in process of going away */ ++ Bool initialized; /* FALSE if created but not initialized */ + }; + + typedef struct _SyncCounter { +-- +2.21.0 + diff --git a/0012-glx-Fix-previous-context-validation-in-xorgGlxMakeCu.patch b/0012-glx-Fix-previous-context-validation-in-xorgGlxMakeCu.patch new file mode 100644 index 0000000..08eae5f --- /dev/null +++ b/0012-glx-Fix-previous-context-validation-in-xorgGlxMakeCu.patch @@ -0,0 +1,40 @@ +From 045add84927051a33569ed701097e1fd514bf0ca Mon Sep 17 00:00:00 2001 +From: Adam Jackson +Date: Fri, 16 Aug 2019 14:56:19 -0400 +Subject: [PATCH xserver 12/15] glx: Fix previous context validation in + xorgGlxMakeCurrent + +vnd has already verified that the context tag is valid before this gets +called, and we only set the context tag private data to non-null for +indirect clients. Mesa happens to be buggy and doesn't send MakeCurrent +requests nearly as much as it should for direct contexts, but if you fix +that, then unbinding a direct context would fail here with +GLXBadContextTag. + +Sadly Mesa will still need to carry a workaround here for broken +servers, but we should still fix the server. + +(cherry picked from commit 95dcc81cb122e5a4c5b38e84ef46eb872b2e1431) +--- + glx/glxcmds.c | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/glx/glxcmds.c b/glx/glxcmds.c +index 54d452e58..75e42823c 100644 +--- a/glx/glxcmds.c ++++ b/glx/glxcmds.c +@@ -574,10 +574,8 @@ xorgGlxMakeCurrent(ClientPtr client, GLXContextTag tag, XID drawId, XID readId, + /* Look up old context. If we have one, it must be in a usable state. */ + if (tag != 0) { + prevglxc = glxServer.getContextTagPrivate(client, tag); +- if (!prevglxc) +- return __glXError(GLXBadContextTag); + +- if (prevglxc->renderMode != GL_RENDER) { ++ if (prevglxc && prevglxc->renderMode != GL_RENDER) { + /* Oops. Not in render mode render. */ + client->errorValue = prevglxc->id; + return __glXError(GLXBadContextState); +-- +2.21.0 + diff --git a/0013-xwayland-Separate-DamagePtr-into-separate-window-dat.patch b/0013-xwayland-Separate-DamagePtr-into-separate-window-dat.patch new file mode 100644 index 0000000..bc1e76d --- /dev/null +++ b/0013-xwayland-Separate-DamagePtr-into-separate-window-dat.patch @@ -0,0 +1,173 @@ +From e0af09061f9e8397ca564ec3bbedea51974455d4 Mon Sep 17 00:00:00 2001 +From: Carlos Garnacho +Date: Mon, 7 Jan 2019 15:20:05 +0100 +Subject: [PATCH xserver 13/15] xwayland: Separate DamagePtr into separate + window data + +This will be dissociated in future commits to handle the cases +where windows are being realized before there is a compositor +handling redirection. + +In that case, we still want the DamagePtr to be registered upfront +on RealizeWindowProc before a corresponding xwl_window might be +created. Most notably, it cannot be lazily created on +SetWindowPixmapProc as damage accounting gets broken. + +Signed-off-by: Carlos Garnacho +(cherry picked from commit 4e50440ae20c537d6a4edf356cda67dd33d4e5a8) +--- + hw/xwayland/xwayland.c | 74 +++++++++++++++++++++++++++++++++--------- + hw/xwayland/xwayland.h | 1 - + 2 files changed, 58 insertions(+), 17 deletions(-) + +diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c +index 7e6e0ab25..1efebd061 100644 +--- a/hw/xwayland/xwayland.c ++++ b/hw/xwayland/xwayland.c +@@ -125,6 +125,7 @@ ddxProcessArgument(int argc, char *argv[], int i) + static DevPrivateKeyRec xwl_window_private_key; + static DevPrivateKeyRec xwl_screen_private_key; + static DevPrivateKeyRec xwl_pixmap_private_key; ++static DevPrivateKeyRec xwl_damage_private_key; + + static struct xwl_window * + xwl_window_get(WindowPtr window) +@@ -367,8 +368,14 @@ xwl_cursor_confined_to(DeviceIntPtr device, + static void + damage_report(DamagePtr pDamage, RegionPtr pRegion, void *data) + { +- struct xwl_window *xwl_window = data; +- struct xwl_screen *xwl_screen = xwl_window->xwl_screen; ++ WindowPtr window = data; ++ struct xwl_window *xwl_window = xwl_window_get(window); ++ struct xwl_screen *xwl_screen; ++ ++ if (!xwl_window) ++ return; ++ ++ xwl_screen = xwl_window->xwl_screen; + + #ifdef GLAMOR_HAS_GBM + if (xwl_window->present_flipped) { +@@ -390,6 +397,47 @@ damage_destroy(DamagePtr pDamage, void *data) + { + } + ++static Bool ++register_damage(WindowPtr window) ++{ ++ DamagePtr damage; ++ ++ damage = DamageCreate(damage_report, damage_destroy, DamageReportNonEmpty, ++ FALSE, window->drawable.pScreen, window); ++ if (damage == NULL) { ++ ErrorF("Failed creating damage\n"); ++ return FALSE; ++ } ++ ++ DamageRegister(&window->drawable, damage); ++ DamageSetReportAfterOp(damage, TRUE); ++ ++ dixSetPrivate(&window->devPrivates, &xwl_damage_private_key, damage); ++ ++ return TRUE; ++} ++ ++static void ++unregister_damage(WindowPtr window) ++{ ++ DamagePtr damage; ++ ++ damage = dixLookupPrivate(&window->devPrivates, &xwl_damage_private_key); ++ if (!damage) ++ return; ++ ++ DamageUnregister(damage); ++ DamageDestroy(damage); ++ ++ dixSetPrivate(&window->devPrivates, &xwl_damage_private_key, NULL); ++} ++ ++static DamagePtr ++window_get_damage(WindowPtr window) ++{ ++ return dixLookupPrivate(&window->devPrivates, &xwl_damage_private_key); ++} ++ + static void + shell_surface_ping(void *data, + struct wl_shell_surface *shell_surface, uint32_t serial) +@@ -545,18 +593,10 @@ xwl_realize_window(WindowPtr window) + + wl_surface_set_user_data(xwl_window->surface, xwl_window); + +- xwl_window->damage = +- DamageCreate(damage_report, damage_destroy, DamageReportNonEmpty, +- FALSE, screen, xwl_window); +- if (xwl_window->damage == NULL) { +- ErrorF("Failed creating damage\n"); +- goto err_surf; +- } +- + compRedirectWindow(serverClient, window, CompositeRedirectManual); + +- DamageRegister(&window->drawable, xwl_window->damage); +- DamageSetReportAfterOp(xwl_window->damage, TRUE); ++ if (!register_damage(window)) ++ goto err_surf; + + dixSetPrivate(&window->devPrivates, &xwl_window_private_key, xwl_window); + xorg_list_init(&xwl_window->link_damage); +@@ -620,8 +660,8 @@ xwl_unrealize_window(WindowPtr window) + + wl_surface_destroy(xwl_window->surface); + xorg_list_del(&xwl_window->link_damage); +- DamageUnregister(xwl_window->damage); +- DamageDestroy(xwl_window->damage); ++ unregister_damage(window); ++ + if (xwl_window->frame_callback) + wl_callback_destroy(xwl_window->frame_callback); + +@@ -689,7 +729,7 @@ xwl_window_post_damage(struct xwl_window *xwl_window) + + assert(!xwl_window->frame_callback); + +- region = DamageRegion(xwl_window->damage); ++ region = DamageRegion(window_get_damage(xwl_window->window)); + pixmap = (*xwl_screen->screen->GetWindowPixmap) (xwl_window->window); + + #ifdef XWL_HAS_GLAMOR +@@ -726,7 +766,7 @@ xwl_window_post_damage(struct xwl_window *xwl_window) + wl_callback_add_listener(xwl_window->frame_callback, &frame_listener, xwl_window); + + wl_surface_commit(xwl_window->surface); +- DamageEmpty(xwl_window->damage); ++ DamageEmpty(window_get_damage(xwl_window->window)); + + xorg_list_del(&xwl_window->link_damage); + } +@@ -962,6 +1002,8 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) + return FALSE; + if (!dixRegisterPrivateKey(&xwl_pixmap_private_key, PRIVATE_PIXMAP, 0)) + return FALSE; ++ if (!dixRegisterPrivateKey(&xwl_damage_private_key, PRIVATE_WINDOW, 0)) ++ return FALSE; + + dixSetPrivate(&pScreen->devPrivates, &xwl_screen_private_key, xwl_screen); + xwl_screen->screen = pScreen; +diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h +index 463622669..dfa3b37c3 100644 +--- a/hw/xwayland/xwayland.h ++++ b/hw/xwayland/xwayland.h +@@ -178,7 +178,6 @@ struct xwl_window { + struct wl_surface *surface; + struct wl_shell_surface *shell_surface; + WindowPtr window; +- DamagePtr damage; + struct xorg_list link_damage; + struct wl_callback *frame_callback; + Bool allow_commits; +-- +2.21.0 + diff --git a/0014-xwayland-Refactor-surface-creation-into-a-separate-f.patch b/0014-xwayland-Refactor-surface-creation-into-a-separate-f.patch new file mode 100644 index 0000000..f8fff3f --- /dev/null +++ b/0014-xwayland-Refactor-surface-creation-into-a-separate-f.patch @@ -0,0 +1,125 @@ +From 12db645c7fc0539752a881df7ac2bcd09e3cb17b Mon Sep 17 00:00:00 2001 +From: Carlos Garnacho +Date: Mon, 7 Jan 2019 15:33:31 +0100 +Subject: [PATCH xserver 14/15] xwayland: Refactor surface creation into a + separate function + +This is just called from xwl_window_realize() ATM, but will be useful in +future commits. + +Signed-off-by: Carlos Garnacho +(cherry picked from commit c2e8ae964052944312c5023ca7ea5c41a92990e5) +--- + hw/xwayland/xwayland.c | 64 ++++++++++++++++++++++++++++-------------- + 1 file changed, 43 insertions(+), 21 deletions(-) + +diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c +index 1efebd061..9a4b52fa9 100644 +--- a/hw/xwayland/xwayland.c ++++ b/hw/xwayland/xwayland.c +@@ -518,36 +518,25 @@ send_surface_id_event(struct xwl_window *xwl_window) + } + + static Bool +-xwl_realize_window(WindowPtr window) ++ensure_surface_for_window(WindowPtr window) + { + ScreenPtr screen = window->drawable.pScreen; + struct xwl_screen *xwl_screen; + struct xwl_window *xwl_window; + struct wl_region *region; +- Bool ret; +- +- xwl_screen = xwl_screen_get(screen); +- +- screen->RealizeWindow = xwl_screen->RealizeWindow; +- ret = (*screen->RealizeWindow) (window); +- xwl_screen->RealizeWindow = screen->RealizeWindow; +- screen->RealizeWindow = xwl_realize_window; + +- if (xwl_screen->rootless && !window->parent) { +- BoxRec box = { 0, 0, xwl_screen->width, xwl_screen->height }; ++ if (xwl_window_get(window)) ++ return TRUE; + +- RegionReset(&window->winSize, &box); +- RegionNull(&window->clipList); +- RegionNull(&window->borderClip); +- } ++ xwl_screen = xwl_screen_get(screen); + + if (xwl_screen->rootless) { + if (window->redirectDraw != RedirectDrawManual) +- return ret; ++ return TRUE; + } + else { + if (window->parent) +- return ret; ++ return TRUE; + } + + xwl_window = calloc(1, sizeof *xwl_window); +@@ -595,15 +584,12 @@ xwl_realize_window(WindowPtr window) + + compRedirectWindow(serverClient, window, CompositeRedirectManual); + +- if (!register_damage(window)) +- goto err_surf; +- + dixSetPrivate(&window->devPrivates, &xwl_window_private_key, xwl_window); + xorg_list_init(&xwl_window->link_damage); + + xwl_window_init_allow_commits(xwl_window); + +- return ret; ++ return TRUE; + + err_surf: + if (xwl_window->shell_surface) +@@ -614,6 +600,42 @@ err: + return FALSE; + } + ++static Bool ++xwl_realize_window(WindowPtr window) ++{ ++ ScreenPtr screen = window->drawable.pScreen; ++ struct xwl_screen *xwl_screen; ++ Bool ret; ++ ++ xwl_screen = xwl_screen_get(screen); ++ ++ screen->RealizeWindow = xwl_screen->RealizeWindow; ++ ret = (*screen->RealizeWindow) (window); ++ xwl_screen->RealizeWindow = screen->RealizeWindow; ++ screen->RealizeWindow = xwl_realize_window; ++ ++ if (!ret) ++ return FALSE; ++ ++ if (xwl_screen->rootless && !window->parent) { ++ BoxRec box = { 0, 0, xwl_screen->width, xwl_screen->height }; ++ ++ RegionReset(&window->winSize, &box); ++ RegionNull(&window->clipList); ++ RegionNull(&window->borderClip); ++ } ++ ++ if (xwl_screen->rootless ? ++ (window->drawable.class == InputOutput && ++ window->parent == window->drawable.pScreen->root) : ++ !window->parent) { ++ if (!register_damage(window)) ++ return FALSE; ++ } ++ ++ return ensure_surface_for_window(window); ++} ++ + static Bool + xwl_unrealize_window(WindowPtr window) + { +-- +2.21.0 + diff --git a/0015-xwayland-Handle-the-case-of-windows-being-realized-b.patch b/0015-xwayland-Handle-the-case-of-windows-being-realized-b.patch new file mode 100644 index 0000000..86d427c --- /dev/null +++ b/0015-xwayland-Handle-the-case-of-windows-being-realized-b.patch @@ -0,0 +1,91 @@ +From 63346c74393e1df4555f84367529802a67578ef6 Mon Sep 17 00:00:00 2001 +From: Carlos Garnacho +Date: Mon, 7 Jan 2019 15:33:35 +0100 +Subject: [PATCH xserver 15/15] xwayland: Handle the case of windows being + realized before redirection +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +If Xwayland gets to realize a window meant for composition before the +compositor redirected windows (i.e. redirect mode is not RedirectDrawManual +yet), the window would stay "invisible" as we wouldn't create a +wl_surface/wl_shell_surface for it at any later point. + +This scenario may happen if the wayland compositor sets up a X11 socket +upfront, but waits to raise Xwayland until there are X11 clients. In this +case the first data on the socket is the client's, the compositor can hardly +beat that in order to redirect subwindows before the client realizes a +Window. + +In order to jump across this hurdle, allow the late creation of a matching +(shell) surface for the WindowPtr on SetWindowPixmapProc, so it is ensured +to be created after the compositor set up redirection. + +Signed-off-by: Carlos Garnacho +Reviewed-by: Michel Dänzer +Reviewed-by: Olivier Fourdan +(cherry picked from commit 78cc8b6f9613fc71f6ecc7e8848d54364a250634) +--- + hw/xwayland/xwayland.c | 25 +++++++++++++++++++++++++ + hw/xwayland/xwayland.h | 1 + + 2 files changed, 26 insertions(+) + +diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c +index 9a4b52fa9..baa08d87b 100644 +--- a/hw/xwayland/xwayland.c ++++ b/hw/xwayland/xwayland.c +@@ -699,6 +699,26 @@ xwl_save_screen(ScreenPtr pScreen, int on) + return TRUE; + } + ++static void ++xwl_set_window_pixmap(WindowPtr window, ++ PixmapPtr pixmap) ++{ ++ ScreenPtr screen = window->drawable.pScreen; ++ struct xwl_screen *xwl_screen; ++ ++ xwl_screen = xwl_screen_get(screen); ++ ++ screen->SetWindowPixmap = xwl_screen->SetWindowPixmap; ++ (*screen->SetWindowPixmap) (window, pixmap); ++ xwl_screen->SetWindowPixmap = screen->SetWindowPixmap; ++ screen->SetWindowPixmap = xwl_set_window_pixmap; ++ ++ if (!RegionNotEmpty(&window->winSize)) ++ return; ++ ++ ensure_surface_for_window(window); ++} ++ + static void + frame_callback(void *data, + struct wl_callback *callback, +@@ -1185,6 +1205,11 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) + xwl_screen->CloseScreen = pScreen->CloseScreen; + pScreen->CloseScreen = xwl_close_screen; + ++ if (xwl_screen->rootless) { ++ xwl_screen->SetWindowPixmap = pScreen->SetWindowPixmap; ++ pScreen->SetWindowPixmap = xwl_set_window_pixmap; ++ } ++ + pScreen->CursorWarpedTo = xwl_cursor_warped_to; + pScreen->CursorConfinedTo = xwl_cursor_confined_to; + +diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h +index dfa3b37c3..0854df456 100644 +--- a/hw/xwayland/xwayland.h ++++ b/hw/xwayland/xwayland.h +@@ -133,6 +133,7 @@ struct xwl_screen { + UnrealizeWindowProcPtr UnrealizeWindow; + DestroyWindowProcPtr DestroyWindow; + XYToWindowProcPtr XYToWindow; ++ SetWindowPixmapProcPtr SetWindowPixmap; + + struct xorg_list output_list; + struct xorg_list seat_list; +-- +2.21.0 + diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 72b77a0..c850ed6 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -46,7 +46,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.20.5 -Release: 6%{?gitdate:.%{gitdate}}%{?dist} +Release: 7%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org License: MIT @@ -120,6 +120,23 @@ Patch30: 0001-Revert-present-scmd-Check-that-the-flip-and-screen-p.patch # https://gitlab.freedesktop.org/xorg/xserver/issues/840 Patch31: 0001-compiler.h-Do-not-include-sys-io.h-on-ARM-with-glibc.patch +Patch32: 0001-Xi-Use-current-device-active-grab-to-deliver-touch-e.patch +Patch33: 0002-dri2-Sync-i965_pci_ids.h-from-mesa.patch +Patch34: 0003-xwayland-Update-screen-pixmap-on-output-resize.patch +Patch35: 0004-xwayland-Expand-the-RANDR-screen-size-limits.patch +# https://bugzilla.redhat.com/1729925 +Patch36: 0005-xwayland-Do-not-free-a-NULL-GBM-bo.patch +Patch37: 0006-xsync-Add-resource-inside-of-SyncCreate-export-SyncC.patch +Patch38: 0007-GLX-Add-a-per-client-vendor-mapping.patch +Patch39: 0008-GLX-Use-the-sending-client-for-looking-up-XID-s.patch +Patch40: 0009-GLX-Add-a-function-to-change-a-clients-vendor-list.patch +Patch41: 0010-GLX-Set-GlxServerExports-major-minor-Version.patch +Patch42: 0011-miext-sync-Fix-needless-ABI-change.patch +Patch43: 0012-glx-Fix-previous-context-validation-in-xorgGlxMakeCu.patch +Patch44: 0013-xwayland-Separate-DamagePtr-into-separate-window-dat.patch +Patch45: 0014-xwayland-Refactor-surface-creation-into-a-separate-f.patch +Patch46: 0015-xwayland-Handle-the-case-of-windows-being-realized-b.patch + BuildRequires: systemtap-sdt-devel BuildRequires: git BuildRequires: automake autoconf libtool pkgconfig @@ -544,6 +561,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Thu Aug 29 2019 Olivier Fourdan 1.20.5-7 +- Pick latest fixes from xserver stable branch upstream (rhbz#1729925) + * Sat Jul 27 2019 Fedora Release Engineering - 1.20.5-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild From 3ae2631a52a9c2116b43300f1b45895a4df4e59b Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 4 Nov 2019 17:59:36 +0100 Subject: [PATCH 043/131] Backport Xwayland randr resolution change emulation support --- 0001-dix-Add-GetCurrentClient-helper.patch | 115 +++++ ...p_viewport-wayland-extension-support.patch | 118 +++++ ...fer_damage-instead-of-surface-damage.patch | 155 ++++++ ...e-output-modes-to-xrandr-output-mode.patch | 206 ++++++++ ...ayland-Use-RandR-1.2-interface-rev-2.patch | 138 ++++++ ...xwayland-Add-per-client-private-data.patch | 77 +++ ...port-for-storing-per-client-per-outp.patch | 148 ++++++ ...port-for-randr-resolution-change-emu.patch | 461 ++++++++++++++++++ ...lRRModeToDisplayMode-helper-function.patch | 100 ++++ ...VidModeGetCurrentRRMode-helper-to-th.patch | 192 ++++++++ ...mode-mode-changing-emulation-support.patch | 235 +++++++++ ...dow_should_enable_viewport-Add-extra.patch | 56 +++ ...AYLAND_RANDR_EMU_MONITOR_RECTS-prope.patch | 204 ++++++++ ...lated-modes-not-being-removed-when-s.patch | 61 +++ ...l_window_check_resolution_change_emu.patch | 46 ++ ...ting-of-_XWAYLAND_RANDR_EMU_MONITOR_.patch | 65 +++ ...unnecessary-xwl_window_is_toplevel-c.patch | 47 ++ xorg-x11-server.spec | 24 +- 18 files changed, 2447 insertions(+), 1 deletion(-) create mode 100644 0001-dix-Add-GetCurrentClient-helper.patch create mode 100644 0002-xwayland-Add-wp_viewport-wayland-extension-support.patch create mode 100644 0003-xwayland-Use-buffer_damage-instead-of-surface-damage.patch create mode 100644 0004-xwayland-Add-fake-output-modes-to-xrandr-output-mode.patch create mode 100644 0005-xwayland-Use-RandR-1.2-interface-rev-2.patch create mode 100644 0006-xwayland-Add-per-client-private-data.patch create mode 100644 0007-xwayland-Add-support-for-storing-per-client-per-outp.patch create mode 100644 0008-xwayland-Add-support-for-randr-resolution-change-emu.patch create mode 100644 0009-xwayland-Add-xwlRRModeToDisplayMode-helper-function.patch create mode 100644 0010-xwayland-Add-xwlVidModeGetCurrentRRMode-helper-to-th.patch create mode 100644 0011-xwayland-Add-vidmode-mode-changing-emulation-support.patch create mode 100644 0012-xwayland-xwl_window_should_enable_viewport-Add-extra.patch create mode 100644 0013-xwayland-Set-_XWAYLAND_RANDR_EMU_MONITOR_RECTS-prope.patch create mode 100644 0014-xwayland-Fix-emulated-modes-not-being-removed-when-s.patch create mode 100644 0015-xwayland-Call-xwl_window_check_resolution_change_emu.patch create mode 100644 0016-xwayland-Fix-setting-of-_XWAYLAND_RANDR_EMU_MONITOR_.patch create mode 100644 0017-xwayland-Remove-unnecessary-xwl_window_is_toplevel-c.patch diff --git a/0001-dix-Add-GetCurrentClient-helper.patch b/0001-dix-Add-GetCurrentClient-helper.patch new file mode 100644 index 0000000..41ed9e7 --- /dev/null +++ b/0001-dix-Add-GetCurrentClient-helper.patch @@ -0,0 +1,115 @@ +From 7d403201820fb2bdc04bfa8f83c9dd3822c6abda Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Thu, 29 Aug 2019 14:18:28 +0200 +Subject: [PATCH xserver 01/14] dix: Add GetCurrentClient helper +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Request-handlers as registered in the requestVector array, always get +passed the clientPtr for the client which sent the request. +But the implementation of many request-handlers typically consists of +a generic handler calling implementation specific callbacks and / or +various helpers often multiple levels deep and in many cases the clientPtr +does not get passed to the callbacks / helpers. + +This means that in some places where we would like to have access to the +current-client, we cannot easily access it and fixing this would require +a lot of work and often would involve ABI breakage. + +This commit adds a GetCurrentClient helper which can be used as a +shortcut to get access to the clienPtr for the currently being processed +request without needing a lot of refactoring and ABI breakage. + +Note using this new GetCurrentClient helper is only safe for code +which only runs from the main thread, this new variable MUST NOT be used +by code which runs from signal handlers or from the input-thread. + +The specific use-case which resulted in the creation of this patch is adding +support for emulation of randr / vidmode resolution changes to Xwayland. +This emulation will not actually change the monitor resolution instead it +will scale any window with a size which exactly matches the requested +resolution to fill the entire monitor. The main use-case for this is +games which are hard-coded to render at a specific resolution and have +sofar relied on randr / vidmode to change the monitor resolution when going +fullscreen. + +To make this emulation as robust as possible (e.g. avoid accidentally scaling +windows from other apps) we want to make the emulated resolution a per client +state. But e.g. the RRSetCrtc function does not take a client pointer; and is +a (used) part of the Xorg server ABI (note the problem is not just limited +to RRSetCrtc). + +Reviewed-by: Olivier Fourdan +Reviewed-by: Michel Dänzer +Signed-off-by: Hans de Goede +--- + dix/dispatch.c | 23 ++++++++++++++++++++++- + include/dix.h | 1 + + 2 files changed, 23 insertions(+), 1 deletion(-) + +diff --git a/dix/dispatch.c b/dix/dispatch.c +index 176c7a0dd..ce84e6c8c 100644 +--- a/dix/dispatch.c ++++ b/dix/dispatch.c +@@ -148,6 +148,7 @@ xConnSetupPrefix connSetupPrefix; + PaddingInfo PixmapWidthPaddingInfo[33]; + + static ClientPtr grabClient; ++static ClientPtr currentClient; /* Client for the request currently being dispatched */ + + #define GrabNone 0 + #define GrabActive 1 +@@ -176,6 +177,23 @@ volatile char isItTimeToYield; + #define SAME_SCREENS(a, b) (\ + (a.pScreen == b.pScreen)) + ++ClientPtr ++GetCurrentClient(void) ++{ ++ if (in_input_thread()) { ++ static Bool warned; ++ ++ if (!warned) { ++ ErrorF("[dix] Error GetCurrentClient called from input-thread\n"); ++ warned = TRUE; ++ } ++ ++ return NULL; ++ } ++ ++ return currentClient; ++} ++ + void + SetInputCheck(HWEventQueuePtr c0, HWEventQueuePtr c1) + { +@@ -474,9 +492,12 @@ Dispatch(void) + result = BadLength; + else { + result = XaceHookDispatch(client, client->majorOp); +- if (result == Success) ++ if (result == Success) { ++ currentClient = client; + result = + (*client->requestVector[client->majorOp]) (client); ++ currentClient = NULL; ++ } + } + if (!SmartScheduleSignalEnable) + SmartScheduleTime = GetTimeInMillis(); +diff --git a/include/dix.h b/include/dix.h +index b6e2bcfde..d65060cb6 100644 +--- a/include/dix.h ++++ b/include/dix.h +@@ -148,6 +148,7 @@ typedef struct _TimeStamp { + } TimeStamp; + + /* dispatch.c */ ++extern _X_EXPORT ClientPtr GetCurrentClient(void); + + extern _X_EXPORT void SetInputCheck(HWEventQueuePtr /*c0 */ , + HWEventQueuePtr /*c1 */ ); +-- +2.23.0 + diff --git a/0002-xwayland-Add-wp_viewport-wayland-extension-support.patch b/0002-xwayland-Add-wp_viewport-wayland-extension-support.patch new file mode 100644 index 0000000..6fce642 --- /dev/null +++ b/0002-xwayland-Add-wp_viewport-wayland-extension-support.patch @@ -0,0 +1,118 @@ +From f473d009dba1029658f6c3fb5751fbbf027ed468 Mon Sep 17 00:00:00 2001 +From: Robert Mader +Date: Mon, 22 Jan 2018 22:02:32 +0100 +Subject: [PATCH xserver 02/14] xwayland: Add wp_viewport wayland extension + support +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This commit adds support for the wayland wp_viewport extension, note +nothing uses this yet. + +This is a preparation patch for adding support for fake mode-changes through +xrandr for apps which want to change the resolution when going fullscreen. + +[hdegoede@redhat.com: Split the code for the extension out into its own patch] + +Reviewed-by: Olivier Fourdan +Acked-by: Michel Dänzer +Signed-off-by: Hans de Goede +--- + hw/xwayland/Makefile.am | 9 ++++++++- + hw/xwayland/meson.build | 3 +++ + hw/xwayland/xwayland.c | 3 +++ + hw/xwayland/xwayland.h | 2 ++ + 5 files changed, 24 insertions(+), 1 deletion(-) + +diff --git a/hw/xwayland/Makefile.am b/hw/xwayland/Makefile.am +index bc1cb8506..49aae3d8b 100644 +--- a/hw/xwayland/Makefile.am ++++ b/hw/xwayland/Makefile.am +@@ -71,7 +71,9 @@ Xwayland_built_sources += \ + xdg-output-unstable-v1-protocol.c \ + xdg-output-unstable-v1-client-protocol.h \ + linux-dmabuf-unstable-v1-client-protocol.h \ +- linux-dmabuf-unstable-v1-protocol.c ++ linux-dmabuf-unstable-v1-protocol.c \ ++ viewporter-client-protocol.h \ ++ viewporter-protocol.c + + if XWAYLAND_EGLSTREAM + Xwayland_built_sources += \ +@@ -120,6 +122,11 @@ linux-dmabuf-unstable-v1-protocol.c : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/linu + linux-dmabuf-unstable-v1-client-protocol.h : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml + $(AM_V_GEN)$(WAYLAND_SCANNER) client-header < $< > $@ + ++viewporter-protocol.c: $(WAYLAND_PROTOCOLS_DATADIR)/stable/viewporter/viewporter.xml ++ $(AM_V_GEN)$(WAYLAND_SCANNER) @SCANNER_ARG@ < $< > $@ ++viewporter-client-protocol.h: $(WAYLAND_PROTOCOLS_DATADIR)/stable/viewporter/viewporter.xml ++ $(AM_V_GEN)$(WAYLAND_SCANNER) client-header < $< > $@ ++ + wayland-eglstream-client-protocol.h : $(WAYLAND_EGLSTREAM_DATADIR)/wayland-eglstream.xml + $(AM_V_GEN)$(WAYLAND_SCANNER) client-header < $< > $@ + wayland-eglstream-controller-client-protocol.h : $(WAYLAND_EGLSTREAM_DATADIR)/wayland-eglstream-controller.xml +diff --git a/hw/xwayland/meson.build b/hw/xwayland/meson.build +index 36bf2133a..4a8d171bb 100644 +--- a/hw/xwayland/meson.build ++++ b/hw/xwayland/meson.build +@@ -21,6 +21,7 @@ tablet_xml = join_paths(protodir, 'unstable', 'tablet', 'tablet-unstable-v2.xml' + kbgrab_xml = join_paths(protodir, 'unstable', 'xwayland-keyboard-grab', 'xwayland-keyboard-grab-unstable-v1.xml') + xdg_output_xml = join_paths(protodir, 'unstable', 'xdg-output', 'xdg-output-unstable-v1.xml') + dmabuf_xml = join_paths(protodir, 'unstable', 'linux-dmabuf', 'linux-dmabuf-unstable-v1.xml') ++viewporter_xml = join_paths(protodir, 'stable', 'viewporter', 'viewporter.xml') + + client_header = generator(scanner, + output : '@BASENAME@-client-protocol.h', +@@ -43,12 +44,14 @@ srcs += client_header.process(tablet_xml) + srcs += client_header.process(kbgrab_xml) + srcs += client_header.process(xdg_output_xml) + srcs += client_header.process(dmabuf_xml) ++srcs += client_header.process(viewporter_xml) + srcs += code.process(relative_xml) + srcs += code.process(pointer_xml) + srcs += code.process(tablet_xml) + srcs += code.process(kbgrab_xml) + srcs += code.process(xdg_output_xml) + srcs += code.process(dmabuf_xml) ++srcs += code.process(viewporter_xml) + + xwayland_glamor = [] + eglstream_srcs = [] +diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c +index baa08d87b..292f239e8 100644 +--- a/hw/xwayland/xwayland.c ++++ b/hw/xwayland/xwayland.c +@@ -863,6 +863,9 @@ registry_global(void *data, struct wl_registry *registry, uint32_t id, + wl_registry_bind(registry, id, &zxdg_output_manager_v1_interface, 1); + xwl_screen_init_xdg_output(xwl_screen); + } ++ else if (strcmp(interface, "wp_viewporter") == 0) { ++ xwl_screen->viewporter = wl_registry_bind(registry, id, &wp_viewporter_interface, 1); ++ } + #ifdef XWL_HAS_GLAMOR + else if (xwl_screen->glamor) { + xwl_glamor_init_wl_registry(xwl_screen, registry, id, interface, +diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h +index 0854df456..c4eabe4c3 100644 +--- a/hw/xwayland/xwayland.h ++++ b/hw/xwayland/xwayland.h +@@ -48,6 +48,7 @@ + #include "xwayland-keyboard-grab-unstable-v1-client-protocol.h" + #include "xdg-output-unstable-v1-client-protocol.h" + #include "linux-dmabuf-unstable-v1-client-protocol.h" ++#include "viewporter-client-protocol.h" + + struct xwl_format { + uint32_t format; +@@ -151,6 +152,7 @@ struct xwl_screen { + struct zwp_pointer_constraints_v1 *pointer_constraints; + struct zwp_xwayland_keyboard_grab_manager_v1 *wp_grab; + struct zxdg_output_manager_v1 *xdg_output_manager; ++ struct wp_viewporter *viewporter; + uint32_t serial; + + #define XWL_FORMAT_ARGB8888 (1 << 0) +-- +2.23.0 + diff --git a/0003-xwayland-Use-buffer_damage-instead-of-surface-damage.patch b/0003-xwayland-Use-buffer_damage-instead-of-surface-damage.patch new file mode 100644 index 0000000..c274d4e --- /dev/null +++ b/0003-xwayland-Use-buffer_damage-instead-of-surface-damage.patch @@ -0,0 +1,155 @@ +From 0356eff57bc1201e2bcd5fdd363a50ceabc4a4fa Mon Sep 17 00:00:00 2001 +From: Robert Mader +Date: Tue, 2 Jul 2019 12:03:12 +0200 +Subject: [PATCH xserver 03/14] xwayland: Use buffer_damage instead of surface + damage if available +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +When a viewport is set, damage will only work properly when using +wl_surface_damage_buffer instead of wl_surface_damage. + +When no viewport is set, there should be no difference between +surface and buffer damage. + +This is a preparation patch for using viewport to add support for fake +mode-changes through xrandr for apps which want to change the resolution +when going fullscreen. + +Changes by Hans de Goede : +-Split the damage changes out into their own patch +-Add xwl_surface_damage helper +-Also use buffer_damage / the new helper for the present and cursor code + +Reviewed-by: Olivier Fourdan +Acked-by: Michel Dänzer +Signed-off-by: Hans de Goede +--- + hw/xwayland/xwayland-cursor.c | 12 ++++++------ + hw/xwayland/xwayland-present.c | 6 +++--- + hw/xwayland/xwayland.c | 29 +++++++++++++++++++++++------ + hw/xwayland/xwayland.h | 3 +++ + 4 files changed, 35 insertions(+), 15 deletions(-) + +diff --git a/hw/xwayland/xwayland-cursor.c b/hw/xwayland/xwayland-cursor.c +index 66720bcc0..cbc715061 100644 +--- a/hw/xwayland/xwayland-cursor.c ++++ b/hw/xwayland/xwayland-cursor.c +@@ -165,9 +165,9 @@ xwl_seat_set_cursor(struct xwl_seat *xwl_seat) + xwl_seat->x_cursor->bits->yhot); + wl_surface_attach(xwl_cursor->surface, + xwl_shm_pixmap_get_wl_buffer(pixmap), 0, 0); +- wl_surface_damage(xwl_cursor->surface, 0, 0, +- xwl_seat->x_cursor->bits->width, +- xwl_seat->x_cursor->bits->height); ++ xwl_surface_damage(xwl_seat->xwl_screen, xwl_cursor->surface, 0, 0, ++ xwl_seat->x_cursor->bits->width, ++ xwl_seat->x_cursor->bits->height); + + xwl_cursor->frame_cb = wl_surface_frame(xwl_cursor->surface); + wl_callback_add_listener(xwl_cursor->frame_cb, &frame_listener, xwl_cursor); +@@ -217,9 +217,9 @@ xwl_tablet_tool_set_cursor(struct xwl_tablet_tool *xwl_tablet_tool) + xwl_seat->x_cursor->bits->yhot); + wl_surface_attach(xwl_cursor->surface, + xwl_shm_pixmap_get_wl_buffer(pixmap), 0, 0); +- wl_surface_damage(xwl_cursor->surface, 0, 0, +- xwl_seat->x_cursor->bits->width, +- xwl_seat->x_cursor->bits->height); ++ xwl_surface_damage(xwl_seat->xwl_screen, xwl_cursor->surface, 0, 0, ++ xwl_seat->x_cursor->bits->width, ++ xwl_seat->x_cursor->bits->height); + + xwl_cursor->frame_cb = wl_surface_frame(xwl_cursor->surface); + wl_callback_add_listener(xwl_cursor->frame_cb, &frame_listener, xwl_cursor); +diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c +index 2937d9c97..df771c30f 100644 +--- a/hw/xwayland/xwayland-present.c ++++ b/hw/xwayland/xwayland-present.c +@@ -500,9 +500,9 @@ xwl_present_flip(WindowPtr present_window, + xwl_present_window->frame_timer_firing = FALSE; + xwl_present_reset_timer(xwl_present_window); + +- wl_surface_damage(xwl_window->surface, 0, 0, +- damage_box->x2 - damage_box->x1, +- damage_box->y2 - damage_box->y1); ++ xwl_surface_damage(xwl_window->xwl_screen, xwl_window->surface, 0, 0, ++ damage_box->x2 - damage_box->x1, ++ damage_box->y2 - damage_box->y1); + + wl_surface_commit(xwl_window->surface); + +diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c +index 292f239e8..8b1c7918a 100644 +--- a/hw/xwayland/xwayland.c ++++ b/hw/xwayland/xwayland.c +@@ -759,6 +759,16 @@ xwl_destroy_window(WindowPtr window) + return ret; + } + ++void xwl_surface_damage(struct xwl_screen *xwl_screen, ++ struct wl_surface *surface, ++ int32_t x, int32_t y, int32_t width, int32_t height) ++{ ++ if (wl_surface_get_version(surface) >= WL_SURFACE_DAMAGE_BUFFER_SINCE_VERSION) ++ wl_surface_damage_buffer(surface, x, y, width, height); ++ else ++ wl_surface_damage(surface, x, y, width, height); ++} ++ + static void + xwl_window_post_damage(struct xwl_window *xwl_window) + { +@@ -795,13 +805,15 @@ xwl_window_post_damage(struct xwl_window *xwl_window) + */ + if (RegionNumRects(region) > 256) { + box = RegionExtents(region); +- wl_surface_damage(xwl_window->surface, box->x1, box->y1, +- box->x2 - box->x1, box->y2 - box->y1); ++ xwl_surface_damage(xwl_screen, xwl_window->surface, box->x1, box->y1, ++ box->x2 - box->x1, box->y2 - box->y1); + } else { + box = RegionRects(region); +- for (i = 0; i < RegionNumRects(region); i++, box++) +- wl_surface_damage(xwl_window->surface, box->x1, box->y1, +- box->x2 - box->x1, box->y2 - box->y1); ++ for (i = 0; i < RegionNumRects(region); i++, box++) { ++ xwl_surface_damage(xwl_screen, xwl_window->surface, ++ box->x1, box->y1, ++ box->x2 - box->x1, box->y2 - box->y1); ++ } + } + + xwl_window->frame_callback = wl_surface_frame(xwl_window->surface); +@@ -844,8 +856,13 @@ registry_global(void *data, struct wl_registry *registry, uint32_t id, + struct xwl_screen *xwl_screen = data; + + if (strcmp(interface, "wl_compositor") == 0) { ++ uint32_t request_version = 1; ++ ++ if (version >= WL_SURFACE_DAMAGE_BUFFER_SINCE_VERSION) ++ request_version = WL_SURFACE_DAMAGE_BUFFER_SINCE_VERSION; ++ + xwl_screen->compositor = +- wl_registry_bind(registry, id, &wl_compositor_interface, 1); ++ wl_registry_bind(registry, id, &wl_compositor_interface, request_version); + } + else if (strcmp(interface, "wl_shm") == 0) { + xwl_screen->shm = wl_registry_bind(registry, id, &wl_shm_interface, 1); +diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h +index c4eabe4c3..3e973d688 100644 +--- a/hw/xwayland/xwayland.h ++++ b/hw/xwayland/xwayland.h +@@ -381,6 +381,9 @@ struct xwl_output { + }; + + void xwl_sync_events (struct xwl_screen *xwl_screen); ++void xwl_surface_damage(struct xwl_screen *xwl_screen, ++ struct wl_surface *surface, ++ int32_t x, int32_t y, int32_t width, int32_t height); + + Bool xwl_screen_init_cursor(struct xwl_screen *xwl_screen); + +-- +2.23.0 + diff --git a/0004-xwayland-Add-fake-output-modes-to-xrandr-output-mode.patch b/0004-xwayland-Add-fake-output-modes-to-xrandr-output-mode.patch new file mode 100644 index 0000000..33467da --- /dev/null +++ b/0004-xwayland-Add-fake-output-modes-to-xrandr-output-mode.patch @@ -0,0 +1,206 @@ +From 873a7d2164c08ddf57e88095b34bbec092f28d31 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Wed, 26 Jun 2019 16:46:54 +0200 +Subject: [PATCH xserver 04/14] xwayland: Add fake output modes to xrandr + output mode lists +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This is a preparation patch for adding support for apps which want to +change the resolution when they go fullscreen because they are hardcoded +to render at a specific resolution, e.g. 640x480. + +Follow up patches will fake the mode-switch these apps want by using +WPviewport to scale there pixmap to cover the entire output. + +Reviewed-by: Olivier Fourdan +Acked-by: Michel Dänzer +Signed-off-by: Hans de Goede +--- + hw/xwayland/xwayland-output.c | 112 ++++++++++++++++++++++++++++++++-- + hw/xwayland/xwayland.c | 17 ++++++ + hw/xwayland/xwayland.h | 1 + + 3 files changed, 124 insertions(+), 6 deletions(-) + +diff --git a/hw/xwayland/xwayland-output.c b/hw/xwayland/xwayland-output.c +index aa6f37864..2ccc3ca60 100644 +--- a/hw/xwayland/xwayland-output.c ++++ b/hw/xwayland/xwayland-output.c +@@ -245,14 +245,110 @@ update_screen_size(struct xwl_output *xwl_output, int width, int height) + update_desktop_dimensions(); + } + ++/* From hw/xfree86/common/xf86DefModeSet.c with some obscure modes dropped */ ++const int32_t xwl_output_fake_modes[][2] = { ++ /* 4:3 (1.33) */ ++ { 2048, 1536 }, ++ { 1920, 1440 }, ++ { 1600, 1200 }, ++ { 1440, 1080 }, ++ { 1400, 1050 }, ++ { 1280, 1024 }, /* 5:4 (1.25) */ ++ { 1280, 960 }, ++ { 1152, 864 }, ++ { 1024, 768 }, ++ { 800, 600 }, ++ { 640, 480 }, ++ { 320, 240 }, ++ /* 16:10 (1.6) */ ++ { 2560, 1600 }, ++ { 1920, 1200 }, ++ { 1680, 1050 }, ++ { 1440, 900 }, ++ { 1280, 800 }, ++ { 720, 480 }, /* 3:2 (1.5) */ ++ { 640, 400 }, ++ { 320, 200 }, ++ /* 16:9 (1.77) */ ++ { 5120, 2880 }, ++ { 4096, 2304 }, ++ { 3840, 2160 }, ++ { 3200, 1800 }, ++ { 2880, 1620 }, ++ { 2560, 1440 }, ++ { 2048, 1152 }, ++ { 1920, 1080 }, ++ { 1600, 900 }, ++ { 1368, 768 }, ++ { 1280, 720 }, ++ { 1024, 576 }, ++ { 864, 486 }, ++ { 720, 400 }, ++ { 640, 350 }, ++}; ++ ++/* Build an array with RRModes the first mode is the actual output mode, the ++ * rest are fake modes from the xwl_output_fake_modes list. We do this for apps ++ * which want to change resolution when they go fullscreen. ++ * When an app requests a mode-change, we fake it using WPviewport. ++ */ ++static RRModePtr * ++output_get_rr_modes(struct xwl_output *xwl_output, ++ int32_t width, int32_t height, ++ int *count) ++{ ++ struct xwl_screen *xwl_screen = xwl_output->xwl_screen; ++ RRModePtr *rr_modes; ++ int i; ++ ++ rr_modes = xallocarray(ARRAY_SIZE(xwl_output_fake_modes) + 1, sizeof(RRModePtr)); ++ if (!rr_modes) ++ goto err; ++ ++ /* Add actual output mode */ ++ rr_modes[0] = xwayland_cvt(width, height, xwl_output->refresh / 1000.0, 0, 0); ++ if (!rr_modes[0]) ++ goto err; ++ ++ *count = 1; ++ ++ if (!xwl_screen_has_resolution_change_emulation(xwl_screen)) ++ return rr_modes; ++ ++ /* Add fake modes */ ++ for (i = 0; i < ARRAY_SIZE(xwl_output_fake_modes); i++) { ++ /* Skip actual output mode, already added */ ++ if (xwl_output_fake_modes[i][0] == width && ++ xwl_output_fake_modes[i][1] == height) ++ continue; ++ ++ /* Skip modes which are too big, avoid downscaling */ ++ if (xwl_output_fake_modes[i][0] > width || ++ xwl_output_fake_modes[i][1] > height) ++ continue; ++ ++ rr_modes[*count] = xwayland_cvt(xwl_output_fake_modes[i][0], ++ xwl_output_fake_modes[i][1], ++ xwl_output->refresh / 1000.0, 0, 0); ++ if (!rr_modes[*count]) ++ goto err; ++ ++ (*count)++; ++ } ++ ++ return rr_modes; ++err: ++ FatalError("Failed to allocate memory for list of RR modes"); ++} ++ + static void + apply_output_change(struct xwl_output *xwl_output) + { + struct xwl_screen *xwl_screen = xwl_output->xwl_screen; + struct xwl_output *it; +- int mode_width, mode_height; ++ int mode_width, mode_height, count; + int width = 0, height = 0, has_this_output = 0; +- RRModePtr randr_mode; ++ RRModePtr *randr_modes; + Bool need_rotate; + + /* Clear out the "done" received flags */ +@@ -271,12 +367,16 @@ apply_output_change(struct xwl_output *xwl_output) + mode_height = xwl_output->width; + } + +- randr_mode = xwayland_cvt(mode_width, mode_height, +- xwl_output->refresh / 1000.0, 0, 0); +- RROutputSetModes(xwl_output->randr_output, &randr_mode, 1, 1); +- RRCrtcNotify(xwl_output->randr_crtc, randr_mode, ++ /* Build a fresh modes array using the current refresh rate */ ++ randr_modes = output_get_rr_modes(xwl_output, mode_width, mode_height, &count); ++ RROutputSetModes(xwl_output->randr_output, randr_modes, count, 1); ++ RRCrtcNotify(xwl_output->randr_crtc, randr_modes[0], + xwl_output->x, xwl_output->y, + xwl_output->rotation, NULL, 1, &xwl_output->randr_output); ++ /* RROutputSetModes takes ownership of the passed in modes, so we only ++ * have to free the pointer array. ++ */ ++ free(randr_modes); + + xorg_list_for_each_entry(it, &xwl_screen->output_list, link) { + /* output done event is sent even when some property +diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c +index 8b1c7918a..a599c022a 100644 +--- a/hw/xwayland/xwayland.c ++++ b/hw/xwayland/xwayland.c +@@ -139,6 +139,23 @@ xwl_screen_get(ScreenPtr screen) + return dixLookupPrivate(&screen->devPrivates, &xwl_screen_private_key); + } + ++static Bool ++xwl_screen_has_viewport_support(struct xwl_screen *xwl_screen) ++{ ++ return wl_compositor_get_version(xwl_screen->compositor) >= ++ WL_SURFACE_DAMAGE_BUFFER_SINCE_VERSION && ++ xwl_screen->viewporter != NULL; ++} ++ ++Bool ++xwl_screen_has_resolution_change_emulation(struct xwl_screen *xwl_screen) ++{ ++ /* Resolution change emulation is only supported in rootless mode and ++ * it requires viewport support. ++ */ ++ return xwl_screen->rootless && xwl_screen_has_viewport_support(xwl_screen); ++} ++ + static void + xwl_window_set_allow_commits(struct xwl_window *xwl_window, Bool allow, + const char *debug_msg) +diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h +index 3e973d688..0fafc07a6 100644 +--- a/hw/xwayland/xwayland.h ++++ b/hw/xwayland/xwayland.h +@@ -388,6 +388,7 @@ void xwl_surface_damage(struct xwl_screen *xwl_screen, + Bool xwl_screen_init_cursor(struct xwl_screen *xwl_screen); + + struct xwl_screen *xwl_screen_get(ScreenPtr screen); ++Bool xwl_screen_has_resolution_change_emulation(struct xwl_screen *xwl_screen); + + void xwl_tablet_tool_set_cursor(struct xwl_tablet_tool *tool); + void xwl_seat_set_cursor(struct xwl_seat *xwl_seat); +-- +2.23.0 + diff --git a/0005-xwayland-Use-RandR-1.2-interface-rev-2.patch b/0005-xwayland-Use-RandR-1.2-interface-rev-2.patch new file mode 100644 index 0000000..e875403 --- /dev/null +++ b/0005-xwayland-Use-RandR-1.2-interface-rev-2.patch @@ -0,0 +1,138 @@ +From 81ff61afd6594e0cf00f4be7ff34f94cd9e8f9b0 Mon Sep 17 00:00:00 2001 +From: Robert Mader +Date: Mon, 22 Jan 2018 17:57:38 +0100 +Subject: [PATCH xserver 05/14] xwayland: Use RandR 1.2 interface (rev 2) +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This adds the RandR 1.2 interface to xwayland and allows modes +advertised by the compositor to be set in an undistructive manner. + +With this patch, applications that try to set the resolution will usually +succeed and work while other apps using the same xwayland +instance are not affected at all. + +The RandR 1.2 interface will be needed to implement fake-mode-setting and +already makes applications work much cleaner and predictive when a mode +was set. + +[hdegoede@redhat.com: Make crtc_set only succeed if the mode matches + the desktop resolution] + +Reviewed-by: Olivier Fourdan +Acked-by: Michel Dänzer +Signed-off-by: Hans de Goede +--- + hw/xwayland/xwayland-output.c | 81 +++++++++++++++++++++++++++++++++++ + 1 file changed, 81 insertions(+) + +diff --git a/hw/xwayland/xwayland-output.c b/hw/xwayland/xwayland-output.c +index 2ccc3ca60..67e99bdab 100644 +--- a/hw/xwayland/xwayland-output.c ++++ b/hw/xwayland/xwayland-output.c +@@ -561,12 +561,80 @@ xwl_randr_get_info(ScreenPtr pScreen, Rotation * rotations) + return TRUE; + } + ++#ifdef RANDR_10_INTERFACE + static Bool + xwl_randr_set_config(ScreenPtr pScreen, + Rotation rotation, int rate, RRScreenSizePtr pSize) + { + return FALSE; + } ++#endif ++ ++#if RANDR_12_INTERFACE ++static Bool ++xwl_randr_screen_set_size(ScreenPtr pScreen, ++ CARD16 width, ++ CARD16 height, ++ CARD32 mmWidth, CARD32 mmHeight) ++{ ++ return TRUE; ++} ++ ++static Bool ++xwl_randr_crtc_set(ScreenPtr pScreen, ++ RRCrtcPtr crtc, ++ RRModePtr mode, ++ int x, ++ int y, ++ Rotation rotation, ++ int numOutputs, RROutputPtr * outputs) ++{ ++ struct xwl_output *xwl_output = crtc->devPrivate; ++ ++ if (!mode || (mode->mode.width == xwl_output->width && ++ mode->mode.height == xwl_output->height)) { ++ RRCrtcChanged(crtc, TRUE); ++ return TRUE; ++ } ++ ++ return FALSE; ++} ++ ++static Bool ++xwl_randr_crtc_set_gamma(ScreenPtr pScreen, RRCrtcPtr crtc) ++{ ++ return TRUE; ++} ++ ++static Bool ++xwl_randr_crtc_get_gamma(ScreenPtr pScreen, RRCrtcPtr crtc) ++{ ++ return TRUE; ++} ++ ++static Bool ++xwl_randr_output_set_property(ScreenPtr pScreen, ++ RROutputPtr output, ++ Atom property, ++ RRPropertyValuePtr value) ++{ ++ return TRUE; ++} ++ ++static Bool ++xwl_output_validate_mode(ScreenPtr pScreen, ++ RROutputPtr output, ++ RRModePtr mode) ++{ ++ return TRUE; ++} ++ ++static void ++xwl_randr_mode_destroy(ScreenPtr pScreen, RRModePtr mode) ++{ ++ return; ++} ++#endif + + Bool + xwl_screen_init_output(struct xwl_screen *xwl_screen) +@@ -580,7 +648,20 @@ xwl_screen_init_output(struct xwl_screen *xwl_screen) + + rp = rrGetScrPriv(xwl_screen->screen); + rp->rrGetInfo = xwl_randr_get_info; ++ ++#if RANDR_10_INTERFACE + rp->rrSetConfig = xwl_randr_set_config; ++#endif ++ ++#if RANDR_12_INTERFACE ++ rp->rrScreenSetSize = xwl_randr_screen_set_size; ++ rp->rrCrtcSet = xwl_randr_crtc_set; ++ rp->rrCrtcSetGamma = xwl_randr_crtc_set_gamma; ++ rp->rrCrtcGetGamma = xwl_randr_crtc_get_gamma; ++ rp->rrOutputSetProperty = xwl_randr_output_set_property; ++ rp->rrOutputValidateMode = xwl_output_validate_mode; ++ rp->rrModeDestroy = xwl_randr_mode_destroy; ++#endif + + return TRUE; + } +-- +2.23.0 + diff --git a/0006-xwayland-Add-per-client-private-data.patch b/0006-xwayland-Add-per-client-private-data.patch new file mode 100644 index 0000000..4038480 --- /dev/null +++ b/0006-xwayland-Add-per-client-private-data.patch @@ -0,0 +1,77 @@ +From 1dc4938467b6338695eda4224f0b0c592cb2c25c Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Thu, 29 Aug 2019 22:45:12 +0200 +Subject: [PATCH xserver 06/14] xwayland: Add per client private data +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Add per client private data, which for now is empty. + +This is a preparation patch for adding randr/vidmode resolution +change emulation. + +Reviewed-by: Olivier Fourdan +Acked-by: Michel Dänzer +Signed-off-by: Hans de Goede +--- + hw/xwayland/xwayland.c | 14 ++++++++++++++ + hw/xwayland/xwayland.h | 5 +++++ + 2 files changed, 19 insertions(+) + +diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c +index a599c022a..2b6065f1a 100644 +--- a/hw/xwayland/xwayland.c ++++ b/hw/xwayland/xwayland.c +@@ -122,11 +122,18 @@ ddxProcessArgument(int argc, char *argv[], int i) + return 0; + } + ++static DevPrivateKeyRec xwl_client_private_key; + static DevPrivateKeyRec xwl_window_private_key; + static DevPrivateKeyRec xwl_screen_private_key; + static DevPrivateKeyRec xwl_pixmap_private_key; + static DevPrivateKeyRec xwl_damage_private_key; + ++struct xwl_client * ++xwl_client_get(ClientPtr client) ++{ ++ return dixLookupPrivate(&client->devPrivates, &xwl_client_private_key); ++} ++ + static struct xwl_window * + xwl_window_get(WindowPtr window) + { +@@ -1083,6 +1090,13 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) + return FALSE; + if (!dixRegisterPrivateKey(&xwl_damage_private_key, PRIVATE_WINDOW, 0)) + return FALSE; ++ /* There are no easy to use new / delete client hooks, we could use a ++ * ClientStateCallback, but it is easier to let the dix code manage the ++ * memory for us. This will zero fill the initial xwl_client data. ++ */ ++ if (!dixRegisterPrivateKey(&xwl_client_private_key, PRIVATE_CLIENT, ++ sizeof(struct xwl_client))) ++ return FALSE; + + dixSetPrivate(&pScreen->devPrivates, &xwl_screen_private_key, xwl_screen); + xwl_screen->screen = pScreen; +diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h +index 0fafc07a6..17018fcf5 100644 +--- a/hw/xwayland/xwayland.h ++++ b/hw/xwayland/xwayland.h +@@ -380,6 +380,11 @@ struct xwl_output { + Bool xdg_output_done; + }; + ++struct xwl_client { ++}; ++ ++struct xwl_client *xwl_client_get(ClientPtr client); ++ + void xwl_sync_events (struct xwl_screen *xwl_screen); + void xwl_surface_damage(struct xwl_screen *xwl_screen, + struct wl_surface *surface, +-- +2.23.0 + diff --git a/0007-xwayland-Add-support-for-storing-per-client-per-outp.patch b/0007-xwayland-Add-support-for-storing-per-client-per-outp.patch new file mode 100644 index 0000000..5ddec9d --- /dev/null +++ b/0007-xwayland-Add-support-for-storing-per-client-per-outp.patch @@ -0,0 +1,148 @@ +From dfb887783bfe3c5f57d46738bce13ec2d79b1769 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Thu, 29 Aug 2019 23:04:36 +0200 +Subject: [PATCH xserver 07/14] xwayland: Add support for storing per client + per output emulated resolution +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Add support for storing per output randr/vidmode emulated resolution +into the per client data. + +Since we do not have a free/delete callback for the client this uses +a simple static array. The entries are tied to a specific output by the +server_output_id, with a server_output_id of 0 indicating a free slot +(0 is the "None" Wayland object id). + +Note that even if we were to store this in a linked list, we would still +need the server_output_id as this is *per client* *per output*. + +This is a preparation patch for adding randr/vidmode resolution +change emulation. + +Reviewed-by: Olivier Fourdan +Acked-by: Michel Dänzer +Signed-off-by: Hans de Goede +--- + hw/xwayland/xwayland-output.c | 67 +++++++++++++++++++++++++++++++++++ + hw/xwayland/xwayland.h | 17 +++++++++ + 2 files changed, 84 insertions(+) + +diff --git a/hw/xwayland/xwayland-output.c b/hw/xwayland/xwayland-output.c +index 67e99bdab..82ff5db70 100644 +--- a/hw/xwayland/xwayland-output.c ++++ b/hw/xwayland/xwayland-output.c +@@ -245,6 +245,73 @@ update_screen_size(struct xwl_output *xwl_output, int width, int height) + update_desktop_dimensions(); + } + ++struct xwl_emulated_mode * ++xwl_output_get_emulated_mode_for_client(struct xwl_output *xwl_output, ++ ClientPtr client) ++{ ++ struct xwl_client *xwl_client = xwl_client_get(client); ++ int i; ++ ++ if (!xwl_output) ++ return NULL; ++ ++ for (i = 0; i < XWL_CLIENT_MAX_EMULATED_MODES; i++) { ++ if (xwl_client->emulated_modes[i].server_output_id == ++ xwl_output->server_output_id) ++ return &xwl_client->emulated_modes[i]; ++ } ++ ++ return NULL; ++} ++ ++static void ++xwl_output_add_emulated_mode_for_client(struct xwl_output *xwl_output, ++ ClientPtr client, ++ RRModePtr mode, ++ Bool from_vidmode) ++{ ++ struct xwl_client *xwl_client = xwl_client_get(client); ++ struct xwl_emulated_mode *emulated_mode; ++ int i; ++ ++ emulated_mode = xwl_output_get_emulated_mode_for_client(xwl_output, client); ++ if (!emulated_mode) { ++ /* Find a free spot in the emulated modes array */ ++ for (i = 0; i < XWL_CLIENT_MAX_EMULATED_MODES; i++) { ++ if (xwl_client->emulated_modes[i].server_output_id == 0) { ++ emulated_mode = &xwl_client->emulated_modes[i]; ++ break; ++ } ++ } ++ } ++ if (!emulated_mode) { ++ static Bool warned; ++ ++ if (!warned) { ++ ErrorF("Ran out of space for emulated-modes, not adding mode"); ++ warned = TRUE; ++ } ++ ++ return; ++ } ++ ++ emulated_mode->server_output_id = xwl_output->server_output_id; ++ emulated_mode->width = mode->mode.width; ++ emulated_mode->height = mode->mode.height; ++ emulated_mode->from_vidmode = from_vidmode; ++} ++ ++static void ++xwl_output_remove_emulated_mode_for_client(struct xwl_output *xwl_output, ++ ClientPtr client) ++{ ++ struct xwl_emulated_mode *emulated_mode; ++ ++ emulated_mode = xwl_output_get_emulated_mode_for_client(xwl_output, client); ++ if (emulated_mode) ++ memset(emulated_mode, 0, sizeof(*emulated_mode)); ++} ++ + /* From hw/xfree86/common/xf86DefModeSet.c with some obscure modes dropped */ + const int32_t xwl_output_fake_modes[][2] = { + /* 4:3 (1.33) */ +diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h +index 17018fcf5..d0e87a89d 100644 +--- a/hw/xwayland/xwayland.h ++++ b/hw/xwayland/xwayland.h +@@ -380,7 +380,21 @@ struct xwl_output { + Bool xdg_output_done; + }; + ++/* Per client per output emulated randr/vidmode resolution info. */ ++struct xwl_emulated_mode { ++ uint32_t server_output_id; ++ int32_t width; ++ int32_t height; ++ Bool from_vidmode; ++}; ++ ++/* Apps which use randr/vidmode to change the mode when going fullscreen, ++ * usually change the mode of only a single monitor, so this should be plenty. ++ */ ++#define XWL_CLIENT_MAX_EMULATED_MODES 16 ++ + struct xwl_client { ++ struct xwl_emulated_mode emulated_modes[XWL_CLIENT_MAX_EMULATED_MODES]; + }; + + struct xwl_client *xwl_client_get(ClientPtr client); +@@ -424,6 +438,9 @@ void xwl_output_destroy(struct xwl_output *xwl_output); + + void xwl_output_remove(struct xwl_output *xwl_output); + ++struct xwl_emulated_mode *xwl_output_get_emulated_mode_for_client( ++ struct xwl_output *xwl_output, ClientPtr client); ++ + RRModePtr xwayland_cvt(int HDisplay, int VDisplay, + float VRefresh, Bool Reduced, Bool Interlaced); + +-- +2.23.0 + diff --git a/0008-xwayland-Add-support-for-randr-resolution-change-emu.patch b/0008-xwayland-Add-support-for-randr-resolution-change-emu.patch new file mode 100644 index 0000000..7119e31 --- /dev/null +++ b/0008-xwayland-Add-support-for-randr-resolution-change-emu.patch @@ -0,0 +1,461 @@ +From e997273b14a23b0ffe89f542de783adbec6e8a1b Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Tue, 2 Jul 2019 11:55:26 +0200 +Subject: [PATCH xserver 08/14] xwayland: Add support for randr-resolution + change emulation using viewport +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Add support for per client randr-resolution change emulation using viewport, +for apps which want to change the resolution when going fullscreen. + +Partly based on earlier work on this by Robert Mader + +Note SDL2 and SFML do not restore randr resolution when going from +fullscreen -> windowed, I believe this is caused by us still reporting the +desktop resolution when they query the resolution. This is not a problem +because when windowed the toplevel window size includes the window-decorations +so it never matches the emulated resolution. + +One exception would be the window being resizable in Windowed mode and the +user resizing the window so that including decorations it matches the +emulated resolution *and* the window being at pos 0x0. But this is an +extreme corner case. Still I will submit patches upstream to SDL2 +and SFML to always restore the desktop resolution under Xwayland, +disabling resolution emulation all together when going windowed. + +Reviewed-by: Olivier Fourdan +Acked-by: Michel Dänzer +Signed-off-by: Hans de Goede +--- + hw/xwayland/xwayland-input.c | 5 + + hw/xwayland/xwayland-output.c | 63 ++++++++++- + hw/xwayland/xwayland.c | 199 ++++++++++++++++++++++++++++++++++ + hw/xwayland/xwayland.h | 15 +++ + 4 files changed, 276 insertions(+), 6 deletions(-) + +diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c +index fa46ac3e7..97b8cd132 100644 +--- a/hw/xwayland/xwayland-input.c ++++ b/hw/xwayland/xwayland-input.c +@@ -486,6 +486,11 @@ dispatch_pointer_motion_event(struct xwl_seat *xwl_seat) + int dx = xwl_seat->focus_window->window->drawable.x; + int dy = xwl_seat->focus_window->window->drawable.y; + ++ if (xwl_window_has_viewport_enabled(xwl_seat->focus_window)) { ++ sx *= xwl_seat->focus_window->scale_x; ++ sy *= xwl_seat->focus_window->scale_y; ++ } ++ + x = dx + sx; + y = dy + sy; + } else { +diff --git a/hw/xwayland/xwayland-output.c b/hw/xwayland/xwayland-output.c +index 82ff5db70..99ab1b288 100644 +--- a/hw/xwayland/xwayland-output.c ++++ b/hw/xwayland/xwayland-output.c +@@ -408,6 +408,42 @@ err: + FatalError("Failed to allocate memory for list of RR modes"); + } + ++RRModePtr ++xwl_output_find_mode(struct xwl_output *xwl_output, ++ int32_t width, int32_t height) ++{ ++ RROutputPtr output = xwl_output->randr_output; ++ int i; ++ ++ /* width & height -1 means we want the actual output mode, which is idx 0 */ ++ if (width == -1 && height == -1 && output->modes) ++ return output->modes[0]; ++ ++ for (i = 0; i < output->numModes; i++) { ++ if (output->modes[i]->mode.width == width && output->modes[i]->mode.height == height) ++ return output->modes[i]; ++ } ++ ++ ErrorF("XWAYLAND: mode %dx%d is not available\n", width, height); ++ return NULL; ++} ++ ++void ++xwl_output_set_emulated_mode(struct xwl_output *xwl_output, ClientPtr client, ++ RRModePtr mode, Bool from_vidmode) ++{ ++ DebugF("XWAYLAND: xwl_output_set_emulated_mode from %s: %dx%d\n", ++ from_vidmode ? "vidmode" : "randr", ++ mode->mode.width, mode->mode.height); ++ ++ if (mode->mode.width == xwl_output->width && mode->mode.height == xwl_output->height) ++ xwl_output_remove_emulated_mode_for_client(xwl_output, client); ++ else ++ xwl_output_add_emulated_mode_for_client(xwl_output, client, mode, from_vidmode); ++ ++ xwl_screen_check_resolution_change_emulation(xwl_output->xwl_screen); ++} ++ + static void + apply_output_change(struct xwl_output *xwl_output) + { +@@ -650,21 +686,36 @@ xwl_randr_screen_set_size(ScreenPtr pScreen, + static Bool + xwl_randr_crtc_set(ScreenPtr pScreen, + RRCrtcPtr crtc, +- RRModePtr mode, ++ RRModePtr new_mode, + int x, + int y, + Rotation rotation, + int numOutputs, RROutputPtr * outputs) + { + struct xwl_output *xwl_output = crtc->devPrivate; ++ RRModePtr mode; + +- if (!mode || (mode->mode.width == xwl_output->width && +- mode->mode.height == xwl_output->height)) { +- RRCrtcChanged(crtc, TRUE); +- return TRUE; ++ if (new_mode) { ++ mode = xwl_output_find_mode(xwl_output, ++ new_mode->mode.width, ++ new_mode->mode.height); ++ } else { ++ mode = xwl_output_find_mode(xwl_output, -1, -1); + } ++ if (!mode) ++ return FALSE; + +- return FALSE; ++ xwl_output_set_emulated_mode(xwl_output, GetCurrentClient(), mode, FALSE); ++ ++ /* A real randr implementation would call: ++ * RRCrtcNotify(xwl_output->randr_crtc, mode, xwl_output->x, xwl_output->y, ++ * xwl_output->rotation, NULL, 1, &xwl_output->randr_output); ++ * here to update the mode reported to clients querying the randr settings ++ * but that influences *all* clients and we do randr mode change emulation ++ * on a per client basis. So we just return success here. ++ */ ++ ++ return TRUE; + } + + static Bool +diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c +index 2b6065f1a..ec1b7eee4 100644 +--- a/hw/xwayland/xwayland.c ++++ b/hw/xwayland/xwayland.c +@@ -163,6 +163,23 @@ xwl_screen_has_resolution_change_emulation(struct xwl_screen *xwl_screen) + return xwl_screen->rootless && xwl_screen_has_viewport_support(xwl_screen); + } + ++/* Return the output @ 0x0, falling back to the first output in the list */ ++struct xwl_output * ++xwl_screen_get_first_output(struct xwl_screen *xwl_screen) ++{ ++ struct xwl_output *xwl_output; ++ ++ xorg_list_for_each_entry(xwl_output, &xwl_screen->output_list, link) { ++ if (xwl_output->x == 0 && xwl_output->y == 0) ++ return xwl_output; ++ } ++ ++ if (xorg_list_is_empty(&xwl_screen->output_list)) ++ return NULL; ++ ++ return xorg_list_first_entry(&xwl_screen->output_list, struct xwl_output, link); ++} ++ + static void + xwl_window_set_allow_commits(struct xwl_window *xwl_window, Bool allow, + const char *debug_msg) +@@ -499,6 +516,150 @@ xwl_pixmap_get(PixmapPtr pixmap) + return dixLookupPrivate(&pixmap->devPrivates, &xwl_pixmap_private_key); + } + ++Bool ++xwl_window_has_viewport_enabled(struct xwl_window *xwl_window) ++{ ++ return (xwl_window->viewport != NULL); ++} ++ ++static void ++xwl_window_disable_viewport(struct xwl_window *xwl_window) ++{ ++ assert (xwl_window->viewport); ++ ++ DebugF("XWAYLAND: disabling viewport\n"); ++ wp_viewport_destroy(xwl_window->viewport); ++ xwl_window->viewport = NULL; ++} ++ ++static void ++xwl_window_enable_viewport(struct xwl_window *xwl_window, ++ struct xwl_output *xwl_output, ++ struct xwl_emulated_mode *emulated_mode) ++{ ++ /* If necessary disable old viewport to apply new settings */ ++ if (xwl_window_has_viewport_enabled(xwl_window)) ++ xwl_window_disable_viewport(xwl_window); ++ ++ DebugF("XWAYLAND: enabling viewport %dx%d -> %dx%d\n", ++ emulated_mode->width, emulated_mode->height, ++ xwl_output->width, xwl_output->height); ++ ++ xwl_window->viewport = ++ wp_viewporter_get_viewport(xwl_window->xwl_screen->viewporter, ++ xwl_window->surface); ++ ++ wp_viewport_set_source(xwl_window->viewport, ++ wl_fixed_from_int(0), ++ wl_fixed_from_int(0), ++ wl_fixed_from_int(emulated_mode->width), ++ wl_fixed_from_int(emulated_mode->height)); ++ wp_viewport_set_destination(xwl_window->viewport, ++ xwl_output->width, ++ xwl_output->height); ++ ++ xwl_window->scale_x = (float)emulated_mode->width / xwl_output->width; ++ xwl_window->scale_y = (float)emulated_mode->height / xwl_output->height; ++} ++ ++static Bool ++xwl_screen_client_is_window_manager(struct xwl_screen *xwl_screen, ++ ClientPtr client) ++{ ++ WindowPtr root = xwl_screen->screen->root; ++ OtherClients *others; ++ ++ for (others = wOtherClients(root); others; others = others->next) { ++ if (SameClient(others, client)) { ++ if (others->mask & (SubstructureRedirectMask | ResizeRedirectMask)) ++ return TRUE; ++ } ++ } ++ ++ return FALSE; ++} ++ ++static ClientPtr ++xwl_window_get_owner(struct xwl_window *xwl_window) ++{ ++ WindowPtr window = xwl_window->window; ++ ClientPtr client = wClient(window); ++ ++ /* If the toplevel window is owned by the window-manager, then the ++ * actual client toplevel window has been reparented to a window-manager ++ * decoration window. In that case return the client of the ++ * first *and only* child of the toplevel (decoration) window. ++ */ ++ if (xwl_screen_client_is_window_manager(xwl_window->xwl_screen, client)) { ++ if (window->firstChild && window->firstChild == window->lastChild) ++ return wClient(window->firstChild); ++ else ++ return NULL; /* Should never happen, skip resolution emulation */ ++ } ++ ++ return client; ++} ++ ++static Bool ++xwl_window_should_enable_viewport(struct xwl_window *xwl_window, ++ struct xwl_output **xwl_output_ret, ++ struct xwl_emulated_mode **emulated_mode_ret) ++{ ++ struct xwl_screen *xwl_screen = xwl_window->xwl_screen; ++ struct xwl_emulated_mode *emulated_mode; ++ struct xwl_output *xwl_output; ++ ClientPtr owner; ++ ++ if (!xwl_screen_has_resolution_change_emulation(xwl_screen)) ++ return FALSE; ++ ++ owner = xwl_window_get_owner(xwl_window); ++ if (!owner) ++ return FALSE; ++ ++ /* 1. Test if the window matches the emulated mode on one of the outputs ++ * This path gets hit by most games / libs (e.g. SDL, SFML, OGRE) ++ */ ++ xorg_list_for_each_entry(xwl_output, &xwl_screen->output_list, link) { ++ emulated_mode = xwl_output_get_emulated_mode_for_client(xwl_output, owner); ++ if (!emulated_mode) ++ continue; ++ ++ if (xwl_window->x == xwl_output->x && ++ xwl_window->y == xwl_output->y && ++ xwl_window->width == emulated_mode->width && ++ xwl_window->height == emulated_mode->height) { ++ ++ *emulated_mode_ret = emulated_mode; ++ *xwl_output_ret = xwl_output; ++ return TRUE; ++ } ++ } ++ ++ return FALSE; ++} ++ ++static void ++xwl_window_check_resolution_change_emulation(struct xwl_window *xwl_window) ++{ ++ struct xwl_emulated_mode *emulated_mode; ++ struct xwl_output *xwl_output; ++ ++ if (xwl_window_should_enable_viewport(xwl_window, &xwl_output, &emulated_mode)) ++ xwl_window_enable_viewport(xwl_window, xwl_output, emulated_mode); ++ else if (xwl_window_has_viewport_enabled(xwl_window)) ++ xwl_window_disable_viewport(xwl_window); ++} ++ ++void ++xwl_screen_check_resolution_change_emulation(struct xwl_screen *xwl_screen) ++{ ++ struct xwl_window *xwl_window; ++ ++ xorg_list_for_each_entry(xwl_window, &xwl_screen->window_list, link_window) ++ xwl_window_check_resolution_change_emulation(xwl_window); ++} ++ + static void + xwl_window_init_allow_commits(struct xwl_window *xwl_window) + { +@@ -569,6 +730,8 @@ ensure_surface_for_window(WindowPtr window) + + xwl_window->xwl_screen = xwl_screen; + xwl_window->window = window; ++ xwl_window->width = window->drawable.width; ++ xwl_window->height = window->drawable.height; + xwl_window->surface = wl_compositor_create_surface(xwl_screen->compositor); + if (xwl_window->surface == NULL) { + ErrorF("wl_display_create_surface failed\n"); +@@ -610,6 +773,7 @@ ensure_surface_for_window(WindowPtr window) + + dixSetPrivate(&window->devPrivates, &xwl_window_private_key, xwl_window); + xorg_list_init(&xwl_window->link_damage); ++ xorg_list_add(&xwl_window->link_window, &xwl_screen->window_list); + + xwl_window_init_allow_commits(xwl_window); + +@@ -704,8 +868,12 @@ xwl_unrealize_window(WindowPtr window) + if (!xwl_window) + return ret; + ++ if (xwl_window_has_viewport_enabled(xwl_window)) ++ xwl_window_disable_viewport(xwl_window); ++ + wl_surface_destroy(xwl_window->surface); + xorg_list_del(&xwl_window->link_damage); ++ xorg_list_del(&xwl_window->link_window); + unregister_damage(window); + + if (xwl_window->frame_callback) +@@ -743,6 +911,33 @@ xwl_set_window_pixmap(WindowPtr window, + ensure_surface_for_window(window); + } + ++static void ++xwl_resize_window(WindowPtr window, ++ int x, int y, ++ unsigned int width, unsigned int height, ++ WindowPtr sib) ++{ ++ ScreenPtr screen = window->drawable.pScreen; ++ struct xwl_screen *xwl_screen; ++ struct xwl_window *xwl_window; ++ ++ xwl_screen = xwl_screen_get(screen); ++ xwl_window = xwl_window_get(window); ++ ++ screen->ResizeWindow = xwl_screen->ResizeWindow; ++ (*screen->ResizeWindow) (window, x, y, width, height, sib); ++ xwl_screen->ResizeWindow = screen->ResizeWindow; ++ screen->ResizeWindow = xwl_resize_window; ++ ++ if (xwl_window) { ++ xwl_window->x = x; ++ xwl_window->y = y; ++ xwl_window->width = width; ++ xwl_window->height = height; ++ xwl_window_check_resolution_change_emulation(xwl_window); ++ } ++} ++ + static void + frame_callback(void *data, + struct wl_callback *callback, +@@ -1158,6 +1353,7 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) + xorg_list_init(&xwl_screen->output_list); + xorg_list_init(&xwl_screen->seat_list); + xorg_list_init(&xwl_screen->damage_window_list); ++ xorg_list_init(&xwl_screen->window_list); + xwl_screen->depth = 24; + + xwl_screen->display = wl_display_connect(NULL); +@@ -1256,6 +1452,9 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) + xwl_screen->CloseScreen = pScreen->CloseScreen; + pScreen->CloseScreen = xwl_close_screen; + ++ xwl_screen->ResizeWindow = pScreen->ResizeWindow; ++ pScreen->ResizeWindow = xwl_resize_window; ++ + if (xwl_screen->rootless) { + xwl_screen->SetWindowPixmap = pScreen->SetWindowPixmap; + pScreen->SetWindowPixmap = xwl_set_window_pixmap; +diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h +index d0e87a89d..b52de11d2 100644 +--- a/hw/xwayland/xwayland.h ++++ b/hw/xwayland/xwayland.h +@@ -135,10 +135,12 @@ struct xwl_screen { + DestroyWindowProcPtr DestroyWindow; + XYToWindowProcPtr XYToWindow; + SetWindowPixmapProcPtr SetWindowPixmap; ++ ResizeWindowProcPtr ResizeWindow; + + struct xorg_list output_list; + struct xorg_list seat_list; + struct xorg_list damage_window_list; ++ struct xorg_list window_list; + + int wayland_fd; + struct wl_display *display; +@@ -179,9 +181,13 @@ struct xwl_screen { + struct xwl_window { + struct xwl_screen *xwl_screen; + struct wl_surface *surface; ++ struct wp_viewport *viewport; ++ int32_t x, y, width, height; ++ float scale_x, scale_y; + struct wl_shell_surface *shell_surface; + WindowPtr window; + struct xorg_list link_damage; ++ struct xorg_list link_window; + struct wl_callback *frame_callback; + Bool allow_commits; + #ifdef GLAMOR_HAS_GBM +@@ -408,6 +414,9 @@ Bool xwl_screen_init_cursor(struct xwl_screen *xwl_screen); + + struct xwl_screen *xwl_screen_get(ScreenPtr screen); + Bool xwl_screen_has_resolution_change_emulation(struct xwl_screen *xwl_screen); ++struct xwl_output *xwl_screen_get_first_output(struct xwl_screen *xwl_screen); ++void xwl_screen_check_resolution_change_emulation(struct xwl_screen *xwl_screen); ++Bool xwl_window_has_viewport_enabled(struct xwl_window *xwl_window); + + void xwl_tablet_tool_set_cursor(struct xwl_tablet_tool *tool); + void xwl_seat_set_cursor(struct xwl_seat *xwl_seat); +@@ -441,6 +450,12 @@ void xwl_output_remove(struct xwl_output *xwl_output); + struct xwl_emulated_mode *xwl_output_get_emulated_mode_for_client( + struct xwl_output *xwl_output, ClientPtr client); + ++RRModePtr xwl_output_find_mode(struct xwl_output *xwl_output, ++ int32_t width, int32_t height); ++void xwl_output_set_emulated_mode(struct xwl_output *xwl_output, ++ ClientPtr client, RRModePtr mode, ++ Bool from_vidmode); ++ + RRModePtr xwayland_cvt(int HDisplay, int VDisplay, + float VRefresh, Bool Reduced, Bool Interlaced); + +-- +2.23.0 + diff --git a/0009-xwayland-Add-xwlRRModeToDisplayMode-helper-function.patch b/0009-xwayland-Add-xwlRRModeToDisplayMode-helper-function.patch new file mode 100644 index 0000000..520eb90 --- /dev/null +++ b/0009-xwayland-Add-xwlRRModeToDisplayMode-helper-function.patch @@ -0,0 +1,100 @@ +From 1ea054bda6618025838c3afb052080b749582454 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Mon, 8 Jul 2019 14:00:27 +0200 +Subject: [PATCH xserver 09/14] xwayland: Add xwlRRModeToDisplayMode() helper + function +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This is a preparation patch for adding emulated mode/resolution change +support to Xwayland's XF86 vidmode extension emulation, using the +Wayland viewport extension. + +Reviewed-by: Olivier Fourdan +Acked-by: Michel Dänzer +Signed-off-by: Hans de Goede +--- + hw/xwayland/xwayland-vidmode.c | 51 +++++++++++++++++++--------------- + 1 file changed, 28 insertions(+), 23 deletions(-) + +diff --git a/hw/xwayland/xwayland-vidmode.c b/hw/xwayland/xwayland-vidmode.c +index 0bcd11401..a59c9f6a9 100644 +--- a/hw/xwayland/xwayland-vidmode.c ++++ b/hw/xwayland/xwayland-vidmode.c +@@ -78,13 +78,37 @@ mode_refresh(const xRRModeInfo *mode_info) + return rate; + } + ++static void ++xwlRRModeToDisplayMode(RRModePtr rrmode, DisplayModePtr mode) ++{ ++ const xRRModeInfo *mode_info = &rrmode->mode; ++ ++ mode->next = mode; ++ mode->prev = mode; ++ mode->name = ""; ++ mode->VScan = 1; ++ mode->Private = NULL; ++ mode->HDisplay = mode_info->width; ++ mode->HSyncStart = mode_info->hSyncStart; ++ mode->HSyncEnd = mode_info->hSyncEnd; ++ mode->HTotal = mode_info->hTotal; ++ mode->HSkew = mode_info->hSkew; ++ mode->VDisplay = mode_info->height; ++ mode->VSyncStart = mode_info->vSyncStart; ++ mode->VSyncEnd = mode_info->vSyncEnd; ++ mode->VTotal = mode_info->vTotal; ++ mode->Flags = mode_info->modeFlags; ++ mode->Clock = mode_info->dotClock / 1000.0; ++ mode->VRefresh = mode_refresh(mode_info); /* Or RRVerticalRefresh() */ ++ mode->HSync = mode_hsync(mode_info); ++} ++ + static Bool + xwlVidModeGetCurrentModeline(ScreenPtr pScreen, DisplayModePtr *mode, int *dotClock) + { + DisplayModePtr pMod; + RROutputPtr output; + RRCrtcPtr crtc; +- xRRModeInfo rrmode; + + pMod = dixLookupPrivate(&pScreen->devPrivates, xwlVidModePrivateKey); + if (pMod == NULL) +@@ -98,30 +122,11 @@ xwlVidModeGetCurrentModeline(ScreenPtr pScreen, DisplayModePtr *mode, int *dotCl + if (crtc == NULL) + return FALSE; + +- rrmode = crtc->mode->mode; +- +- pMod->next = pMod; +- pMod->prev = pMod; +- pMod->name = ""; +- pMod->VScan = 1; +- pMod->Private = NULL; +- pMod->HDisplay = rrmode.width; +- pMod->HSyncStart = rrmode.hSyncStart; +- pMod->HSyncEnd = rrmode.hSyncEnd; +- pMod->HTotal = rrmode.hTotal; +- pMod->HSkew = rrmode.hSkew; +- pMod->VDisplay = rrmode.height; +- pMod->VSyncStart = rrmode.vSyncStart; +- pMod->VSyncEnd = rrmode.vSyncEnd; +- pMod->VTotal = rrmode.vTotal; +- pMod->Flags = rrmode.modeFlags; +- pMod->Clock = rrmode.dotClock / 1000.0; +- pMod->VRefresh = mode_refresh(&rrmode); /* Or RRVerticalRefresh() */ +- pMod->HSync = mode_hsync(&rrmode); +- *mode = pMod; ++ xwlRRModeToDisplayMode(crtc->mode, pMod); + ++ *mode = pMod; + if (dotClock != NULL) +- *dotClock = rrmode.dotClock / 1000.0; ++ *dotClock = pMod->Clock; + + return TRUE; + } +-- +2.23.0 + diff --git a/0010-xwayland-Add-xwlVidModeGetCurrentRRMode-helper-to-th.patch b/0010-xwayland-Add-xwlVidModeGetCurrentRRMode-helper-to-th.patch new file mode 100644 index 0000000..c9ef93d --- /dev/null +++ b/0010-xwayland-Add-xwlVidModeGetCurrentRRMode-helper-to-th.patch @@ -0,0 +1,192 @@ +From 9edd8e37b5e2659a71b05dabed45fd7c3447de79 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Mon, 8 Jul 2019 18:35:27 +0200 +Subject: [PATCH xserver 10/14] xwayland: Add xwlVidModeGetCurrentRRMode helper + to the vidmode code +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +crtc->mode reflects the mode set through the xrandr extension, once we +add support for also changing the mode through the vidmode extension this +will no longer correctly reflect the emulated resolution. + +Add a new xwlVidModeGetCurrentRRMode helper which determines the mode by +looking at the emulated_mode instead. + +Likewise add a xwlVidModeGetRRMode helper and use that in +xwlVidModeCheckModeForMonitor/xwlVidModeCheckModeForDriver to allow any +mode listed in the randr_output's mode list. + +This is a preparation patch for adding emulated mode/resolution change +support to Xwayland's XF86 vidmode extension emulation. + +Reviewed-by: Olivier Fourdan +Acked-by: Michel Dänzer +Signed-off-by: Hans de Goede +--- + hw/xwayland/xwayland-vidmode.c | 90 +++++++++++++++++++++------------- + 1 file changed, 56 insertions(+), 34 deletions(-) + +diff --git a/hw/xwayland/xwayland-vidmode.c b/hw/xwayland/xwayland-vidmode.c +index a59c9f6a9..e9aea7269 100644 +--- a/hw/xwayland/xwayland-vidmode.c ++++ b/hw/xwayland/xwayland-vidmode.c +@@ -103,26 +103,56 @@ xwlRRModeToDisplayMode(RRModePtr rrmode, DisplayModePtr mode) + mode->HSync = mode_hsync(mode_info); + } + ++static RRModePtr ++xwlVidModeGetRRMode(ScreenPtr pScreen, int32_t width, int32_t height) ++{ ++ RROutputPtr output = RRFirstOutput(pScreen); ++ ++ if (output == NULL) ++ return NULL; ++ ++ return xwl_output_find_mode(output->devPrivate, width, height); ++} ++ ++static RRModePtr ++xwlVidModeGetCurrentRRMode(ScreenPtr pScreen) ++{ ++ struct xwl_emulated_mode *emulated_mode; ++ struct xwl_output *xwl_output; ++ RROutputPtr output; ++ ++ output = RRFirstOutput(pScreen); ++ if (output == NULL) ++ return NULL; ++ ++ xwl_output = output->devPrivate; ++ emulated_mode = ++ xwl_output_get_emulated_mode_for_client(xwl_output, GetCurrentClient()); ++ ++ if (emulated_mode) { ++ return xwl_output_find_mode(xwl_output, ++ emulated_mode->width, ++ emulated_mode->height); ++ } else { ++ return xwl_output_find_mode(xwl_output, -1, -1); ++ } ++} ++ + static Bool + xwlVidModeGetCurrentModeline(ScreenPtr pScreen, DisplayModePtr *mode, int *dotClock) + { + DisplayModePtr pMod; +- RROutputPtr output; +- RRCrtcPtr crtc; ++ RRModePtr rrmode; + + pMod = dixLookupPrivate(&pScreen->devPrivates, xwlVidModePrivateKey); + if (pMod == NULL) + return FALSE; + +- output = RRFirstOutput(pScreen); +- if (output == NULL) +- return FALSE; +- +- crtc = output->crtc; +- if (crtc == NULL) ++ rrmode = xwlVidModeGetCurrentRRMode(pScreen); ++ if (rrmode == NULL) + return FALSE; + +- xwlRRModeToDisplayMode(crtc->mode, pMod); ++ xwlRRModeToDisplayMode(rrmode, pMod); + + *mode = pMod; + if (dotClock != NULL) +@@ -135,9 +165,10 @@ static vidMonitorValue + xwlVidModeGetMonitorValue(ScreenPtr pScreen, int valtyp, int indx) + { + vidMonitorValue ret = { NULL, }; +- DisplayModePtr pMod; ++ RRModePtr rrmode; + +- if (!xwlVidModeGetCurrentModeline(pScreen, &pMod, NULL)) ++ rrmode = xwlVidModeGetCurrentRRMode(pScreen); ++ if (rrmode == NULL) + return ret; + + switch (valtyp) { +@@ -155,11 +186,11 @@ xwlVidModeGetMonitorValue(ScreenPtr pScreen, int valtyp, int indx) + break; + case VIDMODE_MON_HSYNC_LO: + case VIDMODE_MON_HSYNC_HI: +- ret.f = 100.0 * pMod->HSync; ++ ret.f = mode_hsync(&rrmode->mode) * 100.0; + break; + case VIDMODE_MON_VREFRESH_LO: + case VIDMODE_MON_VREFRESH_HI: +- ret.f = 100.0 * pMod->VRefresh; ++ ret.f = mode_refresh(&rrmode->mode) * 100.0; + break; + } + return ret; +@@ -168,13 +199,13 @@ xwlVidModeGetMonitorValue(ScreenPtr pScreen, int valtyp, int indx) + static int + xwlVidModeGetDotClock(ScreenPtr pScreen, int Clock) + { +- DisplayModePtr pMod; ++ RRModePtr rrmode; + +- if (!xwlVidModeGetCurrentModeline(pScreen, &pMod, NULL)) ++ rrmode = xwlVidModeGetCurrentRRMode(pScreen); ++ if (rrmode == NULL) + return 0; + +- return pMod->Clock; +- ++ return rrmode->mode.dotClock / 1000.0; + } + + static int +@@ -272,14 +303,15 @@ xwlVidModeLockZoom(ScreenPtr pScreen, Bool lock) + static ModeStatus + xwlVidModeCheckModeForMonitor(ScreenPtr pScreen, DisplayModePtr mode) + { +- DisplayModePtr pMod; ++ RRModePtr rrmode; + +- /* This should not happen */ +- if (!xwlVidModeGetCurrentModeline(pScreen, &pMod, NULL)) ++ rrmode = xwlVidModeGetRRMode(pScreen, mode->HDisplay, mode->VDisplay); ++ if (rrmode == NULL) + return MODE_ERROR; + + /* Only support mode with the same HSync/VRefresh as we advertise */ +- if (mode->HSync == pMod->HSync && mode->VRefresh == pMod->VRefresh) ++ if (mode->HSync == mode_hsync(&rrmode->mode) && ++ mode->VRefresh == mode_refresh(&rrmode->mode)) + return MODE_OK; + + /* All the rest is unsupported - If we want to succeed, return MODE_OK instead */ +@@ -289,20 +321,10 @@ xwlVidModeCheckModeForMonitor(ScreenPtr pScreen, DisplayModePtr mode) + static ModeStatus + xwlVidModeCheckModeForDriver(ScreenPtr pScreen, DisplayModePtr mode) + { +- DisplayModePtr pMod; +- +- /* This should not happen */ +- if (!xwlVidModeGetCurrentModeline(pScreen, &pMod, NULL)) +- return MODE_ERROR; +- +- if (mode->HTotal != pMod->HTotal) +- return MODE_BAD_HVALUE; ++ RRModePtr rrmode; + +- if (mode->VTotal != pMod->VTotal) +- return MODE_BAD_VVALUE; +- +- /* Unsupported for now, but pretend it works */ +- return MODE_OK; ++ rrmode = xwlVidModeGetRRMode(pScreen, mode->HDisplay, mode->VDisplay); ++ return rrmode ? MODE_OK : MODE_ERROR; + } + + static void +-- +2.23.0 + diff --git a/0011-xwayland-Add-vidmode-mode-changing-emulation-support.patch b/0011-xwayland-Add-vidmode-mode-changing-emulation-support.patch new file mode 100644 index 0000000..99ebbae --- /dev/null +++ b/0011-xwayland-Add-vidmode-mode-changing-emulation-support.patch @@ -0,0 +1,235 @@ +From 984691516d78284a8ab63058b0c1d3c68666a7d9 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Tue, 9 Jul 2019 09:31:13 +0200 +Subject: [PATCH xserver 11/14] xwayland: Add vidmode mode changing emulation + support +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Add support for fake mode changes using viewport, for apps which want to +change the resolution when going fullscreen. + +Reviewed-by: Olivier Fourdan +Acked-by: Michel Dänzer +Signed-off-by: Hans de Goede +--- + hw/xwayland/xwayland-vidmode.c | 130 ++++++++++++++++++++++----------- + 1 file changed, 86 insertions(+), 44 deletions(-) + +diff --git a/hw/xwayland/xwayland-vidmode.c b/hw/xwayland/xwayland-vidmode.c +index e9aea7269..56aac693a 100644 +--- a/hw/xwayland/xwayland-vidmode.c ++++ b/hw/xwayland/xwayland-vidmode.c +@@ -106,26 +106,25 @@ xwlRRModeToDisplayMode(RRModePtr rrmode, DisplayModePtr mode) + static RRModePtr + xwlVidModeGetRRMode(ScreenPtr pScreen, int32_t width, int32_t height) + { +- RROutputPtr output = RRFirstOutput(pScreen); ++ struct xwl_screen *xwl_screen = xwl_screen_get(pScreen); ++ struct xwl_output *xwl_output = xwl_screen_get_first_output(xwl_screen); + +- if (output == NULL) ++ if (!xwl_output) + return NULL; + +- return xwl_output_find_mode(output->devPrivate, width, height); ++ return xwl_output_find_mode(xwl_output, width, height); + } + + static RRModePtr + xwlVidModeGetCurrentRRMode(ScreenPtr pScreen) + { ++ struct xwl_screen *xwl_screen = xwl_screen_get(pScreen); ++ struct xwl_output *xwl_output = xwl_screen_get_first_output(xwl_screen); + struct xwl_emulated_mode *emulated_mode; +- struct xwl_output *xwl_output; +- RROutputPtr output; + +- output = RRFirstOutput(pScreen); +- if (output == NULL) ++ if (!xwl_output) + return NULL; + +- xwl_output = output->devPrivate; + emulated_mode = + xwl_output_get_emulated_mode_for_client(xwl_output, GetCurrentClient()); + +@@ -199,39 +198,79 @@ xwlVidModeGetMonitorValue(ScreenPtr pScreen, int valtyp, int indx) + static int + xwlVidModeGetDotClock(ScreenPtr pScreen, int Clock) + { +- RRModePtr rrmode; +- +- rrmode = xwlVidModeGetCurrentRRMode(pScreen); +- if (rrmode == NULL) +- return 0; +- +- return rrmode->mode.dotClock / 1000.0; ++ return Clock; + } + + static int + xwlVidModeGetNumOfClocks(ScreenPtr pScreen, Bool *progClock) + { +- return 1; ++ /* We emulate a programmable clock, rather then a fixed set of clocks */ ++ *progClock = TRUE; ++ return 0; + } + + static Bool + xwlVidModeGetClocks(ScreenPtr pScreen, int *Clocks) + { +- *Clocks = xwlVidModeGetDotClock(pScreen, 0); +- +- return TRUE; ++ return FALSE; /* Programmable clock, no clock list */ + } + ++/* GetFirstModeline and GetNextModeline are used from Xext/vidmode.c like this: ++ * if (pVidMode->GetFirstModeline(pScreen, &mode, &dotClock)) { ++ * do { ++ * ... ++ * if (...) ++ * break; ++ * } while (pVidMode->GetNextModeline(pScreen, &mode, &dotClock)); ++ * } ++ * IOW our caller basically always loops over all the modes. There never is a ++ * return to the mainloop between GetFirstModeline and NextModeline calls where ++ * other parts of the server may change our state so we do not need to worry ++ * about xwl_output->randr_output->modes changing underneath us. ++ * Thus we can simply implement these two callbacks by storing the enumeration ++ * index in pVidMode->Next. ++ */ ++ + static Bool + xwlVidModeGetNextModeline(ScreenPtr pScreen, DisplayModePtr *mode, int *dotClock) + { +- return FALSE; ++ struct xwl_screen *xwl_screen = xwl_screen_get(pScreen); ++ struct xwl_output *xwl_output = xwl_screen_get_first_output(xwl_screen); ++ VidModePtr pVidMode; ++ DisplayModePtr pMod; ++ intptr_t index; ++ ++ pMod = dixLookupPrivate(&pScreen->devPrivates, xwlVidModePrivateKey); ++ pVidMode = VidModeGetPtr(pScreen); ++ if (xwl_output == NULL || pMod == NULL || pVidMode == NULL) ++ return FALSE; ++ ++ index = (intptr_t)pVidMode->Next; ++ if (index >= xwl_output->randr_output->numModes) ++ return FALSE; ++ xwlRRModeToDisplayMode(xwl_output->randr_output->modes[index], pMod); ++ index++; ++ pVidMode->Next = (void *)index; ++ ++ *mode = pMod; ++ if (dotClock != NULL) ++ *dotClock = pMod->Clock; ++ ++ return TRUE; + } + + static Bool + xwlVidModeGetFirstModeline(ScreenPtr pScreen, DisplayModePtr *mode, int *dotClock) + { +- return xwlVidModeGetCurrentModeline(pScreen, mode, dotClock); ++ VidModePtr pVidMode; ++ intptr_t index = 0; ++ ++ pVidMode = VidModeGetPtr(pScreen); ++ if (pVidMode == NULL) ++ return FALSE; ++ ++ pVidMode->Next = (void *)index; /* 0 */ ++ return xwlVidModeGetNextModeline(pScreen, mode, dotClock); + } + + static Bool +@@ -251,37 +290,27 @@ xwlVidModeZoomViewport(ScreenPtr pScreen, int zoom) + static Bool + xwlVidModeSetViewPort(ScreenPtr pScreen, int x, int y) + { +- RROutputPtr output; +- RRCrtcPtr crtc; ++ struct xwl_screen *xwl_screen = xwl_screen_get(pScreen); ++ struct xwl_output *xwl_output = xwl_screen_get_first_output(xwl_screen); + +- output = RRFirstOutput(pScreen); +- if (output == NULL) +- return FALSE; +- +- crtc = output->crtc; +- if (crtc == NULL) ++ if (!xwl_output) + return FALSE; + + /* Support only default viewport */ +- return (x == crtc->x && y == crtc->y); ++ return (x == xwl_output->x && y == xwl_output->y); + } + + static Bool + xwlVidModeGetViewPort(ScreenPtr pScreen, int *x, int *y) + { +- RROutputPtr output; +- RRCrtcPtr crtc; ++ struct xwl_screen *xwl_screen = xwl_screen_get(pScreen); ++ struct xwl_output *xwl_output = xwl_screen_get_first_output(xwl_screen); + +- output = RRFirstOutput(pScreen); +- if (output == NULL) ++ if (!xwl_output) + return FALSE; + +- crtc = output->crtc; +- if (crtc == NULL) +- return FALSE; +- +- *x = crtc->x; +- *y = crtc->y; ++ *x = xwl_output->x; ++ *y = xwl_output->y; + + return TRUE; + } +@@ -289,8 +318,19 @@ xwlVidModeGetViewPort(ScreenPtr pScreen, int *x, int *y) + static Bool + xwlVidModeSwitchMode(ScreenPtr pScreen, DisplayModePtr mode) + { +- /* Unsupported for now */ +- return FALSE; ++ struct xwl_screen *xwl_screen = xwl_screen_get(pScreen); ++ struct xwl_output *xwl_output = xwl_screen_get_first_output(xwl_screen); ++ RRModePtr rrmode; ++ ++ if (!xwl_output) ++ return FALSE; ++ ++ rrmode = xwl_output_find_mode(xwl_output, mode->HDisplay, mode->VDisplay); ++ if (rrmode == NULL) ++ return FALSE; ++ ++ xwl_output_set_emulated_mode(xwl_output, GetCurrentClient(), rrmode, TRUE); ++ return TRUE; + } + + static Bool +@@ -344,8 +384,10 @@ xwlVidModeAddModeline(ScreenPtr pScreen, DisplayModePtr mode) + static int + xwlVidModeGetNumOfModes(ScreenPtr pScreen) + { +- /* We have only one mode */ +- return 1; ++ struct xwl_screen *xwl_screen = xwl_screen_get(pScreen); ++ struct xwl_output *xwl_output = xwl_screen_get_first_output(xwl_screen); ++ ++ return xwl_output ? xwl_output->randr_output->numModes : 0; + } + + static Bool +-- +2.23.0 + diff --git a/0012-xwayland-xwl_window_should_enable_viewport-Add-extra.patch b/0012-xwayland-xwl_window_should_enable_viewport-Add-extra.patch new file mode 100644 index 0000000..4ec587b --- /dev/null +++ b/0012-xwayland-xwl_window_should_enable_viewport-Add-extra.patch @@ -0,0 +1,56 @@ +From 912688326c0f9435660e86a2bdab049caa4b0e9f Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Mon, 26 Aug 2019 12:26:34 +0200 +Subject: [PATCH xserver 12/14] xwayland: xwl_window_should_enable_viewport: + Add extra test +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Games based on the allegro gaming library or on ClanLib-1.0 do not size +their window to match the fullscreen resolution, instead they use a +window covering the entire screen, drawing only the fullscreen resolution +part of it. + +This commit adds a check for these games, so that we correctly apply a +viewport to them making fullscreen work properly for these games under +Xwayland. + +Reviewed-by: Olivier Fourdan +Acked-by: Michel Dänzer +Signed-off-by: Hans de Goede +--- + hw/xwayland/xwayland.c | 17 +++++++++++++++++ + 1 file changed, 17 insertions(+) + +diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c +index ec1b7eee4..58252d2e8 100644 +--- a/hw/xwayland/xwayland.c ++++ b/hw/xwayland/xwayland.c +@@ -636,6 +636,23 @@ xwl_window_should_enable_viewport(struct xwl_window *xwl_window, + } + } + ++ /* 2. Test if the window uses override-redirect + vidmode ++ * and matches (fully covers) the entire screen. ++ * This path gets hit by: allegro4, ClanLib-1.0. ++ */ ++ xwl_output = xwl_screen_get_first_output(xwl_screen); ++ emulated_mode = xwl_output_get_emulated_mode_for_client(xwl_output, owner); ++ if (xwl_output && xwl_window->window->overrideRedirect && ++ emulated_mode && emulated_mode->from_vidmode && ++ xwl_window->x == 0 && xwl_window->y == 0 && ++ xwl_window->width == xwl_screen->width && ++ xwl_window->height == xwl_screen->height) { ++ ++ *emulated_mode_ret = emulated_mode; ++ *xwl_output_ret = xwl_output; ++ return TRUE; ++ } ++ + return FALSE; + } + +-- +2.23.0 + diff --git a/0013-xwayland-Set-_XWAYLAND_RANDR_EMU_MONITOR_RECTS-prope.patch b/0013-xwayland-Set-_XWAYLAND_RANDR_EMU_MONITOR_RECTS-prope.patch new file mode 100644 index 0000000..500d1f5 --- /dev/null +++ b/0013-xwayland-Set-_XWAYLAND_RANDR_EMU_MONITOR_RECTS-prope.patch @@ -0,0 +1,204 @@ +From d9f1d6f51f4c2d388214a675330b58ba2facb170 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Mon, 2 Sep 2019 17:32:45 +0200 +Subject: [PATCH xserver 13/14] xwayland: Set _XWAYLAND_RANDR_EMU_MONITOR_RECTS + property for resolution emulation +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Apps using randr to change the resolution when going fullscreen, in +combination with _NET_WM_STATE_FULLSCREEN to tell the window-manager (WM) +to make their window fullscreen, expect the WM to give the fullscreen window +the size of the emulated resolution as would happen when run under Xorg (*). + +We need the WM to emulate this behavior for these apps to work correctly, +with Xwaylands resolution change emulation. For the WM to emulate this, +it needs to know about the emulated resolution for the Windows owning +client for each monitor. + +This commit adds a _XWAYLAND_RANDR_EMU_MONITOR_RECTS property, which +contains 4 Cardinals (32 bit integers) per monitor with resolution +emulation info. Window-managers can use this to get the emulated +resolution for the client and size the window correctly. + +*) Since under Xorg the resolution will actually be changed and after that +going fullscreen through NET_WM_STATE_FULLSCREEN will size the window to +be equal to the new resolution. + +Reviewed-by: Olivier Fourdan +Acked-by: Michel Dänzer +Signed-off-by: Hans de Goede +--- + hw/xwayland/xwayland-output.c | 77 +++++++++++++++++++++++++++++++++++ + hw/xwayland/xwayland.c | 23 +++++++++++ + hw/xwayland/xwayland.h | 3 ++ + 3 files changed, 103 insertions(+) + +diff --git a/hw/xwayland/xwayland-output.c b/hw/xwayland/xwayland-output.c +index 99ab1b288..20c254962 100644 +--- a/hw/xwayland/xwayland-output.c ++++ b/hw/xwayland/xwayland-output.c +@@ -29,6 +29,7 @@ + + #include "xwayland.h" + #include ++#include + + #define DEFAULT_DPI 96 + #define ALL_ROTATIONS (RR_Rotate_0 | \ +@@ -428,6 +429,80 @@ xwl_output_find_mode(struct xwl_output *xwl_output, + return NULL; + } + ++struct xwl_output_randr_emu_prop { ++ Atom atom; ++ uint32_t rects[XWL_CLIENT_MAX_EMULATED_MODES][4]; ++ int rect_count; ++}; ++ ++static void ++xwl_output_randr_emu_prop(struct xwl_screen *xwl_screen, ClientPtr client, ++ struct xwl_output_randr_emu_prop *prop) ++{ ++ static const char atom_name[] = "_XWAYLAND_RANDR_EMU_MONITOR_RECTS"; ++ struct xwl_emulated_mode *emulated_mode; ++ struct xwl_output *xwl_output; ++ int index = 0; ++ ++ prop->atom = MakeAtom(atom_name, strlen(atom_name), TRUE); ++ ++ xorg_list_for_each_entry(xwl_output, &xwl_screen->output_list, link) { ++ emulated_mode = xwl_output_get_emulated_mode_for_client(xwl_output, client); ++ if (!emulated_mode) ++ continue; ++ ++ prop->rects[index][0] = xwl_output->x; ++ prop->rects[index][1] = xwl_output->y; ++ prop->rects[index][2] = emulated_mode->width; ++ prop->rects[index][3] = emulated_mode->height; ++ index++; ++ } ++ ++ prop->rect_count = index; ++} ++ ++static void ++xwl_output_set_randr_emu_prop(WindowPtr window, ++ struct xwl_output_randr_emu_prop *prop) ++{ ++ if (!xwl_window_is_toplevel(window)) ++ return; ++ ++ if (prop->rect_count) { ++ dixChangeWindowProperty(serverClient, window, prop->atom, ++ XA_CARDINAL, 32, PropModeReplace, ++ prop->rect_count * 4, prop->rects, TRUE); ++ } else { ++ DeleteProperty(serverClient, window, prop->atom); ++ } ++} ++ ++static void ++xwl_output_set_randr_emu_prop_callback(void *resource, XID id, void *user_data) ++{ ++ xwl_output_set_randr_emu_prop(resource, user_data); ++} ++ ++static void ++xwl_output_set_randr_emu_props(struct xwl_screen *xwl_screen, ClientPtr client) ++{ ++ struct xwl_output_randr_emu_prop prop = {}; ++ ++ xwl_output_randr_emu_prop(xwl_screen, client, &prop); ++ FindClientResourcesByType(client, RT_WINDOW, ++ xwl_output_set_randr_emu_prop_callback, &prop); ++} ++ ++void ++xwl_output_set_window_randr_emu_props(struct xwl_screen *xwl_screen, ++ WindowPtr window) ++{ ++ struct xwl_output_randr_emu_prop prop = {}; ++ ++ xwl_output_randr_emu_prop(xwl_screen, wClient(window), &prop); ++ xwl_output_set_randr_emu_prop(window, &prop); ++} ++ + void + xwl_output_set_emulated_mode(struct xwl_output *xwl_output, ClientPtr client, + RRModePtr mode, Bool from_vidmode) +@@ -442,6 +517,8 @@ xwl_output_set_emulated_mode(struct xwl_output *xwl_output, ClientPtr client, + xwl_output_add_emulated_mode_for_client(xwl_output, client, mode, from_vidmode); + + xwl_screen_check_resolution_change_emulation(xwl_output->xwl_screen); ++ ++ xwl_output_set_randr_emu_props(xwl_output->xwl_screen, client); + } + + static void +diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c +index 58252d2e8..75ff9f011 100644 +--- a/hw/xwayland/xwayland.c ++++ b/hw/xwayland/xwayland.c +@@ -677,6 +677,27 @@ xwl_screen_check_resolution_change_emulation(struct xwl_screen *xwl_screen) + xwl_window_check_resolution_change_emulation(xwl_window); + } + ++/* This checks if the passed in Window is a toplevel client window, note this ++ * returns false for window-manager decoration windows and returns true for ++ * the actual client top-level window even if it has been reparented to ++ * a window-manager decoration window. ++ */ ++Bool ++xwl_window_is_toplevel(WindowPtr window) ++{ ++ struct xwl_screen *xwl_screen = xwl_screen_get(window->drawable.pScreen); ++ ++ if (xwl_screen_client_is_window_manager(xwl_screen, wClient(window))) ++ return FALSE; ++ ++ /* CSD and override-redirect toplevel windows */ ++ if (window_get_damage(window)) ++ return TRUE; ++ ++ /* Normal toplevel client windows, reparented to decoration window */ ++ return (window->parent && window_get_damage(window->parent)); ++} ++ + static void + xwl_window_init_allow_commits(struct xwl_window *xwl_window) + { +@@ -838,6 +859,8 @@ xwl_realize_window(WindowPtr window) + return FALSE; + } + ++ xwl_output_set_window_randr_emu_props(xwl_screen, window); ++ + return ensure_surface_for_window(window); + } + +diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h +index b52de11d2..2d825ee8c 100644 +--- a/hw/xwayland/xwayland.h ++++ b/hw/xwayland/xwayland.h +@@ -417,6 +417,7 @@ Bool xwl_screen_has_resolution_change_emulation(struct xwl_screen *xwl_screen); + struct xwl_output *xwl_screen_get_first_output(struct xwl_screen *xwl_screen); + void xwl_screen_check_resolution_change_emulation(struct xwl_screen *xwl_screen); + Bool xwl_window_has_viewport_enabled(struct xwl_window *xwl_window); ++Bool xwl_window_is_toplevel(WindowPtr window); + + void xwl_tablet_tool_set_cursor(struct xwl_tablet_tool *tool); + void xwl_seat_set_cursor(struct xwl_seat *xwl_seat); +@@ -455,6 +456,8 @@ RRModePtr xwl_output_find_mode(struct xwl_output *xwl_output, + void xwl_output_set_emulated_mode(struct xwl_output *xwl_output, + ClientPtr client, RRModePtr mode, + Bool from_vidmode); ++void xwl_output_set_window_randr_emu_props(struct xwl_screen *xwl_screen, ++ WindowPtr window); + + RRModePtr xwayland_cvt(int HDisplay, int VDisplay, + float VRefresh, Bool Reduced, Bool Interlaced); +-- +2.23.0 + diff --git a/0014-xwayland-Fix-emulated-modes-not-being-removed-when-s.patch b/0014-xwayland-Fix-emulated-modes-not-being-removed-when-s.patch new file mode 100644 index 0000000..5d04e5d --- /dev/null +++ b/0014-xwayland-Fix-emulated-modes-not-being-removed-when-s.patch @@ -0,0 +1,61 @@ +From c392765d459bd2cac6e3f431c67d698bb905e0ab Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Mon, 7 Oct 2019 14:27:49 +0200 +Subject: [PATCH xserver 14/14] xwayland: Fix emulated modes not being removed + when screen rotation is used + +The code building the mode-list does the following to deal with screen +rotation: + + if (need_rotate || xwl_output->rotation & (RR_Rotate_0 | RR_Rotate_180)) { + mode_width = xwl_output->width; + mode_height = xwl_output->height; + } else { + mode_width = xwl_output->height; + mode_height = xwl_output->width; + } + +This means we need to do something similar in xwl_output_set_emulated_mode() +to determine if the mode being set is the actual (not-emulated) output mode +and we this should remove any emulated modes set by the client. + +All callers of xwl_output_set_emulated_mode always pass a mode pointer +to a member of xwl_output->randr_output->modes, so we do not need to +duplicate this code, instead we can simply check that the passed in mode +is modes[0] which always is the actual output mode. + +Signed-off-by: Hans de Goede +--- + hw/xwayland/xwayland-output.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/hw/xwayland/xwayland-output.c b/hw/xwayland/xwayland-output.c +index 20c254962..7d705d919 100644 +--- a/hw/xwayland/xwayland-output.c ++++ b/hw/xwayland/xwayland-output.c +@@ -309,8 +309,11 @@ xwl_output_remove_emulated_mode_for_client(struct xwl_output *xwl_output, + struct xwl_emulated_mode *emulated_mode; + + emulated_mode = xwl_output_get_emulated_mode_for_client(xwl_output, client); +- if (emulated_mode) ++ if (emulated_mode) { ++ DebugF("XWAYLAND: xwl_output_remove_emulated_mode: %dx%d\n", ++ emulated_mode->width, emulated_mode->height); + memset(emulated_mode, 0, sizeof(*emulated_mode)); ++ } + } + + /* From hw/xfree86/common/xf86DefModeSet.c with some obscure modes dropped */ +@@ -511,7 +514,8 @@ xwl_output_set_emulated_mode(struct xwl_output *xwl_output, ClientPtr client, + from_vidmode ? "vidmode" : "randr", + mode->mode.width, mode->mode.height); + +- if (mode->mode.width == xwl_output->width && mode->mode.height == xwl_output->height) ++ /* modes[0] is the actual (not-emulated) output mode */ ++ if (mode == xwl_output->randr_output->modes[0]) + xwl_output_remove_emulated_mode_for_client(xwl_output, client); + else + xwl_output_add_emulated_mode_for_client(xwl_output, client, mode, from_vidmode); +-- +2.23.0 + diff --git a/0015-xwayland-Call-xwl_window_check_resolution_change_emu.patch b/0015-xwayland-Call-xwl_window_check_resolution_change_emu.patch new file mode 100644 index 0000000..57ff541 --- /dev/null +++ b/0015-xwayland-Call-xwl_window_check_resolution_change_emu.patch @@ -0,0 +1,46 @@ +From 01629caef21b77cfabc052408eb04699e4fa5143 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Mon, 4 Nov 2019 11:46:49 +0100 +Subject: [PATCH xserver 15/17] xwayland: Call + xwl_window_check_resolution_change_emulation() on newly created O-R windows + +Some clients, which use vidmode to change the resolution when going fullscreen, +create an override-redirect window and never trigger the screen->ResizeWindow +callback we rely on to do the xwl_window_check_resolution_change_emulation(). + +This causes us to not apply a viewport to them, causing the fullscreen window +to not fill the entire monitor. + +This commit adds a call to xwl_window_check_resolution_change_emulation() +at the end of ensure_surface_for_window() to fix this. Note that +ensure_surface_for_window() exits early without creating an xwl_window +for new windows which will not be backed by a wayland surface and which +thus will not have an xwl_window. + +This fixes ClanLib-0.6.x and alleggl-4.4.x using apps not properly +fullscreening. + +Signed-off-by: Hans de Goede +--- + hw/xwayland/xwayland.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c +index 75ff9f011..ed1d671ff 100644 +--- a/hw/xwayland/xwayland.c ++++ b/hw/xwayland/xwayland.c +@@ -815,6 +815,11 @@ ensure_surface_for_window(WindowPtr window) + + xwl_window_init_allow_commits(xwl_window); + ++ if (!xwl_screen_client_is_window_manager(xwl_screen, wClient(window))) { ++ /* CSD or O-R toplevel window, check viewport on creation */ ++ xwl_window_check_resolution_change_emulation(xwl_window); ++ } ++ + return TRUE; + + err_surf: +-- +2.23.0 + diff --git a/0016-xwayland-Fix-setting-of-_XWAYLAND_RANDR_EMU_MONITOR_.patch b/0016-xwayland-Fix-setting-of-_XWAYLAND_RANDR_EMU_MONITOR_.patch new file mode 100644 index 0000000..fd47895 --- /dev/null +++ b/0016-xwayland-Fix-setting-of-_XWAYLAND_RANDR_EMU_MONITOR_.patch @@ -0,0 +1,65 @@ +From 2db2fcb97bd148476817634486cb384a1f623fa9 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Mon, 4 Nov 2019 14:32:29 +0100 +Subject: [PATCH xserver 16/17] xwayland: Fix setting of + _XWAYLAND_RANDR_EMU_MONITOR_RECTS prop on new windows + +For window-manager managed windows, xwl_realize_window is only called for +the window-manager's decoration window and not for the actual client window +on which we should set the _XWAYLAND_RANDR_EMU_MONITOR_RECTS prop. + +Usualy this is not a problem since we walk all client windows to update +the property when the resolution is changed through a randr call. + +But for apps which first do the randr change and only then create their +window this does not work, and our xwl_output_set_window_randr_emu_props +call in xwl_realize_window is a no-op as that is only called for the wm +decoration window and not for the actual client's window. + +This commit fixes this by making ensure_surface_for_window() call +xwl_output_set_window_randr_emu_props on the first and only child of +window-manager managed windows. + +Note this also removes the non-functional xwl_output_set_window_randr_emu_props +call from xwl_realize_window, which was intended to do this, but does not +work. + +This fixes apps using the ogre3d library always running at the +monitors native resolution. + +Signed-off-by: Hans de Goede +--- + hw/xwayland/xwayland.c | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c +index ed1d671ff..1ce29c51c 100644 +--- a/hw/xwayland/xwayland.c ++++ b/hw/xwayland/xwayland.c +@@ -815,7 +815,13 @@ ensure_surface_for_window(WindowPtr window) + + xwl_window_init_allow_commits(xwl_window); + +- if (!xwl_screen_client_is_window_manager(xwl_screen, wClient(window))) { ++ /* When a new windom-manager decoration window is realized, then the randr ++ * emulation props have not been set on the managed client window yet. ++ */ ++ if (xwl_screen_client_is_window_manager(xwl_screen, wClient(window))) { ++ if (window->firstChild && window->firstChild == window->lastChild) ++ xwl_output_set_window_randr_emu_props(xwl_screen, window->firstChild); ++ } else { + /* CSD or O-R toplevel window, check viewport on creation */ + xwl_window_check_resolution_change_emulation(xwl_window); + } +@@ -864,8 +870,6 @@ xwl_realize_window(WindowPtr window) + return FALSE; + } + +- xwl_output_set_window_randr_emu_props(xwl_screen, window); +- + return ensure_surface_for_window(window); + } + +-- +2.23.0 + diff --git a/0017-xwayland-Remove-unnecessary-xwl_window_is_toplevel-c.patch b/0017-xwayland-Remove-unnecessary-xwl_window_is_toplevel-c.patch new file mode 100644 index 0000000..db3b4d9 --- /dev/null +++ b/0017-xwayland-Remove-unnecessary-xwl_window_is_toplevel-c.patch @@ -0,0 +1,47 @@ +From f73305cc415d2fd464aae4b0dc72558fd1b6bd81 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Mon, 4 Nov 2019 15:01:18 +0100 +Subject: [PATCH xserver 17/17] xwayland: Remove unnecessary + xwl_window_is_toplevel() check from xwl_output_set_window_randr_emu_props() + +Since the recent fix to call xwl_output_set_window_randr_emu_props() from +ensure_surface_for_window(), it is now only called on a toplevel window, +so the is-toplevel check is not necessary for the +xwl_output_set_window_randr_emu_props() case. + +This commit moves the check to xwl_output_set_randr_emu_prop_callback() +so that we only do it when we are walking over all Windows of a client +to update the property on a change of the emulated resolution. + +Signed-off-by: Hans de Goede +--- + hw/xwayland/xwayland-output.c | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +diff --git a/hw/xwayland/xwayland-output.c b/hw/xwayland/xwayland-output.c +index 7d705d919..084b669e4 100644 +--- a/hw/xwayland/xwayland-output.c ++++ b/hw/xwayland/xwayland-output.c +@@ -468,9 +468,6 @@ static void + xwl_output_set_randr_emu_prop(WindowPtr window, + struct xwl_output_randr_emu_prop *prop) + { +- if (!xwl_window_is_toplevel(window)) +- return; +- + if (prop->rect_count) { + dixChangeWindowProperty(serverClient, window, prop->atom, + XA_CARDINAL, 32, PropModeReplace, +@@ -483,7 +480,8 @@ xwl_output_set_randr_emu_prop(WindowPtr window, + static void + xwl_output_set_randr_emu_prop_callback(void *resource, XID id, void *user_data) + { +- xwl_output_set_randr_emu_prop(resource, user_data); ++ if (xwl_window_is_toplevel(resource)) ++ xwl_output_set_randr_emu_prop(resource, user_data); + } + + static void +-- +2.23.0 + diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index c850ed6..6f605a3 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -46,7 +46,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.20.5 -Release: 7%{?gitdate:.%{gitdate}}%{?dist} +Release: 8%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org License: MIT @@ -137,6 +137,25 @@ Patch44: 0013-xwayland-Separate-DamagePtr-into-separate-window-dat.patch Patch45: 0014-xwayland-Refactor-surface-creation-into-a-separate-f.patch Patch46: 0015-xwayland-Handle-the-case-of-windows-being-realized-b.patch +# Backported Xwayland randr resolution change emulation support +Patch47: 0001-dix-Add-GetCurrentClient-helper.patch +Patch48: 0002-xwayland-Add-wp_viewport-wayland-extension-support.patch +Patch49: 0003-xwayland-Use-buffer_damage-instead-of-surface-damage.patch +Patch50: 0004-xwayland-Add-fake-output-modes-to-xrandr-output-mode.patch +Patch51: 0005-xwayland-Use-RandR-1.2-interface-rev-2.patch +Patch52: 0006-xwayland-Add-per-client-private-data.patch +Patch53: 0007-xwayland-Add-support-for-storing-per-client-per-outp.patch +Patch54: 0008-xwayland-Add-support-for-randr-resolution-change-emu.patch +Patch55: 0009-xwayland-Add-xwlRRModeToDisplayMode-helper-function.patch +Patch56: 0010-xwayland-Add-xwlVidModeGetCurrentRRMode-helper-to-th.patch +Patch57: 0011-xwayland-Add-vidmode-mode-changing-emulation-support.patch +Patch58: 0012-xwayland-xwl_window_should_enable_viewport-Add-extra.patch +Patch59: 0013-xwayland-Set-_XWAYLAND_RANDR_EMU_MONITOR_RECTS-prope.patch +Patch60: 0014-xwayland-Fix-emulated-modes-not-being-removed-when-s.patch +Patch61: 0015-xwayland-Call-xwl_window_check_resolution_change_emu.patch +Patch62: 0016-xwayland-Fix-setting-of-_XWAYLAND_RANDR_EMU_MONITOR_.patch +Patch63: 0017-xwayland-Remove-unnecessary-xwl_window_is_toplevel-c.patch + BuildRequires: systemtap-sdt-devel BuildRequires: git BuildRequires: automake autoconf libtool pkgconfig @@ -561,6 +580,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Mon Nov 4 2019 Hans de Goede - 1.20.5-8 +- Backport Xwayland randr resolution change emulation support + * Thu Aug 29 2019 Olivier Fourdan 1.20.5-7 - Pick latest fixes from xserver stable branch upstream (rhbz#1729925) From f1f3380dc7bb895ead3bdc5d7e8897e6b30d0311 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 4 Nov 2019 19:35:08 +0100 Subject: [PATCH 044/131] Fix building with new libglvnd provided gl.pc --- ...wer-gl-version-to-work-with-libglvnd.patch | 64 +++++++++++++++++++ xorg-x11-server.spec | 8 ++- 2 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 0001-build-glx-Lower-gl-version-to-work-with-libglvnd.patch diff --git a/0001-build-glx-Lower-gl-version-to-work-with-libglvnd.patch b/0001-build-glx-Lower-gl-version-to-work-with-libglvnd.patch new file mode 100644 index 0000000..11f9c39 --- /dev/null +++ b/0001-build-glx-Lower-gl-version-to-work-with-libglvnd.patch @@ -0,0 +1,64 @@ +From e6ef2b12404dfec7f23592a3524d2a63d9d25802 Mon Sep 17 00:00:00 2001 +From: Marvin Schmidt +Date: Tue, 24 Sep 2019 09:58:43 +0200 +Subject: [PATCH xserver] build: glx: Lower gl version to work with libglvnd + +When using mesa with libglvnd support, mesa will no longer install the +gl, glx, egl pkg-config files but instead let libglvnd provide them. +libglvnd maintainers decided to change the versioning as it was +mesa-specific previously. Now the libraries have versions of the API +they expose[1]. +This causes problems when building the X server: + + checking for glproto >= 1.4.17 gl >= 9.2.0... no + configure: error: Package requirements (glproto >= 1.4.17 gl >= 9.2.0) were not met: + + Requested 'gl >= 9.2.0' but version of gl is 1.2 + +Lower the version requirement to 1.2 to allow building against libglvnd +provided libraries + +[1] https://github.com/NVIDIA/libglvnd/commit/0dfaea2bcb7cdcc785f95e244223bd004a2d7fba +--- + configure.ac | 4 ++-- + glx/meson.build | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 03c2e367c..969090b94 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -760,7 +760,7 @@ LIBDRI="dri >= 7.8.0" + LIBDRM="libdrm >= 2.4.89" + LIBEGL="egl" + LIBGBM="gbm >= 10.2.0" +-LIBGL="gl >= 7.1.0" ++LIBGL="gl >= 1.2" + LIBXEXT="xext >= 1.0.99.4" + LIBXFONT="xfont2 >= 2.0.0" + LIBXI="xi >= 1.2.99.1" +@@ -1115,7 +1115,7 @@ case "$DRI2,$HAVE_DRI2PROTO" in + yes,yes | auto,yes) + AC_DEFINE(DRI2, 1, [Build DRI2 extension]) + DRI2=yes +- LIBGL="gl >= 9.2.0" ++ LIBGL="gl >= 1.2" + SDK_REQUIRED_MODULES="$SDK_REQUIRED_MODULES $DRI2PROTO" + ;; + esac +diff --git a/glx/meson.build b/glx/meson.build +index 7f9e549f0..745814336 100644 +--- a/glx/meson.build ++++ b/glx/meson.build +@@ -39,7 +39,7 @@ if build_glx + common_dep, + dl_dep, + dependency('glproto', version: '>= 1.4.17'), +- dependency('gl', version: '>= 9.2.0'), ++ dependency('gl', version: '>= 1.2'), + ], + c_args: [ + glx_align64, +-- +2.23.0 + diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 6f605a3..7e655a3 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -46,7 +46,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.20.5 -Release: 8%{?gitdate:.%{gitdate}}%{?dist} +Release: 9%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org License: MIT @@ -156,6 +156,9 @@ Patch61: 0015-xwayland-Call-xwl_window_check_resolution_change_emu.patch Patch62: 0016-xwayland-Fix-setting-of-_XWAYLAND_RANDR_EMU_MONITOR_.patch Patch63: 0017-xwayland-Remove-unnecessary-xwl_window_is_toplevel-c.patch +# Fix building with new libglvnd provided gl.pc +Patch64: 0001-build-glx-Lower-gl-version-to-work-with-libglvnd.patch + BuildRequires: systemtap-sdt-devel BuildRequires: git BuildRequires: automake autoconf libtool pkgconfig @@ -580,6 +583,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Mon Nov 4 2019 Hans de Goede - 1.20.5-9 +- Fix building with new libglvnd provided gl.pc + * Mon Nov 4 2019 Hans de Goede - 1.20.5-8 - Backport Xwayland randr resolution change emulation support From 76e2fe61fd6a735dcd2eaed93725e4cd1e2be52d Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 4 Nov 2019 20:48:51 +0100 Subject: [PATCH 045/131] Fix building with new libglvnd-1.2.0 (E)GL headers and pkgconfig files --- 0001-glamor-xwayland-Define-EGL_NO_X11.patch | 98 ++++++++++++++++++++ xorg-x11-server.spec | 5 +- 2 files changed, 101 insertions(+), 2 deletions(-) create mode 100644 0001-glamor-xwayland-Define-EGL_NO_X11.patch diff --git a/0001-glamor-xwayland-Define-EGL_NO_X11.patch b/0001-glamor-xwayland-Define-EGL_NO_X11.patch new file mode 100644 index 0000000..3057eb2 --- /dev/null +++ b/0001-glamor-xwayland-Define-EGL_NO_X11.patch @@ -0,0 +1,98 @@ +From 4b10693a62c06234fae69c3f50dc9af541b6d804 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Mon, 4 Nov 2019 20:03:17 +0100 +Subject: [PATCH xserver] glamor/xwayland: Define EGL_NO_X11 + +Define EGL_NO_X11 everywhere were we also define MESA_EGL_NO_X11_HEADERS, +EGL_NO_X11 is the MESA_EGL_NO_X11_HEADERS equivalent for the egl headers +shipped with libglvnd. + +This fixes the xserver not building with the libglvnd-1.2.0 headers: + +In file included from /usr/include/EGL/eglplatform.h:128, + from /usr/include/epoxy/egl_generated.h:11, + from /usr/include/epoxy/egl.h:46, + from glamor_priv.h:43, + from glamor_composite_glyphs.c:25: +/usr/include/X11/Xlib.h:222:2: error: conflicting types for 'GC' + 222 | *GC; + | ^~ +In file included from glamor.h:34, + from glamor_priv.h:32, + from glamor_composite_glyphs.c:25: +../include/gcstruct.h:282:3: note: previous declaration of 'GC' was here + 282 | } GC; + | ^~ + +Signed-off-by: Hans de Goede +--- + glamor/glamor_egl.h | 1 + + glamor/glamor_priv.h | 1 + + hw/xwayland/xwayland-glamor-eglstream.c | 1 + + hw/xwayland/xwayland-glamor-gbm.c | 1 + + hw/xwayland/xwayland-glamor.c | 1 + + 6 files changed, 6 insertions(+) + +diff --git a/glamor/glamor_egl.h b/glamor/glamor_egl.h +index 2f7566b24..8f6ed7840 100644 +--- a/glamor/glamor_egl.h ++++ b/glamor/glamor_egl.h +@@ -28,6 +28,7 @@ + #define GLAMOR_EGL_H + + #define MESA_EGL_NO_X11_HEADERS ++#define EGL_NO_X11 + #include + #include + #include +diff --git a/glamor/glamor_priv.h b/glamor/glamor_priv.h +index 10c74c1b5..ea7a8bc96 100644 +--- a/glamor/glamor_priv.h ++++ b/glamor/glamor_priv.h +@@ -40,6 +40,7 @@ + #include + #ifdef GLAMOR_HAS_GBM + #define MESA_EGL_NO_X11_HEADERS ++#define EGL_NO_X11 + #include + #endif + +diff --git a/hw/xwayland/xwayland-glamor-eglstream.c b/hw/xwayland/xwayland-glamor-eglstream.c +index c62c0d2ac..36b749aaf 100644 +--- a/hw/xwayland/xwayland-glamor-eglstream.c ++++ b/hw/xwayland/xwayland-glamor-eglstream.c +@@ -33,6 +33,7 @@ + #include "wayland-eglstream-controller-client-protocol.h" + + #define MESA_EGL_NO_X11_HEADERS ++#define EGL_NO_X11 + #include + #include + #include +diff --git a/hw/xwayland/xwayland-glamor-gbm.c b/hw/xwayland/xwayland-glamor-gbm.c +index 354695060..e3d35ce10 100644 +--- a/hw/xwayland/xwayland-glamor-gbm.c ++++ b/hw/xwayland/xwayland-glamor-gbm.c +@@ -36,6 +36,7 @@ + #include + + #define MESA_EGL_NO_X11_HEADERS ++#define EGL_NO_X11 + #include + #include + +diff --git a/hw/xwayland/xwayland-glamor.c b/hw/xwayland/xwayland-glamor.c +index dc07f7933..bf7f0ffb4 100644 +--- a/hw/xwayland/xwayland-glamor.c ++++ b/hw/xwayland/xwayland-glamor.c +@@ -26,6 +26,7 @@ + #include "xwayland.h" + + #define MESA_EGL_NO_X11_HEADERS ++#define EGL_NO_X11 + #include + + #include +-- +2.23.0 + diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 7e655a3..43ea0af 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -156,8 +156,9 @@ Patch61: 0015-xwayland-Call-xwl_window_check_resolution_change_emu.patch Patch62: 0016-xwayland-Fix-setting-of-_XWAYLAND_RANDR_EMU_MONITOR_.patch Patch63: 0017-xwayland-Remove-unnecessary-xwl_window_is_toplevel-c.patch -# Fix building with new libglvnd provided gl.pc +# Fix building with new libglvnd-1.2.0 (E)GL headers and pkgconfig files Patch64: 0001-build-glx-Lower-gl-version-to-work-with-libglvnd.patch +Patch65: 0001-glamor-xwayland-Define-EGL_NO_X11.patch BuildRequires: systemtap-sdt-devel BuildRequires: git @@ -584,7 +585,7 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog * Mon Nov 4 2019 Hans de Goede - 1.20.5-9 -- Fix building with new libglvnd provided gl.pc +- Fix building with new libglvnd-1.2.0 (E)GL headers and pkgconfig files * Mon Nov 4 2019 Hans de Goede - 1.20.5-8 - Backport Xwayland randr resolution change emulation support From 622718ea8330d615d64e8bff97e959fe18be170c Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Mon, 25 Nov 2019 09:26:07 +0100 Subject: [PATCH 046/131] xserver 1.20.6 --- ...cmd-Check-that-the-flip-and-screen-p.patch | 49 ---- ...evice-active-grab-to-deliver-touch-e.patch | 76 ------ ...wer-gl-version-to-work-with-libglvnd.patch | 64 ----- ...t-include-sys-io.h-on-ARM-with-glibc.patch | 59 ----- ...ap-exportable-from-gbm_bo_from_pixma.patch | 89 ------- 0001-glamor-xwayland-Define-EGL_NO_X11.patch | 98 ------- ...a-crash-on-pointer-enter-with-a-grab.patch | 53 ---- ...-Check-status-in-GBM-pixmap-creation.patch | 137 ---------- ...cheduled-frames-after-hiding-tablet-.patch | 38 --- 0002-dri2-Sync-i965_pci_ids.h-from-mesa.patch | 136 ---------- ...pdate-screen-pixmap-on-output-resize.patch | 80 ------ ...-Expand-the-RANDR-screen-size-limits.patch | 36 --- 0005-xwayland-Do-not-free-a-NULL-GBM-bo.patch | 56 ---- ...ce-inside-of-SyncCreate-export-SyncC.patch | 244 ------------------ ...-GLX-Add-a-per-client-vendor-mapping.patch | 92 ------- ...-sending-client-for-looking-up-XID-s.patch | 114 -------- ...tion-to-change-a-clients-vendor-list.patch | 114 -------- ...GlxServerExports-major-minor-Version.patch | 35 --- 0011-miext-sync-Fix-needless-ABI-change.patch | 39 --- ...-context-validation-in-xorgGlxMakeCu.patch | 40 --- ...e-DamagePtr-into-separate-window-dat.patch | 173 ------------- ...r-surface-creation-into-a-separate-f.patch | 125 --------- ...the-case-of-windows-being-realized-b.patch | 91 ------- sources | 2 +- xorg-x11-server.spec | 86 ++---- 25 files changed, 29 insertions(+), 2097 deletions(-) delete mode 100644 0001-Revert-present-scmd-Check-that-the-flip-and-screen-p.patch delete mode 100644 0001-Xi-Use-current-device-active-grab-to-deliver-touch-e.patch delete mode 100644 0001-build-glx-Lower-gl-version-to-work-with-libglvnd.patch delete mode 100644 0001-compiler.h-Do-not-include-sys-io.h-on-ARM-with-glibc.patch delete mode 100644 0001-glamor-Make-pixmap-exportable-from-gbm_bo_from_pixma.patch delete mode 100644 0001-glamor-xwayland-Define-EGL_NO_X11.patch delete mode 100644 0001-xwayland-Avoid-a-crash-on-pointer-enter-with-a-grab.patch delete mode 100644 0001-xwayland-Check-status-in-GBM-pixmap-creation.patch delete mode 100644 0001-xwayland-Reset-scheduled-frames-after-hiding-tablet-.patch delete mode 100644 0002-dri2-Sync-i965_pci_ids.h-from-mesa.patch delete mode 100644 0003-xwayland-Update-screen-pixmap-on-output-resize.patch delete mode 100644 0004-xwayland-Expand-the-RANDR-screen-size-limits.patch delete mode 100644 0005-xwayland-Do-not-free-a-NULL-GBM-bo.patch delete mode 100644 0006-xsync-Add-resource-inside-of-SyncCreate-export-SyncC.patch delete mode 100644 0007-GLX-Add-a-per-client-vendor-mapping.patch delete mode 100644 0008-GLX-Use-the-sending-client-for-looking-up-XID-s.patch delete mode 100644 0009-GLX-Add-a-function-to-change-a-clients-vendor-list.patch delete mode 100644 0010-GLX-Set-GlxServerExports-major-minor-Version.patch delete mode 100644 0011-miext-sync-Fix-needless-ABI-change.patch delete mode 100644 0012-glx-Fix-previous-context-validation-in-xorgGlxMakeCu.patch delete mode 100644 0013-xwayland-Separate-DamagePtr-into-separate-window-dat.patch delete mode 100644 0014-xwayland-Refactor-surface-creation-into-a-separate-f.patch delete mode 100644 0015-xwayland-Handle-the-case-of-windows-being-realized-b.patch diff --git a/0001-Revert-present-scmd-Check-that-the-flip-and-screen-p.patch b/0001-Revert-present-scmd-Check-that-the-flip-and-screen-p.patch deleted file mode 100644 index 29ae6f5..0000000 --- a/0001-Revert-present-scmd-Check-that-the-flip-and-screen-p.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 8d2c776b2e14b3edcb27ced96cda7bede82c39cc Mon Sep 17 00:00:00 2001 -From: Olivier Fourdan -Date: Thu, 4 Jul 2019 08:42:15 +0200 -Subject: [PATCH xserver] Revert "present/scmd: Check that the flip and screen - pixmap pitches match" - -This reverts commit ef91da2757050652c724f6e674e8b1acf5d0cb31. -Closes: https://gitlab.freedesktop.org/xorg/xserver/issues/839 ---- - present/present_scmd.c | 8 +++----- - 1 file changed, 3 insertions(+), 5 deletions(-) - -diff --git a/present/present_scmd.c b/present/present_scmd.c -index 7c2f80997..8417d0925 100644 ---- a/present/present_scmd.c -+++ b/present/present_scmd.c -@@ -78,7 +78,7 @@ present_check_flip(RRCrtcPtr crtc, - PresentFlipReason *reason) - { - ScreenPtr screen = window->drawable.pScreen; -- PixmapPtr screen_pixmap, window_pixmap; -+ PixmapPtr window_pixmap; - WindowPtr root = screen->root; - present_screen_priv_ptr screen_priv = present_screen_priv(screen); - -@@ -99,9 +99,8 @@ present_check_flip(RRCrtcPtr crtc, - return FALSE; - - /* Make sure the window hasn't been redirected with Composite */ -- screen_pixmap = screen->GetScreenPixmap(screen); - window_pixmap = screen->GetWindowPixmap(window); -- if (window_pixmap != screen_pixmap && -+ if (window_pixmap != screen->GetScreenPixmap(screen) && - window_pixmap != screen_priv->flip_pixmap && - window_pixmap != present_flip_pending_pixmap(screen)) - return FALSE; -@@ -127,8 +126,7 @@ present_check_flip(RRCrtcPtr crtc, - window->drawable.x != pixmap->screen_x || window->drawable.y != pixmap->screen_y || - #endif - window->drawable.width != pixmap->drawable.width || -- window->drawable.height != pixmap->drawable.height || -- pixmap->devKind != screen_pixmap->devKind) { -+ window->drawable.height != pixmap->drawable.height) { - return FALSE; - } - --- -2.21.0 - diff --git a/0001-Xi-Use-current-device-active-grab-to-deliver-touch-e.patch b/0001-Xi-Use-current-device-active-grab-to-deliver-touch-e.patch deleted file mode 100644 index 3253151..0000000 --- a/0001-Xi-Use-current-device-active-grab-to-deliver-touch-e.patch +++ /dev/null @@ -1,76 +0,0 @@ -From 98e3db2ac43d4a3f13475cb160c8ce0155ac7d61 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= -Date: Fri, 26 Oct 2018 19:52:49 +0200 -Subject: [PATCH xserver 01/15] Xi: Use current device active grab to deliver - touch events if any - -When Retrieving touch delivery data we need to check if we have an active -grab on such device, and in that case use it to delivery events. -If we don't do this, when rejecting the touch events in DeactivatePointerGrab, -we will end-up in creating an implicit grab that will change the device -deviceGrab's state, causing a recursion during TouchEndTouch. - -Fixes #7 - -https://bugs.freedesktop.org/show_bug.cgi?id=96536 -(cherry picked from commit 35e5a76cc1d02801fadd49d12e60664b02e4bebc) ---- - Xi/exevents.c | 21 ++++++++------------- - 1 file changed, 8 insertions(+), 13 deletions(-) - -diff --git a/Xi/exevents.c b/Xi/exevents.c -index 17d751e31..659816a46 100644 ---- a/Xi/exevents.c -+++ b/Xi/exevents.c -@@ -1293,14 +1293,21 @@ RetrieveTouchDeliveryData(DeviceIntPtr dev, TouchPointInfoPtr ti, - int rc; - InputClients *iclients = NULL; - *mask = NULL; -+ *grab = NULL; - - if (listener->type == LISTENER_GRAB || - listener->type == LISTENER_POINTER_GRAB) { -- - *grab = listener->grab; - - BUG_RETURN_VAL(!*grab, FALSE); -+ } -+ else if (ti->emulate_pointer && dev->deviceGrab.grab && -+ !dev->deviceGrab.fromPassiveGrab) { -+ /* There may be an active pointer grab on the device */ -+ *grab = dev->deviceGrab.grab; -+ } - -+ if (*grab) { - *client = rClient(*grab); - *win = (*grab)->window; - *mask = (*grab)->xi2mask; -@@ -1357,8 +1364,6 @@ RetrieveTouchDeliveryData(DeviceIntPtr dev, TouchPointInfoPtr ti, - /* if owner selected, oclients is NULL */ - *client = oclients ? rClient(oclients) : wClient(*win); - } -- -- *grab = NULL; - } - - return TRUE; -@@ -1498,16 +1503,6 @@ DeliverEmulatedMotionEvent(DeviceIntPtr dev, TouchPointInfoPtr ti, - &mask)) - return; - -- /* There may be a pointer grab on the device */ -- if (!grab) { -- grab = dev->deviceGrab.grab; -- if (grab) { -- win = grab->window; -- mask = grab->xi2mask; -- client = rClient(grab); -- } -- } -- - DeliverTouchEmulatedEvent(dev, ti, (InternalEvent*)&motion, &ti->listeners[0], client, - win, grab, mask); - } --- -2.21.0 - diff --git a/0001-build-glx-Lower-gl-version-to-work-with-libglvnd.patch b/0001-build-glx-Lower-gl-version-to-work-with-libglvnd.patch deleted file mode 100644 index 11f9c39..0000000 --- a/0001-build-glx-Lower-gl-version-to-work-with-libglvnd.patch +++ /dev/null @@ -1,64 +0,0 @@ -From e6ef2b12404dfec7f23592a3524d2a63d9d25802 Mon Sep 17 00:00:00 2001 -From: Marvin Schmidt -Date: Tue, 24 Sep 2019 09:58:43 +0200 -Subject: [PATCH xserver] build: glx: Lower gl version to work with libglvnd - -When using mesa with libglvnd support, mesa will no longer install the -gl, glx, egl pkg-config files but instead let libglvnd provide them. -libglvnd maintainers decided to change the versioning as it was -mesa-specific previously. Now the libraries have versions of the API -they expose[1]. -This causes problems when building the X server: - - checking for glproto >= 1.4.17 gl >= 9.2.0... no - configure: error: Package requirements (glproto >= 1.4.17 gl >= 9.2.0) were not met: - - Requested 'gl >= 9.2.0' but version of gl is 1.2 - -Lower the version requirement to 1.2 to allow building against libglvnd -provided libraries - -[1] https://github.com/NVIDIA/libglvnd/commit/0dfaea2bcb7cdcc785f95e244223bd004a2d7fba ---- - configure.ac | 4 ++-- - glx/meson.build | 2 +- - 2 files changed, 3 insertions(+), 3 deletions(-) - -diff --git a/configure.ac b/configure.ac -index 03c2e367c..969090b94 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -760,7 +760,7 @@ LIBDRI="dri >= 7.8.0" - LIBDRM="libdrm >= 2.4.89" - LIBEGL="egl" - LIBGBM="gbm >= 10.2.0" --LIBGL="gl >= 7.1.0" -+LIBGL="gl >= 1.2" - LIBXEXT="xext >= 1.0.99.4" - LIBXFONT="xfont2 >= 2.0.0" - LIBXI="xi >= 1.2.99.1" -@@ -1115,7 +1115,7 @@ case "$DRI2,$HAVE_DRI2PROTO" in - yes,yes | auto,yes) - AC_DEFINE(DRI2, 1, [Build DRI2 extension]) - DRI2=yes -- LIBGL="gl >= 9.2.0" -+ LIBGL="gl >= 1.2" - SDK_REQUIRED_MODULES="$SDK_REQUIRED_MODULES $DRI2PROTO" - ;; - esac -diff --git a/glx/meson.build b/glx/meson.build -index 7f9e549f0..745814336 100644 ---- a/glx/meson.build -+++ b/glx/meson.build -@@ -39,7 +39,7 @@ if build_glx - common_dep, - dl_dep, - dependency('glproto', version: '>= 1.4.17'), -- dependency('gl', version: '>= 9.2.0'), -+ dependency('gl', version: '>= 1.2'), - ], - c_args: [ - glx_align64, --- -2.23.0 - diff --git a/0001-compiler.h-Do-not-include-sys-io.h-on-ARM-with-glibc.patch b/0001-compiler.h-Do-not-include-sys-io.h-on-ARM-with-glibc.patch deleted file mode 100644 index ba70119..0000000 --- a/0001-compiler.h-Do-not-include-sys-io.h-on-ARM-with-glibc.patch +++ /dev/null @@ -1,59 +0,0 @@ -From cffdd3984369ec7e31c87f9240c1485ab6370a8f Mon Sep 17 00:00:00 2001 -From: Olivier Fourdan -Date: Mon, 1 Jul 2019 13:20:39 +0200 -Subject: [PATCH] compiler.h: Do not include sys/io.h on ARM with glibc - - on ARM hasn't worked for a long, long time, so it was removed -it from glibc upstream. - -Remove the include to avoid a compilation failure on ARM with glibc. - -Signed-off-by: Olivier Fourdan ---- - hw/xfree86/common/compiler.h | 30 ------------------------------ - 1 file changed, 30 deletions(-) - -diff --git a/hw/xfree86/common/compiler.h b/hw/xfree86/common/compiler.h -index 7144c6a..2b2008b 100644 ---- a/hw/xfree86/common/compiler.h -+++ b/hw/xfree86/common/compiler.h -@@ -758,36 +758,6 @@ inl(unsigned short port) - return xf86ReadMmio32Le((void *) ioBase, port); - } - --#elif defined(__arm__) && defined(__linux__) -- --/* for Linux on ARM, we use the LIBC inx/outx routines */ --/* note that the appropriate setup via "ioperm" needs to be done */ --/* *before* any inx/outx is done. */ -- --#include -- --static __inline__ void --xf_outb(unsigned short port, unsigned char val) --{ -- outb(val, port); --} -- --static __inline__ void --xf_outw(unsigned short port, unsigned short val) --{ -- outw(val, port); --} -- --static __inline__ void --xf_outl(unsigned short port, unsigned int val) --{ -- outl(val, port); --} -- --#define outb xf_outb --#define outw xf_outw --#define outl xf_outl -- - #elif defined(__nds32__) - - /* --- -2.21.0 - diff --git a/0001-glamor-Make-pixmap-exportable-from-gbm_bo_from_pixma.patch b/0001-glamor-Make-pixmap-exportable-from-gbm_bo_from_pixma.patch deleted file mode 100644 index ea31a81..0000000 --- a/0001-glamor-Make-pixmap-exportable-from-gbm_bo_from_pixma.patch +++ /dev/null @@ -1,89 +0,0 @@ -From 6e199e4613e149cd5d5ce69cdd6a259744b6cb44 Mon Sep 17 00:00:00 2001 -From: Olivier Fourdan -Date: Fri, 26 Apr 2019 13:37:09 +0200 -Subject: [PATCH xserver] glamor: Make pixmap exportable from - `gbm_bo_from_pixmap()` - -If a pixmap is not exportable, `glamor_gbm_bo_from_pixmap()` would fail -and the modesettings driver would consequently fail to do its page flip, -which both prevents Present from working and also fill up the logs with -error messages such as: - - (EE) modeset(0): Failed to get GBM bo for flip to new front. - (EE) modeset(0): present flip failed - -Refactor the code so that `glamor_gbm_bo_from_pixmap()` takes care of -making the pixmap exportable. - -Signed-off-by: Olivier Fourdan -Signed-off-by: Yuxuan Shui yshui@hadean.com -See-also: https://gitlab.freedesktop.org/xorg/xserver/merge_requests/131 -Closes: https://gitlab.freedesktop.org/xorg/xserver/issues/68 -Fixes: 86b2d8740a "glamor: Reallocate pixmap storage without modifiers - if necessary" -(cherry picked from commit 26fe29f4fa53cbb7d51892e2cf397c084093812f) ---- - glamor/glamor_egl.c | 19 ++++++++++++++----- - 1 file changed, 14 insertions(+), 5 deletions(-) - -diff --git a/glamor/glamor_egl.c b/glamor/glamor_egl.c -index d3c678d6b..9a619a133 100644 ---- a/glamor/glamor_egl.c -+++ b/glamor/glamor_egl.c -@@ -355,8 +355,8 @@ glamor_make_pixmap_exportable(PixmapPtr pixmap, Bool modifiers_ok) - return TRUE; - } - --struct gbm_bo * --glamor_gbm_bo_from_pixmap(ScreenPtr screen, PixmapPtr pixmap) -+static struct gbm_bo * -+glamor_gbm_bo_from_pixmap_internal(ScreenPtr screen, PixmapPtr pixmap) - { - struct glamor_egl_screen_private *glamor_egl = - glamor_egl_get_screen_private(xf86ScreenToScrn(screen)); -@@ -370,6 +370,15 @@ glamor_gbm_bo_from_pixmap(ScreenPtr screen, PixmapPtr pixmap) - pixmap_priv->image, 0); - } - -+struct gbm_bo * -+glamor_gbm_bo_from_pixmap(ScreenPtr screen, PixmapPtr pixmap) -+{ -+ if (!glamor_make_pixmap_exportable(pixmap, TRUE)) -+ return NULL; -+ -+ return glamor_gbm_bo_from_pixmap_internal(screen, pixmap); -+} -+ - int - glamor_egl_fds_from_pixmap(ScreenPtr screen, PixmapPtr pixmap, int *fds, - uint32_t *strides, uint32_t *offsets, -@@ -385,7 +394,7 @@ glamor_egl_fds_from_pixmap(ScreenPtr screen, PixmapPtr pixmap, int *fds, - if (!glamor_make_pixmap_exportable(pixmap, TRUE)) - return 0; - -- bo = glamor_gbm_bo_from_pixmap(screen, pixmap); -+ bo = glamor_gbm_bo_from_pixmap_internal(screen, pixmap); - if (!bo) - return 0; - -@@ -423,7 +432,7 @@ glamor_egl_fd_from_pixmap(ScreenPtr screen, PixmapPtr pixmap, - if (!glamor_make_pixmap_exportable(pixmap, FALSE)) - return -1; - -- bo = glamor_gbm_bo_from_pixmap(screen, pixmap); -+ bo = glamor_gbm_bo_from_pixmap_internal(screen, pixmap); - if (!bo) - return -1; - -@@ -452,7 +461,7 @@ glamor_egl_fd_name_from_pixmap(ScreenPtr screen, - if (!glamor_make_pixmap_exportable(pixmap, FALSE)) - goto failure; - -- bo = glamor_gbm_bo_from_pixmap(screen, pixmap); -+ bo = glamor_gbm_bo_from_pixmap_internal(screen, pixmap); - if (!bo) - goto failure; - --- -2.21.0 - diff --git a/0001-glamor-xwayland-Define-EGL_NO_X11.patch b/0001-glamor-xwayland-Define-EGL_NO_X11.patch deleted file mode 100644 index 3057eb2..0000000 --- a/0001-glamor-xwayland-Define-EGL_NO_X11.patch +++ /dev/null @@ -1,98 +0,0 @@ -From 4b10693a62c06234fae69c3f50dc9af541b6d804 Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Mon, 4 Nov 2019 20:03:17 +0100 -Subject: [PATCH xserver] glamor/xwayland: Define EGL_NO_X11 - -Define EGL_NO_X11 everywhere were we also define MESA_EGL_NO_X11_HEADERS, -EGL_NO_X11 is the MESA_EGL_NO_X11_HEADERS equivalent for the egl headers -shipped with libglvnd. - -This fixes the xserver not building with the libglvnd-1.2.0 headers: - -In file included from /usr/include/EGL/eglplatform.h:128, - from /usr/include/epoxy/egl_generated.h:11, - from /usr/include/epoxy/egl.h:46, - from glamor_priv.h:43, - from glamor_composite_glyphs.c:25: -/usr/include/X11/Xlib.h:222:2: error: conflicting types for 'GC' - 222 | *GC; - | ^~ -In file included from glamor.h:34, - from glamor_priv.h:32, - from glamor_composite_glyphs.c:25: -../include/gcstruct.h:282:3: note: previous declaration of 'GC' was here - 282 | } GC; - | ^~ - -Signed-off-by: Hans de Goede ---- - glamor/glamor_egl.h | 1 + - glamor/glamor_priv.h | 1 + - hw/xwayland/xwayland-glamor-eglstream.c | 1 + - hw/xwayland/xwayland-glamor-gbm.c | 1 + - hw/xwayland/xwayland-glamor.c | 1 + - 6 files changed, 6 insertions(+) - -diff --git a/glamor/glamor_egl.h b/glamor/glamor_egl.h -index 2f7566b24..8f6ed7840 100644 ---- a/glamor/glamor_egl.h -+++ b/glamor/glamor_egl.h -@@ -28,6 +28,7 @@ - #define GLAMOR_EGL_H - - #define MESA_EGL_NO_X11_HEADERS -+#define EGL_NO_X11 - #include - #include - #include -diff --git a/glamor/glamor_priv.h b/glamor/glamor_priv.h -index 10c74c1b5..ea7a8bc96 100644 ---- a/glamor/glamor_priv.h -+++ b/glamor/glamor_priv.h -@@ -40,6 +40,7 @@ - #include - #ifdef GLAMOR_HAS_GBM - #define MESA_EGL_NO_X11_HEADERS -+#define EGL_NO_X11 - #include - #endif - -diff --git a/hw/xwayland/xwayland-glamor-eglstream.c b/hw/xwayland/xwayland-glamor-eglstream.c -index c62c0d2ac..36b749aaf 100644 ---- a/hw/xwayland/xwayland-glamor-eglstream.c -+++ b/hw/xwayland/xwayland-glamor-eglstream.c -@@ -33,6 +33,7 @@ - #include "wayland-eglstream-controller-client-protocol.h" - - #define MESA_EGL_NO_X11_HEADERS -+#define EGL_NO_X11 - #include - #include - #include -diff --git a/hw/xwayland/xwayland-glamor-gbm.c b/hw/xwayland/xwayland-glamor-gbm.c -index 354695060..e3d35ce10 100644 ---- a/hw/xwayland/xwayland-glamor-gbm.c -+++ b/hw/xwayland/xwayland-glamor-gbm.c -@@ -36,6 +36,7 @@ - #include - - #define MESA_EGL_NO_X11_HEADERS -+#define EGL_NO_X11 - #include - #include - -diff --git a/hw/xwayland/xwayland-glamor.c b/hw/xwayland/xwayland-glamor.c -index dc07f7933..bf7f0ffb4 100644 ---- a/hw/xwayland/xwayland-glamor.c -+++ b/hw/xwayland/xwayland-glamor.c -@@ -26,6 +26,7 @@ - #include "xwayland.h" - - #define MESA_EGL_NO_X11_HEADERS -+#define EGL_NO_X11 - #include - - #include --- -2.23.0 - diff --git a/0001-xwayland-Avoid-a-crash-on-pointer-enter-with-a-grab.patch b/0001-xwayland-Avoid-a-crash-on-pointer-enter-with-a-grab.patch deleted file mode 100644 index 7983893..0000000 --- a/0001-xwayland-Avoid-a-crash-on-pointer-enter-with-a-grab.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 6711b5c6fdf0581c77150306fff909d7bc63b8a4 Mon Sep 17 00:00:00 2001 -From: Olivier Fourdan -Date: Thu, 9 May 2019 10:36:19 +0200 -Subject: [PATCH xserver] xwayland: Avoid a crash on pointer enter with a grab - -On pointer enter notification, Xwayland checks for an existing pointer -warp with a `NULL` sprite. - -In turn, `xwl_pointer_warp_emulator_maybe_lock()` checks for an existing -grab and the destination window using `XYToWindow()` which does not -check for the actual sprite not being `NULL`. - -So, in some cases, when the pointer enters the surface and there is an -existing X11 grab which is not an ownerEvents grab, Xwayland would crash -trying to dereference the `NULL` sprite pointer: - - #0 __GI_raise () - #1 __GI_abort () at abort.c:79 - #2 OsAbort () at utils.c:1351 - #3 AbortServer () at log.c:879 - #4 FatalError () at log.c:1017 - #5 OsSigHandler () at osinit.c:156 - #6 OsSigHandler () at osinit.c:110 - #7 - #8 XYToWindow (pSprite=0x0, x=0, y=0) at events.c:2880 - #9 xwl_pointer_warp_emulator_maybe_lock () at xwayland-input.c:2673 - #10 pointer_handle_enter () at xwayland-input.c:434 - -Avoid the crash by simply checking for the sprite being not `NULL` in -`xwl_pointer_warp_emulator_maybe_lock()` - -Signed-off-by: Olivier Fourdan -Bugzilla: https://bugzilla.redhat.com/1708119 -(cherry picked from commit 0a07446318f248b65fcbc8ab8a73ead51153f09e) ---- - hw/xwayland/xwayland-input.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c -index fbbcb39cc..fa46ac3e7 100644 ---- a/hw/xwayland/xwayland-input.c -+++ b/hw/xwayland/xwayland-input.c -@@ -2667,6 +2667,7 @@ xwl_pointer_warp_emulator_maybe_lock(struct xwl_pointer_warp_emulator *warp_emul - */ - if (pointer_grab && - !pointer_grab->ownerEvents && -+ sprite && - XYToWindow(sprite, x, y) != xwl_seat->focus_window->window) - return; - --- -2.21.0 - diff --git a/0001-xwayland-Check-status-in-GBM-pixmap-creation.patch b/0001-xwayland-Check-status-in-GBM-pixmap-creation.patch deleted file mode 100644 index bdbfdda..0000000 --- a/0001-xwayland-Check-status-in-GBM-pixmap-creation.patch +++ /dev/null @@ -1,137 +0,0 @@ -From 34ad57e570f96dfe4bc493f14726b7a0ae6d45f9 Mon Sep 17 00:00:00 2001 -From: Olivier Fourdan -Date: Tue, 12 Mar 2019 15:38:03 +0100 -Subject: [PATCH xserver] xwayland: Check status in GBM pixmap creation - -The current code in `xwl_glamor_gbm_create_pixmap_for_bo()` may fail in -several cases that are not checked for: - - - `eglCreateImageKHR()` may have failed to create the image, - - `glEGLImageTargetTexture2DOES()` may fail and set an error, - - `glamor_set_pixmap_texture()` may fail for very large pixmaps - because the corresponding FBO could not be created. - -Trying to upload content to a pixmap with no texture will crash Mesa, -glamor and Xwayland, e.g.: - - XXX fail to create fbo. - (EE) - (EE) Backtrace: - (EE) 0: Xwayland (OsSigHandler+0x29) - (EE) 1: libpthread.so.0 (funlockfile+0x50) - (EE) 2: libc.so.6 (__memmove_avx_unaligned_erms+0x215) - (EE) 3: dri/i965_dri.so (_mesa_format_convert+0xab3) - (EE) 4: dri/i965_dri.so (_mesa_texstore+0x205) - (EE) 5: dri/i965_dri.so (store_texsubimage+0x28c) - (EE) 6: dri/i965_dri.so (intel_upload_tex+0x13b) - (EE) 7: dri/i965_dri.so (texture_sub_image+0x134) - (EE) 8: dri/i965_dri.so (texsubimage_err+0x150) - (EE) 9: dri/i965_dri.so (_mesa_TexSubImage2D+0x48) - (EE) 10: Xwayland (glamor_upload_boxes+0x246) - (EE) 11: Xwayland (glamor_copy+0x4d1) - (EE) 12: Xwayland (miCopyRegion+0x96) - (EE) 13: Xwayland (miDoCopy+0x43c) - (EE) 14: Xwayland (glamor_copy_area+0x24) - (EE) 15: Xwayland (damageCopyArea+0xba) - (EE) 16: Xwayland (compCopyWindow+0x31c) - (EE) 17: Xwayland (damageCopyWindow+0xd3) - (EE) 18: Xwayland (miResizeWindow+0x7b7) - (EE) 19: Xwayland (compResizeWindow+0x3a) - (EE) 20: Xwayland (ConfigureWindow+0xa96) - (EE) 21: Xwayland (ProcConfigureWindow+0x7d) - (EE) 22: Xwayland (Dispatch+0x320) - (EE) 23: Xwayland (dix_main+0x366) - (EE) 24: libc.so.6 (__libc_start_main+0xf3) - (EE) 25: Xwayland (_start+0x2e) - (EE) - Fatal server error: - (EE) Caught signal 11 (Segmentation fault). Server aborting - (EE) - -Check for the possible cases of failure above and fallback to the -regular glamor pixmap creation when an error is detected. - -Signed-off-by: Olivier Fourdan -Closes: https://gitlab.freedesktop.org/xorg/xserver/issues/661 -(cherry picked from commit fc6380a11be4c6202ed72f241dd9ee8c7c24671d) ---- - hw/xwayland/xwayland-glamor-gbm.c | 34 +++++++++++++++++++++++++++---- - 1 file changed, 30 insertions(+), 4 deletions(-) - -diff --git a/hw/xwayland/xwayland-glamor-gbm.c b/hw/xwayland/xwayland-glamor-gbm.c -index a211e0915..80146ab6e 100644 ---- a/hw/xwayland/xwayland-glamor-gbm.c -+++ b/hw/xwayland/xwayland-glamor-gbm.c -@@ -169,6 +169,8 @@ xwl_glamor_gbm_create_pixmap_for_bo(ScreenPtr screen, struct gbm_bo *bo, - xwl_screen->egl_context, - EGL_NATIVE_PIXMAP_KHR, - xwl_pixmap->bo, NULL); -+ if (xwl_pixmap->image == EGL_NO_IMAGE_KHR) -+ goto error; - - glGenTextures(1, &xwl_pixmap->texture); - glBindTexture(GL_TEXTURE_2D, xwl_pixmap->texture); -@@ -176,14 +178,31 @@ xwl_glamor_gbm_create_pixmap_for_bo(ScreenPtr screen, struct gbm_bo *bo, - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - - glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, xwl_pixmap->image); -- glBindTexture(GL_TEXTURE_2D, 0); -+ if (eglGetError() != EGL_SUCCESS) -+ goto error; - -- xwl_pixmap_set_private(pixmap, xwl_pixmap); -+ glBindTexture(GL_TEXTURE_2D, 0); - - glamor_set_pixmap_texture(pixmap, xwl_pixmap->texture); -+ /* `set_pixmap_texture()` may fail silently if the FBO creation failed, -+ * so we check again the texture to be sure it worked. -+ */ -+ if (!glamor_get_pixmap_texture(pixmap)) -+ goto error; -+ - glamor_set_pixmap_type(pixmap, GLAMOR_TEXTURE_DRM); -+ xwl_pixmap_set_private(pixmap, xwl_pixmap); - - return pixmap; -+ -+error: -+ if (xwl_pixmap->image != EGL_NO_IMAGE_KHR) -+ eglDestroyImageKHR(xwl_screen->egl_display, xwl_pixmap->image); -+ if (pixmap) -+ glamor_destroy_pixmap(pixmap); -+ free(xwl_pixmap); -+ -+ return NULL; - } - - static PixmapPtr -@@ -194,6 +213,7 @@ xwl_glamor_gbm_create_pixmap(ScreenPtr screen, - struct xwl_screen *xwl_screen = xwl_screen_get(screen); - struct xwl_gbm_private *xwl_gbm = xwl_gbm_get(xwl_screen); - struct gbm_bo *bo; -+ PixmapPtr pixmap = NULL; - - if (width > 0 && height > 0 && depth >= 15 && - (hint == 0 || -@@ -219,10 +239,16 @@ xwl_glamor_gbm_create_pixmap(ScreenPtr screen, - } - - if (bo) -- return xwl_glamor_gbm_create_pixmap_for_bo(screen, bo, depth); -+ pixmap = xwl_glamor_gbm_create_pixmap_for_bo(screen, bo, depth); -+ -+ if (!pixmap) -+ gbm_bo_destroy(bo); - } - -- return glamor_create_pixmap(screen, width, height, depth, hint); -+ if (!pixmap) -+ pixmap = glamor_create_pixmap(screen, width, height, depth, hint); -+ -+ return pixmap; - } - - static Bool --- -2.21.0 - diff --git a/0001-xwayland-Reset-scheduled-frames-after-hiding-tablet-.patch b/0001-xwayland-Reset-scheduled-frames-after-hiding-tablet-.patch deleted file mode 100644 index 93cf411..0000000 --- a/0001-xwayland-Reset-scheduled-frames-after-hiding-tablet-.patch +++ /dev/null @@ -1,38 +0,0 @@ -From c86222d4bd94892f3bf3c5947c19793ca18bd9e2 Mon Sep 17 00:00:00 2001 -From: Carlos Garnacho -Date: Wed, 22 May 2019 17:51:04 +0200 -Subject: [PATCH xserver] xwayland: Reset scheduled frames after hiding tablet - cursor - -Hiding the tablet tool cursor results in it being hidden forever after. -This is due to the stale frame callback that will neither be disposed -or replaced. This can be reproduced in krita (X11) as the pointer -cursor is hidden while over the canvas. - -Clearing the frame callback ensures the correct behavior in future -xwl_tablet_tool_set_cursor() calls (i.e. a new cursor surface being -displayed, and a new frame callback created), and is 1:1 -with xwl_seat_set_cursor() for pointers. - -Signed-off-by: Carlos Garnacho -(cherry picked from commit dea4a74621294391ce5901bb3339e1b8e7151efc) ---- - hw/xwayland/xwayland-cursor.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/hw/xwayland/xwayland-cursor.c b/hw/xwayland/xwayland-cursor.c -index cf8395f1d..66720bcc0 100644 ---- a/hw/xwayland/xwayland-cursor.c -+++ b/hw/xwayland/xwayland-cursor.c -@@ -188,6 +188,8 @@ xwl_tablet_tool_set_cursor(struct xwl_tablet_tool *xwl_tablet_tool) - zwp_tablet_tool_v2_set_cursor(xwl_tablet_tool->tool, - xwl_tablet_tool->proximity_in_serial, - NULL, 0, 0); -+ clear_cursor_frame_callback(xwl_cursor); -+ xwl_cursor->needs_update = FALSE; - return; - } - --- -2.21.0 - diff --git a/0002-dri2-Sync-i965_pci_ids.h-from-mesa.patch b/0002-dri2-Sync-i965_pci_ids.h-from-mesa.patch deleted file mode 100644 index c861390..0000000 --- a/0002-dri2-Sync-i965_pci_ids.h-from-mesa.patch +++ /dev/null @@ -1,136 +0,0 @@ -From 1804e7327113d128ac9a759da55fd3de0b9f8c35 Mon Sep 17 00:00:00 2001 -From: Matt Roper -Date: Wed, 26 Jun 2019 09:34:46 -0700 -Subject: [PATCH xserver 02/15] dri2: Sync i965_pci_ids.h from mesa - -Copied from Mesa with no modifications. - -This update brings in a significant number of new platform ID's. - -Syncs with mesa up to commit e334a595e ("intel/icl: Add new ICL -PCI-IDs"). - -Signed-off-by: Matt Roper -(cherry picked from commit a8d9ebeb43583e8d8ef182ac15adbdce256d4867) ---- - hw/xfree86/dri2/pci_ids/i965_pci_ids.h | 53 +++++++++++++++++++++----- - 1 file changed, 43 insertions(+), 10 deletions(-) - -diff --git a/hw/xfree86/dri2/pci_ids/i965_pci_ids.h b/hw/xfree86/dri2/pci_ids/i965_pci_ids.h -index 1ef1a0edf..646df447b 100644 ---- a/hw/xfree86/dri2/pci_ids/i965_pci_ids.h -+++ b/hw/xfree86/dri2/pci_ids/i965_pci_ids.h -@@ -1,3 +1,4 @@ -+#ifndef IRIS - CHIPSET(0x29A2, i965, "Intel(R) 965G") - CHIPSET(0x2992, i965, "Intel(R) 965Q") - CHIPSET(0x2982, i965, "Intel(R) 965G") -@@ -91,6 +92,11 @@ CHIPSET(0x0F32, byt, "Intel(R) Bay Trail") - CHIPSET(0x0F33, byt, "Intel(R) Bay Trail") - CHIPSET(0x0157, byt, "Intel(R) Bay Trail") - CHIPSET(0x0155, byt, "Intel(R) Bay Trail") -+CHIPSET(0x22B0, chv, "Intel(R) HD Graphics (Cherrytrail)") -+CHIPSET(0x22B1, chv, "Intel(R) HD Graphics XXX (Braswell)") /* Overridden in brw_get_renderer_string */ -+CHIPSET(0x22B2, chv, "Intel(R) HD Graphics (Cherryview)") -+CHIPSET(0x22B3, chv, "Intel(R) HD Graphics (Cherryview)") -+#endif - CHIPSET(0x1602, bdw_gt1, "Intel(R) Broadwell GT1") - CHIPSET(0x1606, bdw_gt1, "Intel(R) Broadwell GT1") - CHIPSET(0x160A, bdw_gt1, "Intel(R) Broadwell GT1") -@@ -109,10 +115,6 @@ CHIPSET(0x162A, bdw_gt3, "Intel(R) Iris Pro P6300 (Broadwell GT3e)") - CHIPSET(0x162B, bdw_gt3, "Intel(R) Iris 6100 (Broadwell GT3)") - CHIPSET(0x162D, bdw_gt3, "Intel(R) Broadwell GT3") - CHIPSET(0x162E, bdw_gt3, "Intel(R) Broadwell GT3") --CHIPSET(0x22B0, chv, "Intel(R) HD Graphics (Cherrytrail)") --CHIPSET(0x22B1, chv, "Intel(R) HD Graphics XXX (Braswell)") /* Overridden in brw_get_renderer_string */ --CHIPSET(0x22B2, chv, "Intel(R) HD Graphics (Cherryview)") --CHIPSET(0x22B3, chv, "Intel(R) HD Graphics (Cherryview)") - CHIPSET(0x1902, skl_gt1, "Intel(R) HD Graphics 510 (Skylake GT1)") - CHIPSET(0x1906, skl_gt1, "Intel(R) HD Graphics 510 (Skylake GT1)") - CHIPSET(0x190A, skl_gt1, "Intel(R) Skylake GT1") -@@ -156,7 +158,6 @@ CHIPSET(0x5912, kbl_gt2, "Intel(R) HD Graphics 630 (Kaby Lake GT2)") - CHIPSET(0x5916, kbl_gt2, "Intel(R) HD Graphics 620 (Kaby Lake GT2)") - CHIPSET(0x591A, kbl_gt2, "Intel(R) HD Graphics P630 (Kaby Lake GT2)") - CHIPSET(0x591B, kbl_gt2, "Intel(R) HD Graphics 630 (Kaby Lake GT2)") --CHIPSET(0x591C, kbl_gt2, "Intel(R) Kaby Lake GT2") - CHIPSET(0x591D, kbl_gt2, "Intel(R) HD Graphics P630 (Kaby Lake GT2)") - CHIPSET(0x591E, kbl_gt2, "Intel(R) HD Graphics 615 (Kaby Lake GT2)") - CHIPSET(0x5921, kbl_gt2, "Intel(R) Kabylake GT2F") -@@ -164,13 +165,15 @@ CHIPSET(0x5923, kbl_gt3, "Intel(R) Kabylake GT3") - CHIPSET(0x5926, kbl_gt3, "Intel(R) Iris Plus Graphics 640 (Kaby Lake GT3e)") - CHIPSET(0x5927, kbl_gt3, "Intel(R) Iris Plus Graphics 650 (Kaby Lake GT3e)") - CHIPSET(0x593B, kbl_gt4, "Intel(R) Kabylake GT4") -+CHIPSET(0x591C, kbl_gt2, "Intel(R) Amber Lake (Kabylake) GT2") -+CHIPSET(0x87C0, kbl_gt2, "Intel(R) Amber Lake (Kabylake) GT2") -+CHIPSET(0x87CA, cfl_gt2, "Intel(R) Amber Lake (Coffeelake) GT2") - CHIPSET(0x3184, glk, "Intel(R) UHD Graphics 605 (Geminilake)") - CHIPSET(0x3185, glk_2x6, "Intel(R) UHD Graphics 600 (Geminilake 2x6)") - CHIPSET(0x3E90, cfl_gt1, "Intel(R) UHD Graphics 610 (Coffeelake 2x6 GT1)") - CHIPSET(0x3E93, cfl_gt1, "Intel(R) UHD Graphics 610 (Coffeelake 2x6 GT1)") - CHIPSET(0x3E99, cfl_gt1, "Intel(R) HD Graphics (Coffeelake 2x6 GT1)") --CHIPSET(0x3EA1, cfl_gt1, "Intel(R) HD Graphics (Coffeelake 2x6 GT1)") --CHIPSET(0x3EA4, cfl_gt1, "Intel(R) HD Graphics (Coffeelake 2x6 GT1)") -+CHIPSET(0x3E9C, cfl_gt1, "Intel(R) HD Graphics (Coffeelake 2x6 GT1)") - CHIPSET(0x3E91, cfl_gt2, "Intel(R) UHD Graphics 630 (Coffeelake 3x8 GT2)") - CHIPSET(0x3E92, cfl_gt2, "Intel(R) UHD Graphics 630 (Coffeelake 3x8 GT2)") - CHIPSET(0x3E96, cfl_gt2, "Intel(R) HD Graphics (Coffeelake 3x8 GT2)") -@@ -178,14 +181,34 @@ CHIPSET(0x3E98, cfl_gt2, "Intel(R) UHD Graphics 630 (Coffeelake 3x8 GT2)") - CHIPSET(0x3E9A, cfl_gt2, "Intel(R) HD Graphics (Coffeelake 3x8 GT2)") - CHIPSET(0x3E9B, cfl_gt2, "Intel(R) UHD Graphics 630 (Coffeelake 3x8 GT2)") - CHIPSET(0x3E94, cfl_gt2, "Intel(R) HD Graphics (Coffeelake 3x8 GT2)") --CHIPSET(0x3EA0, cfl_gt2, "Intel(R) HD Graphics (Coffeelake 3x8 GT2)") --CHIPSET(0x3EA3, cfl_gt2, "Intel(R) HD Graphics (Coffeelake 3x8 GT2)") - CHIPSET(0x3EA9, cfl_gt2, "Intel(R) HD Graphics (Coffeelake 3x8 GT2)") --CHIPSET(0x3EA2, cfl_gt3, "Intel(R) HD Graphics (Coffeelake 3x8 GT3)") - CHIPSET(0x3EA5, cfl_gt3, "Intel(R) HD Graphics (Coffeelake 3x8 GT3)") - CHIPSET(0x3EA6, cfl_gt3, "Intel(R) HD Graphics (Coffeelake 3x8 GT3)") - CHIPSET(0x3EA7, cfl_gt3, "Intel(R) HD Graphics (Coffeelake 3x8 GT3)") - CHIPSET(0x3EA8, cfl_gt3, "Intel(R) HD Graphics (Coffeelake 3x8 GT3)") -+CHIPSET(0x3EA1, cfl_gt1, "Intel(R) HD Graphics (Whiskey Lake 2x6 GT1)") -+CHIPSET(0x3EA4, cfl_gt1, "Intel(R) HD Graphics (Whiskey Lake 3x8 GT1)") -+CHIPSET(0x3EA0, cfl_gt2, "Intel(R) HD Graphics (Whiskey Lake 3x8 GT2)") -+CHIPSET(0x3EA3, cfl_gt2, "Intel(R) HD Graphics (Whiskey Lake 3x8 GT2)") -+CHIPSET(0x3EA2, cfl_gt3, "Intel(R) HD Graphics (Whiskey Lake 3x8 GT3)") -+CHIPSET(0x9B21, cfl_gt1, "Intel(R) HD Graphics (Comet Lake 2x6 GT1)") -+CHIPSET(0x9BA0, cfl_gt1, "Intel(R) HD Graphics (Comet Lake 2x6 GT1)") -+CHIPSET(0x9BA2, cfl_gt1, "Intel(R) HD Graphics (Comet Lake 2x6 GT1)") -+CHIPSET(0x9BA4, cfl_gt1, "Intel(R) HD Graphics (Comet Lake 2x6 GT1)") -+CHIPSET(0x9BA5, cfl_gt1, "Intel(R) HD Graphics (Comet Lake 2x6 GT1)") -+CHIPSET(0x9BA8, cfl_gt1, "Intel(R) HD Graphics (Comet Lake 2x6 GT1)") -+CHIPSET(0x9BAA, cfl_gt1, "Intel(R) HD Graphics (Comet Lake 2x6 GT1)") -+CHIPSET(0x9BAB, cfl_gt1, "Intel(R) HD Graphics (Comet Lake 2x6 GT1)") -+CHIPSET(0x9BAC, cfl_gt1, "Intel(R) HD Graphics (Comet Lake 2x6 GT1)") -+CHIPSET(0x9B41, cfl_gt2, "Intel(R) HD Graphics (Comet Lake 3x8 GT2)") -+CHIPSET(0x9BC0, cfl_gt2, "Intel(R) HD Graphics (Comet Lake 3x8 GT2)") -+CHIPSET(0x9BC2, cfl_gt2, "Intel(R) HD Graphics (Comet Lake 3x8 GT2)") -+CHIPSET(0x9BC4, cfl_gt2, "Intel(R) HD Graphics (Comet Lake 3x8 GT2)") -+CHIPSET(0x9BC5, cfl_gt2, "Intel(R) HD Graphics (Comet Lake 3x8 GT2)") -+CHIPSET(0x9BC8, cfl_gt2, "Intel(R) HD Graphics (Comet Lake 3x8 GT2)") -+CHIPSET(0x9BCA, cfl_gt2, "Intel(R) HD Graphics (Comet Lake 3x8 GT2)") -+CHIPSET(0x9BCB, cfl_gt2, "Intel(R) HD Graphics (Comet Lake 3x8 GT2)") -+CHIPSET(0x9BCC, cfl_gt2, "Intel(R) HD Graphics (Comet Lake 3x8 GT2)") - CHIPSET(0x5A49, cnl_2x8, "Intel(R) HD Graphics (Cannonlake 2x8 GT0.5)") - CHIPSET(0x5A4A, cnl_2x8, "Intel(R) HD Graphics (Cannonlake 2x8 GT0.5)") - CHIPSET(0x5A41, cnl_3x8, "Intel(R) HD Graphics (Cannonlake 3x8 GT1)") -@@ -201,8 +224,18 @@ CHIPSET(0x5A54, cnl_5x8, "Intel(R) HD Graphics (Cannonlake 5x8 GT2)") - CHIPSET(0x8A50, icl_8x8, "Intel(R) HD Graphics (Ice Lake 8x8 GT2)") - CHIPSET(0x8A51, icl_8x8, "Intel(R) HD Graphics (Ice Lake 8x8 GT2)") - CHIPSET(0x8A52, icl_8x8, "Intel(R) HD Graphics (Ice Lake 8x8 GT2)") -+CHIPSET(0x8A53, icl_8x8, "Intel(R) HD Graphics (Ice Lake 8x8 GT2)") -+CHIPSET(0x8A54, icl_6x8, "Intel(R) HD Graphics (Ice Lake 6x8 GT1.5)") -+CHIPSET(0x8A56, icl_4x8, "Intel(R) HD Graphics (Ice Lake 4x8 GT1)") -+CHIPSET(0x8A57, icl_6x8, "Intel(R) HD Graphics (Ice Lake 6x8 GT1.5)") -+CHIPSET(0x8A58, icl_4x8, "Intel(R) HD Graphics (Ice Lake 4x8 GT1)") -+CHIPSET(0x8A59, icl_6x8, "Intel(R) HD Graphics (Ice Lake 6x8 GT1.5)") - CHIPSET(0x8A5A, icl_6x8, "Intel(R) HD Graphics (Ice Lake 6x8 GT1.5)") - CHIPSET(0x8A5B, icl_4x8, "Intel(R) HD Graphics (Ice Lake 4x8 GT1)") - CHIPSET(0x8A5C, icl_6x8, "Intel(R) HD Graphics (Ice Lake 6x8 GT1.5)") - CHIPSET(0x8A5D, icl_4x8, "Intel(R) HD Graphics (Ice Lake 4x8 GT1)") - CHIPSET(0x8A71, icl_1x8, "Intel(R) HD Graphics (Ice Lake 1x8 GT0.5)") -+CHIPSET(0x4500, ehl_4x8, "Intel(R) HD Graphics (Elkhart Lake 4x8)") -+CHIPSET(0x4571, ehl_4x8, "Intel(R) HD Graphics (Elkhart Lake 4x8)") -+CHIPSET(0x4551, ehl_4x4, "Intel(R) HD Graphics (Elkhart Lake 4x4)") -+CHIPSET(0x4541, ehl_2x4, "Intel(R) HD Graphics (Elkhart Lake 2x4)") --- -2.21.0 - diff --git a/0003-xwayland-Update-screen-pixmap-on-output-resize.patch b/0003-xwayland-Update-screen-pixmap-on-output-resize.patch deleted file mode 100644 index 7aac779..0000000 --- a/0003-xwayland-Update-screen-pixmap-on-output-resize.patch +++ /dev/null @@ -1,80 +0,0 @@ -From 44c693f45d6abd6f7f3bd2f756d35811db143af7 Mon Sep 17 00:00:00 2001 -From: Olivier Fourdan -Date: Fri, 28 Jun 2019 16:55:11 +0200 -Subject: [PATCH xserver 03/15] xwayland: Update screen pixmap on output resize -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Running Xwayland non-rootless and resizing the output would lead to a -crash while trying to update the larger areas of the root window. - -Make sure we resize the backing pixmap according to the new output size -to avoid the crash. - -Signed-off-by: Olivier Fourdan -Closes: https://gitlab.freedesktop.org/xorg/xserver/issues/834 -Reviewed-by: Michel Dänzer -(cherry picked from commit ce9455b5ee389b100a9b7da76b79690d97211b7a) ---- - hw/xwayland/xwayland-output.c | 37 +++++++++++++++++++++++++++++++++++ - 1 file changed, 37 insertions(+) - -diff --git a/hw/xwayland/xwayland-output.c b/hw/xwayland/xwayland-output.c -index cc68f0340..9d33ed862 100644 ---- a/hw/xwayland/xwayland-output.c -+++ b/hw/xwayland/xwayland-output.c -@@ -171,6 +171,40 @@ approximate_mmpd(struct xwl_screen *xwl_screen) - return 25.4 / DEFAULT_DPI; - } - -+static int -+xwl_set_pixmap_visit_window(WindowPtr window, void *data) -+{ -+ ScreenPtr screen = window->drawable.pScreen; -+ -+ if (screen->GetWindowPixmap(window) == data) { -+ screen->SetWindowPixmap(window, screen->GetScreenPixmap(screen)); -+ return WT_WALKCHILDREN; -+ } -+ -+ return WT_DONTWALKCHILDREN; -+} -+ -+static void -+update_backing_pixmaps(struct xwl_screen *xwl_screen, int width, int height) -+{ -+ ScreenPtr pScreen = xwl_screen->screen; -+ WindowPtr pRoot = pScreen->root; -+ PixmapPtr old_pixmap, new_pixmap; -+ -+ old_pixmap = pScreen->GetScreenPixmap(pScreen); -+ new_pixmap = pScreen->CreatePixmap(pScreen, width, height, -+ pScreen->rootDepth, -+ CREATE_PIXMAP_USAGE_BACKING_PIXMAP); -+ pScreen->SetScreenPixmap(new_pixmap); -+ -+ if (old_pixmap) { -+ TraverseTree(pRoot, xwl_set_pixmap_visit_window, old_pixmap); -+ pScreen->DestroyPixmap(old_pixmap); -+ } -+ -+ pScreen->ResizeWindow(pRoot, 0, 0, width, height, NULL); -+} -+ - static void - update_screen_size(struct xwl_output *xwl_output, int width, int height) - { -@@ -180,6 +214,9 @@ update_screen_size(struct xwl_output *xwl_output, int width, int height) - if (xwl_screen->root_clip_mode == ROOT_CLIP_FULL) - SetRootClip(xwl_screen->screen, ROOT_CLIP_NONE); - -+ if (!xwl_screen->rootless && xwl_screen->screen->root) -+ update_backing_pixmaps (xwl_screen, width, height); -+ - xwl_screen->width = width; - xwl_screen->height = height; - xwl_screen->screen->width = width; --- -2.21.0 - diff --git a/0004-xwayland-Expand-the-RANDR-screen-size-limits.patch b/0004-xwayland-Expand-the-RANDR-screen-size-limits.patch deleted file mode 100644 index 066eb45..0000000 --- a/0004-xwayland-Expand-the-RANDR-screen-size-limits.patch +++ /dev/null @@ -1,36 +0,0 @@ -From df7ee10d9812897b297c67fde29f0b134ffba3ec Mon Sep 17 00:00:00 2001 -From: Adam Jackson -Date: Mon, 15 Jul 2019 11:38:44 -0400 -Subject: [PATCH xserver 04/15] xwayland: Expand the RANDR screen size limits -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -There's not really a good way to query this from the wayland server, so -just set the maximum to the X11 protocol limits. While we're at it, -lower the minimum screen size to something implausibly small too, just -in case. - -Fixes: xorg/xserver#850 -Reviewed-by: Michel Dänzer -(cherry picked from commit d0850241c6218f61127c45c2f95d6e791c3fea44) ---- - hw/xwayland/xwayland-output.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/hw/xwayland/xwayland-output.c b/hw/xwayland/xwayland-output.c -index 9d33ed862..aa6f37864 100644 ---- a/hw/xwayland/xwayland-output.c -+++ b/hw/xwayland/xwayland-output.c -@@ -476,7 +476,7 @@ xwl_screen_init_output(struct xwl_screen *xwl_screen) - if (!RRScreenInit(xwl_screen->screen)) - return FALSE; - -- RRScreenSetSizeRange(xwl_screen->screen, 320, 200, 8192, 8192); -+ RRScreenSetSizeRange(xwl_screen->screen, 16, 16, 32767, 32767); - - rp = rrGetScrPriv(xwl_screen->screen); - rp->rrGetInfo = xwl_randr_get_info; --- -2.21.0 - diff --git a/0005-xwayland-Do-not-free-a-NULL-GBM-bo.patch b/0005-xwayland-Do-not-free-a-NULL-GBM-bo.patch deleted file mode 100644 index fd50a63..0000000 --- a/0005-xwayland-Do-not-free-a-NULL-GBM-bo.patch +++ /dev/null @@ -1,56 +0,0 @@ -From dfd51be3ca2a244bbca27a95310b60e0c14940df Mon Sep 17 00:00:00 2001 -From: Olivier Fourdan -Date: Tue, 23 Jul 2019 11:01:47 +0200 -Subject: [PATCH xserver 05/15] xwayland: Do not free a NULL GBM bo -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Both `gbm_bo_create()` and `gbm_bo_create_with_modifiers()` can fail and -return `NULL`. - -If that occurs, `xwl_glamor_gbm_create_pixmap()` will not create a -pixmap for the (NULL) GBM bo, but would still try to free the bo which -leads to a crash in mesa: - - [...] - #7 - #8 in gbm_bo_destroy (bo=0x0) at ../src/gbm/main/gbm.c:439 - #9 in xwl_glamor_gbm_create_pixmap () at xwayland-glamor-gbm.c:245 - #10 in ProcCreatePixmap () at dispatch.c:1440 - #11 in Dispatch () at dispatch.c:478 - #12 in dix_main () at main.c:276 - -To avoid the crash, only free the GBM bo if not `NULL`. - -Signed-off-by: Olivier Fourdan -Reviewed-by: Michel Dänzer -Bugzilla: https://bugzilla.redhat.com/1729925 -(cherry picked from commit d9ec525059dbe96fc893c73c0362be2a6dd73e85) ---- - hw/xwayland/xwayland-glamor-gbm.c | 7 ++++--- - 1 file changed, 4 insertions(+), 3 deletions(-) - -diff --git a/hw/xwayland/xwayland-glamor-gbm.c b/hw/xwayland/xwayland-glamor-gbm.c -index 80146ab6e..291e060cf 100644 ---- a/hw/xwayland/xwayland-glamor-gbm.c -+++ b/hw/xwayland/xwayland-glamor-gbm.c -@@ -238,11 +238,12 @@ xwl_glamor_gbm_create_pixmap(ScreenPtr screen, - GBM_BO_USE_SCANOUT | GBM_BO_USE_RENDERING); - } - -- if (bo) -+ if (bo) { - pixmap = xwl_glamor_gbm_create_pixmap_for_bo(screen, bo, depth); - -- if (!pixmap) -- gbm_bo_destroy(bo); -+ if (!pixmap) -+ gbm_bo_destroy(bo); -+ } - } - - if (!pixmap) --- -2.21.0 - diff --git a/0006-xsync-Add-resource-inside-of-SyncCreate-export-SyncC.patch b/0006-xsync-Add-resource-inside-of-SyncCreate-export-SyncC.patch deleted file mode 100644 index 0e21998..0000000 --- a/0006-xsync-Add-resource-inside-of-SyncCreate-export-SyncC.patch +++ /dev/null @@ -1,244 +0,0 @@ -From 82f01ad7869e3f2be51e41a8246dab5982bbc36a Mon Sep 17 00:00:00 2001 -From: Alex Goins -Date: Wed, 10 Apr 2019 13:48:02 -0500 -Subject: [PATCH xserver 06/15] xsync: Add resource inside of SyncCreate, - export SyncCreate - -As shown by DRI3 adding the SyncCreateFenceFromFD() function, extensions may -want to create a fence, then initialize it in their own way. This currently -can't be done without adding a function directly to Xext/sync.c due to the fact -that the RTFence resource type is private and there is no external interface to -add to it. - -To facilitate other X extensions creating fences and initializing them, this -change exports SyncCreate() and adds the resource directly within it. Callers no -longer need to call AddResource() after SyncCreate(), they only need to -initialize the SyncObject. - -To prevent FreeFence() and FreeCounter() from segfaulting if the call to -AddResource() fails before the sync object is initialized, this adds a new -'initialized' parameter to SyncObject that, when FALSE, causes FreeFence() and -FreeCounter() to skip de-initialization and simply free the object. -Initialization after adding the resource shouldn't otherwise be a problem due to -the single-threaded nature of X. - -Signed-off-by: Alex Goins -Reviewed-by: James Jones -Signed-off-by: Aaron Plattner -(cherry picked from commit 7f962c70b6d9c346477f23f6c15211e749110078) ---- - Xext/sync.c | 50 +++++++++++++++++++++++------------------- - Xext/syncsdk.h | 3 +++ - miext/sync/misync.c | 27 +++++++++++++---------- - miext/sync/misync.h | 1 + - miext/sync/misyncstr.h | 5 +++-- - 5 files changed, 51 insertions(+), 35 deletions(-) - -diff --git a/Xext/sync.c b/Xext/sync.c -index 8f22a865b..fd2ceb042 100644 ---- a/Xext/sync.c -+++ b/Xext/sync.c -@@ -881,18 +881,21 @@ SyncChangeAlarmAttributes(ClientPtr client, SyncAlarm * pAlarm, Mask mask, - return Success; - } - --static SyncObject * -+SyncObject * - SyncCreate(ClientPtr client, XID id, unsigned char type) - { - SyncObject *pSync; -+ RESTYPE resType; - - switch (type) { - case SYNC_COUNTER: - pSync = malloc(sizeof(SyncCounter)); -+ resType = RTCounter; - break; - case SYNC_FENCE: - pSync = (SyncObject *) dixAllocateObjectWithPrivates(SyncFence, - PRIVATE_SYNC_FENCE); -+ resType = RTFence; - break; - default: - return NULL; -@@ -901,6 +904,11 @@ SyncCreate(ClientPtr client, XID id, unsigned char type) - if (!pSync) - return NULL; - -+ pSync->initialized = FALSE; -+ -+ if (!AddResource(id, resType, (void *) pSync)) -+ return NULL; -+ - pSync->client = client; - pSync->id = id; - pSync->pTriglist = NULL; -@@ -923,13 +931,10 @@ SyncCreateFenceFromFD(ClientPtr client, DrawablePtr pDraw, XID id, int fd, BOOL - - status = miSyncInitFenceFromFD(pDraw, pFence, fd, initially_triggered); - if (status != Success) { -- dixFreeObjectWithPrivates(pFence, PRIVATE_SYNC_FENCE); -+ FreeResource(pFence->sync.id, RT_NONE); - return status; - } - -- if (!AddResource(id, RTFence, (void *) pFence)) -- return BadAlloc; -- - return Success; - #else - return BadImplementation; -@@ -957,8 +962,7 @@ SyncCreateCounter(ClientPtr client, XSyncCounter id, int64_t initialvalue) - pCounter->value = initialvalue; - pCounter->pSysCounterInfo = NULL; - -- if (!AddResource(id, RTCounter, (void *) pCounter)) -- return NULL; -+ pCounter->sync.initialized = TRUE; - - return pCounter; - } -@@ -1137,21 +1141,26 @@ static int - FreeCounter(void *env, XID id) - { - SyncCounter *pCounter = (SyncCounter *) env; -- SyncTriggerList *ptl, *pnext; - - pCounter->sync.beingDestroyed = TRUE; -- /* tell all the counter's triggers that the counter has been destroyed */ -- for (ptl = pCounter->sync.pTriglist; ptl; ptl = pnext) { -- (*ptl->pTrigger->CounterDestroyed) (ptl->pTrigger); -- pnext = ptl->next; -- free(ptl); /* destroy the trigger list as we go */ -- } -- if (IsSystemCounter(pCounter)) { -- xorg_list_del(&pCounter->pSysCounterInfo->entry); -- free(pCounter->pSysCounterInfo->name); -- free(pCounter->pSysCounterInfo->private); -- free(pCounter->pSysCounterInfo); -+ -+ if (pCounter->sync.initialized) { -+ SyncTriggerList *ptl, *pnext; -+ -+ /* tell all the counter's triggers that counter has been destroyed */ -+ for (ptl = pCounter->sync.pTriglist; ptl; ptl = pnext) { -+ (*ptl->pTrigger->CounterDestroyed) (ptl->pTrigger); -+ pnext = ptl->next; -+ free(ptl); /* destroy the trigger list as we go */ -+ } -+ if (IsSystemCounter(pCounter)) { -+ xorg_list_del(&pCounter->pSysCounterInfo->entry); -+ free(pCounter->pSysCounterInfo->name); -+ free(pCounter->pSysCounterInfo->private); -+ free(pCounter->pSysCounterInfo); -+ } - } -+ - free(pCounter); - return Success; - } -@@ -1889,9 +1898,6 @@ ProcSyncCreateFence(ClientPtr client) - - miSyncInitFence(pDraw->pScreen, pFence, stuff->initially_triggered); - -- if (!AddResource(stuff->fid, RTFence, (void *) pFence)) -- return BadAlloc; -- - return Success; - } - -diff --git a/Xext/syncsdk.h b/Xext/syncsdk.h -index f1b99d010..c88285cb1 100644 ---- a/Xext/syncsdk.h -+++ b/Xext/syncsdk.h -@@ -29,6 +29,9 @@ - extern _X_EXPORT int - SyncVerifyFence(SyncFence ** ppFence, XID fid, ClientPtr client, Mask mode); - -+extern _X_EXPORT SyncObject* -+ SyncCreate(ClientPtr client, XID id, unsigned char type); -+ - #define VERIFY_SYNC_FENCE(pFence, fid, client, mode) \ - do { \ - int rc; \ -diff --git a/miext/sync/misync.c b/miext/sync/misync.c -index 490fa0b17..0931803f6 100644 ---- a/miext/sync/misync.c -+++ b/miext/sync/misync.c -@@ -101,24 +101,29 @@ miSyncInitFence(ScreenPtr pScreen, SyncFence * pFence, Bool initially_triggered) - pFence->funcs = miSyncFenceFuncs; - - pScreenPriv->funcs.CreateFence(pScreen, pFence, initially_triggered); -+ -+ pFence->sync.initialized = TRUE; - } - - void - miSyncDestroyFence(SyncFence * pFence) - { -- ScreenPtr pScreen = pFence->pScreen; -- SyncScreenPrivPtr pScreenPriv = SYNC_SCREEN_PRIV(pScreen); -- SyncTriggerList *ptl, *pNext; -- - pFence->sync.beingDestroyed = TRUE; -- /* tell all the fence's triggers that the counter has been destroyed */ -- for (ptl = pFence->sync.pTriglist; ptl; ptl = pNext) { -- (*ptl->pTrigger->CounterDestroyed) (ptl->pTrigger); -- pNext = ptl->next; -- free(ptl); /* destroy the trigger list as we go */ -- } - -- pScreenPriv->funcs.DestroyFence(pScreen, pFence); -+ if (pFence->sync.initialized) { -+ ScreenPtr pScreen = pFence->pScreen; -+ SyncScreenPrivPtr pScreenPriv = SYNC_SCREEN_PRIV(pScreen); -+ SyncTriggerList *ptl, *pNext; -+ -+ /* tell all the fence's triggers that the counter has been destroyed */ -+ for (ptl = pFence->sync.pTriglist; ptl; ptl = pNext) { -+ (*ptl->pTrigger->CounterDestroyed) (ptl->pTrigger); -+ pNext = ptl->next; -+ free(ptl); /* destroy the trigger list as we go */ -+ } -+ -+ pScreenPriv->funcs.DestroyFence(pScreen, pFence); -+ } - - dixFreeObjectWithPrivates(pFence, PRIVATE_SYNC_FENCE); - } -diff --git a/miext/sync/misync.h b/miext/sync/misync.h -index dc78c5fdb..f7082d5ea 100644 ---- a/miext/sync/misync.h -+++ b/miext/sync/misync.h -@@ -28,6 +28,7 @@ - #ifndef _MISYNC_H_ - #define _MISYNC_H_ - -+typedef struct _SyncObject SyncObject; - typedef struct _SyncFence SyncFence; - typedef struct _SyncTrigger SyncTrigger; - -diff --git a/miext/sync/misyncstr.h b/miext/sync/misyncstr.h -index 2eab2aa57..2a6e84a96 100644 ---- a/miext/sync/misyncstr.h -+++ b/miext/sync/misyncstr.h -@@ -38,13 +38,14 @@ - #define SYNC_COUNTER 0 - #define SYNC_FENCE 1 - --typedef struct _SyncObject { -+struct _SyncObject { - ClientPtr client; /* Owning client. 0 for system counters */ - struct _SyncTriggerList *pTriglist; /* list of triggers */ - XID id; /* resource ID */ - unsigned char type; /* SYNC_* */ -+ Bool initialized; /* FALSE if created but not initialized */ - Bool beingDestroyed; /* in process of going away */ --} SyncObject; -+}; - - typedef struct _SyncCounter { - SyncObject sync; /* Common sync object data */ --- -2.21.0 - diff --git a/0007-GLX-Add-a-per-client-vendor-mapping.patch b/0007-GLX-Add-a-per-client-vendor-mapping.patch deleted file mode 100644 index 47bf2f1..0000000 --- a/0007-GLX-Add-a-per-client-vendor-mapping.patch +++ /dev/null @@ -1,92 +0,0 @@ -From 1fdb7cbce538f0b37304a3cfc9fae4ff2fe9ece9 Mon Sep 17 00:00:00 2001 -From: Kyle Brenneman -Date: Thu, 19 Oct 2017 15:14:51 -0600 -Subject: [PATCH xserver 07/15] GLX: Add a per-client vendor mapping. - -Each client now has its own (screen, vendor) mapping. - -Currently, it's just a copy of the global mapping, but later changes will allow -it to change. - -Signed-off-by: Aaron Plattner -Reviewed-by: Aaron Plattner -Reviewed-by: Adam Jackson -(cherry picked from commit 37a36a6b5b887d5c5a17a6931ceba8ad5d1bb6d5) ---- - glx/vndext.c | 11 ++++++++++- - glx/vndserver.h | 5 +++++ - glx/vndservermapping.c | 19 +++++++++++++++---- - 3 files changed, 30 insertions(+), 5 deletions(-) - -diff --git a/glx/vndext.c b/glx/vndext.c -index d7936467b..20c0648cc 100644 ---- a/glx/vndext.c -+++ b/glx/vndext.c -@@ -139,8 +139,17 @@ GlxGetClientData(ClientPtr client) - { - GlxClientPriv *cl = xglvGetClientPrivate(client); - if (cl == NULL) { -- cl = calloc(1, sizeof(GlxClientPriv)); -+ cl = calloc(1, sizeof(GlxClientPriv) -+ + screenInfo.numScreens * sizeof(GlxServerVendor *)); - if (cl != NULL) { -+ int i; -+ -+ cl->vendors = (GlxServerVendor **) (cl + 1); -+ for (i=0; ivendors[i] = GlxGetVendorForScreen(NULL, screenInfo.screens[i]); -+ } -+ - xglvSetClientPrivate(client, cl); - } - } -diff --git a/glx/vndserver.h b/glx/vndserver.h -index a175656ae..78246d212 100644 ---- a/glx/vndserver.h -+++ b/glx/vndserver.h -@@ -57,6 +57,11 @@ typedef struct GlxContextTagInfoRec { - typedef struct GlxClientPrivRec { - GlxContextTagInfo *contextTags; - unsigned int contextTagCount; -+ -+ /** -+ * The vendor handles for each screen. -+ */ -+ GlxServerVendor **vendors; - } GlxClientPriv; - - extern int GlxErrorBase; -diff --git a/glx/vndservermapping.c b/glx/vndservermapping.c -index fd3be92d9..778656bb6 100644 ---- a/glx/vndservermapping.c -+++ b/glx/vndservermapping.c -@@ -187,10 +187,21 @@ Bool GlxSetScreenVendor(ScreenPtr screen, GlxServerVendor *vendor) - - GlxServerVendor *GlxGetVendorForScreen(ClientPtr client, ScreenPtr screen) - { -- GlxScreenPriv *priv = GlxGetScreen(screen); -- if (priv != NULL) { -- return priv->vendor; -+ // Note that the client won't be sending GPU screen numbers, so we don't -+ // need per-client mappings for them. -+ if (client != NULL && !screen->isGPU) { -+ GlxClientPriv *cl = GlxGetClientData(client); -+ if (cl != NULL) { -+ return cl->vendors[screen->myNum]; -+ } else { -+ return NULL; -+ } - } else { -- return NULL; -+ GlxScreenPriv *priv = GlxGetScreen(screen); -+ if (priv != NULL) { -+ return priv->vendor; -+ } else { -+ return NULL; -+ } - } - } --- -2.21.0 - diff --git a/0008-GLX-Use-the-sending-client-for-looking-up-XID-s.patch b/0008-GLX-Use-the-sending-client-for-looking-up-XID-s.patch deleted file mode 100644 index 5daa350..0000000 --- a/0008-GLX-Use-the-sending-client-for-looking-up-XID-s.patch +++ /dev/null @@ -1,114 +0,0 @@ -From abeae4a6d356653d50026707ecc2afceac83631e Mon Sep 17 00:00:00 2001 -From: Kyle Brenneman -Date: Wed, 8 May 2019 08:44:54 -0600 -Subject: [PATCH xserver 08/15] GLX: Use the sending client for looking up - XID's - -When GlxGetXIDMap looks up an unknown XID, it will now look up a vendor based -on the screen number for the XID and the client that sent the current request. - -In GlxGetXIDMap, if the XID is for a regular X window, then it won't be in the -(XID -> vendor) mapping, so we have to look up a vendor by screen number. - -With this change, GlxGetXIDMap will use the (screen -> vendor) map for -whichever client sent the current request, instead of using the global -(screen -> vendor) map. - -Since GlxGetXIDMap doesn't take a ClientPtr argument, GlxDispatchRequest will -store the client for the current request in a global variable. That way, the -ABI for GLXVND doesn't need to change. - -v2: Fix an error check in GlxDispatchRequest. - -Signed-off-by: Aaron Plattner -Reviewed-by: Aaron Plattner -Reviewed-by: Adam Jackson -(cherry picked from commit 8b67ec7cc6fda243480a5a8ca118b66242f3eb2c) ---- - glx/vndcmds.c | 13 +++++++++++-- - glx/vndserver.h | 7 +++++++ - glx/vndservermapping.c | 12 ++++++++---- - 3 files changed, 26 insertions(+), 6 deletions(-) - -diff --git a/glx/vndcmds.c b/glx/vndcmds.c -index f0779d14a..21c6fef9e 100644 ---- a/glx/vndcmds.c -+++ b/glx/vndcmds.c -@@ -468,15 +468,24 @@ void GlxDispatchReset(void) - int GlxDispatchRequest(ClientPtr client) - { - REQUEST(xReq); -+ int result; -+ - if (GlxExtensionEntry->base == 0) - return BadRequest; -+ -+ GlxSetRequestClient(client); -+ - if (stuff->data < OPCODE_ARRAY_LEN) { - if (dispatchFuncs[stuff->data] == NULL) { - // Try to find a dispatch stub. - dispatchFuncs[stuff->data] = GetVendorDispatchFunc(stuff->data, 0); - } -- return dispatchFuncs[stuff->data](client); -+ result = dispatchFuncs[stuff->data](client); - } else { -- return dispatch_GLXSingle(client); -+ result = dispatch_GLXSingle(client); - } -+ -+ GlxSetRequestClient(NULL); -+ -+ return result; - } -diff --git a/glx/vndserver.h b/glx/vndserver.h -index 78246d212..613fef0fe 100644 ---- a/glx/vndserver.h -+++ b/glx/vndserver.h -@@ -95,6 +95,13 @@ Bool GlxAddXIDMap(XID id, GlxServerVendor *vendor); - GlxServerVendor * GlxGetXIDMap(XID id); - void GlxRemoveXIDMap(XID id); - -+/** -+ * Records the client that sent the current request. This is needed in -+ * GlxGetXIDMap to know which client's (screen -> vendor) mapping to use for a -+ * regular X window. -+ */ -+void GlxSetRequestClient(ClientPtr client); -+ - GlxContextTagInfo *GlxAllocContextTag(ClientPtr client, GlxServerVendor *vendor); - GlxContextTagInfo *GlxLookupContextTag(ClientPtr client, GLXContextTag tag); - void GlxFreeContextTag(GlxContextTagInfo *tagInfo); -diff --git a/glx/vndservermapping.c b/glx/vndservermapping.c -index 778656bb6..4efab8b81 100644 ---- a/glx/vndservermapping.c -+++ b/glx/vndservermapping.c -@@ -33,6 +33,13 @@ - - #include "vndservervendor.h" - -+static ClientPtr requestClient = NULL; -+ -+void GlxSetRequestClient(ClientPtr client) -+{ -+ requestClient = client; -+} -+ - static GlxServerVendor *LookupXIDMapResource(XID id) - { - void *ptr = NULL; -@@ -59,10 +66,7 @@ GlxServerVendor *GlxGetXIDMap(XID id) - DixGetAttrAccess); - if (rv == Success && ptr != NULL) { - DrawablePtr draw = (DrawablePtr) ptr; -- GlxScreenPriv *screenPriv = GlxGetScreen(draw->pScreen); -- if (screenPriv != NULL) { -- vendor = screenPriv->vendor; -- } -+ vendor = GlxGetVendorForScreen(requestClient, draw->pScreen); - } - } - return vendor; --- -2.21.0 - diff --git a/0009-GLX-Add-a-function-to-change-a-clients-vendor-list.patch b/0009-GLX-Add-a-function-to-change-a-clients-vendor-list.patch deleted file mode 100644 index 961ac10..0000000 --- a/0009-GLX-Add-a-function-to-change-a-clients-vendor-list.patch +++ /dev/null @@ -1,114 +0,0 @@ -From d3034ef2f5121d85ae766a73fda4e523399043a9 Mon Sep 17 00:00:00 2001 -From: Kyle Brenneman -Date: Thu, 2 May 2019 07:17:21 -0600 -Subject: [PATCH xserver 09/15] GLX: Add a function to change a clients vendor - list. - -Add a new function, GlxServerExports::setClientScreenVendor, which will change -the vendor that handles GLX requests for a screen, but only for requests from -a specific client. - -v2: Increment the GLXVND minor version number. -v3: Note the GLXVND version requirement for setClientScreenVendor. - -Signed-off-by: Aaron Plattner -Reviewed-by: Aaron Plattner -Reviewed-by: Adam Jackson -(cherry picked from commit 56c0a71fdd94a008e5d746261f70a713c4767f93) ---- - glx/vndext.c | 1 + - glx/vndserver.h | 1 + - glx/vndservermapping.c | 21 +++++++++++++++++++++ - include/glxvndabi.h | 13 ++++++++++++- - 4 files changed, 35 insertions(+), 1 deletion(-) - -diff --git a/glx/vndext.c b/glx/vndext.c -index 20c0648cc..582e60b6e 100644 ---- a/glx/vndext.c -+++ b/glx/vndext.c -@@ -324,6 +324,7 @@ _X_EXPORT const GlxServerExports glxServer = { - .getContextTagPrivate = GlxGetContextTagPrivate, - .getVendorForScreen = GlxGetVendorForScreen, - .forwardRequest = GlxForwardRequest, -+ .setClientScreenVendor = GlxSetClientScreenVendor, - }; - - const GlxServerExports * -diff --git a/glx/vndserver.h b/glx/vndserver.h -index 613fef0fe..772b458a1 100644 ---- a/glx/vndserver.h -+++ b/glx/vndserver.h -@@ -107,6 +107,7 @@ GlxContextTagInfo *GlxLookupContextTag(ClientPtr client, GLXContextTag tag); - void GlxFreeContextTag(GlxContextTagInfo *tagInfo); - - Bool GlxSetScreenVendor(ScreenPtr screen, GlxServerVendor *vendor); -+Bool GlxSetClientScreenVendor(ClientPtr client, ScreenPtr screen, GlxServerVendor *vendor); - GlxScreenPriv *GlxGetScreen(ScreenPtr pScreen); - GlxServerVendor *GlxGetVendorForScreen(ClientPtr client, ScreenPtr screen); - -diff --git a/glx/vndservermapping.c b/glx/vndservermapping.c -index 4efab8b81..04788ffbd 100644 ---- a/glx/vndservermapping.c -+++ b/glx/vndservermapping.c -@@ -189,6 +189,27 @@ Bool GlxSetScreenVendor(ScreenPtr screen, GlxServerVendor *vendor) - return TRUE; - } - -+Bool GlxSetClientScreenVendor(ClientPtr client, ScreenPtr screen, GlxServerVendor *vendor) -+{ -+ GlxClientPriv *cl; -+ -+ if (screen == NULL || screen->isGPU) { -+ return FALSE; -+ } -+ -+ cl = GlxGetClientData(client); -+ if (cl == NULL) { -+ return FALSE; -+ } -+ -+ if (vendor != NULL) { -+ cl->vendors[screen->myNum] = vendor; -+ } else { -+ cl->vendors[screen->myNum] = GlxGetVendorForScreen(NULL, screen); -+ } -+ return TRUE; -+} -+ - GlxServerVendor *GlxGetVendorForScreen(ClientPtr client, ScreenPtr screen) - { - // Note that the client won't be sending GPU screen numbers, so we don't -diff --git a/include/glxvndabi.h b/include/glxvndabi.h -index b78306d23..71f36e722 100644 ---- a/include/glxvndabi.h -+++ b/include/glxvndabi.h -@@ -75,7 +75,7 @@ - * will still work. - */ - #define GLXSERVER_VENDOR_ABI_MAJOR_VERSION 0 --#define GLXSERVER_VENDOR_ABI_MINOR_VERSION 0 -+#define GLXSERVER_VENDOR_ABI_MINOR_VERSION 1 - - #if defined(__cplusplus) - extern "C" { -@@ -236,6 +236,17 @@ typedef struct GlxServerExportsRec { - * \param client The client. - */ - int (* forwardRequest) (GlxServerVendor *vendor, ClientPtr client); -+ -+ /** -+ * Sets the vendor library to use for a screen for a specific client. -+ * -+ * This function changes which vendor should handle GLX requests for a -+ * screen. Unlike \c setScreenVendor, this function can be called at any -+ * time, and only applies to requests from a single client. -+ * -+ * This function is available in GLXVND version 0.1 or later. -+ */ -+ Bool (* setClientScreenVendor) (ClientPtr client, ScreenPtr screen, GlxServerVendor *vendor); - } GlxServerExports; - - extern _X_EXPORT const GlxServerExports glxServer; --- -2.21.0 - diff --git a/0010-GLX-Set-GlxServerExports-major-minor-Version.patch b/0010-GLX-Set-GlxServerExports-major-minor-Version.patch deleted file mode 100644 index 036950a..0000000 --- a/0010-GLX-Set-GlxServerExports-major-minor-Version.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 39b3005c329bc63676df72c43529d641bf305bcd Mon Sep 17 00:00:00 2001 -From: Aaron Plattner -Date: Tue, 21 May 2019 10:50:42 -0700 -Subject: [PATCH xserver 10/15] GLX: Set GlxServerExports::{major,minor}Version - -Commit 56c0a71fdd94a008e5d746261f70a713c4767f93 incremented the -GLXSERVER_VENDOR_ABI_MINOR_VERSION define, but this define was not actually -being used to set glxServer.minorVersion. - -Update the initializer for glxServer to use the correct version numbers. - -Signed-off-by: Aaron Plattner -(cherry picked from commit b4231d69028adc8123801a7552b40a15ea928d1b) ---- - glx/vndext.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/glx/vndext.c b/glx/vndext.c -index 582e60b6e..0513733b6 100644 ---- a/glx/vndext.c -+++ b/glx/vndext.c -@@ -304,8 +304,8 @@ GlxFreeServerImports(GlxServerImports *imports) - } - - _X_EXPORT const GlxServerExports glxServer = { -- .majorVersion = 0, -- .minorVersion = 0, -+ .majorVersion = GLXSERVER_VENDOR_ABI_MAJOR_VERSION, -+ .minorVersion = GLXSERVER_VENDOR_ABI_MINOR_VERSION, - - .extensionInitCallback = &vndInitCallbackListPtr, - --- -2.21.0 - diff --git a/0011-miext-sync-Fix-needless-ABI-change.patch b/0011-miext-sync-Fix-needless-ABI-change.patch deleted file mode 100644 index 855dd6a..0000000 --- a/0011-miext-sync-Fix-needless-ABI-change.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 8449c8623d6208b77e76596e8b10250817d3e8ab Mon Sep 17 00:00:00 2001 -From: Adam Jackson -Date: Mon, 19 Aug 2019 14:27:54 -0400 -Subject: [PATCH xserver 11/15] miext/sync: Fix needless ABI change - -The initialized field was added in: - - commit 82f01ad7869e3f2be51e41a8246dab5982bbc36a - Author: Alex Goins - Date: Wed Apr 10 13:48:02 2019 -0500 - - xsync: Add resource inside of SyncCreate, export SyncCreate - -But it added this field not at the end of SyncObject. It may not have -been _usefully_ possible to create those from another extension prior to -that commit, but that's still an ABI-incompatible change. - -(cherry picked from commit 194ba38728b34a76885275dae153057c8afaf72e) ---- - miext/sync/misyncstr.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/miext/sync/misyncstr.h b/miext/sync/misyncstr.h -index 2a6e84a96..ea48a4519 100644 ---- a/miext/sync/misyncstr.h -+++ b/miext/sync/misyncstr.h -@@ -43,8 +43,8 @@ struct _SyncObject { - struct _SyncTriggerList *pTriglist; /* list of triggers */ - XID id; /* resource ID */ - unsigned char type; /* SYNC_* */ -- Bool initialized; /* FALSE if created but not initialized */ - Bool beingDestroyed; /* in process of going away */ -+ Bool initialized; /* FALSE if created but not initialized */ - }; - - typedef struct _SyncCounter { --- -2.21.0 - diff --git a/0012-glx-Fix-previous-context-validation-in-xorgGlxMakeCu.patch b/0012-glx-Fix-previous-context-validation-in-xorgGlxMakeCu.patch deleted file mode 100644 index 08eae5f..0000000 --- a/0012-glx-Fix-previous-context-validation-in-xorgGlxMakeCu.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 045add84927051a33569ed701097e1fd514bf0ca Mon Sep 17 00:00:00 2001 -From: Adam Jackson -Date: Fri, 16 Aug 2019 14:56:19 -0400 -Subject: [PATCH xserver 12/15] glx: Fix previous context validation in - xorgGlxMakeCurrent - -vnd has already verified that the context tag is valid before this gets -called, and we only set the context tag private data to non-null for -indirect clients. Mesa happens to be buggy and doesn't send MakeCurrent -requests nearly as much as it should for direct contexts, but if you fix -that, then unbinding a direct context would fail here with -GLXBadContextTag. - -Sadly Mesa will still need to carry a workaround here for broken -servers, but we should still fix the server. - -(cherry picked from commit 95dcc81cb122e5a4c5b38e84ef46eb872b2e1431) ---- - glx/glxcmds.c | 4 +--- - 1 file changed, 1 insertion(+), 3 deletions(-) - -diff --git a/glx/glxcmds.c b/glx/glxcmds.c -index 54d452e58..75e42823c 100644 ---- a/glx/glxcmds.c -+++ b/glx/glxcmds.c -@@ -574,10 +574,8 @@ xorgGlxMakeCurrent(ClientPtr client, GLXContextTag tag, XID drawId, XID readId, - /* Look up old context. If we have one, it must be in a usable state. */ - if (tag != 0) { - prevglxc = glxServer.getContextTagPrivate(client, tag); -- if (!prevglxc) -- return __glXError(GLXBadContextTag); - -- if (prevglxc->renderMode != GL_RENDER) { -+ if (prevglxc && prevglxc->renderMode != GL_RENDER) { - /* Oops. Not in render mode render. */ - client->errorValue = prevglxc->id; - return __glXError(GLXBadContextState); --- -2.21.0 - diff --git a/0013-xwayland-Separate-DamagePtr-into-separate-window-dat.patch b/0013-xwayland-Separate-DamagePtr-into-separate-window-dat.patch deleted file mode 100644 index bc1e76d..0000000 --- a/0013-xwayland-Separate-DamagePtr-into-separate-window-dat.patch +++ /dev/null @@ -1,173 +0,0 @@ -From e0af09061f9e8397ca564ec3bbedea51974455d4 Mon Sep 17 00:00:00 2001 -From: Carlos Garnacho -Date: Mon, 7 Jan 2019 15:20:05 +0100 -Subject: [PATCH xserver 13/15] xwayland: Separate DamagePtr into separate - window data - -This will be dissociated in future commits to handle the cases -where windows are being realized before there is a compositor -handling redirection. - -In that case, we still want the DamagePtr to be registered upfront -on RealizeWindowProc before a corresponding xwl_window might be -created. Most notably, it cannot be lazily created on -SetWindowPixmapProc as damage accounting gets broken. - -Signed-off-by: Carlos Garnacho -(cherry picked from commit 4e50440ae20c537d6a4edf356cda67dd33d4e5a8) ---- - hw/xwayland/xwayland.c | 74 +++++++++++++++++++++++++++++++++--------- - hw/xwayland/xwayland.h | 1 - - 2 files changed, 58 insertions(+), 17 deletions(-) - -diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index 7e6e0ab25..1efebd061 100644 ---- a/hw/xwayland/xwayland.c -+++ b/hw/xwayland/xwayland.c -@@ -125,6 +125,7 @@ ddxProcessArgument(int argc, char *argv[], int i) - static DevPrivateKeyRec xwl_window_private_key; - static DevPrivateKeyRec xwl_screen_private_key; - static DevPrivateKeyRec xwl_pixmap_private_key; -+static DevPrivateKeyRec xwl_damage_private_key; - - static struct xwl_window * - xwl_window_get(WindowPtr window) -@@ -367,8 +368,14 @@ xwl_cursor_confined_to(DeviceIntPtr device, - static void - damage_report(DamagePtr pDamage, RegionPtr pRegion, void *data) - { -- struct xwl_window *xwl_window = data; -- struct xwl_screen *xwl_screen = xwl_window->xwl_screen; -+ WindowPtr window = data; -+ struct xwl_window *xwl_window = xwl_window_get(window); -+ struct xwl_screen *xwl_screen; -+ -+ if (!xwl_window) -+ return; -+ -+ xwl_screen = xwl_window->xwl_screen; - - #ifdef GLAMOR_HAS_GBM - if (xwl_window->present_flipped) { -@@ -390,6 +397,47 @@ damage_destroy(DamagePtr pDamage, void *data) - { - } - -+static Bool -+register_damage(WindowPtr window) -+{ -+ DamagePtr damage; -+ -+ damage = DamageCreate(damage_report, damage_destroy, DamageReportNonEmpty, -+ FALSE, window->drawable.pScreen, window); -+ if (damage == NULL) { -+ ErrorF("Failed creating damage\n"); -+ return FALSE; -+ } -+ -+ DamageRegister(&window->drawable, damage); -+ DamageSetReportAfterOp(damage, TRUE); -+ -+ dixSetPrivate(&window->devPrivates, &xwl_damage_private_key, damage); -+ -+ return TRUE; -+} -+ -+static void -+unregister_damage(WindowPtr window) -+{ -+ DamagePtr damage; -+ -+ damage = dixLookupPrivate(&window->devPrivates, &xwl_damage_private_key); -+ if (!damage) -+ return; -+ -+ DamageUnregister(damage); -+ DamageDestroy(damage); -+ -+ dixSetPrivate(&window->devPrivates, &xwl_damage_private_key, NULL); -+} -+ -+static DamagePtr -+window_get_damage(WindowPtr window) -+{ -+ return dixLookupPrivate(&window->devPrivates, &xwl_damage_private_key); -+} -+ - static void - shell_surface_ping(void *data, - struct wl_shell_surface *shell_surface, uint32_t serial) -@@ -545,18 +593,10 @@ xwl_realize_window(WindowPtr window) - - wl_surface_set_user_data(xwl_window->surface, xwl_window); - -- xwl_window->damage = -- DamageCreate(damage_report, damage_destroy, DamageReportNonEmpty, -- FALSE, screen, xwl_window); -- if (xwl_window->damage == NULL) { -- ErrorF("Failed creating damage\n"); -- goto err_surf; -- } -- - compRedirectWindow(serverClient, window, CompositeRedirectManual); - -- DamageRegister(&window->drawable, xwl_window->damage); -- DamageSetReportAfterOp(xwl_window->damage, TRUE); -+ if (!register_damage(window)) -+ goto err_surf; - - dixSetPrivate(&window->devPrivates, &xwl_window_private_key, xwl_window); - xorg_list_init(&xwl_window->link_damage); -@@ -620,8 +660,8 @@ xwl_unrealize_window(WindowPtr window) - - wl_surface_destroy(xwl_window->surface); - xorg_list_del(&xwl_window->link_damage); -- DamageUnregister(xwl_window->damage); -- DamageDestroy(xwl_window->damage); -+ unregister_damage(window); -+ - if (xwl_window->frame_callback) - wl_callback_destroy(xwl_window->frame_callback); - -@@ -689,7 +729,7 @@ xwl_window_post_damage(struct xwl_window *xwl_window) - - assert(!xwl_window->frame_callback); - -- region = DamageRegion(xwl_window->damage); -+ region = DamageRegion(window_get_damage(xwl_window->window)); - pixmap = (*xwl_screen->screen->GetWindowPixmap) (xwl_window->window); - - #ifdef XWL_HAS_GLAMOR -@@ -726,7 +766,7 @@ xwl_window_post_damage(struct xwl_window *xwl_window) - wl_callback_add_listener(xwl_window->frame_callback, &frame_listener, xwl_window); - - wl_surface_commit(xwl_window->surface); -- DamageEmpty(xwl_window->damage); -+ DamageEmpty(window_get_damage(xwl_window->window)); - - xorg_list_del(&xwl_window->link_damage); - } -@@ -962,6 +1002,8 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) - return FALSE; - if (!dixRegisterPrivateKey(&xwl_pixmap_private_key, PRIVATE_PIXMAP, 0)) - return FALSE; -+ if (!dixRegisterPrivateKey(&xwl_damage_private_key, PRIVATE_WINDOW, 0)) -+ return FALSE; - - dixSetPrivate(&pScreen->devPrivates, &xwl_screen_private_key, xwl_screen); - xwl_screen->screen = pScreen; -diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h -index 463622669..dfa3b37c3 100644 ---- a/hw/xwayland/xwayland.h -+++ b/hw/xwayland/xwayland.h -@@ -178,7 +178,6 @@ struct xwl_window { - struct wl_surface *surface; - struct wl_shell_surface *shell_surface; - WindowPtr window; -- DamagePtr damage; - struct xorg_list link_damage; - struct wl_callback *frame_callback; - Bool allow_commits; --- -2.21.0 - diff --git a/0014-xwayland-Refactor-surface-creation-into-a-separate-f.patch b/0014-xwayland-Refactor-surface-creation-into-a-separate-f.patch deleted file mode 100644 index f8fff3f..0000000 --- a/0014-xwayland-Refactor-surface-creation-into-a-separate-f.patch +++ /dev/null @@ -1,125 +0,0 @@ -From 12db645c7fc0539752a881df7ac2bcd09e3cb17b Mon Sep 17 00:00:00 2001 -From: Carlos Garnacho -Date: Mon, 7 Jan 2019 15:33:31 +0100 -Subject: [PATCH xserver 14/15] xwayland: Refactor surface creation into a - separate function - -This is just called from xwl_window_realize() ATM, but will be useful in -future commits. - -Signed-off-by: Carlos Garnacho -(cherry picked from commit c2e8ae964052944312c5023ca7ea5c41a92990e5) ---- - hw/xwayland/xwayland.c | 64 ++++++++++++++++++++++++++++-------------- - 1 file changed, 43 insertions(+), 21 deletions(-) - -diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index 1efebd061..9a4b52fa9 100644 ---- a/hw/xwayland/xwayland.c -+++ b/hw/xwayland/xwayland.c -@@ -518,36 +518,25 @@ send_surface_id_event(struct xwl_window *xwl_window) - } - - static Bool --xwl_realize_window(WindowPtr window) -+ensure_surface_for_window(WindowPtr window) - { - ScreenPtr screen = window->drawable.pScreen; - struct xwl_screen *xwl_screen; - struct xwl_window *xwl_window; - struct wl_region *region; -- Bool ret; -- -- xwl_screen = xwl_screen_get(screen); -- -- screen->RealizeWindow = xwl_screen->RealizeWindow; -- ret = (*screen->RealizeWindow) (window); -- xwl_screen->RealizeWindow = screen->RealizeWindow; -- screen->RealizeWindow = xwl_realize_window; - -- if (xwl_screen->rootless && !window->parent) { -- BoxRec box = { 0, 0, xwl_screen->width, xwl_screen->height }; -+ if (xwl_window_get(window)) -+ return TRUE; - -- RegionReset(&window->winSize, &box); -- RegionNull(&window->clipList); -- RegionNull(&window->borderClip); -- } -+ xwl_screen = xwl_screen_get(screen); - - if (xwl_screen->rootless) { - if (window->redirectDraw != RedirectDrawManual) -- return ret; -+ return TRUE; - } - else { - if (window->parent) -- return ret; -+ return TRUE; - } - - xwl_window = calloc(1, sizeof *xwl_window); -@@ -595,15 +584,12 @@ xwl_realize_window(WindowPtr window) - - compRedirectWindow(serverClient, window, CompositeRedirectManual); - -- if (!register_damage(window)) -- goto err_surf; -- - dixSetPrivate(&window->devPrivates, &xwl_window_private_key, xwl_window); - xorg_list_init(&xwl_window->link_damage); - - xwl_window_init_allow_commits(xwl_window); - -- return ret; -+ return TRUE; - - err_surf: - if (xwl_window->shell_surface) -@@ -614,6 +600,42 @@ err: - return FALSE; - } - -+static Bool -+xwl_realize_window(WindowPtr window) -+{ -+ ScreenPtr screen = window->drawable.pScreen; -+ struct xwl_screen *xwl_screen; -+ Bool ret; -+ -+ xwl_screen = xwl_screen_get(screen); -+ -+ screen->RealizeWindow = xwl_screen->RealizeWindow; -+ ret = (*screen->RealizeWindow) (window); -+ xwl_screen->RealizeWindow = screen->RealizeWindow; -+ screen->RealizeWindow = xwl_realize_window; -+ -+ if (!ret) -+ return FALSE; -+ -+ if (xwl_screen->rootless && !window->parent) { -+ BoxRec box = { 0, 0, xwl_screen->width, xwl_screen->height }; -+ -+ RegionReset(&window->winSize, &box); -+ RegionNull(&window->clipList); -+ RegionNull(&window->borderClip); -+ } -+ -+ if (xwl_screen->rootless ? -+ (window->drawable.class == InputOutput && -+ window->parent == window->drawable.pScreen->root) : -+ !window->parent) { -+ if (!register_damage(window)) -+ return FALSE; -+ } -+ -+ return ensure_surface_for_window(window); -+} -+ - static Bool - xwl_unrealize_window(WindowPtr window) - { --- -2.21.0 - diff --git a/0015-xwayland-Handle-the-case-of-windows-being-realized-b.patch b/0015-xwayland-Handle-the-case-of-windows-being-realized-b.patch deleted file mode 100644 index 86d427c..0000000 --- a/0015-xwayland-Handle-the-case-of-windows-being-realized-b.patch +++ /dev/null @@ -1,91 +0,0 @@ -From 63346c74393e1df4555f84367529802a67578ef6 Mon Sep 17 00:00:00 2001 -From: Carlos Garnacho -Date: Mon, 7 Jan 2019 15:33:35 +0100 -Subject: [PATCH xserver 15/15] xwayland: Handle the case of windows being - realized before redirection -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -If Xwayland gets to realize a window meant for composition before the -compositor redirected windows (i.e. redirect mode is not RedirectDrawManual -yet), the window would stay "invisible" as we wouldn't create a -wl_surface/wl_shell_surface for it at any later point. - -This scenario may happen if the wayland compositor sets up a X11 socket -upfront, but waits to raise Xwayland until there are X11 clients. In this -case the first data on the socket is the client's, the compositor can hardly -beat that in order to redirect subwindows before the client realizes a -Window. - -In order to jump across this hurdle, allow the late creation of a matching -(shell) surface for the WindowPtr on SetWindowPixmapProc, so it is ensured -to be created after the compositor set up redirection. - -Signed-off-by: Carlos Garnacho -Reviewed-by: Michel Dänzer -Reviewed-by: Olivier Fourdan -(cherry picked from commit 78cc8b6f9613fc71f6ecc7e8848d54364a250634) ---- - hw/xwayland/xwayland.c | 25 +++++++++++++++++++++++++ - hw/xwayland/xwayland.h | 1 + - 2 files changed, 26 insertions(+) - -diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index 9a4b52fa9..baa08d87b 100644 ---- a/hw/xwayland/xwayland.c -+++ b/hw/xwayland/xwayland.c -@@ -699,6 +699,26 @@ xwl_save_screen(ScreenPtr pScreen, int on) - return TRUE; - } - -+static void -+xwl_set_window_pixmap(WindowPtr window, -+ PixmapPtr pixmap) -+{ -+ ScreenPtr screen = window->drawable.pScreen; -+ struct xwl_screen *xwl_screen; -+ -+ xwl_screen = xwl_screen_get(screen); -+ -+ screen->SetWindowPixmap = xwl_screen->SetWindowPixmap; -+ (*screen->SetWindowPixmap) (window, pixmap); -+ xwl_screen->SetWindowPixmap = screen->SetWindowPixmap; -+ screen->SetWindowPixmap = xwl_set_window_pixmap; -+ -+ if (!RegionNotEmpty(&window->winSize)) -+ return; -+ -+ ensure_surface_for_window(window); -+} -+ - static void - frame_callback(void *data, - struct wl_callback *callback, -@@ -1185,6 +1205,11 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) - xwl_screen->CloseScreen = pScreen->CloseScreen; - pScreen->CloseScreen = xwl_close_screen; - -+ if (xwl_screen->rootless) { -+ xwl_screen->SetWindowPixmap = pScreen->SetWindowPixmap; -+ pScreen->SetWindowPixmap = xwl_set_window_pixmap; -+ } -+ - pScreen->CursorWarpedTo = xwl_cursor_warped_to; - pScreen->CursorConfinedTo = xwl_cursor_confined_to; - -diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h -index dfa3b37c3..0854df456 100644 ---- a/hw/xwayland/xwayland.h -+++ b/hw/xwayland/xwayland.h -@@ -133,6 +133,7 @@ struct xwl_screen { - UnrealizeWindowProcPtr UnrealizeWindow; - DestroyWindowProcPtr DestroyWindow; - XYToWindowProcPtr XYToWindow; -+ SetWindowPixmapProcPtr SetWindowPixmap; - - struct xorg_list output_list; - struct xorg_list seat_list; --- -2.21.0 - diff --git a/sources b/sources index 9b15990..d74b6f3 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (xorg-server-1.20.5.tar.bz2) = 625f0626b122cf95600abe382c3217348999357a0e2d2443092f1b67cff1c98d7ef09303884ceaeac181e0555dc56b0d4d44bda45cc464dac2d9a50c5b32d631 +SHA512 (xorg-server-1.20.6.tar.bz2) = 9aa0ba4aee92fe628f2b8c41e4fe0134dc86154bb8787f907884ef2fd970e18e68e72ea8a1beb706d11ecf155b2abc9731f1abadff251ed592f8cca3b1240dd6 diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 43ea0af..7a105b6 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -45,8 +45,8 @@ Summary: X.Org X11 X server Name: xorg-x11-server -Version: 1.20.5 -Release: 9%{?gitdate:.%{gitdate}}%{?dist} +Version: 1.20.6 +Release: 1%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org License: MIT @@ -100,65 +100,32 @@ Patch6: 0001-Fedora-hack-Make-the-suid-root-wrapper-always-start-.patch #Patch23: 0003-modesetting-Factor-out-drmmode_target_output.patch #Patch24: 0004-modesetting-Use-atomic-instead-of-per-crtc-walks-whe.patch +# Backports from current stable "server-1.20-branch": +# ... + +# Backports from "master" upstream: + # https://bugzilla.redhat.com/show_bug.cgi?id=1697804 -Patch25: 0001-Xi-return-AlreadyGrabbed-for-key-grabs-255.patch - -# From current server-1.20-branch: -# https://bugzilla.redhat.com/1708119 -Patch26: 0001-xwayland-Avoid-a-crash-on-pointer-enter-with-a-grab.patch -# https://bugzilla.redhat.com/1691745 -Patch27: 0001-xwayland-Check-status-in-GBM-pixmap-creation.patch -# https://bugzilla.redhat.com/1645553 -Patch28: 0001-glamor-Make-pixmap-exportable-from-gbm_bo_from_pixma.patch -Patch29: 0001-xwayland-Reset-scheduled-frames-after-hiding-tablet-.patch - -# https://gitlab.freedesktop.org/xorg/xserver/issues/839 -# https://bugzilla.redhat.com/1726419 -Patch30: 0001-Revert-present-scmd-Check-that-the-flip-and-screen-p.patch - -# Build failure with recent glibc -# https://gitlab.freedesktop.org/xorg/xserver/issues/840 -Patch31: 0001-compiler.h-Do-not-include-sys-io.h-on-ARM-with-glibc.patch - -Patch32: 0001-Xi-Use-current-device-active-grab-to-deliver-touch-e.patch -Patch33: 0002-dri2-Sync-i965_pci_ids.h-from-mesa.patch -Patch34: 0003-xwayland-Update-screen-pixmap-on-output-resize.patch -Patch35: 0004-xwayland-Expand-the-RANDR-screen-size-limits.patch -# https://bugzilla.redhat.com/1729925 -Patch36: 0005-xwayland-Do-not-free-a-NULL-GBM-bo.patch -Patch37: 0006-xsync-Add-resource-inside-of-SyncCreate-export-SyncC.patch -Patch38: 0007-GLX-Add-a-per-client-vendor-mapping.patch -Patch39: 0008-GLX-Use-the-sending-client-for-looking-up-XID-s.patch -Patch40: 0009-GLX-Add-a-function-to-change-a-clients-vendor-list.patch -Patch41: 0010-GLX-Set-GlxServerExports-major-minor-Version.patch -Patch42: 0011-miext-sync-Fix-needless-ABI-change.patch -Patch43: 0012-glx-Fix-previous-context-validation-in-xorgGlxMakeCu.patch -Patch44: 0013-xwayland-Separate-DamagePtr-into-separate-window-dat.patch -Patch45: 0014-xwayland-Refactor-surface-creation-into-a-separate-f.patch -Patch46: 0015-xwayland-Handle-the-case-of-windows-being-realized-b.patch +Patch500: 0001-Xi-return-AlreadyGrabbed-for-key-grabs-255.patch # Backported Xwayland randr resolution change emulation support -Patch47: 0001-dix-Add-GetCurrentClient-helper.patch -Patch48: 0002-xwayland-Add-wp_viewport-wayland-extension-support.patch -Patch49: 0003-xwayland-Use-buffer_damage-instead-of-surface-damage.patch -Patch50: 0004-xwayland-Add-fake-output-modes-to-xrandr-output-mode.patch -Patch51: 0005-xwayland-Use-RandR-1.2-interface-rev-2.patch -Patch52: 0006-xwayland-Add-per-client-private-data.patch -Patch53: 0007-xwayland-Add-support-for-storing-per-client-per-outp.patch -Patch54: 0008-xwayland-Add-support-for-randr-resolution-change-emu.patch -Patch55: 0009-xwayland-Add-xwlRRModeToDisplayMode-helper-function.patch -Patch56: 0010-xwayland-Add-xwlVidModeGetCurrentRRMode-helper-to-th.patch -Patch57: 0011-xwayland-Add-vidmode-mode-changing-emulation-support.patch -Patch58: 0012-xwayland-xwl_window_should_enable_viewport-Add-extra.patch -Patch59: 0013-xwayland-Set-_XWAYLAND_RANDR_EMU_MONITOR_RECTS-prope.patch -Patch60: 0014-xwayland-Fix-emulated-modes-not-being-removed-when-s.patch -Patch61: 0015-xwayland-Call-xwl_window_check_resolution_change_emu.patch -Patch62: 0016-xwayland-Fix-setting-of-_XWAYLAND_RANDR_EMU_MONITOR_.patch -Patch63: 0017-xwayland-Remove-unnecessary-xwl_window_is_toplevel-c.patch - -# Fix building with new libglvnd-1.2.0 (E)GL headers and pkgconfig files -Patch64: 0001-build-glx-Lower-gl-version-to-work-with-libglvnd.patch -Patch65: 0001-glamor-xwayland-Define-EGL_NO_X11.patch +Patch501: 0001-dix-Add-GetCurrentClient-helper.patch +Patch502: 0002-xwayland-Add-wp_viewport-wayland-extension-support.patch +Patch503: 0003-xwayland-Use-buffer_damage-instead-of-surface-damage.patch +Patch504: 0004-xwayland-Add-fake-output-modes-to-xrandr-output-mode.patch +Patch505: 0005-xwayland-Use-RandR-1.2-interface-rev-2.patch +Patch506: 0006-xwayland-Add-per-client-private-data.patch +Patch507: 0007-xwayland-Add-support-for-storing-per-client-per-outp.patch +Patch508: 0008-xwayland-Add-support-for-randr-resolution-change-emu.patch +Patch509: 0009-xwayland-Add-xwlRRModeToDisplayMode-helper-function.patch +Patch510: 0010-xwayland-Add-xwlVidModeGetCurrentRRMode-helper-to-th.patch +Patch511: 0011-xwayland-Add-vidmode-mode-changing-emulation-support.patch +Patch512: 0012-xwayland-xwl_window_should_enable_viewport-Add-extra.patch +Patch513: 0013-xwayland-Set-_XWAYLAND_RANDR_EMU_MONITOR_RECTS-prope.patch +Patch514: 0014-xwayland-Fix-emulated-modes-not-being-removed-when-s.patch +Patch515: 0015-xwayland-Call-xwl_window_check_resolution_change_emu.patch +Patch516: 0016-xwayland-Fix-setting-of-_XWAYLAND_RANDR_EMU_MONITOR_.patch +Patch517: 0017-xwayland-Remove-unnecessary-xwl_window_is_toplevel-c.patch BuildRequires: systemtap-sdt-devel BuildRequires: git @@ -584,6 +551,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Mon Nov 25 2019 Olivier Fourdan - 1.20.6-1 +- xserver 1.20.6 + * Mon Nov 4 2019 Hans de Goede - 1.20.5-9 - Fix building with new libglvnd-1.2.0 (E)GL headers and pkgconfig files From dafffedcc84c1c1f79e5f9f0a6dd8ead0192c555 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 31 Jan 2020 04:47:29 +0000 Subject: [PATCH 047/131] - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- xorg-x11-server.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 7a105b6..a45f48d 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -46,7 +46,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.20.6 -Release: 1%{?gitdate:.%{gitdate}}%{?dist} +Release: 2%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org License: MIT @@ -551,6 +551,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Fri Jan 31 2020 Fedora Release Engineering - 1.20.6-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + * Mon Nov 25 2019 Olivier Fourdan - 1.20.6-1 - xserver 1.20.6 From 1e468bc44a1ad5c8a6c0b7f3ca8d0b381b4a5813 Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Fri, 13 Mar 2020 09:33:15 +0100 Subject: [PATCH 048/131] xserver 1.20.7 - backport from stable "xserver-1.20-branch" up to commit ad7364d8d (for mutter fullscreen unredirect on Wayland) - Update videodrv minor ABI as 1.20.7 changed the minor ABI version (backward compatible, API addition in glamor) - Rebase Xwayland randr resolution change emulation support patches --- ...urn-AlreadyGrabbed-for-key-grabs-255.patch | 42 --- ...-GLAMOR_HAS_EGL_QUERY_DRIVER-when-av.patch | 57 ++++ 0001-dix-Add-GetCurrentClient-helper.patch | 8 +- ...-modesetting-Explicitly-include-mi.h.patch | 29 ++ ...p_viewport-wayland-extension-support.patch | 14 +- ...ixmap-filling-optimization-to-GXcopy.patch | 38 +++ ...fer_damage-instead-of-surface-damage.patch | 28 +- ...t-make-reference-to-noClientExceptio.patch | 34 +++ ...e-output-modes-to-xrandr-output-mode.patch | 14 +- ...-dying-client-in-ResetCurrentRequest.patch | 39 +++ ...ayland-Use-RandR-1.2-interface-rev-2.patch | 6 +- ...il-from-xf86RotateRedisplay-if-pScre.patch | 37 +++ ...xwayland-Add-per-client-private-data.patch | 20 +- ...ve-unnecessary-error-message-fix-zap.patch | 59 ++++ ...port-for-storing-per-client-per-outp.patch | 16 +- ...-FBO-allocation-failure-for-picture-.patch | 44 +++ ...port-for-randr-resolution-change-emu.patch | 34 +-- ...-on-out-of-memory-when-allocating-PB.patch | 66 +++++ ...lRRModeToDisplayMode-helper-function.patch | 6 +- ...-glamor_prepare_access-failures-in-c.patch | 45 ++++ ...VidModeGetCurrentRRMode-helper-to-th.patch | 6 +- ...to-system-memory-for-RW-PBO-buffer-a.patch | 67 +++++ ...mode-mode-changing-emulation-support.patch | 6 +- ...piler-warning-since-the-recent-OOM-f.patch | 28 ++ ...dow_should_enable_viewport-Add-extra.patch | 10 +- ...ng-Disable-atomic-support-by-default.patch | 69 +++++ ...AYLAND_RANDR_EMU_MONITOR_RECTS-prope.patch | 18 +- ...lated-modes-not-being-removed-when-s.patch | 6 +- ...p-xwl_screen_post_damage-into-two-ph.patch | 64 +++++ ...amor_block_handler-from-xwl_screen_p.patch | 46 ++++ ...l_window_check_resolution_change_emu.patch | 8 +- ...ting-of-_XWAYLAND_RANDR_EMU_MONITOR_.patch | 10 +- ...ixmaps-after-creation-in-rootless-mo.patch | 137 ++++++++++ ..._window_create_frame_callback-helper.patch | 62 +++++ ...unnecessary-xwl_window_is_toplevel-c.patch | 4 +- ...gle-frame-callback-for-Present-flips.patch | 212 +++++++++++++++ ...me-callbacks-for-Present-vblank-even.patch | 99 +++++++ 0020-Fix-building-with-fno-common.patch | 254 ++++++++++++++++++ ...r-NULL-spriteInfo-in-GetPairedDevice.patch | 35 +++ ...gbm-Handle-DRM_FORMAT_MOD_INVALID-gr.patch | 41 +++ sources | 2 +- xorg-x11-server.spec | 41 ++- 42 files changed, 1704 insertions(+), 157 deletions(-) delete mode 100644 0001-Xi-return-AlreadyGrabbed-for-key-grabs-255.patch create mode 100644 0001-configure-Define-GLAMOR_HAS_EGL_QUERY_DRIVER-when-av.patch create mode 100644 0002-modesetting-Explicitly-include-mi.h.patch create mode 100644 0003-Restrict-1x1-pixmap-filling-optimization-to-GXcopy.patch create mode 100644 0004-Revert-dri2-Don-t-make-reference-to-noClientExceptio.patch create mode 100644 0005-os-Ignore-dying-client-in-ResetCurrentRequest.patch create mode 100644 0006-xfree86-modes-Bail-from-xf86RotateRedisplay-if-pScre.patch create mode 100644 0007-modesetting-remove-unnecessary-error-message-fix-zap.patch create mode 100644 0008-glamor-Propagate-FBO-allocation-failure-for-picture-.patch create mode 100644 0009-glamor-Error-out-on-out-of-memory-when-allocating-PB.patch create mode 100644 0010-glamor-Propagate-glamor_prepare_access-failures-in-c.patch create mode 100644 0011-glamor-Fallback-to-system-memory-for-RW-PBO-buffer-a.patch create mode 100644 0012-glamor-Fix-a-compiler-warning-since-the-recent-OOM-f.patch create mode 100644 0013-modesetting-Disable-atomic-support-by-default.patch create mode 100644 0014-xwayland-Split-up-xwl_screen_post_damage-into-two-ph.patch create mode 100644 0015-xwayland-Call-glamor_block_handler-from-xwl_screen_p.patch create mode 100644 0016-xwayland-clear-pixmaps-after-creation-in-rootless-mo.patch create mode 100644 0017-xwayland-Add-xwl_window_create_frame_callback-helper.patch create mode 100644 0018-xwayland-Use-single-frame-callback-for-Present-flips.patch create mode 100644 0019-xwayland-Use-frame-callbacks-for-Present-vblank-even.patch create mode 100644 0020-Fix-building-with-fno-common.patch create mode 100644 0021-dix-Check-for-NULL-spriteInfo-in-GetPairedDevice.patch create mode 100644 0022-xwayland-glamor-gbm-Handle-DRM_FORMAT_MOD_INVALID-gr.patch diff --git a/0001-Xi-return-AlreadyGrabbed-for-key-grabs-255.patch b/0001-Xi-return-AlreadyGrabbed-for-key-grabs-255.patch deleted file mode 100644 index 9c846d0..0000000 --- a/0001-Xi-return-AlreadyGrabbed-for-key-grabs-255.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 0ad717edcf372425ddf2ba9926857419ab62f4f5 Mon Sep 17 00:00:00 2001 -From: Peter Hutterer -Date: Wed, 29 May 2019 16:19:55 +1000 -Subject: [PATCH xserver] Xi: return AlreadyGrabbed for key grabs > 255 - -We can't have high keycodes because everything in XKB relies on 8 bits. XI2's -API allows for 32-bit keycodes so we have to take those but nothing in the -server is really ready for this. The effect of this right now is that any high -keycode grab is clipped to 255 and thus ends up grabbing a different key -instead. - -https://bugzilla.redhat.com/show_bug.cgi?id=1697804 - -Signed-off-by: Peter Hutterer ---- - Xi/xipassivegrab.c | 10 ++++++++-- - 1 file changed, 8 insertions(+), 2 deletions(-) - -diff --git a/Xi/xipassivegrab.c b/Xi/xipassivegrab.c -index 65d5870f6..d30f51f3c 100644 ---- a/Xi/xipassivegrab.c -+++ b/Xi/xipassivegrab.c -@@ -203,8 +203,14 @@ ProcXIPassiveGrabDevice(ClientPtr client) - ¶m, XI2, &mask); - break; - case XIGrabtypeKeycode: -- status = GrabKey(client, dev, mod_dev, stuff->detail, -- ¶m, XI2, &mask); -+ /* XI2 allows 32-bit keycodes but thanks to XKB we can never -+ * implement this. Just return an error for all keycodes that -+ * cannot work anyway */ -+ if (stuff->detail > 255) -+ status = XIAlreadyGrabbed; -+ else -+ status = GrabKey(client, dev, mod_dev, stuff->detail, -+ ¶m, XI2, &mask); - break; - case XIGrabtypeEnter: - case XIGrabtypeFocusIn: --- -2.21.0 - diff --git a/0001-configure-Define-GLAMOR_HAS_EGL_QUERY_DRIVER-when-av.patch b/0001-configure-Define-GLAMOR_HAS_EGL_QUERY_DRIVER-when-av.patch new file mode 100644 index 0000000..41a6992 --- /dev/null +++ b/0001-configure-Define-GLAMOR_HAS_EGL_QUERY_DRIVER-when-av.patch @@ -0,0 +1,57 @@ +From ad7364d8d7f936b9b08195e47d2f6ee9329ff687 Mon Sep 17 00:00:00 2001 +From: Kenneth Graunke +Date: Mon, 13 Jan 2020 23:34:49 -0800 +Subject: [PATCH xserver 01/22] configure: Define GLAMOR_HAS_EGL_QUERY_DRIVER + when available +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Commit 195c2ef8f9f07b9bdabc0f554a9033b7857b99c7 added this to the Meson +build but neglected to add it to autotools. + +v2: Also update dix-config.h.in + +Fixes: 195c2ef8f ("glamor: Add a function to get the driver name via EGL_MESA_query_driver") + +Reviewed-by: Michel Dänzer [v1] +Reviewed-by: Eric Engestrom [v1] +Reviewed-by: Matt Turner +(cherry picked from commit 25ca99df38a2c28c25ab20a917e68442285f2353) +--- + configure.ac | 4 ++++ + include/dix-config.h.in | 3 +++ + 2 files changed, 7 insertions(+) + +diff --git a/configure.ac b/configure.ac +index 9f82e2a7d..231515f0c 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -2053,6 +2053,10 @@ if test "x$GLAMOR" = xyes; then + [AC_DEFINE(GLAMOR_HAS_EGL_QUERY_DMABUF, 1, [Have GLAMOR_HAS_EGL_QUERY_DMABUF])], + []) + ++ PKG_CHECK_EXISTS(epoxy >= 1.5.4, ++ [AC_DEFINE(GLAMOR_HAS_EGL_QUERY_DRIVER, 1, [Have GLAMOR_HAS_EGL_QUERY_DRIVER])], ++ []) ++ + PKG_CHECK_MODULES(GBM, "$LIBGBM", [GBM=yes], [GBM=no]) + if test "x$GBM" = xyes; then + AC_DEFINE(GLAMOR_HAS_GBM, 1, +diff --git a/include/dix-config.h.in b/include/dix-config.h.in +index c18f62370..d02bb1b81 100644 +--- a/include/dix-config.h.in ++++ b/include/dix-config.h.in +@@ -485,6 +485,9 @@ + /* Glamor can use eglQueryDmaBuf* functions */ + #undef GLAMOR_HAS_EGL_QUERY_DMABUF + ++/* Glamor can use EGL_MESA_query_driver functions */ ++#undef GLAMOR_HAS_EGL_QUERY_DRIVER ++ + /* byte order */ + #undef X_BYTE_ORDER + +-- +2.24.1 + diff --git a/0001-dix-Add-GetCurrentClient-helper.patch b/0001-dix-Add-GetCurrentClient-helper.patch index 41ed9e7..7e0f949 100644 --- a/0001-dix-Add-GetCurrentClient-helper.patch +++ b/0001-dix-Add-GetCurrentClient-helper.patch @@ -1,7 +1,7 @@ -From 7d403201820fb2bdc04bfa8f83c9dd3822c6abda Mon Sep 17 00:00:00 2001 +From 23d54f7049c83fd5baf9e008c159c8ffbec3649c Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Thu, 29 Aug 2019 14:18:28 +0200 -Subject: [PATCH xserver 01/14] dix: Add GetCurrentClient helper +Subject: [PATCH xserver 01/17] dix: Add GetCurrentClient helper MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -49,7 +49,7 @@ Signed-off-by: Hans de Goede 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/dix/dispatch.c b/dix/dispatch.c -index 176c7a0dd..ce84e6c8c 100644 +index a33bfaa9e..2b1cf1a74 100644 --- a/dix/dispatch.c +++ b/dix/dispatch.c @@ -148,6 +148,7 @@ xConnSetupPrefix connSetupPrefix; @@ -111,5 +111,5 @@ index b6e2bcfde..d65060cb6 100644 extern _X_EXPORT void SetInputCheck(HWEventQueuePtr /*c0 */ , HWEventQueuePtr /*c1 */ ); -- -2.23.0 +2.24.1 diff --git a/0002-modesetting-Explicitly-include-mi.h.patch b/0002-modesetting-Explicitly-include-mi.h.patch new file mode 100644 index 0000000..da71434 --- /dev/null +++ b/0002-modesetting-Explicitly-include-mi.h.patch @@ -0,0 +1,29 @@ +From c2ef88c4d3a551ff7646bfb86550cae32b02a510 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michel=20D=C3=A4nzer?= +Date: Tue, 14 Jan 2020 09:23:34 +0100 +Subject: [PATCH xserver 02/22] modesetting: Explicitly #include "mi.h" + +For the miClearDrawable prototype. Apparently it doesn't get pulled in +for some build configurations, breaking the build. + +Reviewed-by: Kenneth Graunke +(cherry picked from commit a24a786fc8490fda08b15c3dab6fa6750f008ecb) +--- + hw/xfree86/drivers/modesetting/drmmode_display.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c +index e18cc379f..3874f6e21 100644 +--- a/hw/xfree86/drivers/modesetting/drmmode_display.c ++++ b/hw/xfree86/drivers/modesetting/drmmode_display.c +@@ -36,6 +36,7 @@ + #include "dumb_bo.h" + #include "xf86str.h" + #include "X11/Xatom.h" ++#include "mi.h" + #include "micmap.h" + #include "xf86cmap.h" + #include "xf86DDC.h" +-- +2.24.1 + diff --git a/0002-xwayland-Add-wp_viewport-wayland-extension-support.patch b/0002-xwayland-Add-wp_viewport-wayland-extension-support.patch index 6fce642..bb0a3fd 100644 --- a/0002-xwayland-Add-wp_viewport-wayland-extension-support.patch +++ b/0002-xwayland-Add-wp_viewport-wayland-extension-support.patch @@ -1,7 +1,7 @@ -From f473d009dba1029658f6c3fb5751fbbf027ed468 Mon Sep 17 00:00:00 2001 +From 707554709a1f7c0f04ef55e72c4cc41ad8e904fd Mon Sep 17 00:00:00 2001 From: Robert Mader Date: Mon, 22 Jan 2018 22:02:32 +0100 -Subject: [PATCH xserver 02/14] xwayland: Add wp_viewport wayland extension +Subject: [PATCH xserver 02/17] xwayland: Add wp_viewport wayland extension support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -23,7 +23,7 @@ Signed-off-by: Hans de Goede hw/xwayland/meson.build | 3 +++ hw/xwayland/xwayland.c | 3 +++ hw/xwayland/xwayland.h | 2 ++ - 5 files changed, 24 insertions(+), 1 deletion(-) + 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/hw/xwayland/Makefile.am b/hw/xwayland/Makefile.am index bc1cb8506..49aae3d8b 100644 @@ -80,10 +80,10 @@ index 36bf2133a..4a8d171bb 100644 xwayland_glamor = [] eglstream_srcs = [] diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index baa08d87b..292f239e8 100644 +index 5fefa5923..13b298f7f 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c -@@ -863,6 +863,9 @@ registry_global(void *data, struct wl_registry *registry, uint32_t id, +@@ -916,6 +916,9 @@ registry_global(void *data, struct wl_registry *registry, uint32_t id, wl_registry_bind(registry, id, &zxdg_output_manager_v1_interface, 1); xwl_screen_init_xdg_output(xwl_screen); } @@ -94,7 +94,7 @@ index baa08d87b..292f239e8 100644 else if (xwl_screen->glamor) { xwl_glamor_init_wl_registry(xwl_screen, registry, id, interface, diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h -index 0854df456..c4eabe4c3 100644 +index a12ec257b..042e107ce 100644 --- a/hw/xwayland/xwayland.h +++ b/hw/xwayland/xwayland.h @@ -48,6 +48,7 @@ @@ -114,5 +114,5 @@ index 0854df456..c4eabe4c3 100644 #define XWL_FORMAT_ARGB8888 (1 << 0) -- -2.23.0 +2.24.1 diff --git a/0003-Restrict-1x1-pixmap-filling-optimization-to-GXcopy.patch b/0003-Restrict-1x1-pixmap-filling-optimization-to-GXcopy.patch new file mode 100644 index 0000000..f52ea66 --- /dev/null +++ b/0003-Restrict-1x1-pixmap-filling-optimization-to-GXcopy.patch @@ -0,0 +1,38 @@ +From d845ceae53bb425695e6a185b51ae1b432dd4672 Mon Sep 17 00:00:00 2001 +From: George Matsumura +Date: Thu, 6 Feb 2020 17:54:36 +0100 +Subject: [PATCH xserver 03/22] Restrict 1x1 pixmap filling optimization to + GXcopy +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This restricts an optimization whereby the filling of 1x1 pixmaps +went around the driver-provided function to cases where the +source color is meant to be directly copied to the destination, +as opposed to other operations which should produce different +destination values than just the foreground color. + +Signed-off-by: George Matsumura +Reviewed-by: Michel Dänzer +(cherry picked from commit 83826075e59c0393c16d2a2482dc5c9f2fdf4564) +--- + exa/exa_accel.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/exa/exa_accel.c b/exa/exa_accel.c +index b26d5c804..41fcb129f 100644 +--- a/exa/exa_accel.c ++++ b/exa/exa_accel.c +@@ -1037,7 +1037,7 @@ exaFillRegionSolid(DrawablePtr pDrawable, RegionPtr pRegion, Pixel pixel, + if (pExaPixmap->pDamage && + pExaPixmap->sys_ptr && pDrawable->type == DRAWABLE_PIXMAP && + pDrawable->width == 1 && pDrawable->height == 1 && +- pDrawable->bitsPerPixel != 24) { ++ pDrawable->bitsPerPixel != 24 && alu == GXcopy) { + RegionPtr pending_damage = DamagePendingRegion(pExaPixmap->pDamage); + + switch (pDrawable->bitsPerPixel) { +-- +2.24.1 + diff --git a/0003-xwayland-Use-buffer_damage-instead-of-surface-damage.patch b/0003-xwayland-Use-buffer_damage-instead-of-surface-damage.patch index c274d4e..4fd9b83 100644 --- a/0003-xwayland-Use-buffer_damage-instead-of-surface-damage.patch +++ b/0003-xwayland-Use-buffer_damage-instead-of-surface-damage.patch @@ -1,7 +1,7 @@ -From 0356eff57bc1201e2bcd5fdd363a50ceabc4a4fa Mon Sep 17 00:00:00 2001 +From 4f06238e319c604638693f5eb452211210b14abf Mon Sep 17 00:00:00 2001 From: Robert Mader Date: Tue, 2 Jul 2019 12:03:12 +0200 -Subject: [PATCH xserver 03/14] xwayland: Use buffer_damage instead of surface +Subject: [PATCH xserver 03/17] xwayland: Use buffer_damage instead of surface damage if available MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -63,11 +63,11 @@ index 66720bcc0..cbc715061 100644 xwl_cursor->frame_cb = wl_surface_frame(xwl_cursor->surface); wl_callback_add_listener(xwl_cursor->frame_cb, &frame_listener, xwl_cursor); diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c -index 2937d9c97..df771c30f 100644 +index c7c077aaa..e583708cb 100644 --- a/hw/xwayland/xwayland-present.c +++ b/hw/xwayland/xwayland-present.c -@@ -500,9 +500,9 @@ xwl_present_flip(WindowPtr present_window, - xwl_present_window->frame_timer_firing = FALSE; +@@ -495,9 +495,9 @@ xwl_present_flip(WindowPtr present_window, + /* Realign timer */ xwl_present_reset_timer(xwl_present_window); - wl_surface_damage(xwl_window->surface, 0, 0, @@ -80,10 +80,10 @@ index 2937d9c97..df771c30f 100644 wl_surface_commit(xwl_window->surface); diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index 292f239e8..8b1c7918a 100644 +index 13b298f7f..87185e6f3 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c -@@ -759,6 +759,16 @@ xwl_destroy_window(WindowPtr window) +@@ -796,6 +796,16 @@ xwl_destroy_window(WindowPtr window) return ret; } @@ -100,7 +100,7 @@ index 292f239e8..8b1c7918a 100644 static void xwl_window_post_damage(struct xwl_window *xwl_window) { -@@ -795,13 +805,15 @@ xwl_window_post_damage(struct xwl_window *xwl_window) +@@ -832,13 +842,15 @@ xwl_window_post_damage(struct xwl_window *xwl_window) */ if (RegionNumRects(region) > 256) { box = RegionExtents(region); @@ -120,8 +120,8 @@ index 292f239e8..8b1c7918a 100644 + } } - xwl_window->frame_callback = wl_surface_frame(xwl_window->surface); -@@ -844,8 +856,13 @@ registry_global(void *data, struct wl_registry *registry, uint32_t id, + xwl_window_create_frame_callback(xwl_window); +@@ -897,8 +909,13 @@ registry_global(void *data, struct wl_registry *registry, uint32_t id, struct xwl_screen *xwl_screen = data; if (strcmp(interface, "wl_compositor") == 0) { @@ -137,11 +137,11 @@ index 292f239e8..8b1c7918a 100644 else if (strcmp(interface, "wl_shm") == 0) { xwl_screen->shm = wl_registry_bind(registry, id, &wl_shm_interface, 1); diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h -index c4eabe4c3..3e973d688 100644 +index 042e107ce..07baa09e2 100644 --- a/hw/xwayland/xwayland.h +++ b/hw/xwayland/xwayland.h -@@ -381,6 +381,9 @@ struct xwl_output { - }; +@@ -382,6 +382,9 @@ struct xwl_output { + void xwl_window_create_frame_callback(struct xwl_window *xwl_window); void xwl_sync_events (struct xwl_screen *xwl_screen); +void xwl_surface_damage(struct xwl_screen *xwl_screen, @@ -151,5 +151,5 @@ index c4eabe4c3..3e973d688 100644 Bool xwl_screen_init_cursor(struct xwl_screen *xwl_screen); -- -2.23.0 +2.24.1 diff --git a/0004-Revert-dri2-Don-t-make-reference-to-noClientExceptio.patch b/0004-Revert-dri2-Don-t-make-reference-to-noClientExceptio.patch new file mode 100644 index 0000000..0576c94 --- /dev/null +++ b/0004-Revert-dri2-Don-t-make-reference-to-noClientExceptio.patch @@ -0,0 +1,34 @@ +From e5293f1c5d7b20d98ed4975dc29a6f88c8bc6a0d Mon Sep 17 00:00:00 2001 +From: Adam Jackson +Date: Thu, 6 Feb 2020 17:55:25 +0100 +Subject: [PATCH xserver 04/22] Revert "dri2: Don't make reference to + noClientException" + +It's true that the value would always be -1, if it's not zero, but it's +usually zero is the problem. As a result we return failure from +otherwise successful indirect GLX paths, which isn't very nice of us. + +This reverts commit 7d33ab0f8c7958b205076f71e4b47c24aace77fd. + +Fixes: https://gitlab.freedesktop.org/xorg/xserver/issues/211 +(cherry picked from commit e1fa3beb2fe2519e69f859f0acdc68e5a770de27) +--- + glx/glxdri2.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/glx/glxdri2.c b/glx/glxdri2.c +index d402ca860..822515a86 100644 +--- a/glx/glxdri2.c ++++ b/glx/glxdri2.c +@@ -295,7 +295,7 @@ __glXDRIcontextWait(__GLXcontext * baseContext, + } + + if (ret) { +- *error = -1; ++ *error = cl->client->noClientException; + return TRUE; + } + +-- +2.24.1 + diff --git a/0004-xwayland-Add-fake-output-modes-to-xrandr-output-mode.patch b/0004-xwayland-Add-fake-output-modes-to-xrandr-output-mode.patch index 33467da..a570437 100644 --- a/0004-xwayland-Add-fake-output-modes-to-xrandr-output-mode.patch +++ b/0004-xwayland-Add-fake-output-modes-to-xrandr-output-mode.patch @@ -1,7 +1,7 @@ -From 873a7d2164c08ddf57e88095b34bbec092f28d31 Mon Sep 17 00:00:00 2001 +From 1a24c9850144481cdc0ebf9bea5b3141ddc2c4b2 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Wed, 26 Jun 2019 16:46:54 +0200 -Subject: [PATCH xserver 04/14] xwayland: Add fake output modes to xrandr +Subject: [PATCH xserver 04/17] xwayland: Add fake output modes to xrandr output mode lists MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -162,10 +162,10 @@ index aa6f37864..2ccc3ca60 100644 xorg_list_for_each_entry(it, &xwl_screen->output_list, link) { /* output done event is sent even when some property diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index 8b1c7918a..a599c022a 100644 +index 87185e6f3..44eb0e042 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c -@@ -139,6 +139,23 @@ xwl_screen_get(ScreenPtr screen) +@@ -152,6 +152,23 @@ xwl_screen_get(ScreenPtr screen) return dixLookupPrivate(&screen->devPrivates, &xwl_screen_private_key); } @@ -190,10 +190,10 @@ index 8b1c7918a..a599c022a 100644 xwl_window_set_allow_commits(struct xwl_window *xwl_window, Bool allow, const char *debug_msg) diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h -index 3e973d688..0fafc07a6 100644 +index 07baa09e2..937977ccf 100644 --- a/hw/xwayland/xwayland.h +++ b/hw/xwayland/xwayland.h -@@ -388,6 +388,7 @@ void xwl_surface_damage(struct xwl_screen *xwl_screen, +@@ -389,6 +389,7 @@ void xwl_surface_damage(struct xwl_screen *xwl_screen, Bool xwl_screen_init_cursor(struct xwl_screen *xwl_screen); struct xwl_screen *xwl_screen_get(ScreenPtr screen); @@ -202,5 +202,5 @@ index 3e973d688..0fafc07a6 100644 void xwl_tablet_tool_set_cursor(struct xwl_tablet_tool *tool); void xwl_seat_set_cursor(struct xwl_seat *xwl_seat); -- -2.23.0 +2.24.1 diff --git a/0005-os-Ignore-dying-client-in-ResetCurrentRequest.patch b/0005-os-Ignore-dying-client-in-ResetCurrentRequest.patch new file mode 100644 index 0000000..99ed599 --- /dev/null +++ b/0005-os-Ignore-dying-client-in-ResetCurrentRequest.patch @@ -0,0 +1,39 @@ +From af2fd88b1019f63fe3ce871f9e99b3e1e4608b25 Mon Sep 17 00:00:00 2001 +From: Daniel Llewellyn +Date: Thu, 6 Feb 2020 17:56:12 +0100 +Subject: [PATCH xserver 05/22] os: Ignore dying client in ResetCurrentRequest + +You might as well, it's harmless. Better, some cleanup code (like DRI2 +swap wait) needs to run both normally and at client exit, so it +simplifies the callers to not need to check first. See 4308f5d3 for a +similar example. + +Props: @ajax (Adam Jackson) + +Fixes: xorg/xserver#211 + +Signed-off-by: Daniel Llewellyn +(cherry picked from commit 578371616e09364318c9fb2371a693d438b31b29) +--- + os/io.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/os/io.c b/os/io.c +index b099f0967..939f51743 100644 +--- a/os/io.c ++++ b/os/io.c +@@ -557,6 +557,11 @@ void + ResetCurrentRequest(ClientPtr client) + { + OsCommPtr oc = (OsCommPtr) client->osPrivate; ++ ++ /* ignore dying clients */ ++ if (!oc) ++ return; ++ + register ConnectionInputPtr oci = oc->input; + register xReq *request; + int gotnow, needed; +-- +2.24.1 + diff --git a/0005-xwayland-Use-RandR-1.2-interface-rev-2.patch b/0005-xwayland-Use-RandR-1.2-interface-rev-2.patch index e875403..4970c3d 100644 --- a/0005-xwayland-Use-RandR-1.2-interface-rev-2.patch +++ b/0005-xwayland-Use-RandR-1.2-interface-rev-2.patch @@ -1,7 +1,7 @@ -From 81ff61afd6594e0cf00f4be7ff34f94cd9e8f9b0 Mon Sep 17 00:00:00 2001 +From 10ea651c552c8a7d7a2bfab29b7def4f31f8af6c Mon Sep 17 00:00:00 2001 From: Robert Mader Date: Mon, 22 Jan 2018 17:57:38 +0100 -Subject: [PATCH xserver 05/14] xwayland: Use RandR 1.2 interface (rev 2) +Subject: [PATCH xserver 05/17] xwayland: Use RandR 1.2 interface (rev 2) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -134,5 +134,5 @@ index 2ccc3ca60..67e99bdab 100644 return TRUE; } -- -2.23.0 +2.24.1 diff --git a/0006-xfree86-modes-Bail-from-xf86RotateRedisplay-if-pScre.patch b/0006-xfree86-modes-Bail-from-xf86RotateRedisplay-if-pScre.patch new file mode 100644 index 0000000..a5397d5 --- /dev/null +++ b/0006-xfree86-modes-Bail-from-xf86RotateRedisplay-if-pScre.patch @@ -0,0 +1,37 @@ +From 1c3e51dabadbf65e7fdedbebbdcd19a85fb03e34 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michel=20D=C3=A4nzer?= +Date: Thu, 6 Feb 2020 17:57:16 +0100 +Subject: [PATCH xserver 06/22] xfree86/modes: Bail from xf86RotateRedisplay if + pScreen->root is NULL + +Avoids a crash in xf86RotatePrepare -> DamageRegister during +CreateScreenResources if rotation or another transform is configured for +any connected RandR output in xorg.conf. The generic rotation/transform +code generally can't work without the root window currently. + +Closes: https://gitlab.freedesktop.org/xorg/xserver/issues/969 +Fixes: 094f42cdfe5d "xfree86/modes: Call xf86RotateRedisplay from + xf86CrtcRotate" +Acked-by: Olivier Fourdan +Reviewed-by: Adam Jackson +(cherry picked from commit 6a5e47c57d16de8b6a6a2636f3cbad1aebec32e2) +--- + hw/xfree86/modes/xf86Rotate.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/hw/xfree86/modes/xf86Rotate.c b/hw/xfree86/modes/xf86Rotate.c +index 05944cfcb..5415ed97c 100644 +--- a/hw/xfree86/modes/xf86Rotate.c ++++ b/hw/xfree86/modes/xf86Rotate.c +@@ -176,7 +176,7 @@ xf86RotateRedisplay(ScreenPtr pScreen) + DamagePtr damage = xf86_config->rotation_damage; + RegionPtr region; + +- if (!damage) ++ if (!damage || !pScreen->root) + return FALSE; + xf86RotatePrepare(pScreen); + region = DamageRegion(damage); +-- +2.24.1 + diff --git a/0006-xwayland-Add-per-client-private-data.patch b/0006-xwayland-Add-per-client-private-data.patch index 4038480..cad9ff4 100644 --- a/0006-xwayland-Add-per-client-private-data.patch +++ b/0006-xwayland-Add-per-client-private-data.patch @@ -1,7 +1,7 @@ -From 1dc4938467b6338695eda4224f0b0c592cb2c25c Mon Sep 17 00:00:00 2001 +From 000b477eee11fddd0d4e323407aaa40afb818827 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Thu, 29 Aug 2019 22:45:12 +0200 -Subject: [PATCH xserver 06/14] xwayland: Add per client private data +Subject: [PATCH xserver 06/17] xwayland: Add per client private data MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -20,10 +20,10 @@ Signed-off-by: Hans de Goede 2 files changed, 19 insertions(+) diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index a599c022a..2b6065f1a 100644 +index 44eb0e042..7720baab8 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c -@@ -122,11 +122,18 @@ ddxProcessArgument(int argc, char *argv[], int i) +@@ -135,11 +135,18 @@ ddxProcessArgument(int argc, char *argv[], int i) return 0; } @@ -42,7 +42,7 @@ index a599c022a..2b6065f1a 100644 static struct xwl_window * xwl_window_get(WindowPtr window) { -@@ -1083,6 +1090,13 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) +@@ -1136,6 +1143,13 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) return FALSE; if (!dixRegisterPrivateKey(&xwl_damage_private_key, PRIVATE_WINDOW, 0)) return FALSE; @@ -57,12 +57,12 @@ index a599c022a..2b6065f1a 100644 dixSetPrivate(&pScreen->devPrivates, &xwl_screen_private_key, xwl_screen); xwl_screen->screen = pScreen; diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h -index 0fafc07a6..17018fcf5 100644 +index 937977ccf..630b14e48 100644 --- a/hw/xwayland/xwayland.h +++ b/hw/xwayland/xwayland.h -@@ -380,6 +380,11 @@ struct xwl_output { - Bool xdg_output_done; - }; +@@ -381,6 +381,11 @@ struct xwl_output { + + void xwl_window_create_frame_callback(struct xwl_window *xwl_window); +struct xwl_client { +}; @@ -73,5 +73,5 @@ index 0fafc07a6..17018fcf5 100644 void xwl_surface_damage(struct xwl_screen *xwl_screen, struct wl_surface *surface, -- -2.23.0 +2.24.1 diff --git a/0007-modesetting-remove-unnecessary-error-message-fix-zap.patch b/0007-modesetting-remove-unnecessary-error-message-fix-zap.patch new file mode 100644 index 0000000..0638020 --- /dev/null +++ b/0007-modesetting-remove-unnecessary-error-message-fix-zap.patch @@ -0,0 +1,59 @@ +From 948afd768398955f043fef8e14d7d154cea25f85 Mon Sep 17 00:00:00 2001 +From: Dave Airlie +Date: Thu, 6 Feb 2020 17:59:08 +0100 +Subject: [PATCH xserver 07/22] modesetting: remove unnecessary error message, + fix zaphod leases +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +I introduced this error with the MST hotplug code, but it can trigger +on zaphod setups, and is perfectly fine. There is no support for +MST/hotplug on zaphod setups currently, so we can just skip over +the dynamic connector handling here. However we shouldn't skip +over the lease handling so move it into the codepath. + +Fixes: 9257b1252da9 ("modesetting: add dynamic connector hotplug support (MST) (v3)") +Reviewed-by: Michel Dänzer +Signed-off-by: Dave Airlie +(cherry picked from commit 1cfdd1a96580733df3625bcea3384ffee3dc92df) +--- + hw/xfree86/drivers/modesetting/drmmode_display.c | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c +index 3874f6e21..ae06fa357 100644 +--- a/hw/xfree86/drivers/modesetting/drmmode_display.c ++++ b/hw/xfree86/drivers/modesetting/drmmode_display.c +@@ -3677,7 +3677,7 @@ drmmode_handle_uevents(int fd, void *closure) + goto out; + + if (mode_res->count_crtcs != config->num_crtc) { +- ErrorF("number of CRTCs changed - failed to handle, %d vs %d\n", mode_res->count_crtcs, config->num_crtc); ++ /* this triggers with Zaphod mode where we don't currently support connector hotplug or MST. */ + goto out_free_res; + } + +@@ -3726,15 +3726,16 @@ drmmode_handle_uevents(int fd, void *closure) + drmmode_output_init(scrn, drmmode, mode_res, i, TRUE, 0); + } + +- /* Check to see if a lessee has disappeared */ +- drmmode_validate_leases(scrn); +- + if (changed) { + RRSetChanged(xf86ScrnToScreen(scrn)); + RRTellChanged(xf86ScrnToScreen(scrn)); + } + + out_free_res: ++ ++ /* Check to see if a lessee has disappeared */ ++ drmmode_validate_leases(scrn); ++ + drmModeFreeResources(mode_res); + out: + RRGetInfo(xf86ScrnToScreen(scrn), TRUE); +-- +2.24.1 + diff --git a/0007-xwayland-Add-support-for-storing-per-client-per-outp.patch b/0007-xwayland-Add-support-for-storing-per-client-per-outp.patch index 5ddec9d..223ee46 100644 --- a/0007-xwayland-Add-support-for-storing-per-client-per-outp.patch +++ b/0007-xwayland-Add-support-for-storing-per-client-per-outp.patch @@ -1,7 +1,7 @@ -From dfb887783bfe3c5f57d46738bce13ec2d79b1769 Mon Sep 17 00:00:00 2001 +From 7c9852e4e9e85000d6c8759b237ed9e9320dadfd Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Thu, 29 Aug 2019 23:04:36 +0200 -Subject: [PATCH xserver 07/14] xwayland: Add support for storing per client +Subject: [PATCH xserver 07/17] xwayland: Add support for storing per client per output emulated resolution MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -108,12 +108,12 @@ index 67e99bdab..82ff5db70 100644 const int32_t xwl_output_fake_modes[][2] = { /* 4:3 (1.33) */ diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h -index 17018fcf5..d0e87a89d 100644 +index 630b14e48..7e6497b80 100644 --- a/hw/xwayland/xwayland.h +++ b/hw/xwayland/xwayland.h -@@ -380,7 +380,21 @@ struct xwl_output { - Bool xdg_output_done; - }; +@@ -381,7 +381,21 @@ struct xwl_output { + + void xwl_window_create_frame_callback(struct xwl_window *xwl_window); +/* Per client per output emulated randr/vidmode resolution info. */ +struct xwl_emulated_mode { @@ -133,7 +133,7 @@ index 17018fcf5..d0e87a89d 100644 }; struct xwl_client *xwl_client_get(ClientPtr client); -@@ -424,6 +438,9 @@ void xwl_output_destroy(struct xwl_output *xwl_output); +@@ -425,6 +439,9 @@ void xwl_output_destroy(struct xwl_output *xwl_output); void xwl_output_remove(struct xwl_output *xwl_output); @@ -144,5 +144,5 @@ index 17018fcf5..d0e87a89d 100644 float VRefresh, Bool Reduced, Bool Interlaced); -- -2.23.0 +2.24.1 diff --git a/0008-glamor-Propagate-FBO-allocation-failure-for-picture-.patch b/0008-glamor-Propagate-FBO-allocation-failure-for-picture-.patch new file mode 100644 index 0000000..53d60f2 --- /dev/null +++ b/0008-glamor-Propagate-FBO-allocation-failure-for-picture-.patch @@ -0,0 +1,44 @@ +From 428b5ce4da99a43bfa0c1933ec447f7feb3639a1 Mon Sep 17 00:00:00 2001 +From: Paul Kocialkowski +Date: Mon, 10 Feb 2020 10:19:18 +0100 +Subject: [PATCH xserver 08/22] glamor: Propagate FBO allocation failure for + picture to texture upload + +When uploading a picture to a texture, glamor_upload_picture_to_texture +calls glamor_pixmap_ensure_fbo to ensure that there is backing FBO. +The FBO will be allocated if the picture's drawable pixmap does not have +one already, which can fail when there is no GL memory left. + +glamor_upload_picture_to_texture checks that the call succeeded and will +enter the failure path if it did not. However, unlike many other +functions in glamor, this one has ret set to TRUE initially, so it needs +to be set to FALSE when a failure happens. + +Otherwise, the error is not propagated and the failure path return TRUE. +This leads to a fault when trying to access the FBO pointer later on. + +Signed-off-by: Paul Kocialkowski +(cherry picked from commit c98c7709c67d8ed6b7455ec700a49b58c396ec2c) +--- + glamor/glamor_picture.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/glamor/glamor_picture.c b/glamor/glamor_picture.c +index 84a33ad6a..685d8d618 100644 +--- a/glamor/glamor_picture.c ++++ b/glamor/glamor_picture.c +@@ -340,8 +340,10 @@ glamor_upload_picture_to_texture(PicturePtr picture) + else + iformat = format; + +- if (!glamor_pixmap_ensure_fbo(pixmap, iformat, GLAMOR_CREATE_FBO_NO_FBO)) ++ if (!glamor_pixmap_ensure_fbo(pixmap, iformat, GLAMOR_CREATE_FBO_NO_FBO)) { ++ ret = FALSE; + goto fail; ++ } + + glPixelStorei(GL_UNPACK_ALIGNMENT, 4); + +-- +2.24.1 + diff --git a/0008-xwayland-Add-support-for-randr-resolution-change-emu.patch b/0008-xwayland-Add-support-for-randr-resolution-change-emu.patch index 7119e31..0e7c5c6 100644 --- a/0008-xwayland-Add-support-for-randr-resolution-change-emu.patch +++ b/0008-xwayland-Add-support-for-randr-resolution-change-emu.patch @@ -1,7 +1,7 @@ -From e997273b14a23b0ffe89f542de783adbec6e8a1b Mon Sep 17 00:00:00 2001 +From 869e6f39165daeacdd9cbb3f2f0d1845a3af3360 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Tue, 2 Jul 2019 11:55:26 +0200 -Subject: [PATCH xserver 08/14] xwayland: Add support for randr-resolution +Subject: [PATCH xserver 08/17] xwayland: Add support for randr-resolution change emulation using viewport MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -142,10 +142,10 @@ index 82ff5db70..99ab1b288 100644 static Bool diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index 2b6065f1a..ec1b7eee4 100644 +index 7720baab8..1466e1e11 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c -@@ -163,6 +163,23 @@ xwl_screen_has_resolution_change_emulation(struct xwl_screen *xwl_screen) +@@ -176,6 +176,23 @@ xwl_screen_has_resolution_change_emulation(struct xwl_screen *xwl_screen) return xwl_screen->rootless && xwl_screen_has_viewport_support(xwl_screen); } @@ -169,7 +169,7 @@ index 2b6065f1a..ec1b7eee4 100644 static void xwl_window_set_allow_commits(struct xwl_window *xwl_window, Bool allow, const char *debug_msg) -@@ -499,6 +516,150 @@ xwl_pixmap_get(PixmapPtr pixmap) +@@ -512,6 +529,150 @@ xwl_pixmap_get(PixmapPtr pixmap) return dixLookupPrivate(&pixmap->devPrivates, &xwl_pixmap_private_key); } @@ -320,7 +320,7 @@ index 2b6065f1a..ec1b7eee4 100644 static void xwl_window_init_allow_commits(struct xwl_window *xwl_window) { -@@ -569,6 +730,8 @@ ensure_surface_for_window(WindowPtr window) +@@ -582,6 +743,8 @@ ensure_surface_for_window(WindowPtr window) xwl_window->xwl_screen = xwl_screen; xwl_window->window = window; @@ -329,15 +329,15 @@ index 2b6065f1a..ec1b7eee4 100644 xwl_window->surface = wl_compositor_create_surface(xwl_screen->compositor); if (xwl_window->surface == NULL) { ErrorF("wl_display_create_surface failed\n"); -@@ -610,6 +773,7 @@ ensure_surface_for_window(WindowPtr window) +@@ -623,6 +786,7 @@ ensure_surface_for_window(WindowPtr window) dixSetPrivate(&window->devPrivates, &xwl_window_private_key, xwl_window); xorg_list_init(&xwl_window->link_damage); + xorg_list_add(&xwl_window->link_window, &xwl_screen->window_list); - xwl_window_init_allow_commits(xwl_window); - -@@ -704,8 +868,12 @@ xwl_unrealize_window(WindowPtr window) + #ifdef GLAMOR_HAS_GBM + xorg_list_init(&xwl_window->frame_callback_list); +@@ -716,8 +880,12 @@ xwl_unrealize_window(WindowPtr window) if (!xwl_window) return ret; @@ -350,7 +350,7 @@ index 2b6065f1a..ec1b7eee4 100644 unregister_damage(window); if (xwl_window->frame_callback) -@@ -743,6 +911,33 @@ xwl_set_window_pixmap(WindowPtr window, +@@ -760,6 +928,33 @@ xwl_set_window_pixmap(WindowPtr window, ensure_surface_for_window(window); } @@ -384,7 +384,7 @@ index 2b6065f1a..ec1b7eee4 100644 static void frame_callback(void *data, struct wl_callback *callback, -@@ -1158,6 +1353,7 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) +@@ -1211,6 +1406,7 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) xorg_list_init(&xwl_screen->output_list); xorg_list_init(&xwl_screen->seat_list); xorg_list_init(&xwl_screen->damage_window_list); @@ -392,7 +392,7 @@ index 2b6065f1a..ec1b7eee4 100644 xwl_screen->depth = 24; xwl_screen->display = wl_display_connect(NULL); -@@ -1256,6 +1452,9 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) +@@ -1309,6 +1505,9 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) xwl_screen->CloseScreen = pScreen->CloseScreen; pScreen->CloseScreen = xwl_close_screen; @@ -403,7 +403,7 @@ index 2b6065f1a..ec1b7eee4 100644 xwl_screen->SetWindowPixmap = pScreen->SetWindowPixmap; pScreen->SetWindowPixmap = xwl_set_window_pixmap; diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h -index d0e87a89d..b52de11d2 100644 +index 7e6497b80..56e753306 100644 --- a/hw/xwayland/xwayland.h +++ b/hw/xwayland/xwayland.h @@ -135,10 +135,12 @@ struct xwl_screen { @@ -433,7 +433,7 @@ index d0e87a89d..b52de11d2 100644 struct wl_callback *frame_callback; Bool allow_commits; #ifdef GLAMOR_HAS_GBM -@@ -408,6 +414,9 @@ Bool xwl_screen_init_cursor(struct xwl_screen *xwl_screen); +@@ -409,6 +415,9 @@ Bool xwl_screen_init_cursor(struct xwl_screen *xwl_screen); struct xwl_screen *xwl_screen_get(ScreenPtr screen); Bool xwl_screen_has_resolution_change_emulation(struct xwl_screen *xwl_screen); @@ -443,7 +443,7 @@ index d0e87a89d..b52de11d2 100644 void xwl_tablet_tool_set_cursor(struct xwl_tablet_tool *tool); void xwl_seat_set_cursor(struct xwl_seat *xwl_seat); -@@ -441,6 +450,12 @@ void xwl_output_remove(struct xwl_output *xwl_output); +@@ -442,6 +451,12 @@ void xwl_output_remove(struct xwl_output *xwl_output); struct xwl_emulated_mode *xwl_output_get_emulated_mode_for_client( struct xwl_output *xwl_output, ClientPtr client); @@ -457,5 +457,5 @@ index d0e87a89d..b52de11d2 100644 float VRefresh, Bool Reduced, Bool Interlaced); -- -2.23.0 +2.24.1 diff --git a/0009-glamor-Error-out-on-out-of-memory-when-allocating-PB.patch b/0009-glamor-Error-out-on-out-of-memory-when-allocating-PB.patch new file mode 100644 index 0000000..2ed84f9 --- /dev/null +++ b/0009-glamor-Error-out-on-out-of-memory-when-allocating-PB.patch @@ -0,0 +1,66 @@ +From a7b165d994d74131778a5a9bcffec957f1d1cacb Mon Sep 17 00:00:00 2001 +From: Paul Kocialkowski +Date: Mon, 10 Feb 2020 10:20:04 +0100 +Subject: [PATCH xserver 09/22] glamor: Error out on out-of-memory when + allocating PBO for FBO access + +Packed buffer allocation (which happens at glBufferData time with the +buffer bound) can fail when there is no GL memory left. + +Pick up the error when it happens, print a proper error message, do +some cleanup and bail. + +Signed-off-by: Paul Kocialkowski +(cherry picked from commit bc2e12239f86e5a4acd220744f42eb83ba55d328) +--- + glamor/glamor_prepare.c | 17 +++++++++++++++++ + glamor/glamor_priv.h | 1 + + 2 files changed, 18 insertions(+) + +diff --git a/glamor/glamor_prepare.c b/glamor/glamor_prepare.c +index 5a73e6c7d..6b35936fc 100644 +--- a/glamor/glamor_prepare.c ++++ b/glamor/glamor_prepare.c +@@ -88,10 +88,27 @@ glamor_prep_pixmap_box(PixmapPtr pixmap, glamor_access_t access, BoxPtr box) + + gl_usage = GL_STREAM_READ; + ++ glamor_priv->suppress_gl_out_of_memory_logging = true; ++ + glBindBuffer(GL_PIXEL_PACK_BUFFER, priv->pbo); + glBufferData(GL_PIXEL_PACK_BUFFER, + pixmap->devKind * pixmap->drawable.height, NULL, + gl_usage); ++ ++ glamor_priv->suppress_gl_out_of_memory_logging = false; ++ ++ if (glGetError() == GL_OUT_OF_MEMORY) { ++ if (!glamor_priv->logged_any_pbo_allocation_failure) { ++ LogMessageVerb(X_WARNING, 0, "glamor: Failed to allocate %d " ++ "bytes PBO due to GL_OUT_OF_MEMORY.\n", ++ pixmap->devKind * pixmap->drawable.height); ++ glamor_priv->logged_any_pbo_allocation_failure = true; ++ } ++ glBindBuffer(GL_PIXEL_PACK_BUFFER, 0); ++ glDeleteBuffers(1, &priv->pbo); ++ priv->pbo = 0; ++ return FALSE; ++ } + } else { + pixmap->devPrivate.ptr = xallocarray(pixmap->devKind, + pixmap->drawable.height); +diff --git a/glamor/glamor_priv.h b/glamor/glamor_priv.h +index 661c11d90..1686ef5a4 100644 +--- a/glamor/glamor_priv.h ++++ b/glamor/glamor_priv.h +@@ -289,6 +289,7 @@ typedef struct glamor_screen_private { + + Bool suppress_gl_out_of_memory_logging; + Bool logged_any_fbo_allocation_failure; ++ Bool logged_any_pbo_allocation_failure; + + /* xv */ + glamor_program xv_prog; +-- +2.24.1 + diff --git a/0009-xwayland-Add-xwlRRModeToDisplayMode-helper-function.patch b/0009-xwayland-Add-xwlRRModeToDisplayMode-helper-function.patch index 520eb90..9c17c41 100644 --- a/0009-xwayland-Add-xwlRRModeToDisplayMode-helper-function.patch +++ b/0009-xwayland-Add-xwlRRModeToDisplayMode-helper-function.patch @@ -1,7 +1,7 @@ -From 1ea054bda6618025838c3afb052080b749582454 Mon Sep 17 00:00:00 2001 +From 3367f9a40c56b48b4945d8529934ef0ac8c395f3 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 8 Jul 2019 14:00:27 +0200 -Subject: [PATCH xserver 09/14] xwayland: Add xwlRRModeToDisplayMode() helper +Subject: [PATCH xserver 09/17] xwayland: Add xwlRRModeToDisplayMode() helper function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -96,5 +96,5 @@ index 0bcd11401..a59c9f6a9 100644 return TRUE; } -- -2.23.0 +2.24.1 diff --git a/0010-glamor-Propagate-glamor_prepare_access-failures-in-c.patch b/0010-glamor-Propagate-glamor_prepare_access-failures-in-c.patch new file mode 100644 index 0000000..408abcb --- /dev/null +++ b/0010-glamor-Propagate-glamor_prepare_access-failures-in-c.patch @@ -0,0 +1,45 @@ +From ca034c2f2cfff8e49b816b8ecbaa96215b796e36 Mon Sep 17 00:00:00 2001 +From: Paul Kocialkowski +Date: Mon, 10 Feb 2020 10:20:30 +0100 +Subject: [PATCH xserver 10/22] glamor: Propagate glamor_prepare_access + failures in copy helpers + +glamor_prepare_access can fail for a few reasons, especially when +failing to allocate a PBO buffer. Take this in account and bail in +the copy helpers that call the helper when a failure happens. + +Signed-off-by: Paul Kocialkowski +(cherry picked from commit de6b3fac1f26075ce915006c914c4a4755617715) +--- + glamor/glamor_copy.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/glamor/glamor_copy.c b/glamor/glamor_copy.c +index e050c0220..1ab2be6c0 100644 +--- a/glamor/glamor_copy.c ++++ b/glamor/glamor_copy.c +@@ -221,7 +221,9 @@ glamor_copy_cpu_fbo(DrawablePtr src, + goto bail; + + glamor_make_current(glamor_priv); +- glamor_prepare_access(src, GLAMOR_ACCESS_RO); ++ ++ if (!glamor_prepare_access(src, GLAMOR_ACCESS_RO)) ++ goto bail; + + glamor_get_drawable_deltas(dst, dst_pixmap, &dst_xoff, &dst_yoff); + +@@ -309,7 +311,9 @@ glamor_copy_fbo_cpu(DrawablePtr src, + goto bail; + + glamor_make_current(glamor_priv); +- glamor_prepare_access(dst, GLAMOR_ACCESS_RW); ++ ++ if (!glamor_prepare_access(dst, GLAMOR_ACCESS_RW)) ++ goto bail; + + glamor_get_drawable_deltas(src, src_pixmap, &src_xoff, &src_yoff); + +-- +2.24.1 + diff --git a/0010-xwayland-Add-xwlVidModeGetCurrentRRMode-helper-to-th.patch b/0010-xwayland-Add-xwlVidModeGetCurrentRRMode-helper-to-th.patch index c9ef93d..38d754a 100644 --- a/0010-xwayland-Add-xwlVidModeGetCurrentRRMode-helper-to-th.patch +++ b/0010-xwayland-Add-xwlVidModeGetCurrentRRMode-helper-to-th.patch @@ -1,7 +1,7 @@ -From 9edd8e37b5e2659a71b05dabed45fd7c3447de79 Mon Sep 17 00:00:00 2001 +From 9da07f246b50292d24347608d5bba92efd1756af Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 8 Jul 2019 18:35:27 +0200 -Subject: [PATCH xserver 10/14] xwayland: Add xwlVidModeGetCurrentRRMode helper +Subject: [PATCH xserver 10/17] xwayland: Add xwlVidModeGetCurrentRRMode helper to the vidmode code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -188,5 +188,5 @@ index a59c9f6a9..e9aea7269 100644 static void -- -2.23.0 +2.24.1 diff --git a/0011-glamor-Fallback-to-system-memory-for-RW-PBO-buffer-a.patch b/0011-glamor-Fallback-to-system-memory-for-RW-PBO-buffer-a.patch new file mode 100644 index 0000000..d147e92 --- /dev/null +++ b/0011-glamor-Fallback-to-system-memory-for-RW-PBO-buffer-a.patch @@ -0,0 +1,67 @@ +From d2a6c8708ca4f27c8d9aade6db2c4e7f2d8c624f Mon Sep 17 00:00:00 2001 +From: Paul Kocialkowski +Date: Mon, 10 Feb 2020 10:21:02 +0100 +Subject: [PATCH xserver 11/22] glamor: Fallback to system memory for RW PBO + buffer allocation + +We currently support two modes of operation for RW PBO buffers: one +that allocates a pack buffer with GL memory and one that uses system +memory when the former is not supported. + +Since allocation with system memory is less likely to fail, add a +fallback to system memory when GL memory failed instead of bailing +out. + +Signed-off-by: Paul Kocialkowski +(cherry picked from commit 8c4e8d9eff03cefc987f13c900b0a47403946127) +--- + glamor/glamor_prepare.c | 11 ++++++----- + 1 file changed, 6 insertions(+), 5 deletions(-) + +diff --git a/glamor/glamor_prepare.c b/glamor/glamor_prepare.c +index 6b35936fc..c1a611f9a 100644 +--- a/glamor/glamor_prepare.c ++++ b/glamor/glamor_prepare.c +@@ -107,9 +107,10 @@ glamor_prep_pixmap_box(PixmapPtr pixmap, glamor_access_t access, BoxPtr box) + glBindBuffer(GL_PIXEL_PACK_BUFFER, 0); + glDeleteBuffers(1, &priv->pbo); + priv->pbo = 0; +- return FALSE; + } +- } else { ++ } ++ ++ if (!priv->pbo) { + pixmap->devPrivate.ptr = xallocarray(pixmap->devKind, + pixmap->drawable.height); + if (!pixmap->devPrivate.ptr) +@@ -123,7 +124,7 @@ glamor_prep_pixmap_box(PixmapPtr pixmap, glamor_access_t access, BoxPtr box) + + RegionUninit(®ion); + +- if (glamor_priv->has_rw_pbo) { ++ if (priv->pbo) { + if (priv->map_access == GLAMOR_ACCESS_RW) + gl_access = GL_READ_WRITE; + else +@@ -155,7 +156,7 @@ glamor_fini_pixmap(PixmapPtr pixmap) + if (!priv->prepared) + return; + +- if (glamor_priv->has_rw_pbo) { ++ if (priv->pbo) { + glBindBuffer(GL_PIXEL_UNPACK_BUFFER, priv->pbo); + glUnmapBuffer(GL_PIXEL_UNPACK_BUFFER); + pixmap->devPrivate.ptr = NULL; +@@ -170,7 +171,7 @@ glamor_fini_pixmap(PixmapPtr pixmap) + + RegionUninit(&priv->prepare_region); + +- if (glamor_priv->has_rw_pbo) { ++ if (priv->pbo) { + glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0); + glDeleteBuffers(1, &priv->pbo); + priv->pbo = 0; +-- +2.24.1 + diff --git a/0011-xwayland-Add-vidmode-mode-changing-emulation-support.patch b/0011-xwayland-Add-vidmode-mode-changing-emulation-support.patch index 99ebbae..28f1ba8 100644 --- a/0011-xwayland-Add-vidmode-mode-changing-emulation-support.patch +++ b/0011-xwayland-Add-vidmode-mode-changing-emulation-support.patch @@ -1,7 +1,7 @@ -From 984691516d78284a8ab63058b0c1d3c68666a7d9 Mon Sep 17 00:00:00 2001 +From 9b119998db0d5e28e912d82de5b04674200f341b Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Tue, 9 Jul 2019 09:31:13 +0200 -Subject: [PATCH xserver 11/14] xwayland: Add vidmode mode changing emulation +Subject: [PATCH xserver 11/17] xwayland: Add vidmode mode changing emulation support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -231,5 +231,5 @@ index e9aea7269..56aac693a 100644 static Bool -- -2.23.0 +2.24.1 diff --git a/0012-glamor-Fix-a-compiler-warning-since-the-recent-OOM-f.patch b/0012-glamor-Fix-a-compiler-warning-since-the-recent-OOM-f.patch new file mode 100644 index 0000000..a454532 --- /dev/null +++ b/0012-glamor-Fix-a-compiler-warning-since-the-recent-OOM-f.patch @@ -0,0 +1,28 @@ +From d44bbb4710961651dcf10701bc562f1f01509010 Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Mon, 10 Feb 2020 10:22:34 +0100 +Subject: [PATCH xserver 12/22] glamor: Fix a compiler warning since the recent + OOM fixes. + +Signed-off-by: Eric Anholt +(cherry picked from commit 3b26b90cb787a14fa5f8bb2033eab8ab6562a9a5) +--- + glamor/glamor_prepare.c | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/glamor/glamor_prepare.c b/glamor/glamor_prepare.c +index c1a611f9a..835c4ebea 100644 +--- a/glamor/glamor_prepare.c ++++ b/glamor/glamor_prepare.c +@@ -146,8 +146,6 @@ glamor_prep_pixmap_box(PixmapPtr pixmap, glamor_access_t access, BoxPtr box) + static void + glamor_fini_pixmap(PixmapPtr pixmap) + { +- ScreenPtr screen = pixmap->drawable.pScreen; +- glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); + glamor_pixmap_private *priv = glamor_get_pixmap_private(pixmap); + + if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(priv)) +-- +2.24.1 + diff --git a/0012-xwayland-xwl_window_should_enable_viewport-Add-extra.patch b/0012-xwayland-xwl_window_should_enable_viewport-Add-extra.patch index 4ec587b..2b63f06 100644 --- a/0012-xwayland-xwl_window_should_enable_viewport-Add-extra.patch +++ b/0012-xwayland-xwl_window_should_enable_viewport-Add-extra.patch @@ -1,7 +1,7 @@ -From 912688326c0f9435660e86a2bdab049caa4b0e9f Mon Sep 17 00:00:00 2001 +From fc9ccf1bd1dc3dadbde022bf7f353dfae93d089e Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 26 Aug 2019 12:26:34 +0200 -Subject: [PATCH xserver 12/14] xwayland: xwl_window_should_enable_viewport: +Subject: [PATCH xserver 12/17] xwayland: xwl_window_should_enable_viewport: Add extra test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -24,10 +24,10 @@ Signed-off-by: Hans de Goede 1 file changed, 17 insertions(+) diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index ec1b7eee4..58252d2e8 100644 +index 1466e1e11..19a348255 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c -@@ -636,6 +636,23 @@ xwl_window_should_enable_viewport(struct xwl_window *xwl_window, +@@ -649,6 +649,23 @@ xwl_window_should_enable_viewport(struct xwl_window *xwl_window, } } @@ -52,5 +52,5 @@ index ec1b7eee4..58252d2e8 100644 } -- -2.23.0 +2.24.1 diff --git a/0013-modesetting-Disable-atomic-support-by-default.patch b/0013-modesetting-Disable-atomic-support-by-default.patch new file mode 100644 index 0000000..a3ba60a --- /dev/null +++ b/0013-modesetting-Disable-atomic-support-by-default.patch @@ -0,0 +1,69 @@ +From 1ba5e528d52ed9d7d67eb45c5d3e04b6f5d22b05 Mon Sep 17 00:00:00 2001 +From: Maarten Lankhorst +Date: Thu, 25 Apr 2019 11:46:41 +0200 +Subject: [PATCH xserver 13/22] modesetting: Disable atomic support by default + +The atomic driver has issues with modesetting when stealing +connectors from a different crtc, a black screen when doing rotation +on a different crtc, and in general is just a mapping of the legacy +helpers to atomic. This is already done in the kernel, so just +fallback to legacy by default until this is fixed. + +Please backport to 1.20, as we don't want to enable it for everyone +there. It breaks for existing users. + +The fixes to make the xserver more atomic have been pending on the +mailing list for ages. + +Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=110375 +Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=110030 +References: https://gitlab.freedesktop.org/xorg/xserver/merge_requests/36/commits +Signed-off-by: Maarten Lankhorst +(cherry picked from commit f0d78b47ac49977a6007f5fe081f00c6eb19a12e) +--- + hw/xfree86/drivers/modesetting/driver.c | 9 +++++++-- + hw/xfree86/drivers/modesetting/driver.h | 1 + + 2 files changed, 8 insertions(+), 2 deletions(-) + +diff --git a/hw/xfree86/drivers/modesetting/driver.c b/hw/xfree86/drivers/modesetting/driver.c +index 9beb51f36..0612a08f6 100644 +--- a/hw/xfree86/drivers/modesetting/driver.c ++++ b/hw/xfree86/drivers/modesetting/driver.c +@@ -131,6 +131,7 @@ static const OptionInfoRec Options[] = { + {OPTION_PAGEFLIP, "PageFlip", OPTV_BOOLEAN, {0}, FALSE}, + {OPTION_ZAPHOD_HEADS, "ZaphodHeads", OPTV_STRING, {0}, FALSE}, + {OPTION_DOUBLE_SHADOW, "DoubleShadow", OPTV_BOOLEAN, {0}, FALSE}, ++ {OPTION_ATOMIC, "Atomic", OPTV_BOOLEAN, {0}, FALSE}, + {-1, NULL, OPTV_NONE, {0}, FALSE} + }; + +@@ -1038,8 +1039,12 @@ PreInit(ScrnInfoPtr pScrn, int flags) + #endif + } + +- ret = drmSetClientCap(ms->fd, DRM_CLIENT_CAP_ATOMIC, 1); +- ms->atomic_modeset = (ret == 0); ++ if (xf86ReturnOptValBool(ms->drmmode.Options, OPTION_ATOMIC, FALSE)) { ++ ret = drmSetClientCap(ms->fd, DRM_CLIENT_CAP_ATOMIC, 1); ++ ms->atomic_modeset = (ret == 0); ++ } else { ++ ms->atomic_modeset = FALSE; ++ } + + ms->kms_has_modifiers = FALSE; + ret = drmGetCap(ms->fd, DRM_CAP_ADDFB2_MODIFIERS, &value); +diff --git a/hw/xfree86/drivers/modesetting/driver.h b/hw/xfree86/drivers/modesetting/driver.h +index 493280c1d..8bfb2fc1a 100644 +--- a/hw/xfree86/drivers/modesetting/driver.h ++++ b/hw/xfree86/drivers/modesetting/driver.h +@@ -51,6 +51,7 @@ typedef enum { + OPTION_PAGEFLIP, + OPTION_ZAPHOD_HEADS, + OPTION_DOUBLE_SHADOW, ++ OPTION_ATOMIC, + } modesettingOpts; + + typedef struct +-- +2.24.1 + diff --git a/0013-xwayland-Set-_XWAYLAND_RANDR_EMU_MONITOR_RECTS-prope.patch b/0013-xwayland-Set-_XWAYLAND_RANDR_EMU_MONITOR_RECTS-prope.patch index 500d1f5..c70f2d5 100644 --- a/0013-xwayland-Set-_XWAYLAND_RANDR_EMU_MONITOR_RECTS-prope.patch +++ b/0013-xwayland-Set-_XWAYLAND_RANDR_EMU_MONITOR_RECTS-prope.patch @@ -1,7 +1,7 @@ -From d9f1d6f51f4c2d388214a675330b58ba2facb170 Mon Sep 17 00:00:00 2001 +From 2fd8751593ed1268e859a9a19f0eea3820ce5f69 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 2 Sep 2019 17:32:45 +0200 -Subject: [PATCH xserver 13/14] xwayland: Set _XWAYLAND_RANDR_EMU_MONITOR_RECTS +Subject: [PATCH xserver 13/17] xwayland: Set _XWAYLAND_RANDR_EMU_MONITOR_RECTS property for resolution emulation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -138,10 +138,10 @@ index 99ab1b288..20c254962 100644 static void diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index 58252d2e8..75ff9f011 100644 +index 19a348255..1840ccbfb 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c -@@ -677,6 +677,27 @@ xwl_screen_check_resolution_change_emulation(struct xwl_screen *xwl_screen) +@@ -690,6 +690,27 @@ xwl_screen_check_resolution_change_emulation(struct xwl_screen *xwl_screen) xwl_window_check_resolution_change_emulation(xwl_window); } @@ -169,7 +169,7 @@ index 58252d2e8..75ff9f011 100644 static void xwl_window_init_allow_commits(struct xwl_window *xwl_window) { -@@ -838,6 +859,8 @@ xwl_realize_window(WindowPtr window) +@@ -855,6 +876,8 @@ xwl_realize_window(WindowPtr window) return FALSE; } @@ -179,10 +179,10 @@ index 58252d2e8..75ff9f011 100644 } diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h -index b52de11d2..2d825ee8c 100644 +index 56e753306..ef1138348 100644 --- a/hw/xwayland/xwayland.h +++ b/hw/xwayland/xwayland.h -@@ -417,6 +417,7 @@ Bool xwl_screen_has_resolution_change_emulation(struct xwl_screen *xwl_screen); +@@ -418,6 +418,7 @@ Bool xwl_screen_has_resolution_change_emulation(struct xwl_screen *xwl_screen); struct xwl_output *xwl_screen_get_first_output(struct xwl_screen *xwl_screen); void xwl_screen_check_resolution_change_emulation(struct xwl_screen *xwl_screen); Bool xwl_window_has_viewport_enabled(struct xwl_window *xwl_window); @@ -190,7 +190,7 @@ index b52de11d2..2d825ee8c 100644 void xwl_tablet_tool_set_cursor(struct xwl_tablet_tool *tool); void xwl_seat_set_cursor(struct xwl_seat *xwl_seat); -@@ -455,6 +456,8 @@ RRModePtr xwl_output_find_mode(struct xwl_output *xwl_output, +@@ -456,6 +457,8 @@ RRModePtr xwl_output_find_mode(struct xwl_output *xwl_output, void xwl_output_set_emulated_mode(struct xwl_output *xwl_output, ClientPtr client, RRModePtr mode, Bool from_vidmode); @@ -200,5 +200,5 @@ index b52de11d2..2d825ee8c 100644 RRModePtr xwayland_cvt(int HDisplay, int VDisplay, float VRefresh, Bool Reduced, Bool Interlaced); -- -2.23.0 +2.24.1 diff --git a/0014-xwayland-Fix-emulated-modes-not-being-removed-when-s.patch b/0014-xwayland-Fix-emulated-modes-not-being-removed-when-s.patch index 5d04e5d..5c0134c 100644 --- a/0014-xwayland-Fix-emulated-modes-not-being-removed-when-s.patch +++ b/0014-xwayland-Fix-emulated-modes-not-being-removed-when-s.patch @@ -1,7 +1,7 @@ -From c392765d459bd2cac6e3f431c67d698bb905e0ab Mon Sep 17 00:00:00 2001 +From a5b9f4880ab61dc0c02065e6fdf5e2f16f36be7c Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 7 Oct 2019 14:27:49 +0200 -Subject: [PATCH xserver 14/14] xwayland: Fix emulated modes not being removed +Subject: [PATCH xserver 14/17] xwayland: Fix emulated modes not being removed when screen rotation is used The code building the mode-list does the following to deal with screen @@ -57,5 +57,5 @@ index 20c254962..7d705d919 100644 else xwl_output_add_emulated_mode_for_client(xwl_output, client, mode, from_vidmode); -- -2.23.0 +2.24.1 diff --git a/0014-xwayland-Split-up-xwl_screen_post_damage-into-two-ph.patch b/0014-xwayland-Split-up-xwl_screen_post_damage-into-two-ph.patch new file mode 100644 index 0000000..3c7eb02 --- /dev/null +++ b/0014-xwayland-Split-up-xwl_screen_post_damage-into-two-ph.patch @@ -0,0 +1,64 @@ +From a93bce6bfc6c610676a7fbc76639854c5553cb2c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michel=20D=C3=A4nzer?= +Date: Fri, 7 Feb 2020 12:06:39 +0100 +Subject: [PATCH xserver 14/22] xwayland: Split up xwl_screen_post_damage into + two phases + +The first phase sets the new surface properties for all damaged +windows, then the second phase commits all surface updates. + +This is preparatory for the next change, there should be no observable +change in behaviour (other than the order of Wayland protocol +requests). + +Reviewed-by: Adam Jackson +(cherry picked from commit f88d9b1f779835302e02e255fcd45989db7f488d) +--- + hw/xwayland/xwayland.c | 17 ++++++++++++++--- + 1 file changed, 14 insertions(+), 3 deletions(-) + +diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c +index 324c68ccf..de35a5af0 100644 +--- a/hw/xwayland/xwayland.c ++++ b/hw/xwayland/xwayland.c +@@ -816,16 +816,16 @@ xwl_window_post_damage(struct xwl_window *xwl_window) + xwl_window->frame_callback = wl_surface_frame(xwl_window->surface); + wl_callback_add_listener(xwl_window->frame_callback, &frame_listener, xwl_window); + +- wl_surface_commit(xwl_window->surface); + DamageEmpty(window_get_damage(xwl_window->window)); +- +- xorg_list_del(&xwl_window->link_damage); + } + + static void + xwl_screen_post_damage(struct xwl_screen *xwl_screen) + { + struct xwl_window *xwl_window, *next_xwl_window; ++ struct xorg_list commit_window_list; ++ ++ xorg_list_init(&commit_window_list); + + xorg_list_for_each_entry_safe(xwl_window, next_xwl_window, + &xwl_screen->damage_window_list, link_damage) { +@@ -843,6 +843,17 @@ xwl_screen_post_damage(struct xwl_screen *xwl_screen) + #endif + + xwl_window_post_damage(xwl_window); ++ xorg_list_del(&xwl_window->link_damage); ++ xorg_list_append(&xwl_window->link_damage, &commit_window_list); ++ } ++ ++ if (xorg_list_is_empty(&commit_window_list)) ++ return; ++ ++ xorg_list_for_each_entry_safe(xwl_window, next_xwl_window, ++ &commit_window_list, link_damage) { ++ wl_surface_commit(xwl_window->surface); ++ xorg_list_del(&xwl_window->link_damage); + } + } + +-- +2.24.1 + diff --git a/0015-xwayland-Call-glamor_block_handler-from-xwl_screen_p.patch b/0015-xwayland-Call-glamor_block_handler-from-xwl_screen_p.patch new file mode 100644 index 0000000..7224985 --- /dev/null +++ b/0015-xwayland-Call-glamor_block_handler-from-xwl_screen_p.patch @@ -0,0 +1,46 @@ +From 0238359bced17f9db0e266111897d154ab117d68 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michel=20D=C3=A4nzer?= +Date: Fri, 7 Feb 2020 12:15:07 +0100 +Subject: [PATCH xserver 15/22] xwayland: Call glamor_block_handler from + xwl_screen_post_damage + +In between the two phases introduced by the previous change. This makes +sure all pending drawing to the new buffers is flushed before they're +committed to the Wayland server. +(cherry picked from commit a542224ea28e2e8ccaf5e0df85bf6c603e97599a) +--- + hw/xwayland/xwayland.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c +index de35a5af0..d3a4684d2 100644 +--- a/hw/xwayland/xwayland.c ++++ b/hw/xwayland/xwayland.c +@@ -43,6 +43,10 @@ + _X_EXPORT Bool noXFree86VidModeExtension; + #endif + ++#ifdef XWL_HAS_GLAMOR ++#include ++#endif ++ + void + ddxGiveUp(enum ExitCode error) + { +@@ -850,6 +854,13 @@ xwl_screen_post_damage(struct xwl_screen *xwl_screen) + if (xorg_list_is_empty(&commit_window_list)) + return; + ++#ifdef XWL_HAS_GLAMOR ++ if (xwl_screen->glamor && ++ xwl_screen->egl_backend == &xwl_screen->gbm_backend) { ++ glamor_block_handler(xwl_screen->screen); ++ } ++#endif ++ + xorg_list_for_each_entry_safe(xwl_window, next_xwl_window, + &commit_window_list, link_damage) { + wl_surface_commit(xwl_window->surface); +-- +2.24.1 + diff --git a/0015-xwayland-Call-xwl_window_check_resolution_change_emu.patch b/0015-xwayland-Call-xwl_window_check_resolution_change_emu.patch index 57ff541..447fa28 100644 --- a/0015-xwayland-Call-xwl_window_check_resolution_change_emu.patch +++ b/0015-xwayland-Call-xwl_window_check_resolution_change_emu.patch @@ -1,4 +1,4 @@ -From 01629caef21b77cfabc052408eb04699e4fa5143 Mon Sep 17 00:00:00 2001 +From c0bae670131d7eef3d0a4d015a14899cbd4c9b2d Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 4 Nov 2019 11:46:49 +0100 Subject: [PATCH xserver 15/17] xwayland: Call @@ -26,10 +26,10 @@ Signed-off-by: Hans de Goede 1 file changed, 5 insertions(+) diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index 75ff9f011..ed1d671ff 100644 +index 1840ccbfb..181977033 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c -@@ -815,6 +815,11 @@ ensure_surface_for_window(WindowPtr window) +@@ -832,6 +832,11 @@ ensure_surface_for_window(WindowPtr window) xwl_window_init_allow_commits(xwl_window); @@ -42,5 +42,5 @@ index 75ff9f011..ed1d671ff 100644 err_surf: -- -2.23.0 +2.24.1 diff --git a/0016-xwayland-Fix-setting-of-_XWAYLAND_RANDR_EMU_MONITOR_.patch b/0016-xwayland-Fix-setting-of-_XWAYLAND_RANDR_EMU_MONITOR_.patch index fd47895..27a6a0a 100644 --- a/0016-xwayland-Fix-setting-of-_XWAYLAND_RANDR_EMU_MONITOR_.patch +++ b/0016-xwayland-Fix-setting-of-_XWAYLAND_RANDR_EMU_MONITOR_.patch @@ -1,4 +1,4 @@ -From 2db2fcb97bd148476817634486cb384a1f623fa9 Mon Sep 17 00:00:00 2001 +From 8a34f7eb226be8d8ae0d9920657c17848372c92e Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 4 Nov 2019 14:32:29 +0100 Subject: [PATCH xserver 16/17] xwayland: Fix setting of @@ -33,10 +33,10 @@ Signed-off-by: Hans de Goede 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index ed1d671ff..1ce29c51c 100644 +index 181977033..d8e65d59f 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c -@@ -815,7 +815,13 @@ ensure_surface_for_window(WindowPtr window) +@@ -832,7 +832,13 @@ ensure_surface_for_window(WindowPtr window) xwl_window_init_allow_commits(xwl_window); @@ -51,7 +51,7 @@ index ed1d671ff..1ce29c51c 100644 /* CSD or O-R toplevel window, check viewport on creation */ xwl_window_check_resolution_change_emulation(xwl_window); } -@@ -864,8 +870,6 @@ xwl_realize_window(WindowPtr window) +@@ -881,8 +887,6 @@ xwl_realize_window(WindowPtr window) return FALSE; } @@ -61,5 +61,5 @@ index ed1d671ff..1ce29c51c 100644 } -- -2.23.0 +2.24.1 diff --git a/0016-xwayland-clear-pixmaps-after-creation-in-rootless-mo.patch b/0016-xwayland-clear-pixmaps-after-creation-in-rootless-mo.patch new file mode 100644 index 0000000..a6e75f9 --- /dev/null +++ b/0016-xwayland-clear-pixmaps-after-creation-in-rootless-mo.patch @@ -0,0 +1,137 @@ +From 94dad4f05133171805ee94095bbcd20ece754eba Mon Sep 17 00:00:00 2001 +From: Dor Askayo +Date: Wed, 19 Feb 2020 17:22:11 +0100 +Subject: [PATCH xserver 16/22] xwayland: clear pixmaps after creation in + rootless mode +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +When a pixmap is created with a backing FBO, the FBO should be cleared +to avoid rendering uninitialized memory. This could happen when the +pixmap is rendered without being filled in its entirety. + +One example is when a top-level window without a background is +resized. The pixmap would be reallocated to prepare for more pixels, +but uninitialized memory would be rendered in the resize offset until +the client sends a frame that fills these additional pixels. + +Another example is when a new top-level window is created without a +background. Uninitialized memory would be rendered after the pixmap is +allocated and before the client sends its first frame. + +This issue is only apparent in OpenGL implementations that don't zero +the VRAM of allocated buffers by default, such as RadeonSI. + +Signed-off-by: Dor Askayo +Closes: https://gitlab.freedesktop.org/xorg/xserver/issues/636 +Reviewed-by: Michel Dänzer +(cherry picked from commit 0e9a0c203c2ae4eae12bdbb95428f398211c7bee) + +[ Michel Dänzer: +* Squashed in commit ebf549db2d9341d99e0d0847b948dd798d98f7dc +* Dropped code related to glamor_format, which only exists on master ] +--- + glamor/glamor.c | 15 +++++++++++++++ + glamor/glamor.h | 3 +++ + glamor/glamor_fbo.c | 12 ++++++++++++ + glamor/glamor_priv.h | 1 + + hw/xwayland/xwayland-glamor-gbm.c | 6 +++++- + 5 files changed, 36 insertions(+), 1 deletion(-) + +diff --git a/glamor/glamor.c b/glamor/glamor.c +index a6cc798f8..abefef614 100644 +--- a/glamor/glamor.c ++++ b/glamor/glamor.c +@@ -128,6 +128,21 @@ glamor_set_pixmap_texture(PixmapPtr pixmap, unsigned int tex) + glamor_pixmap_attach_fbo(pixmap, fbo); + } + ++_X_EXPORT void ++glamor_clear_pixmap(PixmapPtr pixmap) ++{ ++ ScreenPtr screen = pixmap->drawable.pScreen; ++ glamor_screen_private *glamor_priv; ++ glamor_pixmap_private *pixmap_priv; ++ ++ glamor_priv = glamor_get_screen_private(screen); ++ pixmap_priv = glamor_get_pixmap_private(pixmap); ++ ++ assert(pixmap_priv->fbo != NULL); ++ ++ glamor_pixmap_clear_fbo(glamor_priv, pixmap_priv->fbo); ++} ++ + uint32_t + glamor_get_pixmap_texture(PixmapPtr pixmap) + { +diff --git a/glamor/glamor.h b/glamor/glamor.h +index 3f9d265db..be04bf858 100644 +--- a/glamor/glamor.h ++++ b/glamor/glamor.h +@@ -115,6 +115,9 @@ extern _X_EXPORT void glamor_set_pixmap_texture(PixmapPtr pixmap, + + extern _X_EXPORT void glamor_set_pixmap_type(PixmapPtr pixmap, + glamor_pixmap_type_t type); ++ ++extern _X_EXPORT void glamor_clear_pixmap(PixmapPtr pixmap); ++ + extern _X_EXPORT void glamor_block_handler(ScreenPtr screen); + + extern _X_EXPORT PixmapPtr glamor_create_pixmap(ScreenPtr screen, int w, int h, +diff --git a/glamor/glamor_fbo.c b/glamor/glamor_fbo.c +index e8c4330b3..f939a6c2f 100644 +--- a/glamor/glamor_fbo.c ++++ b/glamor/glamor_fbo.c +@@ -239,6 +239,18 @@ glamor_create_fbo_array(glamor_screen_private *glamor_priv, + return NULL; + } + ++void ++glamor_pixmap_clear_fbo(glamor_screen_private *glamor_priv, glamor_pixmap_fbo *fbo) ++{ ++ glamor_make_current(glamor_priv); ++ ++ assert(fbo->fb != 0 && fbo->tex != 0); ++ ++ glamor_set_destination_pixmap_fbo(glamor_priv, fbo, 0, 0, fbo->width, fbo->height); ++ glClearColor(0.0, 0.0, 0.0, 0.0); ++ glClear(GL_COLOR_BUFFER_BIT); ++} ++ + glamor_pixmap_fbo * + glamor_pixmap_detach_fbo(glamor_pixmap_private *pixmap_priv) + { +diff --git a/glamor/glamor_priv.h b/glamor/glamor_priv.h +index 1686ef5a4..4353a99f1 100644 +--- a/glamor/glamor_priv.h ++++ b/glamor/glamor_priv.h +@@ -539,6 +539,7 @@ void glamor_destroy_fbo(glamor_screen_private *glamor_priv, + glamor_pixmap_fbo *fbo); + void glamor_pixmap_destroy_fbo(PixmapPtr pixmap); + Bool glamor_pixmap_fbo_fixup(ScreenPtr screen, PixmapPtr pixmap); ++void glamor_pixmap_clear_fbo(glamor_screen_private *glamor_priv, glamor_pixmap_fbo *fbo); + + /* Return whether 'picture' is alpha-only */ + static inline Bool glamor_picture_is_alpha(PicturePtr picture) +diff --git a/hw/xwayland/xwayland-glamor-gbm.c b/hw/xwayland/xwayland-glamor-gbm.c +index febc0b910..c02ba7363 100644 +--- a/hw/xwayland/xwayland-glamor-gbm.c ++++ b/hw/xwayland/xwayland-glamor-gbm.c +@@ -242,8 +242,12 @@ xwl_glamor_gbm_create_pixmap(ScreenPtr screen, + if (bo) { + pixmap = xwl_glamor_gbm_create_pixmap_for_bo(screen, bo, depth); + +- if (!pixmap) ++ if (!pixmap) { + gbm_bo_destroy(bo); ++ } ++ else if (xwl_screen->rootless && hint == CREATE_PIXMAP_USAGE_BACKING_PIXMAP) { ++ glamor_clear_pixmap(pixmap); ++ } + } + } + +-- +2.24.1 + diff --git a/0017-xwayland-Add-xwl_window_create_frame_callback-helper.patch b/0017-xwayland-Add-xwl_window_create_frame_callback-helper.patch new file mode 100644 index 0000000..3012c84 --- /dev/null +++ b/0017-xwayland-Add-xwl_window_create_frame_callback-helper.patch @@ -0,0 +1,62 @@ +From 915cc107767624bd7914c962347bab9c2e21cdff Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michel=20D=C3=A4nzer?= +Date: Fri, 13 Dec 2019 18:26:35 +0100 +Subject: [PATCH xserver 17/22] xwayland: Add xwl_window_create_frame_callback + helper + +This will be used by the following changes. No functional change +intended. + +Reviewed-by: Olivier Fourdan +(cherry picked from commit f80eea0529b2cfb805a9c7d4994a4235451131e3) +--- + hw/xwayland/xwayland.c | 12 +++++++++--- + hw/xwayland/xwayland.h | 2 ++ + 2 files changed, 11 insertions(+), 3 deletions(-) + +diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c +index d3a4684d2..ef01842f0 100644 +--- a/hw/xwayland/xwayland.c ++++ b/hw/xwayland/xwayland.c +@@ -747,6 +747,14 @@ static const struct wl_callback_listener frame_listener = { + frame_callback + }; + ++void ++xwl_window_create_frame_callback(struct xwl_window *xwl_window) ++{ ++ xwl_window->frame_callback = wl_surface_frame(xwl_window->surface); ++ wl_callback_add_listener(xwl_window->frame_callback, &frame_listener, ++ xwl_window); ++} ++ + static Bool + xwl_destroy_window(WindowPtr window) + { +@@ -817,9 +825,7 @@ xwl_window_post_damage(struct xwl_window *xwl_window) + box->x2 - box->x1, box->y2 - box->y1); + } + +- xwl_window->frame_callback = wl_surface_frame(xwl_window->surface); +- wl_callback_add_listener(xwl_window->frame_callback, &frame_listener, xwl_window); +- ++ xwl_window_create_frame_callback(xwl_window); + DamageEmpty(window_get_damage(xwl_window->window)); + } + +diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h +index 0854df456..d20016c5d 100644 +--- a/hw/xwayland/xwayland.h ++++ b/hw/xwayland/xwayland.h +@@ -378,6 +378,8 @@ struct xwl_output { + Bool xdg_output_done; + }; + ++void xwl_window_create_frame_callback(struct xwl_window *xwl_window); ++ + void xwl_sync_events (struct xwl_screen *xwl_screen); + + Bool xwl_screen_init_cursor(struct xwl_screen *xwl_screen); +-- +2.24.1 + diff --git a/0017-xwayland-Remove-unnecessary-xwl_window_is_toplevel-c.patch b/0017-xwayland-Remove-unnecessary-xwl_window_is_toplevel-c.patch index db3b4d9..d745e1d 100644 --- a/0017-xwayland-Remove-unnecessary-xwl_window_is_toplevel-c.patch +++ b/0017-xwayland-Remove-unnecessary-xwl_window_is_toplevel-c.patch @@ -1,4 +1,4 @@ -From f73305cc415d2fd464aae4b0dc72558fd1b6bd81 Mon Sep 17 00:00:00 2001 +From 28610d4f35d8bc30f30f33656777649ea355f3c2 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 4 Nov 2019 15:01:18 +0100 Subject: [PATCH xserver 17/17] xwayland: Remove unnecessary @@ -43,5 +43,5 @@ index 7d705d919..084b669e4 100644 static void -- -2.23.0 +2.24.1 diff --git a/0018-xwayland-Use-single-frame-callback-for-Present-flips.patch b/0018-xwayland-Use-single-frame-callback-for-Present-flips.patch new file mode 100644 index 0000000..c1bc672 --- /dev/null +++ b/0018-xwayland-Use-single-frame-callback-for-Present-flips.patch @@ -0,0 +1,212 @@ +From 99a6d6b15e0757a4652a569a1b2070c76a00b567 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michel=20D=C3=A4nzer?= +Date: Wed, 27 Nov 2019 18:04:06 +0100 +Subject: [PATCH xserver 18/22] xwayland: Use single frame callback for Present + flips and normal updates + +Using a list of Present windows that need to be called back. + +This prepares for the following change, there should be no change in +observed behaviour. + +v2: +* Use xwl_window_create_frame_callback instead of making the + frame_listener struct non-static (Olivier Fourdan) + +Reviewed-by: Olivier Fourdan +(cherry picked from commit c5067feaeea115761f0a72f37407c6e5e943d1a1) +--- + hw/xwayland/xwayland-present.c | 40 +++++++++++++--------------------- + hw/xwayland/xwayland.c | 26 +++++++++++++++++----- + hw/xwayland/xwayland.h | 4 +++- + 3 files changed, 39 insertions(+), 31 deletions(-) + +diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c +index 31c276623..baa97d6f3 100644 +--- a/hw/xwayland/xwayland-present.c ++++ b/hw/xwayland/xwayland-present.c +@@ -60,6 +60,7 @@ xwl_present_window_get_priv(WindowPtr window) + xwl_present_window->msc = 1; + xwl_present_window->ust = GetTimeInMicros(); + ++ xorg_list_init(&xwl_present_window->frame_callback_list); + xorg_list_init(&xwl_present_window->event_list); + xorg_list_init(&xwl_present_window->release_queue); + +@@ -96,7 +97,7 @@ xwl_present_reset_timer(struct xwl_present_window *xwl_present_window) + if (xwl_present_has_events(xwl_present_window)) { + CARD32 timeout; + +- if (xwl_present_window->frame_callback) ++ if (!xorg_list_is_empty(&xwl_present_window->frame_callback_list)) + timeout = TIMER_LEN_FLIP; + else + timeout = TIMER_LEN_COPY; +@@ -119,10 +120,7 @@ xwl_present_cleanup(WindowPtr window) + if (!xwl_present_window) + return; + +- if (xwl_present_window->frame_callback) { +- wl_callback_destroy(xwl_present_window->frame_callback); +- xwl_present_window->frame_callback = NULL; +- } ++ xorg_list_del(&xwl_present_window->frame_callback_list); + + if (xwl_present_window->sync_callback) { + wl_callback_destroy(xwl_present_window->sync_callback); +@@ -252,15 +250,10 @@ xwl_present_timer_callback(OsTimerPtr timer, + return 0; + } + +-static void +-xwl_present_frame_callback(void *data, +- struct wl_callback *callback, +- uint32_t time) ++void ++xwl_present_frame_callback(struct xwl_present_window *xwl_present_window) + { +- struct xwl_present_window *xwl_present_window = data; +- +- wl_callback_destroy(xwl_present_window->frame_callback); +- xwl_present_window->frame_callback = NULL; ++ xorg_list_del(&xwl_present_window->frame_callback_list); + + if (xwl_present_window->frame_timer_firing) { + /* If the timer is firing, this frame callback is too late */ +@@ -275,10 +268,6 @@ xwl_present_frame_callback(void *data, + xwl_present_reset_timer(xwl_present_window); + } + +-static const struct wl_callback_listener xwl_present_frame_listener = { +- xwl_present_frame_callback +-}; +- + static void + xwl_present_sync_callback(void *data, + struct wl_callback *callback, +@@ -488,11 +477,12 @@ xwl_present_flip(WindowPtr present_window, + /* We can flip directly to the main surface (full screen window without clips) */ + wl_surface_attach(xwl_window->surface, buffer, 0, 0); + +- if (!xwl_present_window->frame_callback) { +- xwl_present_window->frame_callback = wl_surface_frame(xwl_window->surface); +- wl_callback_add_listener(xwl_present_window->frame_callback, +- &xwl_present_frame_listener, +- xwl_present_window); ++ if (!xwl_window->frame_callback) ++ xwl_window_create_frame_callback(xwl_window); ++ ++ if (xorg_list_is_empty(&xwl_present_window->frame_callback_list)) { ++ xorg_list_add(&xwl_present_window->frame_callback_list, ++ &xwl_window->frame_callback_list); + } + + /* Realign timer */ +@@ -532,14 +522,14 @@ xwl_present_unrealize_window(WindowPtr window) + { + struct xwl_present_window *xwl_present_window = xwl_present_window_priv(window); + +- if (!xwl_present_window || !xwl_present_window->frame_callback) ++ if (!xwl_present_window || ++ xorg_list_is_empty(&xwl_present_window->frame_callback_list)) + return; + + /* The pending frame callback may never be called, so drop it and shorten + * the frame timer interval. + */ +- wl_callback_destroy(xwl_present_window->frame_callback); +- xwl_present_window->frame_callback = NULL; ++ xorg_list_del(&xwl_present_window->frame_callback_list); + xwl_present_reset_timer(xwl_present_window); + } + +diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c +index ef01842f0..feb1058b7 100644 +--- a/hw/xwayland/xwayland.c ++++ b/hw/xwayland/xwayland.c +@@ -600,6 +600,10 @@ ensure_surface_for_window(WindowPtr window) + dixSetPrivate(&window->devPrivates, &xwl_window_private_key, xwl_window); + xorg_list_init(&xwl_window->link_damage); + ++#ifdef GLAMOR_HAS_GBM ++ xorg_list_init(&xwl_window->frame_callback_list); ++#endif ++ + xwl_window_init_allow_commits(xwl_window); + + return TRUE; +@@ -684,11 +688,6 @@ xwl_unrealize_window(WindowPtr window) + xwl_screen->UnrealizeWindow = screen->UnrealizeWindow; + screen->UnrealizeWindow = xwl_unrealize_window; + +-#ifdef GLAMOR_HAS_GBM +- if (xwl_screen->present) +- xwl_present_unrealize_window(window); +-#endif +- + xwl_window = xwl_window_get(window); + if (!xwl_window) + return ret; +@@ -700,6 +699,11 @@ xwl_unrealize_window(WindowPtr window) + if (xwl_window->frame_callback) + wl_callback_destroy(xwl_window->frame_callback); + ++#ifdef GLAMOR_HAS_GBM ++ if (xwl_screen->present) ++ xwl_present_unrealize_window(window); ++#endif ++ + free(xwl_window); + dixSetPrivate(&window->devPrivates, &xwl_window_private_key, NULL); + +@@ -741,6 +745,18 @@ frame_callback(void *data, + + wl_callback_destroy (xwl_window->frame_callback); + xwl_window->frame_callback = NULL; ++ ++#ifdef GLAMOR_HAS_GBM ++ if (xwl_window->xwl_screen->present) { ++ struct xwl_present_window *xwl_present_window, *tmp; ++ ++ xorg_list_for_each_entry_safe(xwl_present_window, tmp, ++ &xwl_window->frame_callback_list, ++ frame_callback_list) { ++ xwl_present_frame_callback(xwl_present_window); ++ } ++ } ++#endif + } + + static const struct wl_callback_listener frame_listener = { +diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h +index d20016c5d..d4eb6bf1a 100644 +--- a/hw/xwayland/xwayland.h ++++ b/hw/xwayland/xwayland.h +@@ -183,6 +183,7 @@ struct xwl_window { + struct wl_callback *frame_callback; + Bool allow_commits; + #ifdef GLAMOR_HAS_GBM ++ struct xorg_list frame_callback_list; + Bool present_flipped; + #endif + }; +@@ -192,7 +193,7 @@ struct xwl_present_window { + struct xwl_screen *xwl_screen; + struct xwl_present_event *sync_flip; + WindowPtr window; +- struct xorg_list link; ++ struct xorg_list frame_callback_list; + + uint64_t msc; + uint64_t ust; +@@ -454,6 +455,7 @@ Bool xwl_glamor_allow_commits(struct xwl_window *xwl_window); + void xwl_glamor_egl_make_current(struct xwl_screen *xwl_screen); + + #ifdef GLAMOR_HAS_GBM ++void xwl_present_frame_callback(struct xwl_present_window *xwl_present_window); + Bool xwl_present_init(ScreenPtr screen); + void xwl_present_cleanup(WindowPtr window); + void xwl_present_unrealize_window(WindowPtr window); +-- +2.24.1 + diff --git a/0019-xwayland-Use-frame-callbacks-for-Present-vblank-even.patch b/0019-xwayland-Use-frame-callbacks-for-Present-vblank-even.patch new file mode 100644 index 0000000..429d687 --- /dev/null +++ b/0019-xwayland-Use-frame-callbacks-for-Present-vblank-even.patch @@ -0,0 +1,99 @@ +From 2a185dd22ddb5b0d7d2ef5948591028766bb9530 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michel=20D=C3=A4nzer?= +Date: Mon, 2 Mar 2020 18:09:31 +0100 +Subject: [PATCH xserver 19/22] xwayland: Use frame callbacks for Present + vblank events + +Instead of only the fallback timer. + +Fixes https://gitlab.freedesktop.org/xorg/xserver/issues/854 + +v2: +* Drop unused frame_callback member of struct xwl_present_window + (Olivier Fourdan) + +Reviewed-by: Olivier Fourdan +(cherry picked from commit 9b31358c52e951883bf7c01c953a9da080542244) +--- + hw/xwayland/xwayland-present.c | 22 ++++++++++++++-------- + hw/xwayland/xwayland.h | 2 -- + 2 files changed, 14 insertions(+), 10 deletions(-) + +diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c +index baa97d6f3..c7c077aaa 100644 +--- a/hw/xwayland/xwayland-present.c ++++ b/hw/xwayland/xwayland-present.c +@@ -242,7 +242,10 @@ xwl_present_timer_callback(OsTimerPtr timer, + { + struct xwl_present_window *xwl_present_window = arg; + +- xwl_present_window->frame_timer_firing = TRUE; ++ /* If we were expecting a frame callback for this window, it didn't arrive ++ * in a second. Stop listening to it to avoid double-bumping the MSC ++ */ ++ xorg_list_del(&xwl_present_window->frame_callback_list); + + xwl_present_msc_bump(xwl_present_window); + xwl_present_reset_timer(xwl_present_window); +@@ -255,11 +258,6 @@ xwl_present_frame_callback(struct xwl_present_window *xwl_present_window) + { + xorg_list_del(&xwl_present_window->frame_callback_list); + +- if (xwl_present_window->frame_timer_firing) { +- /* If the timer is firing, this frame callback is too late */ +- return; +- } +- + xwl_present_msc_bump(xwl_present_window); + + /* we do not need the timer anymore for this frame, +@@ -349,6 +347,7 @@ xwl_present_queue_vblank(WindowPtr present_window, + uint64_t msc) + { + struct xwl_present_window *xwl_present_window = xwl_present_window_get_priv(present_window); ++ struct xwl_window *xwl_window = xwl_window_from_window(present_window); + struct xwl_present_event *event; + + event = malloc(sizeof *event); +@@ -361,7 +360,15 @@ xwl_present_queue_vblank(WindowPtr present_window, + + xorg_list_append(&event->list, &xwl_present_window->event_list); + +- if (!xwl_present_window->frame_timer) ++ /* If there's a pending frame callback, use that */ ++ if (xwl_window && xwl_window->frame_callback && ++ xorg_list_is_empty(&xwl_present_window->frame_callback_list)) { ++ xorg_list_add(&xwl_present_window->frame_callback_list, ++ &xwl_window->frame_callback_list); ++ } ++ ++ if ((xwl_window && xwl_window->frame_callback) || ++ !xwl_present_window->frame_timer) + xwl_present_reset_timer(xwl_present_window); + + return Success; +@@ -486,7 +493,6 @@ xwl_present_flip(WindowPtr present_window, + } + + /* Realign timer */ +- xwl_present_window->frame_timer_firing = FALSE; + xwl_present_reset_timer(xwl_present_window); + + wl_surface_damage(xwl_window->surface, 0, 0, +diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h +index d4eb6bf1a..a12ec257b 100644 +--- a/hw/xwayland/xwayland.h ++++ b/hw/xwayland/xwayland.h +@@ -199,9 +199,7 @@ struct xwl_present_window { + uint64_t ust; + + OsTimerPtr frame_timer; +- Bool frame_timer_firing; + +- struct wl_callback *frame_callback; + struct wl_callback *sync_callback; + + struct xorg_list event_list; +-- +2.24.1 + diff --git a/0020-Fix-building-with-fno-common.patch b/0020-Fix-building-with-fno-common.patch new file mode 100644 index 0000000..5a1d588 --- /dev/null +++ b/0020-Fix-building-with-fno-common.patch @@ -0,0 +1,254 @@ +From 1610ef1d6b5ba99da9d1a639f3b65b2e61514a7d Mon Sep 17 00:00:00 2001 +From: David Seifert +Date: Fri, 24 Jan 2020 12:49:44 +0100 +Subject: [PATCH xserver 20/22] Fix building with `-fno-common` + +* GCC 10 will switch the default to `-fno-common`. + https://gcc.gnu.org/PR85678 + +Bug: https://bugs.gentoo.org/705880 +Signed-off-by: Matt Turner +--- + hw/dmx/config/dmxconfig.c | 2 +- + hw/dmx/config/xdmxconfig.c | 2 +- + hw/dmx/glxProxy/glxext.c | 2 -- + hw/xwayland/xwayland.c | 2 +- + test/misc.c | 2 +- + test/xi1/protocol-xchangedevicecontrol.c | 2 +- + test/xi2/protocol-common.c | 2 ++ + test/xi2/protocol-common.h | 2 +- + test/xi2/protocol-xigetclientpointer.c | 2 +- + test/xi2/protocol-xigetselectedevents.c | 2 +- + test/xi2/protocol-xipassivegrabdevice.c | 2 +- + test/xi2/protocol-xiquerydevice.c | 2 +- + test/xi2/protocol-xiquerypointer.c | 2 +- + test/xi2/protocol-xiqueryversion.c | 2 +- + test/xi2/protocol-xiselectevents.c | 2 +- + test/xi2/protocol-xisetclientpointer.c | 2 +- + test/xi2/protocol-xiwarppointer.c | 2 +- + 17 files changed, 17 insertions(+), 17 deletions(-) + +diff --git a/hw/dmx/config/dmxconfig.c b/hw/dmx/config/dmxconfig.c +index c1a9e1cf3..85bc0dbe4 100644 +--- a/hw/dmx/config/dmxconfig.c ++++ b/hw/dmx/config/dmxconfig.c +@@ -72,7 +72,7 @@ typedef struct DMXConfigCmdStruct { + DMXConfigList *xinputs; + } DMXConfigCmd, *DMXConfigCmdPtr; + +-DMXConfigEntryPtr dmxConfigEntry; ++extern DMXConfigEntryPtr dmxConfigEntry; + static DMXConfigCmd dmxConfigCmd; + + static int dmxDisplaysFromCommandLine; +diff --git a/hw/dmx/config/xdmxconfig.c b/hw/dmx/config/xdmxconfig.c +index 49e4b5459..05d839688 100644 +--- a/hw/dmx/config/xdmxconfig.c ++++ b/hw/dmx/config/xdmxconfig.c +@@ -65,7 +65,7 @@ extern FILE *yyin; + #define DMX_CANVAS_WIDTH 400 + #define DMX_CANVAS_HEIGHT 500 + +-DMXConfigEntryPtr dmxConfigEntry; ++extern DMXConfigEntryPtr dmxConfigEntry; + static DMXConfigVirtualPtr dmxConfigCurrent, dmxConfigNewVirtual; + static DMXConfigDisplayPtr dmxConfigCurrentDisplay, dmxConfigNewDisplay; + static int dmxConfigGrabbed, dmxConfigGrabbedFine; +diff --git a/hw/dmx/glxProxy/glxext.c b/hw/dmx/glxProxy/glxext.c +index 49848bbff..ca9780f99 100644 +--- a/hw/dmx/glxProxy/glxext.c ++++ b/hw/dmx/glxProxy/glxext.c +@@ -47,8 +47,6 @@ + #include "extinit.h" + #include "glx_extinit.h" + +-int noGlxExtension; +- + /* + ** Forward declarations. + */ +diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c +index feb1058b7..5fefa5923 100644 +--- a/hw/xwayland/xwayland.c ++++ b/hw/xwayland/xwayland.c +@@ -40,7 +40,7 @@ + + #ifdef XF86VIDMODE + #include +-_X_EXPORT Bool noXFree86VidModeExtension; ++extern _X_EXPORT Bool noXFree86VidModeExtension; + #endif + + #ifdef XWL_HAS_GLAMOR +diff --git a/test/misc.c b/test/misc.c +index 3c669b677..f1f76cccd 100644 +--- a/test/misc.c ++++ b/test/misc.c +@@ -33,7 +33,7 @@ + + #include "tests-common.h" + +-ScreenInfo screenInfo; ++extern ScreenInfo screenInfo; + + static void + dix_version_compare(void) +diff --git a/test/xi1/protocol-xchangedevicecontrol.c b/test/xi1/protocol-xchangedevicecontrol.c +index 57a15c407..54f1f67cb 100644 +--- a/test/xi1/protocol-xchangedevicecontrol.c ++++ b/test/xi1/protocol-xchangedevicecontrol.c +@@ -37,7 +37,7 @@ + + #include "protocol-common.h" + +-ClientRec client_window; ++extern ClientRec client_window; + static ClientRec client_request; + + static void +diff --git a/test/xi2/protocol-common.c b/test/xi2/protocol-common.c +index 8cd85dd05..05dd3c4e7 100644 +--- a/test/xi2/protocol-common.c ++++ b/test/xi2/protocol-common.c +@@ -45,6 +45,8 @@ static ClientRec server_client; + + void *global_userdata; + ++void (*reply_handler) (ClientPtr client, int len, char *data, void *userdata); ++ + int enable_GrabButton_wrap = 1; + int enable_XISetEventMask_wrap = 1; + +diff --git a/test/xi2/protocol-common.h b/test/xi2/protocol-common.h +index 8490529ad..742ce348f 100644 +--- a/test/xi2/protocol-common.h ++++ b/test/xi2/protocol-common.h +@@ -99,7 +99,7 @@ extern void *global_userdata; + * The reply handler called from WriteToClient. Set this handler if you need + * to check the reply values. + */ +-void (*reply_handler) (ClientPtr client, int len, char *data, void *userdata); ++extern void (*reply_handler) (ClientPtr client, int len, char *data, void *userdata); + + /** + * The default screen used for the windows. Initialized by init_simple(). +diff --git a/test/xi2/protocol-xigetclientpointer.c b/test/xi2/protocol-xigetclientpointer.c +index 9c38bd720..244e8438f 100644 +--- a/test/xi2/protocol-xigetclientpointer.c ++++ b/test/xi2/protocol-xigetclientpointer.c +@@ -46,7 +46,7 @@ static struct { + int win; + } test_data; + +-ClientRec client_window; ++extern ClientRec client_window; + static ClientRec client_request; + + static void +diff --git a/test/xi2/protocol-xigetselectedevents.c b/test/xi2/protocol-xigetselectedevents.c +index 9a0fac5d4..b14100224 100644 +--- a/test/xi2/protocol-xigetselectedevents.c ++++ b/test/xi2/protocol-xigetselectedevents.c +@@ -60,7 +60,7 @@ static struct { + int mask_len; + } test_data; + +-ClientRec client_window; ++extern ClientRec client_window; + + /* AddResource is called from XISetSEventMask, we don't need this */ + Bool +diff --git a/test/xi2/protocol-xipassivegrabdevice.c b/test/xi2/protocol-xipassivegrabdevice.c +index c703a1ee8..142bcecb7 100644 +--- a/test/xi2/protocol-xipassivegrabdevice.c ++++ b/test/xi2/protocol-xipassivegrabdevice.c +@@ -41,7 +41,7 @@ + + #include "protocol-common.h" + +-ClientRec client_window; ++extern ClientRec client_window; + static ClientRec client_request; + + #define N_MODS 7 +diff --git a/test/xi2/protocol-xiquerydevice.c b/test/xi2/protocol-xiquerydevice.c +index a068038fd..6ee8a80fc 100644 +--- a/test/xi2/protocol-xiquerydevice.c ++++ b/test/xi2/protocol-xiquerydevice.c +@@ -54,7 +54,7 @@ struct test_data { + int num_devices_in_reply; + }; + +-ClientRec client_window; ++extern ClientRec client_window; + + static void reply_XIQueryDevice_data(ClientPtr client, int len, char *data, + void *closure); +diff --git a/test/xi2/protocol-xiquerypointer.c b/test/xi2/protocol-xiquerypointer.c +index ed75d7910..0f5a2b57a 100644 +--- a/test/xi2/protocol-xiquerypointer.c ++++ b/test/xi2/protocol-xiquerypointer.c +@@ -41,7 +41,7 @@ + + #include "protocol-common.h" + +-ClientRec client_window; ++extern ClientRec client_window; + static ClientRec client_request; + static void reply_XIQueryPointer_data(ClientPtr client, int len, + char *data, void *closure); +diff --git a/test/xi2/protocol-xiqueryversion.c b/test/xi2/protocol-xiqueryversion.c +index 3ce758faa..c7ddbfc10 100644 +--- a/test/xi2/protocol-xiqueryversion.c ++++ b/test/xi2/protocol-xiqueryversion.c +@@ -58,7 +58,7 @@ struct test_data { + int minor_expected; + }; + +-ClientRec client_window; ++extern ClientRec client_window; + + static void + reply_XIQueryVersion(ClientPtr client, int len, char *data, void *closure) +diff --git a/test/xi2/protocol-xiselectevents.c b/test/xi2/protocol-xiselectevents.c +index f136c23d0..06050ade7 100644 +--- a/test/xi2/protocol-xiselectevents.c ++++ b/test/xi2/protocol-xiselectevents.c +@@ -62,7 +62,7 @@ + + static unsigned char *data[4096 * 20]; /* the request data buffer */ + +-ClientRec client_window; ++extern ClientRec client_window; + + int + __real_XISetEventMask(DeviceIntPtr dev, WindowPtr win, ClientPtr client, +diff --git a/test/xi2/protocol-xisetclientpointer.c b/test/xi2/protocol-xisetclientpointer.c +index 6584bb9cc..ddc9f0000 100644 +--- a/test/xi2/protocol-xisetclientpointer.c ++++ b/test/xi2/protocol-xisetclientpointer.c +@@ -48,7 +48,7 @@ + + #include "protocol-common.h" + +-ClientRec client_window; ++extern ClientRec client_window; + static ClientRec client_request; + + static void +diff --git a/test/xi2/protocol-xiwarppointer.c b/test/xi2/protocol-xiwarppointer.c +index 8484d54e5..e5c2f31ea 100644 +--- a/test/xi2/protocol-xiwarppointer.c ++++ b/test/xi2/protocol-xiwarppointer.c +@@ -44,7 +44,7 @@ + static int expected_x = SPRITE_X; + static int expected_y = SPRITE_Y; + +-ClientRec client_window; ++extern ClientRec client_window; + + /** + * This function overrides the one in the screen rec. +-- +2.24.1 + diff --git a/0021-dix-Check-for-NULL-spriteInfo-in-GetPairedDevice.patch b/0021-dix-Check-for-NULL-spriteInfo-in-GetPairedDevice.patch new file mode 100644 index 0000000..38424e7 --- /dev/null +++ b/0021-dix-Check-for-NULL-spriteInfo-in-GetPairedDevice.patch @@ -0,0 +1,35 @@ +From 3c48bd50ad33f2a533ac76afa38d6e3906ebc28a Mon Sep 17 00:00:00 2001 +From: Arthur Williams +Date: Sun, 6 Oct 2019 18:55:35 +0000 +Subject: [PATCH xserver 21/22] dix: Check for NULL spriteInfo in + GetPairedDevice + +There is a race when reseting the XServer that causes spriteInfo to be +NULL in GetPairedDevice resulting a segfault and subsequent crash. The +problem was noticed when opening a connection, creating master devices, +destroying master devices and closing the connection during testing. + +Signed-off-by: Arthur Williams + + +(cherry picked from commit e693c9657f98c334e9921ca2f8ebf710497c0c6a) +--- + dix/devices.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/dix/devices.c b/dix/devices.c +index 1b18b168e..00c453980 100644 +--- a/dix/devices.c ++++ b/dix/devices.c +@@ -2656,7 +2656,7 @@ GetPairedDevice(DeviceIntPtr dev) + if (!IsMaster(dev) && !IsFloating(dev)) + dev = GetMaster(dev, MASTER_ATTACHED); + +- return dev->spriteInfo->paired; ++ return dev->spriteInfo? dev->spriteInfo->paired: NULL; + } + + /** +-- +2.24.1 + diff --git a/0022-xwayland-glamor-gbm-Handle-DRM_FORMAT_MOD_INVALID-gr.patch b/0022-xwayland-glamor-gbm-Handle-DRM_FORMAT_MOD_INVALID-gr.patch new file mode 100644 index 0000000..3646f5c --- /dev/null +++ b/0022-xwayland-glamor-gbm-Handle-DRM_FORMAT_MOD_INVALID-gr.patch @@ -0,0 +1,41 @@ +From a033571644d277dc49a489f7ae32c4ad92856543 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jonas=20=C3=85dahl?= +Date: Fri, 13 Sep 2019 17:11:27 +0200 +Subject: [PATCH xserver 22/22] xwayland/glamor-gbm: Handle + DRM_FORMAT_MOD_INVALID gracefully +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The compositor may send DRM_FORMAT_MOD_INVALID instead of a list of +modifiers for various reasons. Handle this gracefully by ignoring it. + +Without this, if a compositor would send DRM_FORMAT_MOD_INVALID, it'd +result in empty windows provided by Xwayland. + +Signed-off-by: Jonas Ådahl +Reviewed-by: Olivier Fourdan +Reviewed-by: Michel Dänzer +(cherry picked from commit edf964434eac10ffbe27cc883e3ab95505669aee) +--- + hw/xwayland/xwayland-glamor-gbm.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/hw/xwayland/xwayland-glamor-gbm.c b/hw/xwayland/xwayland-glamor-gbm.c +index c02ba7363..dce782fc3 100644 +--- a/hw/xwayland/xwayland-glamor-gbm.c ++++ b/hw/xwayland/xwayland-glamor-gbm.c +@@ -798,6 +798,10 @@ xwl_dmabuf_handle_modifier(void *data, struct zwp_linux_dmabuf_v1 *dmabuf, + struct xwl_format *xwl_format = NULL; + int i; + ++ if (modifier_hi == (DRM_FORMAT_MOD_INVALID >> 32) && ++ modifier_lo == (DRM_FORMAT_MOD_INVALID & 0xffffffff)) ++ return; ++ + for (i = 0; i < xwl_screen->num_formats; i++) { + if (xwl_screen->formats[i].format == format) { + xwl_format = &xwl_screen->formats[i]; +-- +2.24.1 + diff --git a/sources b/sources index d74b6f3..26e3be1 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (xorg-server-1.20.6.tar.bz2) = 9aa0ba4aee92fe628f2b8c41e4fe0134dc86154bb8787f907884ef2fd970e18e68e72ea8a1beb706d11ecf155b2abc9731f1abadff251ed592f8cca3b1240dd6 +SHA512 (xorg-server-1.20.7.tar.bz2) = c67612e379111c28c68941c0a660abf72be7669591b41ccaa3b3474c4540a03822a28d892831b12ce08bac6e5e7e33504c2d19ef2a0c2298f83bd083459f96f5 diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index a45f48d..cd03fea 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -21,7 +21,7 @@ %global ansic_major 0 %global ansic_minor 4 %global videodrv_major 24 -%global videodrv_minor 0 +%global videodrv_minor 1 %global xinput_major 24 %global xinput_minor 1 %global extension_major 10 @@ -45,8 +45,8 @@ Summary: X.Org X11 X server Name: xorg-x11-server -Version: 1.20.6 -Release: 2%{?gitdate:.%{gitdate}}%{?dist} +Version: 1.20.7 +Release: 1%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org License: MIT @@ -101,13 +101,32 @@ Patch6: 0001-Fedora-hack-Make-the-suid-root-wrapper-always-start-.patch #Patch24: 0004-modesetting-Use-atomic-instead-of-per-crtc-walks-whe.patch # Backports from current stable "server-1.20-branch": -# ... + +Patch100: 0001-configure-Define-GLAMOR_HAS_EGL_QUERY_DRIVER-when-av.patch +Patch101: 0002-modesetting-Explicitly-include-mi.h.patch +Patch102: 0003-Restrict-1x1-pixmap-filling-optimization-to-GXcopy.patch +Patch103: 0004-Revert-dri2-Don-t-make-reference-to-noClientExceptio.patch +Patch104: 0005-os-Ignore-dying-client-in-ResetCurrentRequest.patch +Patch105: 0006-xfree86-modes-Bail-from-xf86RotateRedisplay-if-pScre.patch +Patch106: 0007-modesetting-remove-unnecessary-error-message-fix-zap.patch +Patch107: 0008-glamor-Propagate-FBO-allocation-failure-for-picture-.patch +Patch108: 0009-glamor-Error-out-on-out-of-memory-when-allocating-PB.patch +Patch109: 0010-glamor-Propagate-glamor_prepare_access-failures-in-c.patch +Patch110: 0011-glamor-Fallback-to-system-memory-for-RW-PBO-buffer-a.patch +Patch111: 0012-glamor-Fix-a-compiler-warning-since-the-recent-OOM-f.patch +Patch112: 0013-modesetting-Disable-atomic-support-by-default.patch +Patch113: 0014-xwayland-Split-up-xwl_screen_post_damage-into-two-ph.patch +Patch114: 0015-xwayland-Call-glamor_block_handler-from-xwl_screen_p.patch +Patch115: 0016-xwayland-clear-pixmaps-after-creation-in-rootless-mo.patch +Patch116: 0017-xwayland-Add-xwl_window_create_frame_callback-helper.patch +Patch117: 0018-xwayland-Use-single-frame-callback-for-Present-flips.patch +Patch118: 0019-xwayland-Use-frame-callbacks-for-Present-vblank-even.patch +Patch119: 0020-Fix-building-with-fno-common.patch +Patch120: 0021-dix-Check-for-NULL-spriteInfo-in-GetPairedDevice.patch +Patch121: 0022-xwayland-glamor-gbm-Handle-DRM_FORMAT_MOD_INVALID-gr.patch # Backports from "master" upstream: -# https://bugzilla.redhat.com/show_bug.cgi?id=1697804 -Patch500: 0001-Xi-return-AlreadyGrabbed-for-key-grabs-255.patch - # Backported Xwayland randr resolution change emulation support Patch501: 0001-dix-Add-GetCurrentClient-helper.patch Patch502: 0002-xwayland-Add-wp_viewport-wayland-extension-support.patch @@ -551,6 +570,14 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Fri Mar 13 2020 Olivier Fourdan - 1.20.7-1 +- xserver 1.20.7 +- backport from stable "xserver-1.20-branch" up to commit ad7364d8d + (for mutter fullscreen unredirect on Wayland) +- Update videodrv minor ABI as 1.20.7 changed the minor ABI version + (backward compatible, API addition in glamor) +- Rebase Xwayland randr resolution change emulation support patches + * Fri Jan 31 2020 Fedora Release Engineering - 1.20.6-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild From 97b803e4158536b4105c588e8fa4c7a12a9e8e5c Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Wed, 18 Mar 2020 11:02:32 +0100 Subject: [PATCH 049/131] Fix a crash on closing a window using Present https://gitlab.freedesktop.org/xorg/xserver/issues/1000 --- ...all-frame_callback_list-nodes-in-xwl.patch | 80 +++++++++++++++++++ xorg-x11-server.spec | 7 +- 2 files changed, 86 insertions(+), 1 deletion(-) create mode 100644 0001-xwayland-Delete-all-frame_callback_list-nodes-in-xwl.patch diff --git a/0001-xwayland-Delete-all-frame_callback_list-nodes-in-xwl.patch b/0001-xwayland-Delete-all-frame_callback_list-nodes-in-xwl.patch new file mode 100644 index 0000000..3dedc99 --- /dev/null +++ b/0001-xwayland-Delete-all-frame_callback_list-nodes-in-xwl.patch @@ -0,0 +1,80 @@ +From b259485975078087fe6bde2b9e1eccf4ae14120c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michel=20D=C3=A4nzer?= +Date: Tue, 17 Mar 2020 11:45:22 +0100 +Subject: [PATCH xserver] xwayland: Delete all frame_callback_list nodes in + xwl_unrealize_window + +We were only calling xwl_present_unrealize_window for the toplevel +window, but the list can contain entries from child windows as well, +in which case we were leaving dangling pointers to freed memory. + +Closes: https://gitlab.freedesktop.org/xorg/xserver/issues/1000 +Fixes: c5067feaeea1 "xwayland: Use single frame callback for Present + flips and normal updates" +Reviewed-by: Olivier Fourdan +Tested-by: Olivier Fourdan +(cherry picked from commit 5e91587302e85fd6f0e8d5ffbe30182e18c6913f) +--- + hw/xwayland/xwayland-present.c | 8 +------- + hw/xwayland/xwayland.c | 11 +++++++++-- + hw/xwayland/xwayland.h | 2 +- + 3 files changed, 11 insertions(+), 10 deletions(-) + +diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c +index c7c077aaa..5ba7dce08 100644 +--- a/hw/xwayland/xwayland-present.c ++++ b/hw/xwayland/xwayland-present.c +@@ -524,14 +524,8 @@ xwl_present_flips_stop(WindowPtr window) + } + + void +-xwl_present_unrealize_window(WindowPtr window) ++xwl_present_unrealize_window(struct xwl_present_window *xwl_present_window) + { +- struct xwl_present_window *xwl_present_window = xwl_present_window_priv(window); +- +- if (!xwl_present_window || +- xorg_list_is_empty(&xwl_present_window->frame_callback_list)) +- return; +- + /* The pending frame callback may never be called, so drop it and shorten + * the frame timer interval. + */ +diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c +index 5fefa5923..ed9f2e3c2 100644 +--- a/hw/xwayland/xwayland.c ++++ b/hw/xwayland/xwayland.c +@@ -700,8 +700,15 @@ xwl_unrealize_window(WindowPtr window) + wl_callback_destroy(xwl_window->frame_callback); + + #ifdef GLAMOR_HAS_GBM +- if (xwl_screen->present) +- xwl_present_unrealize_window(window); ++ if (xwl_screen->present) { ++ struct xwl_present_window *xwl_present_window, *tmp; ++ ++ xorg_list_for_each_entry_safe(xwl_present_window, tmp, ++ &xwl_window->frame_callback_list, ++ frame_callback_list) { ++ xwl_present_unrealize_window(xwl_present_window); ++ } ++ } + #endif + + free(xwl_window); +diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h +index a12ec257b..daa719209 100644 +--- a/hw/xwayland/xwayland.h ++++ b/hw/xwayland/xwayland.h +@@ -456,7 +456,7 @@ void xwl_glamor_egl_make_current(struct xwl_screen *xwl_screen); + void xwl_present_frame_callback(struct xwl_present_window *xwl_present_window); + Bool xwl_present_init(ScreenPtr screen); + void xwl_present_cleanup(WindowPtr window); +-void xwl_present_unrealize_window(WindowPtr window); ++void xwl_present_unrealize_window(struct xwl_present_window *xwl_present_window); + #endif /* GLAMOR_HAS_GBM */ + + #ifdef XV +-- +2.25.1 + diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index cd03fea..1e0bb79 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -46,7 +46,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.20.7 -Release: 1%{?gitdate:.%{gitdate}}%{?dist} +Release: 2%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org License: MIT @@ -124,6 +124,7 @@ Patch118: 0019-xwayland-Use-frame-callbacks-for-Present-vblank-even.patch Patch119: 0020-Fix-building-with-fno-common.patch Patch120: 0021-dix-Check-for-NULL-spriteInfo-in-GetPairedDevice.patch Patch121: 0022-xwayland-glamor-gbm-Handle-DRM_FORMAT_MOD_INVALID-gr.patch +Patch122: 0001-xwayland-Delete-all-frame_callback_list-nodes-in-xwl.patch # Backports from "master" upstream: @@ -570,6 +571,10 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Wed Mar 18 2020 Olivier Fourdan - 1.20.7-2 +- Fix a crash on closing a window using Present found upstream: + https://gitlab.freedesktop.org/xorg/xserver/issues/1000 + * Fri Mar 13 2020 Olivier Fourdan - 1.20.7-1 - xserver 1.20.7 - backport from stable "xserver-1.20-branch" up to commit ad7364d8d From efa2d863b7718bf2a3559a438e4810eddb8bf985 Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Mon, 30 Mar 2020 09:42:38 +0200 Subject: [PATCH 050/131] xserver 1.20.8 - Update to xserver 1.20.8 - Backport latest Xwayland randr resolution change emulation support patches. --- ...-GLAMOR_HAS_EGL_QUERY_DRIVER-when-av.patch | 57 ---- 0001-dix-Add-GetCurrentClient-helper.patch | 7 +- ...last.valuators-alone-on-slave-switch.patch | 89 ------ ...-Weaksauce-atomic-property-debugging.patch | 64 ----- ...all-frame_callback_list-nodes-in-xwl.patch | 80 ------ ...-Destroy-sync_callback-in-xwl_presen.patch | 36 --- ...-modesetting-Explicitly-include-mi.h.patch | 29 -- ...agate-more-failure-in-drmmode_set_mo.patch | 31 --- ...p_viewport-wayland-extension-support.patch | 13 +- ...ixmap-filling-optimization-to-GXcopy.patch | 38 --- ...ing-Factor-out-drmmode_target_output.patch | 64 ----- ...fer_damage-instead-of-surface-damage.patch | 19 +- ...t-make-reference-to-noClientExceptio.patch | 34 --- ...atomic-instead-of-per-crtc-walks-whe.patch | 245 ----------------- ...e-output-modes-to-xrandr-output-mode.patch | 11 +- ...-dying-client-in-ResetCurrentRequest.patch | 39 --- ...ayland-Use-RandR-1.2-interface-rev-2.patch | 7 +- ...il-from-xf86RotateRedisplay-if-pScre.patch | 37 --- ...xwayland-Add-per-client-private-data.patch | 21 +- ...ve-unnecessary-error-message-fix-zap.patch | 59 ---- ...port-for-storing-per-client-per-outp.patch | 17 +- ...-FBO-allocation-failure-for-picture-.patch | 44 --- ...port-for-randr-resolution-change-emu.patch | 17 +- ...-on-out-of-memory-when-allocating-PB.patch | 66 ----- ...lRRModeToDisplayMode-helper-function.patch | 7 +- ...-glamor_prepare_access-failures-in-c.patch | 45 ---- ...VidModeGetCurrentRRMode-helper-to-th.patch | 7 +- ...to-system-memory-for-RW-PBO-buffer-a.patch | 67 ----- ...mode-mode-changing-emulation-support.patch | 7 +- ...piler-warning-since-the-recent-OOM-f.patch | 28 -- ...dow_should_enable_viewport-Add-extra.patch | 9 +- ...ng-Disable-atomic-support-by-default.patch | 69 ----- ...AYLAND_RANDR_EMU_MONITOR_RECTS-prope.patch | 11 +- ...lient-id-for-the-window-manager-clie.patch | 137 ++++++++++ ...p-xwl_screen_post_damage-into-two-ph.patch | 64 ----- ...amor_block_handler-from-xwl_screen_p.patch | 46 ---- ...Reuse-viewport-instead-of-recreating.patch | 50 ++++ ...Recurse-on-finding-the-none-wm-owner.patch | 81 ++++++ ...ixmaps-after-creation-in-rootless-mo.patch | 137 ---------- ..._window_create_frame_callback-helper.patch | 62 ----- ...ndow_get_none_wm_owner-return-a-Wind.patch | 82 ++++++ ...-emulation-on-client-toplevel-resize.patch | 121 +++++++++ ...gle-frame-callback-for-Present-flips.patch | 212 --------------- ...eck-resolution-change-emulation-when.patch | 45 ++++ ...me-callbacks-for-Present-vblank-even.patch | 99 ------- 0020-Fix-building-with-fno-common.patch | 254 ------------------ ...Also-hook-screen-s-MoveWindow-method.patch | 83 ++++++ ...r-NULL-spriteInfo-in-GetPairedDevice.patch | 35 --- ...lated-modes-not-being-removed-when-s.patch | 8 +- ...l_window_check_resolution_change_emu.patch | 14 +- ...gbm-Handle-DRM_FORMAT_MOD_INVALID-gr.patch | 41 --- ...ting-of-_XWAYLAND_RANDR_EMU_MONITOR_.patch | 39 ++- ...unnecessary-xwl_window_is_toplevel-c.patch | 8 +- sources | 2 +- xorg-x11-server.spec | 56 ++-- ...from-glamor_fds_from_pixmap-on-error.patch | 54 ---- ...ixmap-error-in-glamor_fd_from_pixmap.patch | 58 ---- 57 files changed, 745 insertions(+), 2417 deletions(-) delete mode 100644 0001-configure-Define-GLAMOR_HAS_EGL_QUERY_DRIVER-when-av.patch delete mode 100644 0001-dix-leave-last.valuators-alone-on-slave-switch.patch delete mode 100644 0001-modesetting-Weaksauce-atomic-property-debugging.patch delete mode 100644 0001-xwayland-Delete-all-frame_callback_list-nodes-in-xwl.patch delete mode 100644 0001-xwayland-present-Destroy-sync_callback-in-xwl_presen.patch delete mode 100644 0002-modesetting-Explicitly-include-mi.h.patch delete mode 100644 0002-modesetting-Propagate-more-failure-in-drmmode_set_mo.patch delete mode 100644 0003-Restrict-1x1-pixmap-filling-optimization-to-GXcopy.patch delete mode 100644 0003-modesetting-Factor-out-drmmode_target_output.patch delete mode 100644 0004-Revert-dri2-Don-t-make-reference-to-noClientExceptio.patch delete mode 100644 0004-modesetting-Use-atomic-instead-of-per-crtc-walks-whe.patch delete mode 100644 0005-os-Ignore-dying-client-in-ResetCurrentRequest.patch delete mode 100644 0006-xfree86-modes-Bail-from-xf86RotateRedisplay-if-pScre.patch delete mode 100644 0007-modesetting-remove-unnecessary-error-message-fix-zap.patch delete mode 100644 0008-glamor-Propagate-FBO-allocation-failure-for-picture-.patch delete mode 100644 0009-glamor-Error-out-on-out-of-memory-when-allocating-PB.patch delete mode 100644 0010-glamor-Propagate-glamor_prepare_access-failures-in-c.patch delete mode 100644 0011-glamor-Fallback-to-system-memory-for-RW-PBO-buffer-a.patch delete mode 100644 0012-glamor-Fix-a-compiler-warning-since-the-recent-OOM-f.patch delete mode 100644 0013-modesetting-Disable-atomic-support-by-default.patch create mode 100644 0014-xwayland-Cache-client-id-for-the-window-manager-clie.patch delete mode 100644 0014-xwayland-Split-up-xwl_screen_post_damage-into-two-ph.patch delete mode 100644 0015-xwayland-Call-glamor_block_handler-from-xwl_screen_p.patch create mode 100644 0015-xwayland-Reuse-viewport-instead-of-recreating.patch create mode 100644 0016-xwayland-Recurse-on-finding-the-none-wm-owner.patch delete mode 100644 0016-xwayland-clear-pixmaps-after-creation-in-rootless-mo.patch delete mode 100644 0017-xwayland-Add-xwl_window_create_frame_callback-helper.patch create mode 100644 0017-xwayland-Make-window_get_none_wm_owner-return-a-Wind.patch create mode 100644 0018-xwayland-Check-emulation-on-client-toplevel-resize.patch delete mode 100644 0018-xwayland-Use-single-frame-callback-for-Present-flips.patch create mode 100644 0019-xwayland-Also-check-resolution-change-emulation-when.patch delete mode 100644 0019-xwayland-Use-frame-callbacks-for-Present-vblank-even.patch delete mode 100644 0020-Fix-building-with-fno-common.patch create mode 100644 0020-xwayland-Also-hook-screen-s-MoveWindow-method.patch delete mode 100644 0021-dix-Check-for-NULL-spriteInfo-in-GetPairedDevice.patch rename 0014-xwayland-Fix-emulated-modes-not-being-removed-when-s.patch => 0021-xwayland-Fix-emulated-modes-not-being-removed-when-s.patch (90%) rename 0015-xwayland-Call-xwl_window_check_resolution_change_emu.patch => 0022-xwayland-Call-xwl_window_check_resolution_change_emu.patch (78%) delete mode 100644 0022-xwayland-glamor-gbm-Handle-DRM_FORMAT_MOD_INVALID-gr.patch rename 0016-xwayland-Fix-setting-of-_XWAYLAND_RANDR_EMU_MONITOR_.patch => 0023-xwayland-Fix-setting-of-_XWAYLAND_RANDR_EMU_MONITOR_.patch (60%) rename 0017-xwayland-Remove-unnecessary-xwl_window_is_toplevel-c.patch => 0024-xwayland-Remove-unnecessary-xwl_window_is_toplevel-c.patch (87%) delete mode 100644 xserver-1-2-glamor-Always-return-0-from-glamor_fds_from_pixmap-on-error.patch delete mode 100644 xserver-2-2-glamor-Propagate-glamor_fds_from_pixmap-error-in-glamor_fd_from_pixmap.patch diff --git a/0001-configure-Define-GLAMOR_HAS_EGL_QUERY_DRIVER-when-av.patch b/0001-configure-Define-GLAMOR_HAS_EGL_QUERY_DRIVER-when-av.patch deleted file mode 100644 index 41a6992..0000000 --- a/0001-configure-Define-GLAMOR_HAS_EGL_QUERY_DRIVER-when-av.patch +++ /dev/null @@ -1,57 +0,0 @@ -From ad7364d8d7f936b9b08195e47d2f6ee9329ff687 Mon Sep 17 00:00:00 2001 -From: Kenneth Graunke -Date: Mon, 13 Jan 2020 23:34:49 -0800 -Subject: [PATCH xserver 01/22] configure: Define GLAMOR_HAS_EGL_QUERY_DRIVER - when available -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Commit 195c2ef8f9f07b9bdabc0f554a9033b7857b99c7 added this to the Meson -build but neglected to add it to autotools. - -v2: Also update dix-config.h.in - -Fixes: 195c2ef8f ("glamor: Add a function to get the driver name via EGL_MESA_query_driver") - -Reviewed-by: Michel Dänzer [v1] -Reviewed-by: Eric Engestrom [v1] -Reviewed-by: Matt Turner -(cherry picked from commit 25ca99df38a2c28c25ab20a917e68442285f2353) ---- - configure.ac | 4 ++++ - include/dix-config.h.in | 3 +++ - 2 files changed, 7 insertions(+) - -diff --git a/configure.ac b/configure.ac -index 9f82e2a7d..231515f0c 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -2053,6 +2053,10 @@ if test "x$GLAMOR" = xyes; then - [AC_DEFINE(GLAMOR_HAS_EGL_QUERY_DMABUF, 1, [Have GLAMOR_HAS_EGL_QUERY_DMABUF])], - []) - -+ PKG_CHECK_EXISTS(epoxy >= 1.5.4, -+ [AC_DEFINE(GLAMOR_HAS_EGL_QUERY_DRIVER, 1, [Have GLAMOR_HAS_EGL_QUERY_DRIVER])], -+ []) -+ - PKG_CHECK_MODULES(GBM, "$LIBGBM", [GBM=yes], [GBM=no]) - if test "x$GBM" = xyes; then - AC_DEFINE(GLAMOR_HAS_GBM, 1, -diff --git a/include/dix-config.h.in b/include/dix-config.h.in -index c18f62370..d02bb1b81 100644 ---- a/include/dix-config.h.in -+++ b/include/dix-config.h.in -@@ -485,6 +485,9 @@ - /* Glamor can use eglQueryDmaBuf* functions */ - #undef GLAMOR_HAS_EGL_QUERY_DMABUF - -+/* Glamor can use EGL_MESA_query_driver functions */ -+#undef GLAMOR_HAS_EGL_QUERY_DRIVER -+ - /* byte order */ - #undef X_BYTE_ORDER - --- -2.24.1 - diff --git a/0001-dix-Add-GetCurrentClient-helper.patch b/0001-dix-Add-GetCurrentClient-helper.patch index 7e0f949..d241c0e 100644 --- a/0001-dix-Add-GetCurrentClient-helper.patch +++ b/0001-dix-Add-GetCurrentClient-helper.patch @@ -1,7 +1,7 @@ -From 23d54f7049c83fd5baf9e008c159c8ffbec3649c Mon Sep 17 00:00:00 2001 +From e78e96157efb523272404a85a9433c7b9803c1db Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Thu, 29 Aug 2019 14:18:28 +0200 -Subject: [PATCH xserver 01/17] dix: Add GetCurrentClient helper +Subject: [PATCH xserver 01/24] dix: Add GetCurrentClient helper MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -43,6 +43,7 @@ to RRSetCrtc). Reviewed-by: Olivier Fourdan Reviewed-by: Michel Dänzer Signed-off-by: Hans de Goede +(cherry picked from commit 834a467af978ac7a24ed17b8c8e58b6cddb4faf9) --- dix/dispatch.c | 23 ++++++++++++++++++++++- include/dix.h | 1 + @@ -111,5 +112,5 @@ index b6e2bcfde..d65060cb6 100644 extern _X_EXPORT void SetInputCheck(HWEventQueuePtr /*c0 */ , HWEventQueuePtr /*c1 */ ); -- -2.24.1 +2.25.2 diff --git a/0001-dix-leave-last.valuators-alone-on-slave-switch.patch b/0001-dix-leave-last.valuators-alone-on-slave-switch.patch deleted file mode 100644 index 10c7177..0000000 --- a/0001-dix-leave-last.valuators-alone-on-slave-switch.patch +++ /dev/null @@ -1,89 +0,0 @@ -From 13f9b07039484927532d913dbccc664679235bf6 Mon Sep 17 00:00:00 2001 -From: Peter Hutterer -Date: Mon, 25 Mar 2019 13:19:41 +1000 -Subject: [PATCH xserver] dix: leave last.valuators alone on slave switch - -Terms: -dev->last.valuator[] is the last value given to us by the driver -dev->valuator.axisVal[] is the last value sent to the client -dev->last.scroll[] is the abs value of the scroll axis as given by the driver, - used for button emulation calculation (and the remainder) - -This function updates the device's last.valuator state based on the current -master axis state. This way, relative motion continues fluidly when switching -between devices. Before mouse 2 comes into effect, it's valuator state is -updated to wherever the pointer currently is so the relative event applies on -top of that. - -This can only work for x/y axes, all other axes aren't guaranteed to have the -same meaning and/or may not be present: -- xtest device: no valuator 2 -- mouse: valuator 2 is horizontal scroll axis -- tablet: valuator 2 is pressure - -Scaling the current value from the pressure range into the range for -horizontal scrolling makes no sense. And it causes scroll jumps: - -- scroll down, last.valuator == axisVal == 20 -- xdotool click 1, the XTest device doesn't have that valuator -- scroll up - - updateSlaveDeviceCoords reset last.valuator to 0 (axisVal == 20) - - DeviceClassesChangedEvent includes value 20 for the axis - - event is processed, last.value changes from 0 to -1 - - axisVal is updated to -1, causing a jump of -21 - -The same applies when we switch from tablet to mouse wheel if the pressure -value is 0 on proximity out (basically guaranteed). So let's drop this code -altogether and only leave the scaling for the relative x/y motion. - -Signed-off-by: Peter Hutterer ---- - dix/getevents.c | 25 +------------------------ - 1 file changed, 1 insertion(+), 24 deletions(-) - -diff --git a/dix/getevents.c b/dix/getevents.c -index d8955969a..f83dac709 100644 ---- a/dix/getevents.c -+++ b/dix/getevents.c -@@ -331,9 +331,6 @@ rescaleValuatorAxis(double coord, AxisInfoPtr from, AxisInfoPtr to, - static void - updateSlaveDeviceCoords(DeviceIntPtr master, DeviceIntPtr pDev) - { -- int i; -- DeviceIntPtr lastSlave; -- - /* master->last.valuators[0]/[1] is in desktop-wide coords and the actual - * position of the pointer */ - pDev->last.valuators[0] = master->last.valuators[0]; -@@ -358,27 +355,7 @@ updateSlaveDeviceCoords(DeviceIntPtr master, DeviceIntPtr pDev) - screenInfo.height); - } - -- /* calculate the other axis as well based on info from the old -- * slave-device. If the old slave had less axes than this one, -- * last.valuators is reset to 0. -- */ -- if ((lastSlave = master->last.slave) && lastSlave->valuator) { -- for (i = 2; i < pDev->valuator->numAxes; i++) { -- if (i >= lastSlave->valuator->numAxes) { -- pDev->last.valuators[i] = 0; -- valuator_mask_set_double(pDev->last.scroll, i, 0); -- } -- else { -- double val = pDev->last.valuators[i]; -- -- val = rescaleValuatorAxis(val, lastSlave->valuator->axes + i, -- pDev->valuator->axes + i, 0, 0); -- pDev->last.valuators[i] = val; -- valuator_mask_set_double(pDev->last.scroll, i, val); -- } -- } -- } -- -+ /* other axes are left as-is */ - } - - /** --- -2.20.1 - diff --git a/0001-modesetting-Weaksauce-atomic-property-debugging.patch b/0001-modesetting-Weaksauce-atomic-property-debugging.patch deleted file mode 100644 index 7c9b9a0..0000000 --- a/0001-modesetting-Weaksauce-atomic-property-debugging.patch +++ /dev/null @@ -1,64 +0,0 @@ -From 6915752b2da77c29bf8c861a6d4f2383e667323b Mon Sep 17 00:00:00 2001 -From: Adam Jackson -Date: Fri, 5 Oct 2018 14:07:46 -0400 -Subject: [PATCH xserver 1/4] modesetting: Weaksauce atomic property debugging - -This would be a good idea to have around for troubleshooting purposes, -but this particular patch is Not Good. - -Signed-off-by: Adam Jackson ---- - hw/xfree86/drivers/modesetting/drmmode_display.c | 16 +++++++++++++--- - 1 file changed, 13 insertions(+), 3 deletions(-) - -diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c -index cb48aa46b..a8d989a24 100644 ---- a/hw/xfree86/drivers/modesetting/drmmode_display.c -+++ b/hw/xfree86/drivers/modesetting/drmmode_display.c -@@ -415,6 +415,13 @@ drmmode_ConvertToKMode(ScrnInfoPtr scrn, - drmModeModeInfo * kmode, DisplayModePtr mode); - - -+static int -+drmmodeatomicaddproperty(drmModeAtomicReqPtr req, uint32_t obj, uint32_t prop, uint64_t value) -+{ -+ ErrorF("Adding to %p: %x %x %lx\n", req, obj, prop, value); -+ return drmModeAtomicAddProperty(req, obj, prop, value); -+} -+ - static int - plane_add_prop(drmModeAtomicReq *req, drmmode_crtc_private_ptr drmmode_crtc, - enum drmmode_plane_property prop, uint64_t val) -@@ -425,7 +432,8 @@ plane_add_prop(drmModeAtomicReq *req, drmmode_crtc_private_ptr drmmode_crtc, - if (!info) - return -1; - -- ret = drmModeAtomicAddProperty(req, drmmode_crtc->plane_id, -+ ErrorF("Setting %s\n", info->name); -+ ret = drmmodeatomicaddproperty(req, drmmode_crtc->plane_id, - info->prop_id, val); - return (ret <= 0) ? -1 : 0; - } -@@ -467,7 +475,8 @@ crtc_add_prop(drmModeAtomicReq *req, drmmode_crtc_private_ptr drmmode_crtc, - if (!info) - return -1; - -- ret = drmModeAtomicAddProperty(req, drmmode_crtc->mode_crtc->crtc_id, -+ ErrorF("Setting %s\n", info->name); -+ ret = drmmodeatomicaddproperty(req, drmmode_crtc->mode_crtc->crtc_id, - info->prop_id, val); - return (ret <= 0) ? -1 : 0; - } -@@ -482,7 +491,8 @@ connector_add_prop(drmModeAtomicReq *req, drmmode_output_private_ptr drmmode_out - if (!info) - return -1; - -- ret = drmModeAtomicAddProperty(req, drmmode_output->output_id, -+ ErrorF("Setting %s\n", info->name); -+ ret = drmmodeatomicaddproperty(req, drmmode_output->output_id, - info->prop_id, val); - return (ret <= 0) ? -1 : 0; - } --- -2.20.1 - diff --git a/0001-xwayland-Delete-all-frame_callback_list-nodes-in-xwl.patch b/0001-xwayland-Delete-all-frame_callback_list-nodes-in-xwl.patch deleted file mode 100644 index 3dedc99..0000000 --- a/0001-xwayland-Delete-all-frame_callback_list-nodes-in-xwl.patch +++ /dev/null @@ -1,80 +0,0 @@ -From b259485975078087fe6bde2b9e1eccf4ae14120c Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Michel=20D=C3=A4nzer?= -Date: Tue, 17 Mar 2020 11:45:22 +0100 -Subject: [PATCH xserver] xwayland: Delete all frame_callback_list nodes in - xwl_unrealize_window - -We were only calling xwl_present_unrealize_window for the toplevel -window, but the list can contain entries from child windows as well, -in which case we were leaving dangling pointers to freed memory. - -Closes: https://gitlab.freedesktop.org/xorg/xserver/issues/1000 -Fixes: c5067feaeea1 "xwayland: Use single frame callback for Present - flips and normal updates" -Reviewed-by: Olivier Fourdan -Tested-by: Olivier Fourdan -(cherry picked from commit 5e91587302e85fd6f0e8d5ffbe30182e18c6913f) ---- - hw/xwayland/xwayland-present.c | 8 +------- - hw/xwayland/xwayland.c | 11 +++++++++-- - hw/xwayland/xwayland.h | 2 +- - 3 files changed, 11 insertions(+), 10 deletions(-) - -diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c -index c7c077aaa..5ba7dce08 100644 ---- a/hw/xwayland/xwayland-present.c -+++ b/hw/xwayland/xwayland-present.c -@@ -524,14 +524,8 @@ xwl_present_flips_stop(WindowPtr window) - } - - void --xwl_present_unrealize_window(WindowPtr window) -+xwl_present_unrealize_window(struct xwl_present_window *xwl_present_window) - { -- struct xwl_present_window *xwl_present_window = xwl_present_window_priv(window); -- -- if (!xwl_present_window || -- xorg_list_is_empty(&xwl_present_window->frame_callback_list)) -- return; -- - /* The pending frame callback may never be called, so drop it and shorten - * the frame timer interval. - */ -diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index 5fefa5923..ed9f2e3c2 100644 ---- a/hw/xwayland/xwayland.c -+++ b/hw/xwayland/xwayland.c -@@ -700,8 +700,15 @@ xwl_unrealize_window(WindowPtr window) - wl_callback_destroy(xwl_window->frame_callback); - - #ifdef GLAMOR_HAS_GBM -- if (xwl_screen->present) -- xwl_present_unrealize_window(window); -+ if (xwl_screen->present) { -+ struct xwl_present_window *xwl_present_window, *tmp; -+ -+ xorg_list_for_each_entry_safe(xwl_present_window, tmp, -+ &xwl_window->frame_callback_list, -+ frame_callback_list) { -+ xwl_present_unrealize_window(xwl_present_window); -+ } -+ } - #endif - - free(xwl_window); -diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h -index a12ec257b..daa719209 100644 ---- a/hw/xwayland/xwayland.h -+++ b/hw/xwayland/xwayland.h -@@ -456,7 +456,7 @@ void xwl_glamor_egl_make_current(struct xwl_screen *xwl_screen); - void xwl_present_frame_callback(struct xwl_present_window *xwl_present_window); - Bool xwl_present_init(ScreenPtr screen); - void xwl_present_cleanup(WindowPtr window); --void xwl_present_unrealize_window(WindowPtr window); -+void xwl_present_unrealize_window(struct xwl_present_window *xwl_present_window); - #endif /* GLAMOR_HAS_GBM */ - - #ifdef XV --- -2.25.1 - diff --git a/0001-xwayland-present-Destroy-sync_callback-in-xwl_presen.patch b/0001-xwayland-present-Destroy-sync_callback-in-xwl_presen.patch deleted file mode 100644 index 58c78d2..0000000 --- a/0001-xwayland-present-Destroy-sync_callback-in-xwl_presen.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 2e18eec6f03cc4d9d5bf62853c65d341b363f4b3 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Michel=20D=C3=A4nzer?= -Date: Fri, 8 Mar 2019 18:49:04 +0100 -Subject: [PATCH xserver] xwayland/present: Destroy sync_callback in - xwl_present_cleanup - -xwl_present_cleanup frees the struct xwl_present_window memory, -so if there's a pending callback, we have to destroy it to prevent -use-after-free in xwl_present_sync_callback. - -Should fix issue #645. - -Reviewed-by: Olivier Fourdan ---- - hw/xwayland/xwayland-present.c | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c -index 192f59a653..a1b3109cc2 100644 ---- a/hw/xwayland/xwayland-present.c -+++ b/hw/xwayland/xwayland-present.c -@@ -123,6 +123,11 @@ xwl_present_cleanup(WindowPtr window) - xwl_present_window->frame_callback = NULL; - } - -+ if (xwl_present_window->sync_callback) { -+ wl_callback_destroy(xwl_present_window->sync_callback); -+ xwl_present_window->sync_callback = NULL; -+ } -+ - /* Clear remaining events */ - xorg_list_for_each_entry_safe(event, tmp, &xwl_present_window->event_list, list) { - xorg_list_del(&event->list); --- -2.20.1 - diff --git a/0002-modesetting-Explicitly-include-mi.h.patch b/0002-modesetting-Explicitly-include-mi.h.patch deleted file mode 100644 index da71434..0000000 --- a/0002-modesetting-Explicitly-include-mi.h.patch +++ /dev/null @@ -1,29 +0,0 @@ -From c2ef88c4d3a551ff7646bfb86550cae32b02a510 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Michel=20D=C3=A4nzer?= -Date: Tue, 14 Jan 2020 09:23:34 +0100 -Subject: [PATCH xserver 02/22] modesetting: Explicitly #include "mi.h" - -For the miClearDrawable prototype. Apparently it doesn't get pulled in -for some build configurations, breaking the build. - -Reviewed-by: Kenneth Graunke -(cherry picked from commit a24a786fc8490fda08b15c3dab6fa6750f008ecb) ---- - hw/xfree86/drivers/modesetting/drmmode_display.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c -index e18cc379f..3874f6e21 100644 ---- a/hw/xfree86/drivers/modesetting/drmmode_display.c -+++ b/hw/xfree86/drivers/modesetting/drmmode_display.c -@@ -36,6 +36,7 @@ - #include "dumb_bo.h" - #include "xf86str.h" - #include "X11/Xatom.h" -+#include "mi.h" - #include "micmap.h" - #include "xf86cmap.h" - #include "xf86DDC.h" --- -2.24.1 - diff --git a/0002-modesetting-Propagate-more-failure-in-drmmode_set_mo.patch b/0002-modesetting-Propagate-more-failure-in-drmmode_set_mo.patch deleted file mode 100644 index 47195a1..0000000 --- a/0002-modesetting-Propagate-more-failure-in-drmmode_set_mo.patch +++ /dev/null @@ -1,31 +0,0 @@ -From e262c8ae0039710422c11ae254ddb4ae7e6fac02 Mon Sep 17 00:00:00 2001 -From: Adam Jackson -Date: Fri, 5 Oct 2018 14:03:54 -0400 -Subject: [PATCH xserver 2/4] modesetting: Propagate more failure in - drmmode_set_mode_major - -It's possible that actually setting the mode would fail even though the -check succeeded. We would throw away the error in this case, which would -probably make recovery a bit difficult. - -Signed-off-by: Adam Jackson ---- - hw/xfree86/drivers/modesetting/drmmode_display.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c -index a8d989a24..33f6cea3b 100644 ---- a/hw/xfree86/drivers/modesetting/drmmode_display.c -+++ b/hw/xfree86/drivers/modesetting/drmmode_display.c -@@ -1540,7 +1540,7 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode, - - /* if we only tested the mode previously, really set it now */ - if (can_test) -- drmmode_crtc_set_mode(crtc, FALSE); -+ ret = drmmode_crtc_set_mode(crtc, FALSE); - ms->pending_modeset = FALSE; - } - --- -2.20.1 - diff --git a/0002-xwayland-Add-wp_viewport-wayland-extension-support.patch b/0002-xwayland-Add-wp_viewport-wayland-extension-support.patch index bb0a3fd..441bf4c 100644 --- a/0002-xwayland-Add-wp_viewport-wayland-extension-support.patch +++ b/0002-xwayland-Add-wp_viewport-wayland-extension-support.patch @@ -1,7 +1,7 @@ -From 707554709a1f7c0f04ef55e72c4cc41ad8e904fd Mon Sep 17 00:00:00 2001 +From c0981af6a683266e3f2adfdd7d6539104f502233 Mon Sep 17 00:00:00 2001 From: Robert Mader Date: Mon, 22 Jan 2018 22:02:32 +0100 -Subject: [PATCH xserver 02/17] xwayland: Add wp_viewport wayland extension +Subject: [PATCH xserver 02/24] xwayland: Add wp_viewport wayland extension support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -18,6 +18,7 @@ xrandr for apps which want to change the resolution when going fullscreen. Reviewed-by: Olivier Fourdan Acked-by: Michel Dänzer Signed-off-by: Hans de Goede +(cherry picked from commit 47bba4625339592d08b375bcd8e51029c0000850) --- hw/xwayland/Makefile.am | 9 ++++++++- hw/xwayland/meson.build | 3 +++ @@ -80,10 +81,10 @@ index 36bf2133a..4a8d171bb 100644 xwayland_glamor = [] eglstream_srcs = [] diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index 5fefa5923..13b298f7f 100644 +index ed9f2e3c2..2084f2afb 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c -@@ -916,6 +916,9 @@ registry_global(void *data, struct wl_registry *registry, uint32_t id, +@@ -923,6 +923,9 @@ registry_global(void *data, struct wl_registry *registry, uint32_t id, wl_registry_bind(registry, id, &zxdg_output_manager_v1_interface, 1); xwl_screen_init_xdg_output(xwl_screen); } @@ -94,7 +95,7 @@ index 5fefa5923..13b298f7f 100644 else if (xwl_screen->glamor) { xwl_glamor_init_wl_registry(xwl_screen, registry, id, interface, diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h -index a12ec257b..042e107ce 100644 +index daa719209..f949ea157 100644 --- a/hw/xwayland/xwayland.h +++ b/hw/xwayland/xwayland.h @@ -48,6 +48,7 @@ @@ -114,5 +115,5 @@ index a12ec257b..042e107ce 100644 #define XWL_FORMAT_ARGB8888 (1 << 0) -- -2.24.1 +2.25.2 diff --git a/0003-Restrict-1x1-pixmap-filling-optimization-to-GXcopy.patch b/0003-Restrict-1x1-pixmap-filling-optimization-to-GXcopy.patch deleted file mode 100644 index f52ea66..0000000 --- a/0003-Restrict-1x1-pixmap-filling-optimization-to-GXcopy.patch +++ /dev/null @@ -1,38 +0,0 @@ -From d845ceae53bb425695e6a185b51ae1b432dd4672 Mon Sep 17 00:00:00 2001 -From: George Matsumura -Date: Thu, 6 Feb 2020 17:54:36 +0100 -Subject: [PATCH xserver 03/22] Restrict 1x1 pixmap filling optimization to - GXcopy -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -This restricts an optimization whereby the filling of 1x1 pixmaps -went around the driver-provided function to cases where the -source color is meant to be directly copied to the destination, -as opposed to other operations which should produce different -destination values than just the foreground color. - -Signed-off-by: George Matsumura -Reviewed-by: Michel Dänzer -(cherry picked from commit 83826075e59c0393c16d2a2482dc5c9f2fdf4564) ---- - exa/exa_accel.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/exa/exa_accel.c b/exa/exa_accel.c -index b26d5c804..41fcb129f 100644 ---- a/exa/exa_accel.c -+++ b/exa/exa_accel.c -@@ -1037,7 +1037,7 @@ exaFillRegionSolid(DrawablePtr pDrawable, RegionPtr pRegion, Pixel pixel, - if (pExaPixmap->pDamage && - pExaPixmap->sys_ptr && pDrawable->type == DRAWABLE_PIXMAP && - pDrawable->width == 1 && pDrawable->height == 1 && -- pDrawable->bitsPerPixel != 24) { -+ pDrawable->bitsPerPixel != 24 && alu == GXcopy) { - RegionPtr pending_damage = DamagePendingRegion(pExaPixmap->pDamage); - - switch (pDrawable->bitsPerPixel) { --- -2.24.1 - diff --git a/0003-modesetting-Factor-out-drmmode_target_output.patch b/0003-modesetting-Factor-out-drmmode_target_output.patch deleted file mode 100644 index fee4296..0000000 --- a/0003-modesetting-Factor-out-drmmode_target_output.patch +++ /dev/null @@ -1,64 +0,0 @@ -From e7f0961638818df8ee91edfae0378a02f7177e9f Mon Sep 17 00:00:00 2001 -From: Adam Jackson -Date: Fri, 5 Oct 2018 14:00:33 -0400 -Subject: [PATCH xserver 3/4] modesetting: Factor out drmmode_target_output - -Signed-off-by: Adam Jackson ---- - .../drivers/modesetting/drmmode_display.c | 26 ++++++++++++------- - 1 file changed, 16 insertions(+), 10 deletions(-) - -diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c -index 33f6cea3b..7924aa396 100644 ---- a/hw/xfree86/drivers/modesetting/drmmode_display.c -+++ b/hw/xfree86/drivers/modesetting/drmmode_display.c -@@ -757,6 +757,21 @@ drmmode_crtc_disable(xf86CrtcPtr crtc) - return ret; - } - -+static xf86OutputPtr -+drmmode_target_output(ScrnInfoPtr scrn, xf86CrtcPtr crtc) -+{ -+ xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); -+ int o; -+ -+ if (config->output[config->compat_output]->crtc == crtc) -+ return config->output[config->compat_output]; -+ -+ for (o = 0; o < config->num_output; o++) -+ if (config->output[o]->crtc == crtc) -+ return config->output[o]; -+ -+ return NULL; -+} - static int - drmmode_crtc_set_mode(xf86CrtcPtr crtc, Bool test_only) - { -@@ -3448,7 +3463,6 @@ drmmode_set_desired_modes(ScrnInfoPtr pScrn, drmmode_ptr drmmode, Bool set_hw) - xf86CrtcPtr crtc = config->crtc[c]; - drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; - xf86OutputPtr output = NULL; -- int o; - - /* Skip disabled CRTCs */ - if (!crtc->enabled) { -@@ -3459,15 +3473,7 @@ drmmode_set_desired_modes(ScrnInfoPtr pScrn, drmmode_ptr drmmode, Bool set_hw) - continue; - } - -- if (config->output[config->compat_output]->crtc == crtc) -- output = config->output[config->compat_output]; -- else { -- for (o = 0; o < config->num_output; o++) -- if (config->output[o]->crtc == crtc) { -- output = config->output[o]; -- break; -- } -- } -+ output = drmmode_target_output(pScrn, crtc); - /* paranoia */ - if (!output) - continue; --- -2.20.1 - diff --git a/0003-xwayland-Use-buffer_damage-instead-of-surface-damage.patch b/0003-xwayland-Use-buffer_damage-instead-of-surface-damage.patch index 4fd9b83..acd1a06 100644 --- a/0003-xwayland-Use-buffer_damage-instead-of-surface-damage.patch +++ b/0003-xwayland-Use-buffer_damage-instead-of-surface-damage.patch @@ -1,7 +1,7 @@ -From 4f06238e319c604638693f5eb452211210b14abf Mon Sep 17 00:00:00 2001 +From ce5eef7d33d7ba37cabee6b2bb020ed62abe6208 Mon Sep 17 00:00:00 2001 From: Robert Mader Date: Tue, 2 Jul 2019 12:03:12 +0200 -Subject: [PATCH xserver 03/17] xwayland: Use buffer_damage instead of surface +Subject: [PATCH xserver 03/24] xwayland: Use buffer_damage instead of surface damage if available MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -25,6 +25,7 @@ Changes by Hans de Goede : Reviewed-by: Olivier Fourdan Acked-by: Michel Dänzer Signed-off-by: Hans de Goede +(cherry picked from commit 7c6f17790d3aedb164481264b0f05a8a14103731) --- hw/xwayland/xwayland-cursor.c | 12 ++++++------ hw/xwayland/xwayland-present.c | 6 +++--- @@ -63,7 +64,7 @@ index 66720bcc0..cbc715061 100644 xwl_cursor->frame_cb = wl_surface_frame(xwl_cursor->surface); wl_callback_add_listener(xwl_cursor->frame_cb, &frame_listener, xwl_cursor); diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c -index c7c077aaa..e583708cb 100644 +index 5ba7dce08..58c32941d 100644 --- a/hw/xwayland/xwayland-present.c +++ b/hw/xwayland/xwayland-present.c @@ -495,9 +495,9 @@ xwl_present_flip(WindowPtr present_window, @@ -80,10 +81,10 @@ index c7c077aaa..e583708cb 100644 wl_surface_commit(xwl_window->surface); diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index 13b298f7f..87185e6f3 100644 +index 2084f2afb..942981834 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c -@@ -796,6 +796,16 @@ xwl_destroy_window(WindowPtr window) +@@ -803,6 +803,16 @@ xwl_destroy_window(WindowPtr window) return ret; } @@ -100,7 +101,7 @@ index 13b298f7f..87185e6f3 100644 static void xwl_window_post_damage(struct xwl_window *xwl_window) { -@@ -832,13 +842,15 @@ xwl_window_post_damage(struct xwl_window *xwl_window) +@@ -839,13 +849,15 @@ xwl_window_post_damage(struct xwl_window *xwl_window) */ if (RegionNumRects(region) > 256) { box = RegionExtents(region); @@ -121,7 +122,7 @@ index 13b298f7f..87185e6f3 100644 } xwl_window_create_frame_callback(xwl_window); -@@ -897,8 +909,13 @@ registry_global(void *data, struct wl_registry *registry, uint32_t id, +@@ -904,8 +916,13 @@ registry_global(void *data, struct wl_registry *registry, uint32_t id, struct xwl_screen *xwl_screen = data; if (strcmp(interface, "wl_compositor") == 0) { @@ -137,7 +138,7 @@ index 13b298f7f..87185e6f3 100644 else if (strcmp(interface, "wl_shm") == 0) { xwl_screen->shm = wl_registry_bind(registry, id, &wl_shm_interface, 1); diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h -index 042e107ce..07baa09e2 100644 +index f949ea157..fa78b5ab9 100644 --- a/hw/xwayland/xwayland.h +++ b/hw/xwayland/xwayland.h @@ -382,6 +382,9 @@ struct xwl_output { @@ -151,5 +152,5 @@ index 042e107ce..07baa09e2 100644 Bool xwl_screen_init_cursor(struct xwl_screen *xwl_screen); -- -2.24.1 +2.25.2 diff --git a/0004-Revert-dri2-Don-t-make-reference-to-noClientExceptio.patch b/0004-Revert-dri2-Don-t-make-reference-to-noClientExceptio.patch deleted file mode 100644 index 0576c94..0000000 --- a/0004-Revert-dri2-Don-t-make-reference-to-noClientExceptio.patch +++ /dev/null @@ -1,34 +0,0 @@ -From e5293f1c5d7b20d98ed4975dc29a6f88c8bc6a0d Mon Sep 17 00:00:00 2001 -From: Adam Jackson -Date: Thu, 6 Feb 2020 17:55:25 +0100 -Subject: [PATCH xserver 04/22] Revert "dri2: Don't make reference to - noClientException" - -It's true that the value would always be -1, if it's not zero, but it's -usually zero is the problem. As a result we return failure from -otherwise successful indirect GLX paths, which isn't very nice of us. - -This reverts commit 7d33ab0f8c7958b205076f71e4b47c24aace77fd. - -Fixes: https://gitlab.freedesktop.org/xorg/xserver/issues/211 -(cherry picked from commit e1fa3beb2fe2519e69f859f0acdc68e5a770de27) ---- - glx/glxdri2.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/glx/glxdri2.c b/glx/glxdri2.c -index d402ca860..822515a86 100644 ---- a/glx/glxdri2.c -+++ b/glx/glxdri2.c -@@ -295,7 +295,7 @@ __glXDRIcontextWait(__GLXcontext * baseContext, - } - - if (ret) { -- *error = -1; -+ *error = cl->client->noClientException; - return TRUE; - } - --- -2.24.1 - diff --git a/0004-modesetting-Use-atomic-instead-of-per-crtc-walks-whe.patch b/0004-modesetting-Use-atomic-instead-of-per-crtc-walks-whe.patch deleted file mode 100644 index 3cc6d8d..0000000 --- a/0004-modesetting-Use-atomic-instead-of-per-crtc-walks-whe.patch +++ /dev/null @@ -1,245 +0,0 @@ -From e4e389447c59c89d39a5a78a5f19cdfd22d7699c Mon Sep 17 00:00:00 2001 -From: Adam Jackson -Date: Fri, 5 Oct 2018 14:09:35 -0400 -Subject: [PATCH xserver 4/4] modesetting: Use atomic instead of per-crtc walks - where we can - -drmmode_set_desired_modes (reachable from CreateScreenResources, -EnterVT, etc.) currently works by doing ->set_mode_major on each CRTC. -This is silly, as atomic lets us configure every CRTC at once. It's also -fragile, because we're not trying very hard to ensure the intermediate -states are valid. - -This patch introduces drmmode_set_mode_atomic, which blasts the entire -RANDR state into the kernel in an... atomic... fashion. We change -drmmode_set_desired_modes and drmmode_xf86crtc_resize to use this -instead of walking each CRTC. We also change drmmode_crtc_set_mode to -use this, so that client RANDR requests (operating CRTC-at-a-time, since -RANDR doesn't have atomic changes yet) use the same code paths. - -Signed-off-by: Adam Jackson ---- - .../drivers/modesetting/drmmode_display.c | 179 +++++++++++------- - 1 file changed, 109 insertions(+), 70 deletions(-) - -diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c -index 7924aa396..020678155 100644 ---- a/hw/xfree86/drivers/modesetting/drmmode_display.c -+++ b/hw/xfree86/drivers/modesetting/drmmode_display.c -@@ -772,6 +772,96 @@ drmmode_target_output(ScrnInfoPtr scrn, xf86CrtcPtr crtc) - - return NULL; - } -+ -+static int -+drmmode_set_mode_atomic(ScrnInfoPtr scrn, modesettingPtr ms, Bool test_only) -+{ -+ xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); -+ drmModeAtomicReq *req = drmModeAtomicAlloc(); -+ uint32_t flags = DRM_MODE_ATOMIC_ALLOW_MODESET; -+ int i, j, ret = 0; -+ -+ if (!req) -+ return 1; -+ -+ for (i = 0; i < xf86_config->num_crtc; i++) { -+ xf86CrtcPtr crtc = xf86_config->crtc[i]; -+ drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; -+ Bool active = crtc->enabled; -+ uint32_t fb_id; -+ int x, y; -+ drmModeModeInfo kmode; -+ -+ if (active) { -+ drmmode_ConvertToKMode(crtc->scrn, &kmode, &crtc->desiredMode); -+ ret |= drm_mode_ensure_blob(crtc, kmode); -+ -+ /* XXX this probably doesn't belong here */ -+ if (!crtc->mode.HDisplay && crtc->desiredMode.HDisplay) -+ memcpy(&crtc->mode, &crtc->desiredMode, sizeof(crtc->mode)); -+ } -+ -+ ret |= !drmmode_crtc_get_fb_id(crtc, &fb_id, &x, &y); -+ ret |= crtc_add_prop(req, drmmode_crtc, -+ DRMMODE_CRTC_ACTIVE, active); -+ ret |= crtc_add_prop(req, drmmode_crtc, -+ DRMMODE_CRTC_MODE_ID, -+ active ? drmmode_crtc->current_mode->blob_id : 0); -+ ret |= plane_add_props(req, crtc, active ? fb_id : 0, x, y); -+ } -+ -+ for (i = 0; i < xf86_config->num_output; i++) { -+ xf86OutputPtr output = xf86_config->output[i]; -+ drmmode_output_private_ptr drmmode_output = output->driver_private; -+ drmmode_crtc_private_ptr drm_crtc = -+ output->crtc ? output->crtc->driver_private : NULL; -+ -+ if (drmmode_output->output_id == -1) -+ continue; -+ -+ ret |= connector_add_prop(req, drmmode_output, -+ DRMMODE_CONNECTOR_CRTC_ID, -+ drm_crtc ? drm_crtc->mode_crtc->crtc_id : 0); -+ } -+ -+ if (test_only) -+ flags |= DRM_MODE_ATOMIC_TEST_ONLY; -+ -+ if (ret == 0) -+ ret = drmModeAtomicCommit(ms->fd, req, flags, NULL); -+ -+ if (ret == 0 && !test_only) { -+ for (i = 0; i < xf86_config->num_crtc; i++) { -+ xf86CrtcPtr crtc = xf86_config->crtc[i]; -+ for (j = 0; i < xf86_config->num_output; i++) { -+ xf86OutputPtr output = xf86_config->output[j]; -+ drmmode_output_private_ptr drmmode_output = -+ output->driver_private; -+ -+ if (output->crtc == crtc) -+ drmmode_output->current_crtc = crtc; -+ else if (drmmode_output->current_crtc == crtc) -+ drmmode_output->current_crtc = NULL; -+ } -+ } -+ } -+ -+ if (ret == 0 && test_only) { -+ for (i = 0; i < xf86_config->num_crtc; i++) { -+ xf86CrtcPtr crtc = xf86_config->crtc[i]; -+ crtc->mode = crtc->desiredMode; -+ crtc->rotation = crtc->desiredRotation; -+ crtc->x = crtc->desiredX; -+ crtc->y = crtc->desiredY; -+ if (!xf86CrtcRotate(crtc)) -+ ret = 1; -+ } -+ } -+ -+ drmModeAtomicFree(req); -+ return ret; -+} -+ - static int - drmmode_crtc_set_mode(xf86CrtcPtr crtc, Bool test_only) - { -@@ -786,73 +876,12 @@ drmmode_crtc_set_mode(xf86CrtcPtr crtc, Bool test_only) - int x, y; - int i, ret = 0; - -+ if (ms->atomic_modeset) -+ return drmmode_set_mode_atomic(crtc->scrn, ms, test_only); -+ - if (!drmmode_crtc_get_fb_id(crtc, &fb_id, &x, &y)) - return 1; - -- if (ms->atomic_modeset) { -- drmModeAtomicReq *req = drmModeAtomicAlloc(); -- Bool active; -- uint32_t flags = DRM_MODE_ATOMIC_ALLOW_MODESET; -- -- if (!req) -- return 1; -- -- ret |= crtc_add_dpms_props(req, crtc, DPMSModeOn, &active); -- ret |= plane_add_props(req, crtc, active ? fb_id : 0, x, y); -- -- /* Orphaned CRTCs need to be disabled right now in atomic mode */ -- for (i = 0; i < xf86_config->num_crtc; i++) { -- xf86CrtcPtr other_crtc = xf86_config->crtc[i]; -- drmmode_crtc_private_ptr other_drmmode_crtc = other_crtc->driver_private; -- int lost_outputs = 0; -- int remaining_outputs = 0; -- int j; -- -- if (other_crtc == crtc) -- continue; -- -- for (j = 0; j < xf86_config->num_output; j++) { -- xf86OutputPtr output = xf86_config->output[j]; -- drmmode_output_private_ptr drmmode_output = output->driver_private; -- -- if (drmmode_output->current_crtc == other_crtc) { -- if (output->crtc == crtc) -- lost_outputs++; -- else -- remaining_outputs++; -- } -- } -- -- if (lost_outputs > 0 && remaining_outputs == 0) { -- ret |= crtc_add_prop(req, other_drmmode_crtc, -- DRMMODE_CRTC_ACTIVE, 0); -- ret |= crtc_add_prop(req, other_drmmode_crtc, -- DRMMODE_CRTC_MODE_ID, 0); -- } -- } -- -- if (test_only) -- flags |= DRM_MODE_ATOMIC_TEST_ONLY; -- -- if (ret == 0) -- ret = drmModeAtomicCommit(ms->fd, req, flags, NULL); -- -- if (ret == 0 && !test_only) { -- for (i = 0; i < xf86_config->num_output; i++) { -- xf86OutputPtr output = xf86_config->output[i]; -- drmmode_output_private_ptr drmmode_output = output->driver_private; -- -- if (output->crtc == crtc) -- drmmode_output->current_crtc = crtc; -- else if (drmmode_output->current_crtc == crtc) -- drmmode_output->current_crtc = NULL; -- } -- } -- -- drmModeAtomicFree(req); -- return ret; -- } -- - output_ids = calloc(sizeof(uint32_t), xf86_config->num_output); - if (!output_ids) - return -1; -@@ -3199,14 +3228,19 @@ drmmode_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height) - if (!drmmode_glamor_handle_new_screen_pixmap(drmmode)) - goto fail; - -- for (i = 0; i < xf86_config->num_crtc; i++) { -- xf86CrtcPtr crtc = xf86_config->crtc[i]; -+ if (ms->atomic_modeset) { -+ if (drmmode_set_mode_atomic(scrn, ms, FALSE)) -+ goto fail; -+ } else { -+ for (i = 0; i < xf86_config->num_crtc; i++) { -+ xf86CrtcPtr crtc = xf86_config->crtc[i]; - -- if (!crtc->enabled) -- continue; -+ if (!crtc->enabled) -+ continue; - -- drmmode_set_mode_major(crtc, &crtc->mode, -- crtc->rotation, crtc->x, crtc->y); -+ drmmode_set_mode_major(crtc, &crtc->mode, -+ crtc->rotation, crtc->x, crtc->y); -+ } - } - - if (old_fb_id) { -@@ -3457,8 +3491,13 @@ Bool - drmmode_set_desired_modes(ScrnInfoPtr pScrn, drmmode_ptr drmmode, Bool set_hw) - { - xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); -+ modesettingPtr ms = modesettingPTR(pScrn); - int c; - -+ /* drmmode_set_mode_atomic returns 0 on success, we return TRUE */ -+ if (ms->atomic_modeset) -+ return !drmmode_set_mode_atomic(pScrn, ms, /* test_only = */ !set_hw); -+ - for (c = 0; c < config->num_crtc; c++) { - xf86CrtcPtr crtc = config->crtc[c]; - drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; --- -2.20.1 - diff --git a/0004-xwayland-Add-fake-output-modes-to-xrandr-output-mode.patch b/0004-xwayland-Add-fake-output-modes-to-xrandr-output-mode.patch index a570437..4e05547 100644 --- a/0004-xwayland-Add-fake-output-modes-to-xrandr-output-mode.patch +++ b/0004-xwayland-Add-fake-output-modes-to-xrandr-output-mode.patch @@ -1,7 +1,7 @@ -From 1a24c9850144481cdc0ebf9bea5b3141ddc2c4b2 Mon Sep 17 00:00:00 2001 +From 6ff9bf9f005ce81b587d3b4345232c73fc12da53 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Wed, 26 Jun 2019 16:46:54 +0200 -Subject: [PATCH xserver 04/17] xwayland: Add fake output modes to xrandr +Subject: [PATCH xserver 04/24] xwayland: Add fake output modes to xrandr output mode lists MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -17,6 +17,7 @@ WPviewport to scale there pixmap to cover the entire output. Reviewed-by: Olivier Fourdan Acked-by: Michel Dänzer Signed-off-by: Hans de Goede +(cherry picked from commit 0d656d796071fb637e4969ea800855fe5d1c9728) --- hw/xwayland/xwayland-output.c | 112 ++++++++++++++++++++++++++++++++-- hw/xwayland/xwayland.c | 17 ++++++ @@ -162,7 +163,7 @@ index aa6f37864..2ccc3ca60 100644 xorg_list_for_each_entry(it, &xwl_screen->output_list, link) { /* output done event is sent even when some property diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index 87185e6f3..44eb0e042 100644 +index 942981834..3c50396f1 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c @@ -152,6 +152,23 @@ xwl_screen_get(ScreenPtr screen) @@ -190,7 +191,7 @@ index 87185e6f3..44eb0e042 100644 xwl_window_set_allow_commits(struct xwl_window *xwl_window, Bool allow, const char *debug_msg) diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h -index 07baa09e2..937977ccf 100644 +index fa78b5ab9..c66997f00 100644 --- a/hw/xwayland/xwayland.h +++ b/hw/xwayland/xwayland.h @@ -389,6 +389,7 @@ void xwl_surface_damage(struct xwl_screen *xwl_screen, @@ -202,5 +203,5 @@ index 07baa09e2..937977ccf 100644 void xwl_tablet_tool_set_cursor(struct xwl_tablet_tool *tool); void xwl_seat_set_cursor(struct xwl_seat *xwl_seat); -- -2.24.1 +2.25.2 diff --git a/0005-os-Ignore-dying-client-in-ResetCurrentRequest.patch b/0005-os-Ignore-dying-client-in-ResetCurrentRequest.patch deleted file mode 100644 index 99ed599..0000000 --- a/0005-os-Ignore-dying-client-in-ResetCurrentRequest.patch +++ /dev/null @@ -1,39 +0,0 @@ -From af2fd88b1019f63fe3ce871f9e99b3e1e4608b25 Mon Sep 17 00:00:00 2001 -From: Daniel Llewellyn -Date: Thu, 6 Feb 2020 17:56:12 +0100 -Subject: [PATCH xserver 05/22] os: Ignore dying client in ResetCurrentRequest - -You might as well, it's harmless. Better, some cleanup code (like DRI2 -swap wait) needs to run both normally and at client exit, so it -simplifies the callers to not need to check first. See 4308f5d3 for a -similar example. - -Props: @ajax (Adam Jackson) - -Fixes: xorg/xserver#211 - -Signed-off-by: Daniel Llewellyn -(cherry picked from commit 578371616e09364318c9fb2371a693d438b31b29) ---- - os/io.c | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/os/io.c b/os/io.c -index b099f0967..939f51743 100644 ---- a/os/io.c -+++ b/os/io.c -@@ -557,6 +557,11 @@ void - ResetCurrentRequest(ClientPtr client) - { - OsCommPtr oc = (OsCommPtr) client->osPrivate; -+ -+ /* ignore dying clients */ -+ if (!oc) -+ return; -+ - register ConnectionInputPtr oci = oc->input; - register xReq *request; - int gotnow, needed; --- -2.24.1 - diff --git a/0005-xwayland-Use-RandR-1.2-interface-rev-2.patch b/0005-xwayland-Use-RandR-1.2-interface-rev-2.patch index 4970c3d..8585f82 100644 --- a/0005-xwayland-Use-RandR-1.2-interface-rev-2.patch +++ b/0005-xwayland-Use-RandR-1.2-interface-rev-2.patch @@ -1,7 +1,7 @@ -From 10ea651c552c8a7d7a2bfab29b7def4f31f8af6c Mon Sep 17 00:00:00 2001 +From d837f7003d22c5e0d5bd05d41e872e7ee331dfa4 Mon Sep 17 00:00:00 2001 From: Robert Mader Date: Mon, 22 Jan 2018 17:57:38 +0100 -Subject: [PATCH xserver 05/17] xwayland: Use RandR 1.2 interface (rev 2) +Subject: [PATCH xserver 05/24] xwayland: Use RandR 1.2 interface (rev 2) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -23,6 +23,7 @@ was set. Reviewed-by: Olivier Fourdan Acked-by: Michel Dänzer Signed-off-by: Hans de Goede +(cherry picked from commit e89872f51aa834fa9d94a4ca4822f03b0341ab4f) --- hw/xwayland/xwayland-output.c | 81 +++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) @@ -134,5 +135,5 @@ index 2ccc3ca60..67e99bdab 100644 return TRUE; } -- -2.24.1 +2.25.2 diff --git a/0006-xfree86-modes-Bail-from-xf86RotateRedisplay-if-pScre.patch b/0006-xfree86-modes-Bail-from-xf86RotateRedisplay-if-pScre.patch deleted file mode 100644 index a5397d5..0000000 --- a/0006-xfree86-modes-Bail-from-xf86RotateRedisplay-if-pScre.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 1c3e51dabadbf65e7fdedbebbdcd19a85fb03e34 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Michel=20D=C3=A4nzer?= -Date: Thu, 6 Feb 2020 17:57:16 +0100 -Subject: [PATCH xserver 06/22] xfree86/modes: Bail from xf86RotateRedisplay if - pScreen->root is NULL - -Avoids a crash in xf86RotatePrepare -> DamageRegister during -CreateScreenResources if rotation or another transform is configured for -any connected RandR output in xorg.conf. The generic rotation/transform -code generally can't work without the root window currently. - -Closes: https://gitlab.freedesktop.org/xorg/xserver/issues/969 -Fixes: 094f42cdfe5d "xfree86/modes: Call xf86RotateRedisplay from - xf86CrtcRotate" -Acked-by: Olivier Fourdan -Reviewed-by: Adam Jackson -(cherry picked from commit 6a5e47c57d16de8b6a6a2636f3cbad1aebec32e2) ---- - hw/xfree86/modes/xf86Rotate.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/hw/xfree86/modes/xf86Rotate.c b/hw/xfree86/modes/xf86Rotate.c -index 05944cfcb..5415ed97c 100644 ---- a/hw/xfree86/modes/xf86Rotate.c -+++ b/hw/xfree86/modes/xf86Rotate.c -@@ -176,7 +176,7 @@ xf86RotateRedisplay(ScreenPtr pScreen) - DamagePtr damage = xf86_config->rotation_damage; - RegionPtr region; - -- if (!damage) -+ if (!damage || !pScreen->root) - return FALSE; - xf86RotatePrepare(pScreen); - region = DamageRegion(damage); --- -2.24.1 - diff --git a/0006-xwayland-Add-per-client-private-data.patch b/0006-xwayland-Add-per-client-private-data.patch index cad9ff4..fc4b473 100644 --- a/0006-xwayland-Add-per-client-private-data.patch +++ b/0006-xwayland-Add-per-client-private-data.patch @@ -1,7 +1,7 @@ -From 000b477eee11fddd0d4e323407aaa40afb818827 Mon Sep 17 00:00:00 2001 +From 80ca38c4428a499a795084dc696c390b707749b9 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Thu, 29 Aug 2019 22:45:12 +0200 -Subject: [PATCH xserver 06/17] xwayland: Add per client private data +Subject: [PATCH xserver 06/24] xwayland: Add per client private data MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -14,13 +14,14 @@ change emulation. Reviewed-by: Olivier Fourdan Acked-by: Michel Dänzer Signed-off-by: Hans de Goede +(cherry picked from commit 905cb8b9e27add5f49a45fe167a0005bf05218bc) --- hw/xwayland/xwayland.c | 14 ++++++++++++++ hw/xwayland/xwayland.h | 5 +++++ 2 files changed, 19 insertions(+) diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index 44eb0e042..7720baab8 100644 +index 3c50396f1..b0e37ceb9 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c @@ -135,11 +135,18 @@ ddxProcessArgument(int argc, char *argv[], int i) @@ -42,7 +43,7 @@ index 44eb0e042..7720baab8 100644 static struct xwl_window * xwl_window_get(WindowPtr window) { -@@ -1136,6 +1143,13 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) +@@ -1143,6 +1150,13 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) return FALSE; if (!dixRegisterPrivateKey(&xwl_damage_private_key, PRIVATE_WINDOW, 0)) return FALSE; @@ -57,21 +58,23 @@ index 44eb0e042..7720baab8 100644 dixSetPrivate(&pScreen->devPrivates, &xwl_screen_private_key, xwl_screen); xwl_screen->screen = pScreen; diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h -index 937977ccf..630b14e48 100644 +index c66997f00..593e92b64 100644 --- a/hw/xwayland/xwayland.h +++ b/hw/xwayland/xwayland.h -@@ -381,6 +381,11 @@ struct xwl_output { - - void xwl_window_create_frame_callback(struct xwl_window *xwl_window); +@@ -379,8 +379,13 @@ struct xwl_output { + Bool xdg_output_done; + }; +struct xwl_client { +}; + + void xwl_window_create_frame_callback(struct xwl_window *xwl_window); + +struct xwl_client *xwl_client_get(ClientPtr client); + void xwl_sync_events (struct xwl_screen *xwl_screen); void xwl_surface_damage(struct xwl_screen *xwl_screen, struct wl_surface *surface, -- -2.24.1 +2.25.2 diff --git a/0007-modesetting-remove-unnecessary-error-message-fix-zap.patch b/0007-modesetting-remove-unnecessary-error-message-fix-zap.patch deleted file mode 100644 index 0638020..0000000 --- a/0007-modesetting-remove-unnecessary-error-message-fix-zap.patch +++ /dev/null @@ -1,59 +0,0 @@ -From 948afd768398955f043fef8e14d7d154cea25f85 Mon Sep 17 00:00:00 2001 -From: Dave Airlie -Date: Thu, 6 Feb 2020 17:59:08 +0100 -Subject: [PATCH xserver 07/22] modesetting: remove unnecessary error message, - fix zaphod leases -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -I introduced this error with the MST hotplug code, but it can trigger -on zaphod setups, and is perfectly fine. There is no support for -MST/hotplug on zaphod setups currently, so we can just skip over -the dynamic connector handling here. However we shouldn't skip -over the lease handling so move it into the codepath. - -Fixes: 9257b1252da9 ("modesetting: add dynamic connector hotplug support (MST) (v3)") -Reviewed-by: Michel Dänzer -Signed-off-by: Dave Airlie -(cherry picked from commit 1cfdd1a96580733df3625bcea3384ffee3dc92df) ---- - hw/xfree86/drivers/modesetting/drmmode_display.c | 9 +++++---- - 1 file changed, 5 insertions(+), 4 deletions(-) - -diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c -index 3874f6e21..ae06fa357 100644 ---- a/hw/xfree86/drivers/modesetting/drmmode_display.c -+++ b/hw/xfree86/drivers/modesetting/drmmode_display.c -@@ -3677,7 +3677,7 @@ drmmode_handle_uevents(int fd, void *closure) - goto out; - - if (mode_res->count_crtcs != config->num_crtc) { -- ErrorF("number of CRTCs changed - failed to handle, %d vs %d\n", mode_res->count_crtcs, config->num_crtc); -+ /* this triggers with Zaphod mode where we don't currently support connector hotplug or MST. */ - goto out_free_res; - } - -@@ -3726,15 +3726,16 @@ drmmode_handle_uevents(int fd, void *closure) - drmmode_output_init(scrn, drmmode, mode_res, i, TRUE, 0); - } - -- /* Check to see if a lessee has disappeared */ -- drmmode_validate_leases(scrn); -- - if (changed) { - RRSetChanged(xf86ScrnToScreen(scrn)); - RRTellChanged(xf86ScrnToScreen(scrn)); - } - - out_free_res: -+ -+ /* Check to see if a lessee has disappeared */ -+ drmmode_validate_leases(scrn); -+ - drmModeFreeResources(mode_res); - out: - RRGetInfo(xf86ScrnToScreen(scrn), TRUE); --- -2.24.1 - diff --git a/0007-xwayland-Add-support-for-storing-per-client-per-outp.patch b/0007-xwayland-Add-support-for-storing-per-client-per-outp.patch index 223ee46..4d9b532 100644 --- a/0007-xwayland-Add-support-for-storing-per-client-per-outp.patch +++ b/0007-xwayland-Add-support-for-storing-per-client-per-outp.patch @@ -1,7 +1,7 @@ -From 7c9852e4e9e85000d6c8759b237ed9e9320dadfd Mon Sep 17 00:00:00 2001 +From 879fed575deea57462217fc31eb331db8d23637c Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Thu, 29 Aug 2019 23:04:36 +0200 -Subject: [PATCH xserver 07/17] xwayland: Add support for storing per client +Subject: [PATCH xserver 07/24] xwayland: Add support for storing per client per output emulated resolution MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -24,6 +24,7 @@ change emulation. Reviewed-by: Olivier Fourdan Acked-by: Michel Dänzer Signed-off-by: Hans de Goede +(cherry picked from commit aca0a588eb40a5e6669094a2ab7f71ca0ba06b16) --- hw/xwayland/xwayland-output.c | 67 +++++++++++++++++++++++++++++++++++ hw/xwayland/xwayland.h | 17 +++++++++ @@ -108,12 +109,12 @@ index 67e99bdab..82ff5db70 100644 const int32_t xwl_output_fake_modes[][2] = { /* 4:3 (1.33) */ diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h -index 630b14e48..7e6497b80 100644 +index 593e92b64..0e6f92e63 100644 --- a/hw/xwayland/xwayland.h +++ b/hw/xwayland/xwayland.h -@@ -381,7 +381,21 @@ struct xwl_output { - - void xwl_window_create_frame_callback(struct xwl_window *xwl_window); +@@ -379,7 +379,21 @@ struct xwl_output { + Bool xdg_output_done; + }; +/* Per client per output emulated randr/vidmode resolution info. */ +struct xwl_emulated_mode { @@ -132,7 +133,7 @@ index 630b14e48..7e6497b80 100644 + struct xwl_emulated_mode emulated_modes[XWL_CLIENT_MAX_EMULATED_MODES]; }; - struct xwl_client *xwl_client_get(ClientPtr client); + void xwl_window_create_frame_callback(struct xwl_window *xwl_window); @@ -425,6 +439,9 @@ void xwl_output_destroy(struct xwl_output *xwl_output); void xwl_output_remove(struct xwl_output *xwl_output); @@ -144,5 +145,5 @@ index 630b14e48..7e6497b80 100644 float VRefresh, Bool Reduced, Bool Interlaced); -- -2.24.1 +2.25.2 diff --git a/0008-glamor-Propagate-FBO-allocation-failure-for-picture-.patch b/0008-glamor-Propagate-FBO-allocation-failure-for-picture-.patch deleted file mode 100644 index 53d60f2..0000000 --- a/0008-glamor-Propagate-FBO-allocation-failure-for-picture-.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 428b5ce4da99a43bfa0c1933ec447f7feb3639a1 Mon Sep 17 00:00:00 2001 -From: Paul Kocialkowski -Date: Mon, 10 Feb 2020 10:19:18 +0100 -Subject: [PATCH xserver 08/22] glamor: Propagate FBO allocation failure for - picture to texture upload - -When uploading a picture to a texture, glamor_upload_picture_to_texture -calls glamor_pixmap_ensure_fbo to ensure that there is backing FBO. -The FBO will be allocated if the picture's drawable pixmap does not have -one already, which can fail when there is no GL memory left. - -glamor_upload_picture_to_texture checks that the call succeeded and will -enter the failure path if it did not. However, unlike many other -functions in glamor, this one has ret set to TRUE initially, so it needs -to be set to FALSE when a failure happens. - -Otherwise, the error is not propagated and the failure path return TRUE. -This leads to a fault when trying to access the FBO pointer later on. - -Signed-off-by: Paul Kocialkowski -(cherry picked from commit c98c7709c67d8ed6b7455ec700a49b58c396ec2c) ---- - glamor/glamor_picture.c | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/glamor/glamor_picture.c b/glamor/glamor_picture.c -index 84a33ad6a..685d8d618 100644 ---- a/glamor/glamor_picture.c -+++ b/glamor/glamor_picture.c -@@ -340,8 +340,10 @@ glamor_upload_picture_to_texture(PicturePtr picture) - else - iformat = format; - -- if (!glamor_pixmap_ensure_fbo(pixmap, iformat, GLAMOR_CREATE_FBO_NO_FBO)) -+ if (!glamor_pixmap_ensure_fbo(pixmap, iformat, GLAMOR_CREATE_FBO_NO_FBO)) { -+ ret = FALSE; - goto fail; -+ } - - glPixelStorei(GL_UNPACK_ALIGNMENT, 4); - --- -2.24.1 - diff --git a/0008-xwayland-Add-support-for-randr-resolution-change-emu.patch b/0008-xwayland-Add-support-for-randr-resolution-change-emu.patch index 0e7c5c6..3038555 100644 --- a/0008-xwayland-Add-support-for-randr-resolution-change-emu.patch +++ b/0008-xwayland-Add-support-for-randr-resolution-change-emu.patch @@ -1,7 +1,7 @@ -From 869e6f39165daeacdd9cbb3f2f0d1845a3af3360 Mon Sep 17 00:00:00 2001 +From a640802d33e0daccf2d4045ecb3e70cbf56bf0ac Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Tue, 2 Jul 2019 11:55:26 +0200 -Subject: [PATCH xserver 08/17] xwayland: Add support for randr-resolution +Subject: [PATCH xserver 08/24] xwayland: Add support for randr-resolution change emulation using viewport MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -28,6 +28,7 @@ disabling resolution emulation all together when going windowed. Reviewed-by: Olivier Fourdan Acked-by: Michel Dänzer Signed-off-by: Hans de Goede +(cherry picked from commit d99b9ff0f237d15e7eb507484493c73b393d5dba) --- hw/xwayland/xwayland-input.c | 5 + hw/xwayland/xwayland-output.c | 63 ++++++++++- @@ -142,7 +143,7 @@ index 82ff5db70..99ab1b288 100644 static Bool diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index 7720baab8..1466e1e11 100644 +index b0e37ceb9..1ab5b3a28 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c @@ -176,6 +176,23 @@ xwl_screen_has_resolution_change_emulation(struct xwl_screen *xwl_screen) @@ -350,7 +351,7 @@ index 7720baab8..1466e1e11 100644 unregister_damage(window); if (xwl_window->frame_callback) -@@ -760,6 +928,33 @@ xwl_set_window_pixmap(WindowPtr window, +@@ -767,6 +935,33 @@ xwl_set_window_pixmap(WindowPtr window, ensure_surface_for_window(window); } @@ -384,7 +385,7 @@ index 7720baab8..1466e1e11 100644 static void frame_callback(void *data, struct wl_callback *callback, -@@ -1211,6 +1406,7 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) +@@ -1218,6 +1413,7 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) xorg_list_init(&xwl_screen->output_list); xorg_list_init(&xwl_screen->seat_list); xorg_list_init(&xwl_screen->damage_window_list); @@ -392,7 +393,7 @@ index 7720baab8..1466e1e11 100644 xwl_screen->depth = 24; xwl_screen->display = wl_display_connect(NULL); -@@ -1309,6 +1505,9 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) +@@ -1316,6 +1512,9 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) xwl_screen->CloseScreen = pScreen->CloseScreen; pScreen->CloseScreen = xwl_close_screen; @@ -403,7 +404,7 @@ index 7720baab8..1466e1e11 100644 xwl_screen->SetWindowPixmap = pScreen->SetWindowPixmap; pScreen->SetWindowPixmap = xwl_set_window_pixmap; diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h -index 7e6497b80..56e753306 100644 +index 0e6f92e63..9adf3af76 100644 --- a/hw/xwayland/xwayland.h +++ b/hw/xwayland/xwayland.h @@ -135,10 +135,12 @@ struct xwl_screen { @@ -457,5 +458,5 @@ index 7e6497b80..56e753306 100644 float VRefresh, Bool Reduced, Bool Interlaced); -- -2.24.1 +2.25.2 diff --git a/0009-glamor-Error-out-on-out-of-memory-when-allocating-PB.patch b/0009-glamor-Error-out-on-out-of-memory-when-allocating-PB.patch deleted file mode 100644 index 2ed84f9..0000000 --- a/0009-glamor-Error-out-on-out-of-memory-when-allocating-PB.patch +++ /dev/null @@ -1,66 +0,0 @@ -From a7b165d994d74131778a5a9bcffec957f1d1cacb Mon Sep 17 00:00:00 2001 -From: Paul Kocialkowski -Date: Mon, 10 Feb 2020 10:20:04 +0100 -Subject: [PATCH xserver 09/22] glamor: Error out on out-of-memory when - allocating PBO for FBO access - -Packed buffer allocation (which happens at glBufferData time with the -buffer bound) can fail when there is no GL memory left. - -Pick up the error when it happens, print a proper error message, do -some cleanup and bail. - -Signed-off-by: Paul Kocialkowski -(cherry picked from commit bc2e12239f86e5a4acd220744f42eb83ba55d328) ---- - glamor/glamor_prepare.c | 17 +++++++++++++++++ - glamor/glamor_priv.h | 1 + - 2 files changed, 18 insertions(+) - -diff --git a/glamor/glamor_prepare.c b/glamor/glamor_prepare.c -index 5a73e6c7d..6b35936fc 100644 ---- a/glamor/glamor_prepare.c -+++ b/glamor/glamor_prepare.c -@@ -88,10 +88,27 @@ glamor_prep_pixmap_box(PixmapPtr pixmap, glamor_access_t access, BoxPtr box) - - gl_usage = GL_STREAM_READ; - -+ glamor_priv->suppress_gl_out_of_memory_logging = true; -+ - glBindBuffer(GL_PIXEL_PACK_BUFFER, priv->pbo); - glBufferData(GL_PIXEL_PACK_BUFFER, - pixmap->devKind * pixmap->drawable.height, NULL, - gl_usage); -+ -+ glamor_priv->suppress_gl_out_of_memory_logging = false; -+ -+ if (glGetError() == GL_OUT_OF_MEMORY) { -+ if (!glamor_priv->logged_any_pbo_allocation_failure) { -+ LogMessageVerb(X_WARNING, 0, "glamor: Failed to allocate %d " -+ "bytes PBO due to GL_OUT_OF_MEMORY.\n", -+ pixmap->devKind * pixmap->drawable.height); -+ glamor_priv->logged_any_pbo_allocation_failure = true; -+ } -+ glBindBuffer(GL_PIXEL_PACK_BUFFER, 0); -+ glDeleteBuffers(1, &priv->pbo); -+ priv->pbo = 0; -+ return FALSE; -+ } - } else { - pixmap->devPrivate.ptr = xallocarray(pixmap->devKind, - pixmap->drawable.height); -diff --git a/glamor/glamor_priv.h b/glamor/glamor_priv.h -index 661c11d90..1686ef5a4 100644 ---- a/glamor/glamor_priv.h -+++ b/glamor/glamor_priv.h -@@ -289,6 +289,7 @@ typedef struct glamor_screen_private { - - Bool suppress_gl_out_of_memory_logging; - Bool logged_any_fbo_allocation_failure; -+ Bool logged_any_pbo_allocation_failure; - - /* xv */ - glamor_program xv_prog; --- -2.24.1 - diff --git a/0009-xwayland-Add-xwlRRModeToDisplayMode-helper-function.patch b/0009-xwayland-Add-xwlRRModeToDisplayMode-helper-function.patch index 9c17c41..403f950 100644 --- a/0009-xwayland-Add-xwlRRModeToDisplayMode-helper-function.patch +++ b/0009-xwayland-Add-xwlRRModeToDisplayMode-helper-function.patch @@ -1,7 +1,7 @@ -From 3367f9a40c56b48b4945d8529934ef0ac8c395f3 Mon Sep 17 00:00:00 2001 +From 62e8b2ff7471f1a48b8bac9f41cceecea4931c03 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 8 Jul 2019 14:00:27 +0200 -Subject: [PATCH xserver 09/17] xwayland: Add xwlRRModeToDisplayMode() helper +Subject: [PATCH xserver 09/24] xwayland: Add xwlRRModeToDisplayMode() helper function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -14,6 +14,7 @@ Wayland viewport extension. Reviewed-by: Olivier Fourdan Acked-by: Michel Dänzer Signed-off-by: Hans de Goede +(cherry picked from commit 43c80078126f6f33c6ab7d3cf4668733bde03366) --- hw/xwayland/xwayland-vidmode.c | 51 +++++++++++++++++++--------------- 1 file changed, 28 insertions(+), 23 deletions(-) @@ -96,5 +97,5 @@ index 0bcd11401..a59c9f6a9 100644 return TRUE; } -- -2.24.1 +2.25.2 diff --git a/0010-glamor-Propagate-glamor_prepare_access-failures-in-c.patch b/0010-glamor-Propagate-glamor_prepare_access-failures-in-c.patch deleted file mode 100644 index 408abcb..0000000 --- a/0010-glamor-Propagate-glamor_prepare_access-failures-in-c.patch +++ /dev/null @@ -1,45 +0,0 @@ -From ca034c2f2cfff8e49b816b8ecbaa96215b796e36 Mon Sep 17 00:00:00 2001 -From: Paul Kocialkowski -Date: Mon, 10 Feb 2020 10:20:30 +0100 -Subject: [PATCH xserver 10/22] glamor: Propagate glamor_prepare_access - failures in copy helpers - -glamor_prepare_access can fail for a few reasons, especially when -failing to allocate a PBO buffer. Take this in account and bail in -the copy helpers that call the helper when a failure happens. - -Signed-off-by: Paul Kocialkowski -(cherry picked from commit de6b3fac1f26075ce915006c914c4a4755617715) ---- - glamor/glamor_copy.c | 8 ++++++-- - 1 file changed, 6 insertions(+), 2 deletions(-) - -diff --git a/glamor/glamor_copy.c b/glamor/glamor_copy.c -index e050c0220..1ab2be6c0 100644 ---- a/glamor/glamor_copy.c -+++ b/glamor/glamor_copy.c -@@ -221,7 +221,9 @@ glamor_copy_cpu_fbo(DrawablePtr src, - goto bail; - - glamor_make_current(glamor_priv); -- glamor_prepare_access(src, GLAMOR_ACCESS_RO); -+ -+ if (!glamor_prepare_access(src, GLAMOR_ACCESS_RO)) -+ goto bail; - - glamor_get_drawable_deltas(dst, dst_pixmap, &dst_xoff, &dst_yoff); - -@@ -309,7 +311,9 @@ glamor_copy_fbo_cpu(DrawablePtr src, - goto bail; - - glamor_make_current(glamor_priv); -- glamor_prepare_access(dst, GLAMOR_ACCESS_RW); -+ -+ if (!glamor_prepare_access(dst, GLAMOR_ACCESS_RW)) -+ goto bail; - - glamor_get_drawable_deltas(src, src_pixmap, &src_xoff, &src_yoff); - --- -2.24.1 - diff --git a/0010-xwayland-Add-xwlVidModeGetCurrentRRMode-helper-to-th.patch b/0010-xwayland-Add-xwlVidModeGetCurrentRRMode-helper-to-th.patch index 38d754a..7fa5a19 100644 --- a/0010-xwayland-Add-xwlVidModeGetCurrentRRMode-helper-to-th.patch +++ b/0010-xwayland-Add-xwlVidModeGetCurrentRRMode-helper-to-th.patch @@ -1,7 +1,7 @@ -From 9da07f246b50292d24347608d5bba92efd1756af Mon Sep 17 00:00:00 2001 +From 3ecabb250841ff0423744cd2291aaebf87b4239a Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 8 Jul 2019 18:35:27 +0200 -Subject: [PATCH xserver 10/17] xwayland: Add xwlVidModeGetCurrentRRMode helper +Subject: [PATCH xserver 10/24] xwayland: Add xwlVidModeGetCurrentRRMode helper to the vidmode code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -24,6 +24,7 @@ support to Xwayland's XF86 vidmode extension emulation. Reviewed-by: Olivier Fourdan Acked-by: Michel Dänzer Signed-off-by: Hans de Goede +(cherry picked from commit bcad1b813a04b9f3ff225f57a4baad09bd6315b9) --- hw/xwayland/xwayland-vidmode.c | 90 +++++++++++++++++++++------------- 1 file changed, 56 insertions(+), 34 deletions(-) @@ -188,5 +189,5 @@ index a59c9f6a9..e9aea7269 100644 static void -- -2.24.1 +2.25.2 diff --git a/0011-glamor-Fallback-to-system-memory-for-RW-PBO-buffer-a.patch b/0011-glamor-Fallback-to-system-memory-for-RW-PBO-buffer-a.patch deleted file mode 100644 index d147e92..0000000 --- a/0011-glamor-Fallback-to-system-memory-for-RW-PBO-buffer-a.patch +++ /dev/null @@ -1,67 +0,0 @@ -From d2a6c8708ca4f27c8d9aade6db2c4e7f2d8c624f Mon Sep 17 00:00:00 2001 -From: Paul Kocialkowski -Date: Mon, 10 Feb 2020 10:21:02 +0100 -Subject: [PATCH xserver 11/22] glamor: Fallback to system memory for RW PBO - buffer allocation - -We currently support two modes of operation for RW PBO buffers: one -that allocates a pack buffer with GL memory and one that uses system -memory when the former is not supported. - -Since allocation with system memory is less likely to fail, add a -fallback to system memory when GL memory failed instead of bailing -out. - -Signed-off-by: Paul Kocialkowski -(cherry picked from commit 8c4e8d9eff03cefc987f13c900b0a47403946127) ---- - glamor/glamor_prepare.c | 11 ++++++----- - 1 file changed, 6 insertions(+), 5 deletions(-) - -diff --git a/glamor/glamor_prepare.c b/glamor/glamor_prepare.c -index 6b35936fc..c1a611f9a 100644 ---- a/glamor/glamor_prepare.c -+++ b/glamor/glamor_prepare.c -@@ -107,9 +107,10 @@ glamor_prep_pixmap_box(PixmapPtr pixmap, glamor_access_t access, BoxPtr box) - glBindBuffer(GL_PIXEL_PACK_BUFFER, 0); - glDeleteBuffers(1, &priv->pbo); - priv->pbo = 0; -- return FALSE; - } -- } else { -+ } -+ -+ if (!priv->pbo) { - pixmap->devPrivate.ptr = xallocarray(pixmap->devKind, - pixmap->drawable.height); - if (!pixmap->devPrivate.ptr) -@@ -123,7 +124,7 @@ glamor_prep_pixmap_box(PixmapPtr pixmap, glamor_access_t access, BoxPtr box) - - RegionUninit(®ion); - -- if (glamor_priv->has_rw_pbo) { -+ if (priv->pbo) { - if (priv->map_access == GLAMOR_ACCESS_RW) - gl_access = GL_READ_WRITE; - else -@@ -155,7 +156,7 @@ glamor_fini_pixmap(PixmapPtr pixmap) - if (!priv->prepared) - return; - -- if (glamor_priv->has_rw_pbo) { -+ if (priv->pbo) { - glBindBuffer(GL_PIXEL_UNPACK_BUFFER, priv->pbo); - glUnmapBuffer(GL_PIXEL_UNPACK_BUFFER); - pixmap->devPrivate.ptr = NULL; -@@ -170,7 +171,7 @@ glamor_fini_pixmap(PixmapPtr pixmap) - - RegionUninit(&priv->prepare_region); - -- if (glamor_priv->has_rw_pbo) { -+ if (priv->pbo) { - glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0); - glDeleteBuffers(1, &priv->pbo); - priv->pbo = 0; --- -2.24.1 - diff --git a/0011-xwayland-Add-vidmode-mode-changing-emulation-support.patch b/0011-xwayland-Add-vidmode-mode-changing-emulation-support.patch index 28f1ba8..cf706e3 100644 --- a/0011-xwayland-Add-vidmode-mode-changing-emulation-support.patch +++ b/0011-xwayland-Add-vidmode-mode-changing-emulation-support.patch @@ -1,7 +1,7 @@ -From 9b119998db0d5e28e912d82de5b04674200f341b Mon Sep 17 00:00:00 2001 +From 86e32a877ded8d67ec26ed2bcc06bd80ec2a5915 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Tue, 9 Jul 2019 09:31:13 +0200 -Subject: [PATCH xserver 11/17] xwayland: Add vidmode mode changing emulation +Subject: [PATCH xserver 11/24] xwayland: Add vidmode mode changing emulation support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -13,6 +13,7 @@ change the resolution when going fullscreen. Reviewed-by: Olivier Fourdan Acked-by: Michel Dänzer Signed-off-by: Hans de Goede +(cherry picked from commit 38de6260816674b5430144cc38a8a27d93d1bf19) --- hw/xwayland/xwayland-vidmode.c | 130 ++++++++++++++++++++++----------- 1 file changed, 86 insertions(+), 44 deletions(-) @@ -231,5 +232,5 @@ index e9aea7269..56aac693a 100644 static Bool -- -2.24.1 +2.25.2 diff --git a/0012-glamor-Fix-a-compiler-warning-since-the-recent-OOM-f.patch b/0012-glamor-Fix-a-compiler-warning-since-the-recent-OOM-f.patch deleted file mode 100644 index a454532..0000000 --- a/0012-glamor-Fix-a-compiler-warning-since-the-recent-OOM-f.patch +++ /dev/null @@ -1,28 +0,0 @@ -From d44bbb4710961651dcf10701bc562f1f01509010 Mon Sep 17 00:00:00 2001 -From: Eric Anholt -Date: Mon, 10 Feb 2020 10:22:34 +0100 -Subject: [PATCH xserver 12/22] glamor: Fix a compiler warning since the recent - OOM fixes. - -Signed-off-by: Eric Anholt -(cherry picked from commit 3b26b90cb787a14fa5f8bb2033eab8ab6562a9a5) ---- - glamor/glamor_prepare.c | 2 -- - 1 file changed, 2 deletions(-) - -diff --git a/glamor/glamor_prepare.c b/glamor/glamor_prepare.c -index c1a611f9a..835c4ebea 100644 ---- a/glamor/glamor_prepare.c -+++ b/glamor/glamor_prepare.c -@@ -146,8 +146,6 @@ glamor_prep_pixmap_box(PixmapPtr pixmap, glamor_access_t access, BoxPtr box) - static void - glamor_fini_pixmap(PixmapPtr pixmap) - { -- ScreenPtr screen = pixmap->drawable.pScreen; -- glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); - glamor_pixmap_private *priv = glamor_get_pixmap_private(pixmap); - - if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(priv)) --- -2.24.1 - diff --git a/0012-xwayland-xwl_window_should_enable_viewport-Add-extra.patch b/0012-xwayland-xwl_window_should_enable_viewport-Add-extra.patch index 2b63f06..573ab8e 100644 --- a/0012-xwayland-xwl_window_should_enable_viewport-Add-extra.patch +++ b/0012-xwayland-xwl_window_should_enable_viewport-Add-extra.patch @@ -1,7 +1,7 @@ -From fc9ccf1bd1dc3dadbde022bf7f353dfae93d089e Mon Sep 17 00:00:00 2001 +From fd95c9a52e35e994e140a925cfc01587257d4511 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 26 Aug 2019 12:26:34 +0200 -Subject: [PATCH xserver 12/17] xwayland: xwl_window_should_enable_viewport: +Subject: [PATCH xserver 12/24] xwayland: xwl_window_should_enable_viewport: Add extra test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -19,12 +19,13 @@ Xwayland. Reviewed-by: Olivier Fourdan Acked-by: Michel Dänzer Signed-off-by: Hans de Goede +(cherry picked from commit 0c305dbff8a44f3fa3d6aefd372a967029a7a527) --- hw/xwayland/xwayland.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index 1466e1e11..19a348255 100644 +index 1ab5b3a28..85036adfe 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c @@ -649,6 +649,23 @@ xwl_window_should_enable_viewport(struct xwl_window *xwl_window, @@ -52,5 +53,5 @@ index 1466e1e11..19a348255 100644 } -- -2.24.1 +2.25.2 diff --git a/0013-modesetting-Disable-atomic-support-by-default.patch b/0013-modesetting-Disable-atomic-support-by-default.patch deleted file mode 100644 index a3ba60a..0000000 --- a/0013-modesetting-Disable-atomic-support-by-default.patch +++ /dev/null @@ -1,69 +0,0 @@ -From 1ba5e528d52ed9d7d67eb45c5d3e04b6f5d22b05 Mon Sep 17 00:00:00 2001 -From: Maarten Lankhorst -Date: Thu, 25 Apr 2019 11:46:41 +0200 -Subject: [PATCH xserver 13/22] modesetting: Disable atomic support by default - -The atomic driver has issues with modesetting when stealing -connectors from a different crtc, a black screen when doing rotation -on a different crtc, and in general is just a mapping of the legacy -helpers to atomic. This is already done in the kernel, so just -fallback to legacy by default until this is fixed. - -Please backport to 1.20, as we don't want to enable it for everyone -there. It breaks for existing users. - -The fixes to make the xserver more atomic have been pending on the -mailing list for ages. - -Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=110375 -Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=110030 -References: https://gitlab.freedesktop.org/xorg/xserver/merge_requests/36/commits -Signed-off-by: Maarten Lankhorst -(cherry picked from commit f0d78b47ac49977a6007f5fe081f00c6eb19a12e) ---- - hw/xfree86/drivers/modesetting/driver.c | 9 +++++++-- - hw/xfree86/drivers/modesetting/driver.h | 1 + - 2 files changed, 8 insertions(+), 2 deletions(-) - -diff --git a/hw/xfree86/drivers/modesetting/driver.c b/hw/xfree86/drivers/modesetting/driver.c -index 9beb51f36..0612a08f6 100644 ---- a/hw/xfree86/drivers/modesetting/driver.c -+++ b/hw/xfree86/drivers/modesetting/driver.c -@@ -131,6 +131,7 @@ static const OptionInfoRec Options[] = { - {OPTION_PAGEFLIP, "PageFlip", OPTV_BOOLEAN, {0}, FALSE}, - {OPTION_ZAPHOD_HEADS, "ZaphodHeads", OPTV_STRING, {0}, FALSE}, - {OPTION_DOUBLE_SHADOW, "DoubleShadow", OPTV_BOOLEAN, {0}, FALSE}, -+ {OPTION_ATOMIC, "Atomic", OPTV_BOOLEAN, {0}, FALSE}, - {-1, NULL, OPTV_NONE, {0}, FALSE} - }; - -@@ -1038,8 +1039,12 @@ PreInit(ScrnInfoPtr pScrn, int flags) - #endif - } - -- ret = drmSetClientCap(ms->fd, DRM_CLIENT_CAP_ATOMIC, 1); -- ms->atomic_modeset = (ret == 0); -+ if (xf86ReturnOptValBool(ms->drmmode.Options, OPTION_ATOMIC, FALSE)) { -+ ret = drmSetClientCap(ms->fd, DRM_CLIENT_CAP_ATOMIC, 1); -+ ms->atomic_modeset = (ret == 0); -+ } else { -+ ms->atomic_modeset = FALSE; -+ } - - ms->kms_has_modifiers = FALSE; - ret = drmGetCap(ms->fd, DRM_CAP_ADDFB2_MODIFIERS, &value); -diff --git a/hw/xfree86/drivers/modesetting/driver.h b/hw/xfree86/drivers/modesetting/driver.h -index 493280c1d..8bfb2fc1a 100644 ---- a/hw/xfree86/drivers/modesetting/driver.h -+++ b/hw/xfree86/drivers/modesetting/driver.h -@@ -51,6 +51,7 @@ typedef enum { - OPTION_PAGEFLIP, - OPTION_ZAPHOD_HEADS, - OPTION_DOUBLE_SHADOW, -+ OPTION_ATOMIC, - } modesettingOpts; - - typedef struct --- -2.24.1 - diff --git a/0013-xwayland-Set-_XWAYLAND_RANDR_EMU_MONITOR_RECTS-prope.patch b/0013-xwayland-Set-_XWAYLAND_RANDR_EMU_MONITOR_RECTS-prope.patch index c70f2d5..cfcfd4c 100644 --- a/0013-xwayland-Set-_XWAYLAND_RANDR_EMU_MONITOR_RECTS-prope.patch +++ b/0013-xwayland-Set-_XWAYLAND_RANDR_EMU_MONITOR_RECTS-prope.patch @@ -1,7 +1,7 @@ -From 2fd8751593ed1268e859a9a19f0eea3820ce5f69 Mon Sep 17 00:00:00 2001 +From dda4a8b2f672eb5791f39222dd0996e07b416eb7 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 2 Sep 2019 17:32:45 +0200 -Subject: [PATCH xserver 13/17] xwayland: Set _XWAYLAND_RANDR_EMU_MONITOR_RECTS +Subject: [PATCH xserver 13/24] xwayland: Set _XWAYLAND_RANDR_EMU_MONITOR_RECTS property for resolution emulation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -29,6 +29,7 @@ be equal to the new resolution. Reviewed-by: Olivier Fourdan Acked-by: Michel Dänzer Signed-off-by: Hans de Goede +(cherry picked from commit 5315f988d9f175e4850f4259f691a68d95ce7ac2) --- hw/xwayland/xwayland-output.c | 77 +++++++++++++++++++++++++++++++++++ hw/xwayland/xwayland.c | 23 +++++++++++ @@ -138,7 +139,7 @@ index 99ab1b288..20c254962 100644 static void diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index 19a348255..1840ccbfb 100644 +index 85036adfe..e43f3de96 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c @@ -690,6 +690,27 @@ xwl_screen_check_resolution_change_emulation(struct xwl_screen *xwl_screen) @@ -179,7 +180,7 @@ index 19a348255..1840ccbfb 100644 } diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h -index 56e753306..ef1138348 100644 +index 9adf3af76..eb8c4bd70 100644 --- a/hw/xwayland/xwayland.h +++ b/hw/xwayland/xwayland.h @@ -418,6 +418,7 @@ Bool xwl_screen_has_resolution_change_emulation(struct xwl_screen *xwl_screen); @@ -200,5 +201,5 @@ index 56e753306..ef1138348 100644 RRModePtr xwayland_cvt(int HDisplay, int VDisplay, float VRefresh, Bool Reduced, Bool Interlaced); -- -2.24.1 +2.25.2 diff --git a/0014-xwayland-Cache-client-id-for-the-window-manager-clie.patch b/0014-xwayland-Cache-client-id-for-the-window-manager-clie.patch new file mode 100644 index 0000000..08c605f --- /dev/null +++ b/0014-xwayland-Cache-client-id-for-the-window-manager-clie.patch @@ -0,0 +1,137 @@ +From aa0f9ba1aa3f12f7e65ed64ac03114f27c8bff1f Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Mon, 27 Jan 2020 11:08:00 +0100 +Subject: [PATCH xserver 14/24] xwayland: Cache client-id for the + window-manager client + +Instead of iterating over all clients which are listening for events on the +root window and checking if the client we are dealing with is the one +listening for SubstructureRedirectMask | ResizeRedirectMask events and thus +is the window-manager, cache the client-id of the window-manager in +xwl_screen and use that when checking if a client is the window-manager. + +Note that we cache and compare the client-id rather then the ClienPtr, +this saves reading the ClientPtr from the global clients array when doing +the comparison. + +Suggested-by: Olivier Fourdan +Acked-by: Olivier Fourdan +Signed-off-by: Hans de Goede +(cherry picked from commit ded89300c1dd541f59fe6e93c5c69d7fe7088244) +--- + hw/xwayland/xwayland.c | 48 ++++++++++++++++++++++++++++-------------- + hw/xwayland/xwayland.h | 2 ++ + 2 files changed, 34 insertions(+), 16 deletions(-) + +diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c +index e43f3de96..f4d433bca 100644 +--- a/hw/xwayland/xwayland.c ++++ b/hw/xwayland/xwayland.c +@@ -576,20 +576,11 @@ xwl_window_enable_viewport(struct xwl_window *xwl_window, + } + + static Bool +-xwl_screen_client_is_window_manager(struct xwl_screen *xwl_screen, +- ClientPtr client) ++window_is_wm_window(WindowPtr window) + { +- WindowPtr root = xwl_screen->screen->root; +- OtherClients *others; +- +- for (others = wOtherClients(root); others; others = others->next) { +- if (SameClient(others, client)) { +- if (others->mask & (SubstructureRedirectMask | ResizeRedirectMask)) +- return TRUE; +- } +- } ++ struct xwl_screen *xwl_screen = xwl_screen_get(window->drawable.pScreen); + +- return FALSE; ++ return CLIENT_ID(window->drawable.id) == xwl_screen->wm_client_id; + } + + static ClientPtr +@@ -603,7 +594,7 @@ xwl_window_get_owner(struct xwl_window *xwl_window) + * decoration window. In that case return the client of the + * first *and only* child of the toplevel (decoration) window. + */ +- if (xwl_screen_client_is_window_manager(xwl_window->xwl_screen, client)) { ++ if (window_is_wm_window(window)) { + if (window->firstChild && window->firstChild == window->lastChild) + return wClient(window->firstChild); + else +@@ -698,9 +689,7 @@ xwl_screen_check_resolution_change_emulation(struct xwl_screen *xwl_screen) + Bool + xwl_window_is_toplevel(WindowPtr window) + { +- struct xwl_screen *xwl_screen = xwl_screen_get(window->drawable.pScreen); +- +- if (xwl_screen_client_is_window_manager(xwl_screen, wClient(window))) ++ if (window_is_wm_window(window)) + return FALSE; + + /* CSD and override-redirect toplevel windows */ +@@ -975,6 +964,30 @@ xwl_set_window_pixmap(WindowPtr window, + ensure_surface_for_window(window); + } + ++static Bool ++xwl_change_window_attributes(WindowPtr window, unsigned long mask) ++{ ++ ScreenPtr screen = window->drawable.pScreen; ++ struct xwl_screen *xwl_screen = xwl_screen_get(screen); ++ OtherClients *others; ++ Bool ret; ++ ++ screen->ChangeWindowAttributes = xwl_screen->ChangeWindowAttributes; ++ ret = (*screen->ChangeWindowAttributes) (window, mask); ++ xwl_screen->ChangeWindowAttributes = screen->ChangeWindowAttributes; ++ screen->ChangeWindowAttributes = xwl_change_window_attributes; ++ ++ if (window != screen->root || !(mask & CWEventMask)) ++ return ret; ++ ++ for (others = wOtherClients(window); others; others = others->next) { ++ if (others->mask & (SubstructureRedirectMask | ResizeRedirectMask)) ++ xwl_screen->wm_client_id = CLIENT_ID(others->resource); ++ } ++ ++ return ret; ++} ++ + static void + xwl_resize_window(WindowPtr window, + int x, int y, +@@ -1552,6 +1565,9 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) + xwl_screen->CloseScreen = pScreen->CloseScreen; + pScreen->CloseScreen = xwl_close_screen; + ++ xwl_screen->ChangeWindowAttributes = pScreen->ChangeWindowAttributes; ++ pScreen->ChangeWindowAttributes = xwl_change_window_attributes; ++ + xwl_screen->ResizeWindow = pScreen->ResizeWindow; + pScreen->ResizeWindow = xwl_resize_window; + +diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h +index eb8c4bd70..126af8823 100644 +--- a/hw/xwayland/xwayland.h ++++ b/hw/xwayland/xwayland.h +@@ -118,6 +118,7 @@ struct xwl_screen { + int height; + int depth; + ScreenPtr screen; ++ int wm_client_id; + int expecting_event; + enum RootClipMode root_clip_mode; + +@@ -135,6 +136,7 @@ struct xwl_screen { + DestroyWindowProcPtr DestroyWindow; + XYToWindowProcPtr XYToWindow; + SetWindowPixmapProcPtr SetWindowPixmap; ++ ChangeWindowAttributesProcPtr ChangeWindowAttributes; + ResizeWindowProcPtr ResizeWindow; + + struct xorg_list output_list; +-- +2.25.2 + diff --git a/0014-xwayland-Split-up-xwl_screen_post_damage-into-two-ph.patch b/0014-xwayland-Split-up-xwl_screen_post_damage-into-two-ph.patch deleted file mode 100644 index 3c7eb02..0000000 --- a/0014-xwayland-Split-up-xwl_screen_post_damage-into-two-ph.patch +++ /dev/null @@ -1,64 +0,0 @@ -From a93bce6bfc6c610676a7fbc76639854c5553cb2c Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Michel=20D=C3=A4nzer?= -Date: Fri, 7 Feb 2020 12:06:39 +0100 -Subject: [PATCH xserver 14/22] xwayland: Split up xwl_screen_post_damage into - two phases - -The first phase sets the new surface properties for all damaged -windows, then the second phase commits all surface updates. - -This is preparatory for the next change, there should be no observable -change in behaviour (other than the order of Wayland protocol -requests). - -Reviewed-by: Adam Jackson -(cherry picked from commit f88d9b1f779835302e02e255fcd45989db7f488d) ---- - hw/xwayland/xwayland.c | 17 ++++++++++++++--- - 1 file changed, 14 insertions(+), 3 deletions(-) - -diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index 324c68ccf..de35a5af0 100644 ---- a/hw/xwayland/xwayland.c -+++ b/hw/xwayland/xwayland.c -@@ -816,16 +816,16 @@ xwl_window_post_damage(struct xwl_window *xwl_window) - xwl_window->frame_callback = wl_surface_frame(xwl_window->surface); - wl_callback_add_listener(xwl_window->frame_callback, &frame_listener, xwl_window); - -- wl_surface_commit(xwl_window->surface); - DamageEmpty(window_get_damage(xwl_window->window)); -- -- xorg_list_del(&xwl_window->link_damage); - } - - static void - xwl_screen_post_damage(struct xwl_screen *xwl_screen) - { - struct xwl_window *xwl_window, *next_xwl_window; -+ struct xorg_list commit_window_list; -+ -+ xorg_list_init(&commit_window_list); - - xorg_list_for_each_entry_safe(xwl_window, next_xwl_window, - &xwl_screen->damage_window_list, link_damage) { -@@ -843,6 +843,17 @@ xwl_screen_post_damage(struct xwl_screen *xwl_screen) - #endif - - xwl_window_post_damage(xwl_window); -+ xorg_list_del(&xwl_window->link_damage); -+ xorg_list_append(&xwl_window->link_damage, &commit_window_list); -+ } -+ -+ if (xorg_list_is_empty(&commit_window_list)) -+ return; -+ -+ xorg_list_for_each_entry_safe(xwl_window, next_xwl_window, -+ &commit_window_list, link_damage) { -+ wl_surface_commit(xwl_window->surface); -+ xorg_list_del(&xwl_window->link_damage); - } - } - --- -2.24.1 - diff --git a/0015-xwayland-Call-glamor_block_handler-from-xwl_screen_p.patch b/0015-xwayland-Call-glamor_block_handler-from-xwl_screen_p.patch deleted file mode 100644 index 7224985..0000000 --- a/0015-xwayland-Call-glamor_block_handler-from-xwl_screen_p.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 0238359bced17f9db0e266111897d154ab117d68 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Michel=20D=C3=A4nzer?= -Date: Fri, 7 Feb 2020 12:15:07 +0100 -Subject: [PATCH xserver 15/22] xwayland: Call glamor_block_handler from - xwl_screen_post_damage - -In between the two phases introduced by the previous change. This makes -sure all pending drawing to the new buffers is flushed before they're -committed to the Wayland server. -(cherry picked from commit a542224ea28e2e8ccaf5e0df85bf6c603e97599a) ---- - hw/xwayland/xwayland.c | 11 +++++++++++ - 1 file changed, 11 insertions(+) - -diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index de35a5af0..d3a4684d2 100644 ---- a/hw/xwayland/xwayland.c -+++ b/hw/xwayland/xwayland.c -@@ -43,6 +43,10 @@ - _X_EXPORT Bool noXFree86VidModeExtension; - #endif - -+#ifdef XWL_HAS_GLAMOR -+#include -+#endif -+ - void - ddxGiveUp(enum ExitCode error) - { -@@ -850,6 +854,13 @@ xwl_screen_post_damage(struct xwl_screen *xwl_screen) - if (xorg_list_is_empty(&commit_window_list)) - return; - -+#ifdef XWL_HAS_GLAMOR -+ if (xwl_screen->glamor && -+ xwl_screen->egl_backend == &xwl_screen->gbm_backend) { -+ glamor_block_handler(xwl_screen->screen); -+ } -+#endif -+ - xorg_list_for_each_entry_safe(xwl_window, next_xwl_window, - &commit_window_list, link_damage) { - wl_surface_commit(xwl_window->surface); --- -2.24.1 - diff --git a/0015-xwayland-Reuse-viewport-instead-of-recreating.patch b/0015-xwayland-Reuse-viewport-instead-of-recreating.patch new file mode 100644 index 0000000..3f6cb2d --- /dev/null +++ b/0015-xwayland-Reuse-viewport-instead-of-recreating.patch @@ -0,0 +1,50 @@ +From 1f39cb2ef51c72ec0c448c5d9571540bb0d9f3eb Mon Sep 17 00:00:00 2001 +From: Roman Gilg +Date: Fri, 3 Jan 2020 17:12:14 +0100 +Subject: [PATCH xserver 15/24] xwayland: Reuse viewport instead of recreating + +When a viewport is already created we can reuse this object instead of +destroying it and getting a new one for updating the source rectangle and +destination size. + +Signed-off-by: Roman Gilg +Reviewed-by: Hans de Goede +Acked-by: Olivier Fourdan +Signed-off-by: Hans de Goede +(cherry picked from commit 948e02872feb641a176b3af82b6ef1201c97bb16) +--- + hw/xwayland/xwayland.c | 18 +++++++----------- + 1 file changed, 7 insertions(+), 11 deletions(-) + +diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c +index f4d433bca..320589dde 100644 +--- a/hw/xwayland/xwayland.c ++++ b/hw/xwayland/xwayland.c +@@ -550,17 +550,13 @@ xwl_window_enable_viewport(struct xwl_window *xwl_window, + struct xwl_output *xwl_output, + struct xwl_emulated_mode *emulated_mode) + { +- /* If necessary disable old viewport to apply new settings */ +- if (xwl_window_has_viewport_enabled(xwl_window)) +- xwl_window_disable_viewport(xwl_window); +- +- DebugF("XWAYLAND: enabling viewport %dx%d -> %dx%d\n", +- emulated_mode->width, emulated_mode->height, +- xwl_output->width, xwl_output->height); +- +- xwl_window->viewport = +- wp_viewporter_get_viewport(xwl_window->xwl_screen->viewporter, +- xwl_window->surface); ++ if (!xwl_window_has_viewport_enabled(xwl_window)) { ++ DebugF("XWAYLAND: enabling viewport %dx%d -> %dx%d\n", ++ emulated_mode->width, emulated_mode->height, ++ xwl_output->width, xwl_output->height); ++ xwl_window->viewport = wp_viewporter_get_viewport(xwl_window->xwl_screen->viewporter, ++ xwl_window->surface); ++ } + + wp_viewport_set_source(xwl_window->viewport, + wl_fixed_from_int(0), +-- +2.25.2 + diff --git a/0016-xwayland-Recurse-on-finding-the-none-wm-owner.patch b/0016-xwayland-Recurse-on-finding-the-none-wm-owner.patch new file mode 100644 index 0000000..8299c92 --- /dev/null +++ b/0016-xwayland-Recurse-on-finding-the-none-wm-owner.patch @@ -0,0 +1,81 @@ +From 8cedbfd448edf410a45c57addcee0e7304f11b86 Mon Sep 17 00:00:00 2001 +From: Roman Gilg +Date: Fri, 3 Jan 2020 17:27:28 +0100 +Subject: [PATCH xserver 16/24] xwayland: Recurse on finding the none-wm owner + +An X11 window manager might add a chain of parent windows when reparenting to a +decoration window. + +That is for example the case for KWin, which reparents client windows to one +decoration and another wrapper parent window. + +Account for that by a recursion into the tree. For now assume as before that +all X11 window managers reparent with one child only for these parent windows. + +Changes by Hans de Goede: +- Move the xwl_window_is_toplevel() from a later patch in this series here + as it really belongs together with these changes +- Drop no longer necessary xwl_window argument from window_get_none_wm_owner + parameters + +Signed-off-by: Roman Gilg +Reviewed-by: Hans de Goede +Acked-by: Olivier Fourdan +Signed-off-by: Hans de Goede +(cherry picked from commit a69f7fbb54efc8ffad320c8afd23cb41fc9edc27) +--- + hw/xwayland/xwayland.c | 17 ++++++++--------- + 1 file changed, 8 insertions(+), 9 deletions(-) + +diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c +index 320589dde..f42b80b90 100644 +--- a/hw/xwayland/xwayland.c ++++ b/hw/xwayland/xwayland.c +@@ -580,19 +580,18 @@ window_is_wm_window(WindowPtr window) + } + + static ClientPtr +-xwl_window_get_owner(struct xwl_window *xwl_window) ++window_get_none_wm_owner(WindowPtr window) + { +- WindowPtr window = xwl_window->window; + ClientPtr client = wClient(window); + + /* If the toplevel window is owned by the window-manager, then the +- * actual client toplevel window has been reparented to a window-manager +- * decoration window. In that case return the client of the +- * first *and only* child of the toplevel (decoration) window. ++ * actual client toplevel window has been reparented to some window-manager ++ * decoration/wrapper windows. In that case recurse by checking the client ++ * of the first *and only* child of the decoration/wrapper window. + */ + if (window_is_wm_window(window)) { + if (window->firstChild && window->firstChild == window->lastChild) +- return wClient(window->firstChild); ++ return window_get_none_wm_owner(window->firstChild); + else + return NULL; /* Should never happen, skip resolution emulation */ + } +@@ -613,7 +612,7 @@ xwl_window_should_enable_viewport(struct xwl_window *xwl_window, + if (!xwl_screen_has_resolution_change_emulation(xwl_screen)) + return FALSE; + +- owner = xwl_window_get_owner(xwl_window); ++ owner = window_get_none_wm_owner(xwl_window->window); + if (!owner) + return FALSE; + +@@ -692,8 +691,8 @@ xwl_window_is_toplevel(WindowPtr window) + if (window_get_damage(window)) + return TRUE; + +- /* Normal toplevel client windows, reparented to decoration window */ +- return (window->parent && window_get_damage(window->parent)); ++ /* Normal toplevel client windows, reparented to a window-manager window */ ++ return window->parent && window_is_wm_window(window->parent); + } + + static void +-- +2.25.2 + diff --git a/0016-xwayland-clear-pixmaps-after-creation-in-rootless-mo.patch b/0016-xwayland-clear-pixmaps-after-creation-in-rootless-mo.patch deleted file mode 100644 index a6e75f9..0000000 --- a/0016-xwayland-clear-pixmaps-after-creation-in-rootless-mo.patch +++ /dev/null @@ -1,137 +0,0 @@ -From 94dad4f05133171805ee94095bbcd20ece754eba Mon Sep 17 00:00:00 2001 -From: Dor Askayo -Date: Wed, 19 Feb 2020 17:22:11 +0100 -Subject: [PATCH xserver 16/22] xwayland: clear pixmaps after creation in - rootless mode -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -When a pixmap is created with a backing FBO, the FBO should be cleared -to avoid rendering uninitialized memory. This could happen when the -pixmap is rendered without being filled in its entirety. - -One example is when a top-level window without a background is -resized. The pixmap would be reallocated to prepare for more pixels, -but uninitialized memory would be rendered in the resize offset until -the client sends a frame that fills these additional pixels. - -Another example is when a new top-level window is created without a -background. Uninitialized memory would be rendered after the pixmap is -allocated and before the client sends its first frame. - -This issue is only apparent in OpenGL implementations that don't zero -the VRAM of allocated buffers by default, such as RadeonSI. - -Signed-off-by: Dor Askayo -Closes: https://gitlab.freedesktop.org/xorg/xserver/issues/636 -Reviewed-by: Michel Dänzer -(cherry picked from commit 0e9a0c203c2ae4eae12bdbb95428f398211c7bee) - -[ Michel Dänzer: -* Squashed in commit ebf549db2d9341d99e0d0847b948dd798d98f7dc -* Dropped code related to glamor_format, which only exists on master ] ---- - glamor/glamor.c | 15 +++++++++++++++ - glamor/glamor.h | 3 +++ - glamor/glamor_fbo.c | 12 ++++++++++++ - glamor/glamor_priv.h | 1 + - hw/xwayland/xwayland-glamor-gbm.c | 6 +++++- - 5 files changed, 36 insertions(+), 1 deletion(-) - -diff --git a/glamor/glamor.c b/glamor/glamor.c -index a6cc798f8..abefef614 100644 ---- a/glamor/glamor.c -+++ b/glamor/glamor.c -@@ -128,6 +128,21 @@ glamor_set_pixmap_texture(PixmapPtr pixmap, unsigned int tex) - glamor_pixmap_attach_fbo(pixmap, fbo); - } - -+_X_EXPORT void -+glamor_clear_pixmap(PixmapPtr pixmap) -+{ -+ ScreenPtr screen = pixmap->drawable.pScreen; -+ glamor_screen_private *glamor_priv; -+ glamor_pixmap_private *pixmap_priv; -+ -+ glamor_priv = glamor_get_screen_private(screen); -+ pixmap_priv = glamor_get_pixmap_private(pixmap); -+ -+ assert(pixmap_priv->fbo != NULL); -+ -+ glamor_pixmap_clear_fbo(glamor_priv, pixmap_priv->fbo); -+} -+ - uint32_t - glamor_get_pixmap_texture(PixmapPtr pixmap) - { -diff --git a/glamor/glamor.h b/glamor/glamor.h -index 3f9d265db..be04bf858 100644 ---- a/glamor/glamor.h -+++ b/glamor/glamor.h -@@ -115,6 +115,9 @@ extern _X_EXPORT void glamor_set_pixmap_texture(PixmapPtr pixmap, - - extern _X_EXPORT void glamor_set_pixmap_type(PixmapPtr pixmap, - glamor_pixmap_type_t type); -+ -+extern _X_EXPORT void glamor_clear_pixmap(PixmapPtr pixmap); -+ - extern _X_EXPORT void glamor_block_handler(ScreenPtr screen); - - extern _X_EXPORT PixmapPtr glamor_create_pixmap(ScreenPtr screen, int w, int h, -diff --git a/glamor/glamor_fbo.c b/glamor/glamor_fbo.c -index e8c4330b3..f939a6c2f 100644 ---- a/glamor/glamor_fbo.c -+++ b/glamor/glamor_fbo.c -@@ -239,6 +239,18 @@ glamor_create_fbo_array(glamor_screen_private *glamor_priv, - return NULL; - } - -+void -+glamor_pixmap_clear_fbo(glamor_screen_private *glamor_priv, glamor_pixmap_fbo *fbo) -+{ -+ glamor_make_current(glamor_priv); -+ -+ assert(fbo->fb != 0 && fbo->tex != 0); -+ -+ glamor_set_destination_pixmap_fbo(glamor_priv, fbo, 0, 0, fbo->width, fbo->height); -+ glClearColor(0.0, 0.0, 0.0, 0.0); -+ glClear(GL_COLOR_BUFFER_BIT); -+} -+ - glamor_pixmap_fbo * - glamor_pixmap_detach_fbo(glamor_pixmap_private *pixmap_priv) - { -diff --git a/glamor/glamor_priv.h b/glamor/glamor_priv.h -index 1686ef5a4..4353a99f1 100644 ---- a/glamor/glamor_priv.h -+++ b/glamor/glamor_priv.h -@@ -539,6 +539,7 @@ void glamor_destroy_fbo(glamor_screen_private *glamor_priv, - glamor_pixmap_fbo *fbo); - void glamor_pixmap_destroy_fbo(PixmapPtr pixmap); - Bool glamor_pixmap_fbo_fixup(ScreenPtr screen, PixmapPtr pixmap); -+void glamor_pixmap_clear_fbo(glamor_screen_private *glamor_priv, glamor_pixmap_fbo *fbo); - - /* Return whether 'picture' is alpha-only */ - static inline Bool glamor_picture_is_alpha(PicturePtr picture) -diff --git a/hw/xwayland/xwayland-glamor-gbm.c b/hw/xwayland/xwayland-glamor-gbm.c -index febc0b910..c02ba7363 100644 ---- a/hw/xwayland/xwayland-glamor-gbm.c -+++ b/hw/xwayland/xwayland-glamor-gbm.c -@@ -242,8 +242,12 @@ xwl_glamor_gbm_create_pixmap(ScreenPtr screen, - if (bo) { - pixmap = xwl_glamor_gbm_create_pixmap_for_bo(screen, bo, depth); - -- if (!pixmap) -+ if (!pixmap) { - gbm_bo_destroy(bo); -+ } -+ else if (xwl_screen->rootless && hint == CREATE_PIXMAP_USAGE_BACKING_PIXMAP) { -+ glamor_clear_pixmap(pixmap); -+ } - } - } - --- -2.24.1 - diff --git a/0017-xwayland-Add-xwl_window_create_frame_callback-helper.patch b/0017-xwayland-Add-xwl_window_create_frame_callback-helper.patch deleted file mode 100644 index 3012c84..0000000 --- a/0017-xwayland-Add-xwl_window_create_frame_callback-helper.patch +++ /dev/null @@ -1,62 +0,0 @@ -From 915cc107767624bd7914c962347bab9c2e21cdff Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Michel=20D=C3=A4nzer?= -Date: Fri, 13 Dec 2019 18:26:35 +0100 -Subject: [PATCH xserver 17/22] xwayland: Add xwl_window_create_frame_callback - helper - -This will be used by the following changes. No functional change -intended. - -Reviewed-by: Olivier Fourdan -(cherry picked from commit f80eea0529b2cfb805a9c7d4994a4235451131e3) ---- - hw/xwayland/xwayland.c | 12 +++++++++--- - hw/xwayland/xwayland.h | 2 ++ - 2 files changed, 11 insertions(+), 3 deletions(-) - -diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index d3a4684d2..ef01842f0 100644 ---- a/hw/xwayland/xwayland.c -+++ b/hw/xwayland/xwayland.c -@@ -747,6 +747,14 @@ static const struct wl_callback_listener frame_listener = { - frame_callback - }; - -+void -+xwl_window_create_frame_callback(struct xwl_window *xwl_window) -+{ -+ xwl_window->frame_callback = wl_surface_frame(xwl_window->surface); -+ wl_callback_add_listener(xwl_window->frame_callback, &frame_listener, -+ xwl_window); -+} -+ - static Bool - xwl_destroy_window(WindowPtr window) - { -@@ -817,9 +825,7 @@ xwl_window_post_damage(struct xwl_window *xwl_window) - box->x2 - box->x1, box->y2 - box->y1); - } - -- xwl_window->frame_callback = wl_surface_frame(xwl_window->surface); -- wl_callback_add_listener(xwl_window->frame_callback, &frame_listener, xwl_window); -- -+ xwl_window_create_frame_callback(xwl_window); - DamageEmpty(window_get_damage(xwl_window->window)); - } - -diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h -index 0854df456..d20016c5d 100644 ---- a/hw/xwayland/xwayland.h -+++ b/hw/xwayland/xwayland.h -@@ -378,6 +378,8 @@ struct xwl_output { - Bool xdg_output_done; - }; - -+void xwl_window_create_frame_callback(struct xwl_window *xwl_window); -+ - void xwl_sync_events (struct xwl_screen *xwl_screen); - - Bool xwl_screen_init_cursor(struct xwl_screen *xwl_screen); --- -2.24.1 - diff --git a/0017-xwayland-Make-window_get_none_wm_owner-return-a-Wind.patch b/0017-xwayland-Make-window_get_none_wm_owner-return-a-Wind.patch new file mode 100644 index 0000000..b9a2331 --- /dev/null +++ b/0017-xwayland-Make-window_get_none_wm_owner-return-a-Wind.patch @@ -0,0 +1,82 @@ +From 939a78925a1d591e6aaf291a6609b9c6e54ee6ce Mon Sep 17 00:00:00 2001 +From: Roman Gilg +Date: Wed, 15 Jan 2020 10:07:58 +0100 +Subject: [PATCH xserver 17/24] xwayland: Make window_get_none_wm_owner return + a Window instead of a Client + +Make window_get_none_wm_owner return the first non-wm-window instead of the +owner (client) of the first non-wm-window and rename it to +window_get_client_toplevel to match its new behavior. + +This is a preparation patch for switching to using the drawable coordinates +in xwl_window_should_enable_viewport() + +Changes by Hans de Goede: +- Split this change out into a separate patch for easier reviewing +- Rename window_get_none_wm_owner to window_get_client_toplevel to match + its new behavior + +Signed-off-by: Roman Gilg +Acked-by: Olivier Fourdan +Signed-off-by: Hans de Goede +(cherry picked from commit 060f10062eb1761515b762b46cba56c7a53db72c) +--- + hw/xwayland/xwayland.c | 17 ++++++++++------- + 1 file changed, 10 insertions(+), 7 deletions(-) + +diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c +index f42b80b90..d70d729ae 100644 +--- a/hw/xwayland/xwayland.c ++++ b/hw/xwayland/xwayland.c +@@ -579,10 +579,10 @@ window_is_wm_window(WindowPtr window) + return CLIENT_ID(window->drawable.id) == xwl_screen->wm_client_id; + } + +-static ClientPtr +-window_get_none_wm_owner(WindowPtr window) ++static WindowPtr ++window_get_client_toplevel(WindowPtr window) + { +- ClientPtr client = wClient(window); ++ assert(window); + + /* If the toplevel window is owned by the window-manager, then the + * actual client toplevel window has been reparented to some window-manager +@@ -591,12 +591,12 @@ window_get_none_wm_owner(WindowPtr window) + */ + if (window_is_wm_window(window)) { + if (window->firstChild && window->firstChild == window->lastChild) +- return window_get_none_wm_owner(window->firstChild); ++ return window_get_client_toplevel(window->firstChild); + else + return NULL; /* Should never happen, skip resolution emulation */ + } + +- return client; ++ return window; + } + + static Bool +@@ -608,14 +608,17 @@ xwl_window_should_enable_viewport(struct xwl_window *xwl_window, + struct xwl_emulated_mode *emulated_mode; + struct xwl_output *xwl_output; + ClientPtr owner; ++ WindowPtr window; + + if (!xwl_screen_has_resolution_change_emulation(xwl_screen)) + return FALSE; + +- owner = window_get_none_wm_owner(xwl_window->window); +- if (!owner) ++ window = window_get_client_toplevel(xwl_window->window); ++ if (!window) + return FALSE; + ++ owner = wClient(window); ++ + /* 1. Test if the window matches the emulated mode on one of the outputs + * This path gets hit by most games / libs (e.g. SDL, SFML, OGRE) + */ +-- +2.25.2 + diff --git a/0018-xwayland-Check-emulation-on-client-toplevel-resize.patch b/0018-xwayland-Check-emulation-on-client-toplevel-resize.patch new file mode 100644 index 0000000..dcc0f5e --- /dev/null +++ b/0018-xwayland-Check-emulation-on-client-toplevel-resize.patch @@ -0,0 +1,121 @@ +From c5d9cb5f4bc4f703b66fc524a76247c742490b30 Mon Sep 17 00:00:00 2001 +From: Roman Gilg +Date: Fri, 3 Jan 2020 17:55:28 +0100 +Subject: [PATCH xserver 18/24] xwayland: Check emulation on client toplevel + resize + +When a reparented window is resized directly check the emulation instead of +doing this only when the window manager parent window is resized, what might +never happen. + +For that to work we need to make sure that we compare the current size of the +client toplevel when looking for an emulated mode. + +Changes by Hans de Goede: +- Remove xwl_window x, y, width and height members as those are no longer used. +- Add check for xwl_window_from_window() returning NULL. + +Signed-off-by: Roman Gilg +Acked-by: Olivier Fourdan +Signed-off-by: Hans de Goede +(cherry picked from commit 6d98f840da6dfcf2a69e03a1b3fa0bf602ba1f27) +--- + hw/xwayland/xwayland.c | 27 +++++++++++---------------- + hw/xwayland/xwayland.h | 1 - + 2 files changed, 11 insertions(+), 17 deletions(-) + +diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c +index d70d729ae..14227a327 100644 +--- a/hw/xwayland/xwayland.c ++++ b/hw/xwayland/xwayland.c +@@ -609,6 +609,7 @@ xwl_window_should_enable_viewport(struct xwl_window *xwl_window, + struct xwl_output *xwl_output; + ClientPtr owner; + WindowPtr window; ++ DrawablePtr drawable; + + if (!xwl_screen_has_resolution_change_emulation(xwl_screen)) + return FALSE; +@@ -618,6 +619,7 @@ xwl_window_should_enable_viewport(struct xwl_window *xwl_window, + return FALSE; + + owner = wClient(window); ++ drawable = &window->drawable; + + /* 1. Test if the window matches the emulated mode on one of the outputs + * This path gets hit by most games / libs (e.g. SDL, SFML, OGRE) +@@ -627,10 +629,10 @@ xwl_window_should_enable_viewport(struct xwl_window *xwl_window, + if (!emulated_mode) + continue; + +- if (xwl_window->x == xwl_output->x && +- xwl_window->y == xwl_output->y && +- xwl_window->width == emulated_mode->width && +- xwl_window->height == emulated_mode->height) { ++ if (drawable->x == xwl_output->x && ++ drawable->y == xwl_output->y && ++ drawable->width == emulated_mode->width && ++ drawable->height == emulated_mode->height) { + + *emulated_mode_ret = emulated_mode; + *xwl_output_ret = xwl_output; +@@ -646,9 +648,9 @@ xwl_window_should_enable_viewport(struct xwl_window *xwl_window, + emulated_mode = xwl_output_get_emulated_mode_for_client(xwl_output, owner); + if (xwl_output && xwl_window->window->overrideRedirect && + emulated_mode && emulated_mode->from_vidmode && +- xwl_window->x == 0 && xwl_window->y == 0 && +- xwl_window->width == xwl_screen->width && +- xwl_window->height == xwl_screen->height) { ++ drawable->x == 0 && drawable->y == 0 && ++ drawable->width == xwl_screen->width && ++ drawable->height == xwl_screen->height) { + + *emulated_mode_ret = emulated_mode; + *xwl_output_ret = xwl_output; +@@ -768,8 +770,6 @@ ensure_surface_for_window(WindowPtr window) + + xwl_window->xwl_screen = xwl_screen; + xwl_window->window = window; +- xwl_window->width = window->drawable.width; +- xwl_window->height = window->drawable.height; + xwl_window->surface = wl_compositor_create_surface(xwl_screen->compositor); + if (xwl_window->surface == NULL) { + ErrorF("wl_display_create_surface failed\n"); +@@ -997,20 +997,15 @@ xwl_resize_window(WindowPtr window, + struct xwl_window *xwl_window; + + xwl_screen = xwl_screen_get(screen); +- xwl_window = xwl_window_get(window); ++ xwl_window = xwl_window_from_window(window); + + screen->ResizeWindow = xwl_screen->ResizeWindow; + (*screen->ResizeWindow) (window, x, y, width, height, sib); + xwl_screen->ResizeWindow = screen->ResizeWindow; + screen->ResizeWindow = xwl_resize_window; + +- if (xwl_window) { +- xwl_window->x = x; +- xwl_window->y = y; +- xwl_window->width = width; +- xwl_window->height = height; ++ if (xwl_window && xwl_window_is_toplevel(window)) + xwl_window_check_resolution_change_emulation(xwl_window); +- } + } + + static void +diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h +index 126af8823..01aef27d2 100644 +--- a/hw/xwayland/xwayland.h ++++ b/hw/xwayland/xwayland.h +@@ -184,7 +184,6 @@ struct xwl_window { + struct xwl_screen *xwl_screen; + struct wl_surface *surface; + struct wp_viewport *viewport; +- int32_t x, y, width, height; + float scale_x, scale_y; + struct wl_shell_surface *shell_surface; + WindowPtr window; +-- +2.25.2 + diff --git a/0018-xwayland-Use-single-frame-callback-for-Present-flips.patch b/0018-xwayland-Use-single-frame-callback-for-Present-flips.patch deleted file mode 100644 index c1bc672..0000000 --- a/0018-xwayland-Use-single-frame-callback-for-Present-flips.patch +++ /dev/null @@ -1,212 +0,0 @@ -From 99a6d6b15e0757a4652a569a1b2070c76a00b567 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Michel=20D=C3=A4nzer?= -Date: Wed, 27 Nov 2019 18:04:06 +0100 -Subject: [PATCH xserver 18/22] xwayland: Use single frame callback for Present - flips and normal updates - -Using a list of Present windows that need to be called back. - -This prepares for the following change, there should be no change in -observed behaviour. - -v2: -* Use xwl_window_create_frame_callback instead of making the - frame_listener struct non-static (Olivier Fourdan) - -Reviewed-by: Olivier Fourdan -(cherry picked from commit c5067feaeea115761f0a72f37407c6e5e943d1a1) ---- - hw/xwayland/xwayland-present.c | 40 +++++++++++++--------------------- - hw/xwayland/xwayland.c | 26 +++++++++++++++++----- - hw/xwayland/xwayland.h | 4 +++- - 3 files changed, 39 insertions(+), 31 deletions(-) - -diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c -index 31c276623..baa97d6f3 100644 ---- a/hw/xwayland/xwayland-present.c -+++ b/hw/xwayland/xwayland-present.c -@@ -60,6 +60,7 @@ xwl_present_window_get_priv(WindowPtr window) - xwl_present_window->msc = 1; - xwl_present_window->ust = GetTimeInMicros(); - -+ xorg_list_init(&xwl_present_window->frame_callback_list); - xorg_list_init(&xwl_present_window->event_list); - xorg_list_init(&xwl_present_window->release_queue); - -@@ -96,7 +97,7 @@ xwl_present_reset_timer(struct xwl_present_window *xwl_present_window) - if (xwl_present_has_events(xwl_present_window)) { - CARD32 timeout; - -- if (xwl_present_window->frame_callback) -+ if (!xorg_list_is_empty(&xwl_present_window->frame_callback_list)) - timeout = TIMER_LEN_FLIP; - else - timeout = TIMER_LEN_COPY; -@@ -119,10 +120,7 @@ xwl_present_cleanup(WindowPtr window) - if (!xwl_present_window) - return; - -- if (xwl_present_window->frame_callback) { -- wl_callback_destroy(xwl_present_window->frame_callback); -- xwl_present_window->frame_callback = NULL; -- } -+ xorg_list_del(&xwl_present_window->frame_callback_list); - - if (xwl_present_window->sync_callback) { - wl_callback_destroy(xwl_present_window->sync_callback); -@@ -252,15 +250,10 @@ xwl_present_timer_callback(OsTimerPtr timer, - return 0; - } - --static void --xwl_present_frame_callback(void *data, -- struct wl_callback *callback, -- uint32_t time) -+void -+xwl_present_frame_callback(struct xwl_present_window *xwl_present_window) - { -- struct xwl_present_window *xwl_present_window = data; -- -- wl_callback_destroy(xwl_present_window->frame_callback); -- xwl_present_window->frame_callback = NULL; -+ xorg_list_del(&xwl_present_window->frame_callback_list); - - if (xwl_present_window->frame_timer_firing) { - /* If the timer is firing, this frame callback is too late */ -@@ -275,10 +268,6 @@ xwl_present_frame_callback(void *data, - xwl_present_reset_timer(xwl_present_window); - } - --static const struct wl_callback_listener xwl_present_frame_listener = { -- xwl_present_frame_callback --}; -- - static void - xwl_present_sync_callback(void *data, - struct wl_callback *callback, -@@ -488,11 +477,12 @@ xwl_present_flip(WindowPtr present_window, - /* We can flip directly to the main surface (full screen window without clips) */ - wl_surface_attach(xwl_window->surface, buffer, 0, 0); - -- if (!xwl_present_window->frame_callback) { -- xwl_present_window->frame_callback = wl_surface_frame(xwl_window->surface); -- wl_callback_add_listener(xwl_present_window->frame_callback, -- &xwl_present_frame_listener, -- xwl_present_window); -+ if (!xwl_window->frame_callback) -+ xwl_window_create_frame_callback(xwl_window); -+ -+ if (xorg_list_is_empty(&xwl_present_window->frame_callback_list)) { -+ xorg_list_add(&xwl_present_window->frame_callback_list, -+ &xwl_window->frame_callback_list); - } - - /* Realign timer */ -@@ -532,14 +522,14 @@ xwl_present_unrealize_window(WindowPtr window) - { - struct xwl_present_window *xwl_present_window = xwl_present_window_priv(window); - -- if (!xwl_present_window || !xwl_present_window->frame_callback) -+ if (!xwl_present_window || -+ xorg_list_is_empty(&xwl_present_window->frame_callback_list)) - return; - - /* The pending frame callback may never be called, so drop it and shorten - * the frame timer interval. - */ -- wl_callback_destroy(xwl_present_window->frame_callback); -- xwl_present_window->frame_callback = NULL; -+ xorg_list_del(&xwl_present_window->frame_callback_list); - xwl_present_reset_timer(xwl_present_window); - } - -diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index ef01842f0..feb1058b7 100644 ---- a/hw/xwayland/xwayland.c -+++ b/hw/xwayland/xwayland.c -@@ -600,6 +600,10 @@ ensure_surface_for_window(WindowPtr window) - dixSetPrivate(&window->devPrivates, &xwl_window_private_key, xwl_window); - xorg_list_init(&xwl_window->link_damage); - -+#ifdef GLAMOR_HAS_GBM -+ xorg_list_init(&xwl_window->frame_callback_list); -+#endif -+ - xwl_window_init_allow_commits(xwl_window); - - return TRUE; -@@ -684,11 +688,6 @@ xwl_unrealize_window(WindowPtr window) - xwl_screen->UnrealizeWindow = screen->UnrealizeWindow; - screen->UnrealizeWindow = xwl_unrealize_window; - --#ifdef GLAMOR_HAS_GBM -- if (xwl_screen->present) -- xwl_present_unrealize_window(window); --#endif -- - xwl_window = xwl_window_get(window); - if (!xwl_window) - return ret; -@@ -700,6 +699,11 @@ xwl_unrealize_window(WindowPtr window) - if (xwl_window->frame_callback) - wl_callback_destroy(xwl_window->frame_callback); - -+#ifdef GLAMOR_HAS_GBM -+ if (xwl_screen->present) -+ xwl_present_unrealize_window(window); -+#endif -+ - free(xwl_window); - dixSetPrivate(&window->devPrivates, &xwl_window_private_key, NULL); - -@@ -741,6 +745,18 @@ frame_callback(void *data, - - wl_callback_destroy (xwl_window->frame_callback); - xwl_window->frame_callback = NULL; -+ -+#ifdef GLAMOR_HAS_GBM -+ if (xwl_window->xwl_screen->present) { -+ struct xwl_present_window *xwl_present_window, *tmp; -+ -+ xorg_list_for_each_entry_safe(xwl_present_window, tmp, -+ &xwl_window->frame_callback_list, -+ frame_callback_list) { -+ xwl_present_frame_callback(xwl_present_window); -+ } -+ } -+#endif - } - - static const struct wl_callback_listener frame_listener = { -diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h -index d20016c5d..d4eb6bf1a 100644 ---- a/hw/xwayland/xwayland.h -+++ b/hw/xwayland/xwayland.h -@@ -183,6 +183,7 @@ struct xwl_window { - struct wl_callback *frame_callback; - Bool allow_commits; - #ifdef GLAMOR_HAS_GBM -+ struct xorg_list frame_callback_list; - Bool present_flipped; - #endif - }; -@@ -192,7 +193,7 @@ struct xwl_present_window { - struct xwl_screen *xwl_screen; - struct xwl_present_event *sync_flip; - WindowPtr window; -- struct xorg_list link; -+ struct xorg_list frame_callback_list; - - uint64_t msc; - uint64_t ust; -@@ -454,6 +455,7 @@ Bool xwl_glamor_allow_commits(struct xwl_window *xwl_window); - void xwl_glamor_egl_make_current(struct xwl_screen *xwl_screen); - - #ifdef GLAMOR_HAS_GBM -+void xwl_present_frame_callback(struct xwl_present_window *xwl_present_window); - Bool xwl_present_init(ScreenPtr screen); - void xwl_present_cleanup(WindowPtr window); - void xwl_present_unrealize_window(WindowPtr window); --- -2.24.1 - diff --git a/0019-xwayland-Also-check-resolution-change-emulation-when.patch b/0019-xwayland-Also-check-resolution-change-emulation-when.patch new file mode 100644 index 0000000..a1c0e84 --- /dev/null +++ b/0019-xwayland-Also-check-resolution-change-emulation-when.patch @@ -0,0 +1,45 @@ +From 63b0c0d76d1020f0cac331f3eff30fba07f79965 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Wed, 15 Jan 2020 14:36:45 +0100 +Subject: [PATCH xserver 19/24] xwayland: Also check + resolution-change-emulation when the xwl_window itself moves + +The recent change to use the top-level non-window-manager Window drawable +coordinates from xwl_window_check_resolution_change_emulation() in +combination with only calling it on a resize when the top-level window +is moved breaks things with mutter/gnome-shell. + +When fullscreening a X11 window, mutter moves its window-decoration Window +wrapping the top-level Window to the monitor's origin coordinates (e.g. 0x0) +last. This updates the top-level's drawable coordinates, but as the +actual MoveWindow is called on the wrapper Window and not on the toplevel +we do not call xwl_window_check_resolution_change_emulation() and we never +enable the viewport. + +This commit fixes this by also calling +xwl_window_check_resolution_change_emulation() if the Window being moved +is an xwl_window itself. + +Acked-by: Olivier Fourdan +Signed-off-by: Hans de Goede +(cherry picked from commit 4fc107460a349a1a46f0e5251e6fd2a31f4c0428) +--- + hw/xwayland/xwayland.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c +index 14227a327..298ef3ac8 100644 +--- a/hw/xwayland/xwayland.c ++++ b/hw/xwayland/xwayland.c +@@ -1004,7 +1004,7 @@ xwl_resize_window(WindowPtr window, + xwl_screen->ResizeWindow = screen->ResizeWindow; + screen->ResizeWindow = xwl_resize_window; + +- if (xwl_window && xwl_window_is_toplevel(window)) ++ if (xwl_window && (xwl_window_get(window) || xwl_window_is_toplevel(window))) + xwl_window_check_resolution_change_emulation(xwl_window); + } + +-- +2.25.2 + diff --git a/0019-xwayland-Use-frame-callbacks-for-Present-vblank-even.patch b/0019-xwayland-Use-frame-callbacks-for-Present-vblank-even.patch deleted file mode 100644 index 429d687..0000000 --- a/0019-xwayland-Use-frame-callbacks-for-Present-vblank-even.patch +++ /dev/null @@ -1,99 +0,0 @@ -From 2a185dd22ddb5b0d7d2ef5948591028766bb9530 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Michel=20D=C3=A4nzer?= -Date: Mon, 2 Mar 2020 18:09:31 +0100 -Subject: [PATCH xserver 19/22] xwayland: Use frame callbacks for Present - vblank events - -Instead of only the fallback timer. - -Fixes https://gitlab.freedesktop.org/xorg/xserver/issues/854 - -v2: -* Drop unused frame_callback member of struct xwl_present_window - (Olivier Fourdan) - -Reviewed-by: Olivier Fourdan -(cherry picked from commit 9b31358c52e951883bf7c01c953a9da080542244) ---- - hw/xwayland/xwayland-present.c | 22 ++++++++++++++-------- - hw/xwayland/xwayland.h | 2 -- - 2 files changed, 14 insertions(+), 10 deletions(-) - -diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c -index baa97d6f3..c7c077aaa 100644 ---- a/hw/xwayland/xwayland-present.c -+++ b/hw/xwayland/xwayland-present.c -@@ -242,7 +242,10 @@ xwl_present_timer_callback(OsTimerPtr timer, - { - struct xwl_present_window *xwl_present_window = arg; - -- xwl_present_window->frame_timer_firing = TRUE; -+ /* If we were expecting a frame callback for this window, it didn't arrive -+ * in a second. Stop listening to it to avoid double-bumping the MSC -+ */ -+ xorg_list_del(&xwl_present_window->frame_callback_list); - - xwl_present_msc_bump(xwl_present_window); - xwl_present_reset_timer(xwl_present_window); -@@ -255,11 +258,6 @@ xwl_present_frame_callback(struct xwl_present_window *xwl_present_window) - { - xorg_list_del(&xwl_present_window->frame_callback_list); - -- if (xwl_present_window->frame_timer_firing) { -- /* If the timer is firing, this frame callback is too late */ -- return; -- } -- - xwl_present_msc_bump(xwl_present_window); - - /* we do not need the timer anymore for this frame, -@@ -349,6 +347,7 @@ xwl_present_queue_vblank(WindowPtr present_window, - uint64_t msc) - { - struct xwl_present_window *xwl_present_window = xwl_present_window_get_priv(present_window); -+ struct xwl_window *xwl_window = xwl_window_from_window(present_window); - struct xwl_present_event *event; - - event = malloc(sizeof *event); -@@ -361,7 +360,15 @@ xwl_present_queue_vblank(WindowPtr present_window, - - xorg_list_append(&event->list, &xwl_present_window->event_list); - -- if (!xwl_present_window->frame_timer) -+ /* If there's a pending frame callback, use that */ -+ if (xwl_window && xwl_window->frame_callback && -+ xorg_list_is_empty(&xwl_present_window->frame_callback_list)) { -+ xorg_list_add(&xwl_present_window->frame_callback_list, -+ &xwl_window->frame_callback_list); -+ } -+ -+ if ((xwl_window && xwl_window->frame_callback) || -+ !xwl_present_window->frame_timer) - xwl_present_reset_timer(xwl_present_window); - - return Success; -@@ -486,7 +493,6 @@ xwl_present_flip(WindowPtr present_window, - } - - /* Realign timer */ -- xwl_present_window->frame_timer_firing = FALSE; - xwl_present_reset_timer(xwl_present_window); - - wl_surface_damage(xwl_window->surface, 0, 0, -diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h -index d4eb6bf1a..a12ec257b 100644 ---- a/hw/xwayland/xwayland.h -+++ b/hw/xwayland/xwayland.h -@@ -199,9 +199,7 @@ struct xwl_present_window { - uint64_t ust; - - OsTimerPtr frame_timer; -- Bool frame_timer_firing; - -- struct wl_callback *frame_callback; - struct wl_callback *sync_callback; - - struct xorg_list event_list; --- -2.24.1 - diff --git a/0020-Fix-building-with-fno-common.patch b/0020-Fix-building-with-fno-common.patch deleted file mode 100644 index 5a1d588..0000000 --- a/0020-Fix-building-with-fno-common.patch +++ /dev/null @@ -1,254 +0,0 @@ -From 1610ef1d6b5ba99da9d1a639f3b65b2e61514a7d Mon Sep 17 00:00:00 2001 -From: David Seifert -Date: Fri, 24 Jan 2020 12:49:44 +0100 -Subject: [PATCH xserver 20/22] Fix building with `-fno-common` - -* GCC 10 will switch the default to `-fno-common`. - https://gcc.gnu.org/PR85678 - -Bug: https://bugs.gentoo.org/705880 -Signed-off-by: Matt Turner ---- - hw/dmx/config/dmxconfig.c | 2 +- - hw/dmx/config/xdmxconfig.c | 2 +- - hw/dmx/glxProxy/glxext.c | 2 -- - hw/xwayland/xwayland.c | 2 +- - test/misc.c | 2 +- - test/xi1/protocol-xchangedevicecontrol.c | 2 +- - test/xi2/protocol-common.c | 2 ++ - test/xi2/protocol-common.h | 2 +- - test/xi2/protocol-xigetclientpointer.c | 2 +- - test/xi2/protocol-xigetselectedevents.c | 2 +- - test/xi2/protocol-xipassivegrabdevice.c | 2 +- - test/xi2/protocol-xiquerydevice.c | 2 +- - test/xi2/protocol-xiquerypointer.c | 2 +- - test/xi2/protocol-xiqueryversion.c | 2 +- - test/xi2/protocol-xiselectevents.c | 2 +- - test/xi2/protocol-xisetclientpointer.c | 2 +- - test/xi2/protocol-xiwarppointer.c | 2 +- - 17 files changed, 17 insertions(+), 17 deletions(-) - -diff --git a/hw/dmx/config/dmxconfig.c b/hw/dmx/config/dmxconfig.c -index c1a9e1cf3..85bc0dbe4 100644 ---- a/hw/dmx/config/dmxconfig.c -+++ b/hw/dmx/config/dmxconfig.c -@@ -72,7 +72,7 @@ typedef struct DMXConfigCmdStruct { - DMXConfigList *xinputs; - } DMXConfigCmd, *DMXConfigCmdPtr; - --DMXConfigEntryPtr dmxConfigEntry; -+extern DMXConfigEntryPtr dmxConfigEntry; - static DMXConfigCmd dmxConfigCmd; - - static int dmxDisplaysFromCommandLine; -diff --git a/hw/dmx/config/xdmxconfig.c b/hw/dmx/config/xdmxconfig.c -index 49e4b5459..05d839688 100644 ---- a/hw/dmx/config/xdmxconfig.c -+++ b/hw/dmx/config/xdmxconfig.c -@@ -65,7 +65,7 @@ extern FILE *yyin; - #define DMX_CANVAS_WIDTH 400 - #define DMX_CANVAS_HEIGHT 500 - --DMXConfigEntryPtr dmxConfigEntry; -+extern DMXConfigEntryPtr dmxConfigEntry; - static DMXConfigVirtualPtr dmxConfigCurrent, dmxConfigNewVirtual; - static DMXConfigDisplayPtr dmxConfigCurrentDisplay, dmxConfigNewDisplay; - static int dmxConfigGrabbed, dmxConfigGrabbedFine; -diff --git a/hw/dmx/glxProxy/glxext.c b/hw/dmx/glxProxy/glxext.c -index 49848bbff..ca9780f99 100644 ---- a/hw/dmx/glxProxy/glxext.c -+++ b/hw/dmx/glxProxy/glxext.c -@@ -47,8 +47,6 @@ - #include "extinit.h" - #include "glx_extinit.h" - --int noGlxExtension; -- - /* - ** Forward declarations. - */ -diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index feb1058b7..5fefa5923 100644 ---- a/hw/xwayland/xwayland.c -+++ b/hw/xwayland/xwayland.c -@@ -40,7 +40,7 @@ - - #ifdef XF86VIDMODE - #include --_X_EXPORT Bool noXFree86VidModeExtension; -+extern _X_EXPORT Bool noXFree86VidModeExtension; - #endif - - #ifdef XWL_HAS_GLAMOR -diff --git a/test/misc.c b/test/misc.c -index 3c669b677..f1f76cccd 100644 ---- a/test/misc.c -+++ b/test/misc.c -@@ -33,7 +33,7 @@ - - #include "tests-common.h" - --ScreenInfo screenInfo; -+extern ScreenInfo screenInfo; - - static void - dix_version_compare(void) -diff --git a/test/xi1/protocol-xchangedevicecontrol.c b/test/xi1/protocol-xchangedevicecontrol.c -index 57a15c407..54f1f67cb 100644 ---- a/test/xi1/protocol-xchangedevicecontrol.c -+++ b/test/xi1/protocol-xchangedevicecontrol.c -@@ -37,7 +37,7 @@ - - #include "protocol-common.h" - --ClientRec client_window; -+extern ClientRec client_window; - static ClientRec client_request; - - static void -diff --git a/test/xi2/protocol-common.c b/test/xi2/protocol-common.c -index 8cd85dd05..05dd3c4e7 100644 ---- a/test/xi2/protocol-common.c -+++ b/test/xi2/protocol-common.c -@@ -45,6 +45,8 @@ static ClientRec server_client; - - void *global_userdata; - -+void (*reply_handler) (ClientPtr client, int len, char *data, void *userdata); -+ - int enable_GrabButton_wrap = 1; - int enable_XISetEventMask_wrap = 1; - -diff --git a/test/xi2/protocol-common.h b/test/xi2/protocol-common.h -index 8490529ad..742ce348f 100644 ---- a/test/xi2/protocol-common.h -+++ b/test/xi2/protocol-common.h -@@ -99,7 +99,7 @@ extern void *global_userdata; - * The reply handler called from WriteToClient. Set this handler if you need - * to check the reply values. - */ --void (*reply_handler) (ClientPtr client, int len, char *data, void *userdata); -+extern void (*reply_handler) (ClientPtr client, int len, char *data, void *userdata); - - /** - * The default screen used for the windows. Initialized by init_simple(). -diff --git a/test/xi2/protocol-xigetclientpointer.c b/test/xi2/protocol-xigetclientpointer.c -index 9c38bd720..244e8438f 100644 ---- a/test/xi2/protocol-xigetclientpointer.c -+++ b/test/xi2/protocol-xigetclientpointer.c -@@ -46,7 +46,7 @@ static struct { - int win; - } test_data; - --ClientRec client_window; -+extern ClientRec client_window; - static ClientRec client_request; - - static void -diff --git a/test/xi2/protocol-xigetselectedevents.c b/test/xi2/protocol-xigetselectedevents.c -index 9a0fac5d4..b14100224 100644 ---- a/test/xi2/protocol-xigetselectedevents.c -+++ b/test/xi2/protocol-xigetselectedevents.c -@@ -60,7 +60,7 @@ static struct { - int mask_len; - } test_data; - --ClientRec client_window; -+extern ClientRec client_window; - - /* AddResource is called from XISetSEventMask, we don't need this */ - Bool -diff --git a/test/xi2/protocol-xipassivegrabdevice.c b/test/xi2/protocol-xipassivegrabdevice.c -index c703a1ee8..142bcecb7 100644 ---- a/test/xi2/protocol-xipassivegrabdevice.c -+++ b/test/xi2/protocol-xipassivegrabdevice.c -@@ -41,7 +41,7 @@ - - #include "protocol-common.h" - --ClientRec client_window; -+extern ClientRec client_window; - static ClientRec client_request; - - #define N_MODS 7 -diff --git a/test/xi2/protocol-xiquerydevice.c b/test/xi2/protocol-xiquerydevice.c -index a068038fd..6ee8a80fc 100644 ---- a/test/xi2/protocol-xiquerydevice.c -+++ b/test/xi2/protocol-xiquerydevice.c -@@ -54,7 +54,7 @@ struct test_data { - int num_devices_in_reply; - }; - --ClientRec client_window; -+extern ClientRec client_window; - - static void reply_XIQueryDevice_data(ClientPtr client, int len, char *data, - void *closure); -diff --git a/test/xi2/protocol-xiquerypointer.c b/test/xi2/protocol-xiquerypointer.c -index ed75d7910..0f5a2b57a 100644 ---- a/test/xi2/protocol-xiquerypointer.c -+++ b/test/xi2/protocol-xiquerypointer.c -@@ -41,7 +41,7 @@ - - #include "protocol-common.h" - --ClientRec client_window; -+extern ClientRec client_window; - static ClientRec client_request; - static void reply_XIQueryPointer_data(ClientPtr client, int len, - char *data, void *closure); -diff --git a/test/xi2/protocol-xiqueryversion.c b/test/xi2/protocol-xiqueryversion.c -index 3ce758faa..c7ddbfc10 100644 ---- a/test/xi2/protocol-xiqueryversion.c -+++ b/test/xi2/protocol-xiqueryversion.c -@@ -58,7 +58,7 @@ struct test_data { - int minor_expected; - }; - --ClientRec client_window; -+extern ClientRec client_window; - - static void - reply_XIQueryVersion(ClientPtr client, int len, char *data, void *closure) -diff --git a/test/xi2/protocol-xiselectevents.c b/test/xi2/protocol-xiselectevents.c -index f136c23d0..06050ade7 100644 ---- a/test/xi2/protocol-xiselectevents.c -+++ b/test/xi2/protocol-xiselectevents.c -@@ -62,7 +62,7 @@ - - static unsigned char *data[4096 * 20]; /* the request data buffer */ - --ClientRec client_window; -+extern ClientRec client_window; - - int - __real_XISetEventMask(DeviceIntPtr dev, WindowPtr win, ClientPtr client, -diff --git a/test/xi2/protocol-xisetclientpointer.c b/test/xi2/protocol-xisetclientpointer.c -index 6584bb9cc..ddc9f0000 100644 ---- a/test/xi2/protocol-xisetclientpointer.c -+++ b/test/xi2/protocol-xisetclientpointer.c -@@ -48,7 +48,7 @@ - - #include "protocol-common.h" - --ClientRec client_window; -+extern ClientRec client_window; - static ClientRec client_request; - - static void -diff --git a/test/xi2/protocol-xiwarppointer.c b/test/xi2/protocol-xiwarppointer.c -index 8484d54e5..e5c2f31ea 100644 ---- a/test/xi2/protocol-xiwarppointer.c -+++ b/test/xi2/protocol-xiwarppointer.c -@@ -44,7 +44,7 @@ - static int expected_x = SPRITE_X; - static int expected_y = SPRITE_Y; - --ClientRec client_window; -+extern ClientRec client_window; - - /** - * This function overrides the one in the screen rec. --- -2.24.1 - diff --git a/0020-xwayland-Also-hook-screen-s-MoveWindow-method.patch b/0020-xwayland-Also-hook-screen-s-MoveWindow-method.patch new file mode 100644 index 0000000..51f3fe8 --- /dev/null +++ b/0020-xwayland-Also-hook-screen-s-MoveWindow-method.patch @@ -0,0 +1,83 @@ +From 309e6e549adc5a164541d16822745c022cd8574b Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Thu, 9 Jan 2020 11:00:36 +0100 +Subject: [PATCH xserver 20/24] xwayland: Also hook screen's MoveWindow method + +Not only hook the ResizeWindow method of the screen (which really is +MoveAndResize) but also hook the MoveWindow method for checking if we +need to setup a viewport for resolution change emulation. + +Our resolution change emulation check if the windows origin matches +the monitors origin and the windows origin can also be changed by just +a move without being resized. + +Also checking on a move becomes esp. important when we move to checking +on changes to the top-level non-window-manager client (X11)Window instead +of on changes to the xwl_window later on in this patch series. + +Acked-by: Olivier Fourdan +Signed-off-by: Hans de Goede +(cherry picked from commit 10df0437a2b142e61c4d84ffffa9592ac6846ef1) +--- + hw/xwayland/xwayland.c | 25 +++++++++++++++++++++++++ + hw/xwayland/xwayland.h | 1 + + 2 files changed, 26 insertions(+) + +diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c +index 298ef3ac8..1294ff1d8 100644 +--- a/hw/xwayland/xwayland.c ++++ b/hw/xwayland/xwayland.c +@@ -1008,6 +1008,28 @@ xwl_resize_window(WindowPtr window, + xwl_window_check_resolution_change_emulation(xwl_window); + } + ++static void ++xwl_move_window(WindowPtr window, ++ int x, int y, ++ WindowPtr next_sib, ++ VTKind kind) ++{ ++ ScreenPtr screen = window->drawable.pScreen; ++ struct xwl_screen *xwl_screen; ++ struct xwl_window *xwl_window; ++ ++ xwl_screen = xwl_screen_get(screen); ++ xwl_window = xwl_window_from_window(window); ++ ++ screen->MoveWindow = xwl_screen->MoveWindow; ++ (*screen->MoveWindow) (window, x, y, next_sib, kind); ++ xwl_screen->MoveWindow = screen->MoveWindow; ++ screen->MoveWindow = xwl_move_window; ++ ++ if (xwl_window && (xwl_window_get(window) || xwl_window_is_toplevel(window))) ++ xwl_window_check_resolution_change_emulation(xwl_window); ++} ++ + static void + frame_callback(void *data, + struct wl_callback *callback, +@@ -1564,6 +1586,9 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) + xwl_screen->ResizeWindow = pScreen->ResizeWindow; + pScreen->ResizeWindow = xwl_resize_window; + ++ xwl_screen->MoveWindow = pScreen->MoveWindow; ++ pScreen->MoveWindow = xwl_move_window; ++ + if (xwl_screen->rootless) { + xwl_screen->SetWindowPixmap = pScreen->SetWindowPixmap; + pScreen->SetWindowPixmap = xwl_set_window_pixmap; +diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h +index 01aef27d2..72225374b 100644 +--- a/hw/xwayland/xwayland.h ++++ b/hw/xwayland/xwayland.h +@@ -138,6 +138,7 @@ struct xwl_screen { + SetWindowPixmapProcPtr SetWindowPixmap; + ChangeWindowAttributesProcPtr ChangeWindowAttributes; + ResizeWindowProcPtr ResizeWindow; ++ MoveWindowProcPtr MoveWindow; + + struct xorg_list output_list; + struct xorg_list seat_list; +-- +2.25.2 + diff --git a/0021-dix-Check-for-NULL-spriteInfo-in-GetPairedDevice.patch b/0021-dix-Check-for-NULL-spriteInfo-in-GetPairedDevice.patch deleted file mode 100644 index 38424e7..0000000 --- a/0021-dix-Check-for-NULL-spriteInfo-in-GetPairedDevice.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 3c48bd50ad33f2a533ac76afa38d6e3906ebc28a Mon Sep 17 00:00:00 2001 -From: Arthur Williams -Date: Sun, 6 Oct 2019 18:55:35 +0000 -Subject: [PATCH xserver 21/22] dix: Check for NULL spriteInfo in - GetPairedDevice - -There is a race when reseting the XServer that causes spriteInfo to be -NULL in GetPairedDevice resulting a segfault and subsequent crash. The -problem was noticed when opening a connection, creating master devices, -destroying master devices and closing the connection during testing. - -Signed-off-by: Arthur Williams - - -(cherry picked from commit e693c9657f98c334e9921ca2f8ebf710497c0c6a) ---- - dix/devices.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/dix/devices.c b/dix/devices.c -index 1b18b168e..00c453980 100644 ---- a/dix/devices.c -+++ b/dix/devices.c -@@ -2656,7 +2656,7 @@ GetPairedDevice(DeviceIntPtr dev) - if (!IsMaster(dev) && !IsFloating(dev)) - dev = GetMaster(dev, MASTER_ATTACHED); - -- return dev->spriteInfo->paired; -+ return dev->spriteInfo? dev->spriteInfo->paired: NULL; - } - - /** --- -2.24.1 - diff --git a/0014-xwayland-Fix-emulated-modes-not-being-removed-when-s.patch b/0021-xwayland-Fix-emulated-modes-not-being-removed-when-s.patch similarity index 90% rename from 0014-xwayland-Fix-emulated-modes-not-being-removed-when-s.patch rename to 0021-xwayland-Fix-emulated-modes-not-being-removed-when-s.patch index 5c0134c..2b1bc84 100644 --- a/0014-xwayland-Fix-emulated-modes-not-being-removed-when-s.patch +++ b/0021-xwayland-Fix-emulated-modes-not-being-removed-when-s.patch @@ -1,7 +1,7 @@ -From a5b9f4880ab61dc0c02065e6fdf5e2f16f36be7c Mon Sep 17 00:00:00 2001 +From 52bbef1f55d17229684b0d76a478ec639c4032ed Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 7 Oct 2019 14:27:49 +0200 -Subject: [PATCH xserver 14/17] xwayland: Fix emulated modes not being removed +Subject: [PATCH xserver 21/24] xwayland: Fix emulated modes not being removed when screen rotation is used The code building the mode-list does the following to deal with screen @@ -24,7 +24,9 @@ to a member of xwl_output->randr_output->modes, so we do not need to duplicate this code, instead we can simply check that the passed in mode is modes[0] which always is the actual output mode. +Acked-by: Olivier Fourdan Signed-off-by: Hans de Goede +(cherry picked from commit 88342353de45e64f408c38bb10cd1506ba0f159a) --- hw/xwayland/xwayland-output.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) @@ -57,5 +59,5 @@ index 20c254962..7d705d919 100644 else xwl_output_add_emulated_mode_for_client(xwl_output, client, mode, from_vidmode); -- -2.24.1 +2.25.2 diff --git a/0015-xwayland-Call-xwl_window_check_resolution_change_emu.patch b/0022-xwayland-Call-xwl_window_check_resolution_change_emu.patch similarity index 78% rename from 0015-xwayland-Call-xwl_window_check_resolution_change_emu.patch rename to 0022-xwayland-Call-xwl_window_check_resolution_change_emu.patch index 447fa28..0b6a07b 100644 --- a/0015-xwayland-Call-xwl_window_check_resolution_change_emu.patch +++ b/0022-xwayland-Call-xwl_window_check_resolution_change_emu.patch @@ -1,7 +1,7 @@ -From c0bae670131d7eef3d0a4d015a14899cbd4c9b2d Mon Sep 17 00:00:00 2001 +From 57d0ad44fd0b04fff98e9b484816dc95068a90cc Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 4 Nov 2019 11:46:49 +0100 -Subject: [PATCH xserver 15/17] xwayland: Call +Subject: [PATCH xserver 22/24] xwayland: Call xwl_window_check_resolution_change_emulation() on newly created O-R windows Some clients, which use vidmode to change the resolution when going fullscreen, @@ -20,20 +20,22 @@ thus will not have an xwl_window. This fixes ClanLib-0.6.x and alleggl-4.4.x using apps not properly fullscreening. +Acked-by: Olivier Fourdan Signed-off-by: Hans de Goede +(cherry picked from commit 4cfc2677f5c82ca5db0919de549b9b077f1ba113) --- hw/xwayland/xwayland.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index 1840ccbfb..181977033 100644 +index 1294ff1d8..6b86e56bd 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c -@@ -832,6 +832,11 @@ ensure_surface_for_window(WindowPtr window) +@@ -819,6 +819,11 @@ ensure_surface_for_window(WindowPtr window) xwl_window_init_allow_commits(xwl_window); -+ if (!xwl_screen_client_is_window_manager(xwl_screen, wClient(window))) { ++ if (!window_is_wm_window(window)) { + /* CSD or O-R toplevel window, check viewport on creation */ + xwl_window_check_resolution_change_emulation(xwl_window); + } @@ -42,5 +44,5 @@ index 1840ccbfb..181977033 100644 err_surf: -- -2.24.1 +2.25.2 diff --git a/0022-xwayland-glamor-gbm-Handle-DRM_FORMAT_MOD_INVALID-gr.patch b/0022-xwayland-glamor-gbm-Handle-DRM_FORMAT_MOD_INVALID-gr.patch deleted file mode 100644 index 3646f5c..0000000 --- a/0022-xwayland-glamor-gbm-Handle-DRM_FORMAT_MOD_INVALID-gr.patch +++ /dev/null @@ -1,41 +0,0 @@ -From a033571644d277dc49a489f7ae32c4ad92856543 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Jonas=20=C3=85dahl?= -Date: Fri, 13 Sep 2019 17:11:27 +0200 -Subject: [PATCH xserver 22/22] xwayland/glamor-gbm: Handle - DRM_FORMAT_MOD_INVALID gracefully -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -The compositor may send DRM_FORMAT_MOD_INVALID instead of a list of -modifiers for various reasons. Handle this gracefully by ignoring it. - -Without this, if a compositor would send DRM_FORMAT_MOD_INVALID, it'd -result in empty windows provided by Xwayland. - -Signed-off-by: Jonas Ådahl -Reviewed-by: Olivier Fourdan -Reviewed-by: Michel Dänzer -(cherry picked from commit edf964434eac10ffbe27cc883e3ab95505669aee) ---- - hw/xwayland/xwayland-glamor-gbm.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/hw/xwayland/xwayland-glamor-gbm.c b/hw/xwayland/xwayland-glamor-gbm.c -index c02ba7363..dce782fc3 100644 ---- a/hw/xwayland/xwayland-glamor-gbm.c -+++ b/hw/xwayland/xwayland-glamor-gbm.c -@@ -798,6 +798,10 @@ xwl_dmabuf_handle_modifier(void *data, struct zwp_linux_dmabuf_v1 *dmabuf, - struct xwl_format *xwl_format = NULL; - int i; - -+ if (modifier_hi == (DRM_FORMAT_MOD_INVALID >> 32) && -+ modifier_lo == (DRM_FORMAT_MOD_INVALID & 0xffffffff)) -+ return; -+ - for (i = 0; i < xwl_screen->num_formats; i++) { - if (xwl_screen->formats[i].format == format) { - xwl_format = &xwl_screen->formats[i]; --- -2.24.1 - diff --git a/0016-xwayland-Fix-setting-of-_XWAYLAND_RANDR_EMU_MONITOR_.patch b/0023-xwayland-Fix-setting-of-_XWAYLAND_RANDR_EMU_MONITOR_.patch similarity index 60% rename from 0016-xwayland-Fix-setting-of-_XWAYLAND_RANDR_EMU_MONITOR_.patch rename to 0023-xwayland-Fix-setting-of-_XWAYLAND_RANDR_EMU_MONITOR_.patch index 27a6a0a..f2654fb 100644 --- a/0016-xwayland-Fix-setting-of-_XWAYLAND_RANDR_EMU_MONITOR_.patch +++ b/0023-xwayland-Fix-setting-of-_XWAYLAND_RANDR_EMU_MONITOR_.patch @@ -1,7 +1,7 @@ -From 8a34f7eb226be8d8ae0d9920657c17848372c92e Mon Sep 17 00:00:00 2001 +From 87a1a7b9f8f7d848302057b9ca54f6729e82bbe7 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 4 Nov 2019 14:32:29 +0100 -Subject: [PATCH xserver 16/17] xwayland: Fix setting of +Subject: [PATCH xserver 23/24] xwayland: Fix setting of _XWAYLAND_RANDR_EMU_MONITOR_RECTS prop on new windows For window-manager managed windows, xwl_realize_window is only called for @@ -27,31 +27,42 @@ work. This fixes apps using the ogre3d library always running at the monitors native resolution. +Acked-by: Olivier Fourdan Signed-off-by: Hans de Goede +(cherry picked from commit 148f428dfccf606b932a00d5a00af06e8dca8a7e) --- - hw/xwayland/xwayland.c | 10 +++++++--- - 1 file changed, 7 insertions(+), 3 deletions(-) + hw/xwayland/xwayland.c | 12 +++++++++--- + 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index 181977033..d8e65d59f 100644 +index 6b86e56bd..e721d6cb5 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c -@@ -832,7 +832,13 @@ ensure_surface_for_window(WindowPtr window) +@@ -749,6 +749,7 @@ ensure_surface_for_window(WindowPtr window) + struct xwl_screen *xwl_screen; + struct xwl_window *xwl_window; + struct wl_region *region; ++ WindowPtr toplevel; + + if (xwl_window_get(window)) + return TRUE; +@@ -819,7 +820,14 @@ ensure_surface_for_window(WindowPtr window) xwl_window_init_allow_commits(xwl_window); -- if (!xwl_screen_client_is_window_manager(xwl_screen, wClient(window))) { -+ /* When a new windom-manager decoration window is realized, then the randr -+ * emulation props have not been set on the managed client window yet. +- if (!window_is_wm_window(window)) { ++ /* When a new window-manager window is realized, then the randr emulation ++ * props may have not been set on the managed client window yet. + */ -+ if (xwl_screen_client_is_window_manager(xwl_screen, wClient(window))) { -+ if (window->firstChild && window->firstChild == window->lastChild) -+ xwl_output_set_window_randr_emu_props(xwl_screen, window->firstChild); ++ if (window_is_wm_window(window)) { ++ toplevel = window_get_client_toplevel(window); ++ if (toplevel) ++ xwl_output_set_window_randr_emu_props(xwl_screen, toplevel); + } else { /* CSD or O-R toplevel window, check viewport on creation */ xwl_window_check_resolution_change_emulation(xwl_window); } -@@ -881,8 +887,6 @@ xwl_realize_window(WindowPtr window) +@@ -868,8 +876,6 @@ xwl_realize_window(WindowPtr window) return FALSE; } @@ -61,5 +72,5 @@ index 181977033..d8e65d59f 100644 } -- -2.24.1 +2.25.2 diff --git a/0017-xwayland-Remove-unnecessary-xwl_window_is_toplevel-c.patch b/0024-xwayland-Remove-unnecessary-xwl_window_is_toplevel-c.patch similarity index 87% rename from 0017-xwayland-Remove-unnecessary-xwl_window_is_toplevel-c.patch rename to 0024-xwayland-Remove-unnecessary-xwl_window_is_toplevel-c.patch index d745e1d..c4925c2 100644 --- a/0017-xwayland-Remove-unnecessary-xwl_window_is_toplevel-c.patch +++ b/0024-xwayland-Remove-unnecessary-xwl_window_is_toplevel-c.patch @@ -1,7 +1,7 @@ -From 28610d4f35d8bc30f30f33656777649ea355f3c2 Mon Sep 17 00:00:00 2001 +From 231d5e2da2e1b0aee3cfe6febc54daf7a0e4b4c7 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 4 Nov 2019 15:01:18 +0100 -Subject: [PATCH xserver 17/17] xwayland: Remove unnecessary +Subject: [PATCH xserver 24/24] xwayland: Remove unnecessary xwl_window_is_toplevel() check from xwl_output_set_window_randr_emu_props() Since the recent fix to call xwl_output_set_window_randr_emu_props() from @@ -13,7 +13,9 @@ This commit moves the check to xwl_output_set_randr_emu_prop_callback() so that we only do it when we are walking over all Windows of a client to update the property on a change of the emulated resolution. +Acked-by: Olivier Fourdan Signed-off-by: Hans de Goede +(cherry picked from commit d4faab8708779df265239b203ed5f020bff681bf) --- hw/xwayland/xwayland-output.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) @@ -43,5 +45,5 @@ index 7d705d919..084b669e4 100644 static void -- -2.24.1 +2.25.2 diff --git a/sources b/sources index 26e3be1..b0a0c91 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (xorg-server-1.20.7.tar.bz2) = c67612e379111c28c68941c0a660abf72be7669591b41ccaa3b3474c4540a03822a28d892831b12ce08bac6e5e7e33504c2d19ef2a0c2298f83bd083459f96f5 +SHA512 (xorg-server-1.20.8.tar.bz2) = ab0ec0fcbf490c61558b9297f61b58fd2dedb676c78bef6431dc9166054743b43a0091b88a8b3f4e81d1f539909440ee7e188a298cefabe13ea89159639cd805 diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 1e0bb79..75532b0 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -45,8 +45,8 @@ Summary: X.Org X11 X server Name: xorg-x11-server -Version: 1.20.7 -Release: 2%{?gitdate:.%{gitdate}}%{?dist} +Version: 1.20.8 +Release: 1%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org License: MIT @@ -92,40 +92,8 @@ Patch5: 0001-autobind-GPUs-to-the-screen.patch # because the display-managers are not ready yet, do not upstream Patch6: 0001-Fedora-hack-Make-the-suid-root-wrapper-always-start-.patch -# test for https://bugzilla.redhat.com/show_bug.cgi?id=1697591 -# see also https://gitlab.freedesktop.org/xorg/xserver/merge_requests/36 -# ofourdan> Disabling those for now, causing regressions (#1714981, #1723715) -#Patch21: 0001-modesetting-Weaksauce-atomic-property-debugging.patch -#Patch22: 0002-modesetting-Propagate-more-failure-in-drmmode_set_mo.patch -#Patch23: 0003-modesetting-Factor-out-drmmode_target_output.patch -#Patch24: 0004-modesetting-Use-atomic-instead-of-per-crtc-walks-whe.patch - # Backports from current stable "server-1.20-branch": -Patch100: 0001-configure-Define-GLAMOR_HAS_EGL_QUERY_DRIVER-when-av.patch -Patch101: 0002-modesetting-Explicitly-include-mi.h.patch -Patch102: 0003-Restrict-1x1-pixmap-filling-optimization-to-GXcopy.patch -Patch103: 0004-Revert-dri2-Don-t-make-reference-to-noClientExceptio.patch -Patch104: 0005-os-Ignore-dying-client-in-ResetCurrentRequest.patch -Patch105: 0006-xfree86-modes-Bail-from-xf86RotateRedisplay-if-pScre.patch -Patch106: 0007-modesetting-remove-unnecessary-error-message-fix-zap.patch -Patch107: 0008-glamor-Propagate-FBO-allocation-failure-for-picture-.patch -Patch108: 0009-glamor-Error-out-on-out-of-memory-when-allocating-PB.patch -Patch109: 0010-glamor-Propagate-glamor_prepare_access-failures-in-c.patch -Patch110: 0011-glamor-Fallback-to-system-memory-for-RW-PBO-buffer-a.patch -Patch111: 0012-glamor-Fix-a-compiler-warning-since-the-recent-OOM-f.patch -Patch112: 0013-modesetting-Disable-atomic-support-by-default.patch -Patch113: 0014-xwayland-Split-up-xwl_screen_post_damage-into-two-ph.patch -Patch114: 0015-xwayland-Call-glamor_block_handler-from-xwl_screen_p.patch -Patch115: 0016-xwayland-clear-pixmaps-after-creation-in-rootless-mo.patch -Patch116: 0017-xwayland-Add-xwl_window_create_frame_callback-helper.patch -Patch117: 0018-xwayland-Use-single-frame-callback-for-Present-flips.patch -Patch118: 0019-xwayland-Use-frame-callbacks-for-Present-vblank-even.patch -Patch119: 0020-Fix-building-with-fno-common.patch -Patch120: 0021-dix-Check-for-NULL-spriteInfo-in-GetPairedDevice.patch -Patch121: 0022-xwayland-glamor-gbm-Handle-DRM_FORMAT_MOD_INVALID-gr.patch -Patch122: 0001-xwayland-Delete-all-frame_callback_list-nodes-in-xwl.patch - # Backports from "master" upstream: # Backported Xwayland randr resolution change emulation support @@ -142,10 +110,17 @@ Patch510: 0010-xwayland-Add-xwlVidModeGetCurrentRRMode-helper-to-th.patch Patch511: 0011-xwayland-Add-vidmode-mode-changing-emulation-support.patch Patch512: 0012-xwayland-xwl_window_should_enable_viewport-Add-extra.patch Patch513: 0013-xwayland-Set-_XWAYLAND_RANDR_EMU_MONITOR_RECTS-prope.patch -Patch514: 0014-xwayland-Fix-emulated-modes-not-being-removed-when-s.patch -Patch515: 0015-xwayland-Call-xwl_window_check_resolution_change_emu.patch -Patch516: 0016-xwayland-Fix-setting-of-_XWAYLAND_RANDR_EMU_MONITOR_.patch -Patch517: 0017-xwayland-Remove-unnecessary-xwl_window_is_toplevel-c.patch +Patch514: 0014-xwayland-Cache-client-id-for-the-window-manager-clie.patch +Patch515: 0015-xwayland-Reuse-viewport-instead-of-recreating.patch +Patch516: 0016-xwayland-Recurse-on-finding-the-none-wm-owner.patch +Patch517: 0017-xwayland-Make-window_get_none_wm_owner-return-a-Wind.patch +Patch518: 0018-xwayland-Check-emulation-on-client-toplevel-resize.patch +Patch519: 0019-xwayland-Also-check-resolution-change-emulation-when.patch +Patch520: 0020-xwayland-Also-hook-screen-s-MoveWindow-method.patch +Patch521: 0021-xwayland-Fix-emulated-modes-not-being-removed-when-s.patch +Patch522: 0022-xwayland-Call-xwl_window_check_resolution_change_emu.patch +Patch523: 0023-xwayland-Fix-setting-of-_XWAYLAND_RANDR_EMU_MONITOR_.patch +Patch524: 0024-xwayland-Remove-unnecessary-xwl_window_is_toplevel-c.patch BuildRequires: systemtap-sdt-devel BuildRequires: git @@ -571,6 +546,11 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Mon Mar 30 2020 Olivier Fourdan - 1.20.8-1 +- xserver 1.20.8 +- Backport latest Xwayland randr resolution change emulation support + patches. + * Wed Mar 18 2020 Olivier Fourdan - 1.20.7-2 - Fix a crash on closing a window using Present found upstream: https://gitlab.freedesktop.org/xorg/xserver/issues/1000 diff --git a/xserver-1-2-glamor-Always-return-0-from-glamor_fds_from_pixmap-on-error.patch b/xserver-1-2-glamor-Always-return-0-from-glamor_fds_from_pixmap-on-error.patch deleted file mode 100644 index 32672f2..0000000 --- a/xserver-1-2-glamor-Always-return-0-from-glamor_fds_from_pixmap-on-error.patch +++ /dev/null @@ -1,54 +0,0 @@ -From patchwork Wed May 23 09:43:32 2018 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 8bit -Subject: [xserver, - 1/2] glamor: Always return 0 from glamor_fds_from_pixmap on error -From: =?utf-8?q?Michel_D=C3=A4nzer?= -X-Patchwork-Id: 224909 -Message-Id: <20180523094333.11076-1-michel@daenzer.net> -To: =?UTF-8?q?Louis-Francis=20Ratt=C3=A9-Boulianne?= , - Daniel Stone -Cc: xorg-devel@lists.x.org -Date: Wed, 23 May 2018 11:43:32 +0200 - -From: Michel Dänzer - -This matches what glamor_egl_fds_from_pixmap and dri3_fds_from_pixmap do -and what proc_dri3_buffers_from_pixmap expects. - -Fixes: c8c276c9569b "glamor: Implement PixmapFromBuffers and - BuffersFromPixmap" -Signed-off-by: Michel Dänzer ---- - glamor/glamor.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/glamor/glamor.c b/glamor/glamor.c -index d984d20f3..e2c74d17a 100644 ---- a/glamor/glamor.c -+++ b/glamor/glamor.c -@@ -836,20 +836,20 @@ glamor_fds_from_pixmap(ScreenPtr screen, PixmapPtr pixmap, int *fds, - glamor_get_screen_private(pixmap->drawable.pScreen); - - if (!glamor_priv->dri3_enabled) -- return -1; -+ return 0; - switch (pixmap_priv->type) { - case GLAMOR_TEXTURE_DRM: - case GLAMOR_TEXTURE_ONLY: - if (!glamor_pixmap_ensure_fbo(pixmap, pixmap->drawable.depth == 30 ? - GL_RGB10_A2 : GL_RGBA, 0)) -- return -1; -+ return 0; - return glamor_egl_fds_from_pixmap(screen, pixmap, fds, - strides, offsets, - modifier); - default: - break; - } -- return -1; -+ return 0; - } - - _X_EXPORT int diff --git a/xserver-2-2-glamor-Propagate-glamor_fds_from_pixmap-error-in-glamor_fd_from_pixmap.patch b/xserver-2-2-glamor-Propagate-glamor_fds_from_pixmap-error-in-glamor_fd_from_pixmap.patch deleted file mode 100644 index ab92d3f..0000000 --- a/xserver-2-2-glamor-Propagate-glamor_fds_from_pixmap-error-in-glamor_fd_from_pixmap.patch +++ /dev/null @@ -1,58 +0,0 @@ -From patchwork Wed May 23 09:43:33 2018 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 8bit -Subject: [xserver, 2/2] glamor: Propagate glamor_fds_from_pixmap error in - glamor_fd_from_pixmap -From: =?utf-8?q?Michel_D=C3=A4nzer?= -X-Patchwork-Id: 224910 -Message-Id: <20180523094333.11076-2-michel@daenzer.net> -To: =?UTF-8?q?Louis-Francis=20Ratt=C3=A9-Boulianne?= , - Daniel Stone -Cc: xorg-devel@lists.x.org -Date: Wed, 23 May 2018 11:43:33 +0200 - -From: Michel Dänzer - -glamor_fds_from_pixmap returns 0 on error, but we were treating that as -success, continuing with uninitialized stride and fd values. - -Also bail if the offset isn't 0, same as in dri3_fd_from_pixmap. - -Fixes: c8c276c9569b "glamor: Implement PixmapFromBuffers and - BuffersFromPixmap" -Signed-off-by: Michel Dänzer -Reviewed-by: Emil Velikov ---- - glamor/glamor.c | 16 +++++++--------- - 1 file changed, 7 insertions(+), 9 deletions(-) - -diff --git a/glamor/glamor.c b/glamor/glamor.c -index e2c74d17a..63f0947fa 100644 ---- a/glamor/glamor.c -+++ b/glamor/glamor.c -@@ -865,17 +865,15 @@ glamor_fd_from_pixmap(ScreenPtr screen, - &modifier); - - /* Pixmaps with multi-planes/modifier are not supported in this interface */ -- if (ret > 1) { -- while (ret > 0) -- close(fds[--ret]); -- return -1; -+ if (ret == 1 && offsets[0] == 0) { -+ *stride = strides[0]; -+ *size = pixmap->drawable.height * *stride; -+ return fds[0]; - } - -- ret = fds[0]; -- *stride = strides[0]; -- *size = pixmap->drawable.height * *stride; -- -- return ret; -+ while (ret > 0) -+ close(fds[--ret]); -+ return -1; - } - - _X_EXPORT int From 9d32eb45b593692f08b314491e44c58bba649742 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 29 Jul 2020 14:59:04 +0000 Subject: [PATCH 051/131] - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- xorg-x11-server.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 75532b0..cc5953a 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -46,7 +46,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.20.8 -Release: 1%{?gitdate:.%{gitdate}}%{?dist} +Release: 2%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org License: MIT @@ -546,6 +546,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Wed Jul 29 2020 Fedora Release Engineering - 1.20.8-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + * Mon Mar 30 2020 Olivier Fourdan - 1.20.8-1 - xserver 1.20.8 - Backport latest Xwayland randr resolution change emulation support From e6480d962889c5dfec84095b37099d73c9b72a8d Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Fri, 31 Jul 2020 11:39:27 -0400 Subject: [PATCH 052/131] Fix information disclosure bug in pixmap allocation (CVE-2020-14347) --- 0001-fix-for-ZDI-11426.patch | 33 +++++++++++++++++++++++++++++++++ xorg-x11-server.spec | 6 +++++- 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 0001-fix-for-ZDI-11426.patch diff --git a/0001-fix-for-ZDI-11426.patch b/0001-fix-for-ZDI-11426.patch new file mode 100644 index 0000000..9857e0d --- /dev/null +++ b/0001-fix-for-ZDI-11426.patch @@ -0,0 +1,33 @@ +From aac28e162e5108510065ad4c323affd6deffd816 Mon Sep 17 00:00:00 2001 +From: Matthieu Herrb +Date: Sat, 25 Jul 2020 19:33:50 +0200 +Subject: [PATCH xserver] fix for ZDI-11426 + +Avoid leaking un-initalized memory to clients by zeroing the +whole pixmap on initial allocation. + +This vulnerability was discovered by: +Jan-Niklas Sohn working with Trend Micro Zero Day Initiative + +Signed-off-by: Matthieu Herrb +Reviewed-by: Alan Coopersmith +--- + dix/pixmap.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/dix/pixmap.c b/dix/pixmap.c +index 1186d7dbbf..5a0146bbb6 100644 +--- a/dix/pixmap.c ++++ b/dix/pixmap.c +@@ -116,7 +116,7 @@ AllocatePixmap(ScreenPtr pScreen, int pixDataSize) + if (pScreen->totalPixmapSize > ((size_t) - 1) - pixDataSize) + return NullPixmap; + +- pPixmap = malloc(pScreen->totalPixmapSize + pixDataSize); ++ pPixmap = calloc(1, pScreen->totalPixmapSize + pixDataSize); + if (!pPixmap) + return NullPixmap; + +-- +2.23.0 + diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index cc5953a..095a8d6 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -46,7 +46,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.20.8 -Release: 2%{?gitdate:.%{gitdate}}%{?dist} +Release: 3%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org License: MIT @@ -95,6 +95,7 @@ Patch6: 0001-Fedora-hack-Make-the-suid-root-wrapper-always-start-.patch # Backports from current stable "server-1.20-branch": # Backports from "master" upstream: +Patch100: 0001-fix-for-ZDI-11426.patch # Backported Xwayland randr resolution change emulation support Patch501: 0001-dix-Add-GetCurrentClient-helper.patch @@ -546,6 +547,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Fri Jul 31 2020 Adam Jackson - 1.20.8-3 +- Fix information disclosure bug in pixmap allocation (CVE-2020-14347) + * Wed Jul 29 2020 Fedora Release Engineering - 1.20.8-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild From eb8a79641e423b9b6f437e15e2100cb2ce696454 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Wed, 12 Aug 2020 15:31:35 -0400 Subject: [PATCH 053/131] Enable XC-SECURITY --- xorg-x11-server.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 095a8d6..647148b 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -46,7 +46,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.20.8 -Release: 3%{?gitdate:.%{gitdate}}%{?dist} +Release: 4%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org License: MIT @@ -380,6 +380,7 @@ autoreconf -f -v --install || exit 1 --without-dtrace \ --disable-linux-acpi --disable-linux-apm \ --enable-xselinux --enable-record --enable-present \ + --enable-xcsecurity \ --enable-config-udev \ --disable-unit-tests \ --enable-dmx \ @@ -547,6 +548,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Wed Aug 12 2020 Adam Jackson - 1.20.8-4 +- Enable XC-SECURITY + * Fri Jul 31 2020 Adam Jackson - 1.20.8-3 - Fix information disclosure bug in pixmap allocation (CVE-2020-14347) From eaf442296937a83e622ce4995c5f33122bcd6f02 Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Thu, 8 Oct 2020 10:51:11 +0200 Subject: [PATCH 054/131] xserver 1.20.9 + all current fixes from upstream - Update to xserver 1.20.9 - Add all current fixes from the stable server-1.20-branch upstream - Backport latest Xwayland randr resolution change emulation support patches. --- ...-platform-device-probe-for-DT-based-.patch | 61 +++++ 0001-dix-Add-GetCurrentClient-helper.patch | 4 +- 0001-fix-for-ZDI-11426.patch | 33 --- ...-platform-device-PCI-detection-for-c.patch | 40 +++ ...p_viewport-wayland-extension-support.patch | 10 +- ...e-platform-device-probe-less-fragile.patch | 133 ++++++++++ ...fer_damage-instead-of-surface-damage.patch | 32 +-- ...-the-number-of-max.-input-devices-to.patch | 35 +++ ...e-output-modes-to-xrandr-output-mode.patch | 18 +- ...r_poly_fill_rect_gl-xRectangle-width.patch | 71 ++++++ ...ayland-Use-RandR-1.2-interface-rev-2.patch | 10 +- ...ond-reference-for-SavedCursor-in-xf8.patch | 34 +++ ...xwayland-Add-per-client-private-data.patch | 12 +- ...-t-use-page-flipping-for-windows-cli.patch | 37 +++ ...port-for-storing-per-client-per-outp.patch | 12 +- ...port-for-randr-resolution-change-emu.patch | 40 +-- ...indow-pixmap-in-xwl_present_check_fl.patch | 45 ++++ ...ove-dead-check-from-present_wnmd_che.patch | 33 +++ ...lRRModeToDisplayMode-helper-function.patch | 6 +- ...VidModeGetCurrentRRMode-helper-to-th.patch | 6 +- ...discard-frame-callbacks-on-allow-com.patch | 73 ++++++ ...mode-mode-changing-emulation-support.patch | 6 +- ...GetNodeTypeFromFd-for-checking-if-a-.patch | 68 +++++ ...pending-stream-reference-when-freein.patch | 43 ++++ ...dow_should_enable_viewport-Add-extra.patch | 8 +- ...p-target_msc-adjustment-out-of-prese.patch | 121 +++++++++ ...AYLAND_RANDR_EMU_MONITOR_RECTS-prope.patch | 24 +- ...nt-Add-present_vblank-exec_msc-field.patch | 236 ++++++++++++++++++ ...lient-id-for-the-window-manager-clie.patch | 18 +- ...md-Move-up-present_wnmd_queue_vblank.patch | 58 +++++ ...Reuse-viewport-instead-of-recreating.patch | 8 +- ...ecute-copies-at-target_msc-1-already.patch | 139 +++++++++++ ...Recurse-on-finding-the-none-wm-owner.patch | 12 +- ...ndow_get_none_wm_owner-return-a-Wind.patch | 12 +- ...-emulation-on-client-toplevel-resize.patch | 20 +- ...eck-resolution-change-emulation-when.patch | 8 +- ...Also-hook-screen-s-MoveWindow-method.patch | 12 +- ...lated-modes-not-being-removed-when-s.patch | 10 +- ...l_window_check_resolution_change_emu.patch | 8 +- ...ting-of-_XWAYLAND_RANDR_EMU_MONITOR_.patch | 12 +- ...unnecessary-xwl_window_is_toplevel-c.patch | 10 +- sources | 2 +- xorg-x11-server.spec | 24 +- 43 files changed, 1410 insertions(+), 194 deletions(-) create mode 100644 0001-Revert-linux-Fix-platform-device-probe-for-DT-based-.patch delete mode 100644 0001-fix-for-ZDI-11426.patch create mode 100644 0002-Revert-linux-Fix-platform-device-PCI-detection-for-c.patch create mode 100644 0003-Revert-linux-Make-platform-device-probe-less-fragile.patch create mode 100644 0004-include-Increase-the-number-of-max.-input-devices-to.patch create mode 100644 0005-glamor-Fix-glamor_poly_fill_rect_gl-xRectangle-width.patch create mode 100644 0006-xfree86-Take-second-reference-for-SavedCursor-in-xf8.patch create mode 100644 0007-present-wnmd-Can-t-use-page-flipping-for-windows-cli.patch create mode 100644 0008-xwayland-Check-window-pixmap-in-xwl_present_check_fl.patch create mode 100644 0009-present-wnmd-Remove-dead-check-from-present_wnmd_che.patch create mode 100644 0010-xwayland-Do-not-discard-frame-callbacks-on-allow-com.patch create mode 100644 0011-xwayland-use-drmGetNodeTypeFromFd-for-checking-if-a-.patch create mode 100644 0012-xwayland-Remove-pending-stream-reference-when-freein.patch create mode 100644 0013-present-Move-flip-target_msc-adjustment-out-of-prese.patch create mode 100644 0014-present-Add-present_vblank-exec_msc-field.patch create mode 100644 0015-present-wnmd-Move-up-present_wnmd_queue_vblank.patch create mode 100644 0016-present-wnmd-Execute-copies-at-target_msc-1-already.patch diff --git a/0001-Revert-linux-Fix-platform-device-probe-for-DT-based-.patch b/0001-Revert-linux-Fix-platform-device-probe-for-DT-based-.patch new file mode 100644 index 0000000..adeb9bd --- /dev/null +++ b/0001-Revert-linux-Fix-platform-device-probe-for-DT-based-.patch @@ -0,0 +1,61 @@ +From 4b6fce5975c2f931a0478cf4deeec97529b05eb6 Mon Sep 17 00:00:00 2001 +From: Olivier Fourdan +Date: Tue, 8 Sep 2020 10:01:55 +0200 +Subject: [PATCH xserver 01/16] Revert "linux: Fix platform device probe for + DT-based PCI" + +This reverts commit 249a12c54a9316b089bd22683c011519348496df. + +https://gitlab.freedesktop.org/xorg/xserver/-/issues/1068 +--- + config/udev.c | 27 +-------------------------- + 1 file changed, 1 insertion(+), 26 deletions(-) + +diff --git a/config/udev.c b/config/udev.c +index b00d90237..14409549b 100644 +--- a/config/udev.c ++++ b/config/udev.c +@@ -464,31 +464,6 @@ config_udev_fini(void) + + #ifdef CONFIG_UDEV_KMS + +-/* Find the last occurrence of the needle in haystack */ +-static char *strrstr(const char *haystack, const char *needle) +-{ +- char *prev, *last, *tmp; +- +- prev = strstr(haystack, needle); +- if (!prev) +- return NULL; +- +- last = prev; +- tmp = prev + 1; +- +- while (tmp) { +- last = strstr(tmp, needle); +- if (!last) +- return prev; +- else { +- prev = last; +- tmp = prev + 1; +- } +- } +- +- return last; +-} +- + static void + config_udev_odev_setup_attribs(struct udev_device *udev_device, const char *path, const char *syspath, + int major, int minor, +@@ -503,7 +478,7 @@ 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 && (str = strrstr(value, "pci-"))) { ++ if (value && (str = strstr(value, "pci-"))) { + attribs->busid = XNFstrdup(str); + attribs->busid[3] = ':'; + } +-- +2.28.0 + diff --git a/0001-dix-Add-GetCurrentClient-helper.patch b/0001-dix-Add-GetCurrentClient-helper.patch index d241c0e..95f4e4d 100644 --- a/0001-dix-Add-GetCurrentClient-helper.patch +++ b/0001-dix-Add-GetCurrentClient-helper.patch @@ -1,4 +1,4 @@ -From e78e96157efb523272404a85a9433c7b9803c1db Mon Sep 17 00:00:00 2001 +From 3d78af269556f554c517801d0de481ba56d4e603 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Thu, 29 Aug 2019 14:18:28 +0200 Subject: [PATCH xserver 01/24] dix: Add GetCurrentClient helper @@ -112,5 +112,5 @@ index b6e2bcfde..d65060cb6 100644 extern _X_EXPORT void SetInputCheck(HWEventQueuePtr /*c0 */ , HWEventQueuePtr /*c1 */ ); -- -2.25.2 +2.26.2 diff --git a/0001-fix-for-ZDI-11426.patch b/0001-fix-for-ZDI-11426.patch deleted file mode 100644 index 9857e0d..0000000 --- a/0001-fix-for-ZDI-11426.patch +++ /dev/null @@ -1,33 +0,0 @@ -From aac28e162e5108510065ad4c323affd6deffd816 Mon Sep 17 00:00:00 2001 -From: Matthieu Herrb -Date: Sat, 25 Jul 2020 19:33:50 +0200 -Subject: [PATCH xserver] fix for ZDI-11426 - -Avoid leaking un-initalized memory to clients by zeroing the -whole pixmap on initial allocation. - -This vulnerability was discovered by: -Jan-Niklas Sohn working with Trend Micro Zero Day Initiative - -Signed-off-by: Matthieu Herrb -Reviewed-by: Alan Coopersmith ---- - dix/pixmap.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/dix/pixmap.c b/dix/pixmap.c -index 1186d7dbbf..5a0146bbb6 100644 ---- a/dix/pixmap.c -+++ b/dix/pixmap.c -@@ -116,7 +116,7 @@ AllocatePixmap(ScreenPtr pScreen, int pixDataSize) - if (pScreen->totalPixmapSize > ((size_t) - 1) - pixDataSize) - return NullPixmap; - -- pPixmap = malloc(pScreen->totalPixmapSize + pixDataSize); -+ pPixmap = calloc(1, pScreen->totalPixmapSize + pixDataSize); - if (!pPixmap) - return NullPixmap; - --- -2.23.0 - diff --git a/0002-Revert-linux-Fix-platform-device-PCI-detection-for-c.patch b/0002-Revert-linux-Fix-platform-device-PCI-detection-for-c.patch new file mode 100644 index 0000000..79a5fff --- /dev/null +++ b/0002-Revert-linux-Fix-platform-device-PCI-detection-for-c.patch @@ -0,0 +1,40 @@ +From 39cb95e959fab97a7e255dda1a1599b096fb0f7e Mon Sep 17 00:00:00 2001 +From: Olivier Fourdan +Date: Tue, 8 Sep 2020 10:03:11 +0200 +Subject: [PATCH xserver 02/16] Revert "linux: Fix platform device PCI + detection for complex bus topologies" + +This reverts commit 5c96eb5f44e62a4cfe835023cde304eb5795b8fd. + +https://gitlab.freedesktop.org/xorg/xserver/-/issues/1068 +--- + config/udev.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/config/udev.c b/config/udev.c +index 14409549b..8c6c4b666 100644 +--- a/config/udev.c ++++ b/config/udev.c +@@ -470,7 +470,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, *str; ++ const char *value; + + attribs->path = XNFstrdup(path); + attribs->syspath = XNFstrdup(syspath); +@@ -478,8 +478,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 && (str = strstr(value, "pci-"))) { +- attribs->busid = XNFstrdup(str); ++ if (value && !strncmp(value, "pci-", 4)) { ++ attribs->busid = XNFstrdup(value); + attribs->busid[3] = ':'; + } + +-- +2.28.0 + diff --git a/0002-xwayland-Add-wp_viewport-wayland-extension-support.patch b/0002-xwayland-Add-wp_viewport-wayland-extension-support.patch index 441bf4c..894f273 100644 --- a/0002-xwayland-Add-wp_viewport-wayland-extension-support.patch +++ b/0002-xwayland-Add-wp_viewport-wayland-extension-support.patch @@ -1,4 +1,4 @@ -From c0981af6a683266e3f2adfdd7d6539104f502233 Mon Sep 17 00:00:00 2001 +From 14e9b030449611a7a80f640129138c49ab46774e Mon Sep 17 00:00:00 2001 From: Robert Mader Date: Mon, 22 Jan 2018 22:02:32 +0100 Subject: [PATCH xserver 02/24] xwayland: Add wp_viewport wayland extension @@ -81,10 +81,10 @@ index 36bf2133a..4a8d171bb 100644 xwayland_glamor = [] eglstream_srcs = [] diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index ed9f2e3c2..2084f2afb 100644 +index d02934cd5..98592025a 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c -@@ -923,6 +923,9 @@ registry_global(void *data, struct wl_registry *registry, uint32_t id, +@@ -925,6 +925,9 @@ registry_global(void *data, struct wl_registry *registry, uint32_t id, wl_registry_bind(registry, id, &zxdg_output_manager_v1_interface, 1); xwl_screen_init_xdg_output(xwl_screen); } @@ -95,7 +95,7 @@ index ed9f2e3c2..2084f2afb 100644 else if (xwl_screen->glamor) { xwl_glamor_init_wl_registry(xwl_screen, registry, id, interface, diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h -index daa719209..f949ea157 100644 +index b9495b313..91ae21eeb 100644 --- a/hw/xwayland/xwayland.h +++ b/hw/xwayland/xwayland.h @@ -48,6 +48,7 @@ @@ -115,5 +115,5 @@ index daa719209..f949ea157 100644 #define XWL_FORMAT_ARGB8888 (1 << 0) -- -2.25.2 +2.26.2 diff --git a/0003-Revert-linux-Make-platform-device-probe-less-fragile.patch b/0003-Revert-linux-Make-platform-device-probe-less-fragile.patch new file mode 100644 index 0000000..e3d2d8d --- /dev/null +++ b/0003-Revert-linux-Make-platform-device-probe-less-fragile.patch @@ -0,0 +1,133 @@ +From af4c84ce8855e84c0ad89b929bc972e884f0b8e3 Mon Sep 17 00:00:00 2001 +From: Olivier Fourdan +Date: Tue, 8 Sep 2020 10:03:33 +0200 +Subject: [PATCH xserver 03/16] Revert "linux: Make platform device probe less + fragile" + +This reverts commit 74b7427c41b4e4104af7abf70a996c086d3d7628. + +https://gitlab.freedesktop.org/xorg/xserver/-/issues/1068 +--- + config/udev.c | 17 +++++------------ + hw/xfree86/os-support/linux/lnx_platform.c | 20 ++++++++++++++++++-- + 2 files changed, 23 insertions(+), 14 deletions(-) + +diff --git a/config/udev.c b/config/udev.c +index 8c6c4b666..3a73189e2 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(struct udev_device *udev_device, const char *path, const char *syspath, ++config_udev_odev_setup_attribs(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(udev_device, path, syspath, major(devnum), ++ config_udev_odev_setup_attribs(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(device, path, syspath, major(devnum), ++ config_udev_odev_setup_attribs(path, syspath, major(devnum), + minor(devnum), DeleteGPUDeviceRequest); + /* Retry vtenter after a drm node removal */ + systemd_logind_vtenter(); +@@ -465,24 +465,17 @@ config_udev_fini(void) + #ifdef CONFIG_UDEV_KMS + + static void +-config_udev_odev_setup_attribs(struct udev_device *udev_device, const char *path, const char *syspath, ++config_udev_odev_setup_attribs(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); + } +@@ -523,7 +516,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(udev_device, path, syspath, major(devnum), ++ config_udev_odev_setup_attribs(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 e62306219..70374ace8 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,6 +48,18 @@ 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); +@@ -57,6 +69,10 @@ 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.28.0 + diff --git a/0003-xwayland-Use-buffer_damage-instead-of-surface-damage.patch b/0003-xwayland-Use-buffer_damage-instead-of-surface-damage.patch index acd1a06..8d925c2 100644 --- a/0003-xwayland-Use-buffer_damage-instead-of-surface-damage.patch +++ b/0003-xwayland-Use-buffer_damage-instead-of-surface-damage.patch @@ -1,4 +1,4 @@ -From ce5eef7d33d7ba37cabee6b2bb020ed62abe6208 Mon Sep 17 00:00:00 2001 +From a86c70ed7e9c2b4e8e2f93beddbc51c0cdad57f2 Mon Sep 17 00:00:00 2001 From: Robert Mader Date: Tue, 2 Jul 2019 12:03:12 +0200 Subject: [PATCH xserver 03/24] xwayland: Use buffer_damage instead of surface @@ -28,10 +28,10 @@ Signed-off-by: Hans de Goede (cherry picked from commit 7c6f17790d3aedb164481264b0f05a8a14103731) --- hw/xwayland/xwayland-cursor.c | 12 ++++++------ - hw/xwayland/xwayland-present.c | 6 +++--- + hw/xwayland/xwayland-present.c | 10 +++++----- hw/xwayland/xwayland.c | 29 +++++++++++++++++++++++------ hw/xwayland/xwayland.h | 3 +++ - 4 files changed, 35 insertions(+), 15 deletions(-) + 4 files changed, 37 insertions(+), 17 deletions(-) diff --git a/hw/xwayland/xwayland-cursor.c b/hw/xwayland/xwayland-cursor.c index 66720bcc0..cbc715061 100644 @@ -64,27 +64,31 @@ index 66720bcc0..cbc715061 100644 xwl_cursor->frame_cb = wl_surface_frame(xwl_cursor->surface); wl_callback_add_listener(xwl_cursor->frame_cb, &frame_listener, xwl_cursor); diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c -index 5ba7dce08..58c32941d 100644 +index 6076f6498..ef75ad2ef 100644 --- a/hw/xwayland/xwayland-present.c +++ b/hw/xwayland/xwayland-present.c -@@ -495,9 +495,9 @@ xwl_present_flip(WindowPtr present_window, +@@ -497,11 +497,11 @@ xwl_present_flip(WindowPtr present_window, /* Realign timer */ xwl_present_reset_timer(xwl_present_window); -- wl_surface_damage(xwl_window->surface, 0, 0, +- wl_surface_damage(xwl_window->surface, +- damage_box->x1 - present_window->drawable.x, +- damage_box->y1 - present_window->drawable.y, - damage_box->x2 - damage_box->x1, - damage_box->y2 - damage_box->y1); -+ xwl_surface_damage(xwl_window->xwl_screen, xwl_window->surface, 0, 0, ++ xwl_surface_damage(xwl_window->xwl_screen, xwl_window->surface, ++ damage_box->x1 - present_window->drawable.x, ++ damage_box->y1 - present_window->drawable.y, + damage_box->x2 - damage_box->x1, + damage_box->y2 - damage_box->y1); wl_surface_commit(xwl_window->surface); diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index 2084f2afb..942981834 100644 +index 98592025a..f7fcd1e32 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c -@@ -803,6 +803,16 @@ xwl_destroy_window(WindowPtr window) +@@ -805,6 +805,16 @@ xwl_destroy_window(WindowPtr window) return ret; } @@ -101,7 +105,7 @@ index 2084f2afb..942981834 100644 static void xwl_window_post_damage(struct xwl_window *xwl_window) { -@@ -839,13 +849,15 @@ xwl_window_post_damage(struct xwl_window *xwl_window) +@@ -841,13 +851,15 @@ xwl_window_post_damage(struct xwl_window *xwl_window) */ if (RegionNumRects(region) > 256) { box = RegionExtents(region); @@ -122,7 +126,7 @@ index 2084f2afb..942981834 100644 } xwl_window_create_frame_callback(xwl_window); -@@ -904,8 +916,13 @@ registry_global(void *data, struct wl_registry *registry, uint32_t id, +@@ -906,8 +918,13 @@ registry_global(void *data, struct wl_registry *registry, uint32_t id, struct xwl_screen *xwl_screen = data; if (strcmp(interface, "wl_compositor") == 0) { @@ -138,7 +142,7 @@ index 2084f2afb..942981834 100644 else if (strcmp(interface, "wl_shm") == 0) { xwl_screen->shm = wl_registry_bind(registry, id, &wl_shm_interface, 1); diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h -index f949ea157..fa78b5ab9 100644 +index 91ae21eeb..1244d2e91 100644 --- a/hw/xwayland/xwayland.h +++ b/hw/xwayland/xwayland.h @@ -382,6 +382,9 @@ struct xwl_output { @@ -149,8 +153,8 @@ index f949ea157..fa78b5ab9 100644 + struct wl_surface *surface, + int32_t x, int32_t y, int32_t width, int32_t height); - Bool xwl_screen_init_cursor(struct xwl_screen *xwl_screen); + void xwl_screen_roundtrip (struct xwl_screen *xwl_screen); -- -2.25.2 +2.26.2 diff --git a/0004-include-Increase-the-number-of-max.-input-devices-to.patch b/0004-include-Increase-the-number-of-max.-input-devices-to.patch new file mode 100644 index 0000000..579afbf --- /dev/null +++ b/0004-include-Increase-the-number-of-max.-input-devices-to.patch @@ -0,0 +1,35 @@ +From b28c882889cbea9be3748d3dee1b21ba6eb90b66 Mon Sep 17 00:00:00 2001 +From: Arthur Williams +Date: Fri, 25 Sep 2020 04:52:57 +0000 +Subject: [PATCH xserver 04/16] include: Increase the number of max. input + devices to 256. + +Extending the decade old f0124ed93, to increase the number of input +devices from 40 to 256. 40 translates at most 9 MD, while 256 will allow +63 MD. It is an arbitrary number, but people are hitting the current +limit under reasonable conditions. + +Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=64793 +Signed-off-by: Arthur Williams + +(cherry picked from commit fe439596b99db65bbae35eff1ea0b79db167f8d6) +--- + include/misc.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/include/misc.h b/include/misc.h +index 14920c3c3..9b422e53b 100644 +--- a/include/misc.h ++++ b/include/misc.h +@@ -91,7 +91,7 @@ OF THIS SOFTWARE. + #define LIMITCLIENTS 256 /* Must be a power of 2 and <= MAXCLIENTS */ + #define MAXEXTENSIONS 128 + #define MAXFORMATS 8 +-#define MAXDEVICES 40 /* input devices */ ++#define MAXDEVICES 256 /* input devices */ + #define GPU_SCREEN_OFFSET 256 + + /* 128 event opcodes for core + extension events, excluding GE */ +-- +2.28.0 + diff --git a/0004-xwayland-Add-fake-output-modes-to-xrandr-output-mode.patch b/0004-xwayland-Add-fake-output-modes-to-xrandr-output-mode.patch index 4e05547..86dde42 100644 --- a/0004-xwayland-Add-fake-output-modes-to-xrandr-output-mode.patch +++ b/0004-xwayland-Add-fake-output-modes-to-xrandr-output-mode.patch @@ -1,4 +1,4 @@ -From 6ff9bf9f005ce81b587d3b4345232c73fc12da53 Mon Sep 17 00:00:00 2001 +From c0595515c65571d6304530c51331013381eea1dd Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Wed, 26 Jun 2019 16:46:54 +0200 Subject: [PATCH xserver 04/24] xwayland: Add fake output modes to xrandr @@ -25,10 +25,10 @@ Signed-off-by: Hans de Goede 3 files changed, 124 insertions(+), 6 deletions(-) diff --git a/hw/xwayland/xwayland-output.c b/hw/xwayland/xwayland-output.c -index aa6f37864..2ccc3ca60 100644 +index ae646c663..4036ba681 100644 --- a/hw/xwayland/xwayland-output.c +++ b/hw/xwayland/xwayland-output.c -@@ -245,14 +245,110 @@ update_screen_size(struct xwl_output *xwl_output, int width, int height) +@@ -208,14 +208,110 @@ update_screen_size(struct xwl_output *xwl_output, int width, int height) update_desktop_dimensions(); } @@ -141,7 +141,7 @@ index aa6f37864..2ccc3ca60 100644 Bool need_rotate; /* Clear out the "done" received flags */ -@@ -271,12 +367,16 @@ apply_output_change(struct xwl_output *xwl_output) +@@ -234,12 +330,16 @@ apply_output_change(struct xwl_output *xwl_output) mode_height = xwl_output->width; } @@ -163,10 +163,10 @@ index aa6f37864..2ccc3ca60 100644 xorg_list_for_each_entry(it, &xwl_screen->output_list, link) { /* output done event is sent even when some property diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index 942981834..3c50396f1 100644 +index f7fcd1e32..ffd4809df 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c -@@ -152,6 +152,23 @@ xwl_screen_get(ScreenPtr screen) +@@ -154,6 +154,23 @@ xwl_screen_get(ScreenPtr screen) return dixLookupPrivate(&screen->devPrivates, &xwl_screen_private_key); } @@ -191,10 +191,10 @@ index 942981834..3c50396f1 100644 xwl_window_set_allow_commits(struct xwl_window *xwl_window, Bool allow, const char *debug_msg) diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h -index fa78b5ab9..c66997f00 100644 +index 1244d2e91..200e18a8d 100644 --- a/hw/xwayland/xwayland.h +++ b/hw/xwayland/xwayland.h -@@ -389,6 +389,7 @@ void xwl_surface_damage(struct xwl_screen *xwl_screen, +@@ -391,6 +391,7 @@ void xwl_screen_roundtrip (struct xwl_screen *xwl_screen); Bool xwl_screen_init_cursor(struct xwl_screen *xwl_screen); struct xwl_screen *xwl_screen_get(ScreenPtr screen); @@ -203,5 +203,5 @@ index fa78b5ab9..c66997f00 100644 void xwl_tablet_tool_set_cursor(struct xwl_tablet_tool *tool); void xwl_seat_set_cursor(struct xwl_seat *xwl_seat); -- -2.25.2 +2.26.2 diff --git a/0005-glamor-Fix-glamor_poly_fill_rect_gl-xRectangle-width.patch b/0005-glamor-Fix-glamor_poly_fill_rect_gl-xRectangle-width.patch new file mode 100644 index 0000000..50d22e5 --- /dev/null +++ b/0005-glamor-Fix-glamor_poly_fill_rect_gl-xRectangle-width.patch @@ -0,0 +1,71 @@ +From 8c3c8bda2c44fb3d62b954b02b08e3b1771ef5bc Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michel=20D=C3=A4nzer?= +Date: Tue, 25 Aug 2020 17:26:56 +0200 +Subject: [PATCH xserver 05/16] glamor: Fix glamor_poly_fill_rect_gl + xRectangle::width/height handling + +(Using GLSL 1.30 or newer) + +The width/height members of xRectangle are unsigned, but they were +being interpreted as signed when converting to floating point for the +vertex shader, producing incorrect drawing for values > 32767. + +v2: +* Use separate GL_UNSIGNED_SHORT vertex attribute for width/height. + (Eric Anholt) + +Reviewed-by: Eric Anholt +(cherry picked from commit 032af35657aa95c6bbdb74ff8c72e535b9b56cfa) +--- + glamor/glamor_rects.c | 18 ++++++++++++++---- + 1 file changed, 14 insertions(+), 4 deletions(-) + +diff --git a/glamor/glamor_rects.c b/glamor/glamor_rects.c +index 6cbb040c1..ae4fe8bcc 100644 +--- a/glamor/glamor_rects.c ++++ b/glamor/glamor_rects.c +@@ -27,8 +27,10 @@ + static const glamor_facet glamor_facet_polyfillrect_130 = { + .name = "poly_fill_rect", + .version = 130, +- .vs_vars = "attribute vec4 primitive;\n", +- .vs_exec = (" vec2 pos = primitive.zw * vec2(gl_VertexID&1, (gl_VertexID&2)>>1);\n" ++ .source_name = "size", ++ .vs_vars = "attribute vec2 primitive;\n" ++ "attribute vec2 size;\n", ++ .vs_exec = (" vec2 pos = size * vec2(gl_VertexID&1, (gl_VertexID&2)>>1);\n" + GLAMOR_POS(gl_Position, (primitive.xy + pos))), + }; + +@@ -81,9 +83,14 @@ glamor_poly_fill_rect_gl(DrawablePtr drawable, + + glEnableVertexAttribArray(GLAMOR_VERTEX_POS); + glVertexAttribDivisor(GLAMOR_VERTEX_POS, 1); +- glVertexAttribPointer(GLAMOR_VERTEX_POS, 4, GL_SHORT, GL_FALSE, ++ glVertexAttribPointer(GLAMOR_VERTEX_POS, 2, GL_SHORT, GL_FALSE, + 4 * sizeof (short), vbo_offset); + ++ glEnableVertexAttribArray(GLAMOR_VERTEX_SOURCE); ++ glVertexAttribDivisor(GLAMOR_VERTEX_SOURCE, 1); ++ glVertexAttribPointer(GLAMOR_VERTEX_SOURCE, 2, GL_UNSIGNED_SHORT, GL_FALSE, ++ 4 * sizeof (short), vbo_offset + 2 * sizeof (short)); ++ + memcpy(v, prect, nrect * sizeof (xRectangle)); + + glamor_put_vbo_space(screen); +@@ -156,8 +163,11 @@ glamor_poly_fill_rect_gl(DrawablePtr drawable, + + bail: + glDisable(GL_SCISSOR_TEST); +- if (glamor_priv->glsl_version >= 130) ++ if (glamor_priv->glsl_version >= 130) { ++ glVertexAttribDivisor(GLAMOR_VERTEX_SOURCE, 0); ++ glDisableVertexAttribArray(GLAMOR_VERTEX_SOURCE); + glVertexAttribDivisor(GLAMOR_VERTEX_POS, 0); ++ } + glDisableVertexAttribArray(GLAMOR_VERTEX_POS); + + return ret; +-- +2.28.0 + diff --git a/0005-xwayland-Use-RandR-1.2-interface-rev-2.patch b/0005-xwayland-Use-RandR-1.2-interface-rev-2.patch index 8585f82..ab50605 100644 --- a/0005-xwayland-Use-RandR-1.2-interface-rev-2.patch +++ b/0005-xwayland-Use-RandR-1.2-interface-rev-2.patch @@ -1,4 +1,4 @@ -From d837f7003d22c5e0d5bd05d41e872e7ee331dfa4 Mon Sep 17 00:00:00 2001 +From 19e725dd368e25c057770530cdd622234303003e Mon Sep 17 00:00:00 2001 From: Robert Mader Date: Mon, 22 Jan 2018 17:57:38 +0100 Subject: [PATCH xserver 05/24] xwayland: Use RandR 1.2 interface (rev 2) @@ -29,10 +29,10 @@ Signed-off-by: Hans de Goede 1 file changed, 81 insertions(+) diff --git a/hw/xwayland/xwayland-output.c b/hw/xwayland/xwayland-output.c -index 2ccc3ca60..67e99bdab 100644 +index 4036ba681..633ebb89e 100644 --- a/hw/xwayland/xwayland-output.c +++ b/hw/xwayland/xwayland-output.c -@@ -561,12 +561,80 @@ xwl_randr_get_info(ScreenPtr pScreen, Rotation * rotations) +@@ -524,12 +524,80 @@ xwl_randr_get_info(ScreenPtr pScreen, Rotation * rotations) return TRUE; } @@ -113,7 +113,7 @@ index 2ccc3ca60..67e99bdab 100644 Bool xwl_screen_init_output(struct xwl_screen *xwl_screen) -@@ -580,7 +648,20 @@ xwl_screen_init_output(struct xwl_screen *xwl_screen) +@@ -543,7 +611,20 @@ xwl_screen_init_output(struct xwl_screen *xwl_screen) rp = rrGetScrPriv(xwl_screen->screen); rp->rrGetInfo = xwl_randr_get_info; @@ -135,5 +135,5 @@ index 2ccc3ca60..67e99bdab 100644 return TRUE; } -- -2.25.2 +2.26.2 diff --git a/0006-xfree86-Take-second-reference-for-SavedCursor-in-xf8.patch b/0006-xfree86-Take-second-reference-for-SavedCursor-in-xf8.patch new file mode 100644 index 0000000..f083339 --- /dev/null +++ b/0006-xfree86-Take-second-reference-for-SavedCursor-in-xf8.patch @@ -0,0 +1,34 @@ +From 1e84fda2020b12a83c6b9c6d31ab84f993c6176c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michel=20D=C3=A4nzer?= +Date: Tue, 1 Sep 2020 11:24:57 +0200 +Subject: [PATCH xserver 06/16] xfree86: Take second reference for SavedCursor + in xf86CursorSetCursor + +The same pointer is kept in CurrentCursor as well, therefore two +RefCursor calls are needed. + +Fixes use-after-free after switching VTs. + +Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1067 +(cherry picked from commit 919f1f46fc67dae93b2b3f278fcbfc77af34ec58) +--- + hw/xfree86/ramdac/xf86CursorRD.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/hw/xfree86/ramdac/xf86CursorRD.c b/hw/xfree86/ramdac/xf86CursorRD.c +index ee1d98916..02dab36fe 100644 +--- a/hw/xfree86/ramdac/xf86CursorRD.c ++++ b/hw/xfree86/ramdac/xf86CursorRD.c +@@ -334,6 +334,9 @@ xf86CursorSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCurs, + ScreenPriv->HotY = cursor->bits->yhot; + + if (!infoPtr->pScrn->vtSema) { ++ cursor = RefCursor(cursor); ++ if (ScreenPriv->SavedCursor) ++ FreeCursor(ScreenPriv->SavedCursor, None); + ScreenPriv->SavedCursor = cursor; + return; + } +-- +2.28.0 + diff --git a/0006-xwayland-Add-per-client-private-data.patch b/0006-xwayland-Add-per-client-private-data.patch index fc4b473..3109b46 100644 --- a/0006-xwayland-Add-per-client-private-data.patch +++ b/0006-xwayland-Add-per-client-private-data.patch @@ -1,4 +1,4 @@ -From 80ca38c4428a499a795084dc696c390b707749b9 Mon Sep 17 00:00:00 2001 +From e6ba28eb96b227e47c371a7063f778fb2ab82a0b Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Thu, 29 Aug 2019 22:45:12 +0200 Subject: [PATCH xserver 06/24] xwayland: Add per client private data @@ -21,10 +21,10 @@ Signed-off-by: Hans de Goede 2 files changed, 19 insertions(+) diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index 3c50396f1..b0e37ceb9 100644 +index ffd4809df..e00dba334 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c -@@ -135,11 +135,18 @@ ddxProcessArgument(int argc, char *argv[], int i) +@@ -137,11 +137,18 @@ ddxProcessArgument(int argc, char *argv[], int i) return 0; } @@ -43,7 +43,7 @@ index 3c50396f1..b0e37ceb9 100644 static struct xwl_window * xwl_window_get(WindowPtr window) { -@@ -1143,6 +1150,13 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) +@@ -1158,6 +1165,13 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) return FALSE; if (!dixRegisterPrivateKey(&xwl_damage_private_key, PRIVATE_WINDOW, 0)) return FALSE; @@ -58,7 +58,7 @@ index 3c50396f1..b0e37ceb9 100644 dixSetPrivate(&pScreen->devPrivates, &xwl_screen_private_key, xwl_screen); xwl_screen->screen = pScreen; diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h -index c66997f00..593e92b64 100644 +index 200e18a8d..19626d394 100644 --- a/hw/xwayland/xwayland.h +++ b/hw/xwayland/xwayland.h @@ -379,8 +379,13 @@ struct xwl_output { @@ -76,5 +76,5 @@ index c66997f00..593e92b64 100644 void xwl_surface_damage(struct xwl_screen *xwl_screen, struct wl_surface *surface, -- -2.25.2 +2.26.2 diff --git a/0007-present-wnmd-Can-t-use-page-flipping-for-windows-cli.patch b/0007-present-wnmd-Can-t-use-page-flipping-for-windows-cli.patch new file mode 100644 index 0000000..947dd57 --- /dev/null +++ b/0007-present-wnmd-Can-t-use-page-flipping-for-windows-cli.patch @@ -0,0 +1,37 @@ +From f4006d795cb199bf7deeb00f542c592db6a5becb Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michel=20D=C3=A4nzer?= +Date: Mon, 7 Sep 2020 18:35:10 +0200 +Subject: [PATCH xserver 07/16] present/wnmd: Can't use page flipping for + windows clipped by children + +Noticed this was missing while working on the following fix. + +v2: +* Dropped present_wnmd_can_window_flip hunk (that function is never + called, will be cleaned up in a follow-up MR). + +Reviewed-by: Olivier Fourdan # v1 +Reviewed-by: Roman Gilg +(cherry picked from commit 7ac303c7b1e3b1be79ba3648e217798683e65a99) +--- + present/present_wnmd.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/present/present_wnmd.c b/present/present_wnmd.c +index 32c4d55f1..6a3d1035b 100644 +--- a/present/present_wnmd.c ++++ b/present/present_wnmd.c +@@ -291,6 +291,10 @@ present_wnmd_check_flip(RRCrtcPtr crtc, + if ( !RegionEqual(&window->winSize, &toplvl_window->winSize) ) + return FALSE; + ++ /* Can't flip if window clipped by children */ ++ if (!RegionEqual(&window->clipList, &window->winSize)) ++ return FALSE; ++ + /* Ask the driver for permission */ + if (screen_priv->wnmd_info->check_flip2) { + if (!(*screen_priv->wnmd_info->check_flip2) (crtc, window, pixmap, sync_flip, reason)) { +-- +2.28.0 + diff --git a/0007-xwayland-Add-support-for-storing-per-client-per-outp.patch b/0007-xwayland-Add-support-for-storing-per-client-per-outp.patch index 4d9b532..4c7c0e5 100644 --- a/0007-xwayland-Add-support-for-storing-per-client-per-outp.patch +++ b/0007-xwayland-Add-support-for-storing-per-client-per-outp.patch @@ -1,4 +1,4 @@ -From 879fed575deea57462217fc31eb331db8d23637c Mon Sep 17 00:00:00 2001 +From 575c8b49a715d45115625643b8495ad786961e38 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Thu, 29 Aug 2019 23:04:36 +0200 Subject: [PATCH xserver 07/24] xwayland: Add support for storing per client @@ -31,10 +31,10 @@ Signed-off-by: Hans de Goede 2 files changed, 84 insertions(+) diff --git a/hw/xwayland/xwayland-output.c b/hw/xwayland/xwayland-output.c -index 67e99bdab..82ff5db70 100644 +index 633ebb89e..64794dee7 100644 --- a/hw/xwayland/xwayland-output.c +++ b/hw/xwayland/xwayland-output.c -@@ -245,6 +245,73 @@ update_screen_size(struct xwl_output *xwl_output, int width, int height) +@@ -208,6 +208,73 @@ update_screen_size(struct xwl_output *xwl_output, int width, int height) update_desktop_dimensions(); } @@ -109,7 +109,7 @@ index 67e99bdab..82ff5db70 100644 const int32_t xwl_output_fake_modes[][2] = { /* 4:3 (1.33) */ diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h -index 593e92b64..0e6f92e63 100644 +index 19626d394..c886d77e9 100644 --- a/hw/xwayland/xwayland.h +++ b/hw/xwayland/xwayland.h @@ -379,7 +379,21 @@ struct xwl_output { @@ -134,7 +134,7 @@ index 593e92b64..0e6f92e63 100644 }; void xwl_window_create_frame_callback(struct xwl_window *xwl_window); -@@ -425,6 +439,9 @@ void xwl_output_destroy(struct xwl_output *xwl_output); +@@ -427,6 +441,9 @@ void xwl_output_destroy(struct xwl_output *xwl_output); void xwl_output_remove(struct xwl_output *xwl_output); @@ -145,5 +145,5 @@ index 593e92b64..0e6f92e63 100644 float VRefresh, Bool Reduced, Bool Interlaced); -- -2.25.2 +2.26.2 diff --git a/0008-xwayland-Add-support-for-randr-resolution-change-emu.patch b/0008-xwayland-Add-support-for-randr-resolution-change-emu.patch index 3038555..e3c5b5a 100644 --- a/0008-xwayland-Add-support-for-randr-resolution-change-emu.patch +++ b/0008-xwayland-Add-support-for-randr-resolution-change-emu.patch @@ -1,4 +1,4 @@ -From a640802d33e0daccf2d4045ecb3e70cbf56bf0ac Mon Sep 17 00:00:00 2001 +From 1317f1f02fd0037e2bf7a678f2c3a9a4170161e9 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Tue, 2 Jul 2019 11:55:26 +0200 Subject: [PATCH xserver 08/24] xwayland: Add support for randr-resolution @@ -37,10 +37,10 @@ Signed-off-by: Hans de Goede 4 files changed, 276 insertions(+), 6 deletions(-) diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c -index fa46ac3e7..97b8cd132 100644 +index a05d178ff..7d75a8f54 100644 --- a/hw/xwayland/xwayland-input.c +++ b/hw/xwayland/xwayland-input.c -@@ -486,6 +486,11 @@ dispatch_pointer_motion_event(struct xwl_seat *xwl_seat) +@@ -488,6 +488,11 @@ dispatch_pointer_motion_event(struct xwl_seat *xwl_seat) int dx = xwl_seat->focus_window->window->drawable.x; int dy = xwl_seat->focus_window->window->drawable.y; @@ -53,10 +53,10 @@ index fa46ac3e7..97b8cd132 100644 y = dy + sy; } else { diff --git a/hw/xwayland/xwayland-output.c b/hw/xwayland/xwayland-output.c -index 82ff5db70..99ab1b288 100644 +index 64794dee7..e09d00108 100644 --- a/hw/xwayland/xwayland-output.c +++ b/hw/xwayland/xwayland-output.c -@@ -408,6 +408,42 @@ err: +@@ -371,6 +371,42 @@ err: FatalError("Failed to allocate memory for list of RR modes"); } @@ -99,7 +99,7 @@ index 82ff5db70..99ab1b288 100644 static void apply_output_change(struct xwl_output *xwl_output) { -@@ -650,21 +686,36 @@ xwl_randr_screen_set_size(ScreenPtr pScreen, +@@ -613,21 +649,36 @@ xwl_randr_screen_set_size(ScreenPtr pScreen, static Bool xwl_randr_crtc_set(ScreenPtr pScreen, RRCrtcPtr crtc, @@ -143,10 +143,10 @@ index 82ff5db70..99ab1b288 100644 static Bool diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index b0e37ceb9..1ab5b3a28 100644 +index e00dba334..9c6cf7cf5 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c -@@ -176,6 +176,23 @@ xwl_screen_has_resolution_change_emulation(struct xwl_screen *xwl_screen) +@@ -178,6 +178,23 @@ xwl_screen_has_resolution_change_emulation(struct xwl_screen *xwl_screen) return xwl_screen->rootless && xwl_screen_has_viewport_support(xwl_screen); } @@ -170,7 +170,7 @@ index b0e37ceb9..1ab5b3a28 100644 static void xwl_window_set_allow_commits(struct xwl_window *xwl_window, Bool allow, const char *debug_msg) -@@ -512,6 +529,150 @@ xwl_pixmap_get(PixmapPtr pixmap) +@@ -514,6 +531,150 @@ xwl_pixmap_get(PixmapPtr pixmap) return dixLookupPrivate(&pixmap->devPrivates, &xwl_pixmap_private_key); } @@ -321,7 +321,7 @@ index b0e37ceb9..1ab5b3a28 100644 static void xwl_window_init_allow_commits(struct xwl_window *xwl_window) { -@@ -582,6 +743,8 @@ ensure_surface_for_window(WindowPtr window) +@@ -584,6 +745,8 @@ ensure_surface_for_window(WindowPtr window) xwl_window->xwl_screen = xwl_screen; xwl_window->window = window; @@ -330,7 +330,7 @@ index b0e37ceb9..1ab5b3a28 100644 xwl_window->surface = wl_compositor_create_surface(xwl_screen->compositor); if (xwl_window->surface == NULL) { ErrorF("wl_display_create_surface failed\n"); -@@ -623,6 +786,7 @@ ensure_surface_for_window(WindowPtr window) +@@ -625,6 +788,7 @@ ensure_surface_for_window(WindowPtr window) dixSetPrivate(&window->devPrivates, &xwl_window_private_key, xwl_window); xorg_list_init(&xwl_window->link_damage); @@ -338,7 +338,7 @@ index b0e37ceb9..1ab5b3a28 100644 #ifdef GLAMOR_HAS_GBM xorg_list_init(&xwl_window->frame_callback_list); -@@ -716,8 +880,12 @@ xwl_unrealize_window(WindowPtr window) +@@ -718,8 +882,12 @@ xwl_unrealize_window(WindowPtr window) if (!xwl_window) return ret; @@ -351,7 +351,7 @@ index b0e37ceb9..1ab5b3a28 100644 unregister_damage(window); if (xwl_window->frame_callback) -@@ -767,6 +935,33 @@ xwl_set_window_pixmap(WindowPtr window, +@@ -769,6 +937,33 @@ xwl_set_window_pixmap(WindowPtr window, ensure_surface_for_window(window); } @@ -385,15 +385,15 @@ index b0e37ceb9..1ab5b3a28 100644 static void frame_callback(void *data, struct wl_callback *callback, -@@ -1218,6 +1413,7 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) +@@ -1246,6 +1441,7 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) xorg_list_init(&xwl_screen->output_list); xorg_list_init(&xwl_screen->seat_list); xorg_list_init(&xwl_screen->damage_window_list); + xorg_list_init(&xwl_screen->window_list); xwl_screen->depth = 24; - xwl_screen->display = wl_display_connect(NULL); -@@ -1316,6 +1512,9 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) + if (!monitorResolution) +@@ -1340,6 +1536,9 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) xwl_screen->CloseScreen = pScreen->CloseScreen; pScreen->CloseScreen = xwl_close_screen; @@ -404,7 +404,7 @@ index b0e37ceb9..1ab5b3a28 100644 xwl_screen->SetWindowPixmap = pScreen->SetWindowPixmap; pScreen->SetWindowPixmap = xwl_set_window_pixmap; diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h -index 0e6f92e63..9adf3af76 100644 +index c886d77e9..36c4c4c8b 100644 --- a/hw/xwayland/xwayland.h +++ b/hw/xwayland/xwayland.h @@ -135,10 +135,12 @@ struct xwl_screen { @@ -434,7 +434,7 @@ index 0e6f92e63..9adf3af76 100644 struct wl_callback *frame_callback; Bool allow_commits; #ifdef GLAMOR_HAS_GBM -@@ -409,6 +415,9 @@ Bool xwl_screen_init_cursor(struct xwl_screen *xwl_screen); +@@ -411,6 +417,9 @@ Bool xwl_screen_init_cursor(struct xwl_screen *xwl_screen); struct xwl_screen *xwl_screen_get(ScreenPtr screen); Bool xwl_screen_has_resolution_change_emulation(struct xwl_screen *xwl_screen); @@ -444,7 +444,7 @@ index 0e6f92e63..9adf3af76 100644 void xwl_tablet_tool_set_cursor(struct xwl_tablet_tool *tool); void xwl_seat_set_cursor(struct xwl_seat *xwl_seat); -@@ -442,6 +451,12 @@ void xwl_output_remove(struct xwl_output *xwl_output); +@@ -444,6 +453,12 @@ void xwl_output_remove(struct xwl_output *xwl_output); struct xwl_emulated_mode *xwl_output_get_emulated_mode_for_client( struct xwl_output *xwl_output, ClientPtr client); @@ -458,5 +458,5 @@ index 0e6f92e63..9adf3af76 100644 float VRefresh, Bool Reduced, Bool Interlaced); -- -2.25.2 +2.26.2 diff --git a/0008-xwayland-Check-window-pixmap-in-xwl_present_check_fl.patch b/0008-xwayland-Check-window-pixmap-in-xwl_present_check_fl.patch new file mode 100644 index 0000000..6e846d2 --- /dev/null +++ b/0008-xwayland-Check-window-pixmap-in-xwl_present_check_fl.patch @@ -0,0 +1,45 @@ +From 51ee6e5ceb0cacc8e2fa225ad5391ffb159e36a0 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michel=20D=C3=A4nzer?= +Date: Mon, 7 Sep 2020 18:39:17 +0200 +Subject: [PATCH xserver 08/16] xwayland: Check window pixmap in + xwl_present_check_flip2 + +We can only flip if the window pixmap matches that of the toplevel +window. Doing so regardless could cause the toplevel window pixmap to +get destroyed while it was still referenced by the window, resulting in +use-after-free and likely a crash. + +Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1033 +Reviewed-by: Olivier Fourdan +Reviewed-by: Roman Gilg +(cherry picked from commit 4c25356d6cd908c5030c70e712076dff318ac00d) +--- + hw/xwayland/xwayland-present.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c +index 6076f6498..d177abdd8 100644 +--- a/hw/xwayland/xwayland-present.c ++++ b/hw/xwayland/xwayland-present.c +@@ -421,10 +421,18 @@ xwl_present_check_flip2(RRCrtcPtr crtc, + PresentFlipReason *reason) + { + struct xwl_window *xwl_window = xwl_window_from_window(present_window); ++ ScreenPtr screen = pixmap->drawable.pScreen; + + if (!xwl_window) + return FALSE; + ++ /* Can't flip if the window pixmap doesn't match the xwl_window parent ++ * window's, e.g. because a client redirected this window or one of its ++ * parents. ++ */ ++ if (screen->GetWindowPixmap(xwl_window->window) != screen->GetWindowPixmap(present_window)) ++ return FALSE; ++ + /* + * We currently only allow flips of windows, that have the same + * dimensions as their xwl_window parent window. For the case of +-- +2.28.0 + diff --git a/0009-present-wnmd-Remove-dead-check-from-present_wnmd_che.patch b/0009-present-wnmd-Remove-dead-check-from-present_wnmd_che.patch new file mode 100644 index 0000000..2bad794 --- /dev/null +++ b/0009-present-wnmd-Remove-dead-check-from-present_wnmd_che.patch @@ -0,0 +1,33 @@ +From 174cb91d82d643f78d8ba2b9999312b9d7dea98c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michel=20D=C3=A4nzer?= +Date: Mon, 7 Sep 2020 18:40:34 +0200 +Subject: [PATCH xserver 09/16] present/wnmd: Remove dead check from + present_wnmd_check_flip + +present_wnmd_toplvl_pixmap_window returns a window with the same window +pixmap, so the check could never fail. + +Reviewed-by: Roman Gilg +(cherry picked from commit b6b1161fd7ac409156fb69439897bcabdeacf393) +--- + present/present_wnmd.c | 4 ---- + 1 file changed, 4 deletions(-) + +diff --git a/present/present_wnmd.c b/present/present_wnmd.c +index 6a3d1035b..35ea12968 100644 +--- a/present/present_wnmd.c ++++ b/present/present_wnmd.c +@@ -270,10 +270,6 @@ present_wnmd_check_flip(RRCrtcPtr crtc, + if (!screen_priv->wnmd_info->flip) + return FALSE; + +- /* Can't flip redirected child windows */ +- if (screen->GetWindowPixmap(window) != screen->GetWindowPixmap(toplvl_window)) +- return FALSE; +- + /* Source pixmap must align with window exactly */ + if (x_off || y_off) + return FALSE; +-- +2.28.0 + diff --git a/0009-xwayland-Add-xwlRRModeToDisplayMode-helper-function.patch b/0009-xwayland-Add-xwlRRModeToDisplayMode-helper-function.patch index 403f950..7126893 100644 --- a/0009-xwayland-Add-xwlRRModeToDisplayMode-helper-function.patch +++ b/0009-xwayland-Add-xwlRRModeToDisplayMode-helper-function.patch @@ -1,4 +1,4 @@ -From 62e8b2ff7471f1a48b8bac9f41cceecea4931c03 Mon Sep 17 00:00:00 2001 +From 0efb1df3a2ef4bc2dd329af63e1bd3dbda3445e4 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 8 Jul 2019 14:00:27 +0200 Subject: [PATCH xserver 09/24] xwayland: Add xwlRRModeToDisplayMode() helper @@ -20,7 +20,7 @@ Signed-off-by: Hans de Goede 1 file changed, 28 insertions(+), 23 deletions(-) diff --git a/hw/xwayland/xwayland-vidmode.c b/hw/xwayland/xwayland-vidmode.c -index 0bcd11401..a59c9f6a9 100644 +index d25d1aca1..428af716d 100644 --- a/hw/xwayland/xwayland-vidmode.c +++ b/hw/xwayland/xwayland-vidmode.c @@ -78,13 +78,37 @@ mode_refresh(const xRRModeInfo *mode_info) @@ -97,5 +97,5 @@ index 0bcd11401..a59c9f6a9 100644 return TRUE; } -- -2.25.2 +2.26.2 diff --git a/0010-xwayland-Add-xwlVidModeGetCurrentRRMode-helper-to-th.patch b/0010-xwayland-Add-xwlVidModeGetCurrentRRMode-helper-to-th.patch index 7fa5a19..ee65f4d 100644 --- a/0010-xwayland-Add-xwlVidModeGetCurrentRRMode-helper-to-th.patch +++ b/0010-xwayland-Add-xwlVidModeGetCurrentRRMode-helper-to-th.patch @@ -1,4 +1,4 @@ -From 3ecabb250841ff0423744cd2291aaebf87b4239a Mon Sep 17 00:00:00 2001 +From fdbc9904d5af48db56877369f8b4671985ffc363 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 8 Jul 2019 18:35:27 +0200 Subject: [PATCH xserver 10/24] xwayland: Add xwlVidModeGetCurrentRRMode helper @@ -30,7 +30,7 @@ Signed-off-by: Hans de Goede 1 file changed, 56 insertions(+), 34 deletions(-) diff --git a/hw/xwayland/xwayland-vidmode.c b/hw/xwayland/xwayland-vidmode.c -index a59c9f6a9..e9aea7269 100644 +index 428af716d..7cf982fcc 100644 --- a/hw/xwayland/xwayland-vidmode.c +++ b/hw/xwayland/xwayland-vidmode.c @@ -103,26 +103,56 @@ xwlRRModeToDisplayMode(RRModePtr rrmode, DisplayModePtr mode) @@ -189,5 +189,5 @@ index a59c9f6a9..e9aea7269 100644 static void -- -2.25.2 +2.26.2 diff --git a/0010-xwayland-Do-not-discard-frame-callbacks-on-allow-com.patch b/0010-xwayland-Do-not-discard-frame-callbacks-on-allow-com.patch new file mode 100644 index 0000000..ea78fb5 --- /dev/null +++ b/0010-xwayland-Do-not-discard-frame-callbacks-on-allow-com.patch @@ -0,0 +1,73 @@ +From d108c2c82cba242ea5998d7c91254d90d3a5db71 Mon Sep 17 00:00:00 2001 +From: Olivier Fourdan +Date: Fri, 11 Sep 2020 11:30:18 +0200 +Subject: [PATCH xserver 10/16] xwayland: Do not discard frame callbacks on + allow commits +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Currently, when a X11 client (usually the X11 window manager from a +Wayland compositor) changes the value of the X11 property +`_XWAYLAND_ALLOW_COMMITS` from `false` to `true`, all pending frame +callbacks on the window are discarded so that the commit occurs +immediately. + +Weston uses that mechanism to prevent the content of the window from +showing before it's ready when mapping the window initially, but +discarding the pending frame callbacks has no effect on the initial +mapping of the X11 window since at that point there cannot be any frame +callback on a surface which hasn't been committed yet anyway. + +However, discarding pending frame callbacks can be problematic if we +were to use the same `_XWAYLAND_ALLOW_COMMITS` mechanism to prevent +damages to be posted before the X11 toplevel is updated completely +(including the window decorations from the X11 window manager). + +Remove the portion of code discarding the pending frame callback, +Xwayland should always wait for a pending frame callback if there's one +before posting new damages. + +Signed-off-by: Olivier Fourdan +Reviewed-by: Pekka Paalanen +Reviewed-by: Michel Dänzer +https://gitlab.freedesktop.org/xorg/xserver/merge_requests/333 +(cherry picked from commit 66da95a172c4941b75ffedcdaa0138c0a48f11fb) +--- + hw/xwayland/xwayland.c | 13 ------------- + 1 file changed, 13 deletions(-) + +diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c +index d02934cd5..a69188c0f 100644 +--- a/hw/xwayland/xwayland.c ++++ b/hw/xwayland/xwayland.c +@@ -193,8 +193,6 @@ static void + xwl_window_property_allow_commits(struct xwl_window *xwl_window, + PropertyStateRec *propstate) + { +- Bool old_allow_commits = xwl_window->allow_commits; +- + switch (propstate->state) { + case PropertyNewValue: + xwl_window_set_allow_commits_from_property(xwl_window, propstate->prop); +@@ -207,17 +205,6 @@ xwl_window_property_allow_commits(struct xwl_window *xwl_window, + default: + break; + } +- +- /* If allow_commits turned from off to on, discard any frame +- * callback we might be waiting for so that a new buffer is posted +- * immediately through block_handler() if there is damage to post. +- */ +- if (!old_allow_commits && xwl_window->allow_commits) { +- if (xwl_window->frame_callback) { +- wl_callback_destroy(xwl_window->frame_callback); +- xwl_window->frame_callback = NULL; +- } +- } + } + + static void +-- +2.28.0 + diff --git a/0011-xwayland-Add-vidmode-mode-changing-emulation-support.patch b/0011-xwayland-Add-vidmode-mode-changing-emulation-support.patch index cf706e3..3e8e038 100644 --- a/0011-xwayland-Add-vidmode-mode-changing-emulation-support.patch +++ b/0011-xwayland-Add-vidmode-mode-changing-emulation-support.patch @@ -1,4 +1,4 @@ -From 86e32a877ded8d67ec26ed2bcc06bd80ec2a5915 Mon Sep 17 00:00:00 2001 +From aa5920519dff3dc3dfb33af342e454627fa5402c Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Tue, 9 Jul 2019 09:31:13 +0200 Subject: [PATCH xserver 11/24] xwayland: Add vidmode mode changing emulation @@ -19,7 +19,7 @@ Signed-off-by: Hans de Goede 1 file changed, 86 insertions(+), 44 deletions(-) diff --git a/hw/xwayland/xwayland-vidmode.c b/hw/xwayland/xwayland-vidmode.c -index e9aea7269..56aac693a 100644 +index 7cf982fcc..99a4d2c92 100644 --- a/hw/xwayland/xwayland-vidmode.c +++ b/hw/xwayland/xwayland-vidmode.c @@ -106,26 +106,25 @@ xwlRRModeToDisplayMode(RRModePtr rrmode, DisplayModePtr mode) @@ -232,5 +232,5 @@ index e9aea7269..56aac693a 100644 static Bool -- -2.25.2 +2.26.2 diff --git a/0011-xwayland-use-drmGetNodeTypeFromFd-for-checking-if-a-.patch b/0011-xwayland-use-drmGetNodeTypeFromFd-for-checking-if-a-.patch new file mode 100644 index 0000000..f8b1463 --- /dev/null +++ b/0011-xwayland-use-drmGetNodeTypeFromFd-for-checking-if-a-.patch @@ -0,0 +1,68 @@ +From 1ac389dda89b2882c80767c91bbe88e01818491c Mon Sep 17 00:00:00 2001 +From: Greg V +Date: Tue, 15 Sep 2020 17:41:04 +0300 +Subject: [PATCH xserver 11/16] xwayland: use drmGetNodeTypeFromFd for checking + if a node is a render one + +Major/minor numbers are a.. major (ha) source of pain in FreeBSD porting. +In this case, Xwayland was thinking that /dev/dri/card0 is already a render node, +because the st_rdev on FreeBSD was passing the Linux-style check, +and because of the assumption, acceleration would fail because +various ioctls like AMDGPU_INFO would be denied on the non-render node. + +Switch to libdrm's function that already works correctly on all platforms. + +Signed-off-by: Greg V +Reviewed-by: Emmanuel Vadot +(cherry picked from commit 239ebdc9e447d4f836d0c2aa6068c6064fffb46c) +--- + hw/xwayland/xwayland-glamor-gbm.c | 19 ++----------------- + 1 file changed, 2 insertions(+), 17 deletions(-) + +diff --git a/hw/xwayland/xwayland-glamor-gbm.c b/hw/xwayland/xwayland-glamor-gbm.c +index ebff70a00..b519492cc 100644 +--- a/hw/xwayland/xwayland-glamor-gbm.c ++++ b/hw/xwayland/xwayland-glamor-gbm.c +@@ -110,21 +110,6 @@ wl_drm_format_for_depth(int depth) + } + } + +-static char +-is_fd_render_node(int fd) +-{ +- struct stat render; +- +- if (fstat(fd, &render)) +- return 0; +- if (!S_ISCHR(render.st_mode)) +- return 0; +- if (render.st_rdev & 0x80) +- return 1; +- +- return 0; +-} +- + static char + is_device_path_render_node (const char *device_path) + { +@@ -135,7 +120,7 @@ is_device_path_render_node (const char *device_path) + if (fd < 0) + return 0; + +- is_render_node = is_fd_render_node(fd); ++ is_render_node = (drmGetNodeTypeFromFd(fd) == DRM_NODE_RENDER); + close(fd); + + return is_render_node; +@@ -767,7 +752,7 @@ xwl_drm_handle_device(void *data, struct wl_drm *drm, const char *device) + return; + } + +- if (is_fd_render_node(xwl_gbm->drm_fd)) { ++ if (drmGetNodeTypeFromFd(xwl_gbm->drm_fd) == DRM_NODE_RENDER) { + xwl_gbm->fd_render_node = 1; + xwl_screen->expecting_event--; + } else { +-- +2.28.0 + diff --git a/0012-xwayland-Remove-pending-stream-reference-when-freein.patch b/0012-xwayland-Remove-pending-stream-reference-when-freein.patch new file mode 100644 index 0000000..e3565dc --- /dev/null +++ b/0012-xwayland-Remove-pending-stream-reference-when-freein.patch @@ -0,0 +1,43 @@ +From 1930ed233fdec5d22e4fc192769a0126faabb3ea Mon Sep 17 00:00:00 2001 +From: Olivier Fourdan +Date: Mon, 14 Sep 2020 15:39:10 +0200 +Subject: [PATCH xserver 12/16] xwayland: Remove pending stream reference when + freeing + +The EGLStream backend keeps a queue of pending streams for each Xwayland +window. + +However, when this pending queue is freed, the corresponding private +data may not be cleared (typically if the pixmap for this window has +changed before the compositor finished attaching the consumer for the +window's pixmap's original eglstream), leading to a use-after-free and a +crash when trying to use that data as the window pixmap. + +Make sure to clear the private data when the pending stream is freed. + +Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1055 +Signed-off-by: Olivier Fourdan +Tested-by: Karol Szuster +Reviewed-by: Adam Jackson +(cherry picked from commit a5f439dcd21b4fda093cb382bb1a758b434a1444) +--- + hw/xwayland/xwayland-glamor-eglstream.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/hw/xwayland/xwayland-glamor-eglstream.c b/hw/xwayland/xwayland-glamor-eglstream.c +index 36b749aaf..0c32fff4d 100644 +--- a/hw/xwayland/xwayland-glamor-eglstream.c ++++ b/hw/xwayland/xwayland-glamor-eglstream.c +@@ -431,8 +431,8 @@ xwl_eglstream_consumer_ready_callback(void *data, + DebugF("eglstream: win %d completes eglstream for pixmap %p, congrats!\n", + pending->window->drawable.id, pending->pixmap); + +- xwl_eglstream_window_set_pending(pending->window, NULL); + out: ++ xwl_eglstream_window_set_pending(pending->window, NULL); + xorg_list_del(&pending->link); + free(pending); + } +-- +2.28.0 + diff --git a/0012-xwayland-xwl_window_should_enable_viewport-Add-extra.patch b/0012-xwayland-xwl_window_should_enable_viewport-Add-extra.patch index 573ab8e..3086baa 100644 --- a/0012-xwayland-xwl_window_should_enable_viewport-Add-extra.patch +++ b/0012-xwayland-xwl_window_should_enable_viewport-Add-extra.patch @@ -1,4 +1,4 @@ -From fd95c9a52e35e994e140a925cfc01587257d4511 Mon Sep 17 00:00:00 2001 +From a090b038c45732676d9b7e367848d5bee7ab0ea5 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 26 Aug 2019 12:26:34 +0200 Subject: [PATCH xserver 12/24] xwayland: xwl_window_should_enable_viewport: @@ -25,10 +25,10 @@ Signed-off-by: Hans de Goede 1 file changed, 17 insertions(+) diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index 1ab5b3a28..85036adfe 100644 +index 9c6cf7cf5..2e01822fd 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c -@@ -649,6 +649,23 @@ xwl_window_should_enable_viewport(struct xwl_window *xwl_window, +@@ -651,6 +651,23 @@ xwl_window_should_enable_viewport(struct xwl_window *xwl_window, } } @@ -53,5 +53,5 @@ index 1ab5b3a28..85036adfe 100644 } -- -2.25.2 +2.26.2 diff --git a/0013-present-Move-flip-target_msc-adjustment-out-of-prese.patch b/0013-present-Move-flip-target_msc-adjustment-out-of-prese.patch new file mode 100644 index 0000000..eedcbaf --- /dev/null +++ b/0013-present-Move-flip-target_msc-adjustment-out-of-prese.patch @@ -0,0 +1,121 @@ +From dae234efdb7bba75744aa1697386df3c0db5348a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michel=20D=C3=A4nzer?= +Date: Fri, 11 Sep 2020 17:00:18 +0200 +Subject: [PATCH xserver 13/16] present: Move flip target_msc adjustment out of + present_vblank_create + +Preparation for different handling between SCMD & WNMD. No functional +change intended. + +Reviewed-by: Roman Gilg +Tested-by: Roman Gilg +(cherry picked from commit 4c92dea952f7fed19857904f0f552900257ef4b9) +--- + present/present_priv.h | 2 +- + present/present_scmd.c | 5 ++++- + present/present_vblank.c | 9 ++++----- + present/present_wnmd.c | 5 ++++- + 4 files changed, 13 insertions(+), 8 deletions(-) + +diff --git a/present/present_priv.h b/present/present_priv.h +index 5849b9e0b..90c3f4e79 100644 +--- a/present/present_priv.h ++++ b/present/present_priv.h +@@ -469,7 +469,7 @@ present_vblank_create(WindowPtr window, + const uint32_t *capabilities, + present_notify_ptr notifies, + int num_notifies, +- uint64_t *target_msc, ++ uint64_t target_msc, + uint64_t crtc_msc); + + void +diff --git a/present/present_scmd.c b/present/present_scmd.c +index 6a580cb7a..a4d046ca8 100644 +--- a/present/present_scmd.c ++++ b/present/present_scmd.c +@@ -745,12 +745,15 @@ present_scmd_pixmap(WindowPtr window, + screen_priv->info ? &screen_priv->info->capabilities : NULL, + notifies, + num_notifies, +- &target_msc, ++ target_msc, + crtc_msc); + + if (!vblank) + return BadAlloc; + ++ if (vblank->flip && vblank->sync_flip) ++ target_msc--; ++ + xorg_list_append(&vblank->event_queue, &present_exec_queue); + vblank->queued = TRUE; + if (msc_is_after(target_msc, crtc_msc)) { +diff --git a/present/present_vblank.c b/present/present_vblank.c +index 2c124f4bb..a4b70c0d9 100644 +--- a/present/present_vblank.c ++++ b/present/present_vblank.c +@@ -57,7 +57,7 @@ present_vblank_create(WindowPtr window, + const uint32_t *capabilities, + present_notify_ptr notifies, + int num_notifies, +- uint64_t *target_msc, ++ uint64_t target_msc, + uint64_t crtc_msc) + { + ScreenPtr screen = window->drawable.pScreen; +@@ -100,7 +100,7 @@ present_vblank_create(WindowPtr window, + + vblank->x_off = x_off; + vblank->y_off = y_off; +- vblank->target_msc = *target_msc; ++ vblank->target_msc = target_msc; + vblank->crtc = target_crtc; + vblank->msc_offset = window_priv->msc_offset; + vblank->notifies = notifies; +@@ -111,12 +111,11 @@ present_vblank_create(WindowPtr window, + if (pixmap != NULL && + !(options & PresentOptionCopy) && + capabilities) { +- if (msc_is_after(*target_msc, crtc_msc) && ++ if (msc_is_after(target_msc, crtc_msc) && + screen_priv->check_flip (target_crtc, window, pixmap, TRUE, valid, x_off, y_off, &reason)) + { + vblank->flip = TRUE; + vblank->sync_flip = TRUE; +- *target_msc = *target_msc - 1; + } else if ((*capabilities & PresentCapabilityAsync) && + screen_priv->check_flip (target_crtc, window, pixmap, FALSE, valid, x_off, y_off, &reason)) + { +@@ -139,7 +138,7 @@ present_vblank_create(WindowPtr window, + + if (pixmap) + DebugPresent(("q %" PRIu64 " %p %" PRIu64 ": %08" PRIx32 " -> %08" PRIx32 " (crtc %p) flip %d vsync %d serial %d\n", +- vblank->event_id, vblank, *target_msc, ++ vblank->event_id, vblank, target_msc, + vblank->pixmap->drawable.id, vblank->window->drawable.id, + target_crtc, vblank->flip, vblank->sync_flip, vblank->serial)); + return vblank; +diff --git a/present/present_wnmd.c b/present/present_wnmd.c +index 35ea12968..31e83d6ee 100644 +--- a/present/present_wnmd.c ++++ b/present/present_wnmd.c +@@ -626,11 +626,14 @@ present_wnmd_pixmap(WindowPtr window, + &screen_priv->wnmd_info->capabilities, + notifies, + num_notifies, +- &target_msc, ++ target_msc, + crtc_msc); + if (!vblank) + return BadAlloc; + ++ if (vblank->flip && vblank->sync_flip) ++ target_msc--; ++ + xorg_list_append(&vblank->event_queue, &window_priv->exec_queue); + vblank->queued = TRUE; + if (crtc_msc < target_msc) { +-- +2.28.0 + diff --git a/0013-xwayland-Set-_XWAYLAND_RANDR_EMU_MONITOR_RECTS-prope.patch b/0013-xwayland-Set-_XWAYLAND_RANDR_EMU_MONITOR_RECTS-prope.patch index cfcfd4c..83116b9 100644 --- a/0013-xwayland-Set-_XWAYLAND_RANDR_EMU_MONITOR_RECTS-prope.patch +++ b/0013-xwayland-Set-_XWAYLAND_RANDR_EMU_MONITOR_RECTS-prope.patch @@ -1,4 +1,4 @@ -From dda4a8b2f672eb5791f39222dd0996e07b416eb7 Mon Sep 17 00:00:00 2001 +From e40d94637207543481769fb570515b782225ff09 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 2 Sep 2019 17:32:45 +0200 Subject: [PATCH xserver 13/24] xwayland: Set _XWAYLAND_RANDR_EMU_MONITOR_RECTS @@ -37,7 +37,7 @@ Signed-off-by: Hans de Goede 3 files changed, 103 insertions(+) diff --git a/hw/xwayland/xwayland-output.c b/hw/xwayland/xwayland-output.c -index 99ab1b288..20c254962 100644 +index e09d00108..0d6b9ac9f 100644 --- a/hw/xwayland/xwayland-output.c +++ b/hw/xwayland/xwayland-output.c @@ -29,6 +29,7 @@ @@ -46,9 +46,9 @@ index 99ab1b288..20c254962 100644 #include +#include - #define DEFAULT_DPI 96 #define ALL_ROTATIONS (RR_Rotate_0 | \ -@@ -428,6 +429,80 @@ xwl_output_find_mode(struct xwl_output *xwl_output, + RR_Rotate_90 | \ +@@ -391,6 +392,80 @@ xwl_output_find_mode(struct xwl_output *xwl_output, return NULL; } @@ -129,7 +129,7 @@ index 99ab1b288..20c254962 100644 void xwl_output_set_emulated_mode(struct xwl_output *xwl_output, ClientPtr client, RRModePtr mode, Bool from_vidmode) -@@ -442,6 +517,8 @@ xwl_output_set_emulated_mode(struct xwl_output *xwl_output, ClientPtr client, +@@ -405,6 +480,8 @@ xwl_output_set_emulated_mode(struct xwl_output *xwl_output, ClientPtr client, xwl_output_add_emulated_mode_for_client(xwl_output, client, mode, from_vidmode); xwl_screen_check_resolution_change_emulation(xwl_output->xwl_screen); @@ -139,10 +139,10 @@ index 99ab1b288..20c254962 100644 static void diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index 85036adfe..e43f3de96 100644 +index 2e01822fd..ac4d98e6a 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c -@@ -690,6 +690,27 @@ xwl_screen_check_resolution_change_emulation(struct xwl_screen *xwl_screen) +@@ -692,6 +692,27 @@ xwl_screen_check_resolution_change_emulation(struct xwl_screen *xwl_screen) xwl_window_check_resolution_change_emulation(xwl_window); } @@ -170,7 +170,7 @@ index 85036adfe..e43f3de96 100644 static void xwl_window_init_allow_commits(struct xwl_window *xwl_window) { -@@ -855,6 +876,8 @@ xwl_realize_window(WindowPtr window) +@@ -857,6 +878,8 @@ xwl_realize_window(WindowPtr window) return FALSE; } @@ -180,10 +180,10 @@ index 85036adfe..e43f3de96 100644 } diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h -index 9adf3af76..eb8c4bd70 100644 +index 36c4c4c8b..1317ae5bb 100644 --- a/hw/xwayland/xwayland.h +++ b/hw/xwayland/xwayland.h -@@ -418,6 +418,7 @@ Bool xwl_screen_has_resolution_change_emulation(struct xwl_screen *xwl_screen); +@@ -420,6 +420,7 @@ Bool xwl_screen_has_resolution_change_emulation(struct xwl_screen *xwl_screen); struct xwl_output *xwl_screen_get_first_output(struct xwl_screen *xwl_screen); void xwl_screen_check_resolution_change_emulation(struct xwl_screen *xwl_screen); Bool xwl_window_has_viewport_enabled(struct xwl_window *xwl_window); @@ -191,7 +191,7 @@ index 9adf3af76..eb8c4bd70 100644 void xwl_tablet_tool_set_cursor(struct xwl_tablet_tool *tool); void xwl_seat_set_cursor(struct xwl_seat *xwl_seat); -@@ -456,6 +457,8 @@ RRModePtr xwl_output_find_mode(struct xwl_output *xwl_output, +@@ -458,6 +459,8 @@ RRModePtr xwl_output_find_mode(struct xwl_output *xwl_output, void xwl_output_set_emulated_mode(struct xwl_output *xwl_output, ClientPtr client, RRModePtr mode, Bool from_vidmode); @@ -201,5 +201,5 @@ index 9adf3af76..eb8c4bd70 100644 RRModePtr xwayland_cvt(int HDisplay, int VDisplay, float VRefresh, Bool Reduced, Bool Interlaced); -- -2.25.2 +2.26.2 diff --git a/0014-present-Add-present_vblank-exec_msc-field.patch b/0014-present-Add-present_vblank-exec_msc-field.patch new file mode 100644 index 0000000..e15a7df --- /dev/null +++ b/0014-present-Add-present_vblank-exec_msc-field.patch @@ -0,0 +1,236 @@ +From 669e40390c3679b649db33f0aa4ae4cfdd17e2a9 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michel=20D=C3=A4nzer?= +Date: Fri, 11 Sep 2020 17:00:35 +0200 +Subject: [PATCH xserver 14/16] present: Add present_vblank::exec_msc field +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +For tracking the MSC when the present can be executed separately from +the target MSC. + +Allows removing the requeue field instead, plus more later. + +v2: +* Rename wait_msc → exec_msc (Roman Gilg) +* Use exec_msc = target_msc instead of exec_msc++, for clarity. +* Bug fix: Set exec_msc = target_msc also if present_flip returned + false in present_execute. +v3: +* Set exec_msc = target_msc also if present_wnmd_flip returned + false in present_wnmd_execute, for consistency. +v4: +* Specifically check for exec_msc == crtc_msc + 1 in + present_execute_wait/copy, to avoid re-introducing + https://bugs.freedesktop.org/show_bug.cgi?id=94596 . + +Reviewed-by: Roman Gilg +Tested-by: Roman Gilg +(cherry picked from commit b0b3159abd8001fa3f6dfc44a288a95a62aa5cf6) +--- + present/present_execute.c | 23 ++++++++++------------- + present/present_priv.h | 4 ++-- + present/present_scmd.c | 13 +++++++------ + present/present_vblank.c | 9 +++++---- + present/present_wnmd.c | 13 +++++++------ + 5 files changed, 31 insertions(+), 31 deletions(-) + +diff --git a/present/present_execute.c b/present/present_execute.c +index 8d1ef4a8c..58066db86 100644 +--- a/present/present_execute.c ++++ b/present/present_execute.c +@@ -48,16 +48,13 @@ present_execute_wait(present_vblank_ptr vblank, uint64_t crtc_msc) + ScreenPtr screen = window->drawable.pScreen; + present_screen_priv_ptr screen_priv = present_screen_priv(screen); + +- if (vblank->requeue) { +- vblank->requeue = FALSE; +- if (msc_is_after(vblank->target_msc, crtc_msc) && +- Success == screen_priv->queue_vblank(screen, +- window, +- vblank->crtc, +- vblank->event_id, +- vblank->target_msc)) +- return TRUE; +- } ++ /* We may have to requeue for the next MSC if check_flip_window prevented ++ * using a flip. ++ */ ++ if (vblank->exec_msc == crtc_msc + 1 && ++ screen_priv->queue_vblank(screen, window, vblank->crtc, vblank->event_id, ++ vblank->exec_msc) == Success) ++ return TRUE; + + if (vblank->wait_fence) { + if (!present_fence_check_triggered(vblank->wait_fence)) { +@@ -75,13 +72,13 @@ present_execute_copy(present_vblank_ptr vblank, uint64_t crtc_msc) + ScreenPtr screen = window->drawable.pScreen; + present_screen_priv_ptr screen_priv = present_screen_priv(screen); + +- /* If present_flip failed, we may have to requeue for the target MSC */ +- if (vblank->target_msc == crtc_msc + 1 && ++ /* If present_flip failed, we may have to requeue for the next MSC */ ++ if (vblank->exec_msc == crtc_msc + 1 && + Success == screen_priv->queue_vblank(screen, + window, + vblank->crtc, + vblank->event_id, +- vblank->target_msc)) { ++ vblank->exec_msc)) { + vblank->queued = TRUE; + return; + } +diff --git a/present/present_priv.h b/present/present_priv.h +index 90c3f4e79..f34edd5cf 100644 +--- a/present/present_priv.h ++++ b/present/present_priv.h +@@ -70,14 +70,14 @@ struct present_vblank { + int16_t y_off; + CARD16 kind; + uint64_t event_id; +- uint64_t target_msc; ++ uint64_t target_msc; /* target MSC when present should complete */ ++ uint64_t exec_msc; /* MSC at which present can be executed */ + uint64_t msc_offset; + present_fence_ptr idle_fence; + present_fence_ptr wait_fence; + present_notify_ptr notifies; + int num_notifies; + Bool queued; /* on present_exec_queue */ +- Bool requeue; /* on queue, but target_msc has changed */ + Bool flip; /* planning on using flip */ + Bool flip_ready; /* wants to flip, but waiting for previous flip or unflip */ + Bool flip_idler; /* driver explicitly permitted idling */ +diff --git a/present/present_scmd.c b/present/present_scmd.c +index a4d046ca8..3e3ae3477 100644 +--- a/present/present_scmd.c ++++ b/present/present_scmd.c +@@ -361,8 +361,8 @@ present_flip_notify(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc) + ScreenPtr screen = vblank->screen; + present_screen_priv_ptr screen_priv = present_screen_priv(screen); + +- DebugPresent(("\tn %" PRIu64 " %p %" PRIu64 ": %08" PRIx32 " -> %08" PRIx32 "\n", +- vblank->event_id, vblank, vblank->target_msc, ++ DebugPresent(("\tn %" PRIu64 " %p %" PRIu64 " %" PRIu64 ": %08" PRIx32 " -> %08" PRIx32 "\n", ++ vblank->event_id, vblank, vblank->exec_msc, vblank->target_msc, + vblank->pixmap ? vblank->pixmap->drawable.id : 0, + vblank->window ? vblank->window->drawable.id : 0)); + +@@ -482,7 +482,7 @@ present_check_flip_window (WindowPtr window) + vblank->flip = FALSE; + vblank->reason = reason; + if (vblank->sync_flip) +- vblank->requeue = TRUE; ++ vblank->exec_msc = vblank->target_msc; + } + } + } +@@ -608,6 +608,7 @@ present_execute(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc) + */ + screen_priv->flip_pending = NULL; + vblank->flip = FALSE; ++ vblank->exec_msc = vblank->target_msc; + } + DebugPresent(("\tc %p %" PRIu64 ": %08" PRIx32 " -> %08" PRIx32 "\n", + vblank, crtc_msc, vblank->pixmap->drawable.id, vblank->window->drawable.id)); +@@ -752,12 +753,12 @@ present_scmd_pixmap(WindowPtr window, + return BadAlloc; + + if (vblank->flip && vblank->sync_flip) +- target_msc--; ++ vblank->exec_msc--; + + xorg_list_append(&vblank->event_queue, &present_exec_queue); + vblank->queued = TRUE; +- if (msc_is_after(target_msc, crtc_msc)) { +- ret = present_queue_vblank(screen, window, target_crtc, vblank->event_id, target_msc); ++ if (msc_is_after(vblank->exec_msc, crtc_msc)) { ++ ret = present_queue_vblank(screen, window, target_crtc, vblank->event_id, vblank->exec_msc); + if (ret == Success) + return Success; + +diff --git a/present/present_vblank.c b/present/present_vblank.c +index a4b70c0d9..af14fe134 100644 +--- a/present/present_vblank.c ++++ b/present/present_vblank.c +@@ -101,6 +101,7 @@ present_vblank_create(WindowPtr window, + vblank->x_off = x_off; + vblank->y_off = y_off; + vblank->target_msc = target_msc; ++ vblank->exec_msc = target_msc; + vblank->crtc = target_crtc; + vblank->msc_offset = window_priv->msc_offset; + vblank->notifies = notifies; +@@ -152,8 +153,8 @@ no_mem: + void + present_vblank_scrap(present_vblank_ptr vblank) + { +- DebugPresent(("\tx %" PRIu64 " %p %" PRIu64 ": %08" PRIx32 " -> %08" PRIx32 " (crtc %p)\n", +- vblank->event_id, vblank, vblank->target_msc, ++ DebugPresent(("\tx %" PRIu64 " %p %" PRIu64 " %" PRIu64 ": %08" PRIx32 " -> %08" PRIx32 " (crtc %p)\n", ++ vblank->event_id, vblank, vblank->exec_msc, vblank->target_msc, + vblank->pixmap->drawable.id, vblank->window->drawable.id, + vblank->crtc)); + +@@ -174,8 +175,8 @@ present_vblank_destroy(present_vblank_ptr vblank) + /* Also make sure vblank is removed from event queue (wnmd) */ + xorg_list_del(&vblank->event_queue); + +- DebugPresent(("\td %" PRIu64 " %p %" PRIu64 ": %08" PRIx32 " -> %08" PRIx32 "\n", +- vblank->event_id, vblank, vblank->target_msc, ++ DebugPresent(("\td %" PRIu64 " %p %" PRIu64 " %" PRIu64 ": %08" PRIx32 " -> %08" PRIx32 "\n", ++ vblank->event_id, vblank, vblank->exec_msc, vblank->target_msc, + vblank->pixmap ? vblank->pixmap->drawable.id : 0, + vblank->window ? vblank->window->drawable.id : 0)); + +diff --git a/present/present_wnmd.c b/present/present_wnmd.c +index 31e83d6ee..339e93edb 100644 +--- a/present/present_wnmd.c ++++ b/present/present_wnmd.c +@@ -168,8 +168,8 @@ present_wnmd_flip_notify(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_ + WindowPtr window = vblank->window; + present_window_priv_ptr window_priv = present_window_priv(window); + +- DebugPresent(("\tn %" PRIu64 " %p %" PRIu64 ": %08" PRIx32 " -> %08" PRIx32 "\n", +- vblank->event_id, vblank, vblank->target_msc, ++ DebugPresent(("\tn %" PRIu64 " %p %" PRIu64 " %" PRIu64 ": %08" PRIx32 " -> %08" PRIx32 "\n", ++ vblank->event_id, vblank, vblank->exec_msc, vblank->target_msc, + vblank->pixmap ? vblank->pixmap->drawable.id : 0, + vblank->window ? vblank->window->drawable.id : 0)); + +@@ -343,7 +343,7 @@ present_wnmd_check_flip_window (WindowPtr window) + vblank->flip = FALSE; + vblank->reason = reason; + if (vblank->sync_flip) +- vblank->requeue = TRUE; ++ vblank->exec_msc = vblank->target_msc; + } + } + } +@@ -491,6 +491,7 @@ present_wnmd_execute(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc) + */ + window_priv->flip_pending = NULL; + vblank->flip = FALSE; ++ vblank->exec_msc = vblank->target_msc; + } + DebugPresent(("\tc %p %" PRIu64 ": %08" PRIx32 " -> %08" PRIx32 "\n", + vblank, crtc_msc, vblank->pixmap->drawable.id, vblank->window->drawable.id)); +@@ -632,12 +633,12 @@ present_wnmd_pixmap(WindowPtr window, + return BadAlloc; + + if (vblank->flip && vblank->sync_flip) +- target_msc--; ++ vblank->exec_msc--; + + xorg_list_append(&vblank->event_queue, &window_priv->exec_queue); + vblank->queued = TRUE; +- if (crtc_msc < target_msc) { +- if (present_wnmd_queue_vblank(screen, window, target_crtc, vblank->event_id, target_msc) == Success) { ++ if (crtc_msc < vblank->exec_msc) { ++ if (present_wnmd_queue_vblank(screen, window, target_crtc, vblank->event_id, vblank->exec_msc) == Success) { + return Success; + } + DebugPresent(("present_queue_vblank failed\n")); +-- +2.28.0 + diff --git a/0014-xwayland-Cache-client-id-for-the-window-manager-clie.patch b/0014-xwayland-Cache-client-id-for-the-window-manager-clie.patch index 08c605f..1142b23 100644 --- a/0014-xwayland-Cache-client-id-for-the-window-manager-clie.patch +++ b/0014-xwayland-Cache-client-id-for-the-window-manager-clie.patch @@ -1,4 +1,4 @@ -From aa0f9ba1aa3f12f7e65ed64ac03114f27c8bff1f Mon Sep 17 00:00:00 2001 +From a35e6f9a2b15a446138f6f3e201a19833a5a2454 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 27 Jan 2020 11:08:00 +0100 Subject: [PATCH xserver 14/24] xwayland: Cache client-id for the @@ -24,10 +24,10 @@ Signed-off-by: Hans de Goede 2 files changed, 34 insertions(+), 16 deletions(-) diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index e43f3de96..f4d433bca 100644 +index ac4d98e6a..c16da330c 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c -@@ -576,20 +576,11 @@ xwl_window_enable_viewport(struct xwl_window *xwl_window, +@@ -578,20 +578,11 @@ xwl_window_enable_viewport(struct xwl_window *xwl_window, } static Bool @@ -51,7 +51,7 @@ index e43f3de96..f4d433bca 100644 } static ClientPtr -@@ -603,7 +594,7 @@ xwl_window_get_owner(struct xwl_window *xwl_window) +@@ -605,7 +596,7 @@ xwl_window_get_owner(struct xwl_window *xwl_window) * decoration window. In that case return the client of the * first *and only* child of the toplevel (decoration) window. */ @@ -60,7 +60,7 @@ index e43f3de96..f4d433bca 100644 if (window->firstChild && window->firstChild == window->lastChild) return wClient(window->firstChild); else -@@ -698,9 +689,7 @@ xwl_screen_check_resolution_change_emulation(struct xwl_screen *xwl_screen) +@@ -700,9 +691,7 @@ xwl_screen_check_resolution_change_emulation(struct xwl_screen *xwl_screen) Bool xwl_window_is_toplevel(WindowPtr window) { @@ -71,7 +71,7 @@ index e43f3de96..f4d433bca 100644 return FALSE; /* CSD and override-redirect toplevel windows */ -@@ -975,6 +964,30 @@ xwl_set_window_pixmap(WindowPtr window, +@@ -977,6 +966,30 @@ xwl_set_window_pixmap(WindowPtr window, ensure_surface_for_window(window); } @@ -102,7 +102,7 @@ index e43f3de96..f4d433bca 100644 static void xwl_resize_window(WindowPtr window, int x, int y, -@@ -1552,6 +1565,9 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) +@@ -1576,6 +1589,9 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) xwl_screen->CloseScreen = pScreen->CloseScreen; pScreen->CloseScreen = xwl_close_screen; @@ -113,7 +113,7 @@ index e43f3de96..f4d433bca 100644 pScreen->ResizeWindow = xwl_resize_window; diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h -index eb8c4bd70..126af8823 100644 +index 1317ae5bb..f5ffadfcc 100644 --- a/hw/xwayland/xwayland.h +++ b/hw/xwayland/xwayland.h @@ -118,6 +118,7 @@ struct xwl_screen { @@ -133,5 +133,5 @@ index eb8c4bd70..126af8823 100644 struct xorg_list output_list; -- -2.25.2 +2.26.2 diff --git a/0015-present-wnmd-Move-up-present_wnmd_queue_vblank.patch b/0015-present-wnmd-Move-up-present_wnmd_queue_vblank.patch new file mode 100644 index 0000000..13f7ecd --- /dev/null +++ b/0015-present-wnmd-Move-up-present_wnmd_queue_vblank.patch @@ -0,0 +1,58 @@ +From 96ef31e0f20fcffb2edfe4cb9510f994c188785f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michel=20D=C3=A4nzer?= +Date: Tue, 28 Jul 2020 18:53:45 +0200 +Subject: [PATCH xserver 15/16] present/wnmd: Move up present_wnmd_queue_vblank + +Allowing it to be called from more functions than before. No functional +change. + +Reviewed-by: Roman Gilg +Tested-by: Roman Gilg +(cherry picked from commit d14ea667feccf085c7d66a7c63f380975e07af66) +--- + present/present_wnmd.c | 22 +++++++++++----------- + 1 file changed, 11 insertions(+), 11 deletions(-) + +diff --git a/present/present_wnmd.c b/present/present_wnmd.c +index 339e93edb..2c11e53f5 100644 +--- a/present/present_wnmd.c ++++ b/present/present_wnmd.c +@@ -42,6 +42,17 @@ + static void + present_wnmd_execute(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc); + ++static int ++present_wnmd_queue_vblank(ScreenPtr screen, ++ WindowPtr window, ++ RRCrtcPtr crtc, ++ uint64_t event_id, ++ uint64_t msc) ++{ ++ present_screen_priv_ptr screen_priv = present_screen_priv(screen); ++ return (*screen_priv->wnmd_info->queue_vblank) (window, crtc, event_id, msc); ++} ++ + static void + present_wnmd_create_event_id(present_window_priv_ptr window_priv, present_vblank_ptr vblank) + { +@@ -511,17 +522,6 @@ present_wnmd_execute(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc) + present_execute_post(vblank, ust, crtc_msc); + } + +-static int +-present_wnmd_queue_vblank(ScreenPtr screen, +- WindowPtr window, +- RRCrtcPtr crtc, +- uint64_t event_id, +- uint64_t msc) +-{ +- present_screen_priv_ptr screen_priv = present_screen_priv(screen); +- return (*screen_priv->wnmd_info->queue_vblank) (window, crtc, event_id, msc); +-} +- + static uint64_t + present_wnmd_window_to_crtc_msc(WindowPtr window, RRCrtcPtr crtc, uint64_t window_msc, uint64_t new_msc) + { +-- +2.28.0 + diff --git a/0015-xwayland-Reuse-viewport-instead-of-recreating.patch b/0015-xwayland-Reuse-viewport-instead-of-recreating.patch index 3f6cb2d..9fa0e06 100644 --- a/0015-xwayland-Reuse-viewport-instead-of-recreating.patch +++ b/0015-xwayland-Reuse-viewport-instead-of-recreating.patch @@ -1,4 +1,4 @@ -From 1f39cb2ef51c72ec0c448c5d9571540bb0d9f3eb Mon Sep 17 00:00:00 2001 +From e4d8f7770e27ed56e23e0ef2a87bed8cb4fa28e0 Mon Sep 17 00:00:00 2001 From: Roman Gilg Date: Fri, 3 Jan 2020 17:12:14 +0100 Subject: [PATCH xserver 15/24] xwayland: Reuse viewport instead of recreating @@ -17,10 +17,10 @@ Signed-off-by: Hans de Goede 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index f4d433bca..320589dde 100644 +index c16da330c..ac301ae4a 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c -@@ -550,17 +550,13 @@ xwl_window_enable_viewport(struct xwl_window *xwl_window, +@@ -552,17 +552,13 @@ xwl_window_enable_viewport(struct xwl_window *xwl_window, struct xwl_output *xwl_output, struct xwl_emulated_mode *emulated_mode) { @@ -46,5 +46,5 @@ index f4d433bca..320589dde 100644 wp_viewport_set_source(xwl_window->viewport, wl_fixed_from_int(0), -- -2.25.2 +2.26.2 diff --git a/0016-present-wnmd-Execute-copies-at-target_msc-1-already.patch b/0016-present-wnmd-Execute-copies-at-target_msc-1-already.patch new file mode 100644 index 0000000..a761129 --- /dev/null +++ b/0016-present-wnmd-Execute-copies-at-target_msc-1-already.patch @@ -0,0 +1,139 @@ +From c3e4c1a0fd5d4d6015e9e6317b758018317e56d1 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michel=20D=C3=A4nzer?= +Date: Tue, 28 Jul 2020 18:40:47 +0200 +Subject: [PATCH xserver 16/16] present/wnmd: Execute copies at target_msc-1 + already + +It always takes one update cycle for the copy to become visible on the +host windowing system, so waiting for the target MSC resulted in 1 cycle +delay. + +We re-use the idle list for copies which were executed but need their +completion event sent. + +Fixes black seams when resizing the "Builder" sub-window of + + GDK_BACKEND=x11 gtk4-demo + +on Xwayland (see +https://gitlab.gnome.org/GNOME/mutter/-/issues/1290#note_873557). + +Unfortunately, this cannot completely fix the seams with apps which +queue up multiple frames in advance, since there's always at least one +queued frame corresponding to the old window size. But it should at +least help a little in that case as well. + +v2: +* Bug fix: Don't update exec_msc in present_wnmd_check_flip_window. + (Roman Gilg) +* Use exec_msc = target_msc - 1 instead of exec_msc--, and add a + comment, for clarity. +v3: +* Drop exec_msc = target_msc again in present_wnmd_execute. +* present_execute_copy should never set vblank->queued in + present_wnmd_execute now, so replace that branch with an assertion. + (Roman Gilg) + +Reviewed-by: Roman Gilg +Tested-by: Roman Gilg +(cherry picked from commit 1cccb486d48a5d2e7649836b993805bb65dc09e3) +[Since present_wnmd_event_notify hasn't been split up on the 1.20 +branch, it needs to check vblank->flip. Doing the same in +present_wnmd_free_idle_vblanks to be safe, though I'm not sure it's +actually possible to hit non-flips there.] +--- + present/present_wnmd.c | 28 ++++++++++++++++++---------- + 1 file changed, 18 insertions(+), 10 deletions(-) + +diff --git a/present/present_wnmd.c b/present/present_wnmd.c +index 2c11e53f5..8c31619a2 100644 +--- a/present/present_wnmd.c ++++ b/present/present_wnmd.c +@@ -122,7 +122,8 @@ present_wnmd_free_idle_vblanks(WindowPtr window) + present_vblank_ptr vblank, tmp; + + xorg_list_for_each_entry_safe(vblank, tmp, &window_priv->idle_queue, event_queue) { +- present_wnmd_free_idle_vblank(vblank); ++ if (vblank->flip) ++ present_wnmd_free_idle_vblank(vblank); + } + + if (window_priv->flip_active) { +@@ -245,7 +246,12 @@ present_wnmd_event_notify(WindowPtr window, uint64_t event_id, uint64_t ust, uin + + xorg_list_for_each_entry(vblank, &window_priv->idle_queue, event_queue) { + if (vblank->event_id == event_id) { +- present_wnmd_free_idle_vblank(vblank); ++ if (vblank->flip) ++ present_wnmd_free_idle_vblank(vblank); ++ else ++ /* Copies which were executed but need their completion event sent */ ++ present_execute_post(vblank, ust, msc); ++ + return; + } + } +@@ -353,8 +359,6 @@ present_wnmd_check_flip_window (WindowPtr window) + vblank->sync_flip, vblank->valid, 0, 0, &reason)) { + vblank->flip = FALSE; + vblank->reason = reason; +- if (vblank->sync_flip) +- vblank->exec_msc = vblank->target_msc; + } + } + } +@@ -454,6 +458,7 @@ present_wnmd_execute(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc) + vblank->queued = FALSE; + + if (vblank->pixmap && vblank->window) { ++ ScreenPtr screen = window->drawable.pScreen; + + if (vblank->flip) { + RegionPtr damage; +@@ -479,7 +484,6 @@ present_wnmd_execute(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc) + // ask the driver + if (present_wnmd_flip(vblank->window, vblank->crtc, vblank->event_id, + vblank->target_msc, vblank->pixmap, vblank->sync_flip, damage)) { +- ScreenPtr screen = window->drawable.pScreen; + WindowPtr toplvl_window = present_wnmd_toplvl_pixmap_window(vblank->window); + PixmapPtr old_pixmap = screen->GetWindowPixmap(window); + +@@ -502,7 +506,6 @@ present_wnmd_execute(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc) + */ + window_priv->flip_pending = NULL; + vblank->flip = FALSE; +- vblank->exec_msc = vblank->target_msc; + } + DebugPresent(("\tc %p %" PRIu64 ": %08" PRIx32 " -> %08" PRIx32 "\n", + vblank, crtc_msc, vblank->pixmap->drawable.id, vblank->window->drawable.id)); +@@ -510,9 +513,12 @@ present_wnmd_execute(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc) + present_wnmd_cancel_flip(window); + + present_execute_copy(vblank, crtc_msc); ++ assert(!vblank->queued); + +- if (vblank->queued) { +- xorg_list_add(&vblank->event_queue, &window_priv->exec_queue); ++ if (present_wnmd_queue_vblank(screen, window, vblank->crtc, ++ vblank->event_id, crtc_msc + 1) ++ == Success) { ++ xorg_list_add(&vblank->event_queue, &window_priv->idle_queue); + xorg_list_append(&vblank->window_list, &window_priv->vblank); + + return; +@@ -632,8 +638,10 @@ present_wnmd_pixmap(WindowPtr window, + if (!vblank) + return BadAlloc; + +- if (vblank->flip && vblank->sync_flip) +- vblank->exec_msc--; ++ /* WNMD presentations always complete (at least) one frame after they ++ * are executed ++ */ ++ vblank->exec_msc = vblank->target_msc - 1; + + xorg_list_append(&vblank->event_queue, &window_priv->exec_queue); + vblank->queued = TRUE; +-- +2.28.0 + diff --git a/0016-xwayland-Recurse-on-finding-the-none-wm-owner.patch b/0016-xwayland-Recurse-on-finding-the-none-wm-owner.patch index 8299c92..558f3bf 100644 --- a/0016-xwayland-Recurse-on-finding-the-none-wm-owner.patch +++ b/0016-xwayland-Recurse-on-finding-the-none-wm-owner.patch @@ -1,4 +1,4 @@ -From 8cedbfd448edf410a45c57addcee0e7304f11b86 Mon Sep 17 00:00:00 2001 +From 66a026eeaa49e1042d4d2ec655e78771e1acd9df Mon Sep 17 00:00:00 2001 From: Roman Gilg Date: Fri, 3 Jan 2020 17:27:28 +0100 Subject: [PATCH xserver 16/24] xwayland: Recurse on finding the none-wm owner @@ -28,10 +28,10 @@ Signed-off-by: Hans de Goede 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index 320589dde..f42b80b90 100644 +index ac301ae4a..94e3a18fa 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c -@@ -580,19 +580,18 @@ window_is_wm_window(WindowPtr window) +@@ -582,19 +582,18 @@ window_is_wm_window(WindowPtr window) } static ClientPtr @@ -56,7 +56,7 @@ index 320589dde..f42b80b90 100644 else return NULL; /* Should never happen, skip resolution emulation */ } -@@ -613,7 +612,7 @@ xwl_window_should_enable_viewport(struct xwl_window *xwl_window, +@@ -615,7 +614,7 @@ xwl_window_should_enable_viewport(struct xwl_window *xwl_window, if (!xwl_screen_has_resolution_change_emulation(xwl_screen)) return FALSE; @@ -65,7 +65,7 @@ index 320589dde..f42b80b90 100644 if (!owner) return FALSE; -@@ -692,8 +691,8 @@ xwl_window_is_toplevel(WindowPtr window) +@@ -694,8 +693,8 @@ xwl_window_is_toplevel(WindowPtr window) if (window_get_damage(window)) return TRUE; @@ -77,5 +77,5 @@ index 320589dde..f42b80b90 100644 static void -- -2.25.2 +2.26.2 diff --git a/0017-xwayland-Make-window_get_none_wm_owner-return-a-Wind.patch b/0017-xwayland-Make-window_get_none_wm_owner-return-a-Wind.patch index b9a2331..75b5ddc 100644 --- a/0017-xwayland-Make-window_get_none_wm_owner-return-a-Wind.patch +++ b/0017-xwayland-Make-window_get_none_wm_owner-return-a-Wind.patch @@ -1,4 +1,4 @@ -From 939a78925a1d591e6aaf291a6609b9c6e54ee6ce Mon Sep 17 00:00:00 2001 +From 8b9a66212bacd780f1a8ac37cbb490b650843c28 Mon Sep 17 00:00:00 2001 From: Roman Gilg Date: Wed, 15 Jan 2020 10:07:58 +0100 Subject: [PATCH xserver 17/24] xwayland: Make window_get_none_wm_owner return @@ -25,10 +25,10 @@ Signed-off-by: Hans de Goede 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index f42b80b90..d70d729ae 100644 +index 94e3a18fa..c60a2ce67 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c -@@ -579,10 +579,10 @@ window_is_wm_window(WindowPtr window) +@@ -581,10 +581,10 @@ window_is_wm_window(WindowPtr window) return CLIENT_ID(window->drawable.id) == xwl_screen->wm_client_id; } @@ -42,7 +42,7 @@ index f42b80b90..d70d729ae 100644 /* If the toplevel window is owned by the window-manager, then the * actual client toplevel window has been reparented to some window-manager -@@ -591,12 +591,12 @@ window_get_none_wm_owner(WindowPtr window) +@@ -593,12 +593,12 @@ window_get_none_wm_owner(WindowPtr window) */ if (window_is_wm_window(window)) { if (window->firstChild && window->firstChild == window->lastChild) @@ -57,7 +57,7 @@ index f42b80b90..d70d729ae 100644 } static Bool -@@ -608,14 +608,17 @@ xwl_window_should_enable_viewport(struct xwl_window *xwl_window, +@@ -610,14 +610,17 @@ xwl_window_should_enable_viewport(struct xwl_window *xwl_window, struct xwl_emulated_mode *emulated_mode; struct xwl_output *xwl_output; ClientPtr owner; @@ -78,5 +78,5 @@ index f42b80b90..d70d729ae 100644 * This path gets hit by most games / libs (e.g. SDL, SFML, OGRE) */ -- -2.25.2 +2.26.2 diff --git a/0018-xwayland-Check-emulation-on-client-toplevel-resize.patch b/0018-xwayland-Check-emulation-on-client-toplevel-resize.patch index dcc0f5e..b268bb9 100644 --- a/0018-xwayland-Check-emulation-on-client-toplevel-resize.patch +++ b/0018-xwayland-Check-emulation-on-client-toplevel-resize.patch @@ -1,4 +1,4 @@ -From c5d9cb5f4bc4f703b66fc524a76247c742490b30 Mon Sep 17 00:00:00 2001 +From da3e06f4bed7fa60838ce89a0b45ea73c7d9615c Mon Sep 17 00:00:00 2001 From: Roman Gilg Date: Fri, 3 Jan 2020 17:55:28 +0100 Subject: [PATCH xserver 18/24] xwayland: Check emulation on client toplevel @@ -25,10 +25,10 @@ Signed-off-by: Hans de Goede 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index d70d729ae..14227a327 100644 +index c60a2ce67..898a291fd 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c -@@ -609,6 +609,7 @@ xwl_window_should_enable_viewport(struct xwl_window *xwl_window, +@@ -611,6 +611,7 @@ xwl_window_should_enable_viewport(struct xwl_window *xwl_window, struct xwl_output *xwl_output; ClientPtr owner; WindowPtr window; @@ -36,7 +36,7 @@ index d70d729ae..14227a327 100644 if (!xwl_screen_has_resolution_change_emulation(xwl_screen)) return FALSE; -@@ -618,6 +619,7 @@ xwl_window_should_enable_viewport(struct xwl_window *xwl_window, +@@ -620,6 +621,7 @@ xwl_window_should_enable_viewport(struct xwl_window *xwl_window, return FALSE; owner = wClient(window); @@ -44,7 +44,7 @@ index d70d729ae..14227a327 100644 /* 1. Test if the window matches the emulated mode on one of the outputs * This path gets hit by most games / libs (e.g. SDL, SFML, OGRE) -@@ -627,10 +629,10 @@ xwl_window_should_enable_viewport(struct xwl_window *xwl_window, +@@ -629,10 +631,10 @@ xwl_window_should_enable_viewport(struct xwl_window *xwl_window, if (!emulated_mode) continue; @@ -59,7 +59,7 @@ index d70d729ae..14227a327 100644 *emulated_mode_ret = emulated_mode; *xwl_output_ret = xwl_output; -@@ -646,9 +648,9 @@ xwl_window_should_enable_viewport(struct xwl_window *xwl_window, +@@ -648,9 +650,9 @@ xwl_window_should_enable_viewport(struct xwl_window *xwl_window, emulated_mode = xwl_output_get_emulated_mode_for_client(xwl_output, owner); if (xwl_output && xwl_window->window->overrideRedirect && emulated_mode && emulated_mode->from_vidmode && @@ -72,7 +72,7 @@ index d70d729ae..14227a327 100644 *emulated_mode_ret = emulated_mode; *xwl_output_ret = xwl_output; -@@ -768,8 +770,6 @@ ensure_surface_for_window(WindowPtr window) +@@ -770,8 +772,6 @@ ensure_surface_for_window(WindowPtr window) xwl_window->xwl_screen = xwl_screen; xwl_window->window = window; @@ -81,7 +81,7 @@ index d70d729ae..14227a327 100644 xwl_window->surface = wl_compositor_create_surface(xwl_screen->compositor); if (xwl_window->surface == NULL) { ErrorF("wl_display_create_surface failed\n"); -@@ -997,20 +997,15 @@ xwl_resize_window(WindowPtr window, +@@ -999,20 +999,15 @@ xwl_resize_window(WindowPtr window, struct xwl_window *xwl_window; xwl_screen = xwl_screen_get(screen); @@ -105,7 +105,7 @@ index d70d729ae..14227a327 100644 static void diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h -index 126af8823..01aef27d2 100644 +index f5ffadfcc..0d0baac9b 100644 --- a/hw/xwayland/xwayland.h +++ b/hw/xwayland/xwayland.h @@ -184,7 +184,6 @@ struct xwl_window { @@ -117,5 +117,5 @@ index 126af8823..01aef27d2 100644 struct wl_shell_surface *shell_surface; WindowPtr window; -- -2.25.2 +2.26.2 diff --git a/0019-xwayland-Also-check-resolution-change-emulation-when.patch b/0019-xwayland-Also-check-resolution-change-emulation-when.patch index a1c0e84..42e24e8 100644 --- a/0019-xwayland-Also-check-resolution-change-emulation-when.patch +++ b/0019-xwayland-Also-check-resolution-change-emulation-when.patch @@ -1,4 +1,4 @@ -From 63b0c0d76d1020f0cac331f3eff30fba07f79965 Mon Sep 17 00:00:00 2001 +From 09eb525863ab6c08fd743a637f7da9d10c0c01eb Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Wed, 15 Jan 2020 14:36:45 +0100 Subject: [PATCH xserver 19/24] xwayland: Also check @@ -28,10 +28,10 @@ Signed-off-by: Hans de Goede 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index 14227a327..298ef3ac8 100644 +index 898a291fd..b40502dad 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c -@@ -1004,7 +1004,7 @@ xwl_resize_window(WindowPtr window, +@@ -1006,7 +1006,7 @@ xwl_resize_window(WindowPtr window, xwl_screen->ResizeWindow = screen->ResizeWindow; screen->ResizeWindow = xwl_resize_window; @@ -41,5 +41,5 @@ index 14227a327..298ef3ac8 100644 } -- -2.25.2 +2.26.2 diff --git a/0020-xwayland-Also-hook-screen-s-MoveWindow-method.patch b/0020-xwayland-Also-hook-screen-s-MoveWindow-method.patch index 51f3fe8..dedf011 100644 --- a/0020-xwayland-Also-hook-screen-s-MoveWindow-method.patch +++ b/0020-xwayland-Also-hook-screen-s-MoveWindow-method.patch @@ -1,4 +1,4 @@ -From 309e6e549adc5a164541d16822745c022cd8574b Mon Sep 17 00:00:00 2001 +From 9f2ebb5f07dc3fff8e061b21fa175d3d958d0ee4 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Thu, 9 Jan 2020 11:00:36 +0100 Subject: [PATCH xserver 20/24] xwayland: Also hook screen's MoveWindow method @@ -24,10 +24,10 @@ Signed-off-by: Hans de Goede 2 files changed, 26 insertions(+) diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index 298ef3ac8..1294ff1d8 100644 +index b40502dad..7111e20ae 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c -@@ -1008,6 +1008,28 @@ xwl_resize_window(WindowPtr window, +@@ -1010,6 +1010,28 @@ xwl_resize_window(WindowPtr window, xwl_window_check_resolution_change_emulation(xwl_window); } @@ -56,7 +56,7 @@ index 298ef3ac8..1294ff1d8 100644 static void frame_callback(void *data, struct wl_callback *callback, -@@ -1564,6 +1586,9 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) +@@ -1588,6 +1610,9 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) xwl_screen->ResizeWindow = pScreen->ResizeWindow; pScreen->ResizeWindow = xwl_resize_window; @@ -67,7 +67,7 @@ index 298ef3ac8..1294ff1d8 100644 xwl_screen->SetWindowPixmap = pScreen->SetWindowPixmap; pScreen->SetWindowPixmap = xwl_set_window_pixmap; diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h -index 01aef27d2..72225374b 100644 +index 0d0baac9b..451c08e23 100644 --- a/hw/xwayland/xwayland.h +++ b/hw/xwayland/xwayland.h @@ -138,6 +138,7 @@ struct xwl_screen { @@ -79,5 +79,5 @@ index 01aef27d2..72225374b 100644 struct xorg_list output_list; struct xorg_list seat_list; -- -2.25.2 +2.26.2 diff --git a/0021-xwayland-Fix-emulated-modes-not-being-removed-when-s.patch b/0021-xwayland-Fix-emulated-modes-not-being-removed-when-s.patch index 2b1bc84..b00f9bd 100644 --- a/0021-xwayland-Fix-emulated-modes-not-being-removed-when-s.patch +++ b/0021-xwayland-Fix-emulated-modes-not-being-removed-when-s.patch @@ -1,4 +1,4 @@ -From 52bbef1f55d17229684b0d76a478ec639c4032ed Mon Sep 17 00:00:00 2001 +From 958b34ce3cab02219457d5dcc25217e7c9a0beba Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 7 Oct 2019 14:27:49 +0200 Subject: [PATCH xserver 21/24] xwayland: Fix emulated modes not being removed @@ -32,10 +32,10 @@ Signed-off-by: Hans de Goede 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hw/xwayland/xwayland-output.c b/hw/xwayland/xwayland-output.c -index 20c254962..7d705d919 100644 +index 0d6b9ac9f..4bc9cd6b8 100644 --- a/hw/xwayland/xwayland-output.c +++ b/hw/xwayland/xwayland-output.c -@@ -309,8 +309,11 @@ xwl_output_remove_emulated_mode_for_client(struct xwl_output *xwl_output, +@@ -272,8 +272,11 @@ xwl_output_remove_emulated_mode_for_client(struct xwl_output *xwl_output, struct xwl_emulated_mode *emulated_mode; emulated_mode = xwl_output_get_emulated_mode_for_client(xwl_output, client); @@ -48,7 +48,7 @@ index 20c254962..7d705d919 100644 } /* From hw/xfree86/common/xf86DefModeSet.c with some obscure modes dropped */ -@@ -511,7 +514,8 @@ xwl_output_set_emulated_mode(struct xwl_output *xwl_output, ClientPtr client, +@@ -474,7 +477,8 @@ xwl_output_set_emulated_mode(struct xwl_output *xwl_output, ClientPtr client, from_vidmode ? "vidmode" : "randr", mode->mode.width, mode->mode.height); @@ -59,5 +59,5 @@ index 20c254962..7d705d919 100644 else xwl_output_add_emulated_mode_for_client(xwl_output, client, mode, from_vidmode); -- -2.25.2 +2.26.2 diff --git a/0022-xwayland-Call-xwl_window_check_resolution_change_emu.patch b/0022-xwayland-Call-xwl_window_check_resolution_change_emu.patch index 0b6a07b..0fedf5d 100644 --- a/0022-xwayland-Call-xwl_window_check_resolution_change_emu.patch +++ b/0022-xwayland-Call-xwl_window_check_resolution_change_emu.patch @@ -1,4 +1,4 @@ -From 57d0ad44fd0b04fff98e9b484816dc95068a90cc Mon Sep 17 00:00:00 2001 +From 12a9c05a3088480bc7ab80902e384053f10e51a6 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 4 Nov 2019 11:46:49 +0100 Subject: [PATCH xserver 22/24] xwayland: Call @@ -28,10 +28,10 @@ Signed-off-by: Hans de Goede 1 file changed, 5 insertions(+) diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index 1294ff1d8..6b86e56bd 100644 +index 7111e20ae..734e76b2e 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c -@@ -819,6 +819,11 @@ ensure_surface_for_window(WindowPtr window) +@@ -821,6 +821,11 @@ ensure_surface_for_window(WindowPtr window) xwl_window_init_allow_commits(xwl_window); @@ -44,5 +44,5 @@ index 1294ff1d8..6b86e56bd 100644 err_surf: -- -2.25.2 +2.26.2 diff --git a/0023-xwayland-Fix-setting-of-_XWAYLAND_RANDR_EMU_MONITOR_.patch b/0023-xwayland-Fix-setting-of-_XWAYLAND_RANDR_EMU_MONITOR_.patch index f2654fb..dcd96a6 100644 --- a/0023-xwayland-Fix-setting-of-_XWAYLAND_RANDR_EMU_MONITOR_.patch +++ b/0023-xwayland-Fix-setting-of-_XWAYLAND_RANDR_EMU_MONITOR_.patch @@ -1,4 +1,4 @@ -From 87a1a7b9f8f7d848302057b9ca54f6729e82bbe7 Mon Sep 17 00:00:00 2001 +From 94fc11313b34e3b35aa275dad1c3bc2455a24ec3 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 4 Nov 2019 14:32:29 +0100 Subject: [PATCH xserver 23/24] xwayland: Fix setting of @@ -35,10 +35,10 @@ Signed-off-by: Hans de Goede 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index 6b86e56bd..e721d6cb5 100644 +index 734e76b2e..a7c4f82df 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c -@@ -749,6 +749,7 @@ ensure_surface_for_window(WindowPtr window) +@@ -751,6 +751,7 @@ ensure_surface_for_window(WindowPtr window) struct xwl_screen *xwl_screen; struct xwl_window *xwl_window; struct wl_region *region; @@ -46,7 +46,7 @@ index 6b86e56bd..e721d6cb5 100644 if (xwl_window_get(window)) return TRUE; -@@ -819,7 +820,14 @@ ensure_surface_for_window(WindowPtr window) +@@ -821,7 +822,14 @@ ensure_surface_for_window(WindowPtr window) xwl_window_init_allow_commits(xwl_window); @@ -62,7 +62,7 @@ index 6b86e56bd..e721d6cb5 100644 /* CSD or O-R toplevel window, check viewport on creation */ xwl_window_check_resolution_change_emulation(xwl_window); } -@@ -868,8 +876,6 @@ xwl_realize_window(WindowPtr window) +@@ -870,8 +878,6 @@ xwl_realize_window(WindowPtr window) return FALSE; } @@ -72,5 +72,5 @@ index 6b86e56bd..e721d6cb5 100644 } -- -2.25.2 +2.26.2 diff --git a/0024-xwayland-Remove-unnecessary-xwl_window_is_toplevel-c.patch b/0024-xwayland-Remove-unnecessary-xwl_window_is_toplevel-c.patch index c4925c2..0a3ea40 100644 --- a/0024-xwayland-Remove-unnecessary-xwl_window_is_toplevel-c.patch +++ b/0024-xwayland-Remove-unnecessary-xwl_window_is_toplevel-c.patch @@ -1,4 +1,4 @@ -From 231d5e2da2e1b0aee3cfe6febc54daf7a0e4b4c7 Mon Sep 17 00:00:00 2001 +From 2d078b3372e26278e687399a39699c495bfe16d4 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 4 Nov 2019 15:01:18 +0100 Subject: [PATCH xserver 24/24] xwayland: Remove unnecessary @@ -21,10 +21,10 @@ Signed-off-by: Hans de Goede 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/hw/xwayland/xwayland-output.c b/hw/xwayland/xwayland-output.c -index 7d705d919..084b669e4 100644 +index 4bc9cd6b8..9d3372c8e 100644 --- a/hw/xwayland/xwayland-output.c +++ b/hw/xwayland/xwayland-output.c -@@ -468,9 +468,6 @@ static void +@@ -431,9 +431,6 @@ static void xwl_output_set_randr_emu_prop(WindowPtr window, struct xwl_output_randr_emu_prop *prop) { @@ -34,7 +34,7 @@ index 7d705d919..084b669e4 100644 if (prop->rect_count) { dixChangeWindowProperty(serverClient, window, prop->atom, XA_CARDINAL, 32, PropModeReplace, -@@ -483,7 +480,8 @@ xwl_output_set_randr_emu_prop(WindowPtr window, +@@ -446,7 +443,8 @@ xwl_output_set_randr_emu_prop(WindowPtr window, static void xwl_output_set_randr_emu_prop_callback(void *resource, XID id, void *user_data) { @@ -45,5 +45,5 @@ index 7d705d919..084b669e4 100644 static void -- -2.25.2 +2.26.2 diff --git a/sources b/sources index b0a0c91..043e4bb 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (xorg-server-1.20.8.tar.bz2) = ab0ec0fcbf490c61558b9297f61b58fd2dedb676c78bef6431dc9166054743b43a0091b88a8b3f4e81d1f539909440ee7e188a298cefabe13ea89159639cd805 +SHA512 (xorg-server-1.20.9.tar.bz2) = d9b5f93e1b9763a89187d8b272aa7d4ce9709641b8539f4536708af153310e5a4931bffd4229c51a3b0e3b12da7838750aa71b635751fb4c0bb27438cce4e5e6 diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 647148b..842e909 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -45,8 +45,8 @@ Summary: X.Org X11 X server Name: xorg-x11-server -Version: 1.20.8 -Release: 4%{?gitdate:.%{gitdate}}%{?dist} +Version: 1.20.9 +Release: 1%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org License: MIT @@ -93,9 +93,24 @@ Patch5: 0001-autobind-GPUs-to-the-screen.patch Patch6: 0001-Fedora-hack-Make-the-suid-root-wrapper-always-start-.patch # Backports from current stable "server-1.20-branch": +Patch101: 0001-Revert-linux-Fix-platform-device-probe-for-DT-based-.patch +Patch102: 0002-Revert-linux-Fix-platform-device-PCI-detection-for-c.patch +Patch103: 0003-Revert-linux-Make-platform-device-probe-less-fragile.patch +Patch104: 0004-include-Increase-the-number-of-max.-input-devices-to.patch +Patch105: 0005-glamor-Fix-glamor_poly_fill_rect_gl-xRectangle-width.patch +Patch106: 0006-xfree86-Take-second-reference-for-SavedCursor-in-xf8.patch +Patch107: 0007-present-wnmd-Can-t-use-page-flipping-for-windows-cli.patch +Patch108: 0008-xwayland-Check-window-pixmap-in-xwl_present_check_fl.patch +Patch109: 0009-present-wnmd-Remove-dead-check-from-present_wnmd_che.patch +Patch110: 0010-xwayland-Do-not-discard-frame-callbacks-on-allow-com.patch +Patch111: 0011-xwayland-use-drmGetNodeTypeFromFd-for-checking-if-a-.patch +Patch112: 0012-xwayland-Remove-pending-stream-reference-when-freein.patch +Patch113: 0013-present-Move-flip-target_msc-adjustment-out-of-prese.patch +Patch114: 0014-present-Add-present_vblank-exec_msc-field.patch +Patch115: 0015-present-wnmd-Move-up-present_wnmd_queue_vblank.patch +Patch116: 0016-present-wnmd-Execute-copies-at-target_msc-1-already.patch # Backports from "master" upstream: -Patch100: 0001-fix-for-ZDI-11426.patch # Backported Xwayland randr resolution change emulation support Patch501: 0001-dix-Add-GetCurrentClient-helper.patch @@ -548,6 +563,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Thu Oct 8 2020 Olivier Fourdan - 1.20.9-1 +- xserver 1.20.9 + all current fixes from upstream + * Wed Aug 12 2020 Adam Jackson - 1.20.8-4 - Enable XC-SECURITY From 79af8e61d7dc9919aca68ac1c09e6ade3e7c954d Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 4 Nov 2020 10:38:24 +1000 Subject: [PATCH 055/131] Drop BuildRequires to git-core only --- xorg-x11-server.spec | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 842e909..c4505b5 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -46,7 +46,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.20.9 -Release: 1%{?gitdate:.%{gitdate}}%{?dist} +Release: 2%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org License: MIT @@ -139,7 +139,7 @@ Patch523: 0023-xwayland-Fix-setting-of-_XWAYLAND_RANDR_EMU_MONITOR_.patch Patch524: 0024-xwayland-Remove-unnecessary-xwl_window_is_toplevel-c.patch BuildRequires: systemtap-sdt-devel -BuildRequires: git +BuildRequires: git-core BuildRequires: automake autoconf libtool pkgconfig BuildRequires: xorg-x11-util-macros >= 1.17 @@ -402,7 +402,7 @@ autoreconf -f -v --install || exit 1 --enable-xwayland \ %{dri_flags} %{?bodhi_flags} \ ${CONFIGURE} - + make V=1 %{?_smp_mflags} @@ -563,6 +563,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Wed Nov 04 2020 Peter Hutterer 1.20.9-2 +- Drop BuildRequires to git-core only + * Thu Oct 8 2020 Olivier Fourdan - 1.20.9-1 - xserver 1.20.9 + all current fixes from upstream From 16f4e7facbb97ca6a23cb5944cfdda3c07e127ff Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 5 Nov 2020 10:35:10 +1000 Subject: [PATCH 056/131] Add BuildRequires for make --- xorg-x11-server.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index c4505b5..7fa256d 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -46,7 +46,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.20.9 -Release: 2%{?gitdate:.%{gitdate}}%{?dist} +Release: 3%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org License: MIT @@ -138,6 +138,7 @@ Patch522: 0022-xwayland-Call-xwl_window_check_resolution_change_emu.patch Patch523: 0023-xwayland-Fix-setting-of-_XWAYLAND_RANDR_EMU_MONITOR_.patch Patch524: 0024-xwayland-Remove-unnecessary-xwl_window_is_toplevel-c.patch +BuildRequires: make BuildRequires: systemtap-sdt-devel BuildRequires: git-core BuildRequires: automake autoconf libtool pkgconfig @@ -563,6 +564,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Thu Nov 5 10:35:09 AEST 2020 Peter Hutterer - 1.20.9-3 +- Add BuildRequires for make + * Wed Nov 04 2020 Peter Hutterer 1.20.9-2 - Drop BuildRequires to git-core only From 283d9cdb0767a503157cec6279cf6fe622d365c2 Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Wed, 2 Dec 2020 10:11:20 +0100 Subject: [PATCH 057/131] xserver 1.20.10 (CVE-2020-14360, CVE-2020-25712) --- ...-platform-device-probe-for-DT-based-.patch | 61 ----- 0001-dix-Add-GetCurrentClient-helper.patch | 6 +- ...-platform-device-PCI-detection-for-c.patch | 40 --- ...p_viewport-wayland-extension-support.patch | 10 +- ...e-platform-device-probe-less-fragile.patch | 133 ---------- ...fer_damage-instead-of-surface-damage.patch | 18 +- ...-the-number-of-max.-input-devices-to.patch | 35 --- ...e-output-modes-to-xrandr-output-mode.patch | 8 +- ...r_poly_fill_rect_gl-xRectangle-width.patch | 71 ------ ...ayland-Use-RandR-1.2-interface-rev-2.patch | 6 +- ...ond-reference-for-SavedCursor-in-xf8.patch | 34 --- ...xwayland-Add-per-client-private-data.patch | 10 +- ...-t-use-page-flipping-for-windows-cli.patch | 37 --- ...port-for-storing-per-client-per-outp.patch | 6 +- ...port-for-randr-resolution-change-emu.patch | 22 +- ...indow-pixmap-in-xwl_present_check_fl.patch | 45 ---- ...ove-dead-check-from-present_wnmd_che.patch | 33 --- ...lRRModeToDisplayMode-helper-function.patch | 6 +- ...VidModeGetCurrentRRMode-helper-to-th.patch | 6 +- ...discard-frame-callbacks-on-allow-com.patch | 73 ------ ...mode-mode-changing-emulation-support.patch | 6 +- ...GetNodeTypeFromFd-for-checking-if-a-.patch | 68 ----- ...pending-stream-reference-when-freein.patch | 43 ---- ...dow_should_enable_viewport-Add-extra.patch | 10 +- ...p-target_msc-adjustment-out-of-prese.patch | 121 --------- ...AYLAND_RANDR_EMU_MONITOR_RECTS-prope.patch | 12 +- ...nt-Add-present_vblank-exec_msc-field.patch | 236 ------------------ ...lient-id-for-the-window-manager-clie.patch | 18 +- ...md-Move-up-present_wnmd_queue_vblank.patch | 58 ----- ...Reuse-viewport-instead-of-recreating.patch | 10 +- ...ecute-copies-at-target_msc-1-already.patch | 139 ----------- ...Recurse-on-finding-the-none-wm-owner.patch | 14 +- ...ndow_get_none_wm_owner-return-a-Wind.patch | 14 +- ...-emulation-on-client-toplevel-resize.patch | 20 +- ...eck-resolution-change-emulation-when.patch | 10 +- ...Also-hook-screen-s-MoveWindow-method.patch | 12 +- ...lated-modes-not-being-removed-when-s.patch | 6 +- ...l_window_check_resolution_change_emu.patch | 10 +- ...ting-of-_XWAYLAND_RANDR_EMU_MONITOR_.patch | 16 +- ...unnecessary-xwl_window_is_toplevel-c.patch | 6 +- ...ndow_get_client_toplevel-non-recursi.patch | 37 +++ sources | 2 +- xorg-x11-server.spec | 26 +- 43 files changed, 177 insertions(+), 1377 deletions(-) delete mode 100644 0001-Revert-linux-Fix-platform-device-probe-for-DT-based-.patch delete mode 100644 0002-Revert-linux-Fix-platform-device-PCI-detection-for-c.patch delete mode 100644 0003-Revert-linux-Make-platform-device-probe-less-fragile.patch delete mode 100644 0004-include-Increase-the-number-of-max.-input-devices-to.patch delete mode 100644 0005-glamor-Fix-glamor_poly_fill_rect_gl-xRectangle-width.patch delete mode 100644 0006-xfree86-Take-second-reference-for-SavedCursor-in-xf8.patch delete mode 100644 0007-present-wnmd-Can-t-use-page-flipping-for-windows-cli.patch delete mode 100644 0008-xwayland-Check-window-pixmap-in-xwl_present_check_fl.patch delete mode 100644 0009-present-wnmd-Remove-dead-check-from-present_wnmd_che.patch delete mode 100644 0010-xwayland-Do-not-discard-frame-callbacks-on-allow-com.patch delete mode 100644 0011-xwayland-use-drmGetNodeTypeFromFd-for-checking-if-a-.patch delete mode 100644 0012-xwayland-Remove-pending-stream-reference-when-freein.patch delete mode 100644 0013-present-Move-flip-target_msc-adjustment-out-of-prese.patch delete mode 100644 0014-present-Add-present_vblank-exec_msc-field.patch delete mode 100644 0015-present-wnmd-Move-up-present_wnmd_queue_vblank.patch delete mode 100644 0016-present-wnmd-Execute-copies-at-target_msc-1-already.patch create mode 100644 0025-xwayland-Make-window_get_client_toplevel-non-recursi.patch diff --git a/0001-Revert-linux-Fix-platform-device-probe-for-DT-based-.patch b/0001-Revert-linux-Fix-platform-device-probe-for-DT-based-.patch deleted file mode 100644 index adeb9bd..0000000 --- a/0001-Revert-linux-Fix-platform-device-probe-for-DT-based-.patch +++ /dev/null @@ -1,61 +0,0 @@ -From 4b6fce5975c2f931a0478cf4deeec97529b05eb6 Mon Sep 17 00:00:00 2001 -From: Olivier Fourdan -Date: Tue, 8 Sep 2020 10:01:55 +0200 -Subject: [PATCH xserver 01/16] Revert "linux: Fix platform device probe for - DT-based PCI" - -This reverts commit 249a12c54a9316b089bd22683c011519348496df. - -https://gitlab.freedesktop.org/xorg/xserver/-/issues/1068 ---- - config/udev.c | 27 +-------------------------- - 1 file changed, 1 insertion(+), 26 deletions(-) - -diff --git a/config/udev.c b/config/udev.c -index b00d90237..14409549b 100644 ---- a/config/udev.c -+++ b/config/udev.c -@@ -464,31 +464,6 @@ config_udev_fini(void) - - #ifdef CONFIG_UDEV_KMS - --/* Find the last occurrence of the needle in haystack */ --static char *strrstr(const char *haystack, const char *needle) --{ -- char *prev, *last, *tmp; -- -- prev = strstr(haystack, needle); -- if (!prev) -- return NULL; -- -- last = prev; -- tmp = prev + 1; -- -- while (tmp) { -- last = strstr(tmp, needle); -- if (!last) -- return prev; -- else { -- prev = last; -- tmp = prev + 1; -- } -- } -- -- return last; --} -- - static void - config_udev_odev_setup_attribs(struct udev_device *udev_device, const char *path, const char *syspath, - int major, int minor, -@@ -503,7 +478,7 @@ 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 && (str = strrstr(value, "pci-"))) { -+ if (value && (str = strstr(value, "pci-"))) { - attribs->busid = XNFstrdup(str); - attribs->busid[3] = ':'; - } --- -2.28.0 - diff --git a/0001-dix-Add-GetCurrentClient-helper.patch b/0001-dix-Add-GetCurrentClient-helper.patch index 95f4e4d..3da345c 100644 --- a/0001-dix-Add-GetCurrentClient-helper.patch +++ b/0001-dix-Add-GetCurrentClient-helper.patch @@ -1,7 +1,7 @@ -From 3d78af269556f554c517801d0de481ba56d4e603 Mon Sep 17 00:00:00 2001 +From a815e5f51f75684a53d8fa14b596e03b738cd281 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Thu, 29 Aug 2019 14:18:28 +0200 -Subject: [PATCH xserver 01/24] dix: Add GetCurrentClient helper +Subject: [PATCH xserver 01/25] dix: Add GetCurrentClient helper MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -112,5 +112,5 @@ index b6e2bcfde..d65060cb6 100644 extern _X_EXPORT void SetInputCheck(HWEventQueuePtr /*c0 */ , HWEventQueuePtr /*c1 */ ); -- -2.26.2 +2.28.0 diff --git a/0002-Revert-linux-Fix-platform-device-PCI-detection-for-c.patch b/0002-Revert-linux-Fix-platform-device-PCI-detection-for-c.patch deleted file mode 100644 index 79a5fff..0000000 --- a/0002-Revert-linux-Fix-platform-device-PCI-detection-for-c.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 39cb95e959fab97a7e255dda1a1599b096fb0f7e Mon Sep 17 00:00:00 2001 -From: Olivier Fourdan -Date: Tue, 8 Sep 2020 10:03:11 +0200 -Subject: [PATCH xserver 02/16] Revert "linux: Fix platform device PCI - detection for complex bus topologies" - -This reverts commit 5c96eb5f44e62a4cfe835023cde304eb5795b8fd. - -https://gitlab.freedesktop.org/xorg/xserver/-/issues/1068 ---- - config/udev.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/config/udev.c b/config/udev.c -index 14409549b..8c6c4b666 100644 ---- a/config/udev.c -+++ b/config/udev.c -@@ -470,7 +470,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, *str; -+ const char *value; - - attribs->path = XNFstrdup(path); - attribs->syspath = XNFstrdup(syspath); -@@ -478,8 +478,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 && (str = strstr(value, "pci-"))) { -- attribs->busid = XNFstrdup(str); -+ if (value && !strncmp(value, "pci-", 4)) { -+ attribs->busid = XNFstrdup(value); - attribs->busid[3] = ':'; - } - --- -2.28.0 - diff --git a/0002-xwayland-Add-wp_viewport-wayland-extension-support.patch b/0002-xwayland-Add-wp_viewport-wayland-extension-support.patch index 894f273..e4518a0 100644 --- a/0002-xwayland-Add-wp_viewport-wayland-extension-support.patch +++ b/0002-xwayland-Add-wp_viewport-wayland-extension-support.patch @@ -1,7 +1,7 @@ -From 14e9b030449611a7a80f640129138c49ab46774e Mon Sep 17 00:00:00 2001 +From 0a3046286e69b171c319ff419c94cf62929246bf Mon Sep 17 00:00:00 2001 From: Robert Mader Date: Mon, 22 Jan 2018 22:02:32 +0100 -Subject: [PATCH xserver 02/24] xwayland: Add wp_viewport wayland extension +Subject: [PATCH xserver 02/25] xwayland: Add wp_viewport wayland extension support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -81,10 +81,10 @@ index 36bf2133a..4a8d171bb 100644 xwayland_glamor = [] eglstream_srcs = [] diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index d02934cd5..98592025a 100644 +index b353167c3..a70c1002f 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c -@@ -925,6 +925,9 @@ registry_global(void *data, struct wl_registry *registry, uint32_t id, +@@ -912,6 +912,9 @@ registry_global(void *data, struct wl_registry *registry, uint32_t id, wl_registry_bind(registry, id, &zxdg_output_manager_v1_interface, 1); xwl_screen_init_xdg_output(xwl_screen); } @@ -115,5 +115,5 @@ index b9495b313..91ae21eeb 100644 #define XWL_FORMAT_ARGB8888 (1 << 0) -- -2.26.2 +2.28.0 diff --git a/0003-Revert-linux-Make-platform-device-probe-less-fragile.patch b/0003-Revert-linux-Make-platform-device-probe-less-fragile.patch deleted file mode 100644 index e3d2d8d..0000000 --- a/0003-Revert-linux-Make-platform-device-probe-less-fragile.patch +++ /dev/null @@ -1,133 +0,0 @@ -From af4c84ce8855e84c0ad89b929bc972e884f0b8e3 Mon Sep 17 00:00:00 2001 -From: Olivier Fourdan -Date: Tue, 8 Sep 2020 10:03:33 +0200 -Subject: [PATCH xserver 03/16] Revert "linux: Make platform device probe less - fragile" - -This reverts commit 74b7427c41b4e4104af7abf70a996c086d3d7628. - -https://gitlab.freedesktop.org/xorg/xserver/-/issues/1068 ---- - config/udev.c | 17 +++++------------ - hw/xfree86/os-support/linux/lnx_platform.c | 20 ++++++++++++++++++-- - 2 files changed, 23 insertions(+), 14 deletions(-) - -diff --git a/config/udev.c b/config/udev.c -index 8c6c4b666..3a73189e2 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(struct udev_device *udev_device, const char *path, const char *syspath, -+config_udev_odev_setup_attribs(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(udev_device, path, syspath, major(devnum), -+ config_udev_odev_setup_attribs(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(device, path, syspath, major(devnum), -+ config_udev_odev_setup_attribs(path, syspath, major(devnum), - minor(devnum), DeleteGPUDeviceRequest); - /* Retry vtenter after a drm node removal */ - systemd_logind_vtenter(); -@@ -465,24 +465,17 @@ config_udev_fini(void) - #ifdef CONFIG_UDEV_KMS - - static void --config_udev_odev_setup_attribs(struct udev_device *udev_device, const char *path, const char *syspath, -+config_udev_odev_setup_attribs(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); - } -@@ -523,7 +516,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(udev_device, path, syspath, major(devnum), -+ config_udev_odev_setup_attribs(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 e62306219..70374ace8 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,6 +48,18 @@ 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); -@@ -57,6 +69,10 @@ 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.28.0 - diff --git a/0003-xwayland-Use-buffer_damage-instead-of-surface-damage.patch b/0003-xwayland-Use-buffer_damage-instead-of-surface-damage.patch index 8d925c2..0627415 100644 --- a/0003-xwayland-Use-buffer_damage-instead-of-surface-damage.patch +++ b/0003-xwayland-Use-buffer_damage-instead-of-surface-damage.patch @@ -1,7 +1,7 @@ -From a86c70ed7e9c2b4e8e2f93beddbc51c0cdad57f2 Mon Sep 17 00:00:00 2001 +From 30859f64d1718d1476648dcddbb3d81c2f932828 Mon Sep 17 00:00:00 2001 From: Robert Mader Date: Tue, 2 Jul 2019 12:03:12 +0200 -Subject: [PATCH xserver 03/24] xwayland: Use buffer_damage instead of surface +Subject: [PATCH xserver 03/25] xwayland: Use buffer_damage instead of surface damage if available MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -64,10 +64,10 @@ index 66720bcc0..cbc715061 100644 xwl_cursor->frame_cb = wl_surface_frame(xwl_cursor->surface); wl_callback_add_listener(xwl_cursor->frame_cb, &frame_listener, xwl_cursor); diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c -index 6076f6498..ef75ad2ef 100644 +index d177abdd8..f4027f91e 100644 --- a/hw/xwayland/xwayland-present.c +++ b/hw/xwayland/xwayland-present.c -@@ -497,11 +497,11 @@ xwl_present_flip(WindowPtr present_window, +@@ -505,11 +505,11 @@ xwl_present_flip(WindowPtr present_window, /* Realign timer */ xwl_present_reset_timer(xwl_present_window); @@ -85,10 +85,10 @@ index 6076f6498..ef75ad2ef 100644 wl_surface_commit(xwl_window->surface); diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index 98592025a..f7fcd1e32 100644 +index a70c1002f..811257b00 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c -@@ -805,6 +805,16 @@ xwl_destroy_window(WindowPtr window) +@@ -792,6 +792,16 @@ xwl_destroy_window(WindowPtr window) return ret; } @@ -105,7 +105,7 @@ index 98592025a..f7fcd1e32 100644 static void xwl_window_post_damage(struct xwl_window *xwl_window) { -@@ -841,13 +851,15 @@ xwl_window_post_damage(struct xwl_window *xwl_window) +@@ -828,13 +838,15 @@ xwl_window_post_damage(struct xwl_window *xwl_window) */ if (RegionNumRects(region) > 256) { box = RegionExtents(region); @@ -126,7 +126,7 @@ index 98592025a..f7fcd1e32 100644 } xwl_window_create_frame_callback(xwl_window); -@@ -906,8 +918,13 @@ registry_global(void *data, struct wl_registry *registry, uint32_t id, +@@ -893,8 +905,13 @@ registry_global(void *data, struct wl_registry *registry, uint32_t id, struct xwl_screen *xwl_screen = data; if (strcmp(interface, "wl_compositor") == 0) { @@ -156,5 +156,5 @@ index 91ae21eeb..1244d2e91 100644 void xwl_screen_roundtrip (struct xwl_screen *xwl_screen); -- -2.26.2 +2.28.0 diff --git a/0004-include-Increase-the-number-of-max.-input-devices-to.patch b/0004-include-Increase-the-number-of-max.-input-devices-to.patch deleted file mode 100644 index 579afbf..0000000 --- a/0004-include-Increase-the-number-of-max.-input-devices-to.patch +++ /dev/null @@ -1,35 +0,0 @@ -From b28c882889cbea9be3748d3dee1b21ba6eb90b66 Mon Sep 17 00:00:00 2001 -From: Arthur Williams -Date: Fri, 25 Sep 2020 04:52:57 +0000 -Subject: [PATCH xserver 04/16] include: Increase the number of max. input - devices to 256. - -Extending the decade old f0124ed93, to increase the number of input -devices from 40 to 256. 40 translates at most 9 MD, while 256 will allow -63 MD. It is an arbitrary number, but people are hitting the current -limit under reasonable conditions. - -Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=64793 -Signed-off-by: Arthur Williams - -(cherry picked from commit fe439596b99db65bbae35eff1ea0b79db167f8d6) ---- - include/misc.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/include/misc.h b/include/misc.h -index 14920c3c3..9b422e53b 100644 ---- a/include/misc.h -+++ b/include/misc.h -@@ -91,7 +91,7 @@ OF THIS SOFTWARE. - #define LIMITCLIENTS 256 /* Must be a power of 2 and <= MAXCLIENTS */ - #define MAXEXTENSIONS 128 - #define MAXFORMATS 8 --#define MAXDEVICES 40 /* input devices */ -+#define MAXDEVICES 256 /* input devices */ - #define GPU_SCREEN_OFFSET 256 - - /* 128 event opcodes for core + extension events, excluding GE */ --- -2.28.0 - diff --git a/0004-xwayland-Add-fake-output-modes-to-xrandr-output-mode.patch b/0004-xwayland-Add-fake-output-modes-to-xrandr-output-mode.patch index 86dde42..45d52a9 100644 --- a/0004-xwayland-Add-fake-output-modes-to-xrandr-output-mode.patch +++ b/0004-xwayland-Add-fake-output-modes-to-xrandr-output-mode.patch @@ -1,7 +1,7 @@ -From c0595515c65571d6304530c51331013381eea1dd Mon Sep 17 00:00:00 2001 +From 32987e08e7f1e79ee50ce032cc6c1b6d28e6a50d Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Wed, 26 Jun 2019 16:46:54 +0200 -Subject: [PATCH xserver 04/24] xwayland: Add fake output modes to xrandr +Subject: [PATCH xserver 04/25] xwayland: Add fake output modes to xrandr output mode lists MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -163,7 +163,7 @@ index ae646c663..4036ba681 100644 xorg_list_for_each_entry(it, &xwl_screen->output_list, link) { /* output done event is sent even when some property diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index f7fcd1e32..ffd4809df 100644 +index 811257b00..e84515f94 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c @@ -154,6 +154,23 @@ xwl_screen_get(ScreenPtr screen) @@ -203,5 +203,5 @@ index 1244d2e91..200e18a8d 100644 void xwl_tablet_tool_set_cursor(struct xwl_tablet_tool *tool); void xwl_seat_set_cursor(struct xwl_seat *xwl_seat); -- -2.26.2 +2.28.0 diff --git a/0005-glamor-Fix-glamor_poly_fill_rect_gl-xRectangle-width.patch b/0005-glamor-Fix-glamor_poly_fill_rect_gl-xRectangle-width.patch deleted file mode 100644 index 50d22e5..0000000 --- a/0005-glamor-Fix-glamor_poly_fill_rect_gl-xRectangle-width.patch +++ /dev/null @@ -1,71 +0,0 @@ -From 8c3c8bda2c44fb3d62b954b02b08e3b1771ef5bc Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Michel=20D=C3=A4nzer?= -Date: Tue, 25 Aug 2020 17:26:56 +0200 -Subject: [PATCH xserver 05/16] glamor: Fix glamor_poly_fill_rect_gl - xRectangle::width/height handling - -(Using GLSL 1.30 or newer) - -The width/height members of xRectangle are unsigned, but they were -being interpreted as signed when converting to floating point for the -vertex shader, producing incorrect drawing for values > 32767. - -v2: -* Use separate GL_UNSIGNED_SHORT vertex attribute for width/height. - (Eric Anholt) - -Reviewed-by: Eric Anholt -(cherry picked from commit 032af35657aa95c6bbdb74ff8c72e535b9b56cfa) ---- - glamor/glamor_rects.c | 18 ++++++++++++++---- - 1 file changed, 14 insertions(+), 4 deletions(-) - -diff --git a/glamor/glamor_rects.c b/glamor/glamor_rects.c -index 6cbb040c1..ae4fe8bcc 100644 ---- a/glamor/glamor_rects.c -+++ b/glamor/glamor_rects.c -@@ -27,8 +27,10 @@ - static const glamor_facet glamor_facet_polyfillrect_130 = { - .name = "poly_fill_rect", - .version = 130, -- .vs_vars = "attribute vec4 primitive;\n", -- .vs_exec = (" vec2 pos = primitive.zw * vec2(gl_VertexID&1, (gl_VertexID&2)>>1);\n" -+ .source_name = "size", -+ .vs_vars = "attribute vec2 primitive;\n" -+ "attribute vec2 size;\n", -+ .vs_exec = (" vec2 pos = size * vec2(gl_VertexID&1, (gl_VertexID&2)>>1);\n" - GLAMOR_POS(gl_Position, (primitive.xy + pos))), - }; - -@@ -81,9 +83,14 @@ glamor_poly_fill_rect_gl(DrawablePtr drawable, - - glEnableVertexAttribArray(GLAMOR_VERTEX_POS); - glVertexAttribDivisor(GLAMOR_VERTEX_POS, 1); -- glVertexAttribPointer(GLAMOR_VERTEX_POS, 4, GL_SHORT, GL_FALSE, -+ glVertexAttribPointer(GLAMOR_VERTEX_POS, 2, GL_SHORT, GL_FALSE, - 4 * sizeof (short), vbo_offset); - -+ glEnableVertexAttribArray(GLAMOR_VERTEX_SOURCE); -+ glVertexAttribDivisor(GLAMOR_VERTEX_SOURCE, 1); -+ glVertexAttribPointer(GLAMOR_VERTEX_SOURCE, 2, GL_UNSIGNED_SHORT, GL_FALSE, -+ 4 * sizeof (short), vbo_offset + 2 * sizeof (short)); -+ - memcpy(v, prect, nrect * sizeof (xRectangle)); - - glamor_put_vbo_space(screen); -@@ -156,8 +163,11 @@ glamor_poly_fill_rect_gl(DrawablePtr drawable, - - bail: - glDisable(GL_SCISSOR_TEST); -- if (glamor_priv->glsl_version >= 130) -+ if (glamor_priv->glsl_version >= 130) { -+ glVertexAttribDivisor(GLAMOR_VERTEX_SOURCE, 0); -+ glDisableVertexAttribArray(GLAMOR_VERTEX_SOURCE); - glVertexAttribDivisor(GLAMOR_VERTEX_POS, 0); -+ } - glDisableVertexAttribArray(GLAMOR_VERTEX_POS); - - return ret; --- -2.28.0 - diff --git a/0005-xwayland-Use-RandR-1.2-interface-rev-2.patch b/0005-xwayland-Use-RandR-1.2-interface-rev-2.patch index ab50605..7493da6 100644 --- a/0005-xwayland-Use-RandR-1.2-interface-rev-2.patch +++ b/0005-xwayland-Use-RandR-1.2-interface-rev-2.patch @@ -1,7 +1,7 @@ -From 19e725dd368e25c057770530cdd622234303003e Mon Sep 17 00:00:00 2001 +From 09dcf01f5ea8d1f828a58e54edd608e6918d0b59 Mon Sep 17 00:00:00 2001 From: Robert Mader Date: Mon, 22 Jan 2018 17:57:38 +0100 -Subject: [PATCH xserver 05/24] xwayland: Use RandR 1.2 interface (rev 2) +Subject: [PATCH xserver 05/25] xwayland: Use RandR 1.2 interface (rev 2) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -135,5 +135,5 @@ index 4036ba681..633ebb89e 100644 return TRUE; } -- -2.26.2 +2.28.0 diff --git a/0006-xfree86-Take-second-reference-for-SavedCursor-in-xf8.patch b/0006-xfree86-Take-second-reference-for-SavedCursor-in-xf8.patch deleted file mode 100644 index f083339..0000000 --- a/0006-xfree86-Take-second-reference-for-SavedCursor-in-xf8.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 1e84fda2020b12a83c6b9c6d31ab84f993c6176c Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Michel=20D=C3=A4nzer?= -Date: Tue, 1 Sep 2020 11:24:57 +0200 -Subject: [PATCH xserver 06/16] xfree86: Take second reference for SavedCursor - in xf86CursorSetCursor - -The same pointer is kept in CurrentCursor as well, therefore two -RefCursor calls are needed. - -Fixes use-after-free after switching VTs. - -Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1067 -(cherry picked from commit 919f1f46fc67dae93b2b3f278fcbfc77af34ec58) ---- - hw/xfree86/ramdac/xf86CursorRD.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/hw/xfree86/ramdac/xf86CursorRD.c b/hw/xfree86/ramdac/xf86CursorRD.c -index ee1d98916..02dab36fe 100644 ---- a/hw/xfree86/ramdac/xf86CursorRD.c -+++ b/hw/xfree86/ramdac/xf86CursorRD.c -@@ -334,6 +334,9 @@ xf86CursorSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCurs, - ScreenPriv->HotY = cursor->bits->yhot; - - if (!infoPtr->pScrn->vtSema) { -+ cursor = RefCursor(cursor); -+ if (ScreenPriv->SavedCursor) -+ FreeCursor(ScreenPriv->SavedCursor, None); - ScreenPriv->SavedCursor = cursor; - return; - } --- -2.28.0 - diff --git a/0006-xwayland-Add-per-client-private-data.patch b/0006-xwayland-Add-per-client-private-data.patch index 3109b46..5d64bd8 100644 --- a/0006-xwayland-Add-per-client-private-data.patch +++ b/0006-xwayland-Add-per-client-private-data.patch @@ -1,7 +1,7 @@ -From e6ba28eb96b227e47c371a7063f778fb2ab82a0b Mon Sep 17 00:00:00 2001 +From ca0616ca4ca1badff2674fa5db8f290935b81e7f Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Thu, 29 Aug 2019 22:45:12 +0200 -Subject: [PATCH xserver 06/24] xwayland: Add per client private data +Subject: [PATCH xserver 06/25] xwayland: Add per client private data MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -21,7 +21,7 @@ Signed-off-by: Hans de Goede 2 files changed, 19 insertions(+) diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index ffd4809df..e00dba334 100644 +index e84515f94..f422cfc29 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c @@ -137,11 +137,18 @@ ddxProcessArgument(int argc, char *argv[], int i) @@ -43,7 +43,7 @@ index ffd4809df..e00dba334 100644 static struct xwl_window * xwl_window_get(WindowPtr window) { -@@ -1158,6 +1165,13 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) +@@ -1145,6 +1152,13 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) return FALSE; if (!dixRegisterPrivateKey(&xwl_damage_private_key, PRIVATE_WINDOW, 0)) return FALSE; @@ -76,5 +76,5 @@ index 200e18a8d..19626d394 100644 void xwl_surface_damage(struct xwl_screen *xwl_screen, struct wl_surface *surface, -- -2.26.2 +2.28.0 diff --git a/0007-present-wnmd-Can-t-use-page-flipping-for-windows-cli.patch b/0007-present-wnmd-Can-t-use-page-flipping-for-windows-cli.patch deleted file mode 100644 index 947dd57..0000000 --- a/0007-present-wnmd-Can-t-use-page-flipping-for-windows-cli.patch +++ /dev/null @@ -1,37 +0,0 @@ -From f4006d795cb199bf7deeb00f542c592db6a5becb Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Michel=20D=C3=A4nzer?= -Date: Mon, 7 Sep 2020 18:35:10 +0200 -Subject: [PATCH xserver 07/16] present/wnmd: Can't use page flipping for - windows clipped by children - -Noticed this was missing while working on the following fix. - -v2: -* Dropped present_wnmd_can_window_flip hunk (that function is never - called, will be cleaned up in a follow-up MR). - -Reviewed-by: Olivier Fourdan # v1 -Reviewed-by: Roman Gilg -(cherry picked from commit 7ac303c7b1e3b1be79ba3648e217798683e65a99) ---- - present/present_wnmd.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/present/present_wnmd.c b/present/present_wnmd.c -index 32c4d55f1..6a3d1035b 100644 ---- a/present/present_wnmd.c -+++ b/present/present_wnmd.c -@@ -291,6 +291,10 @@ present_wnmd_check_flip(RRCrtcPtr crtc, - if ( !RegionEqual(&window->winSize, &toplvl_window->winSize) ) - return FALSE; - -+ /* Can't flip if window clipped by children */ -+ if (!RegionEqual(&window->clipList, &window->winSize)) -+ return FALSE; -+ - /* Ask the driver for permission */ - if (screen_priv->wnmd_info->check_flip2) { - if (!(*screen_priv->wnmd_info->check_flip2) (crtc, window, pixmap, sync_flip, reason)) { --- -2.28.0 - diff --git a/0007-xwayland-Add-support-for-storing-per-client-per-outp.patch b/0007-xwayland-Add-support-for-storing-per-client-per-outp.patch index 4c7c0e5..6673754 100644 --- a/0007-xwayland-Add-support-for-storing-per-client-per-outp.patch +++ b/0007-xwayland-Add-support-for-storing-per-client-per-outp.patch @@ -1,7 +1,7 @@ -From 575c8b49a715d45115625643b8495ad786961e38 Mon Sep 17 00:00:00 2001 +From 4bc5480d2e63cceecdc18b4bfda4fb4624f8fb43 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Thu, 29 Aug 2019 23:04:36 +0200 -Subject: [PATCH xserver 07/24] xwayland: Add support for storing per client +Subject: [PATCH xserver 07/25] xwayland: Add support for storing per client per output emulated resolution MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -145,5 +145,5 @@ index 19626d394..c886d77e9 100644 float VRefresh, Bool Reduced, Bool Interlaced); -- -2.26.2 +2.28.0 diff --git a/0008-xwayland-Add-support-for-randr-resolution-change-emu.patch b/0008-xwayland-Add-support-for-randr-resolution-change-emu.patch index e3c5b5a..75a2877 100644 --- a/0008-xwayland-Add-support-for-randr-resolution-change-emu.patch +++ b/0008-xwayland-Add-support-for-randr-resolution-change-emu.patch @@ -1,7 +1,7 @@ -From 1317f1f02fd0037e2bf7a678f2c3a9a4170161e9 Mon Sep 17 00:00:00 2001 +From 2f2a6b8556bd104740d76126640abcfe4705047c Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Tue, 2 Jul 2019 11:55:26 +0200 -Subject: [PATCH xserver 08/24] xwayland: Add support for randr-resolution +Subject: [PATCH xserver 08/25] xwayland: Add support for randr-resolution change emulation using viewport MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -143,7 +143,7 @@ index 64794dee7..e09d00108 100644 static Bool diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index e00dba334..9c6cf7cf5 100644 +index f422cfc29..87870a5f1 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c @@ -178,6 +178,23 @@ xwl_screen_has_resolution_change_emulation(struct xwl_screen *xwl_screen) @@ -170,7 +170,7 @@ index e00dba334..9c6cf7cf5 100644 static void xwl_window_set_allow_commits(struct xwl_window *xwl_window, Bool allow, const char *debug_msg) -@@ -514,6 +531,150 @@ xwl_pixmap_get(PixmapPtr pixmap) +@@ -501,6 +518,150 @@ xwl_pixmap_get(PixmapPtr pixmap) return dixLookupPrivate(&pixmap->devPrivates, &xwl_pixmap_private_key); } @@ -321,7 +321,7 @@ index e00dba334..9c6cf7cf5 100644 static void xwl_window_init_allow_commits(struct xwl_window *xwl_window) { -@@ -584,6 +745,8 @@ ensure_surface_for_window(WindowPtr window) +@@ -571,6 +732,8 @@ ensure_surface_for_window(WindowPtr window) xwl_window->xwl_screen = xwl_screen; xwl_window->window = window; @@ -330,7 +330,7 @@ index e00dba334..9c6cf7cf5 100644 xwl_window->surface = wl_compositor_create_surface(xwl_screen->compositor); if (xwl_window->surface == NULL) { ErrorF("wl_display_create_surface failed\n"); -@@ -625,6 +788,7 @@ ensure_surface_for_window(WindowPtr window) +@@ -612,6 +775,7 @@ ensure_surface_for_window(WindowPtr window) dixSetPrivate(&window->devPrivates, &xwl_window_private_key, xwl_window); xorg_list_init(&xwl_window->link_damage); @@ -338,7 +338,7 @@ index e00dba334..9c6cf7cf5 100644 #ifdef GLAMOR_HAS_GBM xorg_list_init(&xwl_window->frame_callback_list); -@@ -718,8 +882,12 @@ xwl_unrealize_window(WindowPtr window) +@@ -705,8 +869,12 @@ xwl_unrealize_window(WindowPtr window) if (!xwl_window) return ret; @@ -351,7 +351,7 @@ index e00dba334..9c6cf7cf5 100644 unregister_damage(window); if (xwl_window->frame_callback) -@@ -769,6 +937,33 @@ xwl_set_window_pixmap(WindowPtr window, +@@ -756,6 +924,33 @@ xwl_set_window_pixmap(WindowPtr window, ensure_surface_for_window(window); } @@ -385,7 +385,7 @@ index e00dba334..9c6cf7cf5 100644 static void frame_callback(void *data, struct wl_callback *callback, -@@ -1246,6 +1441,7 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) +@@ -1233,6 +1428,7 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) xorg_list_init(&xwl_screen->output_list); xorg_list_init(&xwl_screen->seat_list); xorg_list_init(&xwl_screen->damage_window_list); @@ -393,7 +393,7 @@ index e00dba334..9c6cf7cf5 100644 xwl_screen->depth = 24; if (!monitorResolution) -@@ -1340,6 +1536,9 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) +@@ -1332,6 +1528,9 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) xwl_screen->CloseScreen = pScreen->CloseScreen; pScreen->CloseScreen = xwl_close_screen; @@ -458,5 +458,5 @@ index c886d77e9..36c4c4c8b 100644 float VRefresh, Bool Reduced, Bool Interlaced); -- -2.26.2 +2.28.0 diff --git a/0008-xwayland-Check-window-pixmap-in-xwl_present_check_fl.patch b/0008-xwayland-Check-window-pixmap-in-xwl_present_check_fl.patch deleted file mode 100644 index 6e846d2..0000000 --- a/0008-xwayland-Check-window-pixmap-in-xwl_present_check_fl.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 51ee6e5ceb0cacc8e2fa225ad5391ffb159e36a0 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Michel=20D=C3=A4nzer?= -Date: Mon, 7 Sep 2020 18:39:17 +0200 -Subject: [PATCH xserver 08/16] xwayland: Check window pixmap in - xwl_present_check_flip2 - -We can only flip if the window pixmap matches that of the toplevel -window. Doing so regardless could cause the toplevel window pixmap to -get destroyed while it was still referenced by the window, resulting in -use-after-free and likely a crash. - -Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1033 -Reviewed-by: Olivier Fourdan -Reviewed-by: Roman Gilg -(cherry picked from commit 4c25356d6cd908c5030c70e712076dff318ac00d) ---- - hw/xwayland/xwayland-present.c | 8 ++++++++ - 1 file changed, 8 insertions(+) - -diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c -index 6076f6498..d177abdd8 100644 ---- a/hw/xwayland/xwayland-present.c -+++ b/hw/xwayland/xwayland-present.c -@@ -421,10 +421,18 @@ xwl_present_check_flip2(RRCrtcPtr crtc, - PresentFlipReason *reason) - { - struct xwl_window *xwl_window = xwl_window_from_window(present_window); -+ ScreenPtr screen = pixmap->drawable.pScreen; - - if (!xwl_window) - return FALSE; - -+ /* Can't flip if the window pixmap doesn't match the xwl_window parent -+ * window's, e.g. because a client redirected this window or one of its -+ * parents. -+ */ -+ if (screen->GetWindowPixmap(xwl_window->window) != screen->GetWindowPixmap(present_window)) -+ return FALSE; -+ - /* - * We currently only allow flips of windows, that have the same - * dimensions as their xwl_window parent window. For the case of --- -2.28.0 - diff --git a/0009-present-wnmd-Remove-dead-check-from-present_wnmd_che.patch b/0009-present-wnmd-Remove-dead-check-from-present_wnmd_che.patch deleted file mode 100644 index 2bad794..0000000 --- a/0009-present-wnmd-Remove-dead-check-from-present_wnmd_che.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 174cb91d82d643f78d8ba2b9999312b9d7dea98c Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Michel=20D=C3=A4nzer?= -Date: Mon, 7 Sep 2020 18:40:34 +0200 -Subject: [PATCH xserver 09/16] present/wnmd: Remove dead check from - present_wnmd_check_flip - -present_wnmd_toplvl_pixmap_window returns a window with the same window -pixmap, so the check could never fail. - -Reviewed-by: Roman Gilg -(cherry picked from commit b6b1161fd7ac409156fb69439897bcabdeacf393) ---- - present/present_wnmd.c | 4 ---- - 1 file changed, 4 deletions(-) - -diff --git a/present/present_wnmd.c b/present/present_wnmd.c -index 6a3d1035b..35ea12968 100644 ---- a/present/present_wnmd.c -+++ b/present/present_wnmd.c -@@ -270,10 +270,6 @@ present_wnmd_check_flip(RRCrtcPtr crtc, - if (!screen_priv->wnmd_info->flip) - return FALSE; - -- /* Can't flip redirected child windows */ -- if (screen->GetWindowPixmap(window) != screen->GetWindowPixmap(toplvl_window)) -- return FALSE; -- - /* Source pixmap must align with window exactly */ - if (x_off || y_off) - return FALSE; --- -2.28.0 - diff --git a/0009-xwayland-Add-xwlRRModeToDisplayMode-helper-function.patch b/0009-xwayland-Add-xwlRRModeToDisplayMode-helper-function.patch index 7126893..1d29960 100644 --- a/0009-xwayland-Add-xwlRRModeToDisplayMode-helper-function.patch +++ b/0009-xwayland-Add-xwlRRModeToDisplayMode-helper-function.patch @@ -1,7 +1,7 @@ -From 0efb1df3a2ef4bc2dd329af63e1bd3dbda3445e4 Mon Sep 17 00:00:00 2001 +From aedd71a61ac2d78c347180e7d87e5918b795609e Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 8 Jul 2019 14:00:27 +0200 -Subject: [PATCH xserver 09/24] xwayland: Add xwlRRModeToDisplayMode() helper +Subject: [PATCH xserver 09/25] xwayland: Add xwlRRModeToDisplayMode() helper function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -97,5 +97,5 @@ index d25d1aca1..428af716d 100644 return TRUE; } -- -2.26.2 +2.28.0 diff --git a/0010-xwayland-Add-xwlVidModeGetCurrentRRMode-helper-to-th.patch b/0010-xwayland-Add-xwlVidModeGetCurrentRRMode-helper-to-th.patch index ee65f4d..ea1f6c4 100644 --- a/0010-xwayland-Add-xwlVidModeGetCurrentRRMode-helper-to-th.patch +++ b/0010-xwayland-Add-xwlVidModeGetCurrentRRMode-helper-to-th.patch @@ -1,7 +1,7 @@ -From fdbc9904d5af48db56877369f8b4671985ffc363 Mon Sep 17 00:00:00 2001 +From 719c1d2ef99784043883787d04afc0437f3a9b8f Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 8 Jul 2019 18:35:27 +0200 -Subject: [PATCH xserver 10/24] xwayland: Add xwlVidModeGetCurrentRRMode helper +Subject: [PATCH xserver 10/25] xwayland: Add xwlVidModeGetCurrentRRMode helper to the vidmode code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -189,5 +189,5 @@ index 428af716d..7cf982fcc 100644 static void -- -2.26.2 +2.28.0 diff --git a/0010-xwayland-Do-not-discard-frame-callbacks-on-allow-com.patch b/0010-xwayland-Do-not-discard-frame-callbacks-on-allow-com.patch deleted file mode 100644 index ea78fb5..0000000 --- a/0010-xwayland-Do-not-discard-frame-callbacks-on-allow-com.patch +++ /dev/null @@ -1,73 +0,0 @@ -From d108c2c82cba242ea5998d7c91254d90d3a5db71 Mon Sep 17 00:00:00 2001 -From: Olivier Fourdan -Date: Fri, 11 Sep 2020 11:30:18 +0200 -Subject: [PATCH xserver 10/16] xwayland: Do not discard frame callbacks on - allow commits -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Currently, when a X11 client (usually the X11 window manager from a -Wayland compositor) changes the value of the X11 property -`_XWAYLAND_ALLOW_COMMITS` from `false` to `true`, all pending frame -callbacks on the window are discarded so that the commit occurs -immediately. - -Weston uses that mechanism to prevent the content of the window from -showing before it's ready when mapping the window initially, but -discarding the pending frame callbacks has no effect on the initial -mapping of the X11 window since at that point there cannot be any frame -callback on a surface which hasn't been committed yet anyway. - -However, discarding pending frame callbacks can be problematic if we -were to use the same `_XWAYLAND_ALLOW_COMMITS` mechanism to prevent -damages to be posted before the X11 toplevel is updated completely -(including the window decorations from the X11 window manager). - -Remove the portion of code discarding the pending frame callback, -Xwayland should always wait for a pending frame callback if there's one -before posting new damages. - -Signed-off-by: Olivier Fourdan -Reviewed-by: Pekka Paalanen -Reviewed-by: Michel Dänzer -https://gitlab.freedesktop.org/xorg/xserver/merge_requests/333 -(cherry picked from commit 66da95a172c4941b75ffedcdaa0138c0a48f11fb) ---- - hw/xwayland/xwayland.c | 13 ------------- - 1 file changed, 13 deletions(-) - -diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index d02934cd5..a69188c0f 100644 ---- a/hw/xwayland/xwayland.c -+++ b/hw/xwayland/xwayland.c -@@ -193,8 +193,6 @@ static void - xwl_window_property_allow_commits(struct xwl_window *xwl_window, - PropertyStateRec *propstate) - { -- Bool old_allow_commits = xwl_window->allow_commits; -- - switch (propstate->state) { - case PropertyNewValue: - xwl_window_set_allow_commits_from_property(xwl_window, propstate->prop); -@@ -207,17 +205,6 @@ xwl_window_property_allow_commits(struct xwl_window *xwl_window, - default: - break; - } -- -- /* If allow_commits turned from off to on, discard any frame -- * callback we might be waiting for so that a new buffer is posted -- * immediately through block_handler() if there is damage to post. -- */ -- if (!old_allow_commits && xwl_window->allow_commits) { -- if (xwl_window->frame_callback) { -- wl_callback_destroy(xwl_window->frame_callback); -- xwl_window->frame_callback = NULL; -- } -- } - } - - static void --- -2.28.0 - diff --git a/0011-xwayland-Add-vidmode-mode-changing-emulation-support.patch b/0011-xwayland-Add-vidmode-mode-changing-emulation-support.patch index 3e8e038..f3df892 100644 --- a/0011-xwayland-Add-vidmode-mode-changing-emulation-support.patch +++ b/0011-xwayland-Add-vidmode-mode-changing-emulation-support.patch @@ -1,7 +1,7 @@ -From aa5920519dff3dc3dfb33af342e454627fa5402c Mon Sep 17 00:00:00 2001 +From 98e6cadf2ba8490c303cdc94106baf3f31006299 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Tue, 9 Jul 2019 09:31:13 +0200 -Subject: [PATCH xserver 11/24] xwayland: Add vidmode mode changing emulation +Subject: [PATCH xserver 11/25] xwayland: Add vidmode mode changing emulation support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -232,5 +232,5 @@ index 7cf982fcc..99a4d2c92 100644 static Bool -- -2.26.2 +2.28.0 diff --git a/0011-xwayland-use-drmGetNodeTypeFromFd-for-checking-if-a-.patch b/0011-xwayland-use-drmGetNodeTypeFromFd-for-checking-if-a-.patch deleted file mode 100644 index f8b1463..0000000 --- a/0011-xwayland-use-drmGetNodeTypeFromFd-for-checking-if-a-.patch +++ /dev/null @@ -1,68 +0,0 @@ -From 1ac389dda89b2882c80767c91bbe88e01818491c Mon Sep 17 00:00:00 2001 -From: Greg V -Date: Tue, 15 Sep 2020 17:41:04 +0300 -Subject: [PATCH xserver 11/16] xwayland: use drmGetNodeTypeFromFd for checking - if a node is a render one - -Major/minor numbers are a.. major (ha) source of pain in FreeBSD porting. -In this case, Xwayland was thinking that /dev/dri/card0 is already a render node, -because the st_rdev on FreeBSD was passing the Linux-style check, -and because of the assumption, acceleration would fail because -various ioctls like AMDGPU_INFO would be denied on the non-render node. - -Switch to libdrm's function that already works correctly on all platforms. - -Signed-off-by: Greg V -Reviewed-by: Emmanuel Vadot -(cherry picked from commit 239ebdc9e447d4f836d0c2aa6068c6064fffb46c) ---- - hw/xwayland/xwayland-glamor-gbm.c | 19 ++----------------- - 1 file changed, 2 insertions(+), 17 deletions(-) - -diff --git a/hw/xwayland/xwayland-glamor-gbm.c b/hw/xwayland/xwayland-glamor-gbm.c -index ebff70a00..b519492cc 100644 ---- a/hw/xwayland/xwayland-glamor-gbm.c -+++ b/hw/xwayland/xwayland-glamor-gbm.c -@@ -110,21 +110,6 @@ wl_drm_format_for_depth(int depth) - } - } - --static char --is_fd_render_node(int fd) --{ -- struct stat render; -- -- if (fstat(fd, &render)) -- return 0; -- if (!S_ISCHR(render.st_mode)) -- return 0; -- if (render.st_rdev & 0x80) -- return 1; -- -- return 0; --} -- - static char - is_device_path_render_node (const char *device_path) - { -@@ -135,7 +120,7 @@ is_device_path_render_node (const char *device_path) - if (fd < 0) - return 0; - -- is_render_node = is_fd_render_node(fd); -+ is_render_node = (drmGetNodeTypeFromFd(fd) == DRM_NODE_RENDER); - close(fd); - - return is_render_node; -@@ -767,7 +752,7 @@ xwl_drm_handle_device(void *data, struct wl_drm *drm, const char *device) - return; - } - -- if (is_fd_render_node(xwl_gbm->drm_fd)) { -+ if (drmGetNodeTypeFromFd(xwl_gbm->drm_fd) == DRM_NODE_RENDER) { - xwl_gbm->fd_render_node = 1; - xwl_screen->expecting_event--; - } else { --- -2.28.0 - diff --git a/0012-xwayland-Remove-pending-stream-reference-when-freein.patch b/0012-xwayland-Remove-pending-stream-reference-when-freein.patch deleted file mode 100644 index e3565dc..0000000 --- a/0012-xwayland-Remove-pending-stream-reference-when-freein.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 1930ed233fdec5d22e4fc192769a0126faabb3ea Mon Sep 17 00:00:00 2001 -From: Olivier Fourdan -Date: Mon, 14 Sep 2020 15:39:10 +0200 -Subject: [PATCH xserver 12/16] xwayland: Remove pending stream reference when - freeing - -The EGLStream backend keeps a queue of pending streams for each Xwayland -window. - -However, when this pending queue is freed, the corresponding private -data may not be cleared (typically if the pixmap for this window has -changed before the compositor finished attaching the consumer for the -window's pixmap's original eglstream), leading to a use-after-free and a -crash when trying to use that data as the window pixmap. - -Make sure to clear the private data when the pending stream is freed. - -Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1055 -Signed-off-by: Olivier Fourdan -Tested-by: Karol Szuster -Reviewed-by: Adam Jackson -(cherry picked from commit a5f439dcd21b4fda093cb382bb1a758b434a1444) ---- - hw/xwayland/xwayland-glamor-eglstream.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/hw/xwayland/xwayland-glamor-eglstream.c b/hw/xwayland/xwayland-glamor-eglstream.c -index 36b749aaf..0c32fff4d 100644 ---- a/hw/xwayland/xwayland-glamor-eglstream.c -+++ b/hw/xwayland/xwayland-glamor-eglstream.c -@@ -431,8 +431,8 @@ xwl_eglstream_consumer_ready_callback(void *data, - DebugF("eglstream: win %d completes eglstream for pixmap %p, congrats!\n", - pending->window->drawable.id, pending->pixmap); - -- xwl_eglstream_window_set_pending(pending->window, NULL); - out: -+ xwl_eglstream_window_set_pending(pending->window, NULL); - xorg_list_del(&pending->link); - free(pending); - } --- -2.28.0 - diff --git a/0012-xwayland-xwl_window_should_enable_viewport-Add-extra.patch b/0012-xwayland-xwl_window_should_enable_viewport-Add-extra.patch index 3086baa..8b8ca1c 100644 --- a/0012-xwayland-xwl_window_should_enable_viewport-Add-extra.patch +++ b/0012-xwayland-xwl_window_should_enable_viewport-Add-extra.patch @@ -1,7 +1,7 @@ -From a090b038c45732676d9b7e367848d5bee7ab0ea5 Mon Sep 17 00:00:00 2001 +From 3d359d03573dee270b72f0cea1ea9061c2c886c3 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 26 Aug 2019 12:26:34 +0200 -Subject: [PATCH xserver 12/24] xwayland: xwl_window_should_enable_viewport: +Subject: [PATCH xserver 12/25] xwayland: xwl_window_should_enable_viewport: Add extra test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -25,10 +25,10 @@ Signed-off-by: Hans de Goede 1 file changed, 17 insertions(+) diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index 9c6cf7cf5..2e01822fd 100644 +index 87870a5f1..9175396f7 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c -@@ -651,6 +651,23 @@ xwl_window_should_enable_viewport(struct xwl_window *xwl_window, +@@ -638,6 +638,23 @@ xwl_window_should_enable_viewport(struct xwl_window *xwl_window, } } @@ -53,5 +53,5 @@ index 9c6cf7cf5..2e01822fd 100644 } -- -2.26.2 +2.28.0 diff --git a/0013-present-Move-flip-target_msc-adjustment-out-of-prese.patch b/0013-present-Move-flip-target_msc-adjustment-out-of-prese.patch deleted file mode 100644 index eedcbaf..0000000 --- a/0013-present-Move-flip-target_msc-adjustment-out-of-prese.patch +++ /dev/null @@ -1,121 +0,0 @@ -From dae234efdb7bba75744aa1697386df3c0db5348a Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Michel=20D=C3=A4nzer?= -Date: Fri, 11 Sep 2020 17:00:18 +0200 -Subject: [PATCH xserver 13/16] present: Move flip target_msc adjustment out of - present_vblank_create - -Preparation for different handling between SCMD & WNMD. No functional -change intended. - -Reviewed-by: Roman Gilg -Tested-by: Roman Gilg -(cherry picked from commit 4c92dea952f7fed19857904f0f552900257ef4b9) ---- - present/present_priv.h | 2 +- - present/present_scmd.c | 5 ++++- - present/present_vblank.c | 9 ++++----- - present/present_wnmd.c | 5 ++++- - 4 files changed, 13 insertions(+), 8 deletions(-) - -diff --git a/present/present_priv.h b/present/present_priv.h -index 5849b9e0b..90c3f4e79 100644 ---- a/present/present_priv.h -+++ b/present/present_priv.h -@@ -469,7 +469,7 @@ present_vblank_create(WindowPtr window, - const uint32_t *capabilities, - present_notify_ptr notifies, - int num_notifies, -- uint64_t *target_msc, -+ uint64_t target_msc, - uint64_t crtc_msc); - - void -diff --git a/present/present_scmd.c b/present/present_scmd.c -index 6a580cb7a..a4d046ca8 100644 ---- a/present/present_scmd.c -+++ b/present/present_scmd.c -@@ -745,12 +745,15 @@ present_scmd_pixmap(WindowPtr window, - screen_priv->info ? &screen_priv->info->capabilities : NULL, - notifies, - num_notifies, -- &target_msc, -+ target_msc, - crtc_msc); - - if (!vblank) - return BadAlloc; - -+ if (vblank->flip && vblank->sync_flip) -+ target_msc--; -+ - xorg_list_append(&vblank->event_queue, &present_exec_queue); - vblank->queued = TRUE; - if (msc_is_after(target_msc, crtc_msc)) { -diff --git a/present/present_vblank.c b/present/present_vblank.c -index 2c124f4bb..a4b70c0d9 100644 ---- a/present/present_vblank.c -+++ b/present/present_vblank.c -@@ -57,7 +57,7 @@ present_vblank_create(WindowPtr window, - const uint32_t *capabilities, - present_notify_ptr notifies, - int num_notifies, -- uint64_t *target_msc, -+ uint64_t target_msc, - uint64_t crtc_msc) - { - ScreenPtr screen = window->drawable.pScreen; -@@ -100,7 +100,7 @@ present_vblank_create(WindowPtr window, - - vblank->x_off = x_off; - vblank->y_off = y_off; -- vblank->target_msc = *target_msc; -+ vblank->target_msc = target_msc; - vblank->crtc = target_crtc; - vblank->msc_offset = window_priv->msc_offset; - vblank->notifies = notifies; -@@ -111,12 +111,11 @@ present_vblank_create(WindowPtr window, - if (pixmap != NULL && - !(options & PresentOptionCopy) && - capabilities) { -- if (msc_is_after(*target_msc, crtc_msc) && -+ if (msc_is_after(target_msc, crtc_msc) && - screen_priv->check_flip (target_crtc, window, pixmap, TRUE, valid, x_off, y_off, &reason)) - { - vblank->flip = TRUE; - vblank->sync_flip = TRUE; -- *target_msc = *target_msc - 1; - } else if ((*capabilities & PresentCapabilityAsync) && - screen_priv->check_flip (target_crtc, window, pixmap, FALSE, valid, x_off, y_off, &reason)) - { -@@ -139,7 +138,7 @@ present_vblank_create(WindowPtr window, - - if (pixmap) - DebugPresent(("q %" PRIu64 " %p %" PRIu64 ": %08" PRIx32 " -> %08" PRIx32 " (crtc %p) flip %d vsync %d serial %d\n", -- vblank->event_id, vblank, *target_msc, -+ vblank->event_id, vblank, target_msc, - vblank->pixmap->drawable.id, vblank->window->drawable.id, - target_crtc, vblank->flip, vblank->sync_flip, vblank->serial)); - return vblank; -diff --git a/present/present_wnmd.c b/present/present_wnmd.c -index 35ea12968..31e83d6ee 100644 ---- a/present/present_wnmd.c -+++ b/present/present_wnmd.c -@@ -626,11 +626,14 @@ present_wnmd_pixmap(WindowPtr window, - &screen_priv->wnmd_info->capabilities, - notifies, - num_notifies, -- &target_msc, -+ target_msc, - crtc_msc); - if (!vblank) - return BadAlloc; - -+ if (vblank->flip && vblank->sync_flip) -+ target_msc--; -+ - xorg_list_append(&vblank->event_queue, &window_priv->exec_queue); - vblank->queued = TRUE; - if (crtc_msc < target_msc) { --- -2.28.0 - diff --git a/0013-xwayland-Set-_XWAYLAND_RANDR_EMU_MONITOR_RECTS-prope.patch b/0013-xwayland-Set-_XWAYLAND_RANDR_EMU_MONITOR_RECTS-prope.patch index 83116b9..7aef593 100644 --- a/0013-xwayland-Set-_XWAYLAND_RANDR_EMU_MONITOR_RECTS-prope.patch +++ b/0013-xwayland-Set-_XWAYLAND_RANDR_EMU_MONITOR_RECTS-prope.patch @@ -1,7 +1,7 @@ -From e40d94637207543481769fb570515b782225ff09 Mon Sep 17 00:00:00 2001 +From 48bc25613f91b69d9ee68e8211f8bf22317aa40a Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 2 Sep 2019 17:32:45 +0200 -Subject: [PATCH xserver 13/24] xwayland: Set _XWAYLAND_RANDR_EMU_MONITOR_RECTS +Subject: [PATCH xserver 13/25] xwayland: Set _XWAYLAND_RANDR_EMU_MONITOR_RECTS property for resolution emulation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -139,10 +139,10 @@ index e09d00108..0d6b9ac9f 100644 static void diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index 2e01822fd..ac4d98e6a 100644 +index 9175396f7..32442d88e 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c -@@ -692,6 +692,27 @@ xwl_screen_check_resolution_change_emulation(struct xwl_screen *xwl_screen) +@@ -679,6 +679,27 @@ xwl_screen_check_resolution_change_emulation(struct xwl_screen *xwl_screen) xwl_window_check_resolution_change_emulation(xwl_window); } @@ -170,7 +170,7 @@ index 2e01822fd..ac4d98e6a 100644 static void xwl_window_init_allow_commits(struct xwl_window *xwl_window) { -@@ -857,6 +878,8 @@ xwl_realize_window(WindowPtr window) +@@ -844,6 +865,8 @@ xwl_realize_window(WindowPtr window) return FALSE; } @@ -201,5 +201,5 @@ index 36c4c4c8b..1317ae5bb 100644 RRModePtr xwayland_cvt(int HDisplay, int VDisplay, float VRefresh, Bool Reduced, Bool Interlaced); -- -2.26.2 +2.28.0 diff --git a/0014-present-Add-present_vblank-exec_msc-field.patch b/0014-present-Add-present_vblank-exec_msc-field.patch deleted file mode 100644 index e15a7df..0000000 --- a/0014-present-Add-present_vblank-exec_msc-field.patch +++ /dev/null @@ -1,236 +0,0 @@ -From 669e40390c3679b649db33f0aa4ae4cfdd17e2a9 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Michel=20D=C3=A4nzer?= -Date: Fri, 11 Sep 2020 17:00:35 +0200 -Subject: [PATCH xserver 14/16] present: Add present_vblank::exec_msc field -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -For tracking the MSC when the present can be executed separately from -the target MSC. - -Allows removing the requeue field instead, plus more later. - -v2: -* Rename wait_msc → exec_msc (Roman Gilg) -* Use exec_msc = target_msc instead of exec_msc++, for clarity. -* Bug fix: Set exec_msc = target_msc also if present_flip returned - false in present_execute. -v3: -* Set exec_msc = target_msc also if present_wnmd_flip returned - false in present_wnmd_execute, for consistency. -v4: -* Specifically check for exec_msc == crtc_msc + 1 in - present_execute_wait/copy, to avoid re-introducing - https://bugs.freedesktop.org/show_bug.cgi?id=94596 . - -Reviewed-by: Roman Gilg -Tested-by: Roman Gilg -(cherry picked from commit b0b3159abd8001fa3f6dfc44a288a95a62aa5cf6) ---- - present/present_execute.c | 23 ++++++++++------------- - present/present_priv.h | 4 ++-- - present/present_scmd.c | 13 +++++++------ - present/present_vblank.c | 9 +++++---- - present/present_wnmd.c | 13 +++++++------ - 5 files changed, 31 insertions(+), 31 deletions(-) - -diff --git a/present/present_execute.c b/present/present_execute.c -index 8d1ef4a8c..58066db86 100644 ---- a/present/present_execute.c -+++ b/present/present_execute.c -@@ -48,16 +48,13 @@ present_execute_wait(present_vblank_ptr vblank, uint64_t crtc_msc) - ScreenPtr screen = window->drawable.pScreen; - present_screen_priv_ptr screen_priv = present_screen_priv(screen); - -- if (vblank->requeue) { -- vblank->requeue = FALSE; -- if (msc_is_after(vblank->target_msc, crtc_msc) && -- Success == screen_priv->queue_vblank(screen, -- window, -- vblank->crtc, -- vblank->event_id, -- vblank->target_msc)) -- return TRUE; -- } -+ /* We may have to requeue for the next MSC if check_flip_window prevented -+ * using a flip. -+ */ -+ if (vblank->exec_msc == crtc_msc + 1 && -+ screen_priv->queue_vblank(screen, window, vblank->crtc, vblank->event_id, -+ vblank->exec_msc) == Success) -+ return TRUE; - - if (vblank->wait_fence) { - if (!present_fence_check_triggered(vblank->wait_fence)) { -@@ -75,13 +72,13 @@ present_execute_copy(present_vblank_ptr vblank, uint64_t crtc_msc) - ScreenPtr screen = window->drawable.pScreen; - present_screen_priv_ptr screen_priv = present_screen_priv(screen); - -- /* If present_flip failed, we may have to requeue for the target MSC */ -- if (vblank->target_msc == crtc_msc + 1 && -+ /* If present_flip failed, we may have to requeue for the next MSC */ -+ if (vblank->exec_msc == crtc_msc + 1 && - Success == screen_priv->queue_vblank(screen, - window, - vblank->crtc, - vblank->event_id, -- vblank->target_msc)) { -+ vblank->exec_msc)) { - vblank->queued = TRUE; - return; - } -diff --git a/present/present_priv.h b/present/present_priv.h -index 90c3f4e79..f34edd5cf 100644 ---- a/present/present_priv.h -+++ b/present/present_priv.h -@@ -70,14 +70,14 @@ struct present_vblank { - int16_t y_off; - CARD16 kind; - uint64_t event_id; -- uint64_t target_msc; -+ uint64_t target_msc; /* target MSC when present should complete */ -+ uint64_t exec_msc; /* MSC at which present can be executed */ - uint64_t msc_offset; - present_fence_ptr idle_fence; - present_fence_ptr wait_fence; - present_notify_ptr notifies; - int num_notifies; - Bool queued; /* on present_exec_queue */ -- Bool requeue; /* on queue, but target_msc has changed */ - Bool flip; /* planning on using flip */ - Bool flip_ready; /* wants to flip, but waiting for previous flip or unflip */ - Bool flip_idler; /* driver explicitly permitted idling */ -diff --git a/present/present_scmd.c b/present/present_scmd.c -index a4d046ca8..3e3ae3477 100644 ---- a/present/present_scmd.c -+++ b/present/present_scmd.c -@@ -361,8 +361,8 @@ present_flip_notify(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc) - ScreenPtr screen = vblank->screen; - present_screen_priv_ptr screen_priv = present_screen_priv(screen); - -- DebugPresent(("\tn %" PRIu64 " %p %" PRIu64 ": %08" PRIx32 " -> %08" PRIx32 "\n", -- vblank->event_id, vblank, vblank->target_msc, -+ DebugPresent(("\tn %" PRIu64 " %p %" PRIu64 " %" PRIu64 ": %08" PRIx32 " -> %08" PRIx32 "\n", -+ vblank->event_id, vblank, vblank->exec_msc, vblank->target_msc, - vblank->pixmap ? vblank->pixmap->drawable.id : 0, - vblank->window ? vblank->window->drawable.id : 0)); - -@@ -482,7 +482,7 @@ present_check_flip_window (WindowPtr window) - vblank->flip = FALSE; - vblank->reason = reason; - if (vblank->sync_flip) -- vblank->requeue = TRUE; -+ vblank->exec_msc = vblank->target_msc; - } - } - } -@@ -608,6 +608,7 @@ present_execute(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc) - */ - screen_priv->flip_pending = NULL; - vblank->flip = FALSE; -+ vblank->exec_msc = vblank->target_msc; - } - DebugPresent(("\tc %p %" PRIu64 ": %08" PRIx32 " -> %08" PRIx32 "\n", - vblank, crtc_msc, vblank->pixmap->drawable.id, vblank->window->drawable.id)); -@@ -752,12 +753,12 @@ present_scmd_pixmap(WindowPtr window, - return BadAlloc; - - if (vblank->flip && vblank->sync_flip) -- target_msc--; -+ vblank->exec_msc--; - - xorg_list_append(&vblank->event_queue, &present_exec_queue); - vblank->queued = TRUE; -- if (msc_is_after(target_msc, crtc_msc)) { -- ret = present_queue_vblank(screen, window, target_crtc, vblank->event_id, target_msc); -+ if (msc_is_after(vblank->exec_msc, crtc_msc)) { -+ ret = present_queue_vblank(screen, window, target_crtc, vblank->event_id, vblank->exec_msc); - if (ret == Success) - return Success; - -diff --git a/present/present_vblank.c b/present/present_vblank.c -index a4b70c0d9..af14fe134 100644 ---- a/present/present_vblank.c -+++ b/present/present_vblank.c -@@ -101,6 +101,7 @@ present_vblank_create(WindowPtr window, - vblank->x_off = x_off; - vblank->y_off = y_off; - vblank->target_msc = target_msc; -+ vblank->exec_msc = target_msc; - vblank->crtc = target_crtc; - vblank->msc_offset = window_priv->msc_offset; - vblank->notifies = notifies; -@@ -152,8 +153,8 @@ no_mem: - void - present_vblank_scrap(present_vblank_ptr vblank) - { -- DebugPresent(("\tx %" PRIu64 " %p %" PRIu64 ": %08" PRIx32 " -> %08" PRIx32 " (crtc %p)\n", -- vblank->event_id, vblank, vblank->target_msc, -+ DebugPresent(("\tx %" PRIu64 " %p %" PRIu64 " %" PRIu64 ": %08" PRIx32 " -> %08" PRIx32 " (crtc %p)\n", -+ vblank->event_id, vblank, vblank->exec_msc, vblank->target_msc, - vblank->pixmap->drawable.id, vblank->window->drawable.id, - vblank->crtc)); - -@@ -174,8 +175,8 @@ present_vblank_destroy(present_vblank_ptr vblank) - /* Also make sure vblank is removed from event queue (wnmd) */ - xorg_list_del(&vblank->event_queue); - -- DebugPresent(("\td %" PRIu64 " %p %" PRIu64 ": %08" PRIx32 " -> %08" PRIx32 "\n", -- vblank->event_id, vblank, vblank->target_msc, -+ DebugPresent(("\td %" PRIu64 " %p %" PRIu64 " %" PRIu64 ": %08" PRIx32 " -> %08" PRIx32 "\n", -+ vblank->event_id, vblank, vblank->exec_msc, vblank->target_msc, - vblank->pixmap ? vblank->pixmap->drawable.id : 0, - vblank->window ? vblank->window->drawable.id : 0)); - -diff --git a/present/present_wnmd.c b/present/present_wnmd.c -index 31e83d6ee..339e93edb 100644 ---- a/present/present_wnmd.c -+++ b/present/present_wnmd.c -@@ -168,8 +168,8 @@ present_wnmd_flip_notify(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_ - WindowPtr window = vblank->window; - present_window_priv_ptr window_priv = present_window_priv(window); - -- DebugPresent(("\tn %" PRIu64 " %p %" PRIu64 ": %08" PRIx32 " -> %08" PRIx32 "\n", -- vblank->event_id, vblank, vblank->target_msc, -+ DebugPresent(("\tn %" PRIu64 " %p %" PRIu64 " %" PRIu64 ": %08" PRIx32 " -> %08" PRIx32 "\n", -+ vblank->event_id, vblank, vblank->exec_msc, vblank->target_msc, - vblank->pixmap ? vblank->pixmap->drawable.id : 0, - vblank->window ? vblank->window->drawable.id : 0)); - -@@ -343,7 +343,7 @@ present_wnmd_check_flip_window (WindowPtr window) - vblank->flip = FALSE; - vblank->reason = reason; - if (vblank->sync_flip) -- vblank->requeue = TRUE; -+ vblank->exec_msc = vblank->target_msc; - } - } - } -@@ -491,6 +491,7 @@ present_wnmd_execute(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc) - */ - window_priv->flip_pending = NULL; - vblank->flip = FALSE; -+ vblank->exec_msc = vblank->target_msc; - } - DebugPresent(("\tc %p %" PRIu64 ": %08" PRIx32 " -> %08" PRIx32 "\n", - vblank, crtc_msc, vblank->pixmap->drawable.id, vblank->window->drawable.id)); -@@ -632,12 +633,12 @@ present_wnmd_pixmap(WindowPtr window, - return BadAlloc; - - if (vblank->flip && vblank->sync_flip) -- target_msc--; -+ vblank->exec_msc--; - - xorg_list_append(&vblank->event_queue, &window_priv->exec_queue); - vblank->queued = TRUE; -- if (crtc_msc < target_msc) { -- if (present_wnmd_queue_vblank(screen, window, target_crtc, vblank->event_id, target_msc) == Success) { -+ if (crtc_msc < vblank->exec_msc) { -+ if (present_wnmd_queue_vblank(screen, window, target_crtc, vblank->event_id, vblank->exec_msc) == Success) { - return Success; - } - DebugPresent(("present_queue_vblank failed\n")); --- -2.28.0 - diff --git a/0014-xwayland-Cache-client-id-for-the-window-manager-clie.patch b/0014-xwayland-Cache-client-id-for-the-window-manager-clie.patch index 1142b23..55f14d6 100644 --- a/0014-xwayland-Cache-client-id-for-the-window-manager-clie.patch +++ b/0014-xwayland-Cache-client-id-for-the-window-manager-clie.patch @@ -1,7 +1,7 @@ -From a35e6f9a2b15a446138f6f3e201a19833a5a2454 Mon Sep 17 00:00:00 2001 +From 12a0f852e3276cb5c60e44b8b0d6ddd97975fd42 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 27 Jan 2020 11:08:00 +0100 -Subject: [PATCH xserver 14/24] xwayland: Cache client-id for the +Subject: [PATCH xserver 14/25] xwayland: Cache client-id for the window-manager client Instead of iterating over all clients which are listening for events on the @@ -24,10 +24,10 @@ Signed-off-by: Hans de Goede 2 files changed, 34 insertions(+), 16 deletions(-) diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index ac4d98e6a..c16da330c 100644 +index 32442d88e..f99cdf81f 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c -@@ -578,20 +578,11 @@ xwl_window_enable_viewport(struct xwl_window *xwl_window, +@@ -565,20 +565,11 @@ xwl_window_enable_viewport(struct xwl_window *xwl_window, } static Bool @@ -51,7 +51,7 @@ index ac4d98e6a..c16da330c 100644 } static ClientPtr -@@ -605,7 +596,7 @@ xwl_window_get_owner(struct xwl_window *xwl_window) +@@ -592,7 +583,7 @@ xwl_window_get_owner(struct xwl_window *xwl_window) * decoration window. In that case return the client of the * first *and only* child of the toplevel (decoration) window. */ @@ -60,7 +60,7 @@ index ac4d98e6a..c16da330c 100644 if (window->firstChild && window->firstChild == window->lastChild) return wClient(window->firstChild); else -@@ -700,9 +691,7 @@ xwl_screen_check_resolution_change_emulation(struct xwl_screen *xwl_screen) +@@ -687,9 +678,7 @@ xwl_screen_check_resolution_change_emulation(struct xwl_screen *xwl_screen) Bool xwl_window_is_toplevel(WindowPtr window) { @@ -71,7 +71,7 @@ index ac4d98e6a..c16da330c 100644 return FALSE; /* CSD and override-redirect toplevel windows */ -@@ -977,6 +966,30 @@ xwl_set_window_pixmap(WindowPtr window, +@@ -964,6 +953,30 @@ xwl_set_window_pixmap(WindowPtr window, ensure_surface_for_window(window); } @@ -102,7 +102,7 @@ index ac4d98e6a..c16da330c 100644 static void xwl_resize_window(WindowPtr window, int x, int y, -@@ -1576,6 +1589,9 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) +@@ -1568,6 +1581,9 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) xwl_screen->CloseScreen = pScreen->CloseScreen; pScreen->CloseScreen = xwl_close_screen; @@ -133,5 +133,5 @@ index 1317ae5bb..f5ffadfcc 100644 struct xorg_list output_list; -- -2.26.2 +2.28.0 diff --git a/0015-present-wnmd-Move-up-present_wnmd_queue_vblank.patch b/0015-present-wnmd-Move-up-present_wnmd_queue_vblank.patch deleted file mode 100644 index 13f7ecd..0000000 --- a/0015-present-wnmd-Move-up-present_wnmd_queue_vblank.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 96ef31e0f20fcffb2edfe4cb9510f994c188785f Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Michel=20D=C3=A4nzer?= -Date: Tue, 28 Jul 2020 18:53:45 +0200 -Subject: [PATCH xserver 15/16] present/wnmd: Move up present_wnmd_queue_vblank - -Allowing it to be called from more functions than before. No functional -change. - -Reviewed-by: Roman Gilg -Tested-by: Roman Gilg -(cherry picked from commit d14ea667feccf085c7d66a7c63f380975e07af66) ---- - present/present_wnmd.c | 22 +++++++++++----------- - 1 file changed, 11 insertions(+), 11 deletions(-) - -diff --git a/present/present_wnmd.c b/present/present_wnmd.c -index 339e93edb..2c11e53f5 100644 ---- a/present/present_wnmd.c -+++ b/present/present_wnmd.c -@@ -42,6 +42,17 @@ - static void - present_wnmd_execute(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc); - -+static int -+present_wnmd_queue_vblank(ScreenPtr screen, -+ WindowPtr window, -+ RRCrtcPtr crtc, -+ uint64_t event_id, -+ uint64_t msc) -+{ -+ present_screen_priv_ptr screen_priv = present_screen_priv(screen); -+ return (*screen_priv->wnmd_info->queue_vblank) (window, crtc, event_id, msc); -+} -+ - static void - present_wnmd_create_event_id(present_window_priv_ptr window_priv, present_vblank_ptr vblank) - { -@@ -511,17 +522,6 @@ present_wnmd_execute(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc) - present_execute_post(vblank, ust, crtc_msc); - } - --static int --present_wnmd_queue_vblank(ScreenPtr screen, -- WindowPtr window, -- RRCrtcPtr crtc, -- uint64_t event_id, -- uint64_t msc) --{ -- present_screen_priv_ptr screen_priv = present_screen_priv(screen); -- return (*screen_priv->wnmd_info->queue_vblank) (window, crtc, event_id, msc); --} -- - static uint64_t - present_wnmd_window_to_crtc_msc(WindowPtr window, RRCrtcPtr crtc, uint64_t window_msc, uint64_t new_msc) - { --- -2.28.0 - diff --git a/0015-xwayland-Reuse-viewport-instead-of-recreating.patch b/0015-xwayland-Reuse-viewport-instead-of-recreating.patch index 9fa0e06..c11d0c0 100644 --- a/0015-xwayland-Reuse-viewport-instead-of-recreating.patch +++ b/0015-xwayland-Reuse-viewport-instead-of-recreating.patch @@ -1,7 +1,7 @@ -From e4d8f7770e27ed56e23e0ef2a87bed8cb4fa28e0 Mon Sep 17 00:00:00 2001 +From 5448ffeb9b06d20e821174c04d2280933e3ca993 Mon Sep 17 00:00:00 2001 From: Roman Gilg Date: Fri, 3 Jan 2020 17:12:14 +0100 -Subject: [PATCH xserver 15/24] xwayland: Reuse viewport instead of recreating +Subject: [PATCH xserver 15/25] xwayland: Reuse viewport instead of recreating When a viewport is already created we can reuse this object instead of destroying it and getting a new one for updating the source rectangle and @@ -17,10 +17,10 @@ Signed-off-by: Hans de Goede 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index c16da330c..ac301ae4a 100644 +index f99cdf81f..8de3dd36b 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c -@@ -552,17 +552,13 @@ xwl_window_enable_viewport(struct xwl_window *xwl_window, +@@ -539,17 +539,13 @@ xwl_window_enable_viewport(struct xwl_window *xwl_window, struct xwl_output *xwl_output, struct xwl_emulated_mode *emulated_mode) { @@ -46,5 +46,5 @@ index c16da330c..ac301ae4a 100644 wp_viewport_set_source(xwl_window->viewport, wl_fixed_from_int(0), -- -2.26.2 +2.28.0 diff --git a/0016-present-wnmd-Execute-copies-at-target_msc-1-already.patch b/0016-present-wnmd-Execute-copies-at-target_msc-1-already.patch deleted file mode 100644 index a761129..0000000 --- a/0016-present-wnmd-Execute-copies-at-target_msc-1-already.patch +++ /dev/null @@ -1,139 +0,0 @@ -From c3e4c1a0fd5d4d6015e9e6317b758018317e56d1 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Michel=20D=C3=A4nzer?= -Date: Tue, 28 Jul 2020 18:40:47 +0200 -Subject: [PATCH xserver 16/16] present/wnmd: Execute copies at target_msc-1 - already - -It always takes one update cycle for the copy to become visible on the -host windowing system, so waiting for the target MSC resulted in 1 cycle -delay. - -We re-use the idle list for copies which were executed but need their -completion event sent. - -Fixes black seams when resizing the "Builder" sub-window of - - GDK_BACKEND=x11 gtk4-demo - -on Xwayland (see -https://gitlab.gnome.org/GNOME/mutter/-/issues/1290#note_873557). - -Unfortunately, this cannot completely fix the seams with apps which -queue up multiple frames in advance, since there's always at least one -queued frame corresponding to the old window size. But it should at -least help a little in that case as well. - -v2: -* Bug fix: Don't update exec_msc in present_wnmd_check_flip_window. - (Roman Gilg) -* Use exec_msc = target_msc - 1 instead of exec_msc--, and add a - comment, for clarity. -v3: -* Drop exec_msc = target_msc again in present_wnmd_execute. -* present_execute_copy should never set vblank->queued in - present_wnmd_execute now, so replace that branch with an assertion. - (Roman Gilg) - -Reviewed-by: Roman Gilg -Tested-by: Roman Gilg -(cherry picked from commit 1cccb486d48a5d2e7649836b993805bb65dc09e3) -[Since present_wnmd_event_notify hasn't been split up on the 1.20 -branch, it needs to check vblank->flip. Doing the same in -present_wnmd_free_idle_vblanks to be safe, though I'm not sure it's -actually possible to hit non-flips there.] ---- - present/present_wnmd.c | 28 ++++++++++++++++++---------- - 1 file changed, 18 insertions(+), 10 deletions(-) - -diff --git a/present/present_wnmd.c b/present/present_wnmd.c -index 2c11e53f5..8c31619a2 100644 ---- a/present/present_wnmd.c -+++ b/present/present_wnmd.c -@@ -122,7 +122,8 @@ present_wnmd_free_idle_vblanks(WindowPtr window) - present_vblank_ptr vblank, tmp; - - xorg_list_for_each_entry_safe(vblank, tmp, &window_priv->idle_queue, event_queue) { -- present_wnmd_free_idle_vblank(vblank); -+ if (vblank->flip) -+ present_wnmd_free_idle_vblank(vblank); - } - - if (window_priv->flip_active) { -@@ -245,7 +246,12 @@ present_wnmd_event_notify(WindowPtr window, uint64_t event_id, uint64_t ust, uin - - xorg_list_for_each_entry(vblank, &window_priv->idle_queue, event_queue) { - if (vblank->event_id == event_id) { -- present_wnmd_free_idle_vblank(vblank); -+ if (vblank->flip) -+ present_wnmd_free_idle_vblank(vblank); -+ else -+ /* Copies which were executed but need their completion event sent */ -+ present_execute_post(vblank, ust, msc); -+ - return; - } - } -@@ -353,8 +359,6 @@ present_wnmd_check_flip_window (WindowPtr window) - vblank->sync_flip, vblank->valid, 0, 0, &reason)) { - vblank->flip = FALSE; - vblank->reason = reason; -- if (vblank->sync_flip) -- vblank->exec_msc = vblank->target_msc; - } - } - } -@@ -454,6 +458,7 @@ present_wnmd_execute(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc) - vblank->queued = FALSE; - - if (vblank->pixmap && vblank->window) { -+ ScreenPtr screen = window->drawable.pScreen; - - if (vblank->flip) { - RegionPtr damage; -@@ -479,7 +484,6 @@ present_wnmd_execute(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc) - // ask the driver - if (present_wnmd_flip(vblank->window, vblank->crtc, vblank->event_id, - vblank->target_msc, vblank->pixmap, vblank->sync_flip, damage)) { -- ScreenPtr screen = window->drawable.pScreen; - WindowPtr toplvl_window = present_wnmd_toplvl_pixmap_window(vblank->window); - PixmapPtr old_pixmap = screen->GetWindowPixmap(window); - -@@ -502,7 +506,6 @@ present_wnmd_execute(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc) - */ - window_priv->flip_pending = NULL; - vblank->flip = FALSE; -- vblank->exec_msc = vblank->target_msc; - } - DebugPresent(("\tc %p %" PRIu64 ": %08" PRIx32 " -> %08" PRIx32 "\n", - vblank, crtc_msc, vblank->pixmap->drawable.id, vblank->window->drawable.id)); -@@ -510,9 +513,12 @@ present_wnmd_execute(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc) - present_wnmd_cancel_flip(window); - - present_execute_copy(vblank, crtc_msc); -+ assert(!vblank->queued); - -- if (vblank->queued) { -- xorg_list_add(&vblank->event_queue, &window_priv->exec_queue); -+ if (present_wnmd_queue_vblank(screen, window, vblank->crtc, -+ vblank->event_id, crtc_msc + 1) -+ == Success) { -+ xorg_list_add(&vblank->event_queue, &window_priv->idle_queue); - xorg_list_append(&vblank->window_list, &window_priv->vblank); - - return; -@@ -632,8 +638,10 @@ present_wnmd_pixmap(WindowPtr window, - if (!vblank) - return BadAlloc; - -- if (vblank->flip && vblank->sync_flip) -- vblank->exec_msc--; -+ /* WNMD presentations always complete (at least) one frame after they -+ * are executed -+ */ -+ vblank->exec_msc = vblank->target_msc - 1; - - xorg_list_append(&vblank->event_queue, &window_priv->exec_queue); - vblank->queued = TRUE; --- -2.28.0 - diff --git a/0016-xwayland-Recurse-on-finding-the-none-wm-owner.patch b/0016-xwayland-Recurse-on-finding-the-none-wm-owner.patch index 558f3bf..af33a86 100644 --- a/0016-xwayland-Recurse-on-finding-the-none-wm-owner.patch +++ b/0016-xwayland-Recurse-on-finding-the-none-wm-owner.patch @@ -1,7 +1,7 @@ -From 66a026eeaa49e1042d4d2ec655e78771e1acd9df Mon Sep 17 00:00:00 2001 +From 2896f732af4c74f124d767808a24005342d8f125 Mon Sep 17 00:00:00 2001 From: Roman Gilg Date: Fri, 3 Jan 2020 17:27:28 +0100 -Subject: [PATCH xserver 16/24] xwayland: Recurse on finding the none-wm owner +Subject: [PATCH xserver 16/25] xwayland: Recurse on finding the none-wm owner An X11 window manager might add a chain of parent windows when reparenting to a decoration window. @@ -28,10 +28,10 @@ Signed-off-by: Hans de Goede 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index ac301ae4a..94e3a18fa 100644 +index 8de3dd36b..c38c4180b 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c -@@ -582,19 +582,18 @@ window_is_wm_window(WindowPtr window) +@@ -569,19 +569,18 @@ window_is_wm_window(WindowPtr window) } static ClientPtr @@ -56,7 +56,7 @@ index ac301ae4a..94e3a18fa 100644 else return NULL; /* Should never happen, skip resolution emulation */ } -@@ -615,7 +614,7 @@ xwl_window_should_enable_viewport(struct xwl_window *xwl_window, +@@ -602,7 +601,7 @@ xwl_window_should_enable_viewport(struct xwl_window *xwl_window, if (!xwl_screen_has_resolution_change_emulation(xwl_screen)) return FALSE; @@ -65,7 +65,7 @@ index ac301ae4a..94e3a18fa 100644 if (!owner) return FALSE; -@@ -694,8 +693,8 @@ xwl_window_is_toplevel(WindowPtr window) +@@ -681,8 +680,8 @@ xwl_window_is_toplevel(WindowPtr window) if (window_get_damage(window)) return TRUE; @@ -77,5 +77,5 @@ index ac301ae4a..94e3a18fa 100644 static void -- -2.26.2 +2.28.0 diff --git a/0017-xwayland-Make-window_get_none_wm_owner-return-a-Wind.patch b/0017-xwayland-Make-window_get_none_wm_owner-return-a-Wind.patch index 75b5ddc..58a9c4d 100644 --- a/0017-xwayland-Make-window_get_none_wm_owner-return-a-Wind.patch +++ b/0017-xwayland-Make-window_get_none_wm_owner-return-a-Wind.patch @@ -1,7 +1,7 @@ -From 8b9a66212bacd780f1a8ac37cbb490b650843c28 Mon Sep 17 00:00:00 2001 +From dd83985179b4a3c2613c96922eafeea40e21b7d2 Mon Sep 17 00:00:00 2001 From: Roman Gilg Date: Wed, 15 Jan 2020 10:07:58 +0100 -Subject: [PATCH xserver 17/24] xwayland: Make window_get_none_wm_owner return +Subject: [PATCH xserver 17/25] xwayland: Make window_get_none_wm_owner return a Window instead of a Client Make window_get_none_wm_owner return the first non-wm-window instead of the @@ -25,10 +25,10 @@ Signed-off-by: Hans de Goede 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index 94e3a18fa..c60a2ce67 100644 +index c38c4180b..b3b80beae 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c -@@ -581,10 +581,10 @@ window_is_wm_window(WindowPtr window) +@@ -568,10 +568,10 @@ window_is_wm_window(WindowPtr window) return CLIENT_ID(window->drawable.id) == xwl_screen->wm_client_id; } @@ -42,7 +42,7 @@ index 94e3a18fa..c60a2ce67 100644 /* If the toplevel window is owned by the window-manager, then the * actual client toplevel window has been reparented to some window-manager -@@ -593,12 +593,12 @@ window_get_none_wm_owner(WindowPtr window) +@@ -580,12 +580,12 @@ window_get_none_wm_owner(WindowPtr window) */ if (window_is_wm_window(window)) { if (window->firstChild && window->firstChild == window->lastChild) @@ -57,7 +57,7 @@ index 94e3a18fa..c60a2ce67 100644 } static Bool -@@ -610,14 +610,17 @@ xwl_window_should_enable_viewport(struct xwl_window *xwl_window, +@@ -597,14 +597,17 @@ xwl_window_should_enable_viewport(struct xwl_window *xwl_window, struct xwl_emulated_mode *emulated_mode; struct xwl_output *xwl_output; ClientPtr owner; @@ -78,5 +78,5 @@ index 94e3a18fa..c60a2ce67 100644 * This path gets hit by most games / libs (e.g. SDL, SFML, OGRE) */ -- -2.26.2 +2.28.0 diff --git a/0018-xwayland-Check-emulation-on-client-toplevel-resize.patch b/0018-xwayland-Check-emulation-on-client-toplevel-resize.patch index b268bb9..ea8a875 100644 --- a/0018-xwayland-Check-emulation-on-client-toplevel-resize.patch +++ b/0018-xwayland-Check-emulation-on-client-toplevel-resize.patch @@ -1,7 +1,7 @@ -From da3e06f4bed7fa60838ce89a0b45ea73c7d9615c Mon Sep 17 00:00:00 2001 +From be8c65e84dc4bee97bd0115a89c037fb47053d4c Mon Sep 17 00:00:00 2001 From: Roman Gilg Date: Fri, 3 Jan 2020 17:55:28 +0100 -Subject: [PATCH xserver 18/24] xwayland: Check emulation on client toplevel +Subject: [PATCH xserver 18/25] xwayland: Check emulation on client toplevel resize When a reparented window is resized directly check the emulation instead of @@ -25,10 +25,10 @@ Signed-off-by: Hans de Goede 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index c60a2ce67..898a291fd 100644 +index b3b80beae..b2e46336c 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c -@@ -611,6 +611,7 @@ xwl_window_should_enable_viewport(struct xwl_window *xwl_window, +@@ -598,6 +598,7 @@ xwl_window_should_enable_viewport(struct xwl_window *xwl_window, struct xwl_output *xwl_output; ClientPtr owner; WindowPtr window; @@ -36,7 +36,7 @@ index c60a2ce67..898a291fd 100644 if (!xwl_screen_has_resolution_change_emulation(xwl_screen)) return FALSE; -@@ -620,6 +621,7 @@ xwl_window_should_enable_viewport(struct xwl_window *xwl_window, +@@ -607,6 +608,7 @@ xwl_window_should_enable_viewport(struct xwl_window *xwl_window, return FALSE; owner = wClient(window); @@ -44,7 +44,7 @@ index c60a2ce67..898a291fd 100644 /* 1. Test if the window matches the emulated mode on one of the outputs * This path gets hit by most games / libs (e.g. SDL, SFML, OGRE) -@@ -629,10 +631,10 @@ xwl_window_should_enable_viewport(struct xwl_window *xwl_window, +@@ -616,10 +618,10 @@ xwl_window_should_enable_viewport(struct xwl_window *xwl_window, if (!emulated_mode) continue; @@ -59,7 +59,7 @@ index c60a2ce67..898a291fd 100644 *emulated_mode_ret = emulated_mode; *xwl_output_ret = xwl_output; -@@ -648,9 +650,9 @@ xwl_window_should_enable_viewport(struct xwl_window *xwl_window, +@@ -635,9 +637,9 @@ xwl_window_should_enable_viewport(struct xwl_window *xwl_window, emulated_mode = xwl_output_get_emulated_mode_for_client(xwl_output, owner); if (xwl_output && xwl_window->window->overrideRedirect && emulated_mode && emulated_mode->from_vidmode && @@ -72,7 +72,7 @@ index c60a2ce67..898a291fd 100644 *emulated_mode_ret = emulated_mode; *xwl_output_ret = xwl_output; -@@ -770,8 +772,6 @@ ensure_surface_for_window(WindowPtr window) +@@ -757,8 +759,6 @@ ensure_surface_for_window(WindowPtr window) xwl_window->xwl_screen = xwl_screen; xwl_window->window = window; @@ -81,7 +81,7 @@ index c60a2ce67..898a291fd 100644 xwl_window->surface = wl_compositor_create_surface(xwl_screen->compositor); if (xwl_window->surface == NULL) { ErrorF("wl_display_create_surface failed\n"); -@@ -999,20 +999,15 @@ xwl_resize_window(WindowPtr window, +@@ -986,20 +986,15 @@ xwl_resize_window(WindowPtr window, struct xwl_window *xwl_window; xwl_screen = xwl_screen_get(screen); @@ -117,5 +117,5 @@ index f5ffadfcc..0d0baac9b 100644 struct wl_shell_surface *shell_surface; WindowPtr window; -- -2.26.2 +2.28.0 diff --git a/0019-xwayland-Also-check-resolution-change-emulation-when.patch b/0019-xwayland-Also-check-resolution-change-emulation-when.patch index 42e24e8..a9c5e72 100644 --- a/0019-xwayland-Also-check-resolution-change-emulation-when.patch +++ b/0019-xwayland-Also-check-resolution-change-emulation-when.patch @@ -1,7 +1,7 @@ -From 09eb525863ab6c08fd743a637f7da9d10c0c01eb Mon Sep 17 00:00:00 2001 +From 555e00dbf71d7c5b792bacd789cdde9c42203ff1 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Wed, 15 Jan 2020 14:36:45 +0100 -Subject: [PATCH xserver 19/24] xwayland: Also check +Subject: [PATCH xserver 19/25] xwayland: Also check resolution-change-emulation when the xwl_window itself moves The recent change to use the top-level non-window-manager Window drawable @@ -28,10 +28,10 @@ Signed-off-by: Hans de Goede 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index 898a291fd..b40502dad 100644 +index b2e46336c..e07dabcfa 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c -@@ -1006,7 +1006,7 @@ xwl_resize_window(WindowPtr window, +@@ -993,7 +993,7 @@ xwl_resize_window(WindowPtr window, xwl_screen->ResizeWindow = screen->ResizeWindow; screen->ResizeWindow = xwl_resize_window; @@ -41,5 +41,5 @@ index 898a291fd..b40502dad 100644 } -- -2.26.2 +2.28.0 diff --git a/0020-xwayland-Also-hook-screen-s-MoveWindow-method.patch b/0020-xwayland-Also-hook-screen-s-MoveWindow-method.patch index dedf011..4d66a7a 100644 --- a/0020-xwayland-Also-hook-screen-s-MoveWindow-method.patch +++ b/0020-xwayland-Also-hook-screen-s-MoveWindow-method.patch @@ -1,7 +1,7 @@ -From 9f2ebb5f07dc3fff8e061b21fa175d3d958d0ee4 Mon Sep 17 00:00:00 2001 +From 46ccf740dc5e81d84b2e8c19f6211eaf1d8d06de Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Thu, 9 Jan 2020 11:00:36 +0100 -Subject: [PATCH xserver 20/24] xwayland: Also hook screen's MoveWindow method +Subject: [PATCH xserver 20/25] xwayland: Also hook screen's MoveWindow method Not only hook the ResizeWindow method of the screen (which really is MoveAndResize) but also hook the MoveWindow method for checking if we @@ -24,10 +24,10 @@ Signed-off-by: Hans de Goede 2 files changed, 26 insertions(+) diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index b40502dad..7111e20ae 100644 +index e07dabcfa..4f19f3710 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c -@@ -1010,6 +1010,28 @@ xwl_resize_window(WindowPtr window, +@@ -997,6 +997,28 @@ xwl_resize_window(WindowPtr window, xwl_window_check_resolution_change_emulation(xwl_window); } @@ -56,7 +56,7 @@ index b40502dad..7111e20ae 100644 static void frame_callback(void *data, struct wl_callback *callback, -@@ -1588,6 +1610,9 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) +@@ -1580,6 +1602,9 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) xwl_screen->ResizeWindow = pScreen->ResizeWindow; pScreen->ResizeWindow = xwl_resize_window; @@ -79,5 +79,5 @@ index 0d0baac9b..451c08e23 100644 struct xorg_list output_list; struct xorg_list seat_list; -- -2.26.2 +2.28.0 diff --git a/0021-xwayland-Fix-emulated-modes-not-being-removed-when-s.patch b/0021-xwayland-Fix-emulated-modes-not-being-removed-when-s.patch index b00f9bd..b5f3dac 100644 --- a/0021-xwayland-Fix-emulated-modes-not-being-removed-when-s.patch +++ b/0021-xwayland-Fix-emulated-modes-not-being-removed-when-s.patch @@ -1,7 +1,7 @@ -From 958b34ce3cab02219457d5dcc25217e7c9a0beba Mon Sep 17 00:00:00 2001 +From d64f12d119e4abe3ef337741bf7b38f8de2f9da9 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 7 Oct 2019 14:27:49 +0200 -Subject: [PATCH xserver 21/24] xwayland: Fix emulated modes not being removed +Subject: [PATCH xserver 21/25] xwayland: Fix emulated modes not being removed when screen rotation is used The code building the mode-list does the following to deal with screen @@ -59,5 +59,5 @@ index 0d6b9ac9f..4bc9cd6b8 100644 else xwl_output_add_emulated_mode_for_client(xwl_output, client, mode, from_vidmode); -- -2.26.2 +2.28.0 diff --git a/0022-xwayland-Call-xwl_window_check_resolution_change_emu.patch b/0022-xwayland-Call-xwl_window_check_resolution_change_emu.patch index 0fedf5d..4f4c7f8 100644 --- a/0022-xwayland-Call-xwl_window_check_resolution_change_emu.patch +++ b/0022-xwayland-Call-xwl_window_check_resolution_change_emu.patch @@ -1,7 +1,7 @@ -From 12a9c05a3088480bc7ab80902e384053f10e51a6 Mon Sep 17 00:00:00 2001 +From 677fd1ade4547008b0d67eec460770e002595c3c Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 4 Nov 2019 11:46:49 +0100 -Subject: [PATCH xserver 22/24] xwayland: Call +Subject: [PATCH xserver 22/25] xwayland: Call xwl_window_check_resolution_change_emulation() on newly created O-R windows Some clients, which use vidmode to change the resolution when going fullscreen, @@ -28,10 +28,10 @@ Signed-off-by: Hans de Goede 1 file changed, 5 insertions(+) diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index 7111e20ae..734e76b2e 100644 +index 4f19f3710..5bb7a68e9 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c -@@ -821,6 +821,11 @@ ensure_surface_for_window(WindowPtr window) +@@ -808,6 +808,11 @@ ensure_surface_for_window(WindowPtr window) xwl_window_init_allow_commits(xwl_window); @@ -44,5 +44,5 @@ index 7111e20ae..734e76b2e 100644 err_surf: -- -2.26.2 +2.28.0 diff --git a/0023-xwayland-Fix-setting-of-_XWAYLAND_RANDR_EMU_MONITOR_.patch b/0023-xwayland-Fix-setting-of-_XWAYLAND_RANDR_EMU_MONITOR_.patch index dcd96a6..4e15f4f 100644 --- a/0023-xwayland-Fix-setting-of-_XWAYLAND_RANDR_EMU_MONITOR_.patch +++ b/0023-xwayland-Fix-setting-of-_XWAYLAND_RANDR_EMU_MONITOR_.patch @@ -1,7 +1,7 @@ -From 94fc11313b34e3b35aa275dad1c3bc2455a24ec3 Mon Sep 17 00:00:00 2001 +From 049333a0ecf8574a0612bf27850f9682f0f70533 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 4 Nov 2019 14:32:29 +0100 -Subject: [PATCH xserver 23/24] xwayland: Fix setting of +Subject: [PATCH xserver 23/25] xwayland: Fix setting of _XWAYLAND_RANDR_EMU_MONITOR_RECTS prop on new windows For window-manager managed windows, xwl_realize_window is only called for @@ -35,18 +35,18 @@ Signed-off-by: Hans de Goede 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index 734e76b2e..a7c4f82df 100644 +index 5bb7a68e9..1600c00cd 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c -@@ -751,6 +751,7 @@ ensure_surface_for_window(WindowPtr window) +@@ -738,6 +738,7 @@ ensure_surface_for_window(WindowPtr window) struct xwl_screen *xwl_screen; struct xwl_window *xwl_window; struct wl_region *region; + WindowPtr toplevel; - if (xwl_window_get(window)) + if (xwl_window_from_window(window)) return TRUE; -@@ -821,7 +822,14 @@ ensure_surface_for_window(WindowPtr window) +@@ -808,7 +809,14 @@ ensure_surface_for_window(WindowPtr window) xwl_window_init_allow_commits(xwl_window); @@ -62,7 +62,7 @@ index 734e76b2e..a7c4f82df 100644 /* CSD or O-R toplevel window, check viewport on creation */ xwl_window_check_resolution_change_emulation(xwl_window); } -@@ -870,8 +878,6 @@ xwl_realize_window(WindowPtr window) +@@ -857,8 +865,6 @@ xwl_realize_window(WindowPtr window) return FALSE; } @@ -72,5 +72,5 @@ index 734e76b2e..a7c4f82df 100644 } -- -2.26.2 +2.28.0 diff --git a/0024-xwayland-Remove-unnecessary-xwl_window_is_toplevel-c.patch b/0024-xwayland-Remove-unnecessary-xwl_window_is_toplevel-c.patch index 0a3ea40..ec778db 100644 --- a/0024-xwayland-Remove-unnecessary-xwl_window_is_toplevel-c.patch +++ b/0024-xwayland-Remove-unnecessary-xwl_window_is_toplevel-c.patch @@ -1,7 +1,7 @@ -From 2d078b3372e26278e687399a39699c495bfe16d4 Mon Sep 17 00:00:00 2001 +From f1d77ed7ac9ee9bc2f0cf60b0e4604bae092ebd0 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 4 Nov 2019 15:01:18 +0100 -Subject: [PATCH xserver 24/24] xwayland: Remove unnecessary +Subject: [PATCH xserver 24/25] xwayland: Remove unnecessary xwl_window_is_toplevel() check from xwl_output_set_window_randr_emu_props() Since the recent fix to call xwl_output_set_window_randr_emu_props() from @@ -45,5 +45,5 @@ index 4bc9cd6b8..9d3372c8e 100644 static void -- -2.26.2 +2.28.0 diff --git a/0025-xwayland-Make-window_get_client_toplevel-non-recursi.patch b/0025-xwayland-Make-window_get_client_toplevel-non-recursi.patch new file mode 100644 index 0000000..4bf96dc --- /dev/null +++ b/0025-xwayland-Make-window_get_client_toplevel-non-recursi.patch @@ -0,0 +1,37 @@ +From b5c62ae463101712a2ed91e976b28af5d1e73064 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michel=20D=C3=A4nzer?= +Date: Fri, 6 Nov 2020 10:14:19 +0100 +Subject: [PATCH xserver 25/25] xwayland: Make window_get_client_toplevel + non-recursive + +Noticed while reading the code. + +Reviewed-by: Olivier Fourdan +(cherry picked from commit df3aa4922fd7e256169e541188b724f67ca948e1) +--- + hw/xwayland/xwayland.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c +index 1600c00cd..a5756ea14 100644 +--- a/hw/xwayland/xwayland.c ++++ b/hw/xwayland/xwayland.c +@@ -578,11 +578,11 @@ window_get_client_toplevel(WindowPtr window) + * decoration/wrapper windows. In that case recurse by checking the client + * of the first *and only* child of the decoration/wrapper window. + */ +- if (window_is_wm_window(window)) { +- if (window->firstChild && window->firstChild == window->lastChild) +- return window_get_client_toplevel(window->firstChild); +- else ++ while (window_is_wm_window(window)) { ++ if (!window->firstChild || window->firstChild != window->lastChild) + return NULL; /* Should never happen, skip resolution emulation */ ++ ++ window = window->firstChild; + } + + return window; +-- +2.28.0 + diff --git a/sources b/sources index 043e4bb..623b3d0 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (xorg-server-1.20.9.tar.bz2) = d9b5f93e1b9763a89187d8b272aa7d4ce9709641b8539f4536708af153310e5a4931bffd4229c51a3b0e3b12da7838750aa71b635751fb4c0bb27438cce4e5e6 +SHA512 (xorg-server-1.20.10.tar.bz2) = a07bee380bb72f2117fe6f831a6e4aded19bea1f2b36e42a019a30348e98d6fe65c0617cf819be9c6b405502f88cafb829df30aab32393774b71f1418a4cefae diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 7fa256d..de26148 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -45,8 +45,8 @@ Summary: X.Org X11 X server Name: xorg-x11-server -Version: 1.20.9 -Release: 3%{?gitdate:.%{gitdate}}%{?dist} +Version: 1.20.10 +Release: 1%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org License: MIT @@ -93,24 +93,10 @@ Patch5: 0001-autobind-GPUs-to-the-screen.patch Patch6: 0001-Fedora-hack-Make-the-suid-root-wrapper-always-start-.patch # Backports from current stable "server-1.20-branch": -Patch101: 0001-Revert-linux-Fix-platform-device-probe-for-DT-based-.patch -Patch102: 0002-Revert-linux-Fix-platform-device-PCI-detection-for-c.patch -Patch103: 0003-Revert-linux-Make-platform-device-probe-less-fragile.patch -Patch104: 0004-include-Increase-the-number-of-max.-input-devices-to.patch -Patch105: 0005-glamor-Fix-glamor_poly_fill_rect_gl-xRectangle-width.patch -Patch106: 0006-xfree86-Take-second-reference-for-SavedCursor-in-xf8.patch -Patch107: 0007-present-wnmd-Can-t-use-page-flipping-for-windows-cli.patch -Patch108: 0008-xwayland-Check-window-pixmap-in-xwl_present_check_fl.patch -Patch109: 0009-present-wnmd-Remove-dead-check-from-present_wnmd_che.patch -Patch110: 0010-xwayland-Do-not-discard-frame-callbacks-on-allow-com.patch -Patch111: 0011-xwayland-use-drmGetNodeTypeFromFd-for-checking-if-a-.patch -Patch112: 0012-xwayland-Remove-pending-stream-reference-when-freein.patch -Patch113: 0013-present-Move-flip-target_msc-adjustment-out-of-prese.patch -Patch114: 0014-present-Add-present_vblank-exec_msc-field.patch -Patch115: 0015-present-wnmd-Move-up-present_wnmd_queue_vblank.patch -Patch116: 0016-present-wnmd-Execute-copies-at-target_msc-1-already.patch +# # Backports from "master" upstream: +# # Backported Xwayland randr resolution change emulation support Patch501: 0001-dix-Add-GetCurrentClient-helper.patch @@ -137,6 +123,7 @@ Patch521: 0021-xwayland-Fix-emulated-modes-not-being-removed-when-s.patch Patch522: 0022-xwayland-Call-xwl_window_check_resolution_change_emu.patch Patch523: 0023-xwayland-Fix-setting-of-_XWAYLAND_RANDR_EMU_MONITOR_.patch Patch524: 0024-xwayland-Remove-unnecessary-xwl_window_is_toplevel-c.patch +Patch525: 0025-xwayland-Make-window_get_client_toplevel-non-recursi.patch BuildRequires: make BuildRequires: systemtap-sdt-devel @@ -564,6 +551,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Wed Dec 2 2020 Olivier Fourdan - 1.20.10-1 +- xserver 1.20.10 (CVE-2020-14360, CVE-2020-25712) + * Thu Nov 5 10:35:09 AEST 2020 Peter Hutterer - 1.20.9-3 - Add BuildRequires for make From 38a777ceb5c99737e2acd056bdc604c03c4ef383 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Tue, 19 Jan 2021 19:52:41 -0500 Subject: [PATCH 058/131] Disable int10 and vbe on RHEL Disable DRI1 Stop overriding the vendor name --- xorg-x11-server.spec | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index de26148..a34bf8c 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -46,7 +46,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.20.10 -Release: 1%{?gitdate:.%{gitdate}}%{?dist} +Release: 2%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org License: MIT @@ -357,15 +357,20 @@ export CFLAGS="$RPM_OPT_FLAGS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1" export CXXFLAGS="$RPM_OPT_FLAGS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1" export LDFLAGS="$RPM_LD_FLAGS -specs=/usr/lib/rpm/redhat/redhat-hardened-ld" +%if !0%{?rhel} %ifnarch %{ix86} x86_64 +%global int10_arch 1 +%endif +%endif + +%if %{undefined int10_arch} %global no_int10 --disable-vbe --disable-int10-module %endif %global kdrive --enable-kdrive --enable-xephyr --disable-xfake --disable-xfbdev %global xservers --enable-xvfb --enable-xnest %{kdrive} --enable-xorg %global default_font_path "catalogue:/etc/X11/fontpath.d,built-ins" -%global dri_flags --enable-dri --enable-dri2 %{?!rhel:--enable-dri3} --enable-suid-wrapper --enable-glamor -%global bodhi_flags --with-vendor-name="Fedora Project" +%global dri_flags --disable-dri --enable-dri2 %{?!rhel:--enable-dri3} --enable-suid-wrapper --enable-glamor autoreconf -f -v --install || exit 1 @@ -374,7 +379,7 @@ autoreconf -f -v --install || exit 1 --enable-xwayland-eglstream \ --disable-static \ --with-pic \ - %{?no_int10} --with-int10=x86emu \ + %{?no_int10} \ --with-default-font-path=%{default_font_path} \ --with-module-dir=%{_libdir}/xorg/modules \ --with-builderstring="Build ID: %{name} %{version}-%{release}" \ @@ -388,7 +393,7 @@ autoreconf -f -v --install || exit 1 --disable-unit-tests \ --enable-dmx \ --enable-xwayland \ - %{dri_flags} %{?bodhi_flags} \ + %{dri_flags} \ ${CONFIGURE} make V=1 %{?_smp_mflags} @@ -485,7 +490,7 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %{_libdir}/xorg/modules/libshadowfb.so %{_libdir}/xorg/modules/libvgahw.so %{_libdir}/xorg/modules/libwfb.so -%ifarch %{ix86} x86_64 +%if %{defined int10_arch} %{_libdir}/xorg/modules/libint10.so %{_libdir}/xorg/modules/libvbe.so %endif @@ -551,6 +556,11 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Tue Jan 19 2021 Adam Jackson - 1.20.10-2 +- Disable int10 and vbe on RHEL +- Disable DRI1 +- Stop overriding the vendor name + * Wed Dec 2 2020 Olivier Fourdan - 1.20.10-1 - xserver 1.20.10 (CVE-2020-14360, CVE-2020-25712) From 29f0985634f7e10e348dba264bcac14ea57d015a Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Tue, 19 Jan 2021 20:11:43 -0500 Subject: [PATCH 059/131] fix thinko --- xorg-x11-server.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index a34bf8c..54bbc3d 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -358,7 +358,7 @@ export CXXFLAGS="$RPM_OPT_FLAGS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1" export LDFLAGS="$RPM_LD_FLAGS -specs=/usr/lib/rpm/redhat/redhat-hardened-ld" %if !0%{?rhel} -%ifnarch %{ix86} x86_64 +%ifarch %{ix86} x86_64 %global int10_arch 1 %endif %endif From 11999b23073dc485f86a13e43408cbe140345df2 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 28 Jan 2021 00:18:09 +0000 Subject: [PATCH 060/131] - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- xorg-x11-server.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 54bbc3d..fdf77f6 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -46,7 +46,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.20.10 -Release: 2%{?gitdate:.%{gitdate}}%{?dist} +Release: 3%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org License: MIT @@ -556,6 +556,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Thu Jan 28 2021 Fedora Release Engineering - 1.20.10-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + * Tue Jan 19 2021 Adam Jackson - 1.20.10-2 - Disable int10 and vbe on RHEL - Disable DRI1 From b1458e4567cd8795d5d660be512877750cde9c2f Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Mon, 1 Feb 2021 11:26:56 +0100 Subject: [PATCH 061/131] Remove Xwayland from the xserver builds --- 0001-dix-Add-GetCurrentClient-helper.patch | 116 ----- ...p_viewport-wayland-extension-support.patch | 119 ----- ...fer_damage-instead-of-surface-damage.patch | 160 ------ ...e-output-modes-to-xrandr-output-mode.patch | 207 -------- ...ayland-Use-RandR-1.2-interface-rev-2.patch | 139 ------ ...xwayland-Add-per-client-private-data.patch | 80 --- ...port-for-storing-per-client-per-outp.patch | 149 ------ ...port-for-randr-resolution-change-emu.patch | 462 ------------------ ...lRRModeToDisplayMode-helper-function.patch | 101 ---- ...VidModeGetCurrentRRMode-helper-to-th.patch | 193 -------- ...mode-mode-changing-emulation-support.patch | 236 --------- ...dow_should_enable_viewport-Add-extra.patch | 57 --- ...AYLAND_RANDR_EMU_MONITOR_RECTS-prope.patch | 205 -------- ...lient-id-for-the-window-manager-clie.patch | 137 ------ ...Reuse-viewport-instead-of-recreating.patch | 50 -- ...Recurse-on-finding-the-none-wm-owner.patch | 81 --- ...ndow_get_none_wm_owner-return-a-Wind.patch | 82 ---- ...-emulation-on-client-toplevel-resize.patch | 121 ----- ...eck-resolution-change-emulation-when.patch | 45 -- ...Also-hook-screen-s-MoveWindow-method.patch | 83 ---- ...lated-modes-not-being-removed-when-s.patch | 63 --- ...l_window_check_resolution_change_emu.patch | 48 -- ...ting-of-_XWAYLAND_RANDR_EMU_MONITOR_.patch | 76 --- ...unnecessary-xwl_window_is_toplevel-c.patch | 49 -- ...ndow_get_client_toplevel-non-recursi.patch | 37 -- xorg-x11-server.spec | 51 +- 26 files changed, 5 insertions(+), 3142 deletions(-) delete mode 100644 0001-dix-Add-GetCurrentClient-helper.patch delete mode 100644 0002-xwayland-Add-wp_viewport-wayland-extension-support.patch delete mode 100644 0003-xwayland-Use-buffer_damage-instead-of-surface-damage.patch delete mode 100644 0004-xwayland-Add-fake-output-modes-to-xrandr-output-mode.patch delete mode 100644 0005-xwayland-Use-RandR-1.2-interface-rev-2.patch delete mode 100644 0006-xwayland-Add-per-client-private-data.patch delete mode 100644 0007-xwayland-Add-support-for-storing-per-client-per-outp.patch delete mode 100644 0008-xwayland-Add-support-for-randr-resolution-change-emu.patch delete mode 100644 0009-xwayland-Add-xwlRRModeToDisplayMode-helper-function.patch delete mode 100644 0010-xwayland-Add-xwlVidModeGetCurrentRRMode-helper-to-th.patch delete mode 100644 0011-xwayland-Add-vidmode-mode-changing-emulation-support.patch delete mode 100644 0012-xwayland-xwl_window_should_enable_viewport-Add-extra.patch delete mode 100644 0013-xwayland-Set-_XWAYLAND_RANDR_EMU_MONITOR_RECTS-prope.patch delete mode 100644 0014-xwayland-Cache-client-id-for-the-window-manager-clie.patch delete mode 100644 0015-xwayland-Reuse-viewport-instead-of-recreating.patch delete mode 100644 0016-xwayland-Recurse-on-finding-the-none-wm-owner.patch delete mode 100644 0017-xwayland-Make-window_get_none_wm_owner-return-a-Wind.patch delete mode 100644 0018-xwayland-Check-emulation-on-client-toplevel-resize.patch delete mode 100644 0019-xwayland-Also-check-resolution-change-emulation-when.patch delete mode 100644 0020-xwayland-Also-hook-screen-s-MoveWindow-method.patch delete mode 100644 0021-xwayland-Fix-emulated-modes-not-being-removed-when-s.patch delete mode 100644 0022-xwayland-Call-xwl_window_check_resolution_change_emu.patch delete mode 100644 0023-xwayland-Fix-setting-of-_XWAYLAND_RANDR_EMU_MONITOR_.patch delete mode 100644 0024-xwayland-Remove-unnecessary-xwl_window_is_toplevel-c.patch delete mode 100644 0025-xwayland-Make-window_get_client_toplevel-non-recursi.patch diff --git a/0001-dix-Add-GetCurrentClient-helper.patch b/0001-dix-Add-GetCurrentClient-helper.patch deleted file mode 100644 index 3da345c..0000000 --- a/0001-dix-Add-GetCurrentClient-helper.patch +++ /dev/null @@ -1,116 +0,0 @@ -From a815e5f51f75684a53d8fa14b596e03b738cd281 Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Thu, 29 Aug 2019 14:18:28 +0200 -Subject: [PATCH xserver 01/25] dix: Add GetCurrentClient helper -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Request-handlers as registered in the requestVector array, always get -passed the clientPtr for the client which sent the request. -But the implementation of many request-handlers typically consists of -a generic handler calling implementation specific callbacks and / or -various helpers often multiple levels deep and in many cases the clientPtr -does not get passed to the callbacks / helpers. - -This means that in some places where we would like to have access to the -current-client, we cannot easily access it and fixing this would require -a lot of work and often would involve ABI breakage. - -This commit adds a GetCurrentClient helper which can be used as a -shortcut to get access to the clienPtr for the currently being processed -request without needing a lot of refactoring and ABI breakage. - -Note using this new GetCurrentClient helper is only safe for code -which only runs from the main thread, this new variable MUST NOT be used -by code which runs from signal handlers or from the input-thread. - -The specific use-case which resulted in the creation of this patch is adding -support for emulation of randr / vidmode resolution changes to Xwayland. -This emulation will not actually change the monitor resolution instead it -will scale any window with a size which exactly matches the requested -resolution to fill the entire monitor. The main use-case for this is -games which are hard-coded to render at a specific resolution and have -sofar relied on randr / vidmode to change the monitor resolution when going -fullscreen. - -To make this emulation as robust as possible (e.g. avoid accidentally scaling -windows from other apps) we want to make the emulated resolution a per client -state. But e.g. the RRSetCrtc function does not take a client pointer; and is -a (used) part of the Xorg server ABI (note the problem is not just limited -to RRSetCrtc). - -Reviewed-by: Olivier Fourdan -Reviewed-by: Michel Dänzer -Signed-off-by: Hans de Goede -(cherry picked from commit 834a467af978ac7a24ed17b8c8e58b6cddb4faf9) ---- - dix/dispatch.c | 23 ++++++++++++++++++++++- - include/dix.h | 1 + - 2 files changed, 23 insertions(+), 1 deletion(-) - -diff --git a/dix/dispatch.c b/dix/dispatch.c -index a33bfaa9e..2b1cf1a74 100644 ---- a/dix/dispatch.c -+++ b/dix/dispatch.c -@@ -148,6 +148,7 @@ xConnSetupPrefix connSetupPrefix; - PaddingInfo PixmapWidthPaddingInfo[33]; - - static ClientPtr grabClient; -+static ClientPtr currentClient; /* Client for the request currently being dispatched */ - - #define GrabNone 0 - #define GrabActive 1 -@@ -176,6 +177,23 @@ volatile char isItTimeToYield; - #define SAME_SCREENS(a, b) (\ - (a.pScreen == b.pScreen)) - -+ClientPtr -+GetCurrentClient(void) -+{ -+ if (in_input_thread()) { -+ static Bool warned; -+ -+ if (!warned) { -+ ErrorF("[dix] Error GetCurrentClient called from input-thread\n"); -+ warned = TRUE; -+ } -+ -+ return NULL; -+ } -+ -+ return currentClient; -+} -+ - void - SetInputCheck(HWEventQueuePtr c0, HWEventQueuePtr c1) - { -@@ -474,9 +492,12 @@ Dispatch(void) - result = BadLength; - else { - result = XaceHookDispatch(client, client->majorOp); -- if (result == Success) -+ if (result == Success) { -+ currentClient = client; - result = - (*client->requestVector[client->majorOp]) (client); -+ currentClient = NULL; -+ } - } - if (!SmartScheduleSignalEnable) - SmartScheduleTime = GetTimeInMillis(); -diff --git a/include/dix.h b/include/dix.h -index b6e2bcfde..d65060cb6 100644 ---- a/include/dix.h -+++ b/include/dix.h -@@ -148,6 +148,7 @@ typedef struct _TimeStamp { - } TimeStamp; - - /* dispatch.c */ -+extern _X_EXPORT ClientPtr GetCurrentClient(void); - - extern _X_EXPORT void SetInputCheck(HWEventQueuePtr /*c0 */ , - HWEventQueuePtr /*c1 */ ); --- -2.28.0 - diff --git a/0002-xwayland-Add-wp_viewport-wayland-extension-support.patch b/0002-xwayland-Add-wp_viewport-wayland-extension-support.patch deleted file mode 100644 index e4518a0..0000000 --- a/0002-xwayland-Add-wp_viewport-wayland-extension-support.patch +++ /dev/null @@ -1,119 +0,0 @@ -From 0a3046286e69b171c319ff419c94cf62929246bf Mon Sep 17 00:00:00 2001 -From: Robert Mader -Date: Mon, 22 Jan 2018 22:02:32 +0100 -Subject: [PATCH xserver 02/25] xwayland: Add wp_viewport wayland extension - support -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -This commit adds support for the wayland wp_viewport extension, note -nothing uses this yet. - -This is a preparation patch for adding support for fake mode-changes through -xrandr for apps which want to change the resolution when going fullscreen. - -[hdegoede@redhat.com: Split the code for the extension out into its own patch] - -Reviewed-by: Olivier Fourdan -Acked-by: Michel Dänzer -Signed-off-by: Hans de Goede -(cherry picked from commit 47bba4625339592d08b375bcd8e51029c0000850) ---- - hw/xwayland/Makefile.am | 9 ++++++++- - hw/xwayland/meson.build | 3 +++ - hw/xwayland/xwayland.c | 3 +++ - hw/xwayland/xwayland.h | 2 ++ - 4 files changed, 16 insertions(+), 1 deletion(-) - -diff --git a/hw/xwayland/Makefile.am b/hw/xwayland/Makefile.am -index bc1cb8506..49aae3d8b 100644 ---- a/hw/xwayland/Makefile.am -+++ b/hw/xwayland/Makefile.am -@@ -71,7 +71,9 @@ Xwayland_built_sources += \ - xdg-output-unstable-v1-protocol.c \ - xdg-output-unstable-v1-client-protocol.h \ - linux-dmabuf-unstable-v1-client-protocol.h \ -- linux-dmabuf-unstable-v1-protocol.c -+ linux-dmabuf-unstable-v1-protocol.c \ -+ viewporter-client-protocol.h \ -+ viewporter-protocol.c - - if XWAYLAND_EGLSTREAM - Xwayland_built_sources += \ -@@ -120,6 +122,11 @@ linux-dmabuf-unstable-v1-protocol.c : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/linu - linux-dmabuf-unstable-v1-client-protocol.h : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml - $(AM_V_GEN)$(WAYLAND_SCANNER) client-header < $< > $@ - -+viewporter-protocol.c: $(WAYLAND_PROTOCOLS_DATADIR)/stable/viewporter/viewporter.xml -+ $(AM_V_GEN)$(WAYLAND_SCANNER) @SCANNER_ARG@ < $< > $@ -+viewporter-client-protocol.h: $(WAYLAND_PROTOCOLS_DATADIR)/stable/viewporter/viewporter.xml -+ $(AM_V_GEN)$(WAYLAND_SCANNER) client-header < $< > $@ -+ - wayland-eglstream-client-protocol.h : $(WAYLAND_EGLSTREAM_DATADIR)/wayland-eglstream.xml - $(AM_V_GEN)$(WAYLAND_SCANNER) client-header < $< > $@ - wayland-eglstream-controller-client-protocol.h : $(WAYLAND_EGLSTREAM_DATADIR)/wayland-eglstream-controller.xml -diff --git a/hw/xwayland/meson.build b/hw/xwayland/meson.build -index 36bf2133a..4a8d171bb 100644 ---- a/hw/xwayland/meson.build -+++ b/hw/xwayland/meson.build -@@ -21,6 +21,7 @@ tablet_xml = join_paths(protodir, 'unstable', 'tablet', 'tablet-unstable-v2.xml' - kbgrab_xml = join_paths(protodir, 'unstable', 'xwayland-keyboard-grab', 'xwayland-keyboard-grab-unstable-v1.xml') - xdg_output_xml = join_paths(protodir, 'unstable', 'xdg-output', 'xdg-output-unstable-v1.xml') - dmabuf_xml = join_paths(protodir, 'unstable', 'linux-dmabuf', 'linux-dmabuf-unstable-v1.xml') -+viewporter_xml = join_paths(protodir, 'stable', 'viewporter', 'viewporter.xml') - - client_header = generator(scanner, - output : '@BASENAME@-client-protocol.h', -@@ -43,12 +44,14 @@ srcs += client_header.process(tablet_xml) - srcs += client_header.process(kbgrab_xml) - srcs += client_header.process(xdg_output_xml) - srcs += client_header.process(dmabuf_xml) -+srcs += client_header.process(viewporter_xml) - srcs += code.process(relative_xml) - srcs += code.process(pointer_xml) - srcs += code.process(tablet_xml) - srcs += code.process(kbgrab_xml) - srcs += code.process(xdg_output_xml) - srcs += code.process(dmabuf_xml) -+srcs += code.process(viewporter_xml) - - xwayland_glamor = [] - eglstream_srcs = [] -diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index b353167c3..a70c1002f 100644 ---- a/hw/xwayland/xwayland.c -+++ b/hw/xwayland/xwayland.c -@@ -912,6 +912,9 @@ registry_global(void *data, struct wl_registry *registry, uint32_t id, - wl_registry_bind(registry, id, &zxdg_output_manager_v1_interface, 1); - xwl_screen_init_xdg_output(xwl_screen); - } -+ else if (strcmp(interface, "wp_viewporter") == 0) { -+ xwl_screen->viewporter = wl_registry_bind(registry, id, &wp_viewporter_interface, 1); -+ } - #ifdef XWL_HAS_GLAMOR - else if (xwl_screen->glamor) { - xwl_glamor_init_wl_registry(xwl_screen, registry, id, interface, -diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h -index b9495b313..91ae21eeb 100644 ---- a/hw/xwayland/xwayland.h -+++ b/hw/xwayland/xwayland.h -@@ -48,6 +48,7 @@ - #include "xwayland-keyboard-grab-unstable-v1-client-protocol.h" - #include "xdg-output-unstable-v1-client-protocol.h" - #include "linux-dmabuf-unstable-v1-client-protocol.h" -+#include "viewporter-client-protocol.h" - - struct xwl_format { - uint32_t format; -@@ -151,6 +152,7 @@ struct xwl_screen { - struct zwp_pointer_constraints_v1 *pointer_constraints; - struct zwp_xwayland_keyboard_grab_manager_v1 *wp_grab; - struct zxdg_output_manager_v1 *xdg_output_manager; -+ struct wp_viewporter *viewporter; - uint32_t serial; - - #define XWL_FORMAT_ARGB8888 (1 << 0) --- -2.28.0 - diff --git a/0003-xwayland-Use-buffer_damage-instead-of-surface-damage.patch b/0003-xwayland-Use-buffer_damage-instead-of-surface-damage.patch deleted file mode 100644 index 0627415..0000000 --- a/0003-xwayland-Use-buffer_damage-instead-of-surface-damage.patch +++ /dev/null @@ -1,160 +0,0 @@ -From 30859f64d1718d1476648dcddbb3d81c2f932828 Mon Sep 17 00:00:00 2001 -From: Robert Mader -Date: Tue, 2 Jul 2019 12:03:12 +0200 -Subject: [PATCH xserver 03/25] xwayland: Use buffer_damage instead of surface - damage if available -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -When a viewport is set, damage will only work properly when using -wl_surface_damage_buffer instead of wl_surface_damage. - -When no viewport is set, there should be no difference between -surface and buffer damage. - -This is a preparation patch for using viewport to add support for fake -mode-changes through xrandr for apps which want to change the resolution -when going fullscreen. - -Changes by Hans de Goede : --Split the damage changes out into their own patch --Add xwl_surface_damage helper --Also use buffer_damage / the new helper for the present and cursor code - -Reviewed-by: Olivier Fourdan -Acked-by: Michel Dänzer -Signed-off-by: Hans de Goede -(cherry picked from commit 7c6f17790d3aedb164481264b0f05a8a14103731) ---- - hw/xwayland/xwayland-cursor.c | 12 ++++++------ - hw/xwayland/xwayland-present.c | 10 +++++----- - hw/xwayland/xwayland.c | 29 +++++++++++++++++++++++------ - hw/xwayland/xwayland.h | 3 +++ - 4 files changed, 37 insertions(+), 17 deletions(-) - -diff --git a/hw/xwayland/xwayland-cursor.c b/hw/xwayland/xwayland-cursor.c -index 66720bcc0..cbc715061 100644 ---- a/hw/xwayland/xwayland-cursor.c -+++ b/hw/xwayland/xwayland-cursor.c -@@ -165,9 +165,9 @@ xwl_seat_set_cursor(struct xwl_seat *xwl_seat) - xwl_seat->x_cursor->bits->yhot); - wl_surface_attach(xwl_cursor->surface, - xwl_shm_pixmap_get_wl_buffer(pixmap), 0, 0); -- wl_surface_damage(xwl_cursor->surface, 0, 0, -- xwl_seat->x_cursor->bits->width, -- xwl_seat->x_cursor->bits->height); -+ xwl_surface_damage(xwl_seat->xwl_screen, xwl_cursor->surface, 0, 0, -+ xwl_seat->x_cursor->bits->width, -+ xwl_seat->x_cursor->bits->height); - - xwl_cursor->frame_cb = wl_surface_frame(xwl_cursor->surface); - wl_callback_add_listener(xwl_cursor->frame_cb, &frame_listener, xwl_cursor); -@@ -217,9 +217,9 @@ xwl_tablet_tool_set_cursor(struct xwl_tablet_tool *xwl_tablet_tool) - xwl_seat->x_cursor->bits->yhot); - wl_surface_attach(xwl_cursor->surface, - xwl_shm_pixmap_get_wl_buffer(pixmap), 0, 0); -- wl_surface_damage(xwl_cursor->surface, 0, 0, -- xwl_seat->x_cursor->bits->width, -- xwl_seat->x_cursor->bits->height); -+ xwl_surface_damage(xwl_seat->xwl_screen, xwl_cursor->surface, 0, 0, -+ xwl_seat->x_cursor->bits->width, -+ xwl_seat->x_cursor->bits->height); - - xwl_cursor->frame_cb = wl_surface_frame(xwl_cursor->surface); - wl_callback_add_listener(xwl_cursor->frame_cb, &frame_listener, xwl_cursor); -diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c -index d177abdd8..f4027f91e 100644 ---- a/hw/xwayland/xwayland-present.c -+++ b/hw/xwayland/xwayland-present.c -@@ -505,11 +505,11 @@ xwl_present_flip(WindowPtr present_window, - /* Realign timer */ - xwl_present_reset_timer(xwl_present_window); - -- wl_surface_damage(xwl_window->surface, -- damage_box->x1 - present_window->drawable.x, -- damage_box->y1 - present_window->drawable.y, -- damage_box->x2 - damage_box->x1, -- damage_box->y2 - damage_box->y1); -+ xwl_surface_damage(xwl_window->xwl_screen, xwl_window->surface, -+ damage_box->x1 - present_window->drawable.x, -+ damage_box->y1 - present_window->drawable.y, -+ damage_box->x2 - damage_box->x1, -+ damage_box->y2 - damage_box->y1); - - wl_surface_commit(xwl_window->surface); - -diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index a70c1002f..811257b00 100644 ---- a/hw/xwayland/xwayland.c -+++ b/hw/xwayland/xwayland.c -@@ -792,6 +792,16 @@ xwl_destroy_window(WindowPtr window) - return ret; - } - -+void xwl_surface_damage(struct xwl_screen *xwl_screen, -+ struct wl_surface *surface, -+ int32_t x, int32_t y, int32_t width, int32_t height) -+{ -+ if (wl_surface_get_version(surface) >= WL_SURFACE_DAMAGE_BUFFER_SINCE_VERSION) -+ wl_surface_damage_buffer(surface, x, y, width, height); -+ else -+ wl_surface_damage(surface, x, y, width, height); -+} -+ - static void - xwl_window_post_damage(struct xwl_window *xwl_window) - { -@@ -828,13 +838,15 @@ xwl_window_post_damage(struct xwl_window *xwl_window) - */ - if (RegionNumRects(region) > 256) { - box = RegionExtents(region); -- wl_surface_damage(xwl_window->surface, box->x1, box->y1, -- box->x2 - box->x1, box->y2 - box->y1); -+ xwl_surface_damage(xwl_screen, xwl_window->surface, box->x1, box->y1, -+ box->x2 - box->x1, box->y2 - box->y1); - } else { - box = RegionRects(region); -- for (i = 0; i < RegionNumRects(region); i++, box++) -- wl_surface_damage(xwl_window->surface, box->x1, box->y1, -- box->x2 - box->x1, box->y2 - box->y1); -+ for (i = 0; i < RegionNumRects(region); i++, box++) { -+ xwl_surface_damage(xwl_screen, xwl_window->surface, -+ box->x1, box->y1, -+ box->x2 - box->x1, box->y2 - box->y1); -+ } - } - - xwl_window_create_frame_callback(xwl_window); -@@ -893,8 +905,13 @@ registry_global(void *data, struct wl_registry *registry, uint32_t id, - struct xwl_screen *xwl_screen = data; - - if (strcmp(interface, "wl_compositor") == 0) { -+ uint32_t request_version = 1; -+ -+ if (version >= WL_SURFACE_DAMAGE_BUFFER_SINCE_VERSION) -+ request_version = WL_SURFACE_DAMAGE_BUFFER_SINCE_VERSION; -+ - xwl_screen->compositor = -- wl_registry_bind(registry, id, &wl_compositor_interface, 1); -+ wl_registry_bind(registry, id, &wl_compositor_interface, request_version); - } - else if (strcmp(interface, "wl_shm") == 0) { - xwl_screen->shm = wl_registry_bind(registry, id, &wl_shm_interface, 1); -diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h -index 91ae21eeb..1244d2e91 100644 ---- a/hw/xwayland/xwayland.h -+++ b/hw/xwayland/xwayland.h -@@ -382,6 +382,9 @@ struct xwl_output { - void xwl_window_create_frame_callback(struct xwl_window *xwl_window); - - void xwl_sync_events (struct xwl_screen *xwl_screen); -+void xwl_surface_damage(struct xwl_screen *xwl_screen, -+ struct wl_surface *surface, -+ int32_t x, int32_t y, int32_t width, int32_t height); - - void xwl_screen_roundtrip (struct xwl_screen *xwl_screen); - --- -2.28.0 - diff --git a/0004-xwayland-Add-fake-output-modes-to-xrandr-output-mode.patch b/0004-xwayland-Add-fake-output-modes-to-xrandr-output-mode.patch deleted file mode 100644 index 45d52a9..0000000 --- a/0004-xwayland-Add-fake-output-modes-to-xrandr-output-mode.patch +++ /dev/null @@ -1,207 +0,0 @@ -From 32987e08e7f1e79ee50ce032cc6c1b6d28e6a50d Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Wed, 26 Jun 2019 16:46:54 +0200 -Subject: [PATCH xserver 04/25] xwayland: Add fake output modes to xrandr - output mode lists -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -This is a preparation patch for adding support for apps which want to -change the resolution when they go fullscreen because they are hardcoded -to render at a specific resolution, e.g. 640x480. - -Follow up patches will fake the mode-switch these apps want by using -WPviewport to scale there pixmap to cover the entire output. - -Reviewed-by: Olivier Fourdan -Acked-by: Michel Dänzer -Signed-off-by: Hans de Goede -(cherry picked from commit 0d656d796071fb637e4969ea800855fe5d1c9728) ---- - hw/xwayland/xwayland-output.c | 112 ++++++++++++++++++++++++++++++++-- - hw/xwayland/xwayland.c | 17 ++++++ - hw/xwayland/xwayland.h | 1 + - 3 files changed, 124 insertions(+), 6 deletions(-) - -diff --git a/hw/xwayland/xwayland-output.c b/hw/xwayland/xwayland-output.c -index ae646c663..4036ba681 100644 ---- a/hw/xwayland/xwayland-output.c -+++ b/hw/xwayland/xwayland-output.c -@@ -208,14 +208,110 @@ update_screen_size(struct xwl_output *xwl_output, int width, int height) - update_desktop_dimensions(); - } - -+/* From hw/xfree86/common/xf86DefModeSet.c with some obscure modes dropped */ -+const int32_t xwl_output_fake_modes[][2] = { -+ /* 4:3 (1.33) */ -+ { 2048, 1536 }, -+ { 1920, 1440 }, -+ { 1600, 1200 }, -+ { 1440, 1080 }, -+ { 1400, 1050 }, -+ { 1280, 1024 }, /* 5:4 (1.25) */ -+ { 1280, 960 }, -+ { 1152, 864 }, -+ { 1024, 768 }, -+ { 800, 600 }, -+ { 640, 480 }, -+ { 320, 240 }, -+ /* 16:10 (1.6) */ -+ { 2560, 1600 }, -+ { 1920, 1200 }, -+ { 1680, 1050 }, -+ { 1440, 900 }, -+ { 1280, 800 }, -+ { 720, 480 }, /* 3:2 (1.5) */ -+ { 640, 400 }, -+ { 320, 200 }, -+ /* 16:9 (1.77) */ -+ { 5120, 2880 }, -+ { 4096, 2304 }, -+ { 3840, 2160 }, -+ { 3200, 1800 }, -+ { 2880, 1620 }, -+ { 2560, 1440 }, -+ { 2048, 1152 }, -+ { 1920, 1080 }, -+ { 1600, 900 }, -+ { 1368, 768 }, -+ { 1280, 720 }, -+ { 1024, 576 }, -+ { 864, 486 }, -+ { 720, 400 }, -+ { 640, 350 }, -+}; -+ -+/* Build an array with RRModes the first mode is the actual output mode, the -+ * rest are fake modes from the xwl_output_fake_modes list. We do this for apps -+ * which want to change resolution when they go fullscreen. -+ * When an app requests a mode-change, we fake it using WPviewport. -+ */ -+static RRModePtr * -+output_get_rr_modes(struct xwl_output *xwl_output, -+ int32_t width, int32_t height, -+ int *count) -+{ -+ struct xwl_screen *xwl_screen = xwl_output->xwl_screen; -+ RRModePtr *rr_modes; -+ int i; -+ -+ rr_modes = xallocarray(ARRAY_SIZE(xwl_output_fake_modes) + 1, sizeof(RRModePtr)); -+ if (!rr_modes) -+ goto err; -+ -+ /* Add actual output mode */ -+ rr_modes[0] = xwayland_cvt(width, height, xwl_output->refresh / 1000.0, 0, 0); -+ if (!rr_modes[0]) -+ goto err; -+ -+ *count = 1; -+ -+ if (!xwl_screen_has_resolution_change_emulation(xwl_screen)) -+ return rr_modes; -+ -+ /* Add fake modes */ -+ for (i = 0; i < ARRAY_SIZE(xwl_output_fake_modes); i++) { -+ /* Skip actual output mode, already added */ -+ if (xwl_output_fake_modes[i][0] == width && -+ xwl_output_fake_modes[i][1] == height) -+ continue; -+ -+ /* Skip modes which are too big, avoid downscaling */ -+ if (xwl_output_fake_modes[i][0] > width || -+ xwl_output_fake_modes[i][1] > height) -+ continue; -+ -+ rr_modes[*count] = xwayland_cvt(xwl_output_fake_modes[i][0], -+ xwl_output_fake_modes[i][1], -+ xwl_output->refresh / 1000.0, 0, 0); -+ if (!rr_modes[*count]) -+ goto err; -+ -+ (*count)++; -+ } -+ -+ return rr_modes; -+err: -+ FatalError("Failed to allocate memory for list of RR modes"); -+} -+ - static void - apply_output_change(struct xwl_output *xwl_output) - { - struct xwl_screen *xwl_screen = xwl_output->xwl_screen; - struct xwl_output *it; -- int mode_width, mode_height; -+ int mode_width, mode_height, count; - int width = 0, height = 0, has_this_output = 0; -- RRModePtr randr_mode; -+ RRModePtr *randr_modes; - Bool need_rotate; - - /* Clear out the "done" received flags */ -@@ -234,12 +330,16 @@ apply_output_change(struct xwl_output *xwl_output) - mode_height = xwl_output->width; - } - -- randr_mode = xwayland_cvt(mode_width, mode_height, -- xwl_output->refresh / 1000.0, 0, 0); -- RROutputSetModes(xwl_output->randr_output, &randr_mode, 1, 1); -- RRCrtcNotify(xwl_output->randr_crtc, randr_mode, -+ /* Build a fresh modes array using the current refresh rate */ -+ randr_modes = output_get_rr_modes(xwl_output, mode_width, mode_height, &count); -+ RROutputSetModes(xwl_output->randr_output, randr_modes, count, 1); -+ RRCrtcNotify(xwl_output->randr_crtc, randr_modes[0], - xwl_output->x, xwl_output->y, - xwl_output->rotation, NULL, 1, &xwl_output->randr_output); -+ /* RROutputSetModes takes ownership of the passed in modes, so we only -+ * have to free the pointer array. -+ */ -+ free(randr_modes); - - xorg_list_for_each_entry(it, &xwl_screen->output_list, link) { - /* output done event is sent even when some property -diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index 811257b00..e84515f94 100644 ---- a/hw/xwayland/xwayland.c -+++ b/hw/xwayland/xwayland.c -@@ -154,6 +154,23 @@ xwl_screen_get(ScreenPtr screen) - return dixLookupPrivate(&screen->devPrivates, &xwl_screen_private_key); - } - -+static Bool -+xwl_screen_has_viewport_support(struct xwl_screen *xwl_screen) -+{ -+ return wl_compositor_get_version(xwl_screen->compositor) >= -+ WL_SURFACE_DAMAGE_BUFFER_SINCE_VERSION && -+ xwl_screen->viewporter != NULL; -+} -+ -+Bool -+xwl_screen_has_resolution_change_emulation(struct xwl_screen *xwl_screen) -+{ -+ /* Resolution change emulation is only supported in rootless mode and -+ * it requires viewport support. -+ */ -+ return xwl_screen->rootless && xwl_screen_has_viewport_support(xwl_screen); -+} -+ - static void - xwl_window_set_allow_commits(struct xwl_window *xwl_window, Bool allow, - const char *debug_msg) -diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h -index 1244d2e91..200e18a8d 100644 ---- a/hw/xwayland/xwayland.h -+++ b/hw/xwayland/xwayland.h -@@ -391,6 +391,7 @@ void xwl_screen_roundtrip (struct xwl_screen *xwl_screen); - Bool xwl_screen_init_cursor(struct xwl_screen *xwl_screen); - - struct xwl_screen *xwl_screen_get(ScreenPtr screen); -+Bool xwl_screen_has_resolution_change_emulation(struct xwl_screen *xwl_screen); - - void xwl_tablet_tool_set_cursor(struct xwl_tablet_tool *tool); - void xwl_seat_set_cursor(struct xwl_seat *xwl_seat); --- -2.28.0 - diff --git a/0005-xwayland-Use-RandR-1.2-interface-rev-2.patch b/0005-xwayland-Use-RandR-1.2-interface-rev-2.patch deleted file mode 100644 index 7493da6..0000000 --- a/0005-xwayland-Use-RandR-1.2-interface-rev-2.patch +++ /dev/null @@ -1,139 +0,0 @@ -From 09dcf01f5ea8d1f828a58e54edd608e6918d0b59 Mon Sep 17 00:00:00 2001 -From: Robert Mader -Date: Mon, 22 Jan 2018 17:57:38 +0100 -Subject: [PATCH xserver 05/25] xwayland: Use RandR 1.2 interface (rev 2) -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -This adds the RandR 1.2 interface to xwayland and allows modes -advertised by the compositor to be set in an undistructive manner. - -With this patch, applications that try to set the resolution will usually -succeed and work while other apps using the same xwayland -instance are not affected at all. - -The RandR 1.2 interface will be needed to implement fake-mode-setting and -already makes applications work much cleaner and predictive when a mode -was set. - -[hdegoede@redhat.com: Make crtc_set only succeed if the mode matches - the desktop resolution] - -Reviewed-by: Olivier Fourdan -Acked-by: Michel Dänzer -Signed-off-by: Hans de Goede -(cherry picked from commit e89872f51aa834fa9d94a4ca4822f03b0341ab4f) ---- - hw/xwayland/xwayland-output.c | 81 +++++++++++++++++++++++++++++++++++ - 1 file changed, 81 insertions(+) - -diff --git a/hw/xwayland/xwayland-output.c b/hw/xwayland/xwayland-output.c -index 4036ba681..633ebb89e 100644 ---- a/hw/xwayland/xwayland-output.c -+++ b/hw/xwayland/xwayland-output.c -@@ -524,12 +524,80 @@ xwl_randr_get_info(ScreenPtr pScreen, Rotation * rotations) - return TRUE; - } - -+#ifdef RANDR_10_INTERFACE - static Bool - xwl_randr_set_config(ScreenPtr pScreen, - Rotation rotation, int rate, RRScreenSizePtr pSize) - { - return FALSE; - } -+#endif -+ -+#if RANDR_12_INTERFACE -+static Bool -+xwl_randr_screen_set_size(ScreenPtr pScreen, -+ CARD16 width, -+ CARD16 height, -+ CARD32 mmWidth, CARD32 mmHeight) -+{ -+ return TRUE; -+} -+ -+static Bool -+xwl_randr_crtc_set(ScreenPtr pScreen, -+ RRCrtcPtr crtc, -+ RRModePtr mode, -+ int x, -+ int y, -+ Rotation rotation, -+ int numOutputs, RROutputPtr * outputs) -+{ -+ struct xwl_output *xwl_output = crtc->devPrivate; -+ -+ if (!mode || (mode->mode.width == xwl_output->width && -+ mode->mode.height == xwl_output->height)) { -+ RRCrtcChanged(crtc, TRUE); -+ return TRUE; -+ } -+ -+ return FALSE; -+} -+ -+static Bool -+xwl_randr_crtc_set_gamma(ScreenPtr pScreen, RRCrtcPtr crtc) -+{ -+ return TRUE; -+} -+ -+static Bool -+xwl_randr_crtc_get_gamma(ScreenPtr pScreen, RRCrtcPtr crtc) -+{ -+ return TRUE; -+} -+ -+static Bool -+xwl_randr_output_set_property(ScreenPtr pScreen, -+ RROutputPtr output, -+ Atom property, -+ RRPropertyValuePtr value) -+{ -+ return TRUE; -+} -+ -+static Bool -+xwl_output_validate_mode(ScreenPtr pScreen, -+ RROutputPtr output, -+ RRModePtr mode) -+{ -+ return TRUE; -+} -+ -+static void -+xwl_randr_mode_destroy(ScreenPtr pScreen, RRModePtr mode) -+{ -+ return; -+} -+#endif - - Bool - xwl_screen_init_output(struct xwl_screen *xwl_screen) -@@ -543,7 +611,20 @@ xwl_screen_init_output(struct xwl_screen *xwl_screen) - - rp = rrGetScrPriv(xwl_screen->screen); - rp->rrGetInfo = xwl_randr_get_info; -+ -+#if RANDR_10_INTERFACE - rp->rrSetConfig = xwl_randr_set_config; -+#endif -+ -+#if RANDR_12_INTERFACE -+ rp->rrScreenSetSize = xwl_randr_screen_set_size; -+ rp->rrCrtcSet = xwl_randr_crtc_set; -+ rp->rrCrtcSetGamma = xwl_randr_crtc_set_gamma; -+ rp->rrCrtcGetGamma = xwl_randr_crtc_get_gamma; -+ rp->rrOutputSetProperty = xwl_randr_output_set_property; -+ rp->rrOutputValidateMode = xwl_output_validate_mode; -+ rp->rrModeDestroy = xwl_randr_mode_destroy; -+#endif - - return TRUE; - } --- -2.28.0 - diff --git a/0006-xwayland-Add-per-client-private-data.patch b/0006-xwayland-Add-per-client-private-data.patch deleted file mode 100644 index 5d64bd8..0000000 --- a/0006-xwayland-Add-per-client-private-data.patch +++ /dev/null @@ -1,80 +0,0 @@ -From ca0616ca4ca1badff2674fa5db8f290935b81e7f Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Thu, 29 Aug 2019 22:45:12 +0200 -Subject: [PATCH xserver 06/25] xwayland: Add per client private data -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Add per client private data, which for now is empty. - -This is a preparation patch for adding randr/vidmode resolution -change emulation. - -Reviewed-by: Olivier Fourdan -Acked-by: Michel Dänzer -Signed-off-by: Hans de Goede -(cherry picked from commit 905cb8b9e27add5f49a45fe167a0005bf05218bc) ---- - hw/xwayland/xwayland.c | 14 ++++++++++++++ - hw/xwayland/xwayland.h | 5 +++++ - 2 files changed, 19 insertions(+) - -diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index e84515f94..f422cfc29 100644 ---- a/hw/xwayland/xwayland.c -+++ b/hw/xwayland/xwayland.c -@@ -137,11 +137,18 @@ ddxProcessArgument(int argc, char *argv[], int i) - return 0; - } - -+static DevPrivateKeyRec xwl_client_private_key; - static DevPrivateKeyRec xwl_window_private_key; - static DevPrivateKeyRec xwl_screen_private_key; - static DevPrivateKeyRec xwl_pixmap_private_key; - static DevPrivateKeyRec xwl_damage_private_key; - -+struct xwl_client * -+xwl_client_get(ClientPtr client) -+{ -+ return dixLookupPrivate(&client->devPrivates, &xwl_client_private_key); -+} -+ - static struct xwl_window * - xwl_window_get(WindowPtr window) - { -@@ -1145,6 +1152,13 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) - return FALSE; - if (!dixRegisterPrivateKey(&xwl_damage_private_key, PRIVATE_WINDOW, 0)) - return FALSE; -+ /* There are no easy to use new / delete client hooks, we could use a -+ * ClientStateCallback, but it is easier to let the dix code manage the -+ * memory for us. This will zero fill the initial xwl_client data. -+ */ -+ if (!dixRegisterPrivateKey(&xwl_client_private_key, PRIVATE_CLIENT, -+ sizeof(struct xwl_client))) -+ return FALSE; - - dixSetPrivate(&pScreen->devPrivates, &xwl_screen_private_key, xwl_screen); - xwl_screen->screen = pScreen; -diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h -index 200e18a8d..19626d394 100644 ---- a/hw/xwayland/xwayland.h -+++ b/hw/xwayland/xwayland.h -@@ -379,8 +379,13 @@ struct xwl_output { - Bool xdg_output_done; - }; - -+struct xwl_client { -+}; -+ - void xwl_window_create_frame_callback(struct xwl_window *xwl_window); - -+struct xwl_client *xwl_client_get(ClientPtr client); -+ - void xwl_sync_events (struct xwl_screen *xwl_screen); - void xwl_surface_damage(struct xwl_screen *xwl_screen, - struct wl_surface *surface, --- -2.28.0 - diff --git a/0007-xwayland-Add-support-for-storing-per-client-per-outp.patch b/0007-xwayland-Add-support-for-storing-per-client-per-outp.patch deleted file mode 100644 index 6673754..0000000 --- a/0007-xwayland-Add-support-for-storing-per-client-per-outp.patch +++ /dev/null @@ -1,149 +0,0 @@ -From 4bc5480d2e63cceecdc18b4bfda4fb4624f8fb43 Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Thu, 29 Aug 2019 23:04:36 +0200 -Subject: [PATCH xserver 07/25] xwayland: Add support for storing per client - per output emulated resolution -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Add support for storing per output randr/vidmode emulated resolution -into the per client data. - -Since we do not have a free/delete callback for the client this uses -a simple static array. The entries are tied to a specific output by the -server_output_id, with a server_output_id of 0 indicating a free slot -(0 is the "None" Wayland object id). - -Note that even if we were to store this in a linked list, we would still -need the server_output_id as this is *per client* *per output*. - -This is a preparation patch for adding randr/vidmode resolution -change emulation. - -Reviewed-by: Olivier Fourdan -Acked-by: Michel Dänzer -Signed-off-by: Hans de Goede -(cherry picked from commit aca0a588eb40a5e6669094a2ab7f71ca0ba06b16) ---- - hw/xwayland/xwayland-output.c | 67 +++++++++++++++++++++++++++++++++++ - hw/xwayland/xwayland.h | 17 +++++++++ - 2 files changed, 84 insertions(+) - -diff --git a/hw/xwayland/xwayland-output.c b/hw/xwayland/xwayland-output.c -index 633ebb89e..64794dee7 100644 ---- a/hw/xwayland/xwayland-output.c -+++ b/hw/xwayland/xwayland-output.c -@@ -208,6 +208,73 @@ update_screen_size(struct xwl_output *xwl_output, int width, int height) - update_desktop_dimensions(); - } - -+struct xwl_emulated_mode * -+xwl_output_get_emulated_mode_for_client(struct xwl_output *xwl_output, -+ ClientPtr client) -+{ -+ struct xwl_client *xwl_client = xwl_client_get(client); -+ int i; -+ -+ if (!xwl_output) -+ return NULL; -+ -+ for (i = 0; i < XWL_CLIENT_MAX_EMULATED_MODES; i++) { -+ if (xwl_client->emulated_modes[i].server_output_id == -+ xwl_output->server_output_id) -+ return &xwl_client->emulated_modes[i]; -+ } -+ -+ return NULL; -+} -+ -+static void -+xwl_output_add_emulated_mode_for_client(struct xwl_output *xwl_output, -+ ClientPtr client, -+ RRModePtr mode, -+ Bool from_vidmode) -+{ -+ struct xwl_client *xwl_client = xwl_client_get(client); -+ struct xwl_emulated_mode *emulated_mode; -+ int i; -+ -+ emulated_mode = xwl_output_get_emulated_mode_for_client(xwl_output, client); -+ if (!emulated_mode) { -+ /* Find a free spot in the emulated modes array */ -+ for (i = 0; i < XWL_CLIENT_MAX_EMULATED_MODES; i++) { -+ if (xwl_client->emulated_modes[i].server_output_id == 0) { -+ emulated_mode = &xwl_client->emulated_modes[i]; -+ break; -+ } -+ } -+ } -+ if (!emulated_mode) { -+ static Bool warned; -+ -+ if (!warned) { -+ ErrorF("Ran out of space for emulated-modes, not adding mode"); -+ warned = TRUE; -+ } -+ -+ return; -+ } -+ -+ emulated_mode->server_output_id = xwl_output->server_output_id; -+ emulated_mode->width = mode->mode.width; -+ emulated_mode->height = mode->mode.height; -+ emulated_mode->from_vidmode = from_vidmode; -+} -+ -+static void -+xwl_output_remove_emulated_mode_for_client(struct xwl_output *xwl_output, -+ ClientPtr client) -+{ -+ struct xwl_emulated_mode *emulated_mode; -+ -+ emulated_mode = xwl_output_get_emulated_mode_for_client(xwl_output, client); -+ if (emulated_mode) -+ memset(emulated_mode, 0, sizeof(*emulated_mode)); -+} -+ - /* From hw/xfree86/common/xf86DefModeSet.c with some obscure modes dropped */ - const int32_t xwl_output_fake_modes[][2] = { - /* 4:3 (1.33) */ -diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h -index 19626d394..c886d77e9 100644 ---- a/hw/xwayland/xwayland.h -+++ b/hw/xwayland/xwayland.h -@@ -379,7 +379,21 @@ struct xwl_output { - Bool xdg_output_done; - }; - -+/* Per client per output emulated randr/vidmode resolution info. */ -+struct xwl_emulated_mode { -+ uint32_t server_output_id; -+ int32_t width; -+ int32_t height; -+ Bool from_vidmode; -+}; -+ -+/* Apps which use randr/vidmode to change the mode when going fullscreen, -+ * usually change the mode of only a single monitor, so this should be plenty. -+ */ -+#define XWL_CLIENT_MAX_EMULATED_MODES 16 -+ - struct xwl_client { -+ struct xwl_emulated_mode emulated_modes[XWL_CLIENT_MAX_EMULATED_MODES]; - }; - - void xwl_window_create_frame_callback(struct xwl_window *xwl_window); -@@ -427,6 +441,9 @@ void xwl_output_destroy(struct xwl_output *xwl_output); - - void xwl_output_remove(struct xwl_output *xwl_output); - -+struct xwl_emulated_mode *xwl_output_get_emulated_mode_for_client( -+ struct xwl_output *xwl_output, ClientPtr client); -+ - RRModePtr xwayland_cvt(int HDisplay, int VDisplay, - float VRefresh, Bool Reduced, Bool Interlaced); - --- -2.28.0 - diff --git a/0008-xwayland-Add-support-for-randr-resolution-change-emu.patch b/0008-xwayland-Add-support-for-randr-resolution-change-emu.patch deleted file mode 100644 index 75a2877..0000000 --- a/0008-xwayland-Add-support-for-randr-resolution-change-emu.patch +++ /dev/null @@ -1,462 +0,0 @@ -From 2f2a6b8556bd104740d76126640abcfe4705047c Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Tue, 2 Jul 2019 11:55:26 +0200 -Subject: [PATCH xserver 08/25] xwayland: Add support for randr-resolution - change emulation using viewport -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Add support for per client randr-resolution change emulation using viewport, -for apps which want to change the resolution when going fullscreen. - -Partly based on earlier work on this by Robert Mader - -Note SDL2 and SFML do not restore randr resolution when going from -fullscreen -> windowed, I believe this is caused by us still reporting the -desktop resolution when they query the resolution. This is not a problem -because when windowed the toplevel window size includes the window-decorations -so it never matches the emulated resolution. - -One exception would be the window being resizable in Windowed mode and the -user resizing the window so that including decorations it matches the -emulated resolution *and* the window being at pos 0x0. But this is an -extreme corner case. Still I will submit patches upstream to SDL2 -and SFML to always restore the desktop resolution under Xwayland, -disabling resolution emulation all together when going windowed. - -Reviewed-by: Olivier Fourdan -Acked-by: Michel Dänzer -Signed-off-by: Hans de Goede -(cherry picked from commit d99b9ff0f237d15e7eb507484493c73b393d5dba) ---- - hw/xwayland/xwayland-input.c | 5 + - hw/xwayland/xwayland-output.c | 63 ++++++++++- - hw/xwayland/xwayland.c | 199 ++++++++++++++++++++++++++++++++++ - hw/xwayland/xwayland.h | 15 +++ - 4 files changed, 276 insertions(+), 6 deletions(-) - -diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c -index a05d178ff..7d75a8f54 100644 ---- a/hw/xwayland/xwayland-input.c -+++ b/hw/xwayland/xwayland-input.c -@@ -488,6 +488,11 @@ dispatch_pointer_motion_event(struct xwl_seat *xwl_seat) - int dx = xwl_seat->focus_window->window->drawable.x; - int dy = xwl_seat->focus_window->window->drawable.y; - -+ if (xwl_window_has_viewport_enabled(xwl_seat->focus_window)) { -+ sx *= xwl_seat->focus_window->scale_x; -+ sy *= xwl_seat->focus_window->scale_y; -+ } -+ - x = dx + sx; - y = dy + sy; - } else { -diff --git a/hw/xwayland/xwayland-output.c b/hw/xwayland/xwayland-output.c -index 64794dee7..e09d00108 100644 ---- a/hw/xwayland/xwayland-output.c -+++ b/hw/xwayland/xwayland-output.c -@@ -371,6 +371,42 @@ err: - FatalError("Failed to allocate memory for list of RR modes"); - } - -+RRModePtr -+xwl_output_find_mode(struct xwl_output *xwl_output, -+ int32_t width, int32_t height) -+{ -+ RROutputPtr output = xwl_output->randr_output; -+ int i; -+ -+ /* width & height -1 means we want the actual output mode, which is idx 0 */ -+ if (width == -1 && height == -1 && output->modes) -+ return output->modes[0]; -+ -+ for (i = 0; i < output->numModes; i++) { -+ if (output->modes[i]->mode.width == width && output->modes[i]->mode.height == height) -+ return output->modes[i]; -+ } -+ -+ ErrorF("XWAYLAND: mode %dx%d is not available\n", width, height); -+ return NULL; -+} -+ -+void -+xwl_output_set_emulated_mode(struct xwl_output *xwl_output, ClientPtr client, -+ RRModePtr mode, Bool from_vidmode) -+{ -+ DebugF("XWAYLAND: xwl_output_set_emulated_mode from %s: %dx%d\n", -+ from_vidmode ? "vidmode" : "randr", -+ mode->mode.width, mode->mode.height); -+ -+ if (mode->mode.width == xwl_output->width && mode->mode.height == xwl_output->height) -+ xwl_output_remove_emulated_mode_for_client(xwl_output, client); -+ else -+ xwl_output_add_emulated_mode_for_client(xwl_output, client, mode, from_vidmode); -+ -+ xwl_screen_check_resolution_change_emulation(xwl_output->xwl_screen); -+} -+ - static void - apply_output_change(struct xwl_output *xwl_output) - { -@@ -613,21 +649,36 @@ xwl_randr_screen_set_size(ScreenPtr pScreen, - static Bool - xwl_randr_crtc_set(ScreenPtr pScreen, - RRCrtcPtr crtc, -- RRModePtr mode, -+ RRModePtr new_mode, - int x, - int y, - Rotation rotation, - int numOutputs, RROutputPtr * outputs) - { - struct xwl_output *xwl_output = crtc->devPrivate; -+ RRModePtr mode; - -- if (!mode || (mode->mode.width == xwl_output->width && -- mode->mode.height == xwl_output->height)) { -- RRCrtcChanged(crtc, TRUE); -- return TRUE; -+ if (new_mode) { -+ mode = xwl_output_find_mode(xwl_output, -+ new_mode->mode.width, -+ new_mode->mode.height); -+ } else { -+ mode = xwl_output_find_mode(xwl_output, -1, -1); - } -+ if (!mode) -+ return FALSE; - -- return FALSE; -+ xwl_output_set_emulated_mode(xwl_output, GetCurrentClient(), mode, FALSE); -+ -+ /* A real randr implementation would call: -+ * RRCrtcNotify(xwl_output->randr_crtc, mode, xwl_output->x, xwl_output->y, -+ * xwl_output->rotation, NULL, 1, &xwl_output->randr_output); -+ * here to update the mode reported to clients querying the randr settings -+ * but that influences *all* clients and we do randr mode change emulation -+ * on a per client basis. So we just return success here. -+ */ -+ -+ return TRUE; - } - - static Bool -diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index f422cfc29..87870a5f1 100644 ---- a/hw/xwayland/xwayland.c -+++ b/hw/xwayland/xwayland.c -@@ -178,6 +178,23 @@ xwl_screen_has_resolution_change_emulation(struct xwl_screen *xwl_screen) - return xwl_screen->rootless && xwl_screen_has_viewport_support(xwl_screen); - } - -+/* Return the output @ 0x0, falling back to the first output in the list */ -+struct xwl_output * -+xwl_screen_get_first_output(struct xwl_screen *xwl_screen) -+{ -+ struct xwl_output *xwl_output; -+ -+ xorg_list_for_each_entry(xwl_output, &xwl_screen->output_list, link) { -+ if (xwl_output->x == 0 && xwl_output->y == 0) -+ return xwl_output; -+ } -+ -+ if (xorg_list_is_empty(&xwl_screen->output_list)) -+ return NULL; -+ -+ return xorg_list_first_entry(&xwl_screen->output_list, struct xwl_output, link); -+} -+ - static void - xwl_window_set_allow_commits(struct xwl_window *xwl_window, Bool allow, - const char *debug_msg) -@@ -501,6 +518,150 @@ xwl_pixmap_get(PixmapPtr pixmap) - return dixLookupPrivate(&pixmap->devPrivates, &xwl_pixmap_private_key); - } - -+Bool -+xwl_window_has_viewport_enabled(struct xwl_window *xwl_window) -+{ -+ return (xwl_window->viewport != NULL); -+} -+ -+static void -+xwl_window_disable_viewport(struct xwl_window *xwl_window) -+{ -+ assert (xwl_window->viewport); -+ -+ DebugF("XWAYLAND: disabling viewport\n"); -+ wp_viewport_destroy(xwl_window->viewport); -+ xwl_window->viewport = NULL; -+} -+ -+static void -+xwl_window_enable_viewport(struct xwl_window *xwl_window, -+ struct xwl_output *xwl_output, -+ struct xwl_emulated_mode *emulated_mode) -+{ -+ /* If necessary disable old viewport to apply new settings */ -+ if (xwl_window_has_viewport_enabled(xwl_window)) -+ xwl_window_disable_viewport(xwl_window); -+ -+ DebugF("XWAYLAND: enabling viewport %dx%d -> %dx%d\n", -+ emulated_mode->width, emulated_mode->height, -+ xwl_output->width, xwl_output->height); -+ -+ xwl_window->viewport = -+ wp_viewporter_get_viewport(xwl_window->xwl_screen->viewporter, -+ xwl_window->surface); -+ -+ wp_viewport_set_source(xwl_window->viewport, -+ wl_fixed_from_int(0), -+ wl_fixed_from_int(0), -+ wl_fixed_from_int(emulated_mode->width), -+ wl_fixed_from_int(emulated_mode->height)); -+ wp_viewport_set_destination(xwl_window->viewport, -+ xwl_output->width, -+ xwl_output->height); -+ -+ xwl_window->scale_x = (float)emulated_mode->width / xwl_output->width; -+ xwl_window->scale_y = (float)emulated_mode->height / xwl_output->height; -+} -+ -+static Bool -+xwl_screen_client_is_window_manager(struct xwl_screen *xwl_screen, -+ ClientPtr client) -+{ -+ WindowPtr root = xwl_screen->screen->root; -+ OtherClients *others; -+ -+ for (others = wOtherClients(root); others; others = others->next) { -+ if (SameClient(others, client)) { -+ if (others->mask & (SubstructureRedirectMask | ResizeRedirectMask)) -+ return TRUE; -+ } -+ } -+ -+ return FALSE; -+} -+ -+static ClientPtr -+xwl_window_get_owner(struct xwl_window *xwl_window) -+{ -+ WindowPtr window = xwl_window->window; -+ ClientPtr client = wClient(window); -+ -+ /* If the toplevel window is owned by the window-manager, then the -+ * actual client toplevel window has been reparented to a window-manager -+ * decoration window. In that case return the client of the -+ * first *and only* child of the toplevel (decoration) window. -+ */ -+ if (xwl_screen_client_is_window_manager(xwl_window->xwl_screen, client)) { -+ if (window->firstChild && window->firstChild == window->lastChild) -+ return wClient(window->firstChild); -+ else -+ return NULL; /* Should never happen, skip resolution emulation */ -+ } -+ -+ return client; -+} -+ -+static Bool -+xwl_window_should_enable_viewport(struct xwl_window *xwl_window, -+ struct xwl_output **xwl_output_ret, -+ struct xwl_emulated_mode **emulated_mode_ret) -+{ -+ struct xwl_screen *xwl_screen = xwl_window->xwl_screen; -+ struct xwl_emulated_mode *emulated_mode; -+ struct xwl_output *xwl_output; -+ ClientPtr owner; -+ -+ if (!xwl_screen_has_resolution_change_emulation(xwl_screen)) -+ return FALSE; -+ -+ owner = xwl_window_get_owner(xwl_window); -+ if (!owner) -+ return FALSE; -+ -+ /* 1. Test if the window matches the emulated mode on one of the outputs -+ * This path gets hit by most games / libs (e.g. SDL, SFML, OGRE) -+ */ -+ xorg_list_for_each_entry(xwl_output, &xwl_screen->output_list, link) { -+ emulated_mode = xwl_output_get_emulated_mode_for_client(xwl_output, owner); -+ if (!emulated_mode) -+ continue; -+ -+ if (xwl_window->x == xwl_output->x && -+ xwl_window->y == xwl_output->y && -+ xwl_window->width == emulated_mode->width && -+ xwl_window->height == emulated_mode->height) { -+ -+ *emulated_mode_ret = emulated_mode; -+ *xwl_output_ret = xwl_output; -+ return TRUE; -+ } -+ } -+ -+ return FALSE; -+} -+ -+static void -+xwl_window_check_resolution_change_emulation(struct xwl_window *xwl_window) -+{ -+ struct xwl_emulated_mode *emulated_mode; -+ struct xwl_output *xwl_output; -+ -+ if (xwl_window_should_enable_viewport(xwl_window, &xwl_output, &emulated_mode)) -+ xwl_window_enable_viewport(xwl_window, xwl_output, emulated_mode); -+ else if (xwl_window_has_viewport_enabled(xwl_window)) -+ xwl_window_disable_viewport(xwl_window); -+} -+ -+void -+xwl_screen_check_resolution_change_emulation(struct xwl_screen *xwl_screen) -+{ -+ struct xwl_window *xwl_window; -+ -+ xorg_list_for_each_entry(xwl_window, &xwl_screen->window_list, link_window) -+ xwl_window_check_resolution_change_emulation(xwl_window); -+} -+ - static void - xwl_window_init_allow_commits(struct xwl_window *xwl_window) - { -@@ -571,6 +732,8 @@ ensure_surface_for_window(WindowPtr window) - - xwl_window->xwl_screen = xwl_screen; - xwl_window->window = window; -+ xwl_window->width = window->drawable.width; -+ xwl_window->height = window->drawable.height; - xwl_window->surface = wl_compositor_create_surface(xwl_screen->compositor); - if (xwl_window->surface == NULL) { - ErrorF("wl_display_create_surface failed\n"); -@@ -612,6 +775,7 @@ ensure_surface_for_window(WindowPtr window) - - dixSetPrivate(&window->devPrivates, &xwl_window_private_key, xwl_window); - xorg_list_init(&xwl_window->link_damage); -+ xorg_list_add(&xwl_window->link_window, &xwl_screen->window_list); - - #ifdef GLAMOR_HAS_GBM - xorg_list_init(&xwl_window->frame_callback_list); -@@ -705,8 +869,12 @@ xwl_unrealize_window(WindowPtr window) - if (!xwl_window) - return ret; - -+ if (xwl_window_has_viewport_enabled(xwl_window)) -+ xwl_window_disable_viewport(xwl_window); -+ - wl_surface_destroy(xwl_window->surface); - xorg_list_del(&xwl_window->link_damage); -+ xorg_list_del(&xwl_window->link_window); - unregister_damage(window); - - if (xwl_window->frame_callback) -@@ -756,6 +924,33 @@ xwl_set_window_pixmap(WindowPtr window, - ensure_surface_for_window(window); - } - -+static void -+xwl_resize_window(WindowPtr window, -+ int x, int y, -+ unsigned int width, unsigned int height, -+ WindowPtr sib) -+{ -+ ScreenPtr screen = window->drawable.pScreen; -+ struct xwl_screen *xwl_screen; -+ struct xwl_window *xwl_window; -+ -+ xwl_screen = xwl_screen_get(screen); -+ xwl_window = xwl_window_get(window); -+ -+ screen->ResizeWindow = xwl_screen->ResizeWindow; -+ (*screen->ResizeWindow) (window, x, y, width, height, sib); -+ xwl_screen->ResizeWindow = screen->ResizeWindow; -+ screen->ResizeWindow = xwl_resize_window; -+ -+ if (xwl_window) { -+ xwl_window->x = x; -+ xwl_window->y = y; -+ xwl_window->width = width; -+ xwl_window->height = height; -+ xwl_window_check_resolution_change_emulation(xwl_window); -+ } -+} -+ - static void - frame_callback(void *data, - struct wl_callback *callback, -@@ -1233,6 +1428,7 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) - xorg_list_init(&xwl_screen->output_list); - xorg_list_init(&xwl_screen->seat_list); - xorg_list_init(&xwl_screen->damage_window_list); -+ xorg_list_init(&xwl_screen->window_list); - xwl_screen->depth = 24; - - if (!monitorResolution) -@@ -1332,6 +1528,9 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) - xwl_screen->CloseScreen = pScreen->CloseScreen; - pScreen->CloseScreen = xwl_close_screen; - -+ xwl_screen->ResizeWindow = pScreen->ResizeWindow; -+ pScreen->ResizeWindow = xwl_resize_window; -+ - if (xwl_screen->rootless) { - xwl_screen->SetWindowPixmap = pScreen->SetWindowPixmap; - pScreen->SetWindowPixmap = xwl_set_window_pixmap; -diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h -index c886d77e9..36c4c4c8b 100644 ---- a/hw/xwayland/xwayland.h -+++ b/hw/xwayland/xwayland.h -@@ -135,10 +135,12 @@ struct xwl_screen { - DestroyWindowProcPtr DestroyWindow; - XYToWindowProcPtr XYToWindow; - SetWindowPixmapProcPtr SetWindowPixmap; -+ ResizeWindowProcPtr ResizeWindow; - - struct xorg_list output_list; - struct xorg_list seat_list; - struct xorg_list damage_window_list; -+ struct xorg_list window_list; - - int wayland_fd; - struct wl_display *display; -@@ -179,9 +181,13 @@ struct xwl_screen { - struct xwl_window { - struct xwl_screen *xwl_screen; - struct wl_surface *surface; -+ struct wp_viewport *viewport; -+ int32_t x, y, width, height; -+ float scale_x, scale_y; - struct wl_shell_surface *shell_surface; - WindowPtr window; - struct xorg_list link_damage; -+ struct xorg_list link_window; - struct wl_callback *frame_callback; - Bool allow_commits; - #ifdef GLAMOR_HAS_GBM -@@ -411,6 +417,9 @@ Bool xwl_screen_init_cursor(struct xwl_screen *xwl_screen); - - struct xwl_screen *xwl_screen_get(ScreenPtr screen); - Bool xwl_screen_has_resolution_change_emulation(struct xwl_screen *xwl_screen); -+struct xwl_output *xwl_screen_get_first_output(struct xwl_screen *xwl_screen); -+void xwl_screen_check_resolution_change_emulation(struct xwl_screen *xwl_screen); -+Bool xwl_window_has_viewport_enabled(struct xwl_window *xwl_window); - - void xwl_tablet_tool_set_cursor(struct xwl_tablet_tool *tool); - void xwl_seat_set_cursor(struct xwl_seat *xwl_seat); -@@ -444,6 +453,12 @@ void xwl_output_remove(struct xwl_output *xwl_output); - struct xwl_emulated_mode *xwl_output_get_emulated_mode_for_client( - struct xwl_output *xwl_output, ClientPtr client); - -+RRModePtr xwl_output_find_mode(struct xwl_output *xwl_output, -+ int32_t width, int32_t height); -+void xwl_output_set_emulated_mode(struct xwl_output *xwl_output, -+ ClientPtr client, RRModePtr mode, -+ Bool from_vidmode); -+ - RRModePtr xwayland_cvt(int HDisplay, int VDisplay, - float VRefresh, Bool Reduced, Bool Interlaced); - --- -2.28.0 - diff --git a/0009-xwayland-Add-xwlRRModeToDisplayMode-helper-function.patch b/0009-xwayland-Add-xwlRRModeToDisplayMode-helper-function.patch deleted file mode 100644 index 1d29960..0000000 --- a/0009-xwayland-Add-xwlRRModeToDisplayMode-helper-function.patch +++ /dev/null @@ -1,101 +0,0 @@ -From aedd71a61ac2d78c347180e7d87e5918b795609e Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Mon, 8 Jul 2019 14:00:27 +0200 -Subject: [PATCH xserver 09/25] xwayland: Add xwlRRModeToDisplayMode() helper - function -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -This is a preparation patch for adding emulated mode/resolution change -support to Xwayland's XF86 vidmode extension emulation, using the -Wayland viewport extension. - -Reviewed-by: Olivier Fourdan -Acked-by: Michel Dänzer -Signed-off-by: Hans de Goede -(cherry picked from commit 43c80078126f6f33c6ab7d3cf4668733bde03366) ---- - hw/xwayland/xwayland-vidmode.c | 51 +++++++++++++++++++--------------- - 1 file changed, 28 insertions(+), 23 deletions(-) - -diff --git a/hw/xwayland/xwayland-vidmode.c b/hw/xwayland/xwayland-vidmode.c -index d25d1aca1..428af716d 100644 ---- a/hw/xwayland/xwayland-vidmode.c -+++ b/hw/xwayland/xwayland-vidmode.c -@@ -78,13 +78,37 @@ mode_refresh(const xRRModeInfo *mode_info) - return rate; - } - -+static void -+xwlRRModeToDisplayMode(RRModePtr rrmode, DisplayModePtr mode) -+{ -+ const xRRModeInfo *mode_info = &rrmode->mode; -+ -+ mode->next = mode; -+ mode->prev = mode; -+ mode->name = ""; -+ mode->VScan = 1; -+ mode->Private = NULL; -+ mode->HDisplay = mode_info->width; -+ mode->HSyncStart = mode_info->hSyncStart; -+ mode->HSyncEnd = mode_info->hSyncEnd; -+ mode->HTotal = mode_info->hTotal; -+ mode->HSkew = mode_info->hSkew; -+ mode->VDisplay = mode_info->height; -+ mode->VSyncStart = mode_info->vSyncStart; -+ mode->VSyncEnd = mode_info->vSyncEnd; -+ mode->VTotal = mode_info->vTotal; -+ mode->Flags = mode_info->modeFlags; -+ mode->Clock = mode_info->dotClock / 1000.0; -+ mode->VRefresh = mode_refresh(mode_info); /* Or RRVerticalRefresh() */ -+ mode->HSync = mode_hsync(mode_info); -+} -+ - static Bool - xwlVidModeGetCurrentModeline(ScreenPtr pScreen, DisplayModePtr *mode, int *dotClock) - { - DisplayModePtr pMod; - RROutputPtr output; - RRCrtcPtr crtc; -- xRRModeInfo rrmode; - - pMod = dixLookupPrivate(&pScreen->devPrivates, xwlVidModePrivateKey); - if (pMod == NULL) -@@ -98,30 +122,11 @@ xwlVidModeGetCurrentModeline(ScreenPtr pScreen, DisplayModePtr *mode, int *dotCl - if (crtc == NULL) - return FALSE; - -- rrmode = crtc->mode->mode; -- -- pMod->next = pMod; -- pMod->prev = pMod; -- pMod->name = ""; -- pMod->VScan = 1; -- pMod->Private = NULL; -- pMod->HDisplay = rrmode.width; -- pMod->HSyncStart = rrmode.hSyncStart; -- pMod->HSyncEnd = rrmode.hSyncEnd; -- pMod->HTotal = rrmode.hTotal; -- pMod->HSkew = rrmode.hSkew; -- pMod->VDisplay = rrmode.height; -- pMod->VSyncStart = rrmode.vSyncStart; -- pMod->VSyncEnd = rrmode.vSyncEnd; -- pMod->VTotal = rrmode.vTotal; -- pMod->Flags = rrmode.modeFlags; -- pMod->Clock = rrmode.dotClock / 1000.0; -- pMod->VRefresh = mode_refresh(&rrmode); /* Or RRVerticalRefresh() */ -- pMod->HSync = mode_hsync(&rrmode); -- *mode = pMod; -+ xwlRRModeToDisplayMode(crtc->mode, pMod); - -+ *mode = pMod; - if (dotClock != NULL) -- *dotClock = rrmode.dotClock / 1000.0; -+ *dotClock = pMod->Clock; - - return TRUE; - } --- -2.28.0 - diff --git a/0010-xwayland-Add-xwlVidModeGetCurrentRRMode-helper-to-th.patch b/0010-xwayland-Add-xwlVidModeGetCurrentRRMode-helper-to-th.patch deleted file mode 100644 index ea1f6c4..0000000 --- a/0010-xwayland-Add-xwlVidModeGetCurrentRRMode-helper-to-th.patch +++ /dev/null @@ -1,193 +0,0 @@ -From 719c1d2ef99784043883787d04afc0437f3a9b8f Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Mon, 8 Jul 2019 18:35:27 +0200 -Subject: [PATCH xserver 10/25] xwayland: Add xwlVidModeGetCurrentRRMode helper - to the vidmode code -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -crtc->mode reflects the mode set through the xrandr extension, once we -add support for also changing the mode through the vidmode extension this -will no longer correctly reflect the emulated resolution. - -Add a new xwlVidModeGetCurrentRRMode helper which determines the mode by -looking at the emulated_mode instead. - -Likewise add a xwlVidModeGetRRMode helper and use that in -xwlVidModeCheckModeForMonitor/xwlVidModeCheckModeForDriver to allow any -mode listed in the randr_output's mode list. - -This is a preparation patch for adding emulated mode/resolution change -support to Xwayland's XF86 vidmode extension emulation. - -Reviewed-by: Olivier Fourdan -Acked-by: Michel Dänzer -Signed-off-by: Hans de Goede -(cherry picked from commit bcad1b813a04b9f3ff225f57a4baad09bd6315b9) ---- - hw/xwayland/xwayland-vidmode.c | 90 +++++++++++++++++++++------------- - 1 file changed, 56 insertions(+), 34 deletions(-) - -diff --git a/hw/xwayland/xwayland-vidmode.c b/hw/xwayland/xwayland-vidmode.c -index 428af716d..7cf982fcc 100644 ---- a/hw/xwayland/xwayland-vidmode.c -+++ b/hw/xwayland/xwayland-vidmode.c -@@ -103,26 +103,56 @@ xwlRRModeToDisplayMode(RRModePtr rrmode, DisplayModePtr mode) - mode->HSync = mode_hsync(mode_info); - } - -+static RRModePtr -+xwlVidModeGetRRMode(ScreenPtr pScreen, int32_t width, int32_t height) -+{ -+ RROutputPtr output = RRFirstOutput(pScreen); -+ -+ if (output == NULL) -+ return NULL; -+ -+ return xwl_output_find_mode(output->devPrivate, width, height); -+} -+ -+static RRModePtr -+xwlVidModeGetCurrentRRMode(ScreenPtr pScreen) -+{ -+ struct xwl_emulated_mode *emulated_mode; -+ struct xwl_output *xwl_output; -+ RROutputPtr output; -+ -+ output = RRFirstOutput(pScreen); -+ if (output == NULL) -+ return NULL; -+ -+ xwl_output = output->devPrivate; -+ emulated_mode = -+ xwl_output_get_emulated_mode_for_client(xwl_output, GetCurrentClient()); -+ -+ if (emulated_mode) { -+ return xwl_output_find_mode(xwl_output, -+ emulated_mode->width, -+ emulated_mode->height); -+ } else { -+ return xwl_output_find_mode(xwl_output, -1, -1); -+ } -+} -+ - static Bool - xwlVidModeGetCurrentModeline(ScreenPtr pScreen, DisplayModePtr *mode, int *dotClock) - { - DisplayModePtr pMod; -- RROutputPtr output; -- RRCrtcPtr crtc; -+ RRModePtr rrmode; - - pMod = dixLookupPrivate(&pScreen->devPrivates, xwlVidModePrivateKey); - if (pMod == NULL) - return FALSE; - -- output = RRFirstOutput(pScreen); -- if (output == NULL) -- return FALSE; -- -- crtc = output->crtc; -- if (crtc == NULL) -+ rrmode = xwlVidModeGetCurrentRRMode(pScreen); -+ if (rrmode == NULL) - return FALSE; - -- xwlRRModeToDisplayMode(crtc->mode, pMod); -+ xwlRRModeToDisplayMode(rrmode, pMod); - - *mode = pMod; - if (dotClock != NULL) -@@ -135,9 +165,10 @@ static vidMonitorValue - xwlVidModeGetMonitorValue(ScreenPtr pScreen, int valtyp, int indx) - { - vidMonitorValue ret = { NULL, }; -- DisplayModePtr pMod; -+ RRModePtr rrmode; - -- if (!xwlVidModeGetCurrentModeline(pScreen, &pMod, NULL)) -+ rrmode = xwlVidModeGetCurrentRRMode(pScreen); -+ if (rrmode == NULL) - return ret; - - switch (valtyp) { -@@ -155,11 +186,11 @@ xwlVidModeGetMonitorValue(ScreenPtr pScreen, int valtyp, int indx) - break; - case VIDMODE_MON_HSYNC_LO: - case VIDMODE_MON_HSYNC_HI: -- ret.f = 100.0 * pMod->HSync; -+ ret.f = mode_hsync(&rrmode->mode) * 100.0; - break; - case VIDMODE_MON_VREFRESH_LO: - case VIDMODE_MON_VREFRESH_HI: -- ret.f = 100.0 * pMod->VRefresh; -+ ret.f = mode_refresh(&rrmode->mode) * 100.0; - break; - } - return ret; -@@ -168,13 +199,13 @@ xwlVidModeGetMonitorValue(ScreenPtr pScreen, int valtyp, int indx) - static int - xwlVidModeGetDotClock(ScreenPtr pScreen, int Clock) - { -- DisplayModePtr pMod; -+ RRModePtr rrmode; - -- if (!xwlVidModeGetCurrentModeline(pScreen, &pMod, NULL)) -+ rrmode = xwlVidModeGetCurrentRRMode(pScreen); -+ if (rrmode == NULL) - return 0; - -- return pMod->Clock; -- -+ return rrmode->mode.dotClock / 1000.0; - } - - static int -@@ -272,14 +303,15 @@ xwlVidModeLockZoom(ScreenPtr pScreen, Bool lock) - static ModeStatus - xwlVidModeCheckModeForMonitor(ScreenPtr pScreen, DisplayModePtr mode) - { -- DisplayModePtr pMod; -+ RRModePtr rrmode; - -- /* This should not happen */ -- if (!xwlVidModeGetCurrentModeline(pScreen, &pMod, NULL)) -+ rrmode = xwlVidModeGetRRMode(pScreen, mode->HDisplay, mode->VDisplay); -+ if (rrmode == NULL) - return MODE_ERROR; - - /* Only support mode with the same HSync/VRefresh as we advertise */ -- if (mode->HSync == pMod->HSync && mode->VRefresh == pMod->VRefresh) -+ if (mode->HSync == mode_hsync(&rrmode->mode) && -+ mode->VRefresh == mode_refresh(&rrmode->mode)) - return MODE_OK; - - /* All the rest is unsupported - If we want to succeed, return MODE_OK instead */ -@@ -289,20 +321,10 @@ xwlVidModeCheckModeForMonitor(ScreenPtr pScreen, DisplayModePtr mode) - static ModeStatus - xwlVidModeCheckModeForDriver(ScreenPtr pScreen, DisplayModePtr mode) - { -- DisplayModePtr pMod; -- -- /* This should not happen */ -- if (!xwlVidModeGetCurrentModeline(pScreen, &pMod, NULL)) -- return MODE_ERROR; -- -- if (mode->HTotal != pMod->HTotal) -- return MODE_BAD_HVALUE; -+ RRModePtr rrmode; - -- if (mode->VTotal != pMod->VTotal) -- return MODE_BAD_VVALUE; -- -- /* Unsupported for now, but pretend it works */ -- return MODE_OK; -+ rrmode = xwlVidModeGetRRMode(pScreen, mode->HDisplay, mode->VDisplay); -+ return rrmode ? MODE_OK : MODE_ERROR; - } - - static void --- -2.28.0 - diff --git a/0011-xwayland-Add-vidmode-mode-changing-emulation-support.patch b/0011-xwayland-Add-vidmode-mode-changing-emulation-support.patch deleted file mode 100644 index f3df892..0000000 --- a/0011-xwayland-Add-vidmode-mode-changing-emulation-support.patch +++ /dev/null @@ -1,236 +0,0 @@ -From 98e6cadf2ba8490c303cdc94106baf3f31006299 Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Tue, 9 Jul 2019 09:31:13 +0200 -Subject: [PATCH xserver 11/25] xwayland: Add vidmode mode changing emulation - support -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Add support for fake mode changes using viewport, for apps which want to -change the resolution when going fullscreen. - -Reviewed-by: Olivier Fourdan -Acked-by: Michel Dänzer -Signed-off-by: Hans de Goede -(cherry picked from commit 38de6260816674b5430144cc38a8a27d93d1bf19) ---- - hw/xwayland/xwayland-vidmode.c | 130 ++++++++++++++++++++++----------- - 1 file changed, 86 insertions(+), 44 deletions(-) - -diff --git a/hw/xwayland/xwayland-vidmode.c b/hw/xwayland/xwayland-vidmode.c -index 7cf982fcc..99a4d2c92 100644 ---- a/hw/xwayland/xwayland-vidmode.c -+++ b/hw/xwayland/xwayland-vidmode.c -@@ -106,26 +106,25 @@ xwlRRModeToDisplayMode(RRModePtr rrmode, DisplayModePtr mode) - static RRModePtr - xwlVidModeGetRRMode(ScreenPtr pScreen, int32_t width, int32_t height) - { -- RROutputPtr output = RRFirstOutput(pScreen); -+ struct xwl_screen *xwl_screen = xwl_screen_get(pScreen); -+ struct xwl_output *xwl_output = xwl_screen_get_first_output(xwl_screen); - -- if (output == NULL) -+ if (!xwl_output) - return NULL; - -- return xwl_output_find_mode(output->devPrivate, width, height); -+ return xwl_output_find_mode(xwl_output, width, height); - } - - static RRModePtr - xwlVidModeGetCurrentRRMode(ScreenPtr pScreen) - { -+ struct xwl_screen *xwl_screen = xwl_screen_get(pScreen); -+ struct xwl_output *xwl_output = xwl_screen_get_first_output(xwl_screen); - struct xwl_emulated_mode *emulated_mode; -- struct xwl_output *xwl_output; -- RROutputPtr output; - -- output = RRFirstOutput(pScreen); -- if (output == NULL) -+ if (!xwl_output) - return NULL; - -- xwl_output = output->devPrivate; - emulated_mode = - xwl_output_get_emulated_mode_for_client(xwl_output, GetCurrentClient()); - -@@ -199,39 +198,79 @@ xwlVidModeGetMonitorValue(ScreenPtr pScreen, int valtyp, int indx) - static int - xwlVidModeGetDotClock(ScreenPtr pScreen, int Clock) - { -- RRModePtr rrmode; -- -- rrmode = xwlVidModeGetCurrentRRMode(pScreen); -- if (rrmode == NULL) -- return 0; -- -- return rrmode->mode.dotClock / 1000.0; -+ return Clock; - } - - static int - xwlVidModeGetNumOfClocks(ScreenPtr pScreen, Bool *progClock) - { -- return 1; -+ /* We emulate a programmable clock, rather then a fixed set of clocks */ -+ *progClock = TRUE; -+ return 0; - } - - static Bool - xwlVidModeGetClocks(ScreenPtr pScreen, int *Clocks) - { -- *Clocks = xwlVidModeGetDotClock(pScreen, 0); -- -- return TRUE; -+ return FALSE; /* Programmable clock, no clock list */ - } - -+/* GetFirstModeline and GetNextModeline are used from Xext/vidmode.c like this: -+ * if (pVidMode->GetFirstModeline(pScreen, &mode, &dotClock)) { -+ * do { -+ * ... -+ * if (...) -+ * break; -+ * } while (pVidMode->GetNextModeline(pScreen, &mode, &dotClock)); -+ * } -+ * IOW our caller basically always loops over all the modes. There never is a -+ * return to the mainloop between GetFirstModeline and NextModeline calls where -+ * other parts of the server may change our state so we do not need to worry -+ * about xwl_output->randr_output->modes changing underneath us. -+ * Thus we can simply implement these two callbacks by storing the enumeration -+ * index in pVidMode->Next. -+ */ -+ - static Bool - xwlVidModeGetNextModeline(ScreenPtr pScreen, DisplayModePtr *mode, int *dotClock) - { -- return FALSE; -+ struct xwl_screen *xwl_screen = xwl_screen_get(pScreen); -+ struct xwl_output *xwl_output = xwl_screen_get_first_output(xwl_screen); -+ VidModePtr pVidMode; -+ DisplayModePtr pMod; -+ intptr_t index; -+ -+ pMod = dixLookupPrivate(&pScreen->devPrivates, xwlVidModePrivateKey); -+ pVidMode = VidModeGetPtr(pScreen); -+ if (xwl_output == NULL || pMod == NULL || pVidMode == NULL) -+ return FALSE; -+ -+ index = (intptr_t)pVidMode->Next; -+ if (index >= xwl_output->randr_output->numModes) -+ return FALSE; -+ xwlRRModeToDisplayMode(xwl_output->randr_output->modes[index], pMod); -+ index++; -+ pVidMode->Next = (void *)index; -+ -+ *mode = pMod; -+ if (dotClock != NULL) -+ *dotClock = pMod->Clock; -+ -+ return TRUE; - } - - static Bool - xwlVidModeGetFirstModeline(ScreenPtr pScreen, DisplayModePtr *mode, int *dotClock) - { -- return xwlVidModeGetCurrentModeline(pScreen, mode, dotClock); -+ VidModePtr pVidMode; -+ intptr_t index = 0; -+ -+ pVidMode = VidModeGetPtr(pScreen); -+ if (pVidMode == NULL) -+ return FALSE; -+ -+ pVidMode->Next = (void *)index; /* 0 */ -+ return xwlVidModeGetNextModeline(pScreen, mode, dotClock); - } - - static Bool -@@ -251,37 +290,27 @@ xwlVidModeZoomViewport(ScreenPtr pScreen, int zoom) - static Bool - xwlVidModeSetViewPort(ScreenPtr pScreen, int x, int y) - { -- RROutputPtr output; -- RRCrtcPtr crtc; -+ struct xwl_screen *xwl_screen = xwl_screen_get(pScreen); -+ struct xwl_output *xwl_output = xwl_screen_get_first_output(xwl_screen); - -- output = RRFirstOutput(pScreen); -- if (output == NULL) -- return FALSE; -- -- crtc = output->crtc; -- if (crtc == NULL) -+ if (!xwl_output) - return FALSE; - - /* Support only default viewport */ -- return (x == crtc->x && y == crtc->y); -+ return (x == xwl_output->x && y == xwl_output->y); - } - - static Bool - xwlVidModeGetViewPort(ScreenPtr pScreen, int *x, int *y) - { -- RROutputPtr output; -- RRCrtcPtr crtc; -+ struct xwl_screen *xwl_screen = xwl_screen_get(pScreen); -+ struct xwl_output *xwl_output = xwl_screen_get_first_output(xwl_screen); - -- output = RRFirstOutput(pScreen); -- if (output == NULL) -+ if (!xwl_output) - return FALSE; - -- crtc = output->crtc; -- if (crtc == NULL) -- return FALSE; -- -- *x = crtc->x; -- *y = crtc->y; -+ *x = xwl_output->x; -+ *y = xwl_output->y; - - return TRUE; - } -@@ -289,8 +318,19 @@ xwlVidModeGetViewPort(ScreenPtr pScreen, int *x, int *y) - static Bool - xwlVidModeSwitchMode(ScreenPtr pScreen, DisplayModePtr mode) - { -- /* Unsupported for now */ -- return FALSE; -+ struct xwl_screen *xwl_screen = xwl_screen_get(pScreen); -+ struct xwl_output *xwl_output = xwl_screen_get_first_output(xwl_screen); -+ RRModePtr rrmode; -+ -+ if (!xwl_output) -+ return FALSE; -+ -+ rrmode = xwl_output_find_mode(xwl_output, mode->HDisplay, mode->VDisplay); -+ if (rrmode == NULL) -+ return FALSE; -+ -+ xwl_output_set_emulated_mode(xwl_output, GetCurrentClient(), rrmode, TRUE); -+ return TRUE; - } - - static Bool -@@ -344,8 +384,10 @@ xwlVidModeAddModeline(ScreenPtr pScreen, DisplayModePtr mode) - static int - xwlVidModeGetNumOfModes(ScreenPtr pScreen) - { -- /* We have only one mode */ -- return 1; -+ struct xwl_screen *xwl_screen = xwl_screen_get(pScreen); -+ struct xwl_output *xwl_output = xwl_screen_get_first_output(xwl_screen); -+ -+ return xwl_output ? xwl_output->randr_output->numModes : 0; - } - - static Bool --- -2.28.0 - diff --git a/0012-xwayland-xwl_window_should_enable_viewport-Add-extra.patch b/0012-xwayland-xwl_window_should_enable_viewport-Add-extra.patch deleted file mode 100644 index 8b8ca1c..0000000 --- a/0012-xwayland-xwl_window_should_enable_viewport-Add-extra.patch +++ /dev/null @@ -1,57 +0,0 @@ -From 3d359d03573dee270b72f0cea1ea9061c2c886c3 Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Mon, 26 Aug 2019 12:26:34 +0200 -Subject: [PATCH xserver 12/25] xwayland: xwl_window_should_enable_viewport: - Add extra test -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Games based on the allegro gaming library or on ClanLib-1.0 do not size -their window to match the fullscreen resolution, instead they use a -window covering the entire screen, drawing only the fullscreen resolution -part of it. - -This commit adds a check for these games, so that we correctly apply a -viewport to them making fullscreen work properly for these games under -Xwayland. - -Reviewed-by: Olivier Fourdan -Acked-by: Michel Dänzer -Signed-off-by: Hans de Goede -(cherry picked from commit 0c305dbff8a44f3fa3d6aefd372a967029a7a527) ---- - hw/xwayland/xwayland.c | 17 +++++++++++++++++ - 1 file changed, 17 insertions(+) - -diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index 87870a5f1..9175396f7 100644 ---- a/hw/xwayland/xwayland.c -+++ b/hw/xwayland/xwayland.c -@@ -638,6 +638,23 @@ xwl_window_should_enable_viewport(struct xwl_window *xwl_window, - } - } - -+ /* 2. Test if the window uses override-redirect + vidmode -+ * and matches (fully covers) the entire screen. -+ * This path gets hit by: allegro4, ClanLib-1.0. -+ */ -+ xwl_output = xwl_screen_get_first_output(xwl_screen); -+ emulated_mode = xwl_output_get_emulated_mode_for_client(xwl_output, owner); -+ if (xwl_output && xwl_window->window->overrideRedirect && -+ emulated_mode && emulated_mode->from_vidmode && -+ xwl_window->x == 0 && xwl_window->y == 0 && -+ xwl_window->width == xwl_screen->width && -+ xwl_window->height == xwl_screen->height) { -+ -+ *emulated_mode_ret = emulated_mode; -+ *xwl_output_ret = xwl_output; -+ return TRUE; -+ } -+ - return FALSE; - } - --- -2.28.0 - diff --git a/0013-xwayland-Set-_XWAYLAND_RANDR_EMU_MONITOR_RECTS-prope.patch b/0013-xwayland-Set-_XWAYLAND_RANDR_EMU_MONITOR_RECTS-prope.patch deleted file mode 100644 index 7aef593..0000000 --- a/0013-xwayland-Set-_XWAYLAND_RANDR_EMU_MONITOR_RECTS-prope.patch +++ /dev/null @@ -1,205 +0,0 @@ -From 48bc25613f91b69d9ee68e8211f8bf22317aa40a Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Mon, 2 Sep 2019 17:32:45 +0200 -Subject: [PATCH xserver 13/25] xwayland: Set _XWAYLAND_RANDR_EMU_MONITOR_RECTS - property for resolution emulation -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Apps using randr to change the resolution when going fullscreen, in -combination with _NET_WM_STATE_FULLSCREEN to tell the window-manager (WM) -to make their window fullscreen, expect the WM to give the fullscreen window -the size of the emulated resolution as would happen when run under Xorg (*). - -We need the WM to emulate this behavior for these apps to work correctly, -with Xwaylands resolution change emulation. For the WM to emulate this, -it needs to know about the emulated resolution for the Windows owning -client for each monitor. - -This commit adds a _XWAYLAND_RANDR_EMU_MONITOR_RECTS property, which -contains 4 Cardinals (32 bit integers) per monitor with resolution -emulation info. Window-managers can use this to get the emulated -resolution for the client and size the window correctly. - -*) Since under Xorg the resolution will actually be changed and after that -going fullscreen through NET_WM_STATE_FULLSCREEN will size the window to -be equal to the new resolution. - -Reviewed-by: Olivier Fourdan -Acked-by: Michel Dänzer -Signed-off-by: Hans de Goede -(cherry picked from commit 5315f988d9f175e4850f4259f691a68d95ce7ac2) ---- - hw/xwayland/xwayland-output.c | 77 +++++++++++++++++++++++++++++++++++ - hw/xwayland/xwayland.c | 23 +++++++++++ - hw/xwayland/xwayland.h | 3 ++ - 3 files changed, 103 insertions(+) - -diff --git a/hw/xwayland/xwayland-output.c b/hw/xwayland/xwayland-output.c -index e09d00108..0d6b9ac9f 100644 ---- a/hw/xwayland/xwayland-output.c -+++ b/hw/xwayland/xwayland-output.c -@@ -29,6 +29,7 @@ - - #include "xwayland.h" - #include -+#include - - #define ALL_ROTATIONS (RR_Rotate_0 | \ - RR_Rotate_90 | \ -@@ -391,6 +392,80 @@ xwl_output_find_mode(struct xwl_output *xwl_output, - return NULL; - } - -+struct xwl_output_randr_emu_prop { -+ Atom atom; -+ uint32_t rects[XWL_CLIENT_MAX_EMULATED_MODES][4]; -+ int rect_count; -+}; -+ -+static void -+xwl_output_randr_emu_prop(struct xwl_screen *xwl_screen, ClientPtr client, -+ struct xwl_output_randr_emu_prop *prop) -+{ -+ static const char atom_name[] = "_XWAYLAND_RANDR_EMU_MONITOR_RECTS"; -+ struct xwl_emulated_mode *emulated_mode; -+ struct xwl_output *xwl_output; -+ int index = 0; -+ -+ prop->atom = MakeAtom(atom_name, strlen(atom_name), TRUE); -+ -+ xorg_list_for_each_entry(xwl_output, &xwl_screen->output_list, link) { -+ emulated_mode = xwl_output_get_emulated_mode_for_client(xwl_output, client); -+ if (!emulated_mode) -+ continue; -+ -+ prop->rects[index][0] = xwl_output->x; -+ prop->rects[index][1] = xwl_output->y; -+ prop->rects[index][2] = emulated_mode->width; -+ prop->rects[index][3] = emulated_mode->height; -+ index++; -+ } -+ -+ prop->rect_count = index; -+} -+ -+static void -+xwl_output_set_randr_emu_prop(WindowPtr window, -+ struct xwl_output_randr_emu_prop *prop) -+{ -+ if (!xwl_window_is_toplevel(window)) -+ return; -+ -+ if (prop->rect_count) { -+ dixChangeWindowProperty(serverClient, window, prop->atom, -+ XA_CARDINAL, 32, PropModeReplace, -+ prop->rect_count * 4, prop->rects, TRUE); -+ } else { -+ DeleteProperty(serverClient, window, prop->atom); -+ } -+} -+ -+static void -+xwl_output_set_randr_emu_prop_callback(void *resource, XID id, void *user_data) -+{ -+ xwl_output_set_randr_emu_prop(resource, user_data); -+} -+ -+static void -+xwl_output_set_randr_emu_props(struct xwl_screen *xwl_screen, ClientPtr client) -+{ -+ struct xwl_output_randr_emu_prop prop = {}; -+ -+ xwl_output_randr_emu_prop(xwl_screen, client, &prop); -+ FindClientResourcesByType(client, RT_WINDOW, -+ xwl_output_set_randr_emu_prop_callback, &prop); -+} -+ -+void -+xwl_output_set_window_randr_emu_props(struct xwl_screen *xwl_screen, -+ WindowPtr window) -+{ -+ struct xwl_output_randr_emu_prop prop = {}; -+ -+ xwl_output_randr_emu_prop(xwl_screen, wClient(window), &prop); -+ xwl_output_set_randr_emu_prop(window, &prop); -+} -+ - void - xwl_output_set_emulated_mode(struct xwl_output *xwl_output, ClientPtr client, - RRModePtr mode, Bool from_vidmode) -@@ -405,6 +480,8 @@ xwl_output_set_emulated_mode(struct xwl_output *xwl_output, ClientPtr client, - xwl_output_add_emulated_mode_for_client(xwl_output, client, mode, from_vidmode); - - xwl_screen_check_resolution_change_emulation(xwl_output->xwl_screen); -+ -+ xwl_output_set_randr_emu_props(xwl_output->xwl_screen, client); - } - - static void -diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index 9175396f7..32442d88e 100644 ---- a/hw/xwayland/xwayland.c -+++ b/hw/xwayland/xwayland.c -@@ -679,6 +679,27 @@ xwl_screen_check_resolution_change_emulation(struct xwl_screen *xwl_screen) - xwl_window_check_resolution_change_emulation(xwl_window); - } - -+/* This checks if the passed in Window is a toplevel client window, note this -+ * returns false for window-manager decoration windows and returns true for -+ * the actual client top-level window even if it has been reparented to -+ * a window-manager decoration window. -+ */ -+Bool -+xwl_window_is_toplevel(WindowPtr window) -+{ -+ struct xwl_screen *xwl_screen = xwl_screen_get(window->drawable.pScreen); -+ -+ if (xwl_screen_client_is_window_manager(xwl_screen, wClient(window))) -+ return FALSE; -+ -+ /* CSD and override-redirect toplevel windows */ -+ if (window_get_damage(window)) -+ return TRUE; -+ -+ /* Normal toplevel client windows, reparented to decoration window */ -+ return (window->parent && window_get_damage(window->parent)); -+} -+ - static void - xwl_window_init_allow_commits(struct xwl_window *xwl_window) - { -@@ -844,6 +865,8 @@ xwl_realize_window(WindowPtr window) - return FALSE; - } - -+ xwl_output_set_window_randr_emu_props(xwl_screen, window); -+ - return ensure_surface_for_window(window); - } - -diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h -index 36c4c4c8b..1317ae5bb 100644 ---- a/hw/xwayland/xwayland.h -+++ b/hw/xwayland/xwayland.h -@@ -420,6 +420,7 @@ Bool xwl_screen_has_resolution_change_emulation(struct xwl_screen *xwl_screen); - struct xwl_output *xwl_screen_get_first_output(struct xwl_screen *xwl_screen); - void xwl_screen_check_resolution_change_emulation(struct xwl_screen *xwl_screen); - Bool xwl_window_has_viewport_enabled(struct xwl_window *xwl_window); -+Bool xwl_window_is_toplevel(WindowPtr window); - - void xwl_tablet_tool_set_cursor(struct xwl_tablet_tool *tool); - void xwl_seat_set_cursor(struct xwl_seat *xwl_seat); -@@ -458,6 +459,8 @@ RRModePtr xwl_output_find_mode(struct xwl_output *xwl_output, - void xwl_output_set_emulated_mode(struct xwl_output *xwl_output, - ClientPtr client, RRModePtr mode, - Bool from_vidmode); -+void xwl_output_set_window_randr_emu_props(struct xwl_screen *xwl_screen, -+ WindowPtr window); - - RRModePtr xwayland_cvt(int HDisplay, int VDisplay, - float VRefresh, Bool Reduced, Bool Interlaced); --- -2.28.0 - diff --git a/0014-xwayland-Cache-client-id-for-the-window-manager-clie.patch b/0014-xwayland-Cache-client-id-for-the-window-manager-clie.patch deleted file mode 100644 index 55f14d6..0000000 --- a/0014-xwayland-Cache-client-id-for-the-window-manager-clie.patch +++ /dev/null @@ -1,137 +0,0 @@ -From 12a0f852e3276cb5c60e44b8b0d6ddd97975fd42 Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Mon, 27 Jan 2020 11:08:00 +0100 -Subject: [PATCH xserver 14/25] xwayland: Cache client-id for the - window-manager client - -Instead of iterating over all clients which are listening for events on the -root window and checking if the client we are dealing with is the one -listening for SubstructureRedirectMask | ResizeRedirectMask events and thus -is the window-manager, cache the client-id of the window-manager in -xwl_screen and use that when checking if a client is the window-manager. - -Note that we cache and compare the client-id rather then the ClienPtr, -this saves reading the ClientPtr from the global clients array when doing -the comparison. - -Suggested-by: Olivier Fourdan -Acked-by: Olivier Fourdan -Signed-off-by: Hans de Goede -(cherry picked from commit ded89300c1dd541f59fe6e93c5c69d7fe7088244) ---- - hw/xwayland/xwayland.c | 48 ++++++++++++++++++++++++++++-------------- - hw/xwayland/xwayland.h | 2 ++ - 2 files changed, 34 insertions(+), 16 deletions(-) - -diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index 32442d88e..f99cdf81f 100644 ---- a/hw/xwayland/xwayland.c -+++ b/hw/xwayland/xwayland.c -@@ -565,20 +565,11 @@ xwl_window_enable_viewport(struct xwl_window *xwl_window, - } - - static Bool --xwl_screen_client_is_window_manager(struct xwl_screen *xwl_screen, -- ClientPtr client) -+window_is_wm_window(WindowPtr window) - { -- WindowPtr root = xwl_screen->screen->root; -- OtherClients *others; -- -- for (others = wOtherClients(root); others; others = others->next) { -- if (SameClient(others, client)) { -- if (others->mask & (SubstructureRedirectMask | ResizeRedirectMask)) -- return TRUE; -- } -- } -+ struct xwl_screen *xwl_screen = xwl_screen_get(window->drawable.pScreen); - -- return FALSE; -+ return CLIENT_ID(window->drawable.id) == xwl_screen->wm_client_id; - } - - static ClientPtr -@@ -592,7 +583,7 @@ xwl_window_get_owner(struct xwl_window *xwl_window) - * decoration window. In that case return the client of the - * first *and only* child of the toplevel (decoration) window. - */ -- if (xwl_screen_client_is_window_manager(xwl_window->xwl_screen, client)) { -+ if (window_is_wm_window(window)) { - if (window->firstChild && window->firstChild == window->lastChild) - return wClient(window->firstChild); - else -@@ -687,9 +678,7 @@ xwl_screen_check_resolution_change_emulation(struct xwl_screen *xwl_screen) - Bool - xwl_window_is_toplevel(WindowPtr window) - { -- struct xwl_screen *xwl_screen = xwl_screen_get(window->drawable.pScreen); -- -- if (xwl_screen_client_is_window_manager(xwl_screen, wClient(window))) -+ if (window_is_wm_window(window)) - return FALSE; - - /* CSD and override-redirect toplevel windows */ -@@ -964,6 +953,30 @@ xwl_set_window_pixmap(WindowPtr window, - ensure_surface_for_window(window); - } - -+static Bool -+xwl_change_window_attributes(WindowPtr window, unsigned long mask) -+{ -+ ScreenPtr screen = window->drawable.pScreen; -+ struct xwl_screen *xwl_screen = xwl_screen_get(screen); -+ OtherClients *others; -+ Bool ret; -+ -+ screen->ChangeWindowAttributes = xwl_screen->ChangeWindowAttributes; -+ ret = (*screen->ChangeWindowAttributes) (window, mask); -+ xwl_screen->ChangeWindowAttributes = screen->ChangeWindowAttributes; -+ screen->ChangeWindowAttributes = xwl_change_window_attributes; -+ -+ if (window != screen->root || !(mask & CWEventMask)) -+ return ret; -+ -+ for (others = wOtherClients(window); others; others = others->next) { -+ if (others->mask & (SubstructureRedirectMask | ResizeRedirectMask)) -+ xwl_screen->wm_client_id = CLIENT_ID(others->resource); -+ } -+ -+ return ret; -+} -+ - static void - xwl_resize_window(WindowPtr window, - int x, int y, -@@ -1568,6 +1581,9 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) - xwl_screen->CloseScreen = pScreen->CloseScreen; - pScreen->CloseScreen = xwl_close_screen; - -+ xwl_screen->ChangeWindowAttributes = pScreen->ChangeWindowAttributes; -+ pScreen->ChangeWindowAttributes = xwl_change_window_attributes; -+ - xwl_screen->ResizeWindow = pScreen->ResizeWindow; - pScreen->ResizeWindow = xwl_resize_window; - -diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h -index 1317ae5bb..f5ffadfcc 100644 ---- a/hw/xwayland/xwayland.h -+++ b/hw/xwayland/xwayland.h -@@ -118,6 +118,7 @@ struct xwl_screen { - int height; - int depth; - ScreenPtr screen; -+ int wm_client_id; - int expecting_event; - enum RootClipMode root_clip_mode; - -@@ -135,6 +136,7 @@ struct xwl_screen { - DestroyWindowProcPtr DestroyWindow; - XYToWindowProcPtr XYToWindow; - SetWindowPixmapProcPtr SetWindowPixmap; -+ ChangeWindowAttributesProcPtr ChangeWindowAttributes; - ResizeWindowProcPtr ResizeWindow; - - struct xorg_list output_list; --- -2.28.0 - diff --git a/0015-xwayland-Reuse-viewport-instead-of-recreating.patch b/0015-xwayland-Reuse-viewport-instead-of-recreating.patch deleted file mode 100644 index c11d0c0..0000000 --- a/0015-xwayland-Reuse-viewport-instead-of-recreating.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 5448ffeb9b06d20e821174c04d2280933e3ca993 Mon Sep 17 00:00:00 2001 -From: Roman Gilg -Date: Fri, 3 Jan 2020 17:12:14 +0100 -Subject: [PATCH xserver 15/25] xwayland: Reuse viewport instead of recreating - -When a viewport is already created we can reuse this object instead of -destroying it and getting a new one for updating the source rectangle and -destination size. - -Signed-off-by: Roman Gilg -Reviewed-by: Hans de Goede -Acked-by: Olivier Fourdan -Signed-off-by: Hans de Goede -(cherry picked from commit 948e02872feb641a176b3af82b6ef1201c97bb16) ---- - hw/xwayland/xwayland.c | 18 +++++++----------- - 1 file changed, 7 insertions(+), 11 deletions(-) - -diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index f99cdf81f..8de3dd36b 100644 ---- a/hw/xwayland/xwayland.c -+++ b/hw/xwayland/xwayland.c -@@ -539,17 +539,13 @@ xwl_window_enable_viewport(struct xwl_window *xwl_window, - struct xwl_output *xwl_output, - struct xwl_emulated_mode *emulated_mode) - { -- /* If necessary disable old viewport to apply new settings */ -- if (xwl_window_has_viewport_enabled(xwl_window)) -- xwl_window_disable_viewport(xwl_window); -- -- DebugF("XWAYLAND: enabling viewport %dx%d -> %dx%d\n", -- emulated_mode->width, emulated_mode->height, -- xwl_output->width, xwl_output->height); -- -- xwl_window->viewport = -- wp_viewporter_get_viewport(xwl_window->xwl_screen->viewporter, -- xwl_window->surface); -+ if (!xwl_window_has_viewport_enabled(xwl_window)) { -+ DebugF("XWAYLAND: enabling viewport %dx%d -> %dx%d\n", -+ emulated_mode->width, emulated_mode->height, -+ xwl_output->width, xwl_output->height); -+ xwl_window->viewport = wp_viewporter_get_viewport(xwl_window->xwl_screen->viewporter, -+ xwl_window->surface); -+ } - - wp_viewport_set_source(xwl_window->viewport, - wl_fixed_from_int(0), --- -2.28.0 - diff --git a/0016-xwayland-Recurse-on-finding-the-none-wm-owner.patch b/0016-xwayland-Recurse-on-finding-the-none-wm-owner.patch deleted file mode 100644 index af33a86..0000000 --- a/0016-xwayland-Recurse-on-finding-the-none-wm-owner.patch +++ /dev/null @@ -1,81 +0,0 @@ -From 2896f732af4c74f124d767808a24005342d8f125 Mon Sep 17 00:00:00 2001 -From: Roman Gilg -Date: Fri, 3 Jan 2020 17:27:28 +0100 -Subject: [PATCH xserver 16/25] xwayland: Recurse on finding the none-wm owner - -An X11 window manager might add a chain of parent windows when reparenting to a -decoration window. - -That is for example the case for KWin, which reparents client windows to one -decoration and another wrapper parent window. - -Account for that by a recursion into the tree. For now assume as before that -all X11 window managers reparent with one child only for these parent windows. - -Changes by Hans de Goede: -- Move the xwl_window_is_toplevel() from a later patch in this series here - as it really belongs together with these changes -- Drop no longer necessary xwl_window argument from window_get_none_wm_owner - parameters - -Signed-off-by: Roman Gilg -Reviewed-by: Hans de Goede -Acked-by: Olivier Fourdan -Signed-off-by: Hans de Goede -(cherry picked from commit a69f7fbb54efc8ffad320c8afd23cb41fc9edc27) ---- - hw/xwayland/xwayland.c | 17 ++++++++--------- - 1 file changed, 8 insertions(+), 9 deletions(-) - -diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index 8de3dd36b..c38c4180b 100644 ---- a/hw/xwayland/xwayland.c -+++ b/hw/xwayland/xwayland.c -@@ -569,19 +569,18 @@ window_is_wm_window(WindowPtr window) - } - - static ClientPtr --xwl_window_get_owner(struct xwl_window *xwl_window) -+window_get_none_wm_owner(WindowPtr window) - { -- WindowPtr window = xwl_window->window; - ClientPtr client = wClient(window); - - /* If the toplevel window is owned by the window-manager, then the -- * actual client toplevel window has been reparented to a window-manager -- * decoration window. In that case return the client of the -- * first *and only* child of the toplevel (decoration) window. -+ * actual client toplevel window has been reparented to some window-manager -+ * decoration/wrapper windows. In that case recurse by checking the client -+ * of the first *and only* child of the decoration/wrapper window. - */ - if (window_is_wm_window(window)) { - if (window->firstChild && window->firstChild == window->lastChild) -- return wClient(window->firstChild); -+ return window_get_none_wm_owner(window->firstChild); - else - return NULL; /* Should never happen, skip resolution emulation */ - } -@@ -602,7 +601,7 @@ xwl_window_should_enable_viewport(struct xwl_window *xwl_window, - if (!xwl_screen_has_resolution_change_emulation(xwl_screen)) - return FALSE; - -- owner = xwl_window_get_owner(xwl_window); -+ owner = window_get_none_wm_owner(xwl_window->window); - if (!owner) - return FALSE; - -@@ -681,8 +680,8 @@ xwl_window_is_toplevel(WindowPtr window) - if (window_get_damage(window)) - return TRUE; - -- /* Normal toplevel client windows, reparented to decoration window */ -- return (window->parent && window_get_damage(window->parent)); -+ /* Normal toplevel client windows, reparented to a window-manager window */ -+ return window->parent && window_is_wm_window(window->parent); - } - - static void --- -2.28.0 - diff --git a/0017-xwayland-Make-window_get_none_wm_owner-return-a-Wind.patch b/0017-xwayland-Make-window_get_none_wm_owner-return-a-Wind.patch deleted file mode 100644 index 58a9c4d..0000000 --- a/0017-xwayland-Make-window_get_none_wm_owner-return-a-Wind.patch +++ /dev/null @@ -1,82 +0,0 @@ -From dd83985179b4a3c2613c96922eafeea40e21b7d2 Mon Sep 17 00:00:00 2001 -From: Roman Gilg -Date: Wed, 15 Jan 2020 10:07:58 +0100 -Subject: [PATCH xserver 17/25] xwayland: Make window_get_none_wm_owner return - a Window instead of a Client - -Make window_get_none_wm_owner return the first non-wm-window instead of the -owner (client) of the first non-wm-window and rename it to -window_get_client_toplevel to match its new behavior. - -This is a preparation patch for switching to using the drawable coordinates -in xwl_window_should_enable_viewport() - -Changes by Hans de Goede: -- Split this change out into a separate patch for easier reviewing -- Rename window_get_none_wm_owner to window_get_client_toplevel to match - its new behavior - -Signed-off-by: Roman Gilg -Acked-by: Olivier Fourdan -Signed-off-by: Hans de Goede -(cherry picked from commit 060f10062eb1761515b762b46cba56c7a53db72c) ---- - hw/xwayland/xwayland.c | 17 ++++++++++------- - 1 file changed, 10 insertions(+), 7 deletions(-) - -diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index c38c4180b..b3b80beae 100644 ---- a/hw/xwayland/xwayland.c -+++ b/hw/xwayland/xwayland.c -@@ -568,10 +568,10 @@ window_is_wm_window(WindowPtr window) - return CLIENT_ID(window->drawable.id) == xwl_screen->wm_client_id; - } - --static ClientPtr --window_get_none_wm_owner(WindowPtr window) -+static WindowPtr -+window_get_client_toplevel(WindowPtr window) - { -- ClientPtr client = wClient(window); -+ assert(window); - - /* If the toplevel window is owned by the window-manager, then the - * actual client toplevel window has been reparented to some window-manager -@@ -580,12 +580,12 @@ window_get_none_wm_owner(WindowPtr window) - */ - if (window_is_wm_window(window)) { - if (window->firstChild && window->firstChild == window->lastChild) -- return window_get_none_wm_owner(window->firstChild); -+ return window_get_client_toplevel(window->firstChild); - else - return NULL; /* Should never happen, skip resolution emulation */ - } - -- return client; -+ return window; - } - - static Bool -@@ -597,14 +597,17 @@ xwl_window_should_enable_viewport(struct xwl_window *xwl_window, - struct xwl_emulated_mode *emulated_mode; - struct xwl_output *xwl_output; - ClientPtr owner; -+ WindowPtr window; - - if (!xwl_screen_has_resolution_change_emulation(xwl_screen)) - return FALSE; - -- owner = window_get_none_wm_owner(xwl_window->window); -- if (!owner) -+ window = window_get_client_toplevel(xwl_window->window); -+ if (!window) - return FALSE; - -+ owner = wClient(window); -+ - /* 1. Test if the window matches the emulated mode on one of the outputs - * This path gets hit by most games / libs (e.g. SDL, SFML, OGRE) - */ --- -2.28.0 - diff --git a/0018-xwayland-Check-emulation-on-client-toplevel-resize.patch b/0018-xwayland-Check-emulation-on-client-toplevel-resize.patch deleted file mode 100644 index ea8a875..0000000 --- a/0018-xwayland-Check-emulation-on-client-toplevel-resize.patch +++ /dev/null @@ -1,121 +0,0 @@ -From be8c65e84dc4bee97bd0115a89c037fb47053d4c Mon Sep 17 00:00:00 2001 -From: Roman Gilg -Date: Fri, 3 Jan 2020 17:55:28 +0100 -Subject: [PATCH xserver 18/25] xwayland: Check emulation on client toplevel - resize - -When a reparented window is resized directly check the emulation instead of -doing this only when the window manager parent window is resized, what might -never happen. - -For that to work we need to make sure that we compare the current size of the -client toplevel when looking for an emulated mode. - -Changes by Hans de Goede: -- Remove xwl_window x, y, width and height members as those are no longer used. -- Add check for xwl_window_from_window() returning NULL. - -Signed-off-by: Roman Gilg -Acked-by: Olivier Fourdan -Signed-off-by: Hans de Goede -(cherry picked from commit 6d98f840da6dfcf2a69e03a1b3fa0bf602ba1f27) ---- - hw/xwayland/xwayland.c | 27 +++++++++++---------------- - hw/xwayland/xwayland.h | 1 - - 2 files changed, 11 insertions(+), 17 deletions(-) - -diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index b3b80beae..b2e46336c 100644 ---- a/hw/xwayland/xwayland.c -+++ b/hw/xwayland/xwayland.c -@@ -598,6 +598,7 @@ xwl_window_should_enable_viewport(struct xwl_window *xwl_window, - struct xwl_output *xwl_output; - ClientPtr owner; - WindowPtr window; -+ DrawablePtr drawable; - - if (!xwl_screen_has_resolution_change_emulation(xwl_screen)) - return FALSE; -@@ -607,6 +608,7 @@ xwl_window_should_enable_viewport(struct xwl_window *xwl_window, - return FALSE; - - owner = wClient(window); -+ drawable = &window->drawable; - - /* 1. Test if the window matches the emulated mode on one of the outputs - * This path gets hit by most games / libs (e.g. SDL, SFML, OGRE) -@@ -616,10 +618,10 @@ xwl_window_should_enable_viewport(struct xwl_window *xwl_window, - if (!emulated_mode) - continue; - -- if (xwl_window->x == xwl_output->x && -- xwl_window->y == xwl_output->y && -- xwl_window->width == emulated_mode->width && -- xwl_window->height == emulated_mode->height) { -+ if (drawable->x == xwl_output->x && -+ drawable->y == xwl_output->y && -+ drawable->width == emulated_mode->width && -+ drawable->height == emulated_mode->height) { - - *emulated_mode_ret = emulated_mode; - *xwl_output_ret = xwl_output; -@@ -635,9 +637,9 @@ xwl_window_should_enable_viewport(struct xwl_window *xwl_window, - emulated_mode = xwl_output_get_emulated_mode_for_client(xwl_output, owner); - if (xwl_output && xwl_window->window->overrideRedirect && - emulated_mode && emulated_mode->from_vidmode && -- xwl_window->x == 0 && xwl_window->y == 0 && -- xwl_window->width == xwl_screen->width && -- xwl_window->height == xwl_screen->height) { -+ drawable->x == 0 && drawable->y == 0 && -+ drawable->width == xwl_screen->width && -+ drawable->height == xwl_screen->height) { - - *emulated_mode_ret = emulated_mode; - *xwl_output_ret = xwl_output; -@@ -757,8 +759,6 @@ ensure_surface_for_window(WindowPtr window) - - xwl_window->xwl_screen = xwl_screen; - xwl_window->window = window; -- xwl_window->width = window->drawable.width; -- xwl_window->height = window->drawable.height; - xwl_window->surface = wl_compositor_create_surface(xwl_screen->compositor); - if (xwl_window->surface == NULL) { - ErrorF("wl_display_create_surface failed\n"); -@@ -986,20 +986,15 @@ xwl_resize_window(WindowPtr window, - struct xwl_window *xwl_window; - - xwl_screen = xwl_screen_get(screen); -- xwl_window = xwl_window_get(window); -+ xwl_window = xwl_window_from_window(window); - - screen->ResizeWindow = xwl_screen->ResizeWindow; - (*screen->ResizeWindow) (window, x, y, width, height, sib); - xwl_screen->ResizeWindow = screen->ResizeWindow; - screen->ResizeWindow = xwl_resize_window; - -- if (xwl_window) { -- xwl_window->x = x; -- xwl_window->y = y; -- xwl_window->width = width; -- xwl_window->height = height; -+ if (xwl_window && xwl_window_is_toplevel(window)) - xwl_window_check_resolution_change_emulation(xwl_window); -- } - } - - static void -diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h -index f5ffadfcc..0d0baac9b 100644 ---- a/hw/xwayland/xwayland.h -+++ b/hw/xwayland/xwayland.h -@@ -184,7 +184,6 @@ struct xwl_window { - struct xwl_screen *xwl_screen; - struct wl_surface *surface; - struct wp_viewport *viewport; -- int32_t x, y, width, height; - float scale_x, scale_y; - struct wl_shell_surface *shell_surface; - WindowPtr window; --- -2.28.0 - diff --git a/0019-xwayland-Also-check-resolution-change-emulation-when.patch b/0019-xwayland-Also-check-resolution-change-emulation-when.patch deleted file mode 100644 index a9c5e72..0000000 --- a/0019-xwayland-Also-check-resolution-change-emulation-when.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 555e00dbf71d7c5b792bacd789cdde9c42203ff1 Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Wed, 15 Jan 2020 14:36:45 +0100 -Subject: [PATCH xserver 19/25] xwayland: Also check - resolution-change-emulation when the xwl_window itself moves - -The recent change to use the top-level non-window-manager Window drawable -coordinates from xwl_window_check_resolution_change_emulation() in -combination with only calling it on a resize when the top-level window -is moved breaks things with mutter/gnome-shell. - -When fullscreening a X11 window, mutter moves its window-decoration Window -wrapping the top-level Window to the monitor's origin coordinates (e.g. 0x0) -last. This updates the top-level's drawable coordinates, but as the -actual MoveWindow is called on the wrapper Window and not on the toplevel -we do not call xwl_window_check_resolution_change_emulation() and we never -enable the viewport. - -This commit fixes this by also calling -xwl_window_check_resolution_change_emulation() if the Window being moved -is an xwl_window itself. - -Acked-by: Olivier Fourdan -Signed-off-by: Hans de Goede -(cherry picked from commit 4fc107460a349a1a46f0e5251e6fd2a31f4c0428) ---- - hw/xwayland/xwayland.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index b2e46336c..e07dabcfa 100644 ---- a/hw/xwayland/xwayland.c -+++ b/hw/xwayland/xwayland.c -@@ -993,7 +993,7 @@ xwl_resize_window(WindowPtr window, - xwl_screen->ResizeWindow = screen->ResizeWindow; - screen->ResizeWindow = xwl_resize_window; - -- if (xwl_window && xwl_window_is_toplevel(window)) -+ if (xwl_window && (xwl_window_get(window) || xwl_window_is_toplevel(window))) - xwl_window_check_resolution_change_emulation(xwl_window); - } - --- -2.28.0 - diff --git a/0020-xwayland-Also-hook-screen-s-MoveWindow-method.patch b/0020-xwayland-Also-hook-screen-s-MoveWindow-method.patch deleted file mode 100644 index 4d66a7a..0000000 --- a/0020-xwayland-Also-hook-screen-s-MoveWindow-method.patch +++ /dev/null @@ -1,83 +0,0 @@ -From 46ccf740dc5e81d84b2e8c19f6211eaf1d8d06de Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Thu, 9 Jan 2020 11:00:36 +0100 -Subject: [PATCH xserver 20/25] xwayland: Also hook screen's MoveWindow method - -Not only hook the ResizeWindow method of the screen (which really is -MoveAndResize) but also hook the MoveWindow method for checking if we -need to setup a viewport for resolution change emulation. - -Our resolution change emulation check if the windows origin matches -the monitors origin and the windows origin can also be changed by just -a move without being resized. - -Also checking on a move becomes esp. important when we move to checking -on changes to the top-level non-window-manager client (X11)Window instead -of on changes to the xwl_window later on in this patch series. - -Acked-by: Olivier Fourdan -Signed-off-by: Hans de Goede -(cherry picked from commit 10df0437a2b142e61c4d84ffffa9592ac6846ef1) ---- - hw/xwayland/xwayland.c | 25 +++++++++++++++++++++++++ - hw/xwayland/xwayland.h | 1 + - 2 files changed, 26 insertions(+) - -diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index e07dabcfa..4f19f3710 100644 ---- a/hw/xwayland/xwayland.c -+++ b/hw/xwayland/xwayland.c -@@ -997,6 +997,28 @@ xwl_resize_window(WindowPtr window, - xwl_window_check_resolution_change_emulation(xwl_window); - } - -+static void -+xwl_move_window(WindowPtr window, -+ int x, int y, -+ WindowPtr next_sib, -+ VTKind kind) -+{ -+ ScreenPtr screen = window->drawable.pScreen; -+ struct xwl_screen *xwl_screen; -+ struct xwl_window *xwl_window; -+ -+ xwl_screen = xwl_screen_get(screen); -+ xwl_window = xwl_window_from_window(window); -+ -+ screen->MoveWindow = xwl_screen->MoveWindow; -+ (*screen->MoveWindow) (window, x, y, next_sib, kind); -+ xwl_screen->MoveWindow = screen->MoveWindow; -+ screen->MoveWindow = xwl_move_window; -+ -+ if (xwl_window && (xwl_window_get(window) || xwl_window_is_toplevel(window))) -+ xwl_window_check_resolution_change_emulation(xwl_window); -+} -+ - static void - frame_callback(void *data, - struct wl_callback *callback, -@@ -1580,6 +1602,9 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) - xwl_screen->ResizeWindow = pScreen->ResizeWindow; - pScreen->ResizeWindow = xwl_resize_window; - -+ xwl_screen->MoveWindow = pScreen->MoveWindow; -+ pScreen->MoveWindow = xwl_move_window; -+ - if (xwl_screen->rootless) { - xwl_screen->SetWindowPixmap = pScreen->SetWindowPixmap; - pScreen->SetWindowPixmap = xwl_set_window_pixmap; -diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h -index 0d0baac9b..451c08e23 100644 ---- a/hw/xwayland/xwayland.h -+++ b/hw/xwayland/xwayland.h -@@ -138,6 +138,7 @@ struct xwl_screen { - SetWindowPixmapProcPtr SetWindowPixmap; - ChangeWindowAttributesProcPtr ChangeWindowAttributes; - ResizeWindowProcPtr ResizeWindow; -+ MoveWindowProcPtr MoveWindow; - - struct xorg_list output_list; - struct xorg_list seat_list; --- -2.28.0 - diff --git a/0021-xwayland-Fix-emulated-modes-not-being-removed-when-s.patch b/0021-xwayland-Fix-emulated-modes-not-being-removed-when-s.patch deleted file mode 100644 index b5f3dac..0000000 --- a/0021-xwayland-Fix-emulated-modes-not-being-removed-when-s.patch +++ /dev/null @@ -1,63 +0,0 @@ -From d64f12d119e4abe3ef337741bf7b38f8de2f9da9 Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Mon, 7 Oct 2019 14:27:49 +0200 -Subject: [PATCH xserver 21/25] xwayland: Fix emulated modes not being removed - when screen rotation is used - -The code building the mode-list does the following to deal with screen -rotation: - - if (need_rotate || xwl_output->rotation & (RR_Rotate_0 | RR_Rotate_180)) { - mode_width = xwl_output->width; - mode_height = xwl_output->height; - } else { - mode_width = xwl_output->height; - mode_height = xwl_output->width; - } - -This means we need to do something similar in xwl_output_set_emulated_mode() -to determine if the mode being set is the actual (not-emulated) output mode -and we this should remove any emulated modes set by the client. - -All callers of xwl_output_set_emulated_mode always pass a mode pointer -to a member of xwl_output->randr_output->modes, so we do not need to -duplicate this code, instead we can simply check that the passed in mode -is modes[0] which always is the actual output mode. - -Acked-by: Olivier Fourdan -Signed-off-by: Hans de Goede -(cherry picked from commit 88342353de45e64f408c38bb10cd1506ba0f159a) ---- - hw/xwayland/xwayland-output.c | 8 ++++++-- - 1 file changed, 6 insertions(+), 2 deletions(-) - -diff --git a/hw/xwayland/xwayland-output.c b/hw/xwayland/xwayland-output.c -index 0d6b9ac9f..4bc9cd6b8 100644 ---- a/hw/xwayland/xwayland-output.c -+++ b/hw/xwayland/xwayland-output.c -@@ -272,8 +272,11 @@ xwl_output_remove_emulated_mode_for_client(struct xwl_output *xwl_output, - struct xwl_emulated_mode *emulated_mode; - - emulated_mode = xwl_output_get_emulated_mode_for_client(xwl_output, client); -- if (emulated_mode) -+ if (emulated_mode) { -+ DebugF("XWAYLAND: xwl_output_remove_emulated_mode: %dx%d\n", -+ emulated_mode->width, emulated_mode->height); - memset(emulated_mode, 0, sizeof(*emulated_mode)); -+ } - } - - /* From hw/xfree86/common/xf86DefModeSet.c with some obscure modes dropped */ -@@ -474,7 +477,8 @@ xwl_output_set_emulated_mode(struct xwl_output *xwl_output, ClientPtr client, - from_vidmode ? "vidmode" : "randr", - mode->mode.width, mode->mode.height); - -- if (mode->mode.width == xwl_output->width && mode->mode.height == xwl_output->height) -+ /* modes[0] is the actual (not-emulated) output mode */ -+ if (mode == xwl_output->randr_output->modes[0]) - xwl_output_remove_emulated_mode_for_client(xwl_output, client); - else - xwl_output_add_emulated_mode_for_client(xwl_output, client, mode, from_vidmode); --- -2.28.0 - diff --git a/0022-xwayland-Call-xwl_window_check_resolution_change_emu.patch b/0022-xwayland-Call-xwl_window_check_resolution_change_emu.patch deleted file mode 100644 index 4f4c7f8..0000000 --- a/0022-xwayland-Call-xwl_window_check_resolution_change_emu.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 677fd1ade4547008b0d67eec460770e002595c3c Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Mon, 4 Nov 2019 11:46:49 +0100 -Subject: [PATCH xserver 22/25] xwayland: Call - xwl_window_check_resolution_change_emulation() on newly created O-R windows - -Some clients, which use vidmode to change the resolution when going fullscreen, -create an override-redirect window and never trigger the screen->ResizeWindow -callback we rely on to do the xwl_window_check_resolution_change_emulation(). - -This causes us to not apply a viewport to them, causing the fullscreen window -to not fill the entire monitor. - -This commit adds a call to xwl_window_check_resolution_change_emulation() -at the end of ensure_surface_for_window() to fix this. Note that -ensure_surface_for_window() exits early without creating an xwl_window -for new windows which will not be backed by a wayland surface and which -thus will not have an xwl_window. - -This fixes ClanLib-0.6.x and alleggl-4.4.x using apps not properly -fullscreening. - -Acked-by: Olivier Fourdan -Signed-off-by: Hans de Goede -(cherry picked from commit 4cfc2677f5c82ca5db0919de549b9b077f1ba113) ---- - hw/xwayland/xwayland.c | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index 4f19f3710..5bb7a68e9 100644 ---- a/hw/xwayland/xwayland.c -+++ b/hw/xwayland/xwayland.c -@@ -808,6 +808,11 @@ ensure_surface_for_window(WindowPtr window) - - xwl_window_init_allow_commits(xwl_window); - -+ if (!window_is_wm_window(window)) { -+ /* CSD or O-R toplevel window, check viewport on creation */ -+ xwl_window_check_resolution_change_emulation(xwl_window); -+ } -+ - return TRUE; - - err_surf: --- -2.28.0 - diff --git a/0023-xwayland-Fix-setting-of-_XWAYLAND_RANDR_EMU_MONITOR_.patch b/0023-xwayland-Fix-setting-of-_XWAYLAND_RANDR_EMU_MONITOR_.patch deleted file mode 100644 index 4e15f4f..0000000 --- a/0023-xwayland-Fix-setting-of-_XWAYLAND_RANDR_EMU_MONITOR_.patch +++ /dev/null @@ -1,76 +0,0 @@ -From 049333a0ecf8574a0612bf27850f9682f0f70533 Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Mon, 4 Nov 2019 14:32:29 +0100 -Subject: [PATCH xserver 23/25] xwayland: Fix setting of - _XWAYLAND_RANDR_EMU_MONITOR_RECTS prop on new windows - -For window-manager managed windows, xwl_realize_window is only called for -the window-manager's decoration window and not for the actual client window -on which we should set the _XWAYLAND_RANDR_EMU_MONITOR_RECTS prop. - -Usualy this is not a problem since we walk all client windows to update -the property when the resolution is changed through a randr call. - -But for apps which first do the randr change and only then create their -window this does not work, and our xwl_output_set_window_randr_emu_props -call in xwl_realize_window is a no-op as that is only called for the wm -decoration window and not for the actual client's window. - -This commit fixes this by making ensure_surface_for_window() call -xwl_output_set_window_randr_emu_props on the first and only child of -window-manager managed windows. - -Note this also removes the non-functional xwl_output_set_window_randr_emu_props -call from xwl_realize_window, which was intended to do this, but does not -work. - -This fixes apps using the ogre3d library always running at the -monitors native resolution. - -Acked-by: Olivier Fourdan -Signed-off-by: Hans de Goede -(cherry picked from commit 148f428dfccf606b932a00d5a00af06e8dca8a7e) ---- - hw/xwayland/xwayland.c | 12 +++++++++--- - 1 file changed, 9 insertions(+), 3 deletions(-) - -diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index 5bb7a68e9..1600c00cd 100644 ---- a/hw/xwayland/xwayland.c -+++ b/hw/xwayland/xwayland.c -@@ -738,6 +738,7 @@ ensure_surface_for_window(WindowPtr window) - struct xwl_screen *xwl_screen; - struct xwl_window *xwl_window; - struct wl_region *region; -+ WindowPtr toplevel; - - if (xwl_window_from_window(window)) - return TRUE; -@@ -808,7 +809,14 @@ ensure_surface_for_window(WindowPtr window) - - xwl_window_init_allow_commits(xwl_window); - -- if (!window_is_wm_window(window)) { -+ /* When a new window-manager window is realized, then the randr emulation -+ * props may have not been set on the managed client window yet. -+ */ -+ if (window_is_wm_window(window)) { -+ toplevel = window_get_client_toplevel(window); -+ if (toplevel) -+ xwl_output_set_window_randr_emu_props(xwl_screen, toplevel); -+ } else { - /* CSD or O-R toplevel window, check viewport on creation */ - xwl_window_check_resolution_change_emulation(xwl_window); - } -@@ -857,8 +865,6 @@ xwl_realize_window(WindowPtr window) - return FALSE; - } - -- xwl_output_set_window_randr_emu_props(xwl_screen, window); -- - return ensure_surface_for_window(window); - } - --- -2.28.0 - diff --git a/0024-xwayland-Remove-unnecessary-xwl_window_is_toplevel-c.patch b/0024-xwayland-Remove-unnecessary-xwl_window_is_toplevel-c.patch deleted file mode 100644 index ec778db..0000000 --- a/0024-xwayland-Remove-unnecessary-xwl_window_is_toplevel-c.patch +++ /dev/null @@ -1,49 +0,0 @@ -From f1d77ed7ac9ee9bc2f0cf60b0e4604bae092ebd0 Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Mon, 4 Nov 2019 15:01:18 +0100 -Subject: [PATCH xserver 24/25] xwayland: Remove unnecessary - xwl_window_is_toplevel() check from xwl_output_set_window_randr_emu_props() - -Since the recent fix to call xwl_output_set_window_randr_emu_props() from -ensure_surface_for_window(), it is now only called on a toplevel window, -so the is-toplevel check is not necessary for the -xwl_output_set_window_randr_emu_props() case. - -This commit moves the check to xwl_output_set_randr_emu_prop_callback() -so that we only do it when we are walking over all Windows of a client -to update the property on a change of the emulated resolution. - -Acked-by: Olivier Fourdan -Signed-off-by: Hans de Goede -(cherry picked from commit d4faab8708779df265239b203ed5f020bff681bf) ---- - hw/xwayland/xwayland-output.c | 6 ++---- - 1 file changed, 2 insertions(+), 4 deletions(-) - -diff --git a/hw/xwayland/xwayland-output.c b/hw/xwayland/xwayland-output.c -index 4bc9cd6b8..9d3372c8e 100644 ---- a/hw/xwayland/xwayland-output.c -+++ b/hw/xwayland/xwayland-output.c -@@ -431,9 +431,6 @@ static void - xwl_output_set_randr_emu_prop(WindowPtr window, - struct xwl_output_randr_emu_prop *prop) - { -- if (!xwl_window_is_toplevel(window)) -- return; -- - if (prop->rect_count) { - dixChangeWindowProperty(serverClient, window, prop->atom, - XA_CARDINAL, 32, PropModeReplace, -@@ -446,7 +443,8 @@ xwl_output_set_randr_emu_prop(WindowPtr window, - static void - xwl_output_set_randr_emu_prop_callback(void *resource, XID id, void *user_data) - { -- xwl_output_set_randr_emu_prop(resource, user_data); -+ if (xwl_window_is_toplevel(resource)) -+ xwl_output_set_randr_emu_prop(resource, user_data); - } - - static void --- -2.28.0 - diff --git a/0025-xwayland-Make-window_get_client_toplevel-non-recursi.patch b/0025-xwayland-Make-window_get_client_toplevel-non-recursi.patch deleted file mode 100644 index 4bf96dc..0000000 --- a/0025-xwayland-Make-window_get_client_toplevel-non-recursi.patch +++ /dev/null @@ -1,37 +0,0 @@ -From b5c62ae463101712a2ed91e976b28af5d1e73064 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Michel=20D=C3=A4nzer?= -Date: Fri, 6 Nov 2020 10:14:19 +0100 -Subject: [PATCH xserver 25/25] xwayland: Make window_get_client_toplevel - non-recursive - -Noticed while reading the code. - -Reviewed-by: Olivier Fourdan -(cherry picked from commit df3aa4922fd7e256169e541188b724f67ca948e1) ---- - hw/xwayland/xwayland.c | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index 1600c00cd..a5756ea14 100644 ---- a/hw/xwayland/xwayland.c -+++ b/hw/xwayland/xwayland.c -@@ -578,11 +578,11 @@ window_get_client_toplevel(WindowPtr window) - * decoration/wrapper windows. In that case recurse by checking the client - * of the first *and only* child of the decoration/wrapper window. - */ -- if (window_is_wm_window(window)) { -- if (window->firstChild && window->firstChild == window->lastChild) -- return window_get_client_toplevel(window->firstChild); -- else -+ while (window_is_wm_window(window)) { -+ if (!window->firstChild || window->firstChild != window->lastChild) - return NULL; /* Should never happen, skip resolution emulation */ -+ -+ window = window->firstChild; - } - - return window; --- -2.28.0 - diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index fdf77f6..a858dbd 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -46,7 +46,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.20.10 -Release: 3%{?gitdate:.%{gitdate}}%{?dist} +Release: 4%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org License: MIT @@ -98,33 +98,6 @@ Patch6: 0001-Fedora-hack-Make-the-suid-root-wrapper-always-start-.patch # Backports from "master" upstream: # -# Backported Xwayland randr resolution change emulation support -Patch501: 0001-dix-Add-GetCurrentClient-helper.patch -Patch502: 0002-xwayland-Add-wp_viewport-wayland-extension-support.patch -Patch503: 0003-xwayland-Use-buffer_damage-instead-of-surface-damage.patch -Patch504: 0004-xwayland-Add-fake-output-modes-to-xrandr-output-mode.patch -Patch505: 0005-xwayland-Use-RandR-1.2-interface-rev-2.patch -Patch506: 0006-xwayland-Add-per-client-private-data.patch -Patch507: 0007-xwayland-Add-support-for-storing-per-client-per-outp.patch -Patch508: 0008-xwayland-Add-support-for-randr-resolution-change-emu.patch -Patch509: 0009-xwayland-Add-xwlRRModeToDisplayMode-helper-function.patch -Patch510: 0010-xwayland-Add-xwlVidModeGetCurrentRRMode-helper-to-th.patch -Patch511: 0011-xwayland-Add-vidmode-mode-changing-emulation-support.patch -Patch512: 0012-xwayland-xwl_window_should_enable_viewport-Add-extra.patch -Patch513: 0013-xwayland-Set-_XWAYLAND_RANDR_EMU_MONITOR_RECTS-prope.patch -Patch514: 0014-xwayland-Cache-client-id-for-the-window-manager-clie.patch -Patch515: 0015-xwayland-Reuse-viewport-instead-of-recreating.patch -Patch516: 0016-xwayland-Recurse-on-finding-the-none-wm-owner.patch -Patch517: 0017-xwayland-Make-window_get_none_wm_owner-return-a-Wind.patch -Patch518: 0018-xwayland-Check-emulation-on-client-toplevel-resize.patch -Patch519: 0019-xwayland-Also-check-resolution-change-emulation-when.patch -Patch520: 0020-xwayland-Also-hook-screen-s-MoveWindow-method.patch -Patch521: 0021-xwayland-Fix-emulated-modes-not-being-removed-when-s.patch -Patch522: 0022-xwayland-Call-xwl_window_check_resolution_change_emu.patch -Patch523: 0023-xwayland-Fix-setting-of-_XWAYLAND_RANDR_EMU_MONITOR_.patch -Patch524: 0024-xwayland-Remove-unnecessary-xwl_window_is_toplevel-c.patch -Patch525: 0025-xwayland-Make-window_get_client_toplevel-non-recursi.patch - BuildRequires: make BuildRequires: systemtap-sdt-devel BuildRequires: git-core @@ -145,10 +118,6 @@ BuildRequires: libXinerama-devel libXi-devel BuildRequires: libXt-devel libdmx-devel libXmu-devel libXrender-devel BuildRequires: libXi-devel libXpm-devel libXaw-devel libXfixes-devel -BuildRequires: wayland-devel -BuildRequires: wayland-protocols-devel -BuildRequires: pkgconfig(wayland-eglstream-protocols) -BuildRequires: pkgconfig(wayland-client) >= 1.3.0 BuildRequires: pkgconfig(epoxy) BuildRequires: pkgconfig(xshmfence) >= 1.1 BuildRequires: libXv-devel @@ -285,15 +254,6 @@ X protocol, and therefore supports the newer X extensions like Render and Composite. -%package Xwayland -Summary: Wayland X Server -Requires: xorg-x11-server-common >= %{version}-%{release} -Requires: libEGL - -%description Xwayland -Xwayland is an X server for running X clients under Wayland. - - %package devel Summary: SDK for X server driver module development Requires: xorg-x11-util-macros @@ -376,7 +336,6 @@ autoreconf -f -v --install || exit 1 %configure %{xservers} \ --enable-dependency-tracking \ - --enable-xwayland-eglstream \ --disable-static \ --with-pic \ %{?no_int10} \ @@ -392,7 +351,7 @@ autoreconf -f -v --install || exit 1 --enable-config-udev \ --disable-unit-tests \ --enable-dmx \ - --enable-xwayland \ + --disable-xwayland \ %{dri_flags} \ ${CONFIGURE} @@ -539,9 +498,6 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %{_bindir}/Xephyr %{_mandir}/man1/Xephyr.1* -%files Xwayland -%{_bindir}/Xwayland - %files devel %doc COPYING #{_docdir}/xorg-server @@ -556,6 +512,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Mon Feb 1 2021 Olivier Fourdan - 1.20.10-4 +- Remove Xwayland from the xserver builds + * Thu Jan 28 2021 Fedora Release Engineering - 1.20.10-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild From 5f0a71dde2357321cf582eff5ce70d4e371e2182 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 3 Feb 2021 15:21:19 +1000 Subject: [PATCH 062/131] Drop BuildRequires for flex-devel (#1871101) --- xorg-x11-server.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index a858dbd..8a3da67 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -46,7 +46,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.20.10 -Release: 4%{?gitdate:.%{gitdate}}%{?dist} +Release: 5%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org License: MIT @@ -122,7 +122,7 @@ BuildRequires: pkgconfig(epoxy) BuildRequires: pkgconfig(xshmfence) >= 1.1 BuildRequires: libXv-devel BuildRequires: pixman-devel >= 0.30.0 -BuildRequires: libpciaccess-devel >= 0.13.1 openssl-devel bison flex flex-devel +BuildRequires: libpciaccess-devel >= 0.13.1 openssl-devel bison flex BuildRequires: mesa-libGL-devel >= 9.2 BuildRequires: mesa-libEGL-devel BuildRequires: mesa-libgbm-devel @@ -512,6 +512,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Wed Feb 03 2021 Peter Hutterer 1.20.10-5 +- Drop BuildRequires for flex-devel (#1871101) + * Mon Feb 1 2021 Olivier Fourdan - 1.20.10-4 - Remove Xwayland from the xserver builds From 03bc044aa3dd8ebb5b4492ed039e936957e223da Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Wed, 14 Apr 2021 10:55:42 +0200 Subject: [PATCH 063/131] xserver 1.20.11 Security fix for CVE-2021-3472 / ZDI-CAN-1259 --- sources | 2 +- xorg-x11-server.spec | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/sources b/sources index 623b3d0..8b4e4a9 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (xorg-server-1.20.10.tar.bz2) = a07bee380bb72f2117fe6f831a6e4aded19bea1f2b36e42a019a30348e98d6fe65c0617cf819be9c6b405502f88cafb829df30aab32393774b71f1418a4cefae +SHA512 (xorg-server-1.20.11.tar.bz2) = 1017015b9fd5d53788abe3641d877e6df8609841fa5c1847c0a5e133ddcc1b758a5d695304ebd36828099ec201a85b6b70b46f5ea4f81c5bd3a16fa6e175e3c2 diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 8a3da67..1614370 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -45,8 +45,8 @@ Summary: X.Org X11 X server Name: xorg-x11-server -Version: 1.20.10 -Release: 5%{?gitdate:.%{gitdate}}%{?dist} +Version: 1.20.11 +Release: 1%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org License: MIT @@ -512,6 +512,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Wed Apr 14 2021 Olivier Fourdan - 1.20.11-1 +- xserver 1.20.11 (CVE-2021-3472 / ZDI-CAN-1259) + * Wed Feb 03 2021 Peter Hutterer 1.20.10-5 - Drop BuildRequires for flex-devel (#1871101) From 4818e48baff962a94488a940e4cf777ebb8cc588 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 23 Jul 2021 21:51:14 +0000 Subject: [PATCH 064/131] - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- xorg-x11-server.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 1614370..0332529 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -46,7 +46,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.20.11 -Release: 1%{?gitdate:.%{gitdate}}%{?dist} +Release: 2%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org License: MIT @@ -512,6 +512,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Fri Jul 23 2021 Fedora Release Engineering - 1.20.11-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + * Wed Apr 14 2021 Olivier Fourdan - 1.20.11-1 - xserver 1.20.11 (CVE-2021-3472 / ZDI-CAN-1259) From a6fbe2c194d3ef780f5991d62a59a0823ce72685 Mon Sep 17 00:00:00 2001 From: Sahana Prasad Date: Tue, 14 Sep 2021 19:18:17 +0200 Subject: [PATCH 065/131] Rebuilt with OpenSSL 3.0.0 --- xorg-x11-server.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 0332529..0781fe2 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -46,7 +46,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.20.11 -Release: 2%{?gitdate:.%{gitdate}}%{?dist} +Release: 3%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org License: MIT @@ -512,6 +512,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Tue Sep 14 2021 Sahana Prasad - 1.20.11-3 +- Rebuilt with OpenSSL 3.0.0 + * Fri Jul 23 2021 Fedora Release Engineering - 1.20.11-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild From f08aeec29a2912bcf17dfea173ce36122a614ad9 Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Fri, 17 Dec 2021 15:25:24 +0100 Subject: [PATCH 066/131] xserver 1.20.14 CVE-2021-4008/ZDI-CAN-14192 (#2026059, #2032941) CVE-2021-4009/ZDI-CAN-14950 (#2026072, #2032943) CVE-2021-4010/ZDI-CAN-14951 (#2026073, #2032944) CVE-2021-4011/ZDI-CAN-14952 (#2026074, #2032945) --- .gitignore | 1 + sources | 2 +- xorg-x11-server.spec | 13 ++++++++++--- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index ae892e8..89c66cc 100644 --- a/.gitignore +++ b/.gitignore @@ -34,3 +34,4 @@ xorg-server-1.9.1.tar.bz2 *.bz2 *.xz /xorg-x11-server-1.15.0-1.fc21.src.rpm +/xorg-server-1.20.14.tar.gz diff --git a/sources b/sources index 8b4e4a9..32cd6fa 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (xorg-server-1.20.11.tar.bz2) = 1017015b9fd5d53788abe3641d877e6df8609841fa5c1847c0a5e133ddcc1b758a5d695304ebd36828099ec201a85b6b70b46f5ea4f81c5bd3a16fa6e175e3c2 +SHA512 (xorg-server-1.20.14.tar.xz) = be3dc32cce7d55d7e38c5f6557027f13f39224c76cc83e5800555d5ce89dbdc3731773a2d186a5b97db9fc8731a2b2dd6e9829af2b01ee2559246d4aef7c4963 diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 0781fe2..f4cac33 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -45,8 +45,8 @@ Summary: X.Org X11 X server Name: xorg-x11-server -Version: 1.20.11 -Release: 3%{?gitdate:.%{gitdate}}%{?dist} +Version: 1.20.14 +Release: 1%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org License: MIT @@ -59,7 +59,7 @@ Source0: xorg-server-%{gitdate}.tar.xz Source1: make-git-snapshot.sh Source2: commitid %else -Source0: https://www.x.org/pub/individual/xserver/%{pkgname}-%{version}.tar.bz2 +Source0: https://www.x.org/pub/individual/xserver/%{pkgname}-%{version}.tar.xz Source1: gitignore %endif @@ -512,6 +512,13 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Fri Dec 17 2021 Olivier - 1.20.14-1 +- xserver 1.20.14 + CVE-2021-4008/ZDI-CAN-14192 (#2026059, #2032941) + CVE-2021-4009/ZDI-CAN-14950 (#2026072, #2032943) + CVE-2021-4010/ZDI-CAN-14951 (#2026073, #2032944) + CVE-2021-4011/ZDI-CAN-14952 (#2026074, #2032945) + * Tue Sep 14 2021 Sahana Prasad - 1.20.11-3 - Rebuilt with OpenSSL 3.0.0 From 5125f505512ffb1b9695ebd1ca25d852b75094e1 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 22 Jan 2022 05:24:18 +0000 Subject: [PATCH 067/131] - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- xorg-x11-server.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index f4cac33..66e63b6 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -46,7 +46,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.20.14 -Release: 1%{?gitdate:.%{gitdate}}%{?dist} +Release: 2%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org License: MIT @@ -512,6 +512,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Sat Jan 22 2022 Fedora Release Engineering - 1.20.14-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + * Fri Dec 17 2021 Olivier - 1.20.14-1 - xserver 1.20.14 CVE-2021-4008/ZDI-CAN-14192 (#2026059, #2032941) From befd31b80006001148e5722f6c3c0aa1240566df Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Fri, 28 Jan 2022 10:50:12 +0100 Subject: [PATCH 068/131] Fix crash with NVIDIA proprietary driver with Present Resolves: #2046147 --- ...sent-Check-for-NULL-to-prevent-crash.patch | 43 +++++++++++++++++++ xorg-x11-server.spec | 7 ++- 2 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 0001-present-Check-for-NULL-to-prevent-crash.patch diff --git a/0001-present-Check-for-NULL-to-prevent-crash.patch b/0001-present-Check-for-NULL-to-prevent-crash.patch new file mode 100644 index 0000000..894ad0e --- /dev/null +++ b/0001-present-Check-for-NULL-to-prevent-crash.patch @@ -0,0 +1,43 @@ +From 94b4a3d45451d29e9539ea234ce8b5e9ed58546c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?B=C5=82a=C5=BCej=20Szczygie=C5=82?= +Date: Thu, 13 Jan 2022 00:47:27 +0100 +Subject: [PATCH xserver] present: Check for NULL to prevent crash +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1275 +Signed-off-by: Błażej Szczygieł +Tested-by: Aaron Plattner +(cherry picked from commit 22d5818851967408bb7c903cb345b7ca8766094c) +--- + present/present_scmd.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/present/present_scmd.c b/present/present_scmd.c +index 3c68e690b..11391adbb 100644 +--- a/present/present_scmd.c ++++ b/present/present_scmd.c +@@ -168,6 +168,9 @@ present_scmd_get_crtc(present_screen_priv_ptr screen_priv, WindowPtr window) + if (!screen_priv->info) + return NULL; + ++ if (!screen_priv->info->get_crtc) ++ return NULL; ++ + return (*screen_priv->info->get_crtc)(window); + } + +@@ -206,6 +209,9 @@ present_flush(WindowPtr window) + if (!screen_priv->info) + return; + ++ if (!screen_priv->info->flush) ++ return; ++ + (*screen_priv->info->flush) (window); + } + +-- +2.34.1 + diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 66e63b6..431a9c0 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -46,7 +46,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.20.14 -Release: 2%{?gitdate:.%{gitdate}}%{?dist} +Release: 3%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org License: MIT @@ -96,7 +96,7 @@ Patch6: 0001-Fedora-hack-Make-the-suid-root-wrapper-always-start-.patch # # Backports from "master" upstream: -# +Patch100: 0001-present-Check-for-NULL-to-prevent-crash.patch BuildRequires: make BuildRequires: systemtap-sdt-devel @@ -512,6 +512,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Tue Jan 25 2022 Olivier Fourdan - 1.20.14-3 +- Fix crash with NVIDIA proprietary driver with Present (#2046147) + * Sat Jan 22 2022 Fedora Release Engineering - 1.20.14-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild From 4f6b52c6ec80890e454ac73059498d08d8d88859 Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Fri, 28 Jan 2022 10:54:50 +0100 Subject: [PATCH 069/131] Fix build with GCC 12 Resolves: #2047134 --- 0001-render-Fix-build-with-gcc-12.patch | 90 +++++++++++++++++++++++++ xorg-x11-server.spec | 6 +- 2 files changed, 95 insertions(+), 1 deletion(-) create mode 100644 0001-render-Fix-build-with-gcc-12.patch diff --git a/0001-render-Fix-build-with-gcc-12.patch b/0001-render-Fix-build-with-gcc-12.patch new file mode 100644 index 0000000..22f2e5a --- /dev/null +++ b/0001-render-Fix-build-with-gcc-12.patch @@ -0,0 +1,90 @@ +From 53173fdab492f0f638f6616fcf01af0b9ea6338d Mon Sep 17 00:00:00 2001 +From: Olivier Fourdan +Date: Thu, 20 Jan 2022 10:20:38 +0100 +Subject: [PATCH xserver] render: Fix build with gcc 12 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The xserver fails to compile with the latest gcc 12: + + render/picture.c: In function ‘CreateSolidPicture’: + render/picture.c:874:26: error: array subscript ‘union _SourcePict[0]’ is partly outside array bounds of ‘unsigned char[16]’ [-Werror=array-bounds] + 874 | pPicture->pSourcePict->type = SourcePictTypeSolidFill; + | ^~ + render/picture.c:868:45: note: object of size 16 allocated by ‘malloc’ + 868 | pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(PictSolidFill)); + | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + render/picture.c: In function ‘CreateLinearGradientPicture’: + render/picture.c:906:26: error: array subscript ‘union _SourcePict[0]’ is partly outside array bounds of ‘unsigned char[32]’ [-Werror=array-bounds] + 906 | pPicture->pSourcePict->linear.type = SourcePictTypeLinear; + | ^~ + render/picture.c:899:45: note: object of size 32 allocated by ‘malloc’ + 899 | pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(PictLinearGradient)); + | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + render/picture.c: In function ‘CreateConicalGradientPicture’: + render/picture.c:989:26: error: array subscript ‘union _SourcePict[0]’ is partly outside array bounds of ‘unsigned char[32]’ [-Werror=array-bounds] + 989 | pPicture->pSourcePict->conical.type = SourcePictTypeConical; + | ^~ + render/picture.c:982:45: note: object of size 32 allocated by ‘malloc’ + 982 | pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(PictConicalGradient)); + | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + cc1: some warnings being treated as errors + ninja: build stopped: subcommand failed. + +This is because gcc 12 has become stricter and raises a warning now. + +Fix the warning/error by allocating enough memory to store the union +struct. + +Signed-off-by: Olivier Fourdan +Acked-by: Michel Dänzer +Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1256 +(cherry picked from commit c6b0dcb82d4db07a2f32c09a8c09c85a5f57248e) +--- + render/picture.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/render/picture.c b/render/picture.c +index afa0d258f..2be4b1954 100644 +--- a/render/picture.c ++++ b/render/picture.c +@@ -865,7 +865,7 @@ CreateSolidPicture(Picture pid, xRenderColor * color, int *error) + } + + pPicture->id = pid; +- pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(PictSolidFill)); ++ pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(SourcePict)); + if (!pPicture->pSourcePict) { + *error = BadAlloc; + free(pPicture); +@@ -896,7 +896,7 @@ CreateLinearGradientPicture(Picture pid, xPointFixed * p1, xPointFixed * p2, + } + + pPicture->id = pid; +- pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(PictLinearGradient)); ++ pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(SourcePict)); + if (!pPicture->pSourcePict) { + *error = BadAlloc; + free(pPicture); +@@ -936,7 +936,7 @@ CreateRadialGradientPicture(Picture pid, xPointFixed * inner, + } + + pPicture->id = pid; +- pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(PictRadialGradient)); ++ pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(SourcePict)); + if (!pPicture->pSourcePict) { + *error = BadAlloc; + free(pPicture); +@@ -979,7 +979,7 @@ CreateConicalGradientPicture(Picture pid, xPointFixed * center, xFixed angle, + } + + pPicture->id = pid; +- pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(PictConicalGradient)); ++ pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(SourcePict)); + if (!pPicture->pSourcePict) { + *error = BadAlloc; + free(pPicture); +-- +2.34.1 + diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 431a9c0..e632148 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -46,7 +46,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.20.14 -Release: 3%{?gitdate:.%{gitdate}}%{?dist} +Release: 4%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org License: MIT @@ -97,6 +97,7 @@ Patch6: 0001-Fedora-hack-Make-the-suid-root-wrapper-always-start-.patch # Backports from "master" upstream: Patch100: 0001-present-Check-for-NULL-to-prevent-crash.patch +Patch101: 0001-render-Fix-build-with-gcc-12.patch BuildRequires: make BuildRequires: systemtap-sdt-devel @@ -512,6 +513,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Fri Jan 28 2022 Olivier Fourdan - 1.20.14-4 +- Fix build with GCC 12 (#2047134) + * Tue Jan 25 2022 Olivier Fourdan - 1.20.14-3 - Fix crash with NVIDIA proprietary driver with Present (#2046147) From 672ae9a577e12acf35e6eab1eac5bc5e94c28320 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= Date: Mon, 11 Apr 2022 11:12:37 +0200 Subject: [PATCH 070/131] Fix basic graphic mode not working with simpledrm (#2067151) --- ...pt-devices-with-the-simpledrm-driver.patch | 34 +++++++++++++++++++ xorg-x11-server.spec | 6 +++- 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 0001-xf86-Accept-devices-with-the-simpledrm-driver.patch diff --git a/0001-xf86-Accept-devices-with-the-simpledrm-driver.patch b/0001-xf86-Accept-devices-with-the-simpledrm-driver.patch new file mode 100644 index 0000000..3dc5796 --- /dev/null +++ b/0001-xf86-Accept-devices-with-the-simpledrm-driver.patch @@ -0,0 +1,34 @@ +From b9218fadf3c09d83566549279d68886d8258f79c Mon Sep 17 00:00:00 2001 +From: nerdopolis +Date: Thu, 30 Sep 2021 08:51:18 -0400 +Subject: [PATCH] xf86: Accept devices with the 'simpledrm' driver. + +SimpleDRM 'devices' are a fallback device, and do not have a busid +so they are getting skipped. This will allow simpledrm to work +with the modesetting driver +--- + hw/xfree86/common/xf86platformBus.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c +index 0e0a995ac..45028f7a6 100644 +--- a/hw/xfree86/common/xf86platformBus.c ++++ b/hw/xfree86/common/xf86platformBus.c +@@ -557,8 +557,13 @@ xf86platformProbeDev(DriverPtr drvp) + } + else { + /* for non-seat0 servers assume first device is the master */ +- if (ServerIsNotSeat0()) ++ if (ServerIsNotSeat0()) { + break; ++ } else { ++ /* Accept the device if the driver is simpledrm */ ++ if (strcmp(xf86_platform_devices[j].attribs->driver, "simpledrm") == 0) ++ break; ++ } + + if (xf86IsPrimaryPlatform(&xf86_platform_devices[j])) + break; +-- +2.35.1 + diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index e632148..63a51d6 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -46,7 +46,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.20.14 -Release: 4%{?gitdate:.%{gitdate}}%{?dist} +Release: 5%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org License: MIT @@ -98,6 +98,7 @@ Patch6: 0001-Fedora-hack-Make-the-suid-root-wrapper-always-start-.patch # Backports from "master" upstream: Patch100: 0001-present-Check-for-NULL-to-prevent-crash.patch Patch101: 0001-render-Fix-build-with-gcc-12.patch +Patch102: 0001-xf86-Accept-devices-with-the-simpledrm-driver.patch BuildRequires: make BuildRequires: systemtap-sdt-devel @@ -513,6 +514,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Fri Apr 8 2022 Jocelyn Falempe - 1.20.14-5 +- Fix basic graphic mode not working with simpledrm (#2067151) + * Fri Jan 28 2022 Olivier Fourdan - 1.20.14-4 - Fix build with GCC 12 (#2047134) From ba5ead2efb47ba9f19f318ac3dc5c965174e461b Mon Sep 17 00:00:00 2001 From: Dominik 'Rathann' Mierzejewski Date: Wed, 13 Apr 2022 12:21:15 +0100 Subject: [PATCH 071/131] Don't hardcode fps for fake screen (#2054188) --- 0001-Don-t-hardcode-fps-for-fake-screen.patch | 135 ++++++++++++++++++ xorg-x11-server.spec | 6 +- 2 files changed, 140 insertions(+), 1 deletion(-) create mode 100644 0001-Don-t-hardcode-fps-for-fake-screen.patch diff --git a/0001-Don-t-hardcode-fps-for-fake-screen.patch b/0001-Don-t-hardcode-fps-for-fake-screen.patch new file mode 100644 index 0000000..465a92b --- /dev/null +++ b/0001-Don-t-hardcode-fps-for-fake-screen.patch @@ -0,0 +1,135 @@ +From 6497eeeb1a6552315132340565a3901d4db2144c Mon Sep 17 00:00:00 2001 +From: Boris-Barboris +Date: Tue, 22 Jun 2021 00:51:08 +0300 +Subject: [PATCH] Don't hardcode fps for fake screen + +Currently, when main hardware screen is powered-off, +X server initializes fake screen's timer with +1 second update interval. + +Streaming software like Nomachine or Vnc, as well as +desktop input automation suffers from it, since it +will forever be stuck on 1 fps until the display is +turned back on. + +This commit adds command line option -fakescreenfps +that allows the user to change the default fake screen +timer. + +Signed-off-by: Baranin Alexander +--- + man/Xserver.man | 3 +++ + os/utils.c | 12 ++++++++++++ + present/present.h | 2 ++ + present/present_fake.c | 28 ++++++++++++++++++---------- + 4 files changed, 35 insertions(+), 10 deletions(-) + +diff --git a/man/Xserver.man b/man/Xserver.man +index 31ffb8c..b1a3f40 100644 +--- a/man/Xserver.man ++++ b/man/Xserver.man +@@ -169,6 +169,9 @@ sets default cursor font. + .B \-fn \fIfont\fP + sets the default font. + .TP 8 ++.B \-fakescreenfps \fFps\fP ++sets fake presenter screen default fps (allowable range: 1-600). ++.TP 8 + .B \-fp \fIfontPath\fP + sets the search path for fonts. This path is a comma separated list + of directories which the X server searches for font databases. +diff --git a/os/utils.c b/os/utils.c +index 2ba1c80..721d4e9 100644 +--- a/os/utils.c ++++ b/os/utils.c +@@ -110,6 +110,8 @@ __stdcall unsigned long GetTickCount(void); + + #include "picture.h" + ++#include "present.h" ++ + Bool noTestExtensions; + + #ifdef COMPOSITE +@@ -526,6 +528,7 @@ UseMsg(void) + ErrorF + ("-deferglyphs [none|all|16] defer loading of [no|all|16-bit] glyphs\n"); + ErrorF("-f # bell base (0-100)\n"); ++ ErrorF("-fakescreenfps # fake screen default fps (1-600)\n"); + ErrorF("-fc string cursor font\n"); + ErrorF("-fn string default font name\n"); + ErrorF("-fp string default font path\n"); +@@ -776,6 +779,15 @@ ProcessCommandLine(int argc, char *argv[]) + else + UseMsg(); + } ++ else if (strcmp(argv[i], "-fakescreenfps") == 0) { ++ if (++i < argc) { ++ FakeScreenFps = (uint32_t) atoi(argv[i]); ++ if (FakeScreenFps < 1 || FakeScreenFps > 600) ++ FatalError("fakescreenfps must be an integer in [1;600] range\n"); ++ } ++ else ++ UseMsg(); ++ } + else if (strcmp(argv[i], "-fc") == 0) { + if (++i < argc) + defaultCursorFont = argv[i]; +diff --git a/present/present.h b/present/present.h +index 3d0b972..e7cc50d 100644 +--- a/present/present.h ++++ b/present/present.h +@@ -190,4 +190,6 @@ present_register_complete_notify(present_complete_notify_proc proc); + extern _X_EXPORT Bool + present_can_window_flip(WindowPtr window); + ++extern _X_EXPORT uint32_t FakeScreenFps; ++ + #endif /* _PRESENT_H_ */ +diff --git a/present/present_fake.c b/present/present_fake.c +index 2350638..d9ac598 100644 +--- a/present/present_fake.c ++++ b/present/present_fake.c +@@ -117,21 +117,29 @@ present_fake_queue_vblank(ScreenPtr screen, + return Success; + } + ++uint32_t FakeScreenFps = 0; ++ + void + present_fake_screen_init(ScreenPtr screen) + { ++ uint32_t fake_fps; + present_screen_priv_ptr screen_priv = present_screen_priv(screen); + +- /* For screens with hardware vblank support, the fake code +- * will be used for off-screen windows and while screens are blanked, +- * in which case we want a slow interval here +- * +- * Otherwise, pretend that the screen runs at 60Hz +- */ +- if (screen_priv->info && screen_priv->info->get_crtc) +- screen_priv->fake_interval = 1000000; +- else +- screen_priv->fake_interval = 16667; ++ if (FakeScreenFps) ++ fake_fps = FakeScreenFps; ++ else { ++ /* For screens with hardware vblank support, the fake code ++ * will be used for off-screen windows and while screens are blanked, ++ * in which case we want a large interval here: 1Hz ++ * ++ * Otherwise, pretend that the screen runs at 60Hz ++ */ ++ if (screen_priv->info && screen_priv->info->get_crtc) ++ fake_fps = 1; ++ else ++ fake_fps = 60; ++ } ++ screen_priv->fake_interval = 1000000 / fake_fps; + } + + void +-- +2.34.1 + diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 63a51d6..cc58003 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -46,7 +46,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.20.14 -Release: 5%{?gitdate:.%{gitdate}}%{?dist} +Release: 6%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org License: MIT @@ -99,6 +99,7 @@ Patch6: 0001-Fedora-hack-Make-the-suid-root-wrapper-always-start-.patch Patch100: 0001-present-Check-for-NULL-to-prevent-crash.patch Patch101: 0001-render-Fix-build-with-gcc-12.patch Patch102: 0001-xf86-Accept-devices-with-the-simpledrm-driver.patch +Patch103: 0001-Don-t-hardcode-fps-for-fake-screen.patch BuildRequires: make BuildRequires: systemtap-sdt-devel @@ -514,6 +515,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Wed Apr 13 2022 Dominik Mierzejewski - 1.20.14-6 +- Don't hardcode fps for fake screen (#2054188) + * Fri Apr 8 2022 Jocelyn Falempe - 1.20.14-5 - Fix basic graphic mode not working with simpledrm (#2067151) From 98518b3d7ae429a5f3e11bd3453f8ab81bb27e8b Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Tue, 12 Jul 2022 17:26:05 +0200 Subject: [PATCH 072/131] Fix XKB vulnerabilities * CVE-2022-2319/ZDI-CAN-16062 * CVE-2022-2320/ZDI-CAN-16070 --- ...array-index-loops-to-moving-pointers.patch | 76 ++++++++ ...DeviceInfo-and-XkbSetDeviceInfoCheck.patch | 179 +++++++++++++++++ ...length-validation-for-XkbSetGeometry.patch | 182 ++++++++++++++++++ xorg-x11-server.spec | 10 +- 4 files changed, 446 insertions(+), 1 deletion(-) create mode 100644 0001-xkb-switch-to-array-index-loops-to-moving-pointers.patch create mode 100644 0002-xkb-swap-XkbSetDeviceInfo-and-XkbSetDeviceInfoCheck.patch create mode 100644 0003-xkb-add-request-length-validation-for-XkbSetGeometry.patch diff --git a/0001-xkb-switch-to-array-index-loops-to-moving-pointers.patch b/0001-xkb-switch-to-array-index-loops-to-moving-pointers.patch new file mode 100644 index 0000000..a4efb7a --- /dev/null +++ b/0001-xkb-switch-to-array-index-loops-to-moving-pointers.patch @@ -0,0 +1,76 @@ +From f1070c01d616c5f21f939d5ebc533738779451ac Mon Sep 17 00:00:00 2001 +From: Peter Hutterer +Date: Tue, 5 Jul 2022 12:40:47 +1000 +Subject: [PATCH xserver 1/3] xkb: switch to array index loops to moving + pointers + +Most similar loops here use a pointer that advances with each loop +iteration, let's do the same here for consistency. + +No functional changes. + +Signed-off-by: Peter Hutterer +Reviewed-by: Olivier Fourdan +--- + xkb/xkb.c | 20 ++++++++++---------- + 1 file changed, 10 insertions(+), 10 deletions(-) + +diff --git a/xkb/xkb.c b/xkb/xkb.c +index a29262c24..64e52611e 100644 +--- a/xkb/xkb.c ++++ b/xkb/xkb.c +@@ -5368,16 +5368,16 @@ _CheckSetSections(XkbGeometryPtr geom, + row->left = rWire->left; + row->vertical = rWire->vertical; + kWire = (xkbKeyWireDesc *) &rWire[1]; +- for (k = 0; k < rWire->nKeys; k++) { ++ for (k = 0; k < rWire->nKeys; k++, kWire++) { + XkbKeyPtr key; + + key = XkbAddGeomKey(row); + if (!key) + return BadAlloc; +- memcpy(key->name.name, kWire[k].name, XkbKeyNameLength); +- key->gap = kWire[k].gap; +- key->shape_ndx = kWire[k].shapeNdx; +- key->color_ndx = kWire[k].colorNdx; ++ memcpy(key->name.name, kWire->name, XkbKeyNameLength); ++ key->gap = kWire->gap; ++ key->shape_ndx = kWire->shapeNdx; ++ key->color_ndx = kWire->colorNdx; + if (key->shape_ndx >= geom->num_shapes) { + client->errorValue = _XkbErrCode3(0x10, key->shape_ndx, + geom->num_shapes); +@@ -5389,7 +5389,7 @@ _CheckSetSections(XkbGeometryPtr geom, + return BadMatch; + } + } +- rWire = (xkbRowWireDesc *) &kWire[rWire->nKeys]; ++ rWire = (xkbRowWireDesc *)kWire; + } + wire = (char *) rWire; + if (sWire->nDoodads > 0) { +@@ -5454,16 +5454,16 @@ _CheckSetShapes(XkbGeometryPtr geom, + return BadAlloc; + ol->corner_radius = olWire->cornerRadius; + ptWire = (xkbPointWireDesc *) &olWire[1]; +- for (p = 0, pt = ol->points; p < olWire->nPoints; p++, pt++) { +- pt->x = ptWire[p].x; +- pt->y = ptWire[p].y; ++ for (p = 0, pt = ol->points; p < olWire->nPoints; p++, pt++, ptWire++) { ++ pt->x = ptWire->x; ++ pt->y = ptWire->y; + if (client->swapped) { + swaps(&pt->x); + swaps(&pt->y); + } + } + ol->num_points = olWire->nPoints; +- olWire = (xkbOutlineWireDesc *) (&ptWire[olWire->nPoints]); ++ olWire = (xkbOutlineWireDesc *)ptWire; + } + if (shapeWire->primaryNdx != XkbNoShape) + shape->primary = &shape->outlines[shapeWire->primaryNdx]; +-- +2.36.1 + diff --git a/0002-xkb-swap-XkbSetDeviceInfo-and-XkbSetDeviceInfoCheck.patch b/0002-xkb-swap-XkbSetDeviceInfo-and-XkbSetDeviceInfoCheck.patch new file mode 100644 index 0000000..8973a0e --- /dev/null +++ b/0002-xkb-swap-XkbSetDeviceInfo-and-XkbSetDeviceInfoCheck.patch @@ -0,0 +1,179 @@ +From dd8caf39e9e15d8f302e54045dd08d8ebf1025dc Mon Sep 17 00:00:00 2001 +From: Peter Hutterer +Date: Tue, 5 Jul 2022 09:50:41 +1000 +Subject: [PATCH xserver 2/3] xkb: swap XkbSetDeviceInfo and + XkbSetDeviceInfoCheck + +XKB often uses a FooCheck and Foo function pair, the former is supposed +to check all values in the request and error out on BadLength, +BadValue, etc. The latter is then called once we're confident the values +are good (they may still fail on an individual device, but that's a +different topic). + +In the case of XkbSetDeviceInfo, those functions were incorrectly +named, with XkbSetDeviceInfo ending up as the checker function and +XkbSetDeviceInfoCheck as the setter function. As a result, the setter +function was called before the checker function, accessing request +data and modifying device state before we ensured that the data is +valid. + +In particular, the setter function relied on values being already +byte-swapped. This in turn could lead to potential OOB memory access. + +Fix this by correctly naming the functions and moving the length checks +over to the checker function. These were added in 87c64fc5b0 to the +wrong function, probably due to the incorrect naming. + +Fixes ZDI-CAN 16070, CVE-2022-2320. + +This vulnerability was discovered by: +Jan-Niklas Sohn working with Trend Micro Zero Day Initiative + +Introduced in c06e27b2f6fd9f7b9f827623a48876a225264132 + +Signed-off-by: Peter Hutterer +--- + xkb/xkb.c | 46 +++++++++++++++++++++++++--------------------- + 1 file changed, 25 insertions(+), 21 deletions(-) + +diff --git a/xkb/xkb.c b/xkb/xkb.c +index 64e52611e..34b2c290b 100644 +--- a/xkb/xkb.c ++++ b/xkb/xkb.c +@@ -6550,7 +6550,8 @@ ProcXkbGetDeviceInfo(ClientPtr client) + static char * + CheckSetDeviceIndicators(char *wire, + DeviceIntPtr dev, +- int num, int *status_rtrn, ClientPtr client) ++ int num, int *status_rtrn, ClientPtr client, ++ xkbSetDeviceInfoReq * stuff) + { + xkbDeviceLedsWireDesc *ledWire; + int i; +@@ -6558,6 +6559,11 @@ CheckSetDeviceIndicators(char *wire, + + ledWire = (xkbDeviceLedsWireDesc *) wire; + for (i = 0; i < num; i++) { ++ if (!_XkbCheckRequestBounds(client, stuff, ledWire, ledWire + 1)) { ++ *status_rtrn = BadLength; ++ return (char *) ledWire; ++ } ++ + if (client->swapped) { + swaps(&ledWire->ledClass); + swaps(&ledWire->ledID); +@@ -6585,6 +6591,11 @@ CheckSetDeviceIndicators(char *wire, + atomWire = (CARD32 *) &ledWire[1]; + if (nNames > 0) { + for (n = 0; n < nNames; n++) { ++ if (!_XkbCheckRequestBounds(client, stuff, atomWire, atomWire + 1)) { ++ *status_rtrn = BadLength; ++ return (char *) atomWire; ++ } ++ + if (client->swapped) { + swapl(atomWire); + } +@@ -6596,6 +6607,10 @@ CheckSetDeviceIndicators(char *wire, + mapWire = (xkbIndicatorMapWireDesc *) atomWire; + if (nMaps > 0) { + for (n = 0; n < nMaps; n++) { ++ if (!_XkbCheckRequestBounds(client, stuff, mapWire, mapWire + 1)) { ++ *status_rtrn = BadLength; ++ return (char *) mapWire; ++ } + if (client->swapped) { + swaps(&mapWire->virtualMods); + swapl(&mapWire->ctrls); +@@ -6647,11 +6662,6 @@ SetDeviceIndicators(char *wire, + xkbIndicatorMapWireDesc *mapWire; + XkbSrvLedInfoPtr sli; + +- if (!_XkbCheckRequestBounds(client, stuff, ledWire, ledWire + 1)) { +- *status_rtrn = BadLength; +- return (char *) ledWire; +- } +- + namec = mapc = statec = 0; + sli = XkbFindSrvLedInfo(dev, ledWire->ledClass, ledWire->ledID, + XkbXI_IndicatorMapsMask); +@@ -6670,10 +6680,6 @@ SetDeviceIndicators(char *wire, + memset((char *) sli->names, 0, XkbNumIndicators * sizeof(Atom)); + for (n = 0, bit = 1; n < XkbNumIndicators; n++, bit <<= 1) { + if (ledWire->namesPresent & bit) { +- if (!_XkbCheckRequestBounds(client, stuff, atomWire, atomWire + 1)) { +- *status_rtrn = BadLength; +- return (char *) atomWire; +- } + sli->names[n] = (Atom) *atomWire; + if (sli->names[n] == None) + ledWire->namesPresent &= ~bit; +@@ -6691,10 +6697,6 @@ SetDeviceIndicators(char *wire, + if (ledWire->mapsPresent) { + for (n = 0, bit = 1; n < XkbNumIndicators; n++, bit <<= 1) { + if (ledWire->mapsPresent & bit) { +- if (!_XkbCheckRequestBounds(client, stuff, mapWire, mapWire + 1)) { +- *status_rtrn = BadLength; +- return (char *) mapWire; +- } + sli->maps[n].flags = mapWire->flags; + sli->maps[n].which_groups = mapWire->whichGroups; + sli->maps[n].groups = mapWire->groups; +@@ -6730,13 +6732,17 @@ SetDeviceIndicators(char *wire, + } + + static int +-_XkbSetDeviceInfo(ClientPtr client, DeviceIntPtr dev, ++_XkbSetDeviceInfoCheck(ClientPtr client, DeviceIntPtr dev, + xkbSetDeviceInfoReq * stuff) + { + char *wire; + + wire = (char *) &stuff[1]; + if (stuff->change & XkbXI_ButtonActionsMask) { ++ int sz = stuff->nBtns * SIZEOF(xkbActionWireDesc); ++ if (!_XkbCheckRequestBounds(client, stuff, wire, (char *) wire + sz)) ++ return BadLength; ++ + if (!dev->button) { + client->errorValue = _XkbErrCode2(XkbErr_BadClass, ButtonClass); + return XkbKeyboardErrorCode; +@@ -6747,13 +6753,13 @@ _XkbSetDeviceInfo(ClientPtr client, DeviceIntPtr dev, + dev->button->numButtons); + return BadMatch; + } +- wire += (stuff->nBtns * SIZEOF(xkbActionWireDesc)); ++ wire += sz; + } + if (stuff->change & XkbXI_IndicatorsMask) { + int status = Success; + + wire = CheckSetDeviceIndicators(wire, dev, stuff->nDeviceLedFBs, +- &status, client); ++ &status, client, stuff); + if (status != Success) + return status; + } +@@ -6764,8 +6770,8 @@ _XkbSetDeviceInfo(ClientPtr client, DeviceIntPtr dev, + } + + static int +-_XkbSetDeviceInfoCheck(ClientPtr client, DeviceIntPtr dev, +- xkbSetDeviceInfoReq * stuff) ++_XkbSetDeviceInfo(ClientPtr client, DeviceIntPtr dev, ++ xkbSetDeviceInfoReq * stuff) + { + char *wire; + xkbExtensionDeviceNotify ed; +@@ -6789,8 +6795,6 @@ _XkbSetDeviceInfoCheck(ClientPtr client, DeviceIntPtr dev, + if (stuff->firstBtn + stuff->nBtns > nBtns) + return BadValue; + sz = stuff->nBtns * SIZEOF(xkbActionWireDesc); +- if (!_XkbCheckRequestBounds(client, stuff, wire, (char *) wire + sz)) +- return BadLength; + memcpy((char *) &acts[stuff->firstBtn], (char *) wire, sz); + wire += sz; + ed.reason |= XkbXI_ButtonActionsMask; +-- +2.36.1 + diff --git a/0003-xkb-add-request-length-validation-for-XkbSetGeometry.patch b/0003-xkb-add-request-length-validation-for-XkbSetGeometry.patch new file mode 100644 index 0000000..dca4d7c --- /dev/null +++ b/0003-xkb-add-request-length-validation-for-XkbSetGeometry.patch @@ -0,0 +1,182 @@ +From 6907b6ea2b4ce949cb07271f5b678d5966d9df42 Mon Sep 17 00:00:00 2001 +From: Peter Hutterer +Date: Tue, 5 Jul 2022 11:11:06 +1000 +Subject: [PATCH xserver 3/3] xkb: add request length validation for + XkbSetGeometry + +No validation of the various fields on that report were done, so a +malicious client could send a short request that claims it had N +sections, or rows, or keys, and the server would process the request for +N sections, running out of bounds of the actual request data. + +Fix this by adding size checks to ensure our data is valid. + +ZDI-CAN 16062, CVE-2022-2319. + +This vulnerability was discovered by: +Jan-Niklas Sohn working with Trend Micro Zero Day Initiative + +Signed-off-by: Peter Hutterer +--- + xkb/xkb.c | 43 ++++++++++++++++++++++++++++++++++++++----- + 1 file changed, 38 insertions(+), 5 deletions(-) + +diff --git a/xkb/xkb.c b/xkb/xkb.c +index 34b2c290b..4692895db 100644 +--- a/xkb/xkb.c ++++ b/xkb/xkb.c +@@ -5156,7 +5156,7 @@ _GetCountedString(char **wire_inout, ClientPtr client, char **str) + } + + static Status +-_CheckSetDoodad(char **wire_inout, ++_CheckSetDoodad(char **wire_inout, xkbSetGeometryReq *req, + XkbGeometryPtr geom, XkbSectionPtr section, ClientPtr client) + { + char *wire; +@@ -5167,6 +5167,9 @@ _CheckSetDoodad(char **wire_inout, + Status status; + + dWire = (xkbDoodadWireDesc *) (*wire_inout); ++ if (!_XkbCheckRequestBounds(client, req, dWire, dWire + 1)) ++ return BadLength; ++ + any = dWire->any; + wire = (char *) &dWire[1]; + if (client->swapped) { +@@ -5269,7 +5272,7 @@ _CheckSetDoodad(char **wire_inout, + } + + static Status +-_CheckSetOverlay(char **wire_inout, ++_CheckSetOverlay(char **wire_inout, xkbSetGeometryReq *req, + XkbGeometryPtr geom, XkbSectionPtr section, ClientPtr client) + { + register int r; +@@ -5280,6 +5283,9 @@ _CheckSetOverlay(char **wire_inout, + + wire = *wire_inout; + olWire = (xkbOverlayWireDesc *) wire; ++ if (!_XkbCheckRequestBounds(client, req, olWire, olWire + 1)) ++ return BadLength; ++ + if (client->swapped) { + swapl(&olWire->name); + } +@@ -5291,6 +5297,9 @@ _CheckSetOverlay(char **wire_inout, + xkbOverlayKeyWireDesc *kWire; + XkbOverlayRowPtr row; + ++ if (!_XkbCheckRequestBounds(client, req, rWire, rWire + 1)) ++ return BadLength; ++ + if (rWire->rowUnder > section->num_rows) { + client->errorValue = _XkbErrCode4(0x20, r, section->num_rows, + rWire->rowUnder); +@@ -5299,6 +5308,9 @@ _CheckSetOverlay(char **wire_inout, + row = XkbAddGeomOverlayRow(ol, rWire->rowUnder, rWire->nKeys); + kWire = (xkbOverlayKeyWireDesc *) &rWire[1]; + for (k = 0; k < rWire->nKeys; k++, kWire++) { ++ if (!_XkbCheckRequestBounds(client, req, kWire, kWire + 1)) ++ return BadLength; ++ + if (XkbAddGeomOverlayKey(ol, row, + (char *) kWire->over, + (char *) kWire->under) == NULL) { +@@ -5332,6 +5344,9 @@ _CheckSetSections(XkbGeometryPtr geom, + register int r; + xkbRowWireDesc *rWire; + ++ if (!_XkbCheckRequestBounds(client, req, sWire, sWire + 1)) ++ return BadLength; ++ + if (client->swapped) { + swapl(&sWire->name); + swaps(&sWire->top); +@@ -5357,6 +5372,9 @@ _CheckSetSections(XkbGeometryPtr geom, + XkbRowPtr row; + xkbKeyWireDesc *kWire; + ++ if (!_XkbCheckRequestBounds(client, req, rWire, rWire + 1)) ++ return BadLength; ++ + if (client->swapped) { + swaps(&rWire->top); + swaps(&rWire->left); +@@ -5371,6 +5389,9 @@ _CheckSetSections(XkbGeometryPtr geom, + for (k = 0; k < rWire->nKeys; k++, kWire++) { + XkbKeyPtr key; + ++ if (!_XkbCheckRequestBounds(client, req, kWire, kWire + 1)) ++ return BadLength; ++ + key = XkbAddGeomKey(row); + if (!key) + return BadAlloc; +@@ -5396,7 +5417,7 @@ _CheckSetSections(XkbGeometryPtr geom, + register int d; + + for (d = 0; d < sWire->nDoodads; d++) { +- status = _CheckSetDoodad(&wire, geom, section, client); ++ status = _CheckSetDoodad(&wire, req, geom, section, client); + if (status != Success) + return status; + } +@@ -5405,7 +5426,7 @@ _CheckSetSections(XkbGeometryPtr geom, + register int o; + + for (o = 0; o < sWire->nOverlays; o++) { +- status = _CheckSetOverlay(&wire, geom, section, client); ++ status = _CheckSetOverlay(&wire, req, geom, section, client); + if (status != Success) + return status; + } +@@ -5439,6 +5460,9 @@ _CheckSetShapes(XkbGeometryPtr geom, + xkbOutlineWireDesc *olWire; + XkbOutlinePtr ol; + ++ if (!_XkbCheckRequestBounds(client, req, shapeWire, shapeWire + 1)) ++ return BadLength; ++ + shape = + XkbAddGeomShape(geom, shapeWire->name, shapeWire->nOutlines); + if (!shape) +@@ -5449,12 +5473,18 @@ _CheckSetShapes(XkbGeometryPtr geom, + XkbPointPtr pt; + xkbPointWireDesc *ptWire; + ++ if (!_XkbCheckRequestBounds(client, req, olWire, olWire + 1)) ++ return BadLength; ++ + ol = XkbAddGeomOutline(shape, olWire->nPoints); + if (!ol) + return BadAlloc; + ol->corner_radius = olWire->cornerRadius; + ptWire = (xkbPointWireDesc *) &olWire[1]; + for (p = 0, pt = ol->points; p < olWire->nPoints; p++, pt++, ptWire++) { ++ if (!_XkbCheckRequestBounds(client, req, ptWire, ptWire + 1)) ++ return BadLength; ++ + pt->x = ptWire->x; + pt->y = ptWire->y; + if (client->swapped) { +@@ -5560,12 +5590,15 @@ _CheckSetGeom(XkbGeometryPtr geom, xkbSetGeometryReq * req, ClientPtr client) + return status; + + for (i = 0; i < req->nDoodads; i++) { +- status = _CheckSetDoodad(&wire, geom, NULL, client); ++ status = _CheckSetDoodad(&wire, req, geom, NULL, client); + if (status != Success) + return status; + } + + for (i = 0; i < req->nKeyAliases; i++) { ++ if (!_XkbCheckRequestBounds(client, req, wire, wire + XkbKeyNameLength)) ++ return BadLength; ++ + if (XkbAddGeomKeyAlias(geom, &wire[XkbKeyNameLength], wire) == NULL) + return BadAlloc; + wire += 2 * XkbKeyNameLength; +-- +2.36.1 + diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index cc58003..6712284 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -46,7 +46,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.20.14 -Release: 6%{?gitdate:.%{gitdate}}%{?dist} +Release: 7%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org License: MIT @@ -101,6 +101,11 @@ Patch101: 0001-render-Fix-build-with-gcc-12.patch Patch102: 0001-xf86-Accept-devices-with-the-simpledrm-driver.patch Patch103: 0001-Don-t-hardcode-fps-for-fake-screen.patch +# CVE-2022-2319/ZDI-CAN-16062, CVE-2022-2320/ZDI-CAN-16070 +Patch110: 0001-xkb-switch-to-array-index-loops-to-moving-pointers.patch +Patch111: 0002-xkb-swap-XkbSetDeviceInfo-and-XkbSetDeviceInfoCheck.patch +Patch112: 0003-xkb-add-request-length-validation-for-XkbSetGeometry.patch + BuildRequires: make BuildRequires: systemtap-sdt-devel BuildRequires: git-core @@ -515,6 +520,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Tue Jul 12 2022 Olivier Fourdan - 1.20.14-7 +- Fix CVE-2022-2319/ZDI-CAN-16062, CVE-2022-2320/ZDI-CAN-16070 + * Wed Apr 13 2022 Dominik Mierzejewski - 1.20.14-6 - Don't hardcode fps for fake screen (#2054188) From 88dcddb59c19c2ebfd626b040b7e1075f732f9a3 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 23 Jul 2022 13:25:55 +0000 Subject: [PATCH 073/131] Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- xorg-x11-server.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 6712284..c9f627e 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -46,7 +46,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.20.14 -Release: 7%{?gitdate:.%{gitdate}}%{?dist} +Release: 8%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org License: MIT @@ -520,6 +520,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Sat Jul 23 2022 Fedora Release Engineering - 1.20.14-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + * Tue Jul 12 2022 Olivier Fourdan - 1.20.14-7 - Fix CVE-2022-2319/ZDI-CAN-16062, CVE-2022-2320/ZDI-CAN-16070 From 9fc1d98575629b289a8bb0d9b66a3147677a8be3 Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Tue, 8 Nov 2022 12:03:21 +0100 Subject: [PATCH 074/131] Fix CVE-2022-3550, CVE-2022-3551 --- ...possible-memleaks-in-XkbGetKbdByName.patch | 59 +++++++++++++++++++ ...ntedString-against-request-length-at.patch | 35 +++++++++++ xorg-x11-server.spec | 10 +++- 3 files changed, 103 insertions(+), 1 deletion(-) create mode 100644 0001-xkb-fix-some-possible-memleaks-in-XkbGetKbdByName.patch create mode 100644 0001-xkb-proof-GetCountedString-against-request-length-at.patch diff --git a/0001-xkb-fix-some-possible-memleaks-in-XkbGetKbdByName.patch b/0001-xkb-fix-some-possible-memleaks-in-XkbGetKbdByName.patch new file mode 100644 index 0000000..6e5ebb5 --- /dev/null +++ b/0001-xkb-fix-some-possible-memleaks-in-XkbGetKbdByName.patch @@ -0,0 +1,59 @@ +From 18f91b950e22c2a342a4fbc55e9ddf7534a707d2 Mon Sep 17 00:00:00 2001 +From: Peter Hutterer +Date: Wed, 13 Jul 2022 11:23:09 +1000 +Subject: [PATCH xserver] xkb: fix some possible memleaks in XkbGetKbdByName + +GetComponentByName returns an allocated string, so let's free that if we +fail somewhere. + +Signed-off-by: Peter Hutterer +--- + xkb/xkb.c | 26 ++++++++++++++++++++------ + 1 file changed, 20 insertions(+), 6 deletions(-) + +diff --git a/xkb/xkb.c b/xkb/xkb.c +index 4692895db..b79a269e3 100644 +--- a/xkb/xkb.c ++++ b/xkb/xkb.c +@@ -5935,18 +5935,32 @@ ProcXkbGetKbdByName(ClientPtr client) + xkb = dev->key->xkbInfo->desc; + status = Success; + str = (unsigned char *) &stuff[1]; +- if (GetComponentSpec(&str, TRUE, &status)) /* keymap, unsupported */ +- return BadMatch; ++ { ++ char *keymap = GetComponentSpec(&str, TRUE, &status); /* keymap, unsupported */ ++ if (keymap) { ++ free(keymap); ++ return BadMatch; ++ } ++ } + names.keycodes = GetComponentSpec(&str, TRUE, &status); + names.types = GetComponentSpec(&str, TRUE, &status); + names.compat = GetComponentSpec(&str, TRUE, &status); + names.symbols = GetComponentSpec(&str, TRUE, &status); + names.geometry = GetComponentSpec(&str, TRUE, &status); +- if (status != Success) ++ if (status == Success) { ++ len = str - ((unsigned char *) stuff); ++ if ((XkbPaddedSize(len) / 4) != stuff->length) ++ status = BadLength; ++ } ++ ++ if (status != Success) { ++ free(names.keycodes); ++ free(names.types); ++ free(names.compat); ++ free(names.symbols); ++ free(names.geometry); + return status; +- len = str - ((unsigned char *) stuff); +- if ((XkbPaddedSize(len) / 4) != stuff->length) +- return BadLength; ++ } + + CHK_MASK_LEGAL(0x01, stuff->want, XkbGBN_AllComponentsMask); + CHK_MASK_LEGAL(0x02, stuff->need, XkbGBN_AllComponentsMask); +-- +2.38.1 + diff --git a/0001-xkb-proof-GetCountedString-against-request-length-at.patch b/0001-xkb-proof-GetCountedString-against-request-length-at.patch new file mode 100644 index 0000000..d358a32 --- /dev/null +++ b/0001-xkb-proof-GetCountedString-against-request-length-at.patch @@ -0,0 +1,35 @@ +From 11beef0b7f1ed290348e45618e5fa0d2bffcb72e Mon Sep 17 00:00:00 2001 +From: Peter Hutterer +Date: Tue, 5 Jul 2022 12:06:20 +1000 +Subject: [PATCH xserver] xkb: proof GetCountedString against request length + attacks + +GetCountedString did a check for the whole string to be within the +request buffer but not for the initial 2 bytes that contain the length +field. A swapped client could send a malformed request to trigger a +swaps() on those bytes, writing into random memory. + +Signed-off-by: Peter Hutterer +--- + xkb/xkb.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/xkb/xkb.c b/xkb/xkb.c +index f42f59ef3..1841cff26 100644 +--- a/xkb/xkb.c ++++ b/xkb/xkb.c +@@ -5137,6 +5137,11 @@ _GetCountedString(char **wire_inout, ClientPtr client, char **str) + CARD16 len; + + wire = *wire_inout; ++ ++ if (client->req_len < ++ bytes_to_int32(wire + 2 - (char *) client->requestBuffer)) ++ return BadValue; ++ + len = *(CARD16 *) wire; + if (client->swapped) { + swaps(&len); +-- +2.38.1 + diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index c9f627e..f676f0c 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -46,7 +46,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.20.14 -Release: 8%{?gitdate:.%{gitdate}}%{?dist} +Release: 9%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org License: MIT @@ -106,6 +106,11 @@ Patch110: 0001-xkb-switch-to-array-index-loops-to-moving-pointers.patch Patch111: 0002-xkb-swap-XkbSetDeviceInfo-and-XkbSetDeviceInfoCheck.patch Patch112: 0003-xkb-add-request-length-validation-for-XkbSetGeometry.patch +# CVE-2022-3550 +Patch113: 0001-xkb-proof-GetCountedString-against-request-length-at.patch +# CVE-2022-3551 +Patch114: 0001-xkb-fix-some-possible-memleaks-in-XkbGetKbdByName.patch + BuildRequires: make BuildRequires: systemtap-sdt-devel BuildRequires: git-core @@ -520,6 +525,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Tue Nov 8 2022 Olivier Fourdan - 1.20.14-9 +- Fix CVE-2022-3550, CVE-2022-3551 + * Sat Jul 23 2022 Fedora Release Engineering - 1.20.14-8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild From 4e595ce4fd362911c230e5538b96d9ac4e9da381 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 23 Nov 2022 14:57:50 +1000 Subject: [PATCH 075/131] Drop dependency on xorg-x11-font-utils, it was only there for one build-time variable that's always the same value anyway (#2145088) --- ...search-for-the-fontrootdir-ourselves.patch | 72 +++++++++++++++++++ xorg-x11-server.spec | 13 +++- 2 files changed, 83 insertions(+), 2 deletions(-) create mode 100644 0001-configure.ac-search-for-the-fontrootdir-ourselves.patch diff --git a/0001-configure.ac-search-for-the-fontrootdir-ourselves.patch b/0001-configure.ac-search-for-the-fontrootdir-ourselves.patch new file mode 100644 index 0000000..3e29358 --- /dev/null +++ b/0001-configure.ac-search-for-the-fontrootdir-ourselves.patch @@ -0,0 +1,72 @@ +From e67e988730346c63d2f0cdf2531ed36b0c7ad5a6 Mon Sep 17 00:00:00 2001 +From: Peter Hutterer +Date: Wed, 23 Nov 2022 14:50:29 +1000 +Subject: [PATCH xserver] configure.ac: search for the fontrootdir ourselves + +This replaces the use of font-utils' .m4 macro set with a copy of the +only one we actually want: the bit for the fontrootpath. + +We don't need configure options for every single subfont directory, so +let's hardcode those in the default font path. Like meson does upstream +too. + +With this patch we no longer require the font-utils dependency. + +Signed-off-by: Peter Hutterer +--- + configure.ac | 28 +++++++++++++++++----------- + 1 file changed, 17 insertions(+), 11 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 0909cc5b4d..2349320888 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -49,9 +49,6 @@ XORG_WITH_XSLTPROC + XORG_ENABLE_UNIT_TESTS + XORG_LD_WRAP([optional]) + +-m4_ifndef([XORG_FONT_MACROS_VERSION], [m4_fatal([must install font-util 1.1 or later before running autoconf/autogen])]) +-XORG_FONT_MACROS_VERSION(1.1) +- + dnl this gets generated by autoheader, and thus contains all the defines. we + dnl don't ever actually use it, internally. + AC_CONFIG_HEADERS(include/do-not-use-config.h) +@@ -450,18 +447,27 @@ AC_MSG_RESULT([$FALLBACK_INPUT_DRIVER]) + AC_DEFINE_UNQUOTED(FALLBACK_INPUT_DRIVER, ["$FALLBACK_INPUT_DRIVER"], [ Fallback input driver ]) + + dnl Determine font path +-XORG_FONTROOTDIR +-XORG_FONTSUBDIR(FONTMISCDIR, fontmiscdir, misc) +-XORG_FONTSUBDIR(FONTOTFDIR, fontotfdir, OTF) +-XORG_FONTSUBDIR(FONTTTFDIR, fontttfdir, TTF) +-XORG_FONTSUBDIR(FONTTYPE1DIR, fonttype1dir, Type1) +-XORG_FONTSUBDIR(FONT75DPIDIR, font75dpidir, 75dpi) +-XORG_FONTSUBDIR(FONT100DPIDIR, font100dpidir, 100dpi) ++dnl This is a copy of XORG_FONTROOTDIR from font-utils so we can drop the dependency ++AC_MSG_CHECKING([for root directory for font files]) ++AC_ARG_WITH(fontrootdir, ++ AS_HELP_STRING([--with-fontrootdir=DIR], ++ [Path to root directory for font files]), ++ [FONTROOTDIR="$withval"]) ++# if --with-fontrootdir not specified... ++if test "x${FONTROOTDIR}" = "x"; then ++ FONTROOTDIR=`$PKG_CONFIG --variable=fontrootdir fontutil` ++fi ++# ...and if pkg-config didn't find fontdir in fontutil.pc... ++if test "x${FONTROOTDIR}" = "x"; then ++ FONTROOTDIR="${datadir}/fonts/X11" ++fi ++AC_SUBST(FONTROOTDIR) ++AC_MSG_RESULT([${FONTROOTDIR}]) + + dnl Uses --with-default-font-path if set, otherwise uses standard + dnl subdirectories of FONTROOTDIR. Some distros set the default font path to + dnl "catalogue:/etc/X11/fontpath.d,built-ins" +-DEFAULT_FONT_PATH="${FONTMISCDIR}/,${FONTTTFDIR}/,${FONTOTFDIR}/,${FONTTYPE1DIR}/,${FONT100DPIDIR}/,${FONT75DPIDIR}/" ++DEFAULT_FONT_PATH="${FONTROOTDIR}/misc,${FONTROOTDIR}/OTF,${FONTROOTDIR}/TTF,${FONTROOTDIR}/Type1,${FONTROOTDIR}/75dpi,${FONTROOTDIR}/100dpi" + case $host_os in + darwin*) DEFAULT_FONT_PATH="${DEFAULT_FONT_PATH},/Library/Fonts,/System/Library/Fonts" ;; + esac +-- +2.38.1 + diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index f676f0c..1b98ee3 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -46,7 +46,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.20.14 -Release: 9%{?gitdate:.%{gitdate}}%{?dist} +Release: 10%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org License: MIT @@ -92,6 +92,12 @@ Patch5: 0001-autobind-GPUs-to-the-screen.patch # because the display-managers are not ready yet, do not upstream Patch6: 0001-Fedora-hack-Make-the-suid-root-wrapper-always-start-.patch +# Not sure anyone else cares about this so let's keep this Fedora-only for now +# Upstream PR for the meson.build equivalent is here, so we can drop this patch +# when we start building with meson. +# https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1001` +Patch7: 0001-configure.ac-search-for-the-fontrootdir-ourselves.patch + # Backports from current stable "server-1.20-branch": # @@ -118,7 +124,6 @@ BuildRequires: automake autoconf libtool pkgconfig BuildRequires: xorg-x11-util-macros >= 1.17 BuildRequires: xorg-x11-proto-devel >= 7.7-10 -BuildRequires: xorg-x11-font-utils >= 7.2-11 BuildRequires: dbus-devel libepoxy-devel systemd-devel BuildRequires: xorg-x11-xtrans-devel >= 1.3.2 @@ -525,6 +530,10 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Wed Nov 23 2022 Peter Hutterer - 1.20.14-10 +- Drop dependency on xorg-x11-font-utils, it was only there for on + build-time variable that's always the same value anyway (#2145088) + * Tue Nov 8 2022 Olivier Fourdan - 1.20.14-9 - Fix CVE-2022-3550, CVE-2022-3551 From 75e6f92d0f54c035cfc105c43aeae53233f09c88 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 14 Dec 2022 11:53:02 +1000 Subject: [PATCH 076/131] CVE fix for: CVE-2022-4283, CVE-2022-46340, CVE-2022-46341, CVE-2022-46342, CVE-2022-46343, CVE-2022-46344 --- ...-GenericEvents-in-XTestSwapFakeInput.patch | 52 ++++++++++++ ...or-from-XI-property-changes-if-verif.patch | 41 ++++++++++ ...-truncation-in-length-check-of-ProcX.patch | 71 ++++++++++++++++ ...llow-passive-grabs-with-a-detail-255.patch | 82 +++++++++++++++++++ ...reen-saver-resource-when-replacing-i.patch | 48 +++++++++++ ...RTVideoNotify-when-turning-off-from-.patch | 74 +++++++++++++++++ ...dio_groups-pointer-to-NULL-after-fre.patch | 36 ++++++++ xorg-x11-server.spec | 21 ++++- 8 files changed, 424 insertions(+), 1 deletion(-) create mode 100644 0001-Xtest-disallow-GenericEvents-in-XTestSwapFakeInput.patch create mode 100644 0002-Xi-return-an-error-from-XI-property-changes-if-verif.patch create mode 100644 0003-Xi-avoid-integer-truncation-in-length-check-of-ProcX.patch create mode 100644 0004-Xi-disallow-passive-grabs-with-a-detail-255.patch create mode 100644 0005-Xext-free-the-screen-saver-resource-when-replacing-i.patch create mode 100644 0006-Xext-free-the-XvRTVideoNotify-when-turning-off-from-.patch create mode 100644 0007-xkb-reset-the-radio_groups-pointer-to-NULL-after-fre.patch diff --git a/0001-Xtest-disallow-GenericEvents-in-XTestSwapFakeInput.patch b/0001-Xtest-disallow-GenericEvents-in-XTestSwapFakeInput.patch new file mode 100644 index 0000000..017f247 --- /dev/null +++ b/0001-Xtest-disallow-GenericEvents-in-XTestSwapFakeInput.patch @@ -0,0 +1,52 @@ +From 8dba686dc277d6d262ad0c77b4632a5b276697ba Mon Sep 17 00:00:00 2001 +From: Peter Hutterer +Date: Tue, 29 Nov 2022 12:55:45 +1000 +Subject: [PATCH xserver 1/7] Xtest: disallow GenericEvents in + XTestSwapFakeInput + +XTestSwapFakeInput assumes all events in this request are +sizeof(xEvent) and iterates through these in 32-byte increments. +However, a GenericEvent may be of arbitrary length longer than 32 bytes, +so any GenericEvent in this list would result in subsequent events to be +misparsed. + +Additional, the swapped event is written into a stack-allocated struct +xEvent (size 32 bytes). For any GenericEvent longer than 32 bytes, +swapping the event may thus smash the stack like an avocado on toast. + +Catch this case early and return BadValue for any GenericEvent. +Which is what would happen in unswapped setups anyway since XTest +doesn't support GenericEvent. + +CVE-2022-46340, ZDI-CAN 19265 + +This vulnerability was discovered by: +Jan-Niklas Sohn working with Trend Micro Zero Day Initiative + +Signed-off-by: Peter Hutterer +Acked-by: Olivier Fourdan +--- + Xext/xtest.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/Xext/xtest.c b/Xext/xtest.c +index bf27eb590b..2985a4ce6e 100644 +--- a/Xext/xtest.c ++++ b/Xext/xtest.c +@@ -502,10 +502,11 @@ XTestSwapFakeInput(ClientPtr client, xReq * req) + + nev = ((req->length << 2) - sizeof(xReq)) / sizeof(xEvent); + for (ev = (xEvent *) &req[1]; --nev >= 0; ev++) { ++ int evtype = ev->u.u.type & 0x177; + /* Swap event */ +- proc = EventSwapVector[ev->u.u.type & 0177]; ++ proc = EventSwapVector[evtype]; + /* no swapping proc; invalid event type? */ +- if (!proc || proc == NotImplemented) { ++ if (!proc || proc == NotImplemented || evtype == GenericEvent) { + client->errorValue = ev->u.u.type; + return BadValue; + } +-- +2.38.1 + diff --git a/0002-Xi-return-an-error-from-XI-property-changes-if-verif.patch b/0002-Xi-return-an-error-from-XI-property-changes-if-verif.patch new file mode 100644 index 0000000..72bcadb --- /dev/null +++ b/0002-Xi-return-an-error-from-XI-property-changes-if-verif.patch @@ -0,0 +1,41 @@ +From c5ff57676698f19ed3a1402aef58a15552e32d27 Mon Sep 17 00:00:00 2001 +From: Peter Hutterer +Date: Tue, 29 Nov 2022 13:24:00 +1000 +Subject: [PATCH xserver 2/7] Xi: return an error from XI property changes if + verification failed + +Both ProcXChangeDeviceProperty and ProcXIChangeProperty checked the +property for validity but didn't actually return the potential error. + +Signed-off-by: Peter Hutterer +Acked-by: Olivier Fourdan +--- + Xi/xiproperty.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/Xi/xiproperty.c b/Xi/xiproperty.c +index a36f7d61df..68c362c628 100644 +--- a/Xi/xiproperty.c ++++ b/Xi/xiproperty.c +@@ -902,6 +902,8 @@ ProcXChangeDeviceProperty(ClientPtr client) + + rc = check_change_property(client, stuff->property, stuff->type, + stuff->format, stuff->mode, stuff->nUnits); ++ if (rc != Success) ++ return rc; + + len = stuff->nUnits; + if (len > (bytes_to_int32(0xffffffff - sizeof(xChangeDevicePropertyReq)))) +@@ -1141,6 +1143,9 @@ ProcXIChangeProperty(ClientPtr client) + + rc = check_change_property(client, stuff->property, stuff->type, + stuff->format, stuff->mode, stuff->num_items); ++ if (rc != Success) ++ return rc; ++ + len = stuff->num_items; + if (len > bytes_to_int32(0xffffffff - sizeof(xXIChangePropertyReq))) + return BadLength; +-- +2.38.1 + diff --git a/0003-Xi-avoid-integer-truncation-in-length-check-of-ProcX.patch b/0003-Xi-avoid-integer-truncation-in-length-check-of-ProcX.patch new file mode 100644 index 0000000..d3c6541 --- /dev/null +++ b/0003-Xi-avoid-integer-truncation-in-length-check-of-ProcX.patch @@ -0,0 +1,71 @@ +From f9c435822c852659e3926502829f1b13ce6efc37 Mon Sep 17 00:00:00 2001 +From: Peter Hutterer +Date: Tue, 29 Nov 2022 13:26:57 +1000 +Subject: [PATCH xserver 3/7] Xi: avoid integer truncation in length check of + ProcXIChangeProperty + +This fixes an OOB read and the resulting information disclosure. + +Length calculation for the request was clipped to a 32-bit integer. With +the correct stuff->num_items value the expected request size was +truncated, passing the REQUEST_FIXED_SIZE check. + +The server then proceeded with reading at least stuff->num_items bytes +(depending on stuff->format) from the request and stuffing whatever it +finds into the property. In the process it would also allocate at least +stuff->num_items bytes, i.e. 4GB. + +The same bug exists in ProcChangeProperty and ProcXChangeDeviceProperty, +so let's fix that too. + +CVE-2022-46344, ZDI-CAN 19405 + +This vulnerability was discovered by: +Jan-Niklas Sohn working with Trend Micro Zero Day Initiative + +Signed-off-by: Peter Hutterer +Acked-by: Olivier Fourdan +--- + Xi/xiproperty.c | 4 ++-- + dix/property.c | 3 ++- + 2 files changed, 4 insertions(+), 3 deletions(-) + +diff --git a/Xi/xiproperty.c b/Xi/xiproperty.c +index 68c362c628..066ba21fba 100644 +--- a/Xi/xiproperty.c ++++ b/Xi/xiproperty.c +@@ -890,7 +890,7 @@ ProcXChangeDeviceProperty(ClientPtr client) + REQUEST(xChangeDevicePropertyReq); + DeviceIntPtr dev; + unsigned long len; +- int totalSize; ++ uint64_t totalSize; + int rc; + + REQUEST_AT_LEAST_SIZE(xChangeDevicePropertyReq); +@@ -1130,7 +1130,7 @@ ProcXIChangeProperty(ClientPtr client) + { + int rc; + DeviceIntPtr dev; +- int totalSize; ++ uint64_t totalSize; + unsigned long len; + + REQUEST(xXIChangePropertyReq); +diff --git a/dix/property.c b/dix/property.c +index 94ef5a0ec0..acce94b2c6 100644 +--- a/dix/property.c ++++ b/dix/property.c +@@ -205,7 +205,8 @@ ProcChangeProperty(ClientPtr client) + WindowPtr pWin; + char format, mode; + unsigned long len; +- int sizeInBytes, totalSize, err; ++ int sizeInBytes, err; ++ uint64_t totalSize; + + REQUEST(xChangePropertyReq); + +-- +2.38.1 + diff --git a/0004-Xi-disallow-passive-grabs-with-a-detail-255.patch b/0004-Xi-disallow-passive-grabs-with-a-detail-255.patch new file mode 100644 index 0000000..5b189ea --- /dev/null +++ b/0004-Xi-disallow-passive-grabs-with-a-detail-255.patch @@ -0,0 +1,82 @@ +From 0dab0b527ac5c4fe0272ea679522bd87238a733b Mon Sep 17 00:00:00 2001 +From: Peter Hutterer +Date: Tue, 29 Nov 2022 13:55:32 +1000 +Subject: [PATCH xserver 4/7] Xi: disallow passive grabs with a detail > 255 + +The XKB protocol effectively prevents us from ever using keycodes above +255. For buttons it's theoretically possible but realistically too niche +to worry about. For all other passive grabs, the detail must be zero +anyway. + +This fixes an OOB write: + +ProcXIPassiveUngrabDevice() calls DeletePassiveGrabFromList with a +temporary grab struct which contains tempGrab->detail.exact = stuff->detail. +For matching existing grabs, DeleteDetailFromMask is called with the +stuff->detail value. This function creates a new mask with the one bit +representing stuff->detail cleared. + +However, the array size for the new mask is 8 * sizeof(CARD32) bits, +thus any detail above 255 results in an OOB array write. + +CVE-2022-46341, ZDI-CAN 19381 + +This vulnerability was discovered by: +Jan-Niklas Sohn working with Trend Micro Zero Day Initiative + +Signed-off-by: Peter Hutterer +Acked-by: Olivier Fourdan +--- + Xi/xipassivegrab.c | 22 ++++++++++++++-------- + 1 file changed, 14 insertions(+), 8 deletions(-) + +diff --git a/Xi/xipassivegrab.c b/Xi/xipassivegrab.c +index 2769fb7c94..c9ac2f8553 100644 +--- a/Xi/xipassivegrab.c ++++ b/Xi/xipassivegrab.c +@@ -137,6 +137,12 @@ ProcXIPassiveGrabDevice(ClientPtr client) + return BadValue; + } + ++ /* XI2 allows 32-bit keycodes but thanks to XKB we can never ++ * implement this. Just return an error for all keycodes that ++ * cannot work anyway, same for buttons > 255. */ ++ if (stuff->detail > 255) ++ return XIAlreadyGrabbed; ++ + if (XICheckInvalidMaskBits(client, (unsigned char *) &stuff[1], + stuff->mask_len * 4) != Success) + return BadValue; +@@ -207,14 +213,8 @@ ProcXIPassiveGrabDevice(ClientPtr client) + ¶m, XI2, &mask); + break; + case XIGrabtypeKeycode: +- /* XI2 allows 32-bit keycodes but thanks to XKB we can never +- * implement this. Just return an error for all keycodes that +- * cannot work anyway */ +- if (stuff->detail > 255) +- status = XIAlreadyGrabbed; +- else +- status = GrabKey(client, dev, mod_dev, stuff->detail, +- ¶m, XI2, &mask); ++ status = GrabKey(client, dev, mod_dev, stuff->detail, ++ ¶m, XI2, &mask); + break; + case XIGrabtypeEnter: + case XIGrabtypeFocusIn: +@@ -334,6 +334,12 @@ ProcXIPassiveUngrabDevice(ClientPtr client) + return BadValue; + } + ++ /* We don't allow passive grabs for details > 255 anyway */ ++ if (stuff->detail > 255) { ++ client->errorValue = stuff->detail; ++ return BadValue; ++ } ++ + rc = dixLookupWindow(&win, stuff->grab_window, client, DixSetAttrAccess); + if (rc != Success) + return rc; +-- +2.38.1 + diff --git a/0005-Xext-free-the-screen-saver-resource-when-replacing-i.patch b/0005-Xext-free-the-screen-saver-resource-when-replacing-i.patch new file mode 100644 index 0000000..dc2a9d9 --- /dev/null +++ b/0005-Xext-free-the-screen-saver-resource-when-replacing-i.patch @@ -0,0 +1,48 @@ +From 94f6fe99d87cf6ba0adadd95c595158c345b7d29 Mon Sep 17 00:00:00 2001 +From: Peter Hutterer +Date: Tue, 29 Nov 2022 14:53:07 +1000 +Subject: [PATCH xserver 5/7] Xext: free the screen saver resource when + replacing it + +This fixes a use-after-free bug: + +When a client first calls ScreenSaverSetAttributes(), a struct +ScreenSaverAttrRec is allocated and added to the client's +resources. + +When the same client calls ScreenSaverSetAttributes() again, a new +struct ScreenSaverAttrRec is allocated, replacing the old struct. The +old struct was freed but not removed from the clients resources. + +Later, when the client is destroyed the resource system invokes +ScreenSaverFreeAttr and attempts to clean up the already freed struct. + +Fix this by letting the resource system free the old attrs instead. + +CVE-2022-46343, ZDI-CAN 19404 + +This vulnerability was discovered by: +Jan-Niklas Sohn working with Trend Micro Zero Day Initiative + +Signed-off-by: Peter Hutterer +Acked-by: Olivier Fourdan +--- + Xext/saver.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Xext/saver.c b/Xext/saver.c +index f813ba08d1..fd6153c313 100644 +--- a/Xext/saver.c ++++ b/Xext/saver.c +@@ -1051,7 +1051,7 @@ ScreenSaverSetAttributes(ClientPtr client) + pVlist++; + } + if (pPriv->attr) +- FreeScreenAttr(pPriv->attr); ++ FreeResource(pPriv->attr->resource, AttrType); + pPriv->attr = pAttr; + pAttr->resource = FakeClientID(client->index); + if (!AddResource(pAttr->resource, AttrType, (void *) pAttr)) +-- +2.38.1 + diff --git a/0006-Xext-free-the-XvRTVideoNotify-when-turning-off-from-.patch b/0006-Xext-free-the-XvRTVideoNotify-when-turning-off-from-.patch new file mode 100644 index 0000000..ba8b8fa --- /dev/null +++ b/0006-Xext-free-the-XvRTVideoNotify-when-turning-off-from-.patch @@ -0,0 +1,74 @@ +From a42635ee3c01f71a49052d83a372933504c9db04 Mon Sep 17 00:00:00 2001 +From: Peter Hutterer +Date: Wed, 30 Nov 2022 11:20:40 +1000 +Subject: [PATCH xserver 6/7] Xext: free the XvRTVideoNotify when turning off + from the same client + +This fixes a use-after-free bug: + +When a client first calls XvdiSelectVideoNotify() on a drawable with a +TRUE onoff argument, a struct XvVideoNotifyRec is allocated. This struct +is added twice to the resources: + - as the drawable's XvRTVideoNotifyList. This happens only once per + drawable, subsequent calls append to this list. + - as the client's XvRTVideoNotify. This happens for every client. + +The struct keeps the ClientPtr around once it has been added for a +client. The idea, presumably, is that if the client disconnects we can remove +all structs from the drawable's list that match the client (by resetting +the ClientPtr to NULL), but if the drawable is destroyed we can remove +and free the whole list. + +However, if the same client then calls XvdiSelectVideoNotify() on the +same drawable with a FALSE onoff argument, only the ClientPtr on the +existing struct was set to NULL. The struct itself remained in the +client's resources. + +If the drawable is now destroyed, the resource system invokes +XvdiDestroyVideoNotifyList which frees the whole list for this drawable +- including our struct. This function however does not free the resource +for the client since our ClientPtr is NULL. + +Later, when the client is destroyed and the resource system invokes +XvdiDestroyVideoNotify, we unconditionally set the ClientPtr to NULL. On +a struct that has been freed previously. This is generally frowned upon. + +Fix this by calling FreeResource() on the second call instead of merely +setting the ClientPtr to NULL. This removes the struct from the client +resources (but not from the list), ensuring that it won't be accessed +again when the client quits. + +Note that the assignment tpn->client = NULL; is superfluous since the +XvdiDestroyVideoNotify function will do this anyway. But it's left for +clarity and to match a similar invocation in XvdiSelectPortNotify. + +CVE-2022-46342, ZDI-CAN 19400 + +This vulnerability was discovered by: +Jan-Niklas Sohn working with Trend Micro Zero Day Initiative + +Signed-off-by: Peter Hutterer +Acked-by: Olivier Fourdan +--- + Xext/xvmain.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/Xext/xvmain.c b/Xext/xvmain.c +index f627471938..2a08f8744a 100644 +--- a/Xext/xvmain.c ++++ b/Xext/xvmain.c +@@ -811,8 +811,10 @@ XvdiSelectVideoNotify(ClientPtr client, DrawablePtr pDraw, BOOL onoff) + tpn = pn; + while (tpn) { + if (tpn->client == client) { +- if (!onoff) ++ if (!onoff) { + tpn->client = NULL; ++ FreeResource(tpn->id, XvRTVideoNotify); ++ } + return Success; + } + if (!tpn->client) +-- +2.38.1 + diff --git a/0007-xkb-reset-the-radio_groups-pointer-to-NULL-after-fre.patch b/0007-xkb-reset-the-radio_groups-pointer-to-NULL-after-fre.patch new file mode 100644 index 0000000..c6b2352 --- /dev/null +++ b/0007-xkb-reset-the-radio_groups-pointer-to-NULL-after-fre.patch @@ -0,0 +1,36 @@ +From 774260dbae1fa505cd2848c786baed9a8db5179d Mon Sep 17 00:00:00 2001 +From: Peter Hutterer +Date: Mon, 5 Dec 2022 15:55:54 +1000 +Subject: [PATCH xserver 7/7] xkb: reset the radio_groups pointer to NULL after + freeing it + +Unlike other elements of the keymap, this pointer was freed but not +reset. On a subsequent XkbGetKbdByName request, the server may access +already freed memory. + +CVE-2022-46283, ZDI-CAN-19530 + +This vulnerability was discovered by: +Jan-Niklas Sohn working with Trend Micro Zero Day Initiative + +Signed-off-by: Peter Hutterer +Acked-by: Olivier Fourdan +--- + xkb/xkbUtils.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/xkb/xkbUtils.c b/xkb/xkbUtils.c +index dd089c2046..3f5791a183 100644 +--- a/xkb/xkbUtils.c ++++ b/xkb/xkbUtils.c +@@ -1326,6 +1326,7 @@ _XkbCopyNames(XkbDescPtr src, XkbDescPtr dst) + } + else { + free(dst->names->radio_groups); ++ dst->names->radio_groups = NULL; + } + dst->names->num_rg = src->names->num_rg; + +-- +2.38.1 + diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 1b98ee3..5285f9d 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -46,7 +46,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.20.14 -Release: 10%{?gitdate:.%{gitdate}}%{?dist} +Release: 11%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org License: MIT @@ -117,6 +117,21 @@ Patch113: 0001-xkb-proof-GetCountedString-against-request-length-at.patch # CVE-2022-3551 Patch114: 0001-xkb-fix-some-possible-memleaks-in-XkbGetKbdByName.patch +# CVE-2022-46340 +Patch115: 0001-Xtest-disallow-GenericEvents-in-XTestSwapFakeInput.patch +# related to CVE-2022-46344 +Patch116: 0002-Xi-return-an-error-from-XI-property-changes-if-verif.patch +# CVE-2022-46344 +Patch117: 0003-Xi-avoid-integer-truncation-in-length-check-of-ProcX.patch +# CVE-2022-46341 +Patch118: 0004-Xi-disallow-passive-grabs-with-a-detail-255.patch +# CVE-2022-46343 +Patch119: 0005-Xext-free-the-screen-saver-resource-when-replacing-i.patch +# CVE-2022-46342 +Patch120: 0006-Xext-free-the-XvRTVideoNotify-when-turning-off-from-.patch +# CVE-2022-46283 +Patch121: 0007-xkb-reset-the-radio_groups-pointer-to-NULL-after-fre.patch + BuildRequires: make BuildRequires: systemtap-sdt-devel BuildRequires: git-core @@ -530,6 +545,10 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Wed Dec 14 2022 Peter Hutterer 1.20.14-11 +- CVE fix for: CVE-2022-4283, CVE-2022-46340, CVE-2022-46341, + CVE-2022-46342, CVE-2022-46343, CVE-2022-46344 + * Wed Nov 23 2022 Peter Hutterer - 1.20.14-10 - Drop dependency on xorg-x11-font-utils, it was only there for on build-time variable that's always the same value anyway (#2145088) From fc0c7be4e314918120e199284ed0305862761cab Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Mon, 19 Dec 2022 10:18:48 +1000 Subject: [PATCH 077/131] Fix buggy patch to CVE-2022-46340 --- ...-event-type-mask-in-XTestSwapFakeInp.patch | 35 +++++++++++++++++++ xorg-x11-server.spec | 7 +++- 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 0008-Xext-fix-invalid-event-type-mask-in-XTestSwapFakeInp.patch diff --git a/0008-Xext-fix-invalid-event-type-mask-in-XTestSwapFakeInp.patch b/0008-Xext-fix-invalid-event-type-mask-in-XTestSwapFakeInp.patch new file mode 100644 index 0000000..c84d387 --- /dev/null +++ b/0008-Xext-fix-invalid-event-type-mask-in-XTestSwapFakeInp.patch @@ -0,0 +1,35 @@ +From bb1711b7fba42f2a0c7d1c09beee241a1b2bcc30 Mon Sep 17 00:00:00 2001 +From: Peter Hutterer +Date: Mon, 19 Dec 2022 10:06:45 +1000 +Subject: [PATCH xserver] Xext: fix invalid event type mask in + XTestSwapFakeInput + +In commit b320ca0 the mask was inadvertently changed from octal 0177 to +hexadecimal 0x177. + +Fixes commit b320ca0ffe4c0c872eeb3a93d9bde21f765c7c63 + Xtest: disallow GenericEvents in XTestSwapFakeInput + +Found by Stuart Cassoff + +Signed-off-by: Peter Hutterer +--- + Xext/xtest.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Xext/xtest.c b/Xext/xtest.c +index 2985a4ce6e..dde5c4cf9d 100644 +--- a/Xext/xtest.c ++++ b/Xext/xtest.c +@@ -502,7 +502,7 @@ XTestSwapFakeInput(ClientPtr client, xReq * req) + + nev = ((req->length << 2) - sizeof(xReq)) / sizeof(xEvent); + for (ev = (xEvent *) &req[1]; --nev >= 0; ev++) { +- int evtype = ev->u.u.type & 0x177; ++ int evtype = ev->u.u.type & 0177; + /* Swap event */ + proc = EventSwapVector[evtype]; + /* no swapping proc; invalid event type? */ +-- +2.38.1 + diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 5285f9d..2184f31 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -46,7 +46,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.20.14 -Release: 11%{?gitdate:.%{gitdate}}%{?dist} +Release: 12%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org License: MIT @@ -131,6 +131,8 @@ Patch119: 0005-Xext-free-the-screen-saver-resource-when-replacing-i.patch Patch120: 0006-Xext-free-the-XvRTVideoNotify-when-turning-off-from-.patch # CVE-2022-46283 Patch121: 0007-xkb-reset-the-radio_groups-pointer-to-NULL-after-fre.patch +# Fix for buggy patch to CVE-2022-46340 +Patch122: 0008-Xext-fix-invalid-event-type-mask-in-XTestSwapFakeInp.patch BuildRequires: make BuildRequires: systemtap-sdt-devel @@ -545,6 +547,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Mon Dec 19 2022 Peter Hutterer - 1.20.14-12 +- Fix buggy patch to CVE-2022-46340 + * Wed Dec 14 2022 Peter Hutterer 1.20.14-11 - CVE fix for: CVE-2022-4283, CVE-2022-46340, CVE-2022-46341, CVE-2022-46342, CVE-2022-46343, CVE-2022-46344 From 140953a817b9139307553a921b9f9a7f35c8dd1b Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Wed, 11 Jan 2023 16:41:24 +0100 Subject: [PATCH 078/131] Rename value field from bool to boolean Rename boolean config value field from bool to boolean to fix drivers build failures due to a conflict with C++ and stdbool.h --- ...n-config-value-field-from-bool-to-bo.patch | 154 ++++++++++++++++++ xorg-x11-server.spec | 7 +- 2 files changed, 160 insertions(+), 1 deletion(-) create mode 100644 0001-hw-Rename-boolean-config-value-field-from-bool-to-bo.patch diff --git a/0001-hw-Rename-boolean-config-value-field-from-bool-to-bo.patch b/0001-hw-Rename-boolean-config-value-field-from-bool-to-bo.patch new file mode 100644 index 0000000..52ea4d0 --- /dev/null +++ b/0001-hw-Rename-boolean-config-value-field-from-bool-to-bo.patch @@ -0,0 +1,154 @@ +From 454b3a826edb5fc6d0fea3a9cfd1a5e8fc568747 Mon Sep 17 00:00:00 2001 +From: Adam Jackson +Date: Mon, 22 Jul 2019 13:51:06 -0400 +Subject: [PATCH xserver] hw: Rename boolean config value field from bool to + boolean + +"bool" conflicts with C++ (meh) and stdbool.h (ngh alright fine). This +is a driver-visible change and will likely break the build for mach64, +but it can be fixed by simply using xf86ReturnOptValBool like every +other driver. + +Signed-off-by: Adam Jackson +--- + hw/xfree86/common/xf86Opt.h | 2 +- + hw/xfree86/common/xf86Option.c | 10 +++++----- + hw/xwin/winconfig.c | 22 +++++++++++----------- + hw/xwin/winconfig.h | 2 +- + 4 files changed, 18 insertions(+), 18 deletions(-) + +diff --git a/hw/xfree86/common/xf86Opt.h b/hw/xfree86/common/xf86Opt.h +index 3be2a0fc7..3046fbd41 100644 +--- a/hw/xfree86/common/xf86Opt.h ++++ b/hw/xfree86/common/xf86Opt.h +@@ -41,7 +41,7 @@ typedef union { + unsigned long num; + const char *str; + double realnum; +- Bool bool; ++ Bool boolean; + OptFrequency freq; + } ValueUnion; + +diff --git a/hw/xfree86/common/xf86Option.c b/hw/xfree86/common/xf86Option.c +index 06973bca3..ca538cc57 100644 +--- a/hw/xfree86/common/xf86Option.c ++++ b/hw/xfree86/common/xf86Option.c +@@ -213,7 +213,7 @@ LookupBoolOption(XF86OptionPtr optlist, const char *name, int deflt, + o.name = name; + o.type = OPTV_BOOLEAN; + if (ParseOptionValue(-1, optlist, &o, markUsed)) +- deflt = o.value.bool; ++ deflt = o.value.boolean; + return deflt; + } + +@@ -474,7 +474,7 @@ xf86ShowUnusedOptions(int scrnIndex, XF86OptionPtr opt) + static Bool + GetBoolValue(OptionInfoPtr p, const char *s) + { +- return xf86getBoolValue(&p->value.bool, s); ++ return xf86getBoolValue(&p->value.boolean, s); + } + + static Bool +@@ -678,7 +678,7 @@ ParseOptionValue(int scrnIndex, XF86OptionPtr options, OptionInfoPtr p, + if (markUsed) + xf86MarkOptionUsedByName(options, newn); + if (GetBoolValue(&opt, s)) { +- p->value.bool = !opt.value.bool; ++ p->value.boolean = !opt.value.boolean; + p->found = TRUE; + } + else { +@@ -869,7 +869,7 @@ xf86GetOptValBool(const OptionInfoRec * table, int token, Bool *value) + + p = xf86TokenToOptinfo(table, token); + if (p && p->found) { +- *value = p->value.bool; ++ *value = p->value.boolean; + return TRUE; + } + else +@@ -883,7 +883,7 @@ xf86ReturnOptValBool(const OptionInfoRec * table, int token, Bool def) + + p = xf86TokenToOptinfo(table, token); + if (p && p->found) { +- return p->value.bool; ++ return p->value.boolean; + } + else + return def; +diff --git a/hw/xwin/winconfig.c b/hw/xwin/winconfig.c +index 31894d2fb..646d69006 100644 +--- a/hw/xwin/winconfig.c ++++ b/hw/xwin/winconfig.c +@@ -623,7 +623,7 @@ winSetBoolOption(void *optlist, const char *name, int deflt) + o.name = name; + o.type = OPTV_BOOLEAN; + if (ParseOptionValue(-1, optlist, &o)) +- deflt = o.value.bool; ++ deflt = o.value.boolean; + return deflt; + } + +@@ -918,7 +918,7 @@ ParseOptionValue(int scrnIndex, void *options, OptionInfoPtr p) + } + if ((s = winFindOptionValue(options, newn)) != NULL) { + if (GetBoolValue(&opt, s)) { +- p->value.bool = !opt.value.bool; ++ p->value.boolean = !opt.value.boolean; + p->found = TRUE; + } + else { +@@ -968,25 +968,25 @@ static Bool + GetBoolValue(OptionInfoPtr p, const char *s) + { + if (*s == 0) { +- p->value.bool = TRUE; ++ p->value.boolean = TRUE; + } + else { + if (winNameCompare(s, "1") == 0) +- p->value.bool = TRUE; ++ p->value.boolean = TRUE; + else if (winNameCompare(s, "on") == 0) +- p->value.bool = TRUE; ++ p->value.boolean = TRUE; + else if (winNameCompare(s, "true") == 0) +- p->value.bool = TRUE; ++ p->value.boolean = TRUE; + else if (winNameCompare(s, "yes") == 0) +- p->value.bool = TRUE; ++ p->value.boolean = TRUE; + else if (winNameCompare(s, "0") == 0) +- p->value.bool = FALSE; ++ p->value.boolean = FALSE; + else if (winNameCompare(s, "off") == 0) +- p->value.bool = FALSE; ++ p->value.boolean = FALSE; + else if (winNameCompare(s, "false") == 0) +- p->value.bool = FALSE; ++ p->value.boolean = FALSE; + else if (winNameCompare(s, "no") == 0) +- p->value.bool = FALSE; ++ p->value.boolean = FALSE; + } + return TRUE; + } +diff --git a/hw/xwin/winconfig.h b/hw/xwin/winconfig.h +index f079368c7..bd1f59650 100644 +--- a/hw/xwin/winconfig.h ++++ b/hw/xwin/winconfig.h +@@ -199,7 +199,7 @@ typedef union { + unsigned long num; + char *str; + double realnum; +- Bool bool; ++ Bool boolean; + OptFrequency freq; + } ValueUnion; + +-- +2.39.0 + diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 2184f31..a79dac2 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -46,7 +46,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.20.14 -Release: 12%{?gitdate:.%{gitdate}}%{?dist} +Release: 13%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org License: MIT @@ -106,6 +106,7 @@ Patch100: 0001-present-Check-for-NULL-to-prevent-crash.patch Patch101: 0001-render-Fix-build-with-gcc-12.patch Patch102: 0001-xf86-Accept-devices-with-the-simpledrm-driver.patch Patch103: 0001-Don-t-hardcode-fps-for-fake-screen.patch +Patch104: 0001-hw-Rename-boolean-config-value-field-from-bool-to-bo.patch # CVE-2022-2319/ZDI-CAN-16062, CVE-2022-2320/ZDI-CAN-16070 Patch110: 0001-xkb-switch-to-array-index-loops-to-moving-pointers.patch @@ -547,6 +548,10 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Wed Jan 11 2023 Olivier Fourdan - 1.20.14-13 +- Rename boolean config value field from bool to boolean to fix drivers + build failures due to a conflict with C++ and stdbool.h + * Mon Dec 19 2022 Peter Hutterer - 1.20.14-12 - Fix buggy patch to CVE-2022-46340 From e6bf129b81251bcd2a6e2f8e5c77a8d238a043bf Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Fri, 13 Jan 2023 15:23:38 +1000 Subject: [PATCH 079/131] Disallow byte-swapped clients (#2159489) --- ...llow-byte-swapped-clients-by-default.patch | 272 ++++++++++++++++++ xorg-x11-server.spec | 11 +- 2 files changed, 282 insertions(+), 1 deletion(-) create mode 100644 0001-Disallow-byte-swapped-clients-by-default.patch diff --git a/0001-Disallow-byte-swapped-clients-by-default.patch b/0001-Disallow-byte-swapped-clients-by-default.patch new file mode 100644 index 0000000..2cbf798 --- /dev/null +++ b/0001-Disallow-byte-swapped-clients-by-default.patch @@ -0,0 +1,272 @@ +From 73d6e888c6058b28a0e87ab65aa4172b17d8327d Mon Sep 17 00:00:00 2001 +From: Peter Hutterer +Date: Mon, 19 Dec 2022 10:34:29 +1000 +Subject: [PATCH xserver] Fix some indentation issues + +Signed-off-by: Peter Hutterer +--- + dix/dispatch.c | 22 +++++++++++----------- + 1 file changed, 11 insertions(+), 11 deletions(-) + +diff --git a/dix/dispatch.c b/dix/dispatch.c +index 210df75c63..e38a8fecaa 100644 +--- a/dix/dispatch.c ++++ b/dix/dispatch.c +@@ -492,10 +492,10 @@ Dispatch(void) + if (!WaitForSomething(clients_are_ready())) + continue; + +- /***************** +- * Handle events in round robin fashion, doing input between +- * each round +- *****************/ ++ /***************** ++ * Handle events in round robin fashion, doing input between ++ * each round ++ *****************/ + + if (!dispatchException && clients_are_ready()) { + client = SmartScheduleClient(); +@@ -3657,11 +3657,11 @@ ProcInitialConnection(ClientPtr client) + prefix = (xConnClientPrefix *) ((char *)stuff + sz_xReq); + order = prefix->byteOrder; + if (order != 'l' && order != 'B' && order != 'r' && order != 'R') +- return client->noClientException = -1; ++ return client->noClientException = -1; + if (((*(char *) &whichbyte) && (order == 'B' || order == 'R')) || +- (!(*(char *) &whichbyte) && (order == 'l' || order == 'r'))) { +- client->swapped = TRUE; +- SwapConnClientPrefix(prefix); ++ (!(*(char *) &whichbyte) && (order == 'l' || order == 'r'))) { ++ client->swapped = TRUE; ++ SwapConnClientPrefix(prefix); + } + stuff->reqType = 2; + stuff->length += bytes_to_int32(prefix->nbytesAuthProto) + +@@ -3670,7 +3670,7 @@ ProcInitialConnection(ClientPtr client) + swaps(&stuff->length); + } + if (order == 'r' || order == 'R') { +- client->local = FALSE; ++ client->local = FALSE; + } + ResetCurrentRequest(client); + return Success; +@@ -3781,8 +3781,8 @@ ProcEstablishConnection(ClientPtr client) + auth_string = auth_proto + pad_to_int32(prefix->nbytesAuthProto); + + if ((client->req_len << 2) != sz_xReq + sz_xConnClientPrefix + +- pad_to_int32(prefix->nbytesAuthProto) + +- pad_to_int32(prefix->nbytesAuthString)) ++ pad_to_int32(prefix->nbytesAuthProto) + ++ pad_to_int32(prefix->nbytesAuthString)) + reason = "Bad length"; + else if ((prefix->majorVersion != X_PROTOCOL) || + (prefix->minorVersion != X_PROTOCOL_REVISION)) +-- +2.39.0 + +From f69280ddcdd3115ee4717f22e85e0f43569b60dd Mon Sep 17 00:00:00 2001 +From: Peter Hutterer +Date: Tue, 20 Dec 2022 11:40:16 +1000 +Subject: [PATCH xserver] dix: localize two variables + +Signed-off-by: Peter Hutterer +--- + dix/dispatch.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/dix/dispatch.c b/dix/dispatch.c +index c651c3d887..92be773e6c 100644 +--- a/dix/dispatch.c ++++ b/dix/dispatch.c +@@ -3766,14 +3766,11 @@ int + ProcEstablishConnection(ClientPtr client) + { + const char *reason; +- char *auth_proto, *auth_string; + xConnClientPrefix *prefix; + + REQUEST(xReq); + + prefix = (xConnClientPrefix *) ((char *) stuff + sz_xReq); +- auth_proto = (char *) prefix + sz_xConnClientPrefix; +- auth_string = auth_proto + pad_to_int32(prefix->nbytesAuthProto); + + if ((client->req_len << 2) != sz_xReq + sz_xConnClientPrefix + + pad_to_int32(prefix->nbytesAuthProto) + +@@ -3782,12 +3779,15 @@ ProcEstablishConnection(ClientPtr client) + else if ((prefix->majorVersion != X_PROTOCOL) || + (prefix->minorVersion != X_PROTOCOL_REVISION)) + reason = "Protocol version mismatch"; +- else ++ else { ++ char *auth_proto = (char *) prefix + sz_xConnClientPrefix; ++ char *auth_string = auth_proto + pad_to_int32(prefix->nbytesAuthProto); + reason = ClientAuthorized(client, + (unsigned short) prefix->nbytesAuthProto, + auth_proto, + (unsigned short) prefix->nbytesAuthString, + auth_string); ++ } + + return (SendConnSetup(client, reason)); + } +-- +2.39.0 + +From 412777664a20dd3561b936c02c96571a756fe9b2 Mon Sep 17 00:00:00 2001 +From: Peter Hutterer +Date: Tue, 20 Dec 2022 10:42:03 +1000 +Subject: [PATCH xserver] Disallow byte-swapped clients by default + +The X server swapping code is a huge attack surface, much of this code +is untested and prone to security issues. The use-case of byte-swapped +clients is very niche, so let's disable this by default and allow it +only when the respective config option or commandline flag is given. + +For Xorg, this adds the ServerFlag "AllowByteSwappedClients" "on". +For all DDX, this adds the commandline options +byteswappedclients and +-byteswappedclients to enable or disable, respectively. + +Fixes #1201 + +https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1029 + +Signed-off-by: Peter Hutterer +--- + dix/dispatch.c | 4 +++- + hw/xfree86/common/xf86Config.c | 8 ++++++++ + hw/xfree86/man/xorg.conf.man | 2 ++ + hw/xwayland/xwayland.pc.in | 1 + + include/opaque.h | 2 ++ + man/Xserver.man | 6 ++++++ + os/utils.c | 9 +++++++++ + 7 files changed, 31 insertions(+), 1 deletion(-) + +diff --git a/dix/dispatch.c b/dix/dispatch.c +index 92be773e6c..9c26753a96 100644 +--- a/dix/dispatch.c ++++ b/dix/dispatch.c +@@ -3772,7 +3772,9 @@ ProcEstablishConnection(ClientPtr client) + + prefix = (xConnClientPrefix *) ((char *) stuff + sz_xReq); + +- if ((client->req_len << 2) != sz_xReq + sz_xConnClientPrefix + ++ if (client->swapped && !AllowByteSwappedClients) { ++ reason = "Prohibited client endianess, see the Xserver man page "; ++ } else if ((client->req_len << 2) != sz_xReq + sz_xConnClientPrefix + + pad_to_int32(prefix->nbytesAuthProto) + + pad_to_int32(prefix->nbytesAuthString)) + reason = "Bad length"; +diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c +index 5d814c1485..41acb25aa2 100644 +--- a/hw/xfree86/common/xf86Config.c ++++ b/hw/xfree86/common/xf86Config.c +@@ -646,6 +646,7 @@ typedef enum { + FLAG_MAX_CLIENTS, + FLAG_IGLX, + FLAG_DEBUG, ++ FLAG_ALLOW_BYTE_SWAPPED_CLIENTS, + } FlagValues; + + /** +@@ -705,6 +706,8 @@ static OptionInfoRec FlagOptions[] = { + {0}, FALSE}, + {FLAG_DEBUG, "Debug", OPTV_STRING, + {0}, FALSE}, ++ {FLAG_ALLOW_BYTE_SWAPPED_CLIENTS, "AllowByteSwappedClients", OPTV_BOOLEAN, ++ {0}, FALSE}, + {-1, NULL, OPTV_NONE, + {0}, FALSE}, + }; +@@ -746,6 +749,11 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts) + xf86Msg(X_CONFIG, "Ignoring ABI Version\n"); + } + ++ xf86GetOptValBool(FlagOptions, FLAG_ALLOW_BYTE_SWAPPED_CLIENTS, &AllowByteSwappedClients); ++ if (AllowByteSwappedClients) { ++ xf86Msg(X_CONFIG, "Allowing byte-swapped clients\n"); ++ } ++ + if (xf86IsOptionSet(FlagOptions, FLAG_AUTO_ADD_DEVICES)) { + xf86GetOptValBool(FlagOptions, FLAG_AUTO_ADD_DEVICES, + &xf86Info.autoAddDevices); +diff --git a/hw/xfree86/man/xorg.conf.man b/hw/xfree86/man/xorg.conf.man +index 01b47247ee..d057f26ecd 100644 +--- a/hw/xfree86/man/xorg.conf.man ++++ b/hw/xfree86/man/xorg.conf.man +@@ -677,6 +677,8 @@ Possible values are + or + .BR sync . + Unset by default. ++.BI "Option \*qAllowByteSwappedClients\*q \*q" boolean \*q ++Allow clients with a different byte-order than the server. Disabled by default. + .SH "MODULE SECTION" + The + .B Module +diff --git a/include/opaque.h b/include/opaque.h +index 256261c2ad..398d4b4e51 100644 +--- a/include/opaque.h ++++ b/include/opaque.h +@@ -74,4 +74,6 @@ extern _X_EXPORT Bool bgNoneRoot; + extern _X_EXPORT Bool CoreDump; + extern _X_EXPORT Bool NoListenAll; + ++extern _X_EXPORT Bool AllowByteSwappedClients; ++ + #endif /* OPAQUE_H */ +diff --git a/man/Xserver.man b/man/Xserver.man +index 764bd1d907..e7adf9eb35 100644 +--- a/man/Xserver.man ++++ b/man/Xserver.man +@@ -114,6 +114,12 @@ pattern. This is the default unless -retro or -wr is specified. + .B \-bs + disables backing store support on all screens. + .TP 8 ++.B \+byteswappedclients ++Allow connections from clients with an endianess different to that of the server. ++.TP 8 ++.B \-byteswappedclients ++Prohibit connections from clients with an endianess different to that of the server. ++.TP 8 + .B \-c + turns off key-click. + .TP 8 +diff --git a/os/utils.c b/os/utils.c +index fe94912f34..405bf7d8b4 100644 +--- a/os/utils.c ++++ b/os/utils.c +@@ -189,6 +189,8 @@ Bool CoreDump; + + Bool enableIndirectGLX = FALSE; + ++Bool AllowByteSwappedClients = FALSE; ++ + #ifdef PANORAMIX + Bool PanoramiXExtensionDisabledHack = FALSE; + #endif +@@ -523,6 +525,8 @@ UseMsg(void) + ErrorF("-br create root window with black background\n"); + ErrorF("+bs enable any backing store support\n"); + ErrorF("-bs disable any backing store support\n"); ++ ErrorF("+byteswappedclients Allow clients with endianess different to that of the server\n"); ++ ErrorF("-byteswappedclients Prohibit clients with endianess different to that of the server\n"); + ErrorF("-c turns off key-click\n"); + ErrorF("c # key-click volume (0-100)\n"); + ErrorF("-cc int default color visual class\n"); +@@ -720,6 +724,11 @@ ProcessCommandLine(int argc, char *argv[]) + else + UseMsg(); + } ++ else if (strcmp(argv[i], "-byteswappedclients") == 0) { ++ AllowByteSwappedClients = FALSE; ++ } else if (strcmp(argv[i], "+byteswappedclients") == 0) { ++ AllowByteSwappedClients = TRUE; ++ } + else if (strcmp(argv[i], "-br") == 0); /* default */ + else if (strcmp(argv[i], "+bs") == 0) + enableBackingStore = TRUE; +-- +2.39.0 + diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index a79dac2..3fd8caf 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -46,7 +46,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.20.14 -Release: 13%{?gitdate:.%{gitdate}}%{?dist} +Release: 14%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org License: MIT @@ -135,6 +135,12 @@ Patch121: 0007-xkb-reset-the-radio_groups-pointer-to-NULL-after-fre.patch # Fix for buggy patch to CVE-2022-46340 Patch122: 0008-Xext-fix-invalid-event-type-mask-in-XTestSwapFakeInp.patch +# Only on F38 and later +%if 0%{fedora} >= 38 +# Upstream commits 73d6e88, f69280dd and 4127776, minus the xwayland.pc.in change +Patch200: 0001-Disallow-byte-swapped-clients-by-default.patch +%endif + BuildRequires: make BuildRequires: systemtap-sdt-devel BuildRequires: git-core @@ -548,6 +554,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Fri Jan 13 2023 Peter Hutterer - 1.20.14-14 +- Disallow byte-swapped clients (#2159489) + * Wed Jan 11 2023 Olivier Fourdan - 1.20.14-13 - Rename boolean config value field from bool to boolean to fix drivers build failures due to a conflict with C++ and stdbool.h From 6c12217df8fda831add4b16f1b1a203973c71bf8 Mon Sep 17 00:00:00 2001 From: Leif Liddy Date: Thu, 12 Jan 2023 11:57:17 +0100 Subject: [PATCH 080/131] resolve Xorg server DCP display issue (#2152414) Xorg server does not correctly select the DCP for the display without a quirk --- 0001-add-a-quirk-for-apple-silicon.patch | 30 +++++++++++++++++++ 10-quirks.conf | 38 ------------------------ xorg-x11-server.spec | 12 ++++---- 3 files changed, 36 insertions(+), 44 deletions(-) create mode 100644 0001-add-a-quirk-for-apple-silicon.patch delete mode 100644 10-quirks.conf diff --git a/0001-add-a-quirk-for-apple-silicon.patch b/0001-add-a-quirk-for-apple-silicon.patch new file mode 100644 index 0000000..17c40e5 --- /dev/null +++ b/0001-add-a-quirk-for-apple-silicon.patch @@ -0,0 +1,30 @@ +commit 39934a656a44722d16a80bf4db411c53e2d67b38 (HEAD -> master, origin/master, origin/HEAD) +Author: Eric Curtin +Date: Fri Dec 16 11:10:12 2022 +0000 + + config: add a quirk for Apple Silicon appledrm + + Xorg server does not correctly select the DCP for the display without a + quirk on Apple Silicon. + + Signed-off-by: Eric Curtin + Suggested-by: Hector Martin + +diff --git a/config/10-quirks.conf b/config/10-quirks.conf +index 47907d82d..54dd908a7 100644 +--- a/config/10-quirks.conf ++++ b/config/10-quirks.conf +@@ -36,3 +36,13 @@ Section "InputClass" + MatchDriver "evdev" + Option "TypeName" "MOUSE" + EndSection ++ ++# https://bugzilla.redhat.com/show_bug.cgi?id=2152414 ++# Xorg server does not correctly select the DCP for the display without ++# a quirk on Apple Silicon ++Section "OutputClass" ++ Identifier "appledrm" ++ MatchDriver "apple" ++ Driver "modesetting" ++ Option "PrimaryGPU" "true" ++EndSection diff --git a/10-quirks.conf b/10-quirks.conf deleted file mode 100644 index 47907d8..0000000 --- a/10-quirks.conf +++ /dev/null @@ -1,38 +0,0 @@ -# Collection of quirks and blacklist/whitelists for specific devices. - - -# Accelerometer device, posts data through ABS_X/ABS_Y, making X unusable -# http://bugs.freedesktop.org/show_bug.cgi?id=22442 -Section "InputClass" - Identifier "ThinkPad HDAPS accelerometer blacklist" - MatchProduct "ThinkPad HDAPS accelerometer data" - Option "Ignore" "on" -EndSection - -# https://bugzilla.redhat.com/show_bug.cgi?id=523914 -# Mouse does not move in PV Xen guest -# Explicitly tell evdev to not ignore the absolute axes. -Section "InputClass" - Identifier "Xen Virtual Pointer axis blacklist" - MatchProduct "Xen Virtual Pointer" - Option "IgnoreAbsoluteAxes" "off" - Option "IgnoreRelativeAxes" "off" -EndSection - -# https://bugs.freedesktop.org/show_bug.cgi?id=55867 -# Bug 55867 - Doesn't know how to tag XI_TRACKBALL -Section "InputClass" - Identifier "Tag trackballs as XI_TRACKBALL" - MatchProduct "trackball" - MatchDriver "evdev" - Option "TypeName" "TRACKBALL" -EndSection - -# https://bugs.freedesktop.org/show_bug.cgi?id=62831 -# Bug 62831 - Mionix Naos 5000 mouse detected incorrectly -Section "InputClass" - Identifier "Tag Mionix Naos 5000 mouse XI_MOUSE" - MatchProduct "La-VIEW Technology Naos 5000 Mouse" - MatchDriver "evdev" - Option "TypeName" "MOUSE" -EndSection diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 3fd8caf..2cfb3ec 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -46,7 +46,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.20.14 -Release: 14%{?gitdate:.%{gitdate}}%{?dist} +Release: 15%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org License: MIT @@ -63,8 +63,6 @@ Source0: https://www.x.org/pub/individual/xserver/%{pkgname}-%{version}.tar.xz Source1: gitignore %endif -Source4: 10-quirks.conf - Source10: xserver.pamd # "useful" xvfb-run script @@ -107,6 +105,7 @@ Patch101: 0001-render-Fix-build-with-gcc-12.patch Patch102: 0001-xf86-Accept-devices-with-the-simpledrm-driver.patch Patch103: 0001-Don-t-hardcode-fps-for-fake-screen.patch Patch104: 0001-hw-Rename-boolean-config-value-field-from-bool-to-bo.patch +Patch105: 0001-add-a-quirk-for-apple-silicon.patch # CVE-2022-2319/ZDI-CAN-16062, CVE-2022-2320/ZDI-CAN-16070 Patch110: 0001-xkb-switch-to-array-index-loops-to-moving-pointers.patch @@ -408,9 +407,6 @@ mkdir -p $RPM_BUILD_ROOT%{_libdir}/xorg/modules/{drivers,input} mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/pam.d install -m 644 %{SOURCE10} $RPM_BUILD_ROOT%{_sysconfdir}/pam.d/xserver -mkdir -p $RPM_BUILD_ROOT%{_datadir}/X11/xorg.conf.d -install -m 644 %{SOURCE4} $RPM_BUILD_ROOT%{_datadir}/X11/xorg.conf.d - # make sure the (empty) /etc/X11/xorg.conf.d is there, system-setup-keyboard # relies on it more or less. mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/X11/xorg.conf.d @@ -554,6 +550,10 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Fri Jan 13 2023 Leif Liddy 1.20.14-15 +- Xorg server does not correctly select the DCP for the display + without a quirk on Apple silicon machines (#2152414) + * Fri Jan 13 2023 Peter Hutterer - 1.20.14-14 - Disallow byte-swapped clients (#2159489) From 743d53fc693d797a9aabefe0bb9aba63cbe6d05e Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Tue, 17 Jan 2023 17:12:15 +0100 Subject: [PATCH 081/131] Use the recommended way to apply conditional patches https://docs.fedoraproject.org/en-US/packaging-guidelines/SourceURL/#_do_not_conditionalize_sources --- xorg-x11-server.spec | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 2cfb3ec..be5d1f1 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -46,7 +46,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.20.14 -Release: 15%{?gitdate:.%{gitdate}}%{?dist} +Release: 16%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org License: MIT @@ -134,11 +134,9 @@ Patch121: 0007-xkb-reset-the-radio_groups-pointer-to-NULL-after-fre.patch # Fix for buggy patch to CVE-2022-46340 Patch122: 0008-Xext-fix-invalid-event-type-mask-in-XTestSwapFakeInp.patch -# Only on F38 and later -%if 0%{fedora} >= 38 +# Only on F38 and later (patch number starts at 3801, see autopatch below) # Upstream commits 73d6e88, f69280dd and 4127776, minus the xwayland.pc.in change -Patch200: 0001-Disallow-byte-swapped-clients-by-default.patch -%endif +Patch3801: 0001-Disallow-byte-swapped-clients-by-default.patch BuildRequires: make BuildRequires: systemtap-sdt-devel @@ -327,7 +325,11 @@ cp %{SOURCE1} .gitignore # ick %global __scm git %{expand:%__scm_setup_git -q} +%if 0%{fedora} >= 38 %autopatch +%else +%autopatch -M 3800 +%endif %if 0%{?stable_abi} # check the ABI in the source against what we expect. @@ -550,6 +552,10 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Tue Jan 17 2023 Olivier Fourdan - 1.20.14-16 +- Use the recommended way to apply conditional patches without + conditionalizing the sources (for byte-swapped clients). + * Fri Jan 13 2023 Leif Liddy 1.20.14-15 - Xorg server does not correctly select the DCP for the display without a quirk on Apple silicon machines (#2152414) From 50af4f1fc6d205eb636df1459c071467ef161e14 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 1 Feb 2023 14:27:20 +1000 Subject: [PATCH 082/131] Updated conditional fedora statement --- xorg-x11-server.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index be5d1f1..c689d4e 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -46,7 +46,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.20.14 -Release: 16%{?gitdate:.%{gitdate}}%{?dist} +Release: 17%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org License: MIT @@ -325,7 +325,7 @@ cp %{SOURCE1} .gitignore # ick %global __scm git %{expand:%__scm_setup_git -q} -%if 0%{fedora} >= 38 +%if 0%{?fedora} >= 38 %autopatch %else %autopatch -M 3800 @@ -552,6 +552,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Wed Feb 01 2023 Peter Hutterer - 1.20.14-17 +- Updated conditional fedora statement + * Tue Jan 17 2023 Olivier Fourdan - 1.20.14-16 - Use the recommended way to apply conditional patches without conditionalizing the sources (for byte-swapped clients). From 996eaa843f218b2e237334460c31ac4c2d221f53 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 2 Feb 2023 15:32:24 +1000 Subject: [PATCH 083/131] CVE-2023-0494: potential use-after-free --- ...-use-after-free-in-DeepCopyPointerCl.patch | 35 +++++++++++++++++++ xorg-x11-server.spec | 7 +++- 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 0001-Xi-fix-potential-use-after-free-in-DeepCopyPointerCl.patch diff --git a/0001-Xi-fix-potential-use-after-free-in-DeepCopyPointerCl.patch b/0001-Xi-fix-potential-use-after-free-in-DeepCopyPointerCl.patch new file mode 100644 index 0000000..2389895 --- /dev/null +++ b/0001-Xi-fix-potential-use-after-free-in-DeepCopyPointerCl.patch @@ -0,0 +1,35 @@ +From 7150ba655c0cc08fa6ded309b81265bb672f2869 Mon Sep 17 00:00:00 2001 +From: Peter Hutterer +Date: Wed, 25 Jan 2023 11:41:40 +1000 +Subject: [PATCH xserver] Xi: fix potential use-after-free in + DeepCopyPointerClasses + +CVE-2023-0494, ZDI-CAN 19596 + +This vulnerability was discovered by: +Jan-Niklas Sohn working with Trend Micro Zero Day Initiative + +Signed-off-by: Peter Hutterer +--- + Xi/exevents.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/Xi/exevents.c b/Xi/exevents.c +index 217baa9561..dcd4efb3bc 100644 +--- a/Xi/exevents.c ++++ b/Xi/exevents.c +@@ -619,8 +619,10 @@ DeepCopyPointerClasses(DeviceIntPtr from, DeviceIntPtr to) + memcpy(to->button->xkb_acts, from->button->xkb_acts, + sizeof(XkbAction)); + } +- else ++ else { + free(to->button->xkb_acts); ++ to->button->xkb_acts = NULL; ++ } + + memcpy(to->button->labels, from->button->labels, + from->button->numButtons * sizeof(Atom)); +-- +2.39.0 + diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index c689d4e..0c2a07e 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -46,7 +46,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.20.14 -Release: 17%{?gitdate:.%{gitdate}}%{?dist} +Release: 18%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org License: MIT @@ -133,6 +133,8 @@ Patch120: 0006-Xext-free-the-XvRTVideoNotify-when-turning-off-from-.patch Patch121: 0007-xkb-reset-the-radio_groups-pointer-to-NULL-after-fre.patch # Fix for buggy patch to CVE-2022-46340 Patch122: 0008-Xext-fix-invalid-event-type-mask-in-XTestSwapFakeInp.patch +# CVE-2023-0494 +Patch123: 0001-Xi-fix-potential-use-after-free-in-DeepCopyPointerCl.patch # Only on F38 and later (patch number starts at 3801, see autopatch below) # Upstream commits 73d6e88, f69280dd and 4127776, minus the xwayland.pc.in change @@ -552,6 +554,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Thu Feb 02 2023 Peter Hutterer - 1.20.14-18 +- CVE-2023-0494: potential use-after-free + * Wed Feb 01 2023 Peter Hutterer - 1.20.14-17 - Updated conditional fedora statement From 7c9187a0934bb176ae8f46c0a11fc6dee3488c35 Mon Sep 17 00:00:00 2001 From: Iker Pedrosa Date: Mon, 6 Feb 2023 12:09:39 +0100 Subject: [PATCH 084/131] Remove pam_console from service file pam_console is being removed as it was replaced by ConsoleKit, and later by systemd-logind. Most probably the migration was already done years ago as I don't see any specific configuration file for pam_console. This change only removes pam_console from the service file. If you are curious about the removal check the Fedora System-Wide Change proposal linked below. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1822209 Relates: https://fedoraproject.org/wiki/Changes/RemovePamConsole Relates: https://bugzilla.redhat.com/show_bug.cgi?id=2166692 Signed-off-by: Iker Pedrosa --- xorg-x11-server.spec | 5 ++++- xserver.pamd | 1 - 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 0c2a07e..5c4ddfd 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -46,7 +46,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.20.14 -Release: 18%{?gitdate:.%{gitdate}}%{?dist} +Release: 19%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org License: MIT @@ -554,6 +554,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Thu Feb 09 2023 Iker Pedrosa - 1.20.14-19 +- Remove pam_console from service file (#1822209) + * Thu Feb 02 2023 Peter Hutterer - 1.20.14-18 - CVE-2023-0494: potential use-after-free diff --git a/xserver.pamd b/xserver.pamd index bf79930..9374ff6 100644 --- a/xserver.pamd +++ b/xserver.pamd @@ -1,5 +1,4 @@ #%PAM-1.0 auth sufficient pam_rootok.so -auth required pam_console.so account required pam_permit.so session optional pam_keyinit.so force revoke From 31ea8b9649d0ba2dca56c218edcfd39530181c3e Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Thu, 23 Feb 2023 09:09:36 +0100 Subject: [PATCH 085/131] Fix xvfb-run script with --listen-tcp --- xorg-x11-server.spec | 5 ++++- xvfb-run.sh | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 5c4ddfd..cfd9c76 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -46,7 +46,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.20.14 -Release: 19%{?gitdate:.%{gitdate}}%{?dist} +Release: 20%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org License: MIT @@ -554,6 +554,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Thu Feb 23 2023 Olivier Fourdan - 1.20.14-20 +- Fix xvfb-run script with --listen-tcp + * Thu Feb 09 2023 Iker Pedrosa - 1.20.14-19 - Remove pam_console from service file (#1822209) diff --git a/xvfb-run.sh b/xvfb-run.sh index 9d088c1..5d4447b 100644 --- a/xvfb-run.sh +++ b/xvfb-run.sh @@ -120,7 +120,7 @@ while :; do -f|--auth-file) AUTHFILE="$2"; shift ;; -h|--help) SHOWHELP="yes" ;; -n|--server-num) SERVERNUM="$2"; shift ;; - -l|--listen-tcp) LISTENTCP="" ;; + -l|--listen-tcp) LISTENTCP="-listen tcp" ;; -p|--xauth-protocol) XAUTHPROTO="$2"; shift ;; -s|--server-args) XVFBARGS="$2"; shift ;; -w|--wait) STARTWAIT="$2"; shift ;; From 21269fd4b752289d8f45277ac9a92bb6bb72dcc1 Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Wed, 29 Mar 2023 15:36:30 +0200 Subject: [PATCH 086/131] Fix for CVE-2023-1393 --- ...posite-Fix-use-after-free-of-the-COW.patch | 42 +++++++++++++++++++ xorg-x11-server.spec | 7 +++- 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 0001-composite-Fix-use-after-free-of-the-COW.patch diff --git a/0001-composite-Fix-use-after-free-of-the-COW.patch b/0001-composite-Fix-use-after-free-of-the-COW.patch new file mode 100644 index 0000000..bb21d7e --- /dev/null +++ b/0001-composite-Fix-use-after-free-of-the-COW.patch @@ -0,0 +1,42 @@ +From 26ef545b3502f61ca722a7a3373507e88ef64110 Mon Sep 17 00:00:00 2001 +From: Olivier Fourdan +Date: Mon, 13 Mar 2023 11:08:47 +0100 +Subject: [PATCH xserver] composite: Fix use-after-free of the COW + +ZDI-CAN-19866/CVE-2023-1393 + +If a client explicitly destroys the compositor overlay window (aka COW), +we would leave a dangling pointer to that window in the CompScreen +structure, which will trigger a use-after-free later. + +Make sure to clear the CompScreen pointer to the COW when the latter gets +destroyed explicitly by the client. + +This vulnerability was discovered by: +Jan-Niklas Sohn working with Trend Micro Zero Day Initiative + +Signed-off-by: Olivier Fourdan +Reviewed-by: Adam Jackson +--- + composite/compwindow.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/composite/compwindow.c b/composite/compwindow.c +index 4e2494b86..b30da589e 100644 +--- a/composite/compwindow.c ++++ b/composite/compwindow.c +@@ -620,6 +620,11 @@ compDestroyWindow(WindowPtr pWin) + ret = (*pScreen->DestroyWindow) (pWin); + cs->DestroyWindow = pScreen->DestroyWindow; + pScreen->DestroyWindow = compDestroyWindow; ++ ++ /* Did we just destroy the overlay window? */ ++ if (pWin == cs->pOverlayWin) ++ cs->pOverlayWin = NULL; ++ + /* compCheckTree (pWin->drawable.pScreen); can't check -- tree isn't good*/ + return ret; + } +-- +2.40.0 + diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index cfd9c76..53f1d75 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -46,7 +46,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.20.14 -Release: 20%{?gitdate:.%{gitdate}}%{?dist} +Release: 21%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org License: MIT @@ -135,6 +135,8 @@ Patch121: 0007-xkb-reset-the-radio_groups-pointer-to-NULL-after-fre.patch Patch122: 0008-Xext-fix-invalid-event-type-mask-in-XTestSwapFakeInp.patch # CVE-2023-0494 Patch123: 0001-Xi-fix-potential-use-after-free-in-DeepCopyPointerCl.patch +# CVE-2023-1393 +Patch124: 0001-composite-Fix-use-after-free-of-the-COW.patch # Only on F38 and later (patch number starts at 3801, see autopatch below) # Upstream commits 73d6e88, f69280dd and 4127776, minus the xwayland.pc.in change @@ -554,6 +556,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Wed Mar 29 2023 Olivier Fourdan - 1.20.14-21 +- CVE fix for: CVE-2023-1393 + * Thu Feb 23 2023 Olivier Fourdan - 1.20.14-20 - Fix xvfb-run script with --listen-tcp From c2b6cc043d2760f168e97ce7860c344357645e25 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Thu, 13 Apr 2023 15:48:20 +0200 Subject: [PATCH 087/131] Make more functions available in fb.h with !FB_ACCESS_WRAPPER Related to: --- xorg-x11-server-fb-access-wrapper.patch | 31 +++++++++++++++++++++++++ xorg-x11-server.spec | 7 +++++- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 xorg-x11-server-fb-access-wrapper.patch diff --git a/xorg-x11-server-fb-access-wrapper.patch b/xorg-x11-server-fb-access-wrapper.patch new file mode 100644 index 0000000..7bb0e23 --- /dev/null +++ b/xorg-x11-server-fb-access-wrapper.patch @@ -0,0 +1,31 @@ +fb: Declare wfbFinishScreenInit, wfbScreenInit for !FB_ACCESS_WRAPPER + +xorg-x11-drv-nouveau wfbScreenInit without defining FB_ACCESS_WRAPPER +(which has other unintended side effects). Presently, this compiles +and links because compilers still support implicit function +declarations, but this is going to change fairly soon. This seems to +be the most straightforward change to keep the driver building. + +Submitted upstream: + + + +diff -ur xorg-server-1.20.14.orig/fb/fb.h xorg-server-1.20.14/fb/fb.h +--- xorg-server-1.20.14.orig/fb/fb.h 2021-12-15 20:01:24.000000000 +0100 ++++ xorg-server-1.20.14/fb/fb.h 2023-04-13 13:59:47.325341537 +0200 +@@ -1027,7 +1027,6 @@ + int dpiy, int width, /* pixel width of frame buffer */ + int bpp); /* bits per pixel of frame buffer */ + +-#ifdef FB_ACCESS_WRAPPER + extern _X_EXPORT Bool + wfbFinishScreenInit(ScreenPtr pScreen, + void *pbits, +@@ -1049,7 +1048,6 @@ + int width, + int bpp, + SetupWrapProcPtr setupWrap, FinishWrapProcPtr finishWrap); +-#endif + + extern _X_EXPORT Bool + fbFinishScreenInit(ScreenPtr pScreen, diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 53f1d75..2086fcd 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -46,7 +46,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.20.14 -Release: 21%{?gitdate:.%{gitdate}}%{?dist} +Release: 22%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org License: MIT @@ -138,6 +138,8 @@ Patch123: 0001-Xi-fix-potential-use-after-free-in-DeepCopyPointerCl.patch # CVE-2023-1393 Patch124: 0001-composite-Fix-use-after-free-of-the-COW.patch +Patch125: xorg-x11-server-fb-access-wrapper.patch + # Only on F38 and later (patch number starts at 3801, see autopatch below) # Upstream commits 73d6e88, f69280dd and 4127776, minus the xwayland.pc.in change Patch3801: 0001-Disallow-byte-swapped-clients-by-default.patch @@ -556,6 +558,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Thu Apr 13 2023 Florian Weimer - 1.20.14-22 +- Make more functions available in fb.h with !FB_ACCESS_WRAPPER + * Wed Mar 29 2023 Olivier Fourdan - 1.20.14-21 - CVE fix for: CVE-2023-1393 From a3932dc93a2738b8ce64b45b18107c12588c4ffc Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Tue, 25 Apr 2023 10:49:16 +0200 Subject: [PATCH 088/131] Backport fix for a deadlock with DRI3 See https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1057 and https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21339 Resolves: #2189434 --- ...resentConfigureNotify-event-for-dest.patch | 105 ++++++++++++++++++ xorg-x11-server.spec | 9 +- 2 files changed, 112 insertions(+), 2 deletions(-) create mode 100644 0001-present-Send-a-PresentConfigureNotify-event-for-dest.patch diff --git a/0001-present-Send-a-PresentConfigureNotify-event-for-dest.patch b/0001-present-Send-a-PresentConfigureNotify-event-for-dest.patch new file mode 100644 index 0000000..d9eea48 --- /dev/null +++ b/0001-present-Send-a-PresentConfigureNotify-event-for-dest.patch @@ -0,0 +1,105 @@ +From b98fc07d3442a289c6bef82df50dd0a2d01de71a Mon Sep 17 00:00:00 2001 +From: Adam Jackson +Date: Thu, 2 Feb 2023 12:26:27 -0500 +Subject: [PATCH xserver] present: Send a PresentConfigureNotify event for + destroyed windows +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This enables fixing a deadlock case on the client side, where the client +ends up blocked waiting for a Present event that will never come because +the window was destroyed. The new PresentWindowDestroyed flag allows the +client to avoid blocking indefinitely. + +Signed-off-by: Adam Jackson +See-also: https://gitlab.freedesktop.org/mesa/mesa/-/issues/116 +See-also: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6685 +Reviewed-by: Michel Dänzer +(cherry picked from commit 462b06033e66a32308d940eb5fc47f5e4c914dc0) +--- + present/present_event.c | 5 +++-- + present/present_priv.h | 7 ++++++- + present/present_screen.c | 11 ++++++++++- + 3 files changed, 19 insertions(+), 4 deletions(-) + +diff --git a/present/present_event.c b/present/present_event.c +index 435b26b70..849732dc8 100644 +--- a/present/present_event.c ++++ b/present/present_event.c +@@ -102,7 +102,8 @@ present_event_swap(xGenericEvent *from, xGenericEvent *to) + } + + void +-present_send_config_notify(WindowPtr window, int x, int y, int w, int h, int bw, WindowPtr sibling) ++present_send_config_notify(WindowPtr window, int x, int y, int w, int h, ++ int bw, WindowPtr sibling, CARD32 flags) + { + present_window_priv_ptr window_priv = present_window_priv(window); + +@@ -122,7 +123,7 @@ present_send_config_notify(WindowPtr window, int x, int y, int w, int h, int bw, + .off_y = 0, + .pixmap_width = w, + .pixmap_height = h, +- .pixmap_flags = 0 ++ .pixmap_flags = flags + }; + present_event_ptr event; + +diff --git a/present/present_priv.h b/present/present_priv.h +index 6ebd009a2..4ad729864 100644 +--- a/present/present_priv.h ++++ b/present/present_priv.h +@@ -43,6 +43,11 @@ + #define DebugPresent(x) + #endif + ++/* XXX this belongs in presentproto */ ++#ifndef PresentWindowDestroyed ++#define PresentWindowDestroyed (1 << 0) ++#endif ++ + extern int present_request; + + extern DevPrivateKeyRec present_screen_private_key; +@@ -307,7 +312,7 @@ void + present_free_events(WindowPtr window); + + void +-present_send_config_notify(WindowPtr window, int x, int y, int w, int h, int bw, WindowPtr sibling); ++present_send_config_notify(WindowPtr window, int x, int y, int w, int h, int bw, WindowPtr sibling, CARD32 flags); + + void + present_send_complete_notify(WindowPtr window, CARD8 kind, CARD8 mode, CARD32 serial, uint64_t ust, uint64_t msc); +diff --git a/present/present_screen.c b/present/present_screen.c +index 15684eda4..2c29aafd2 100644 +--- a/present/present_screen.c ++++ b/present/present_screen.c +@@ -93,6 +93,15 @@ present_destroy_window(WindowPtr window) + present_screen_priv_ptr screen_priv = present_screen_priv(screen); + present_window_priv_ptr window_priv = present_window_priv(window); + ++ present_send_config_notify(window, ++ window->drawable.x, ++ window->drawable.y, ++ window->drawable.width, ++ window->drawable.height, ++ window->borderWidth, ++ window->nextSib, ++ PresentWindowDestroyed); ++ + if (window_priv) { + present_clear_window_notifies(window); + present_free_events(window); +@@ -123,7 +132,7 @@ present_config_notify(WindowPtr window, + ScreenPtr screen = window->drawable.pScreen; + present_screen_priv_ptr screen_priv = present_screen_priv(screen); + +- present_send_config_notify(window, x, y, w, h, bw, sibling); ++ present_send_config_notify(window, x, y, w, h, bw, sibling, 0); + + unwrap(screen_priv, screen, ConfigNotify); + if (screen->ConfigNotify) +-- +2.40.0 + diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 2086fcd..26d66b7 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -46,7 +46,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.20.14 -Release: 22%{?gitdate:.%{gitdate}}%{?dist} +Release: 23%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org License: MIT @@ -137,8 +137,10 @@ Patch122: 0008-Xext-fix-invalid-event-type-mask-in-XTestSwapFakeInp.patch Patch123: 0001-Xi-fix-potential-use-after-free-in-DeepCopyPointerCl.patch # CVE-2023-1393 Patch124: 0001-composite-Fix-use-after-free-of-the-COW.patch - +# https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1114 Patch125: xorg-x11-server-fb-access-wrapper.patch +# https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1057 +Patch126: 0001-present-Send-a-PresentConfigureNotify-event-for-dest.patch # Only on F38 and later (patch number starts at 3801, see autopatch below) # Upstream commits 73d6e88, f69280dd and 4127776, minus the xwayland.pc.in change @@ -558,6 +560,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Tue Apr 25 2023 Olivier Fourdan - 1.20.14-23 +- Backport fix for a deadlock with DRI3 (#2189434) + * Thu Apr 13 2023 Florian Weimer - 1.20.14-22 - Make more functions available in fb.h with !FB_ACCESS_WRAPPER From 78721b7ea482c93d27905fdf090063fb91a3c666 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 22 Jul 2023 19:11:32 +0000 Subject: [PATCH 089/131] Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- xorg-x11-server.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 26d66b7..fa40e3e 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -46,7 +46,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.20.14 -Release: 23%{?gitdate:.%{gitdate}}%{?dist} +Release: 24%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org License: MIT @@ -560,6 +560,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Sat Jul 22 2023 Fedora Release Engineering - 1.20.14-24 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + * Tue Apr 25 2023 Olivier Fourdan - 1.20.14-23 - Backport fix for a deadlock with DRI3 (#2189434) From fdd7c4bbd1151dc311da2f82297f70df2b035700 Mon Sep 17 00:00:00 2001 From: Orion Poplawski Date: Thu, 28 Sep 2023 21:16:17 -0600 Subject: [PATCH 090/131] Fix xvfb-run --error-file / auth-file options --- xorg-x11-server.spec | 5 ++++- xvfb-run.sh | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index fa40e3e..4f76f9a 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -46,7 +46,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.20.14 -Release: 24%{?gitdate:.%{gitdate}}%{?dist} +Release: 25%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org License: MIT @@ -560,6 +560,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Fri Sep 29 2023 Orion Poplawski - 1.20.14-25 +- Fix xvfb-run --error-file / auth-file options + * Sat Jul 22 2023 Fedora Release Engineering - 1.20.14-24 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild diff --git a/xvfb-run.sh b/xvfb-run.sh index 5d4447b..dec7dfc 100644 --- a/xvfb-run.sh +++ b/xvfb-run.sh @@ -101,7 +101,7 @@ find_free_servernum() { # Parse the command line. ARGS=$(getopt --options +ade:f:hn:lp:s:w: \ - --long auto-servernum,error-file:auth-file:,help,server-num:,listen-tcp,xauth-protocol:,server-args:,wait: \ + --long auto-servernum,error-file:,auth-file:,help,server-num:,listen-tcp,xauth-protocol:,server-args:,wait: \ --name "$PROGNAME" -- "$@") GETOPT_STATUS=$? From 28a268e0aa19293ea5cfe3736bf014aa6b02ccac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Exp=C3=B3sito?= Date: Fri, 20 Oct 2023 17:38:41 +0200 Subject: [PATCH 091/131] SPDX migration: license is already SPDX compatible --- xorg-x11-server.spec | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 4f76f9a..36e248d 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -48,6 +48,7 @@ Name: xorg-x11-server Version: 1.20.14 Release: 25%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org +# SPDX License: MIT #VCS: git:git://git.freedesktop.org/git/xorg/xserver @@ -560,6 +561,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Fri Oct 20 2023 José Expósito +- SPDX migration: license is already SPDX compatible + * Fri Sep 29 2023 Orion Poplawski - 1.20.14-25 - Fix xvfb-run --error-file / auth-file options From 54e15127aead5542e24995da0955e72348bc4bf8 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 17 Oct 2023 15:42:37 +1000 Subject: [PATCH 092/131] CVE fix for: CVE-2023-5367, CVE-2023-5380 --- ...x-handling-of-PropModeAppend-Prepend.patch | 80 +++++++++++++++ ...nterWindows-reference-on-screen-swit.patch | 99 +++++++++++++++++++ xorg-x11-server.spec | 11 ++- 3 files changed, 189 insertions(+), 1 deletion(-) create mode 100644 0001-Xi-randr-fix-handling-of-PropModeAppend-Prepend.patch create mode 100644 0002-mi-reset-the-PointerWindows-reference-on-screen-swit.patch diff --git a/0001-Xi-randr-fix-handling-of-PropModeAppend-Prepend.patch b/0001-Xi-randr-fix-handling-of-PropModeAppend-Prepend.patch new file mode 100644 index 0000000..99625dd --- /dev/null +++ b/0001-Xi-randr-fix-handling-of-PropModeAppend-Prepend.patch @@ -0,0 +1,80 @@ +From a31ba141824a7649e11f0ef7673718ce559d6337 Mon Sep 17 00:00:00 2001 +From: Peter Hutterer +Date: Tue, 3 Oct 2023 11:53:05 +1000 +Subject: [PATCH xserver 1/4] Xi/randr: fix handling of PropModeAppend/Prepend + +The handling of appending/prepending properties was incorrect, with at +least two bugs: the property length was set to the length of the new +part only, i.e. appending or prepending N elements to a property with P +existing elements always resulted in the property having N elements +instead of N + P. + +Second, when pre-pending a value to a property, the offset for the old +values was incorrect, leaving the new property with potentially +uninitalized values and/or resulting in OOB memory writes. +For example, prepending a 3 element value to a 5 element property would +result in this 8 value array: + [N, N, N, ?, ?, P, P, P ] P, P + ^OOB write + +The XI2 code is a copy/paste of the RandR code, so the bug exists in +both. + +CVE-2023-5367, ZDI-CAN-22153 + +This vulnerability was discovered by: +Jan-Niklas Sohn working with Trend Micro Zero Day Initiative + +Signed-off-by: Peter Hutterer +--- + Xi/xiproperty.c | 4 ++-- + randr/rrproperty.c | 4 ++-- + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/Xi/xiproperty.c b/Xi/xiproperty.c +index 6ec419e870..563c4f31a5 100644 +--- a/Xi/xiproperty.c ++++ b/Xi/xiproperty.c +@@ -730,7 +730,7 @@ XIChangeDeviceProperty(DeviceIntPtr dev, Atom property, Atom type, + XIDestroyDeviceProperty(prop); + return BadAlloc; + } +- new_value.size = len; ++ new_value.size = total_len; + new_value.type = type; + new_value.format = format; + +@@ -747,7 +747,7 @@ XIChangeDeviceProperty(DeviceIntPtr dev, Atom property, Atom type, + case PropModePrepend: + new_data = new_value.data; + old_data = (void *) (((char *) new_value.data) + +- (prop_value->size * size_in_bytes)); ++ (len * size_in_bytes)); + break; + } + if (new_data) +diff --git a/randr/rrproperty.c b/randr/rrproperty.c +index c2fb9585c6..25469f57b2 100644 +--- a/randr/rrproperty.c ++++ b/randr/rrproperty.c +@@ -209,7 +209,7 @@ RRChangeOutputProperty(RROutputPtr output, Atom property, Atom type, + RRDestroyOutputProperty(prop); + return BadAlloc; + } +- new_value.size = len; ++ new_value.size = total_len; + new_value.type = type; + new_value.format = format; + +@@ -226,7 +226,7 @@ RRChangeOutputProperty(RROutputPtr output, Atom property, Atom type, + case PropModePrepend: + new_data = new_value.data; + old_data = (void *) (((char *) new_value.data) + +- (prop_value->size * size_in_bytes)); ++ (len * size_in_bytes)); + break; + } + if (new_data) +-- +2.41.0 + diff --git a/0002-mi-reset-the-PointerWindows-reference-on-screen-swit.patch b/0002-mi-reset-the-PointerWindows-reference-on-screen-swit.patch new file mode 100644 index 0000000..cbe9804 --- /dev/null +++ b/0002-mi-reset-the-PointerWindows-reference-on-screen-swit.patch @@ -0,0 +1,99 @@ +From 004f461c440cb6611eefb48fbbb4fa53a6d49f80 Mon Sep 17 00:00:00 2001 +From: Peter Hutterer +Date: Thu, 5 Oct 2023 12:19:45 +1000 +Subject: [PATCH xserver 2/4] mi: reset the PointerWindows reference on screen + switch + +PointerWindows[] keeps a reference to the last window our sprite +entered - changes are usually handled by CheckMotion(). + +If we switch between screens via XWarpPointer our +dev->spriteInfo->sprite->win is set to the new screen's root window. +If there's another window at the cursor location CheckMotion() will +trigger the right enter/leave events later. If there is not, it skips +that process and we never trigger LeaveWindow() - PointerWindows[] for +the device still refers to the previous window. + +If that window is destroyed we have a dangling reference that will +eventually cause a use-after-free bug when checking the window hierarchy +later. + +To trigger this, we require: +- two protocol screens +- XWarpPointer to the other screen's root window +- XDestroyWindow before entering any other window + +This is a niche bug so we hack around it by making sure we reset the +PointerWindows[] entry so we cannot have a dangling pointer. This +doesn't handle Enter/Leave events correctly but the previous code didn't +either. + +CVE-2023-5380, ZDI-CAN-21608 + +This vulnerability was discovered by: +Sri working with Trend Micro Zero Day Initiative + +Signed-off-by: Peter Hutterer +Reviewed-by: Adam Jackson +--- + dix/enterleave.h | 2 -- + include/eventstr.h | 3 +++ + mi/mipointer.c | 17 +++++++++++++++-- + 3 files changed, 18 insertions(+), 4 deletions(-) + +diff --git a/dix/enterleave.h b/dix/enterleave.h +index 4b833d8a3b..e8af924c68 100644 +--- a/dix/enterleave.h ++++ b/dix/enterleave.h +@@ -58,8 +58,6 @@ extern void DeviceFocusEvent(DeviceIntPtr dev, + + extern void EnterWindow(DeviceIntPtr dev, WindowPtr win, int mode); + +-extern void LeaveWindow(DeviceIntPtr dev); +- + extern void CoreFocusEvent(DeviceIntPtr kbd, + int type, int mode, int detail, WindowPtr pWin); + +diff --git a/include/eventstr.h b/include/eventstr.h +index bf3b95fe4a..2bae3b0767 100644 +--- a/include/eventstr.h ++++ b/include/eventstr.h +@@ -296,4 +296,7 @@ union _InternalEvent { + #endif + }; + ++extern void ++LeaveWindow(DeviceIntPtr dev); ++ + #endif +diff --git a/mi/mipointer.c b/mi/mipointer.c +index 75be1aeeb8..b12ae9be1d 100644 +--- a/mi/mipointer.c ++++ b/mi/mipointer.c +@@ -397,8 +397,21 @@ miPointerWarpCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y) + #ifdef PANORAMIX + && noPanoramiXExtension + #endif +- ) +- UpdateSpriteForScreen(pDev, pScreen); ++ ) { ++ DeviceIntPtr master = GetMaster(pDev, MASTER_POINTER); ++ /* Hack for CVE-2023-5380: if we're moving ++ * screens PointerWindows[] keeps referring to the ++ * old window. If that gets destroyed we have a UAF ++ * bug later. Only happens when jumping from a window ++ * to the root window on the other screen. ++ * Enter/Leave events are incorrect for that case but ++ * too niche to fix. ++ */ ++ LeaveWindow(pDev); ++ if (master) ++ LeaveWindow(master); ++ UpdateSpriteForScreen(pDev, pScreen); ++ } + } + + /** +-- +2.41.0 + diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 36e248d..947af50 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -46,7 +46,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.20.14 -Release: 25%{?gitdate:.%{gitdate}}%{?dist} +Release: 26%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org # SPDX License: MIT @@ -147,6 +147,12 @@ Patch126: 0001-present-Send-a-PresentConfigureNotify-event-for-dest.patch # Upstream commits 73d6e88, f69280dd and 4127776, minus the xwayland.pc.in change Patch3801: 0001-Disallow-byte-swapped-clients-by-default.patch +# CVE-2023-5367 +Patch3810: 0001-Xi-randr-fix-handling-of-PropModeAppend-Prepend.patch +# CVE-2023-5380 +Patch3811: 0002-mi-reset-the-PointerWindows-reference-on-screen-swit.patch + + BuildRequires: make BuildRequires: systemtap-sdt-devel BuildRequires: git-core @@ -561,6 +567,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Wed Oct 25 2023 Peter Hutterer - 1.20.14-26 +- CVE fix for: CVE-2023-5367, CVE-2023-5380 + * Fri Oct 20 2023 José Expósito - SPDX migration: license is already SPDX compatible From d8ec1545f329a3851279b8d2bc9b457076d99ad2 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Fri, 10 Nov 2023 14:31:54 +1000 Subject: [PATCH 093/131] Update with full SPDX license list --- xorg-x11-server.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 947af50..d7e492e 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -46,10 +46,10 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.20.14 -Release: 26%{?gitdate:.%{gitdate}}%{?dist} +Release: 27%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org # SPDX -License: MIT +License: Adobe-Display-PostScript AND BSD-3-Clause AND DEC-3-Clause AND HPND AND HPND-sell-MIT-disclaimer-xserver AND HPND-sell-variant AND ICU AND ISC AND MIT AND MIT-open-group AND NTP AND SGI-B-2.0 AND SMLNJ AND X11 AND X11-distribute-modifications-variant #VCS: git:git://git.freedesktop.org/git/xorg/xserver %if 0%{?gitdate} @@ -567,6 +567,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Fri Nov 10 2023 Peter Hutterer - 1.20.14-27 +- Update with full SPDX license list + * Wed Oct 25 2023 Peter Hutterer - 1.20.14-26 - CVE fix for: CVE-2023-5367, CVE-2023-5380 From d887a5b9894b1664f040e0d3b1c94db95998fc70 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 13 Dec 2023 11:51:29 +1000 Subject: [PATCH 094/131] CVE fix for: CVE-2023-6377, CVE-2023-6478 --- ...te-enough-XkbActions-for-our-buttons.patch | 77 +++++++++++++++++++ ...ger-truncation-in-length-check-of-Pr.patch | 61 +++++++++++++++ xorg-x11-server.spec | 9 ++- 3 files changed, 146 insertions(+), 1 deletion(-) create mode 100644 0001-Xi-allocate-enough-XkbActions-for-our-buttons.patch create mode 100644 0001-randr-avoid-integer-truncation-in-length-check-of-Pr.patch diff --git a/0001-Xi-allocate-enough-XkbActions-for-our-buttons.patch b/0001-Xi-allocate-enough-XkbActions-for-our-buttons.patch new file mode 100644 index 0000000..11236a1 --- /dev/null +++ b/0001-Xi-allocate-enough-XkbActions-for-our-buttons.patch @@ -0,0 +1,77 @@ +From a7bda3080d2b44eae668cdcec7a93095385b9652 Mon Sep 17 00:00:00 2001 +From: Peter Hutterer +Date: Tue, 28 Nov 2023 15:19:04 +1000 +Subject: [PATCH xserver] Xi: allocate enough XkbActions for our buttons + +button->xkb_acts is supposed to be an array sufficiently large for all +our buttons, not just a single XkbActions struct. Allocating +insufficient memory here means when we memcpy() later in +XkbSetDeviceInfo we write into memory that wasn't ours to begin with, +leading to the usual security ooopsiedaisies. + +CVE-2023-6377, ZDI-CAN-22412, ZDI-CAN-22413 + +This vulnerability was discovered by: +Jan-Niklas Sohn working with Trend Micro Zero Day Initiative + +(cherry picked from commit 0c1a93d319558fe3ab2d94f51d174b4f93810afd) +--- + Xi/exevents.c | 12 ++++++------ + dix/devices.c | 10 ++++++++++ + 2 files changed, 16 insertions(+), 6 deletions(-) + +diff --git a/Xi/exevents.c b/Xi/exevents.c +index dcd4efb3bc..54ea11a938 100644 +--- a/Xi/exevents.c ++++ b/Xi/exevents.c +@@ -611,13 +611,13 @@ DeepCopyPointerClasses(DeviceIntPtr from, DeviceIntPtr to) + } + + if (from->button->xkb_acts) { +- if (!to->button->xkb_acts) { +- to->button->xkb_acts = calloc(1, sizeof(XkbAction)); +- if (!to->button->xkb_acts) +- FatalError("[Xi] not enough memory for xkb_acts.\n"); +- } ++ size_t maxbuttons = max(to->button->numButtons, from->button->numButtons); ++ to->button->xkb_acts = xnfreallocarray(to->button->xkb_acts, ++ maxbuttons, ++ sizeof(XkbAction)); ++ memset(to->button->xkb_acts, 0, maxbuttons * sizeof(XkbAction)); + memcpy(to->button->xkb_acts, from->button->xkb_acts, +- sizeof(XkbAction)); ++ from->button->numButtons * sizeof(XkbAction)); + } + else { + free(to->button->xkb_acts); +diff --git a/dix/devices.c b/dix/devices.c +index 5bf956ead4..15e46a9a5f 100644 +--- a/dix/devices.c ++++ b/dix/devices.c +@@ -2525,6 +2525,8 @@ RecalculateMasterButtons(DeviceIntPtr slave) + + if (master->button && master->button->numButtons != maxbuttons) { + int i; ++ int last_num_buttons = master->button->numButtons; ++ + DeviceChangedEvent event = { + .header = ET_Internal, + .type = ET_DeviceChanged, +@@ -2535,6 +2537,14 @@ RecalculateMasterButtons(DeviceIntPtr slave) + }; + + master->button->numButtons = maxbuttons; ++ if (last_num_buttons < maxbuttons) { ++ master->button->xkb_acts = xnfreallocarray(master->button->xkb_acts, ++ maxbuttons, ++ sizeof(XkbAction)); ++ memset(&master->button->xkb_acts[last_num_buttons], ++ 0, ++ (maxbuttons - last_num_buttons) * sizeof(XkbAction)); ++ } + + memcpy(&event.buttons.names, master->button->labels, maxbuttons * + sizeof(Atom)); +-- +2.43.0 + diff --git a/0001-randr-avoid-integer-truncation-in-length-check-of-Pr.patch b/0001-randr-avoid-integer-truncation-in-length-check-of-Pr.patch new file mode 100644 index 0000000..d88a8d5 --- /dev/null +++ b/0001-randr-avoid-integer-truncation-in-length-check-of-Pr.patch @@ -0,0 +1,61 @@ +From 58e83c683950ac9e253ab05dd7a13a8368b70a3c Mon Sep 17 00:00:00 2001 +From: Peter Hutterer +Date: Mon, 27 Nov 2023 16:27:49 +1000 +Subject: [PATCH xserver] randr: avoid integer truncation in length check of + ProcRRChange*Property + +Affected are ProcRRChangeProviderProperty and ProcRRChangeOutputProperty. +See also xserver@8f454b79 where this same bug was fixed for the core +protocol and XI. + +This fixes an OOB read and the resulting information disclosure. + +Length calculation for the request was clipped to a 32-bit integer. With +the correct stuff->nUnits value the expected request size was +truncated, passing the REQUEST_FIXED_SIZE check. + +The server then proceeded with reading at least stuff->num_items bytes +(depending on stuff->format) from the request and stuffing whatever it +finds into the property. In the process it would also allocate at least +stuff->nUnits bytes, i.e. 4GB. + +CVE-2023-6478, ZDI-CAN-22561 + +This vulnerability was discovered by: +Jan-Niklas Sohn working with Trend Micro Zero Day Initiative + +(cherry picked from commit 14f480010a93ff962fef66a16412fafff81ad632) +--- + randr/rrproperty.c | 2 +- + randr/rrproviderproperty.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/randr/rrproperty.c b/randr/rrproperty.c +index 25469f57b2..c4fef8a1f6 100644 +--- a/randr/rrproperty.c ++++ b/randr/rrproperty.c +@@ -530,7 +530,7 @@ ProcRRChangeOutputProperty(ClientPtr client) + char format, mode; + unsigned long len; + int sizeInBytes; +- int totalSize; ++ uint64_t totalSize; + int err; + + REQUEST_AT_LEAST_SIZE(xRRChangeOutputPropertyReq); +diff --git a/randr/rrproviderproperty.c b/randr/rrproviderproperty.c +index b79c17f9bf..90c5a9a933 100644 +--- a/randr/rrproviderproperty.c ++++ b/randr/rrproviderproperty.c +@@ -498,7 +498,7 @@ ProcRRChangeProviderProperty(ClientPtr client) + char format, mode; + unsigned long len; + int sizeInBytes; +- int totalSize; ++ uint64_t totalSize; + int err; + + REQUEST_AT_LEAST_SIZE(xRRChangeProviderPropertyReq); +-- +2.43.0 + diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index d7e492e..07a90fa 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -46,7 +46,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.20.14 -Release: 27%{?gitdate:.%{gitdate}}%{?dist} +Release: 28%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org # SPDX License: Adobe-Display-PostScript AND BSD-3-Clause AND DEC-3-Clause AND HPND AND HPND-sell-MIT-disclaimer-xserver AND HPND-sell-variant AND ICU AND ISC AND MIT AND MIT-open-group AND NTP AND SGI-B-2.0 AND SMLNJ AND X11 AND X11-distribute-modifications-variant @@ -151,6 +151,10 @@ Patch3801: 0001-Disallow-byte-swapped-clients-by-default.patch Patch3810: 0001-Xi-randr-fix-handling-of-PropModeAppend-Prepend.patch # CVE-2023-5380 Patch3811: 0002-mi-reset-the-PointerWindows-reference-on-screen-swit.patch +# CVE-2023-6377 +Patch3812: 0001-Xi-allocate-enough-XkbActions-for-our-buttons.patch +# CVE-2023-6478 +Patch3813: 0001-randr-avoid-integer-truncation-in-length-check-of-Pr.patch BuildRequires: make @@ -567,6 +571,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Wed Dec 13 2023 Peter Hutterer - 1.20.14-28 +- CVE fix for: CVE-2023-6377, CVE-2023-6478 + * Fri Nov 10 2023 Peter Hutterer - 1.20.14-27 - Update with full SPDX license list From 57dbbbe6c220ca822b1f10b1fc16eb158a3820a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Exp=C3=B3sito?= Date: Tue, 16 Jan 2024 15:19:18 +0100 Subject: [PATCH 095/131] CVE fix for: CVE-2023-6816, CVE-2024-0229, CVE-2024-21885, CVE-2024-21886, CVE-2024-0408 and CVE-2024-0409 --- ...enough-space-for-logical-button-maps.patch | 51 ++++ ...ficient-xEvents-for-our-DeviceStateN.patch | 84 +++++++ ...-DeviceStateNotify-event-calculation.patch | 217 ++++++++++++++++++ ...-a-new-ButtonClass-set-the-number-of.patch | 37 +++ ...hy-events-after-adding-removing-mast.patch | 109 +++++++++ ...linked-list-pointer-during-recursion.patch | 70 ++++++ ...ng-a-master-float-disabled-slaved-de.patch | 53 +++++ ...lx-Call-XACE-hooks-on-the-GLX-buffer.patch | 60 +++++ ...se-the-proper-private-key-for-cursor.patch | 56 +++++ xorg-x11-server.spec | 22 +- 10 files changed, 757 insertions(+), 2 deletions(-) create mode 100644 0001-dix-allocate-enough-space-for-logical-button-maps.patch create mode 100644 0002-dix-Allocate-sufficient-xEvents-for-our-DeviceStateN.patch create mode 100644 0003-dix-fix-DeviceStateNotify-event-calculation.patch create mode 100644 0004-Xi-when-creating-a-new-ButtonClass-set-the-number-of.patch create mode 100644 0005-Xi-flush-hierarchy-events-after-adding-removing-mast.patch create mode 100644 0006-Xi-do-not-keep-linked-list-pointer-during-recursion.patch create mode 100644 0007-dix-when-disabling-a-master-float-disabled-slaved-de.patch create mode 100644 0008-glx-Call-XACE-hooks-on-the-GLX-buffer.patch create mode 100644 0009-ephyr-xwayland-Use-the-proper-private-key-for-cursor.patch diff --git a/0001-dix-allocate-enough-space-for-logical-button-maps.patch b/0001-dix-allocate-enough-space-for-logical-button-maps.patch new file mode 100644 index 0000000..e11eb0e --- /dev/null +++ b/0001-dix-allocate-enough-space-for-logical-button-maps.patch @@ -0,0 +1,51 @@ +From 9e2ecb2af8302dedc49cb6a63ebe063c58a9e7e3 Mon Sep 17 00:00:00 2001 +From: Peter Hutterer +Date: Thu, 14 Dec 2023 11:29:49 +1000 +Subject: [PATCH 1/9] dix: allocate enough space for logical button maps + +Both DeviceFocusEvent and the XIQueryPointer reply contain a bit for +each logical button currently down. Since buttons can be arbitrarily mapped +to anything up to 255 make sure we have enough bits for the maximum mapping. + +CVE-2023-6816, ZDI-CAN-22664, ZDI-CAN-22665 + +This vulnerability was discovered by: +Jan-Niklas Sohn working with Trend Micro Zero Day Initiative +--- + Xi/xiquerypointer.c | 3 +-- + dix/enterleave.c | 5 +++-- + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/Xi/xiquerypointer.c b/Xi/xiquerypointer.c +index 5b77b1a44..2b05ac5f3 100644 +--- a/Xi/xiquerypointer.c ++++ b/Xi/xiquerypointer.c +@@ -149,8 +149,7 @@ ProcXIQueryPointer(ClientPtr client) + if (pDev->button) { + int i; + +- rep.buttons_len = +- bytes_to_int32(bits_to_bytes(pDev->button->numButtons)); ++ rep.buttons_len = bytes_to_int32(bits_to_bytes(256)); /* button map up to 255 */ + rep.length += rep.buttons_len; + buttons = calloc(rep.buttons_len, 4); + if (!buttons) +diff --git a/dix/enterleave.c b/dix/enterleave.c +index 867ec7436..ded8679d7 100644 +--- a/dix/enterleave.c ++++ b/dix/enterleave.c +@@ -784,8 +784,9 @@ DeviceFocusEvent(DeviceIntPtr dev, int type, int mode, int detail, + + mouse = IsFloating(dev) ? dev : GetMaster(dev, MASTER_POINTER); + +- /* XI 2 event */ +- btlen = (mouse->button) ? bits_to_bytes(mouse->button->numButtons) : 0; ++ /* XI 2 event contains the logical button map - maps are CARD8 ++ * so we need 256 bits for the possibly maximum mapping */ ++ btlen = (mouse->button) ? bits_to_bytes(256) : 0; + btlen = bytes_to_int32(btlen); + len = sizeof(xXIFocusInEvent) + btlen * 4; + +-- +2.43.0 + diff --git a/0002-dix-Allocate-sufficient-xEvents-for-our-DeviceStateN.patch b/0002-dix-Allocate-sufficient-xEvents-for-our-DeviceStateN.patch new file mode 100644 index 0000000..21c5622 --- /dev/null +++ b/0002-dix-Allocate-sufficient-xEvents-for-our-DeviceStateN.patch @@ -0,0 +1,84 @@ +From ece23be888a93b741aa1209d1dbf64636109d6a5 Mon Sep 17 00:00:00 2001 +From: Peter Hutterer +Date: Mon, 18 Dec 2023 14:27:50 +1000 +Subject: [PATCH 2/9] dix: Allocate sufficient xEvents for our + DeviceStateNotify + +If a device has both a button class and a key class and numButtons is +zero, we can get an OOB write due to event under-allocation. + +This function seems to assume a device has either keys or buttons, not +both. It has two virtually identical code paths, both of which assume +they're applying to the first event in the sequence. + +A device with both a key and button class triggered a logic bug - only +one xEvent was allocated but the deviceStateNotify pointer was pushed on +once per type. So effectively this logic code: + + int count = 1; + if (button && nbuttons > 32) count++; + if (key && nbuttons > 0) count++; + if (key && nkeys > 32) count++; // this is basically always true + // count is at 2 for our keys + zero button device + + ev = alloc(count * sizeof(xEvent)); + FixDeviceStateNotify(ev); + if (button) + FixDeviceStateNotify(ev++); + if (key) + FixDeviceStateNotify(ev++); // santa drops into the wrong chimney here + +If the device has more than 3 valuators, the OOB is pushed back - we're +off by one so it will happen when the last deviceValuator event is +written instead. + +Fix this by allocating the maximum number of events we may allocate. +Note that the current behavior is not protocol-correct anyway, this +patch fixes only the allocation issue. + +Note that this issue does not trigger if the device has at least one +button. While the server does not prevent a button class with zero +buttons, it is very unlikely. + +CVE-2024-0229, ZDI-CAN-22678 + +This vulnerability was discovered by: +Jan-Niklas Sohn working with Trend Micro Zero Day Initiative +--- + dix/enterleave.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/dix/enterleave.c b/dix/enterleave.c +index ded8679d7..17964b00a 100644 +--- a/dix/enterleave.c ++++ b/dix/enterleave.c +@@ -675,7 +675,8 @@ static void + DeliverStateNotifyEvent(DeviceIntPtr dev, WindowPtr win) + { + int evcount = 1; +- deviceStateNotify *ev, *sev; ++ deviceStateNotify sev[6 + (MAX_VALUATORS + 2)/3]; ++ deviceStateNotify *ev; + deviceKeyStateNotify *kev; + deviceButtonStateNotify *bev; + +@@ -714,7 +715,7 @@ DeliverStateNotifyEvent(DeviceIntPtr dev, WindowPtr win) + } + } + +- sev = ev = xallocarray(evcount, sizeof(xEvent)); ++ ev = sev; + FixDeviceStateNotify(dev, ev, NULL, NULL, NULL, first); + + if (b != NULL) { +@@ -770,7 +771,6 @@ DeliverStateNotifyEvent(DeviceIntPtr dev, WindowPtr win) + + DeliverEventsToWindow(dev, win, (xEvent *) sev, evcount, + DeviceStateNotifyMask, NullGrab); +- free(sev); + } + + void +-- +2.43.0 + diff --git a/0003-dix-fix-DeviceStateNotify-event-calculation.patch b/0003-dix-fix-DeviceStateNotify-event-calculation.patch new file mode 100644 index 0000000..2fe2f8e --- /dev/null +++ b/0003-dix-fix-DeviceStateNotify-event-calculation.patch @@ -0,0 +1,217 @@ +From 219c54b8a3337456ce5270ded6a67bcde53553d5 Mon Sep 17 00:00:00 2001 +From: Peter Hutterer +Date: Mon, 18 Dec 2023 12:26:20 +1000 +Subject: [PATCH 3/9] dix: fix DeviceStateNotify event calculation + +The previous code only made sense if one considers buttons and keys to +be mutually exclusive on a device. That is not necessarily true, causing +a number of issues. + +This function allocates and fills in the number of xEvents we need to +send the device state down the wire. This is split across multiple +32-byte devices including one deviceStateNotify event and optional +deviceKeyStateNotify, deviceButtonStateNotify and (possibly multiple) +deviceValuator events. + +The previous behavior would instead compose a sequence +of [state, buttonstate, state, keystate, valuator...]. This is not +protocol correct, and on top of that made the code extremely convoluted. + +Fix this by streamlining: add both button and key into the deviceStateNotify +and then append the key state and button state, followed by the +valuators. Finally, the deviceValuator events contain up to 6 valuators +per event but we only ever sent through 3 at a time. Let's double that +troughput. + +CVE-2024-0229, ZDI-CAN-22678 + +This vulnerability was discovered by: +Jan-Niklas Sohn working with Trend Micro Zero Day Initiative +--- + dix/enterleave.c | 121 ++++++++++++++++++++--------------------------- + 1 file changed, 52 insertions(+), 69 deletions(-) + +diff --git a/dix/enterleave.c b/dix/enterleave.c +index 17964b00a..7b7ba1098 100644 +--- a/dix/enterleave.c ++++ b/dix/enterleave.c +@@ -615,9 +615,15 @@ FixDeviceValuator(DeviceIntPtr dev, deviceValuator * ev, ValuatorClassPtr v, + + ev->type = DeviceValuator; + ev->deviceid = dev->id; +- ev->num_valuators = nval < 3 ? nval : 3; ++ ev->num_valuators = nval < 6 ? nval : 6; + ev->first_valuator = first; + switch (ev->num_valuators) { ++ case 6: ++ ev->valuator2 = v->axisVal[first + 5]; ++ case 5: ++ ev->valuator2 = v->axisVal[first + 4]; ++ case 4: ++ ev->valuator2 = v->axisVal[first + 3]; + case 3: + ev->valuator2 = v->axisVal[first + 2]; + case 2: +@@ -626,7 +632,6 @@ FixDeviceValuator(DeviceIntPtr dev, deviceValuator * ev, ValuatorClassPtr v, + ev->valuator0 = v->axisVal[first]; + break; + } +- first += ev->num_valuators; + } + + static void +@@ -646,7 +651,7 @@ FixDeviceStateNotify(DeviceIntPtr dev, deviceStateNotify * ev, KeyClassPtr k, + ev->num_buttons = b->numButtons; + memcpy((char *) ev->buttons, (char *) b->down, 4); + } +- else if (k) { ++ if (k) { + ev->classes_reported |= (1 << KeyClass); + ev->num_keys = k->xkbInfo->desc->max_key_code - + k->xkbInfo->desc->min_key_code; +@@ -670,15 +675,26 @@ FixDeviceStateNotify(DeviceIntPtr dev, deviceStateNotify * ev, KeyClassPtr k, + } + } + +- ++/** ++ * The device state notify event is split across multiple 32-byte events. ++ * The first one contains the first 32 button state bits, the first 32 ++ * key state bits, and the first 3 valuator values. ++ * ++ * If a device has more than that, the server sends out: ++ * - one deviceButtonStateNotify for buttons 32 and above ++ * - one deviceKeyStateNotify for keys 32 and above ++ * - one deviceValuator event per 6 valuators above valuator 4 ++ * ++ * All events but the last one have the deviceid binary ORed with MORE_EVENTS, ++ */ + static void + DeliverStateNotifyEvent(DeviceIntPtr dev, WindowPtr win) + { ++ /* deviceStateNotify, deviceKeyStateNotify, deviceButtonStateNotify ++ * and one deviceValuator for each 6 valuators */ ++ deviceStateNotify sev[3 + (MAX_VALUATORS + 6)/6]; + int evcount = 1; +- deviceStateNotify sev[6 + (MAX_VALUATORS + 2)/3]; +- deviceStateNotify *ev; +- deviceKeyStateNotify *kev; +- deviceButtonStateNotify *bev; ++ deviceStateNotify *ev = sev; + + KeyClassPtr k; + ButtonClassPtr b; +@@ -691,82 +707,49 @@ DeliverStateNotifyEvent(DeviceIntPtr dev, WindowPtr win) + + if ((b = dev->button) != NULL) { + nbuttons = b->numButtons; +- if (nbuttons > 32) ++ if (nbuttons > 32) /* first 32 are encoded in deviceStateNotify */ + evcount++; + } + if ((k = dev->key) != NULL) { + nkeys = k->xkbInfo->desc->max_key_code - k->xkbInfo->desc->min_key_code; +- if (nkeys > 32) ++ if (nkeys > 32) /* first 32 are encoded in deviceStateNotify */ + evcount++; +- if (nbuttons > 0) { +- evcount++; +- } + } + if ((v = dev->valuator) != NULL) { + nval = v->numAxes; +- +- if (nval > 3) +- evcount++; +- if (nval > 6) { +- if (!(k && b)) +- evcount++; +- if (nval > 9) +- evcount += ((nval - 7) / 3); +- } ++ /* first three are encoded in deviceStateNotify, then ++ * it's 6 per deviceValuator event */ ++ evcount += ((nval - 3) + 6)/6; + } + +- ev = sev; +- FixDeviceStateNotify(dev, ev, NULL, NULL, NULL, first); +- +- if (b != NULL) { +- FixDeviceStateNotify(dev, ev++, NULL, b, v, first); +- first += 3; +- nval -= 3; +- if (nbuttons > 32) { +- (ev - 1)->deviceid |= MORE_EVENTS; +- bev = (deviceButtonStateNotify *) ev++; +- bev->type = DeviceButtonStateNotify; +- bev->deviceid = dev->id; +- memcpy((char *) &bev->buttons[4], (char *) &b->down[4], +- DOWN_LENGTH - 4); +- } +- if (nval > 0) { +- (ev - 1)->deviceid |= MORE_EVENTS; +- FixDeviceValuator(dev, (deviceValuator *) ev++, v, first); +- first += 3; +- nval -= 3; +- } ++ BUG_RETURN(evcount <= ARRAY_SIZE(sev)); ++ ++ FixDeviceStateNotify(dev, ev, k, b, v, first); ++ ++ if (b != NULL && nbuttons > 32) { ++ deviceButtonStateNotify *bev = (deviceButtonStateNotify *) ++ev; ++ (ev - 1)->deviceid |= MORE_EVENTS; ++ bev->type = DeviceButtonStateNotify; ++ bev->deviceid = dev->id; ++ memcpy((char *) &bev->buttons[4], (char *) &b->down[4], ++ DOWN_LENGTH - 4); + } + +- if (k != NULL) { +- FixDeviceStateNotify(dev, ev++, k, NULL, v, first); +- first += 3; +- nval -= 3; +- if (nkeys > 32) { +- (ev - 1)->deviceid |= MORE_EVENTS; +- kev = (deviceKeyStateNotify *) ev++; +- kev->type = DeviceKeyStateNotify; +- kev->deviceid = dev->id; +- memmove((char *) &kev->keys[0], (char *) &k->down[4], 28); +- } +- if (nval > 0) { +- (ev - 1)->deviceid |= MORE_EVENTS; +- FixDeviceValuator(dev, (deviceValuator *) ev++, v, first); +- first += 3; +- nval -= 3; +- } ++ if (k != NULL && nkeys > 32) { ++ deviceKeyStateNotify *kev = (deviceKeyStateNotify *) ++ev; ++ (ev - 1)->deviceid |= MORE_EVENTS; ++ kev->type = DeviceKeyStateNotify; ++ kev->deviceid = dev->id; ++ memmove((char *) &kev->keys[0], (char *) &k->down[4], 28); + } + ++ first = 3; ++ nval -= 3; + while (nval > 0) { +- FixDeviceStateNotify(dev, ev++, NULL, NULL, v, first); +- first += 3; +- nval -= 3; +- if (nval > 0) { +- (ev - 1)->deviceid |= MORE_EVENTS; +- FixDeviceValuator(dev, (deviceValuator *) ev++, v, first); +- first += 3; +- nval -= 3; +- } ++ ev->deviceid |= MORE_EVENTS; ++ FixDeviceValuator(dev, (deviceValuator *) ++ev, v, first); ++ first += 6; ++ nval -= 6; + } + + DeliverEventsToWindow(dev, win, (xEvent *) sev, evcount, +-- +2.43.0 + diff --git a/0004-Xi-when-creating-a-new-ButtonClass-set-the-number-of.patch b/0004-Xi-when-creating-a-new-ButtonClass-set-the-number-of.patch new file mode 100644 index 0000000..dbe90ce --- /dev/null +++ b/0004-Xi-when-creating-a-new-ButtonClass-set-the-number-of.patch @@ -0,0 +1,37 @@ +From df3c65706eb169d5938df0052059f3e0d5981b74 Mon Sep 17 00:00:00 2001 +From: Peter Hutterer +Date: Thu, 21 Dec 2023 13:48:10 +1000 +Subject: [PATCH 4/9] Xi: when creating a new ButtonClass, set the number of + buttons + +There's a racy sequence where a master device may copy the button class +from the slave, without ever initializing numButtons. This leads to a +device with zero buttons but a button class which is invalid. + +Let's copy the numButtons value from the source - by definition if we +don't have a button class yet we do not have any other slave devices +with more than this number of buttons anyway. + +CVE-2024-0229, ZDI-CAN-22678 + +This vulnerability was discovered by: +Jan-Niklas Sohn working with Trend Micro Zero Day Initiative +--- + Xi/exevents.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/Xi/exevents.c b/Xi/exevents.c +index 54ea11a93..e16171468 100644 +--- a/Xi/exevents.c ++++ b/Xi/exevents.c +@@ -605,6 +605,7 @@ DeepCopyPointerClasses(DeviceIntPtr from, DeviceIntPtr to) + to->button = calloc(1, sizeof(ButtonClassRec)); + if (!to->button) + FatalError("[Xi] no memory for class shift.\n"); ++ to->button->numButtons = from->button->numButtons; + } + else + classes->button = NULL; +-- +2.43.0 + diff --git a/0005-Xi-flush-hierarchy-events-after-adding-removing-mast.patch b/0005-Xi-flush-hierarchy-events-after-adding-removing-mast.patch new file mode 100644 index 0000000..6a21b3c --- /dev/null +++ b/0005-Xi-flush-hierarchy-events-after-adding-removing-mast.patch @@ -0,0 +1,109 @@ +From 4a5e9b1895627d40d26045bd0b7ef3dce503cbd1 Mon Sep 17 00:00:00 2001 +From: Peter Hutterer +Date: Thu, 4 Jan 2024 10:01:24 +1000 +Subject: [PATCH 5/9] Xi: flush hierarchy events after adding/removing master + devices + +The `XISendDeviceHierarchyEvent()` function allocates space to store up +to `MAXDEVICES` (256) `xXIHierarchyInfo` structures in `info`. + +If a device with a given ID was removed and a new device with the same +ID added both in the same operation, the single device ID will lead to +two info structures being written to `info`. + +Since this case can occur for every device ID at once, a total of two +times `MAXDEVICES` info structures might be written to the allocation. + +To avoid it, once one add/remove master is processed, send out the +device hierarchy event for the current state and continue. That event +thus only ever has exactly one of either added/removed in it (and +optionally slave attached/detached). + +CVE-2024-21885, ZDI-CAN-22744 + +This vulnerability was discovered by: +Jan-Niklas Sohn working with Trend Micro Zero Day Initiative +--- + Xi/xichangehierarchy.c | 27 ++++++++++++++++++++++----- + 1 file changed, 22 insertions(+), 5 deletions(-) + +diff --git a/Xi/xichangehierarchy.c b/Xi/xichangehierarchy.c +index d2d985848..72d00451e 100644 +--- a/Xi/xichangehierarchy.c ++++ b/Xi/xichangehierarchy.c +@@ -416,6 +416,11 @@ ProcXIChangeHierarchy(ClientPtr client) + size_t len; /* length of data remaining in request */ + int rc = Success; + int flags[MAXDEVICES] = { 0 }; ++ enum { ++ NO_CHANGE, ++ FLUSH, ++ CHANGED, ++ } changes = NO_CHANGE; + + REQUEST(xXIChangeHierarchyReq); + REQUEST_AT_LEAST_SIZE(xXIChangeHierarchyReq); +@@ -465,8 +470,9 @@ ProcXIChangeHierarchy(ClientPtr client) + rc = add_master(client, c, flags); + if (rc != Success) + goto unwind; +- } ++ changes = FLUSH; + break; ++ } + case XIRemoveMaster: + { + xXIRemoveMasterInfo *r = (xXIRemoveMasterInfo *) any; +@@ -475,8 +481,9 @@ ProcXIChangeHierarchy(ClientPtr client) + rc = remove_master(client, r, flags); + if (rc != Success) + goto unwind; +- } ++ changes = FLUSH; + break; ++ } + case XIDetachSlave: + { + xXIDetachSlaveInfo *c = (xXIDetachSlaveInfo *) any; +@@ -485,8 +492,9 @@ ProcXIChangeHierarchy(ClientPtr client) + rc = detach_slave(client, c, flags); + if (rc != Success) + goto unwind; +- } ++ changes = CHANGED; + break; ++ } + case XIAttachSlave: + { + xXIAttachSlaveInfo *c = (xXIAttachSlaveInfo *) any; +@@ -495,16 +503,25 @@ ProcXIChangeHierarchy(ClientPtr client) + rc = attach_slave(client, c, flags); + if (rc != Success) + goto unwind; ++ changes = CHANGED; ++ break; + } ++ default: + break; + } + ++ if (changes == FLUSH) { ++ XISendDeviceHierarchyEvent(flags); ++ memset(flags, 0, sizeof(flags)); ++ changes = NO_CHANGE; ++ } ++ + len -= any->length * 4; + any = (xXIAnyHierarchyChangeInfo *) ((char *) any + any->length * 4); + } + + unwind: +- +- XISendDeviceHierarchyEvent(flags); ++ if (changes != NO_CHANGE) ++ XISendDeviceHierarchyEvent(flags); + return rc; + } +-- +2.43.0 + diff --git a/0006-Xi-do-not-keep-linked-list-pointer-during-recursion.patch b/0006-Xi-do-not-keep-linked-list-pointer-during-recursion.patch new file mode 100644 index 0000000..3174635 --- /dev/null +++ b/0006-Xi-do-not-keep-linked-list-pointer-during-recursion.patch @@ -0,0 +1,70 @@ +From bc1fdbe46559dd947674375946bbef54dd0ce36b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jos=C3=A9=20Exp=C3=B3sito?= +Date: Fri, 22 Dec 2023 18:28:31 +0100 +Subject: [PATCH 6/9] Xi: do not keep linked list pointer during recursion + +The `DisableDevice()` function is called whenever an enabled device +is disabled and it moves the device from the `inputInfo.devices` linked +list to the `inputInfo.off_devices` linked list. + +However, its link/unlink operation has an issue during the recursive +call to `DisableDevice()` due to the `prev` pointer pointing to a +removed device. + +This issue leads to a length mismatch between the total number of +devices and the number of device in the list, leading to a heap +overflow and, possibly, to local privilege escalation. + +Simplify the code that checked whether the device passed to +`DisableDevice()` was in `inputInfo.devices` or not and find the +previous device after the recursion. + +CVE-2024-21886, ZDI-CAN-22840 + +This vulnerability was discovered by: +Jan-Niklas Sohn working with Trend Micro Zero Day Initiative +--- + dix/devices.c | 15 ++++++++++++--- + 1 file changed, 12 insertions(+), 3 deletions(-) + +diff --git a/dix/devices.c b/dix/devices.c +index dca98c8d1..389d28a23 100644 +--- a/dix/devices.c ++++ b/dix/devices.c +@@ -453,14 +453,20 @@ DisableDevice(DeviceIntPtr dev, BOOL sendevent) + { + DeviceIntPtr *prev, other; + BOOL enabled; ++ BOOL dev_in_devices_list = FALSE; + int flags[MAXDEVICES] = { 0 }; + + if (!dev->enabled) + return TRUE; + +- for (prev = &inputInfo.devices; +- *prev && (*prev != dev); prev = &(*prev)->next); +- if (*prev != dev) ++ for (other = inputInfo.devices; other; other = other->next) { ++ if (other == dev) { ++ dev_in_devices_list = TRUE; ++ break; ++ } ++ } ++ ++ if (!dev_in_devices_list) + return FALSE; + + TouchEndPhysicallyActiveTouches(dev); +@@ -511,6 +517,9 @@ DisableDevice(DeviceIntPtr dev, BOOL sendevent) + LeaveWindow(dev); + SetFocusOut(dev); + ++ for (prev = &inputInfo.devices; ++ *prev && (*prev != dev); prev = &(*prev)->next); ++ + *prev = dev->next; + dev->next = inputInfo.off_devices; + inputInfo.off_devices = dev; +-- +2.43.0 + diff --git a/0007-dix-when-disabling-a-master-float-disabled-slaved-de.patch b/0007-dix-when-disabling-a-master-float-disabled-slaved-de.patch new file mode 100644 index 0000000..32a326a --- /dev/null +++ b/0007-dix-when-disabling-a-master-float-disabled-slaved-de.patch @@ -0,0 +1,53 @@ +From 26769aa71fcbe0a8403b7fb13b7c9010cc07c3a8 Mon Sep 17 00:00:00 2001 +From: Peter Hutterer +Date: Fri, 5 Jan 2024 09:40:27 +1000 +Subject: [PATCH 7/9] dix: when disabling a master, float disabled slaved + devices too + +Disabling a master device floats all slave devices but we didn't do this +to already-disabled slave devices. As a result those devices kept their +reference to the master device resulting in access to already freed +memory if the master device was removed before the corresponding slave +device. + +And to match this behavior, also forcibly reset that pointer during +CloseDownDevices(). + +Related to CVE-2024-21886, ZDI-CAN-22840 +--- + dix/devices.c | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +diff --git a/dix/devices.c b/dix/devices.c +index 389d28a23..84a6406d1 100644 +--- a/dix/devices.c ++++ b/dix/devices.c +@@ -483,6 +483,13 @@ DisableDevice(DeviceIntPtr dev, BOOL sendevent) + flags[other->id] |= XISlaveDetached; + } + } ++ ++ for (other = inputInfo.off_devices; other; other = other->next) { ++ if (!IsMaster(other) && GetMaster(other, MASTER_ATTACHED) == dev) { ++ AttachDevice(NULL, other, NULL); ++ flags[other->id] |= XISlaveDetached; ++ } ++ } + } + else { + for (other = inputInfo.devices; other; other = other->next) { +@@ -1088,6 +1095,11 @@ CloseDownDevices(void) + dev->master = NULL; + } + ++ for (dev = inputInfo.off_devices; dev; dev = dev->next) { ++ if (!IsMaster(dev) && !IsFloating(dev)) ++ dev->master = NULL; ++ } ++ + CloseDeviceList(&inputInfo.devices); + CloseDeviceList(&inputInfo.off_devices); + +-- +2.43.0 + diff --git a/0008-glx-Call-XACE-hooks-on-the-GLX-buffer.patch b/0008-glx-Call-XACE-hooks-on-the-GLX-buffer.patch new file mode 100644 index 0000000..0e9e4a0 --- /dev/null +++ b/0008-glx-Call-XACE-hooks-on-the-GLX-buffer.patch @@ -0,0 +1,60 @@ +From e5e8586a12a3ec915673edffa10dc8fe5e15dac3 Mon Sep 17 00:00:00 2001 +From: Olivier Fourdan +Date: Wed, 6 Dec 2023 12:09:41 +0100 +Subject: [PATCH 8/9] glx: Call XACE hooks on the GLX buffer + +The XSELINUX code will label resources at creation by checking the +access mode. When the access mode is DixCreateAccess, it will call the +function to label the new resource SELinuxLabelResource(). + +However, GLX buffers do not go through the XACE hooks when created, +hence leaving the resource actually unlabeled. + +When, later, the client tries to create another resource using that +drawable (like a GC for example), the XSELINUX code would try to use +the security ID of that object which has never been labeled, get a NULL +pointer and crash when checking whether the requested permissions are +granted for subject security ID. + +To avoid the issue, make sure to call the XACE hooks when creating the +GLX buffers. + +Credit goes to Donn Seeley for providing the patch. + +CVE-2024-0408 + +Signed-off-by: Olivier Fourdan +Acked-by: Peter Hutterer +--- + glx/glxcmds.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/glx/glxcmds.c b/glx/glxcmds.c +index fc26a2e34..1e46d0c72 100644 +--- a/glx/glxcmds.c ++++ b/glx/glxcmds.c +@@ -48,6 +48,7 @@ + #include "indirect_util.h" + #include "protocol-versions.h" + #include "glxvndabi.h" ++#include "xace.h" + + static char GLXServerVendorName[] = "SGI"; + +@@ -1392,6 +1393,13 @@ DoCreatePbuffer(ClientPtr client, int screenNum, XID fbconfigId, + if (!pPixmap) + return BadAlloc; + ++ err = XaceHook(XACE_RESOURCE_ACCESS, client, glxDrawableId, RT_PIXMAP, ++ pPixmap, RT_NONE, NULL, DixCreateAccess); ++ if (err != Success) { ++ (*pGlxScreen->pScreen->DestroyPixmap) (pPixmap); ++ return err; ++ } ++ + /* Assign the pixmap the same id as the pbuffer and add it as a + * resource so it and the DRI2 drawable will be reclaimed when the + * pbuffer is destroyed. */ +-- +2.43.0 + diff --git a/0009-ephyr-xwayland-Use-the-proper-private-key-for-cursor.patch b/0009-ephyr-xwayland-Use-the-proper-private-key-for-cursor.patch new file mode 100644 index 0000000..5fa80fd --- /dev/null +++ b/0009-ephyr-xwayland-Use-the-proper-private-key-for-cursor.patch @@ -0,0 +1,56 @@ +From 2ef0f1116c65d5cb06d7b6d83f8a1aea702c94f7 Mon Sep 17 00:00:00 2001 +From: Olivier Fourdan +Date: Wed, 6 Dec 2023 11:51:56 +0100 +Subject: [PATCH 9/9] ephyr,xwayland: Use the proper private key for cursor + +The cursor in DIX is actually split in two parts, the cursor itself and +the cursor bits, each with their own devPrivates. + +The cursor itself includes the cursor bits, meaning that the cursor bits +devPrivates in within structure of the cursor. + +Both Xephyr and Xwayland were using the private key for the cursor bits +to store the data for the cursor, and when using XSELINUX which comes +with its own special devPrivates, the data stored in that cursor bits' +devPrivates would interfere with the XSELINUX devPrivates data and the +SELINUX security ID would point to some other unrelated data, causing a +crash in the XSELINUX code when trying to (re)use the security ID. + +CVE-2024-0409 + +Signed-off-by: Olivier Fourdan +Reviewed-by: Peter Hutterer +--- + hw/kdrive/ephyr/ephyrcursor.c | 2 +- + hw/xwayland/xwayland-cursor.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/hw/kdrive/ephyr/ephyrcursor.c b/hw/kdrive/ephyr/ephyrcursor.c +index f991899c5..3f192d034 100644 +--- a/hw/kdrive/ephyr/ephyrcursor.c ++++ b/hw/kdrive/ephyr/ephyrcursor.c +@@ -246,7 +246,7 @@ miPointerSpriteFuncRec EphyrPointerSpriteFuncs = { + Bool + ephyrCursorInit(ScreenPtr screen) + { +- if (!dixRegisterPrivateKey(&ephyrCursorPrivateKey, PRIVATE_CURSOR_BITS, ++ if (!dixRegisterPrivateKey(&ephyrCursorPrivateKey, PRIVATE_CURSOR, + sizeof(ephyrCursorRec))) + return FALSE; + +diff --git a/hw/xwayland/xwayland-cursor.c b/hw/xwayland/xwayland-cursor.c +index e3c1aaa50..bd94b0cfb 100644 +--- a/hw/xwayland/xwayland-cursor.c ++++ b/hw/xwayland/xwayland-cursor.c +@@ -431,7 +431,7 @@ static miPointerScreenFuncRec xwl_pointer_screen_funcs = { + Bool + xwl_screen_init_cursor(struct xwl_screen *xwl_screen) + { +- if (!dixRegisterPrivateKey(&xwl_cursor_private_key, PRIVATE_CURSOR_BITS, 0)) ++ if (!dixRegisterPrivateKey(&xwl_cursor_private_key, PRIVATE_CURSOR, 0)) + return FALSE; + + return miPointerInitialize(xwl_screen->screen, +-- +2.43.0 + diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 07a90fa..a30b55b 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -46,7 +46,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.20.14 -Release: 28%{?gitdate:.%{gitdate}}%{?dist} +Release: 29%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org # SPDX License: Adobe-Display-PostScript AND BSD-3-Clause AND DEC-3-Clause AND HPND AND HPND-sell-MIT-disclaimer-xserver AND HPND-sell-variant AND ICU AND ISC AND MIT AND MIT-open-group AND NTP AND SGI-B-2.0 AND SMLNJ AND X11 AND X11-distribute-modifications-variant @@ -155,7 +155,21 @@ Patch3811: 0002-mi-reset-the-PointerWindows-reference-on-screen-swit.patch Patch3812: 0001-Xi-allocate-enough-XkbActions-for-our-buttons.patch # CVE-2023-6478 Patch3813: 0001-randr-avoid-integer-truncation-in-length-check-of-Pr.patch - +# CVE-2023-6816 +Patch3814: 0001-dix-allocate-enough-space-for-logical-button-maps.patch +# CVE-2024-0229 +Patch3815: 0002-dix-Allocate-sufficient-xEvents-for-our-DeviceStateN.patch +Patch3816: 0003-dix-fix-DeviceStateNotify-event-calculation.patch +Patch3817: 0004-Xi-when-creating-a-new-ButtonClass-set-the-number-of.patch +# CVE-2024-21885 +Patch3818: 0005-Xi-flush-hierarchy-events-after-adding-removing-mast.patch +# CVE-2024-21886 +Patch3819: 0006-Xi-do-not-keep-linked-list-pointer-during-recursion.patch +Patch3820: 0007-dix-when-disabling-a-master-float-disabled-slaved-de.patch +# CVE-2024-0408 +Patch3821: 0008-glx-Call-XACE-hooks-on-the-GLX-buffer.patch +# CVE-2024-0409 +Patch3822: 0009-ephyr-xwayland-Use-the-proper-private-key-for-cursor.patch BuildRequires: make BuildRequires: systemtap-sdt-devel @@ -571,6 +585,10 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Tue Jan 16 2024 José Expósito - 1.20.14-29 +- CVE fix for: CVE-2023-6816, CVE-2024-0229, CVE-2024-21885, CVE-2024-21886, + CVE-2024-0408 and CVE-2024-0409 + * Wed Dec 13 2023 Peter Hutterer - 1.20.14-28 - CVE fix for: CVE-2023-6377, CVE-2023-6478 From 9df532a0270dff0ba124f8363eaa6ad6a314a240 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Exp=C3=B3sito?= Date: Fri, 19 Jan 2024 11:22:19 +0100 Subject: [PATCH 096/131] Fix use after free related to CVE-2024-21886 --- ...-after-free-in-input-device-shutdown.patch | 77 +++++++++++++++++++ xorg-x11-server.spec | 7 +- 2 files changed, 83 insertions(+), 1 deletion(-) create mode 100644 0001-dix-Fix-use-after-free-in-input-device-shutdown.patch diff --git a/0001-dix-Fix-use-after-free-in-input-device-shutdown.patch b/0001-dix-Fix-use-after-free-in-input-device-shutdown.patch new file mode 100644 index 0000000..c2d723f --- /dev/null +++ b/0001-dix-Fix-use-after-free-in-input-device-shutdown.patch @@ -0,0 +1,77 @@ +From 1801fe0ac3926882d47d7e1ad6c0518a2cdffd41 Mon Sep 17 00:00:00 2001 +From: Povilas Kanapickas +Date: Sun, 19 Dec 2021 18:11:07 +0200 +Subject: [PATCH] dix: Fix use after free in input device shutdown + +This fixes access to freed heap memory via dev->master. E.g. when +running BarrierNotify.ReceivesNotifyEvents/7 test from +xorg-integration-tests: + +==24736==ERROR: AddressSanitizer: heap-use-after-free on address +0x619000065020 at pc 0x55c450e2b9cf bp 0x7fffc532fd20 sp 0x7fffc532fd10 +READ of size 4 at 0x619000065020 thread T0 + #0 0x55c450e2b9ce in GetMaster ../../../dix/devices.c:2722 + #1 0x55c450e9d035 in IsFloating ../../../dix/events.c:346 + #2 0x55c4513209c6 in GetDeviceUse ../../../Xi/xiquerydevice.c:525 +../../../Xi/xichangehierarchy.c:95 + #4 0x55c450e3455c in RemoveDevice ../../../dix/devices.c:1204 +../../../hw/xfree86/common/xf86Xinput.c:1142 + #6 0x55c450e17b04 in CloseDeviceList ../../../dix/devices.c:1038 + #7 0x55c450e1de85 in CloseDownDevices ../../../dix/devices.c:1068 + #8 0x55c450e837ef in dix_main ../../../dix/main.c:302 + #9 0x55c4517a8d93 in main ../../../dix/stubmain.c:34 +(/lib/x86_64-linux-gnu/libc.so.6+0x28564) + #11 0x55c450d0113d in _start (/usr/lib/xorg/Xorg+0x117713d) + +0x619000065020 is located 160 bytes inside of 912-byte region +[0x619000064f80,0x619000065310) +freed by thread T0 here: +(/usr/lib/x86_64-linux-gnu/libasan.so.5+0x10d7cf) + #1 0x55c450e19f1c in CloseDevice ../../../dix/devices.c:1014 + #2 0x55c450e343a4 in RemoveDevice ../../../dix/devices.c:1186 +../../../hw/xfree86/common/xf86Xinput.c:1142 + #4 0x55c450e17b04 in CloseDeviceList ../../../dix/devices.c:1038 + #5 0x55c450e1de85 in CloseDownDevices ../../../dix/devices.c:1068 + #6 0x55c450e837ef in dix_main ../../../dix/main.c:302 + #7 0x55c4517a8d93 in main ../../../dix/stubmain.c:34 +(/lib/x86_64-linux-gnu/libc.so.6+0x28564) + +previously allocated by thread T0 here: +(/usr/lib/x86_64-linux-gnu/libasan.so.5+0x10ddc6) + #1 0x55c450e1c57b in AddInputDevice ../../../dix/devices.c:259 + #2 0x55c450e34840 in AllocDevicePair ../../../dix/devices.c:2755 + #3 0x55c45130318f in add_master ../../../Xi/xichangehierarchy.c:152 +../../../Xi/xichangehierarchy.c:465 + #5 0x55c4512cb9f5 in ProcIDispatch ../../../Xi/extinit.c:390 + #6 0x55c450e6a92b in Dispatch ../../../dix/dispatch.c:551 + #7 0x55c450e834b7 in dix_main ../../../dix/main.c:272 + #8 0x55c4517a8d93 in main ../../../dix/stubmain.c:34 +(/lib/x86_64-linux-gnu/libc.so.6+0x28564) + +The problem is caused by dev->master being not reset when disabling the +device, which then causes dangling pointer when the master device itself +is being deleted when exiting whole server. + +Note that RecalculateMasterButtons() requires dev->master to be still +valid, so we can reset it only at the end of function. + +Signed-off-by: Povilas Kanapickas +--- + dix/devices.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/dix/devices.c b/dix/devices.c +index e62c34c55..5f9ce1678 100644 +--- a/dix/devices.c ++++ b/dix/devices.c +@@ -520,6 +520,7 @@ DisableDevice(DeviceIntPtr dev, BOOL sendevent) + } + + RecalculateMasterButtons(dev); ++ dev->master = NULL; + + return TRUE; + } +-- +2.43.0 + diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index a30b55b..81e8f11 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -46,7 +46,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.20.14 -Release: 29%{?gitdate:.%{gitdate}}%{?dist} +Release: 30%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org # SPDX License: Adobe-Display-PostScript AND BSD-3-Clause AND DEC-3-Clause AND HPND AND HPND-sell-MIT-disclaimer-xserver AND HPND-sell-variant AND ICU AND ISC AND MIT AND MIT-open-group AND NTP AND SGI-B-2.0 AND SMLNJ AND X11 AND X11-distribute-modifications-variant @@ -170,6 +170,8 @@ Patch3820: 0007-dix-when-disabling-a-master-float-disabled-slaved-de.patch Patch3821: 0008-glx-Call-XACE-hooks-on-the-GLX-buffer.patch # CVE-2024-0409 Patch3822: 0009-ephyr-xwayland-Use-the-proper-private-key-for-cursor.patch +# Related to CVE-2024-21886 +Patch3823: 0001-dix-Fix-use-after-free-in-input-device-shutdown.patch BuildRequires: make BuildRequires: systemtap-sdt-devel @@ -585,6 +587,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Fri Jan 19 2024 José Expósito - 1.20.14-30 +- Fix use after free related to CVE-2024-21886 + * Tue Jan 16 2024 José Expósito - 1.20.14-29 - CVE fix for: CVE-2023-6816, CVE-2024-0229, CVE-2024-21885, CVE-2024-21886, CVE-2024-0408 and CVE-2024-0409 From af32bd411c16f7e657aae8ae6ae3a533cf76da5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Exp=C3=B3sito?= Date: Mon, 22 Jan 2024 09:25:50 +0100 Subject: [PATCH 097/131] Fix compilation error on i686 --- ...ncompatible-pointer-type-build-error.patch | 54 +++++++++++++++++++ xorg-x11-server.spec | 7 ++- 2 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 0001-ephyr-Fix-incompatible-pointer-type-build-error.patch diff --git a/0001-ephyr-Fix-incompatible-pointer-type-build-error.patch b/0001-ephyr-Fix-incompatible-pointer-type-build-error.patch new file mode 100644 index 0000000..345e660 --- /dev/null +++ b/0001-ephyr-Fix-incompatible-pointer-type-build-error.patch @@ -0,0 +1,54 @@ +From e89edec497bac581ca9b614fb00c25365580f045 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jos=C3=A9=20Exp=C3=B3sito?= +Date: Fri, 19 Jan 2024 13:05:51 +0100 +Subject: [PATCH] ephyr: Fix incompatible pointer type build error +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Fix a compilation error on 32 bits architectures with gcc 14: + + ephyr_glamor_xv.c: In function ‘ephyr_glamor_xv_init’: + ephyr_glamor_xv.c:154:31: error: assignment to ‘SetPortAttributeFuncPtr’ {aka ‘int (*)(struct _KdScreenInfo *, long unsigned int, int, void *)’} from incompatible pointer type ‘int (*)(KdScreenInfo *, Atom, INT32, void *)’ {aka ‘int (*)(struct _KdScreenInfo *, long unsigned int, long int, void *)’} [-Wincompatible-pointer-types] + 154 | adaptor->SetPortAttribute = ephyr_glamor_xv_set_port_attribute; + | ^ + ephyr_glamor_xv.c:155:31: error: assignment to ‘GetPortAttributeFuncPtr’ {aka ‘int (*)(struct _KdScreenInfo *, long unsigned int, int *, void *)’} from incompatible pointer type ‘int (*)(KdScreenInfo *, Atom, INT32 *, void *)’ {aka ‘int (*)(struct _KdScreenInfo *, long unsigned int, long int *, void *)’} [-Wincompatible-pointer-types] + 155 | adaptor->GetPortAttribute = ephyr_glamor_xv_get_port_attribute; + | ^ + +Build error logs: +https://koji.fedoraproject.org/koji/taskinfo?taskID=111964273 + +Signed-off-by: José Expósito +--- + hw/kdrive/ephyr/ephyr_glamor_xv.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/hw/kdrive/ephyr/ephyr_glamor_xv.c b/hw/kdrive/ephyr/ephyr_glamor_xv.c +index 4dd15cf41..b5eae48c8 100644 +--- a/hw/kdrive/ephyr/ephyr_glamor_xv.c ++++ b/hw/kdrive/ephyr/ephyr_glamor_xv.c +@@ -50,16 +50,16 @@ ephyr_glamor_xv_stop_video(KdScreenInfo *screen, void *data, Bool cleanup) + + static int + ephyr_glamor_xv_set_port_attribute(KdScreenInfo *screen, +- Atom attribute, INT32 value, void *data) ++ Atom attribute, int value, void *data) + { +- return glamor_xv_set_port_attribute(data, attribute, value); ++ return glamor_xv_set_port_attribute(data, attribute, (INT32)value); + } + + static int + ephyr_glamor_xv_get_port_attribute(KdScreenInfo *screen, +- Atom attribute, INT32 *value, void *data) ++ Atom attribute, int *value, void *data) + { +- return glamor_xv_get_port_attribute(data, attribute, value); ++ return glamor_xv_get_port_attribute(data, attribute, (INT32 *)value); + } + + static void +-- +2.43.0 + diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 81e8f11..108cb6f 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -46,7 +46,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.20.14 -Release: 30%{?gitdate:.%{gitdate}}%{?dist} +Release: 31%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org # SPDX License: Adobe-Display-PostScript AND BSD-3-Clause AND DEC-3-Clause AND HPND AND HPND-sell-MIT-disclaimer-xserver AND HPND-sell-variant AND ICU AND ISC AND MIT AND MIT-open-group AND NTP AND SGI-B-2.0 AND SMLNJ AND X11 AND X11-distribute-modifications-variant @@ -172,6 +172,8 @@ Patch3821: 0008-glx-Call-XACE-hooks-on-the-GLX-buffer.patch Patch3822: 0009-ephyr-xwayland-Use-the-proper-private-key-for-cursor.patch # Related to CVE-2024-21886 Patch3823: 0001-dix-Fix-use-after-free-in-input-device-shutdown.patch +# Fix compilation error on i686 +Patch3824: 0001-ephyr-Fix-incompatible-pointer-type-build-error.patch BuildRequires: make BuildRequires: systemtap-sdt-devel @@ -587,6 +589,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Fri Jan 19 2024 José Expósito - 1.20.14-31 +- Fix compilation error on i686 + * Fri Jan 19 2024 José Expósito - 1.20.14-30 - Fix use after free related to CVE-2024-21886 From 3982aab455824f967ed736ee47f9f24cbf50bf85 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 27 Jan 2024 10:01:05 +0000 Subject: [PATCH 098/131] Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild --- xorg-x11-server.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 108cb6f..d0b2d47 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -46,7 +46,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.20.14 -Release: 31%{?gitdate:.%{gitdate}}%{?dist} +Release: 32%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org # SPDX License: Adobe-Display-PostScript AND BSD-3-Clause AND DEC-3-Clause AND HPND AND HPND-sell-MIT-disclaimer-xserver AND HPND-sell-variant AND ICU AND ISC AND MIT AND MIT-open-group AND NTP AND SGI-B-2.0 AND SMLNJ AND X11 AND X11-distribute-modifications-variant @@ -589,6 +589,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Sat Jan 27 2024 Fedora Release Engineering - 1.20.14-32 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + * Fri Jan 19 2024 José Expósito - 1.20.14-31 - Fix compilation error on i686 From c88593e07dcdaae526de35cb6a34ffc50d3ba7b9 Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Tue, 30 Jan 2024 19:44:53 -0500 Subject: [PATCH 099/131] Apply all CVE patches to RHEL builds Patch 3801 is specific to Fedora, but all the other patches, even those that are newer, should be applied both to Fedora and RHEL (or, possibly in the future, EPEL) builds. --- xorg-x11-server.spec | 58 +++++++++++++++++++++++--------------------- 1 file changed, 30 insertions(+), 28 deletions(-) diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index d0b2d47..7efa161 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -143,38 +143,40 @@ Patch125: xorg-x11-server-fb-access-wrapper.patch # https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1057 Patch126: 0001-present-Send-a-PresentConfigureNotify-event-for-dest.patch +# CVE-2023-5367 +Patch1010: 0001-Xi-randr-fix-handling-of-PropModeAppend-Prepend.patch +# CVE-2023-5380 +Patch1011: 0002-mi-reset-the-PointerWindows-reference-on-screen-swit.patch +# CVE-2023-6377 +Patch1012: 0001-Xi-allocate-enough-XkbActions-for-our-buttons.patch +# CVE-2023-6478 +Patch1013: 0001-randr-avoid-integer-truncation-in-length-check-of-Pr.patch +# CVE-2023-6816 +Patch1014: 0001-dix-allocate-enough-space-for-logical-button-maps.patch +# CVE-2024-0229 +Patch1015: 0002-dix-Allocate-sufficient-xEvents-for-our-DeviceStateN.patch +Patch1016: 0003-dix-fix-DeviceStateNotify-event-calculation.patch +Patch1017: 0004-Xi-when-creating-a-new-ButtonClass-set-the-number-of.patch +# CVE-2024-21885 +Patch1018: 0005-Xi-flush-hierarchy-events-after-adding-removing-mast.patch +# CVE-2024-21886 +Patch1019: 0006-Xi-do-not-keep-linked-list-pointer-during-recursion.patch +Patch1020: 0007-dix-when-disabling-a-master-float-disabled-slaved-de.patch +# CVE-2024-0408 +Patch1021: 0008-glx-Call-XACE-hooks-on-the-GLX-buffer.patch +# CVE-2024-0409 +Patch1022: 0009-ephyr-xwayland-Use-the-proper-private-key-for-cursor.patch +# Related to CVE-2024-21886 +Patch1023: 0001-dix-Fix-use-after-free-in-input-device-shutdown.patch +# Fix compilation error on i686 +Patch1024: 0001-ephyr-Fix-incompatible-pointer-type-build-error.patch + +## Add new patches above; Fedora-specific patches below + # Only on F38 and later (patch number starts at 3801, see autopatch below) # Upstream commits 73d6e88, f69280dd and 4127776, minus the xwayland.pc.in change Patch3801: 0001-Disallow-byte-swapped-clients-by-default.patch -# CVE-2023-5367 -Patch3810: 0001-Xi-randr-fix-handling-of-PropModeAppend-Prepend.patch -# CVE-2023-5380 -Patch3811: 0002-mi-reset-the-PointerWindows-reference-on-screen-swit.patch -# CVE-2023-6377 -Patch3812: 0001-Xi-allocate-enough-XkbActions-for-our-buttons.patch -# CVE-2023-6478 -Patch3813: 0001-randr-avoid-integer-truncation-in-length-check-of-Pr.patch -# CVE-2023-6816 -Patch3814: 0001-dix-allocate-enough-space-for-logical-button-maps.patch -# CVE-2024-0229 -Patch3815: 0002-dix-Allocate-sufficient-xEvents-for-our-DeviceStateN.patch -Patch3816: 0003-dix-fix-DeviceStateNotify-event-calculation.patch -Patch3817: 0004-Xi-when-creating-a-new-ButtonClass-set-the-number-of.patch -# CVE-2024-21885 -Patch3818: 0005-Xi-flush-hierarchy-events-after-adding-removing-mast.patch -# CVE-2024-21886 -Patch3819: 0006-Xi-do-not-keep-linked-list-pointer-during-recursion.patch -Patch3820: 0007-dix-when-disabling-a-master-float-disabled-slaved-de.patch -# CVE-2024-0408 -Patch3821: 0008-glx-Call-XACE-hooks-on-the-GLX-buffer.patch -# CVE-2024-0409 -Patch3822: 0009-ephyr-xwayland-Use-the-proper-private-key-for-cursor.patch -# Related to CVE-2024-21886 -Patch3823: 0001-dix-Fix-use-after-free-in-input-device-shutdown.patch -# Fix compilation error on i686 -Patch3824: 0001-ephyr-Fix-incompatible-pointer-type-build-error.patch - BuildRequires: make BuildRequires: systemtap-sdt-devel BuildRequires: git-core From 43f6ceeda4e140feff387cb509965a6c32658485 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Exp=C3=B3sito?= Date: Mon, 4 Mar 2024 15:39:48 +0100 Subject: [PATCH 100/131] Add util-linux as a dependency of Xvfb The xvfb-run command uses getopt, provided by util-linux, but the dependency is not listed. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2267450 --- xorg-x11-server.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 7efa161..6976b5f 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -46,7 +46,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.20.14 -Release: 32%{?gitdate:.%{gitdate}}%{?dist} +Release: 33%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org # SPDX License: Adobe-Display-PostScript AND BSD-3-Clause AND DEC-3-Clause AND HPND AND HPND-sell-MIT-disclaimer-xserver AND HPND-sell-variant AND ICU AND ISC AND MIT AND MIT-open-group AND NTP AND SGI-B-2.0 AND SMLNJ AND X11 AND X11-distribute-modifications-variant @@ -306,6 +306,7 @@ License: MIT and GPLv2 Requires: xorg-x11-server-common >= %{version}-%{release} # required for xvfb-run Requires: xorg-x11-xauth +Requires: util-linux Provides: Xvfb %description Xvfb @@ -591,6 +592,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Mon Mar 04 2024 José Expósito - 1.20.14-33 +- Add util-linux as a dependency of Xvfb + * Sat Jan 27 2024 Fedora Release Engineering - 1.20.14-32 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild From 0ad871b912f6a37727f1034d98c9f9a8a7b8d3a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Exp=C3=B3sito?= Date: Wed, 3 Apr 2024 18:10:41 +0200 Subject: [PATCH 101/131] CVE fix for: CVE-2024-31080, CVE-2024-31081, CVE-2024-31082 and CVE-2024-31083 --- ...ctedEvents-needs-to-use-unswapped-le.patch | 45 +++++++ ...-copy-paste-error-in-the-DeviceState.patch | 33 ++++++ ...GrabDevice-needs-to-use-unswapped-le.patch | 43 +++++++ ...eDRICreatePixmap-needs-to-use-unswap.patch | 47 ++++++++ ...unting-of-glyphs-during-ProcRenderAd.patch | 112 ++++++++++++++++++ xorg-x11-server.spec | 16 ++- 6 files changed, 295 insertions(+), 1 deletion(-) create mode 100644 0001-Xi-ProcXIGetSelectedEvents-needs-to-use-unswapped-le.patch create mode 100644 0001-dix-fix-valuator-copy-paste-error-in-the-DeviceState.patch create mode 100644 0002-Xi-ProcXIPassiveGrabDevice-needs-to-use-unswapped-le.patch create mode 100644 0003-Xquartz-ProcAppleDRICreatePixmap-needs-to-use-unswap.patch create mode 100644 0004-render-fix-refcounting-of-glyphs-during-ProcRenderAd.patch diff --git a/0001-Xi-ProcXIGetSelectedEvents-needs-to-use-unswapped-le.patch b/0001-Xi-ProcXIGetSelectedEvents-needs-to-use-unswapped-le.patch new file mode 100644 index 0000000..5a64c75 --- /dev/null +++ b/0001-Xi-ProcXIGetSelectedEvents-needs-to-use-unswapped-le.patch @@ -0,0 +1,45 @@ +From 96798fc1967491c80a4d0c8d9e0a80586cb2152b Mon Sep 17 00:00:00 2001 +From: Alan Coopersmith +Date: Fri, 22 Mar 2024 18:51:45 -0700 +Subject: [PATCH 1/4] Xi: ProcXIGetSelectedEvents needs to use unswapped length + to send reply + +CVE-2024-31080 + +Reported-by: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=69762 +Fixes: 53e821ab4 ("Xi: add request processing for XIGetSelectedEvents.") +Signed-off-by: Alan Coopersmith +Part-of: +--- + Xi/xiselectev.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/Xi/xiselectev.c b/Xi/xiselectev.c +index edcb8a0d3..ac1494987 100644 +--- a/Xi/xiselectev.c ++++ b/Xi/xiselectev.c +@@ -349,6 +349,7 @@ ProcXIGetSelectedEvents(ClientPtr client) + InputClientsPtr others = NULL; + xXIEventMask *evmask = NULL; + DeviceIntPtr dev; ++ uint32_t length; + + REQUEST(xXIGetSelectedEventsReq); + REQUEST_SIZE_MATCH(xXIGetSelectedEventsReq); +@@ -418,10 +419,12 @@ ProcXIGetSelectedEvents(ClientPtr client) + } + } + ++ /* save the value before SRepXIGetSelectedEvents swaps it */ ++ length = reply.length; + WriteReplyToClient(client, sizeof(xXIGetSelectedEventsReply), &reply); + + if (reply.num_masks) +- WriteToClient(client, reply.length * 4, buffer); ++ WriteToClient(client, length * 4, buffer); + + free(buffer); + return Success; +-- +2.44.0 + diff --git a/0001-dix-fix-valuator-copy-paste-error-in-the-DeviceState.patch b/0001-dix-fix-valuator-copy-paste-error-in-the-DeviceState.patch new file mode 100644 index 0000000..363af1f --- /dev/null +++ b/0001-dix-fix-valuator-copy-paste-error-in-the-DeviceState.patch @@ -0,0 +1,33 @@ +From 133e0d651c5d12bf01999d6289e84e224ba77adc Mon Sep 17 00:00:00 2001 +From: Peter Hutterer +Date: Mon, 22 Jan 2024 14:22:12 +1000 +Subject: [PATCH] dix: fix valuator copy/paste error in the DeviceStateNotify + event + +Fixes 219c54b8a3337456ce5270ded6a67bcde53553d5 +--- + dix/enterleave.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/dix/enterleave.c b/dix/enterleave.c +index 7b7ba1098..c1e6ac600 100644 +--- a/dix/enterleave.c ++++ b/dix/enterleave.c +@@ -619,11 +619,11 @@ FixDeviceValuator(DeviceIntPtr dev, deviceValuator * ev, ValuatorClassPtr v, + ev->first_valuator = first; + switch (ev->num_valuators) { + case 6: +- ev->valuator2 = v->axisVal[first + 5]; ++ ev->valuator5 = v->axisVal[first + 5]; + case 5: +- ev->valuator2 = v->axisVal[first + 4]; ++ ev->valuator4 = v->axisVal[first + 4]; + case 4: +- ev->valuator2 = v->axisVal[first + 3]; ++ ev->valuator3 = v->axisVal[first + 3]; + case 3: + ev->valuator2 = v->axisVal[first + 2]; + case 2: +-- +2.44.0 + diff --git a/0002-Xi-ProcXIPassiveGrabDevice-needs-to-use-unswapped-le.patch b/0002-Xi-ProcXIPassiveGrabDevice-needs-to-use-unswapped-le.patch new file mode 100644 index 0000000..4e061f7 --- /dev/null +++ b/0002-Xi-ProcXIPassiveGrabDevice-needs-to-use-unswapped-le.patch @@ -0,0 +1,43 @@ +From 3e77295f888c67fc7645db5d0c00926a29ffecee Mon Sep 17 00:00:00 2001 +From: Alan Coopersmith +Date: Fri, 22 Mar 2024 18:56:27 -0700 +Subject: [PATCH 2/4] Xi: ProcXIPassiveGrabDevice needs to use unswapped length + to send reply + +CVE-2024-31081 + +Fixes: d220d6907 ("Xi: add GrabButton and GrabKeysym code.") +Signed-off-by: Alan Coopersmith +Part-of: +--- + Xi/xipassivegrab.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/Xi/xipassivegrab.c b/Xi/xipassivegrab.c +index c9ac2f855..896233bec 100644 +--- a/Xi/xipassivegrab.c ++++ b/Xi/xipassivegrab.c +@@ -93,6 +93,7 @@ ProcXIPassiveGrabDevice(ClientPtr client) + GrabParameters param; + void *tmp; + int mask_len; ++ uint32_t length; + + REQUEST(xXIPassiveGrabDeviceReq); + REQUEST_FIXED_SIZE(xXIPassiveGrabDeviceReq, +@@ -247,9 +248,11 @@ ProcXIPassiveGrabDevice(ClientPtr client) + } + } + ++ /* save the value before SRepXIPassiveGrabDevice swaps it */ ++ length = rep.length; + WriteReplyToClient(client, sizeof(rep), &rep); + if (rep.num_modifiers) +- WriteToClient(client, rep.length * 4, modifiers_failed); ++ WriteToClient(client, length * 4, modifiers_failed); + + out: + free(modifiers_failed); +-- +2.44.0 + diff --git a/0003-Xquartz-ProcAppleDRICreatePixmap-needs-to-use-unswap.patch b/0003-Xquartz-ProcAppleDRICreatePixmap-needs-to-use-unswap.patch new file mode 100644 index 0000000..df0a498 --- /dev/null +++ b/0003-Xquartz-ProcAppleDRICreatePixmap-needs-to-use-unswap.patch @@ -0,0 +1,47 @@ +From 6c684d035c06fd41c727f0ef0744517580864cef Mon Sep 17 00:00:00 2001 +From: Alan Coopersmith +Date: Fri, 22 Mar 2024 19:07:34 -0700 +Subject: [PATCH 3/4] Xquartz: ProcAppleDRICreatePixmap needs to use unswapped + length to send reply + +CVE-2024-31082 + +Fixes: 14205ade0 ("XQuartz: appledri: Fix byte swapping in replies") +Signed-off-by: Alan Coopersmith +Part-of: +--- + hw/xquartz/xpr/appledri.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/hw/xquartz/xpr/appledri.c b/hw/xquartz/xpr/appledri.c +index 77574655b..40422b61a 100644 +--- a/hw/xquartz/xpr/appledri.c ++++ b/hw/xquartz/xpr/appledri.c +@@ -272,6 +272,7 @@ ProcAppleDRICreatePixmap(ClientPtr client) + xAppleDRICreatePixmapReply rep; + int width, height, pitch, bpp; + void *ptr; ++ CARD32 stringLength; + + REQUEST_SIZE_MATCH(xAppleDRICreatePixmapReq); + +@@ -307,6 +308,7 @@ ProcAppleDRICreatePixmap(ClientPtr client) + if (sizeof(rep) != sz_xAppleDRICreatePixmapReply) + ErrorF("error sizeof(rep) is %zu\n", sizeof(rep)); + ++ stringLength = rep.stringLength; /* save unswapped value */ + if (client->swapped) { + swaps(&rep.sequenceNumber); + swapl(&rep.length); +@@ -319,7 +321,7 @@ ProcAppleDRICreatePixmap(ClientPtr client) + } + + WriteToClient(client, sizeof(rep), &rep); +- WriteToClient(client, rep.stringLength, path); ++ WriteToClient(client, stringLength, path); + + return Success; + } +-- +2.44.0 + diff --git a/0004-render-fix-refcounting-of-glyphs-during-ProcRenderAd.patch b/0004-render-fix-refcounting-of-glyphs-during-ProcRenderAd.patch new file mode 100644 index 0000000..dcbf337 --- /dev/null +++ b/0004-render-fix-refcounting-of-glyphs-during-ProcRenderAd.patch @@ -0,0 +1,112 @@ +From bdca6c3d1f5057eeb31609b1280fc93237b00c77 Mon Sep 17 00:00:00 2001 +From: Peter Hutterer +Date: Tue, 30 Jan 2024 13:13:35 +1000 +Subject: [PATCH 4/4] render: fix refcounting of glyphs during + ProcRenderAddGlyphs + +Previously, AllocateGlyph would return a new glyph with refcount=0 and a +re-used glyph would end up not changing the refcount at all. The +resulting glyph_new array would thus have multiple entries pointing to +the same non-refcounted glyphs. + +AddGlyph may free a glyph, resulting in a UAF when the same glyph +pointer is then later used. + +Fix this by returning a refcount of 1 for a new glyph and always +incrementing the refcount for a re-used glyph, followed by dropping that +refcount back down again when we're done with it. + +CVE-2024-31083, ZDI-CAN-22880 + +This vulnerability was discovered by: +Jan-Niklas Sohn working with Trend Micro Zero Day Initiative + +Part-of: +--- + render/glyph.c | 5 +++-- + render/glyphstr_priv.h | 1 + + render/render.c | 15 +++++++++++---- + 3 files changed, 15 insertions(+), 6 deletions(-) + +diff --git a/render/glyph.c b/render/glyph.c +index 850ea8440..13991f8a1 100644 +--- a/render/glyph.c ++++ b/render/glyph.c +@@ -245,10 +245,11 @@ FreeGlyphPicture(GlyphPtr glyph) + } + } + +-static void ++void + FreeGlyph(GlyphPtr glyph, int format) + { + CheckDuplicates(&globalGlyphs[format], "FreeGlyph"); ++ BUG_RETURN(glyph->refcnt == 0); + if (--glyph->refcnt == 0) { + GlyphRefPtr gr; + int i; +@@ -354,7 +355,7 @@ AllocateGlyph(xGlyphInfo * gi, int fdepth) + glyph = (GlyphPtr) malloc(size); + if (!glyph) + return 0; +- glyph->refcnt = 0; ++ glyph->refcnt = 1; + glyph->size = size + sizeof(xGlyphInfo); + glyph->info = *gi; + dixInitPrivates(glyph, (char *) glyph + head_size, PRIVATE_GLYPH); +diff --git a/render/glyphstr.h b/render/glyphstr.h +index 2f51bd244..3b1d806d1 100644 +--- a/render/glyphstr.h ++++ b/render/glyphstr.h +@@ -108,6 +108,7 @@ extern Bool + extern GlyphPtr FindGlyph(GlyphSetPtr glyphSet, Glyph id); + + extern GlyphPtr AllocateGlyph(xGlyphInfo * gi, int format); ++extern void FreeGlyph(GlyphPtr glyph, int format); + + extern Bool + ResizeGlyphSet(GlyphSetPtr glyphSet, CARD32 change); +diff --git a/render/render.c b/render/render.c +index 29c5055c6..fe5e37dd9 100644 +--- a/render/render.c ++++ b/render/render.c +@@ -1076,6 +1076,7 @@ ProcRenderAddGlyphs(ClientPtr client) + + if (glyph_new->glyph && glyph_new->glyph != DeletedGlyph) { + glyph_new->found = TRUE; ++ ++glyph_new->glyph->refcnt; + } + else { + GlyphPtr glyph; +@@ -1168,8 +1169,10 @@ ProcRenderAddGlyphs(ClientPtr client) + err = BadAlloc; + goto bail; + } +- for (i = 0; i < nglyphs; i++) ++ for (i = 0; i < nglyphs; i++) { + AddGlyph(glyphSet, glyphs[i].glyph, glyphs[i].id); ++ FreeGlyph(glyphs[i].glyph, glyphSet->fdepth); ++ } + + if (glyphsBase != glyphsLocal) + free(glyphsBase); +@@ -1179,9 +1182,13 @@ ProcRenderAddGlyphs(ClientPtr client) + FreePicture((void *) pSrc, 0); + if (pSrcPix) + FreeScratchPixmapHeader(pSrcPix); +- for (i = 0; i < nglyphs; i++) +- if (glyphs[i].glyph && !glyphs[i].found) +- free(glyphs[i].glyph); ++ for (i = 0; i < nglyphs; i++) { ++ if (glyphs[i].glyph) { ++ --glyphs[i].glyph->refcnt; ++ if (!glyphs[i].found) ++ free(glyphs[i].glyph); ++ } ++ } + if (glyphsBase != glyphsLocal) + free(glyphsBase); + return err; +-- +2.44.0 + diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 6976b5f..8a921eb 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -46,7 +46,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.20.14 -Release: 33%{?gitdate:.%{gitdate}}%{?dist} +Release: 34%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org # SPDX License: Adobe-Display-PostScript AND BSD-3-Clause AND DEC-3-Clause AND HPND AND HPND-sell-MIT-disclaimer-xserver AND HPND-sell-variant AND ICU AND ISC AND MIT AND MIT-open-group AND NTP AND SGI-B-2.0 AND SMLNJ AND X11 AND X11-distribute-modifications-variant @@ -170,6 +170,16 @@ Patch1022: 0009-ephyr-xwayland-Use-the-proper-private-key-for-cursor.patch Patch1023: 0001-dix-Fix-use-after-free-in-input-device-shutdown.patch # Fix compilation error on i686 Patch1024: 0001-ephyr-Fix-incompatible-pointer-type-build-error.patch +# Fix copy and paste error in CVE-2024-0229 +Patch1025: 0001-dix-fix-valuator-copy-paste-error-in-the-DeviceState.patch +# CVE-2024-31080 +Patch1026: 0001-Xi-ProcXIGetSelectedEvents-needs-to-use-unswapped-le.patch +# CVE-2024-31081 +Patch1027: 0002-Xi-ProcXIPassiveGrabDevice-needs-to-use-unswapped-le.patch +# CVE-2024-31082 +Patch1028: 0003-Xquartz-ProcAppleDRICreatePixmap-needs-to-use-unswap.patch +# CVE-2024-31083 +Patch1029: 0004-render-fix-refcounting-of-glyphs-during-ProcRenderAd.patch ## Add new patches above; Fedora-specific patches below @@ -592,6 +602,10 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Wed Apr 03 2024 José Expósito - 1.20.14-34 +- CVE fix for: CVE-2024-31080, CVE-2024-31081, CVE-2024-31082 and + CVE-2024-31083 + * Mon Mar 04 2024 José Expósito - 1.20.14-33 - Add util-linux as a dependency of Xvfb From 47092bca4f4e0d5a730cdc2bb49f4fb9c8f4528d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Exp=C3=B3sito?= Date: Wed, 10 Apr 2024 09:56:49 +0200 Subject: [PATCH 102/131] Fix regression caused by the fix for CVE-2024-31083 --- ...sible-double-free-in-ProcRenderAddGl.patch | 72 +++++++++++++++++++ xorg-x11-server.spec | 6 +- 2 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 0001-render-Avoid-possible-double-free-in-ProcRenderAddGl.patch diff --git a/0001-render-Avoid-possible-double-free-in-ProcRenderAddGl.patch b/0001-render-Avoid-possible-double-free-in-ProcRenderAddGl.patch new file mode 100644 index 0000000..549f90a --- /dev/null +++ b/0001-render-Avoid-possible-double-free-in-ProcRenderAddGl.patch @@ -0,0 +1,72 @@ +From 337d8d48b618d4fc0168a7b978be4c3447650b04 Mon Sep 17 00:00:00 2001 +From: Olivier Fourdan +Date: Fri, 5 Apr 2024 15:24:49 +0200 +Subject: [PATCH] render: Avoid possible double-free in ProcRenderAddGlyphs() + +ProcRenderAddGlyphs() adds the glyph to the glyphset using AddGlyph() and +then frees it using FreeGlyph() to decrease the reference count, after +AddGlyph() has increased it. + +AddGlyph() however may chose to reuse an existing glyph if it's already +in the glyphSet, and free the glyph that was given, in which case the +caller function, ProcRenderAddGlyphs() will call FreeGlyph() on an +already freed glyph, as reported by ASan: + + READ of size 4 thread T0 + #0 in FreeGlyph xserver/render/glyph.c:252 + #1 in ProcRenderAddGlyphs xserver/render/render.c:1174 + #2 in Dispatch xserver/dix/dispatch.c:546 + #3 in dix_main xserver/dix/main.c:271 + #4 in main xserver/dix/stubmain.c:34 + #5 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58 + #6 in __libc_start_main_impl ../csu/libc-start.c:360 + #7 (/usr/bin/Xwayland+0x44fe4) + Address is located 0 bytes inside of 64-byte region + freed by thread T0 here: + #0 in __interceptor_free libsanitizer/asan/asan_malloc_linux.cpp:52 + #1 in _dixFreeObjectWithPrivates xserver/dix/privates.c:538 + #2 in AddGlyph xserver/render/glyph.c:295 + #3 in ProcRenderAddGlyphs xserver/render/render.c:1173 + #4 in Dispatch xserver/dix/dispatch.c:546 + #5 in dix_main xserver/dix/main.c:271 + #6 in main xserver/dix/stubmain.c:34 + #7 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58 + previously allocated by thread T0 here: + #0 in __interceptor_malloc libsanitizer/asan/asan_malloc_linux.cpp:69 + #1 in AllocateGlyph xserver/render/glyph.c:355 + #2 in ProcRenderAddGlyphs xserver/render/render.c:1085 + #3 in Dispatch xserver/dix/dispatch.c:546 + #4 in dix_main xserver/dix/main.c:271 + #5 in main xserver/dix/stubmain.c:34 + #6 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58 + SUMMARY: AddressSanitizer: heap-use-after-free xserver/render/glyph.c:252 in FreeGlyph + +To avoid that, make sure not to free the given glyph in AddGlyph(). + +v2: Simplify the test using the boolean returned from AddGlyph() (Michel) +v3: Simplify even more by not freeing the glyph in AddGlyph() (Peter) + +Fixes: bdca6c3d1 - render: fix refcounting of glyphs during ProcRenderAddGlyphs +Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1659 +Signed-off-by: Olivier Fourdan +Part-of: +--- + render/glyph.c | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/render/glyph.c b/render/glyph.c +index 13991f8a1..5fa7f3b5b 100644 +--- a/render/glyph.c ++++ b/render/glyph.c +@@ -291,8 +291,6 @@ AddGlyph(GlyphSetPtr glyphSet, GlyphPtr glyph, Glyph id) + gr = FindGlyphRef(&globalGlyphs[glyphSet->fdepth], signature, + TRUE, glyph->sha1); + if (gr->glyph && gr->glyph != DeletedGlyph && gr->glyph != glyph) { +- FreeGlyphPicture(glyph); +- dixFreeObjectWithPrivates(glyph, PRIVATE_GLYPH); + glyph = gr->glyph; + } + else if (gr->glyph != glyph) { +-- +2.44.0 + diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 8a921eb..d5cfe46 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -46,7 +46,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.20.14 -Release: 34%{?gitdate:.%{gitdate}}%{?dist} +Release: 35%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org # SPDX License: Adobe-Display-PostScript AND BSD-3-Clause AND DEC-3-Clause AND HPND AND HPND-sell-MIT-disclaimer-xserver AND HPND-sell-variant AND ICU AND ISC AND MIT AND MIT-open-group AND NTP AND SGI-B-2.0 AND SMLNJ AND X11 AND X11-distribute-modifications-variant @@ -180,6 +180,7 @@ Patch1027: 0002-Xi-ProcXIPassiveGrabDevice-needs-to-use-unswapped-le.patch Patch1028: 0003-Xquartz-ProcAppleDRICreatePixmap-needs-to-use-unswap.patch # CVE-2024-31083 Patch1029: 0004-render-fix-refcounting-of-glyphs-during-ProcRenderAd.patch +Patch1030: 0001-render-Avoid-possible-double-free-in-ProcRenderAddGl.patch ## Add new patches above; Fedora-specific patches below @@ -602,6 +603,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Wed Apr 10 2024 José Expósito - 1.20.14-35 +- Fix regression caused by the fix for CVE-2024-31083 + * Wed Apr 03 2024 José Expósito - 1.20.14-34 - CVE fix for: CVE-2024-31080, CVE-2024-31081, CVE-2024-31082 and CVE-2024-31083 From ef7d64c39f7c4a503fe17f5bcc807def02c42c06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Exp=C3=B3sito?= Date: Wed, 8 May 2024 10:01:49 +0200 Subject: [PATCH 103/131] Backport fix for invalid Unicode sequence --- ...artz-Remove-invalid-Unicode-sequence.patch | 30 +++++++++++++++++++ xorg-x11-server.spec | 6 +++- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 0001-xquartz-Remove-invalid-Unicode-sequence.patch diff --git a/0001-xquartz-Remove-invalid-Unicode-sequence.patch b/0001-xquartz-Remove-invalid-Unicode-sequence.patch new file mode 100644 index 0000000..926849e --- /dev/null +++ b/0001-xquartz-Remove-invalid-Unicode-sequence.patch @@ -0,0 +1,30 @@ +From a7ba1e9fe41019296a0f3ddff3d681f77e041ad7 Mon Sep 17 00:00:00 2001 +From: Olivier Fourdan +Date: Tue, 7 May 2024 18:04:02 +0200 +Subject: [PATCH] xquartz: Remove invalid Unicode sequence + +This is flagged by the automatic scanning tools. + +Signed-off-by: Olivier Fourdan +Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1673 +Part-of: +--- + hw/xquartz/bundle/Resources/he.lproj/main.nib/designable.nib | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/hw/xquartz/bundle/Resources/he.lproj/main.nib/designable.nib b/hw/xquartz/bundle/Resources/he.lproj/main.nib/designable.nib +index e56c1adbc..42042a18d 100644 +--- a/hw/xquartz/bundle/Resources/he.lproj/main.nib/designable.nib ++++ b/hw/xquartz/bundle/Resources/he.lproj/main.nib/designable.nib +@@ -438,7 +438,7 @@ + + + +- ++ + + + +-- +2.45.0 + diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index d5cfe46..979899a 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -46,7 +46,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.20.14 -Release: 35%{?gitdate:.%{gitdate}}%{?dist} +Release: 36%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org # SPDX License: Adobe-Display-PostScript AND BSD-3-Clause AND DEC-3-Clause AND HPND AND HPND-sell-MIT-disclaimer-xserver AND HPND-sell-variant AND ICU AND ISC AND MIT AND MIT-open-group AND NTP AND SGI-B-2.0 AND SMLNJ AND X11 AND X11-distribute-modifications-variant @@ -107,6 +107,7 @@ Patch102: 0001-xf86-Accept-devices-with-the-simpledrm-driver.patch Patch103: 0001-Don-t-hardcode-fps-for-fake-screen.patch Patch104: 0001-hw-Rename-boolean-config-value-field-from-bool-to-bo.patch Patch105: 0001-add-a-quirk-for-apple-silicon.patch +Patch106: 0001-xquartz-Remove-invalid-Unicode-sequence.patch # CVE-2022-2319/ZDI-CAN-16062, CVE-2022-2320/ZDI-CAN-16070 Patch110: 0001-xkb-switch-to-array-index-loops-to-moving-pointers.patch @@ -603,6 +604,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Wed Apr 10 2024 José Expósito - 1.20.14-35 +- Backport fix for invalid Unicode sequence + * Wed Apr 10 2024 José Expósito - 1.20.14-35 - Fix regression caused by the fix for CVE-2024-31083 From aa17c8dba19993ef99b01a6cb4fd57494e91b356 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 20 Jul 2024 10:21:44 +0000 Subject: [PATCH 104/131] Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild --- xorg-x11-server.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 979899a..bd5f3e3 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -46,7 +46,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.20.14 -Release: 36%{?gitdate:.%{gitdate}}%{?dist} +Release: 37%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org # SPDX License: Adobe-Display-PostScript AND BSD-3-Clause AND DEC-3-Clause AND HPND AND HPND-sell-MIT-disclaimer-xserver AND HPND-sell-variant AND ICU AND ISC AND MIT AND MIT-open-group AND NTP AND SGI-B-2.0 AND SMLNJ AND X11 AND X11-distribute-modifications-variant @@ -604,6 +604,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Sat Jul 20 2024 Fedora Release Engineering - 1.20.14-37 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + * Wed Apr 10 2024 José Expósito - 1.20.14-35 - Backport fix for invalid Unicode sequence From 422064e45a4226682c5d5c2904bd3857ea41faec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20M=2E=20Basto?= Date: Mon, 2 Sep 2024 14:58:29 +0100 Subject: [PATCH 105/131] Update X11-server to 21.1.13 and ABI numbers of videodrv and xinput DMX DDX was dropped 0001-Disallow-byte-swapped-clients-by-default.patch is upstremaed 0001-autobind-GPUs-to-the-screen.patch is upstreamed 0001-xf86-dri2-Use-va_gl-as-vdpau_driver-for-Intel-i965-G.patch updated --- ..._gl-as-vdpau_driver-for-Intel-i965-G.patch | 31 +-- sources | 2 +- xorg-x11-server.spec | 211 +++++------------- 3 files changed, 75 insertions(+), 169 deletions(-) diff --git a/0001-xf86-dri2-Use-va_gl-as-vdpau_driver-for-Intel-i965-G.patch b/0001-xf86-dri2-Use-va_gl-as-vdpau_driver-for-Intel-i965-G.patch index cce0348..2134a44 100644 --- a/0001-xf86-dri2-Use-va_gl-as-vdpau_driver-for-Intel-i965-G.patch +++ b/0001-xf86-dri2-Use-va_gl-as-vdpau_driver-for-Intel-i965-G.patch @@ -52,7 +52,7 @@ index 6619e3aa7..1f8ad14bc 100644 /* For non-PCI devices and drmGetDevice fail, just assume that * the 3D driver is named the same as the kernel driver. This is * currently true for vc4 and msm (freedreno). -@@ -1456,12 +1460,14 @@ dri2_probe_driver_name(ScreenPtr pScreen, DRI2InfoPtr info) +@@ -1454,12 +1458,14 @@ dri2_probe_driver_name(ScreenPtr pScreen, DRI2InfoPtr info) xf86DrvMsg(pScreen->myNum, X_ERROR, "[DRI2] Couldn't drmGetVersion() on non-PCI device, " "no driver name found.\n"); @@ -70,7 +70,7 @@ index 6619e3aa7..1f8ad14bc 100644 } for (i = 0; driver_map[i].driver; i++) { -@@ -1469,13 +1475,15 @@ dri2_probe_driver_name(ScreenPtr pScreen, DRI2InfoPtr info) +@@ -1467,13 +1473,15 @@ dri2_probe_driver_name(ScreenPtr pScreen, DRI2InfoPtr info) continue; if (driver_map[i].num_chips_ids == -1) { @@ -88,7 +88,7 @@ index 6619e3aa7..1f8ad14bc 100644 goto out; } } -@@ -1487,9 +1495,9 @@ dri2_probe_driver_name(ScreenPtr pScreen, DRI2InfoPtr info) +@@ -1485,9 +1493,9 @@ dri2_probe_driver_name(ScreenPtr pScreen, DRI2InfoPtr info) dev->deviceinfo.pci->vendor_id, dev->deviceinfo.pci->device_id); out: drmFreeDevice(&dev); @@ -100,21 +100,21 @@ index 6619e3aa7..1f8ad14bc 100644 #endif } -@@ -1610,7 +1618,8 @@ DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info) - if (info->driverName) { - ds->driverNames[0] = info->driverName; +@@ -1604,7 +1612,8 @@ DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info) } else { + /* FIXME dri2_probe_driver_name() returns a strdup-ed string, + * currently this gets leaked */ - ds->driverNames[0] = ds->driverNames[1] = dri2_probe_driver_name(pScreen, info); + dri2_probe_driver_name(pScreen, info, + &ds->driverNames[0], &ds->driverNames[1]); if (!ds->driverNames[0]) return FALSE; - } + 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..7036d1003 100644 --- a/hw/xfree86/dri2/pci_ids/pci_id_driver_map.h +++ b/hw/xfree86/dri2/pci_ids/pci_id_driver_map.h -@@ -66,21 +66,22 @@ static const int vmwgfx_chip_ids[] = { +@@ -60,23 +60,24 @@ static const int vmwgfx_chip_ids[] = { static const struct { int vendor_id; const char *driver; @@ -124,8 +124,10 @@ index da7ea1c1e..7036d1003 100644 } 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 }, + { 0x8086, "i915", "i915", i915_chip_ids, ARRAY_SIZE(i915_chip_ids) }, + { 0x8086, "i965", "va_gl", i965_chip_ids, ARRAY_SIZE(i965_chip_ids) }, ++ { 0x8086, "i965", "va_gl", 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) }, @@ -134,19 +136,18 @@ index da7ea1c1e..7036d1003 100644 #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) }, +- { 0x0000, NULL, NULL, 0 }, + { 0x1002, "r300", "r300", r300_chip_ids, ARRAY_SIZE(r300_chip_ids) }, -+ { 0x1002, "r600","r600", r600_chip_ids, ARRAY_SIZE(r600_chip_ids) }, -+ { 0x1002, "radeonsi", "radeonsi", radeonsi_chip_ids, ARRAY_SIZE(radeonsi_chip_ids) }, ++ { 0x1002, "r600", "r600", r600_chip_ids, ARRAY_SIZE(r600_chip_ids) }, ++ { 0x1002, "radeonsi", "radeonsi", NULL, -1 }, + { 0x10de, "nouveau", "nouveau", NULL, -1 }, + { 0x1af4, "virtio_gpu", "virtio_gpu", virtio_gpu_chip_ids, ARRAY_SIZE(virtio_gpu_chip_ids) }, + { 0x15ad, "vmwgfx", "vmwgfx", vmwgfx_chip_ids, ARRAY_SIZE(vmwgfx_chip_ids) }, - { 0x0000, NULL, NULL, 0 }, ++ { 0x0000, NULL, NULL, NULL, 0 }, }; --- -2.19.0 - + #endif /* _PCI_ID_DRIVER_MAP_H_ */ diff --git a/sources b/sources index 32cd6fa..475e678 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (xorg-server-1.20.14.tar.xz) = be3dc32cce7d55d7e38c5f6557027f13f39224c76cc83e5800555d5ce89dbdc3731773a2d186a5b97db9fc8731a2b2dd6e9829af2b01ee2559246d4aef7c4963 +SHA512 (xorg-server-21.1.13.tar.xz) = a55fbeeed227c12c67f166f2c06a7f4f8d78feeea04c6e73509dbc723185fd0772349aa23f7c44cf0828ac0a0e2f9e4b26cffb220e6dfa7186d60f88b25ccaf1 diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index bd5f3e3..01c5b1f 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -20,10 +20,10 @@ # source because rpm is a terrible language. %global ansic_major 0 %global ansic_minor 4 -%global videodrv_major 24 -%global videodrv_minor 1 +%global videodrv_major 25 +%global videodrv_minor 2 %global xinput_major 24 -%global xinput_minor 1 +%global xinput_minor 4 %global extension_major 10 %global extension_minor 0 %endif @@ -45,8 +45,8 @@ Summary: X.Org X11 X server Name: xorg-x11-server -Version: 1.20.14 -Release: 37%{?gitdate:.%{gitdate}}%{?dist} +Version: 21.1.13 +Release: 1%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org # SPDX License: Adobe-Display-PostScript AND BSD-3-Clause AND DEC-3-Clause AND HPND AND HPND-sell-MIT-disclaimer-xserver AND HPND-sell-variant AND ICU AND ISC AND MIT AND MIT-open-group AND NTP AND SGI-B-2.0 AND SMLNJ AND X11 AND X11-distribute-modifications-variant @@ -85,9 +85,6 @@ Patch2: 0001-xfree86-use-modesetting-driver-by-default-on-GeForce.patch # va_gl should probably just be the default everywhere ? Patch3: 0001-xf86-dri2-Use-va_gl-as-vdpau_driver-for-Intel-i965-G.patch -# Submitted upstream, but not going anywhere -Patch5: 0001-autobind-GPUs-to-the-screen.patch - # because the display-managers are not ready yet, do not upstream Patch6: 0001-Fedora-hack-Make-the-suid-root-wrapper-always-start-.patch @@ -97,129 +94,60 @@ Patch6: 0001-Fedora-hack-Make-the-suid-root-wrapper-always-start-.patch # https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1001` Patch7: 0001-configure.ac-search-for-the-fontrootdir-ourselves.patch -# Backports from current stable "server-1.20-branch": +# Backports from current stable "server-21.1-branch": # -# Backports from "master" upstream: -Patch100: 0001-present-Check-for-NULL-to-prevent-crash.patch -Patch101: 0001-render-Fix-build-with-gcc-12.patch -Patch102: 0001-xf86-Accept-devices-with-the-simpledrm-driver.patch -Patch103: 0001-Don-t-hardcode-fps-for-fake-screen.patch -Patch104: 0001-hw-Rename-boolean-config-value-field-from-bool-to-bo.patch -Patch105: 0001-add-a-quirk-for-apple-silicon.patch -Patch106: 0001-xquartz-Remove-invalid-Unicode-sequence.patch - -# CVE-2022-2319/ZDI-CAN-16062, CVE-2022-2320/ZDI-CAN-16070 -Patch110: 0001-xkb-switch-to-array-index-loops-to-moving-pointers.patch -Patch111: 0002-xkb-swap-XkbSetDeviceInfo-and-XkbSetDeviceInfoCheck.patch -Patch112: 0003-xkb-add-request-length-validation-for-XkbSetGeometry.patch - -# CVE-2022-3550 -Patch113: 0001-xkb-proof-GetCountedString-against-request-length-at.patch -# CVE-2022-3551 -Patch114: 0001-xkb-fix-some-possible-memleaks-in-XkbGetKbdByName.patch - -# CVE-2022-46340 -Patch115: 0001-Xtest-disallow-GenericEvents-in-XTestSwapFakeInput.patch -# related to CVE-2022-46344 -Patch116: 0002-Xi-return-an-error-from-XI-property-changes-if-verif.patch -# CVE-2022-46344 -Patch117: 0003-Xi-avoid-integer-truncation-in-length-check-of-ProcX.patch -# CVE-2022-46341 -Patch118: 0004-Xi-disallow-passive-grabs-with-a-detail-255.patch -# CVE-2022-46343 -Patch119: 0005-Xext-free-the-screen-saver-resource-when-replacing-i.patch -# CVE-2022-46342 -Patch120: 0006-Xext-free-the-XvRTVideoNotify-when-turning-off-from-.patch -# CVE-2022-46283 -Patch121: 0007-xkb-reset-the-radio_groups-pointer-to-NULL-after-fre.patch -# Fix for buggy patch to CVE-2022-46340 -Patch122: 0008-Xext-fix-invalid-event-type-mask-in-XTestSwapFakeInp.patch -# CVE-2023-0494 -Patch123: 0001-Xi-fix-potential-use-after-free-in-DeepCopyPointerCl.patch -# CVE-2023-1393 -Patch124: 0001-composite-Fix-use-after-free-of-the-COW.patch -# https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1114 -Patch125: xorg-x11-server-fb-access-wrapper.patch -# https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1057 -Patch126: 0001-present-Send-a-PresentConfigureNotify-event-for-dest.patch - -# CVE-2023-5367 -Patch1010: 0001-Xi-randr-fix-handling-of-PropModeAppend-Prepend.patch -# CVE-2023-5380 -Patch1011: 0002-mi-reset-the-PointerWindows-reference-on-screen-swit.patch -# CVE-2023-6377 -Patch1012: 0001-Xi-allocate-enough-XkbActions-for-our-buttons.patch -# CVE-2023-6478 -Patch1013: 0001-randr-avoid-integer-truncation-in-length-check-of-Pr.patch -# CVE-2023-6816 -Patch1014: 0001-dix-allocate-enough-space-for-logical-button-maps.patch -# CVE-2024-0229 -Patch1015: 0002-dix-Allocate-sufficient-xEvents-for-our-DeviceStateN.patch -Patch1016: 0003-dix-fix-DeviceStateNotify-event-calculation.patch -Patch1017: 0004-Xi-when-creating-a-new-ButtonClass-set-the-number-of.patch -# CVE-2024-21885 -Patch1018: 0005-Xi-flush-hierarchy-events-after-adding-removing-mast.patch -# CVE-2024-21886 -Patch1019: 0006-Xi-do-not-keep-linked-list-pointer-during-recursion.patch -Patch1020: 0007-dix-when-disabling-a-master-float-disabled-slaved-de.patch -# CVE-2024-0408 -Patch1021: 0008-glx-Call-XACE-hooks-on-the-GLX-buffer.patch -# CVE-2024-0409 -Patch1022: 0009-ephyr-xwayland-Use-the-proper-private-key-for-cursor.patch -# Related to CVE-2024-21886 -Patch1023: 0001-dix-Fix-use-after-free-in-input-device-shutdown.patch # Fix compilation error on i686 +# https://gitlab.freedesktop.org/xorg/xserver/-/commit/8407181c7dfe14086d99697af0b86120320ab73e Patch1024: 0001-ephyr-Fix-incompatible-pointer-type-build-error.patch -# Fix copy and paste error in CVE-2024-0229 -Patch1025: 0001-dix-fix-valuator-copy-paste-error-in-the-DeviceState.patch -# CVE-2024-31080 -Patch1026: 0001-Xi-ProcXIGetSelectedEvents-needs-to-use-unswapped-le.patch -# CVE-2024-31081 -Patch1027: 0002-Xi-ProcXIPassiveGrabDevice-needs-to-use-unswapped-le.patch -# CVE-2024-31082 -Patch1028: 0003-Xquartz-ProcAppleDRICreatePixmap-needs-to-use-unswap.patch -# CVE-2024-31083 -Patch1029: 0004-render-fix-refcounting-of-glyphs-during-ProcRenderAd.patch -Patch1030: 0001-render-Avoid-possible-double-free-in-ProcRenderAddGl.patch ## Add new patches above; Fedora-specific patches below -# Only on F38 and later (patch number starts at 3801, see autopatch below) -# Upstream commits 73d6e88, f69280dd and 4127776, minus the xwayland.pc.in change -Patch3801: 0001-Disallow-byte-swapped-clients-by-default.patch BuildRequires: make BuildRequires: systemtap-sdt-devel BuildRequires: git-core -BuildRequires: automake autoconf libtool pkgconfig +BuildRequires: automake +BuildRequires: autoconf +BuildRequires: libtool +BuildRequires: pkgconfig BuildRequires: xorg-x11-util-macros >= 1.17 BuildRequires: xorg-x11-proto-devel >= 7.7-10 -BuildRequires: dbus-devel libepoxy-devel systemd-devel +BuildRequires: dbus-devel +BuildRequires: libepoxy-devel +BuildRequires: systemd-devel BuildRequires: xorg-x11-xtrans-devel >= 1.3.2 -BuildRequires: libXfont2-devel libXau-devel libxkbfile-devel libXres-devel -BuildRequires: libfontenc-devel libXtst-devel libXdmcp-devel -BuildRequires: libX11-devel libXext-devel -BuildRequires: libXinerama-devel libXi-devel - -# DMX config utils buildreqs. -BuildRequires: libXt-devel libdmx-devel libXmu-devel libXrender-devel -BuildRequires: libXi-devel libXpm-devel libXaw-devel libXfixes-devel +BuildRequires: libXfont2-devel +BuildRequires: libXau-devel +BuildRequires: libxkbfile-devel +BuildRequires: libXres-devel +BuildRequires: libfontenc-devel +BuildRequires: libXtst-devel +BuildRequires: libXdmcp-devel +BuildRequires: libX11-devel +BuildRequires: libXext-devel +BuildRequires: libXinerama-devel +BuildRequires: libXi-devel BuildRequires: pkgconfig(epoxy) BuildRequires: pkgconfig(xshmfence) >= 1.1 BuildRequires: libXv-devel BuildRequires: pixman-devel >= 0.30.0 -BuildRequires: libpciaccess-devel >= 0.13.1 openssl-devel bison flex +BuildRequires: libpciaccess-devel >= 0.13.1 +BuildRequires: openssl-devel +BuildRequires: bison +BuildRequires: flex BuildRequires: mesa-libGL-devel >= 9.2 BuildRequires: mesa-libEGL-devel BuildRequires: mesa-libgbm-devel # XXX silly... -BuildRequires: libdrm-devel >= 2.4.0 kernel-headers +BuildRequires: libdrm-devel >= 2.4.0 +BuildRequires: kernel-headers -BuildRequires: audit-libs-devel libselinux-devel >= 2.0.86-1 +BuildRequires: audit-libs-devel +BuildRequires: libselinux-devel >= 2.0.86-1 BuildRequires: libudev-devel # libunwind is Exclusive for the following arches %ifarch aarch64 %{arm} hppa ia64 mips ppc ppc64 %{ix86} x86_64 @@ -228,8 +156,12 @@ BuildRequires: libunwind-devel %endif %endif -BuildRequires: pkgconfig(xcb-aux) pkgconfig(xcb-image) pkgconfig(xcb-icccm) -BuildRequires: pkgconfig(xcb-keysyms) pkgconfig(xcb-renderutil) +BuildRequires: pkgconfig(xcb-aux) +BuildRequires: pkgconfig(xcb-image) +BuildRequires: pkgconfig(xcb-icccm) +BuildRequires: pkgconfig(xcb-keysyms) +BuildRequires: pkgconfig(xcb-renderutil) +BuildRequires: pkgconfig(libxcvt) %description X.Org X11 X server @@ -269,6 +201,9 @@ Obsoletes: xorg-x11-drv-modesetting < %{version}-%{release} Provides: xorg-x11-drv-modesetting = %{version}-%{release} # Dropped from F25 Obsoletes: xorg-x11-drv-vmmouse < 13.1.0-4 +# Dropped from xorg-x11-server-21.1 +# https://gitlab.freedesktop.org/xorg/xserver/-/commit/b3b81c8c2090cd49410960a021baf0d27fdd2ab3 +Obsoletes: xorg-x11-server-Xdmx < 1.20.15 Requires: xorg-x11-server-common >= %{version}-%{release} Requires: system-setup-keyboard @@ -295,22 +230,6 @@ is a very useful tool for developers who wish to test their applications without running them on their real X server. -%package Xdmx -Summary: Distributed Multihead X Server and utilities -Requires: xorg-x11-server-common >= %{version}-%{release} -Provides: Xdmx - -%description Xdmx -Xdmx is proxy X server that provides multi-head support for multiple displays -attached to different machines (each of which is running a typical X server). -When Xinerama is used with Xdmx, the multiple displays on multiple machines -are presented to the user as a single unified screen. A simple application -for Xdmx would be to provide multi-head support using two desktop machines, -each of which has a single display device attached to it. A complex -application for Xdmx would be to unify a 4 by 4 grid of 1280x1024 displays -(each attached to one of 16 computers) into a unified 5120x4096 display. - - %package Xvfb Summary: A X Windows System virtual framebuffer X server # xvfb-run is GPLv2, rest is MIT @@ -374,14 +293,11 @@ Xserver source code needed to build VNC server (Xvnc) %autosetup -N -n %{pkgname}-%{?gitdate:%{gitdate}}%{!?gitdate:%{version}} rm -rf .git cp %{SOURCE1} .gitignore +%global _default_patch_flags -f # ick -%global __scm git -%{expand:%__scm_setup_git -q} -%if 0%{?fedora} >= 38 -%autopatch -%else -%autopatch -M 3800 -%endif +#%%global __scm git +#%%{expand:%%__scm_setup_git -q} +%autopatch -p1 %if 0%{?stable_abi} # check the ABI in the source against what we expect. @@ -484,7 +400,7 @@ mkdir -p %{inst_srcdir}/{hw/dmx/doc,man,doc,hw/dmx/doxygen} cp {,%{inst_srcdir}/}hw/xquartz/bundle/cpprules.in cp {,%{inst_srcdir}/}man/Xserver.man cp {,%{inst_srcdir}/}doc/smartsched -cp {,%{inst_srcdir}/}hw/dmx/doxygen/doxygen.conf.in +#cp {,%{inst_srcdir}/}hw/dmx/doxygen/doxygen.conf.in cp {,%{inst_srcdir}/}xserver.ent.in cp {,%{inst_srcdir}/}hw/xfree86/Xorg.sh.in cp xkb/README.compiled %{inst_srcdir}/xkb @@ -524,7 +440,6 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %{_bindir}/Xorg %{_libexecdir}/Xorg %{Xorgperms} %{_libexecdir}/Xorg.wrap -%{_bindir}/cvt %{_bindir}/gtf %dir %{_libdir}/xorg %dir %{_libdir}/xorg/modules @@ -533,9 +448,10 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %dir %{_libdir}/xorg/modules/extensions %{_libdir}/xorg/modules/extensions/libglx.so %dir %{_libdir}/xorg/modules/input +%{_libdir}/xorg/modules/input/inputtest_drv.so %{_libdir}/xorg/modules/libfbdevhw.so %{_libdir}/xorg/modules/libexa.so -%{_libdir}/xorg/modules/libfb.so +#%%{_libdir}/xorg/modules/libfb.so %{_libdir}/xorg/modules/libglamoregl.so %{_libdir}/xorg/modules/libshadow.so %{_libdir}/xorg/modules/libshadowfb.so @@ -543,14 +459,14 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %{_libdir}/xorg/modules/libwfb.so %if %{defined int10_arch} %{_libdir}/xorg/modules/libint10.so -%{_libdir}/xorg/modules/libvbe.so +#%%{_libdir}/xorg/modules/libvbe.so %endif %{_mandir}/man1/gtf.1* %{_mandir}/man1/Xorg.1* %{_mandir}/man1/Xorg.wrap.1* -%{_mandir}/man1/cvt.1* %{_mandir}/man4/fbdevhw.4* %{_mandir}/man4/exa.4* +%{_mandir}/man4//inputtestdrv.4* %{_mandir}/man4/modesetting.4* %{_mandir}/man5/Xwrapper.config.5* %{_mandir}/man5/xorg.conf.5* @@ -563,24 +479,6 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %{_bindir}/Xnest %{_mandir}/man1/Xnest.1* -%files Xdmx -%{_bindir}/Xdmx -%{_bindir}/dmxaddinput -%{_bindir}/dmxaddscreen -%{_bindir}/dmxreconfig -%{_bindir}/dmxresize -%{_bindir}/dmxrminput -%{_bindir}/dmxrmscreen -%{_bindir}/dmxtodmx -%{_bindir}/dmxwininfo -%{_bindir}/vdltodmx -%{_bindir}/dmxinfo -%{_bindir}/xdmxconfig -%{_mandir}/man1/Xdmx.1* -%{_mandir}/man1/dmxtodmx.1* -%{_mandir}/man1/vdltodmx.1* -%{_mandir}/man1/xdmxconfig.1* - %files Xvfb %{_bindir}/Xvfb %{_bindir}/xvfb-run @@ -604,6 +502,13 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Mon Sep 02 2024 Sérgio Basto - 21.1.13-1 +- Update X11-server to 21.1.13 and ABI numbers of videodrv and xinput +- DMX DDX was dropped +- 0001-Disallow-byte-swapped-clients-by-default.patch is upstreamed +- 0001-autobind-GPUs-to-the-screen.patch is upstreamed +- 0001-xf86-dri2-Use-va_gl-as-vdpau_driver-for-Intel-i965-G.patch updated + * Sat Jul 20 2024 Fedora Release Engineering - 1.20.14-37 - Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild From 72accf2c5acec0be38e8a7dfb48c37299dceb728 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20M=2E=20Basto?= Date: Wed, 17 Jul 2024 18:08:52 +0100 Subject: [PATCH 106/131] Remove unused patches with fedpkg unused-patches --- ...llow-byte-swapped-clients-by-default.patch | 272 ---------------- 0001-Don-t-hardcode-fps-for-fake-screen.patch | 135 -------- ...ctedEvents-needs-to-use-unswapped-le.patch | 45 --- ...te-enough-XkbActions-for-our-buttons.patch | 77 ----- ...-use-after-free-in-DeepCopyPointerCl.patch | 35 --- ...x-handling-of-PropModeAppend-Prepend.patch | 80 ----- ...-GenericEvents-in-XTestSwapFakeInput.patch | 52 ---- 0001-add-a-quirk-for-apple-silicon.patch | 30 -- 0001-autobind-GPUs-to-the-screen.patch | 293 ------------------ ...posite-Fix-use-after-free-of-the-COW.patch | 42 --- ...-after-free-in-input-device-shutdown.patch | 77 ----- ...enough-space-for-logical-button-maps.patch | 51 --- ...-copy-paste-error-in-the-DeviceState.patch | 33 -- ...n-config-value-field-from-bool-to-bo.patch | 154 --------- ...sent-Check-for-NULL-to-prevent-crash.patch | 43 --- ...resentConfigureNotify-event-for-dest.patch | 105 ------- ...ger-truncation-in-length-check-of-Pr.patch | 61 ---- ...sible-double-free-in-ProcRenderAddGl.patch | 72 ----- 0001-render-Fix-build-with-gcc-12.patch | 90 ------ ...pt-devices-with-the-simpledrm-driver.patch | 34 -- ...possible-memleaks-in-XkbGetKbdByName.patch | 59 ---- ...ntedString-against-request-length-at.patch | 35 --- ...array-index-loops-to-moving-pointers.patch | 76 ----- ...GrabDevice-needs-to-use-unswapped-le.patch | 43 --- ...or-from-XI-property-changes-if-verif.patch | 41 --- ...ficient-xEvents-for-our-DeviceStateN.patch | 84 ----- ...nterWindows-reference-on-screen-swit.patch | 99 ------ ...DeviceInfo-and-XkbSetDeviceInfoCheck.patch | 179 ----------- ...-truncation-in-length-check-of-ProcX.patch | 71 ----- ...eDRICreatePixmap-needs-to-use-unswap.patch | 47 --- ...-DeviceStateNotify-event-calculation.patch | 217 ------------- ...length-validation-for-XkbSetGeometry.patch | 182 ----------- ...llow-passive-grabs-with-a-detail-255.patch | 82 ----- ...-a-new-ButtonClass-set-the-number-of.patch | 37 --- ...unting-of-glyphs-during-ProcRenderAd.patch | 112 ------- ...reen-saver-resource-when-replacing-i.patch | 48 --- ...hy-events-after-adding-removing-mast.patch | 109 ------- ...RTVideoNotify-when-turning-off-from-.patch | 74 ----- ...linked-list-pointer-during-recursion.patch | 70 ----- ...ng-a-master-float-disabled-slaved-de.patch | 53 ---- ...dio_groups-pointer-to-NULL-after-fre.patch | 36 --- ...-event-type-mask-in-XTestSwapFakeInp.patch | 35 --- ...lx-Call-XACE-hooks-on-the-GLX-buffer.patch | 60 ---- ...se-the-proper-private-key-for-cursor.patch | 56 ---- xorg-x11-server-fb-access-wrapper.patch | 31 -- 45 files changed, 3717 deletions(-) delete mode 100644 0001-Disallow-byte-swapped-clients-by-default.patch delete mode 100644 0001-Don-t-hardcode-fps-for-fake-screen.patch delete mode 100644 0001-Xi-ProcXIGetSelectedEvents-needs-to-use-unswapped-le.patch delete mode 100644 0001-Xi-allocate-enough-XkbActions-for-our-buttons.patch delete mode 100644 0001-Xi-fix-potential-use-after-free-in-DeepCopyPointerCl.patch delete mode 100644 0001-Xi-randr-fix-handling-of-PropModeAppend-Prepend.patch delete mode 100644 0001-Xtest-disallow-GenericEvents-in-XTestSwapFakeInput.patch delete mode 100644 0001-add-a-quirk-for-apple-silicon.patch delete mode 100644 0001-autobind-GPUs-to-the-screen.patch delete mode 100644 0001-composite-Fix-use-after-free-of-the-COW.patch delete mode 100644 0001-dix-Fix-use-after-free-in-input-device-shutdown.patch delete mode 100644 0001-dix-allocate-enough-space-for-logical-button-maps.patch delete mode 100644 0001-dix-fix-valuator-copy-paste-error-in-the-DeviceState.patch delete mode 100644 0001-hw-Rename-boolean-config-value-field-from-bool-to-bo.patch delete mode 100644 0001-present-Check-for-NULL-to-prevent-crash.patch delete mode 100644 0001-present-Send-a-PresentConfigureNotify-event-for-dest.patch delete mode 100644 0001-randr-avoid-integer-truncation-in-length-check-of-Pr.patch delete mode 100644 0001-render-Avoid-possible-double-free-in-ProcRenderAddGl.patch delete mode 100644 0001-render-Fix-build-with-gcc-12.patch delete mode 100644 0001-xf86-Accept-devices-with-the-simpledrm-driver.patch delete mode 100644 0001-xkb-fix-some-possible-memleaks-in-XkbGetKbdByName.patch delete mode 100644 0001-xkb-proof-GetCountedString-against-request-length-at.patch delete mode 100644 0001-xkb-switch-to-array-index-loops-to-moving-pointers.patch delete mode 100644 0002-Xi-ProcXIPassiveGrabDevice-needs-to-use-unswapped-le.patch delete mode 100644 0002-Xi-return-an-error-from-XI-property-changes-if-verif.patch delete mode 100644 0002-dix-Allocate-sufficient-xEvents-for-our-DeviceStateN.patch delete mode 100644 0002-mi-reset-the-PointerWindows-reference-on-screen-swit.patch delete mode 100644 0002-xkb-swap-XkbSetDeviceInfo-and-XkbSetDeviceInfoCheck.patch delete mode 100644 0003-Xi-avoid-integer-truncation-in-length-check-of-ProcX.patch delete mode 100644 0003-Xquartz-ProcAppleDRICreatePixmap-needs-to-use-unswap.patch delete mode 100644 0003-dix-fix-DeviceStateNotify-event-calculation.patch delete mode 100644 0003-xkb-add-request-length-validation-for-XkbSetGeometry.patch delete mode 100644 0004-Xi-disallow-passive-grabs-with-a-detail-255.patch delete mode 100644 0004-Xi-when-creating-a-new-ButtonClass-set-the-number-of.patch delete mode 100644 0004-render-fix-refcounting-of-glyphs-during-ProcRenderAd.patch delete mode 100644 0005-Xext-free-the-screen-saver-resource-when-replacing-i.patch delete mode 100644 0005-Xi-flush-hierarchy-events-after-adding-removing-mast.patch delete mode 100644 0006-Xext-free-the-XvRTVideoNotify-when-turning-off-from-.patch delete mode 100644 0006-Xi-do-not-keep-linked-list-pointer-during-recursion.patch delete mode 100644 0007-dix-when-disabling-a-master-float-disabled-slaved-de.patch delete mode 100644 0007-xkb-reset-the-radio_groups-pointer-to-NULL-after-fre.patch delete mode 100644 0008-Xext-fix-invalid-event-type-mask-in-XTestSwapFakeInp.patch delete mode 100644 0008-glx-Call-XACE-hooks-on-the-GLX-buffer.patch delete mode 100644 0009-ephyr-xwayland-Use-the-proper-private-key-for-cursor.patch delete mode 100644 xorg-x11-server-fb-access-wrapper.patch diff --git a/0001-Disallow-byte-swapped-clients-by-default.patch b/0001-Disallow-byte-swapped-clients-by-default.patch deleted file mode 100644 index 2cbf798..0000000 --- a/0001-Disallow-byte-swapped-clients-by-default.patch +++ /dev/null @@ -1,272 +0,0 @@ -From 73d6e888c6058b28a0e87ab65aa4172b17d8327d Mon Sep 17 00:00:00 2001 -From: Peter Hutterer -Date: Mon, 19 Dec 2022 10:34:29 +1000 -Subject: [PATCH xserver] Fix some indentation issues - -Signed-off-by: Peter Hutterer ---- - dix/dispatch.c | 22 +++++++++++----------- - 1 file changed, 11 insertions(+), 11 deletions(-) - -diff --git a/dix/dispatch.c b/dix/dispatch.c -index 210df75c63..e38a8fecaa 100644 ---- a/dix/dispatch.c -+++ b/dix/dispatch.c -@@ -492,10 +492,10 @@ Dispatch(void) - if (!WaitForSomething(clients_are_ready())) - continue; - -- /***************** -- * Handle events in round robin fashion, doing input between -- * each round -- *****************/ -+ /***************** -+ * Handle events in round robin fashion, doing input between -+ * each round -+ *****************/ - - if (!dispatchException && clients_are_ready()) { - client = SmartScheduleClient(); -@@ -3657,11 +3657,11 @@ ProcInitialConnection(ClientPtr client) - prefix = (xConnClientPrefix *) ((char *)stuff + sz_xReq); - order = prefix->byteOrder; - if (order != 'l' && order != 'B' && order != 'r' && order != 'R') -- return client->noClientException = -1; -+ return client->noClientException = -1; - if (((*(char *) &whichbyte) && (order == 'B' || order == 'R')) || -- (!(*(char *) &whichbyte) && (order == 'l' || order == 'r'))) { -- client->swapped = TRUE; -- SwapConnClientPrefix(prefix); -+ (!(*(char *) &whichbyte) && (order == 'l' || order == 'r'))) { -+ client->swapped = TRUE; -+ SwapConnClientPrefix(prefix); - } - stuff->reqType = 2; - stuff->length += bytes_to_int32(prefix->nbytesAuthProto) + -@@ -3670,7 +3670,7 @@ ProcInitialConnection(ClientPtr client) - swaps(&stuff->length); - } - if (order == 'r' || order == 'R') { -- client->local = FALSE; -+ client->local = FALSE; - } - ResetCurrentRequest(client); - return Success; -@@ -3781,8 +3781,8 @@ ProcEstablishConnection(ClientPtr client) - auth_string = auth_proto + pad_to_int32(prefix->nbytesAuthProto); - - if ((client->req_len << 2) != sz_xReq + sz_xConnClientPrefix + -- pad_to_int32(prefix->nbytesAuthProto) + -- pad_to_int32(prefix->nbytesAuthString)) -+ pad_to_int32(prefix->nbytesAuthProto) + -+ pad_to_int32(prefix->nbytesAuthString)) - reason = "Bad length"; - else if ((prefix->majorVersion != X_PROTOCOL) || - (prefix->minorVersion != X_PROTOCOL_REVISION)) --- -2.39.0 - -From f69280ddcdd3115ee4717f22e85e0f43569b60dd Mon Sep 17 00:00:00 2001 -From: Peter Hutterer -Date: Tue, 20 Dec 2022 11:40:16 +1000 -Subject: [PATCH xserver] dix: localize two variables - -Signed-off-by: Peter Hutterer ---- - dix/dispatch.c | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/dix/dispatch.c b/dix/dispatch.c -index c651c3d887..92be773e6c 100644 ---- a/dix/dispatch.c -+++ b/dix/dispatch.c -@@ -3766,14 +3766,11 @@ int - ProcEstablishConnection(ClientPtr client) - { - const char *reason; -- char *auth_proto, *auth_string; - xConnClientPrefix *prefix; - - REQUEST(xReq); - - prefix = (xConnClientPrefix *) ((char *) stuff + sz_xReq); -- auth_proto = (char *) prefix + sz_xConnClientPrefix; -- auth_string = auth_proto + pad_to_int32(prefix->nbytesAuthProto); - - if ((client->req_len << 2) != sz_xReq + sz_xConnClientPrefix + - pad_to_int32(prefix->nbytesAuthProto) + -@@ -3782,12 +3779,15 @@ ProcEstablishConnection(ClientPtr client) - else if ((prefix->majorVersion != X_PROTOCOL) || - (prefix->minorVersion != X_PROTOCOL_REVISION)) - reason = "Protocol version mismatch"; -- else -+ else { -+ char *auth_proto = (char *) prefix + sz_xConnClientPrefix; -+ char *auth_string = auth_proto + pad_to_int32(prefix->nbytesAuthProto); - reason = ClientAuthorized(client, - (unsigned short) prefix->nbytesAuthProto, - auth_proto, - (unsigned short) prefix->nbytesAuthString, - auth_string); -+ } - - return (SendConnSetup(client, reason)); - } --- -2.39.0 - -From 412777664a20dd3561b936c02c96571a756fe9b2 Mon Sep 17 00:00:00 2001 -From: Peter Hutterer -Date: Tue, 20 Dec 2022 10:42:03 +1000 -Subject: [PATCH xserver] Disallow byte-swapped clients by default - -The X server swapping code is a huge attack surface, much of this code -is untested and prone to security issues. The use-case of byte-swapped -clients is very niche, so let's disable this by default and allow it -only when the respective config option or commandline flag is given. - -For Xorg, this adds the ServerFlag "AllowByteSwappedClients" "on". -For all DDX, this adds the commandline options +byteswappedclients and --byteswappedclients to enable or disable, respectively. - -Fixes #1201 - -https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1029 - -Signed-off-by: Peter Hutterer ---- - dix/dispatch.c | 4 +++- - hw/xfree86/common/xf86Config.c | 8 ++++++++ - hw/xfree86/man/xorg.conf.man | 2 ++ - hw/xwayland/xwayland.pc.in | 1 + - include/opaque.h | 2 ++ - man/Xserver.man | 6 ++++++ - os/utils.c | 9 +++++++++ - 7 files changed, 31 insertions(+), 1 deletion(-) - -diff --git a/dix/dispatch.c b/dix/dispatch.c -index 92be773e6c..9c26753a96 100644 ---- a/dix/dispatch.c -+++ b/dix/dispatch.c -@@ -3772,7 +3772,9 @@ ProcEstablishConnection(ClientPtr client) - - prefix = (xConnClientPrefix *) ((char *) stuff + sz_xReq); - -- if ((client->req_len << 2) != sz_xReq + sz_xConnClientPrefix + -+ if (client->swapped && !AllowByteSwappedClients) { -+ reason = "Prohibited client endianess, see the Xserver man page "; -+ } else if ((client->req_len << 2) != sz_xReq + sz_xConnClientPrefix + - pad_to_int32(prefix->nbytesAuthProto) + - pad_to_int32(prefix->nbytesAuthString)) - reason = "Bad length"; -diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c -index 5d814c1485..41acb25aa2 100644 ---- a/hw/xfree86/common/xf86Config.c -+++ b/hw/xfree86/common/xf86Config.c -@@ -646,6 +646,7 @@ typedef enum { - FLAG_MAX_CLIENTS, - FLAG_IGLX, - FLAG_DEBUG, -+ FLAG_ALLOW_BYTE_SWAPPED_CLIENTS, - } FlagValues; - - /** -@@ -705,6 +706,8 @@ static OptionInfoRec FlagOptions[] = { - {0}, FALSE}, - {FLAG_DEBUG, "Debug", OPTV_STRING, - {0}, FALSE}, -+ {FLAG_ALLOW_BYTE_SWAPPED_CLIENTS, "AllowByteSwappedClients", OPTV_BOOLEAN, -+ {0}, FALSE}, - {-1, NULL, OPTV_NONE, - {0}, FALSE}, - }; -@@ -746,6 +749,11 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts) - xf86Msg(X_CONFIG, "Ignoring ABI Version\n"); - } - -+ xf86GetOptValBool(FlagOptions, FLAG_ALLOW_BYTE_SWAPPED_CLIENTS, &AllowByteSwappedClients); -+ if (AllowByteSwappedClients) { -+ xf86Msg(X_CONFIG, "Allowing byte-swapped clients\n"); -+ } -+ - if (xf86IsOptionSet(FlagOptions, FLAG_AUTO_ADD_DEVICES)) { - xf86GetOptValBool(FlagOptions, FLAG_AUTO_ADD_DEVICES, - &xf86Info.autoAddDevices); -diff --git a/hw/xfree86/man/xorg.conf.man b/hw/xfree86/man/xorg.conf.man -index 01b47247ee..d057f26ecd 100644 ---- a/hw/xfree86/man/xorg.conf.man -+++ b/hw/xfree86/man/xorg.conf.man -@@ -677,6 +677,8 @@ Possible values are - or - .BR sync . - Unset by default. -+.BI "Option \*qAllowByteSwappedClients\*q \*q" boolean \*q -+Allow clients with a different byte-order than the server. Disabled by default. - .SH "MODULE SECTION" - The - .B Module -diff --git a/include/opaque.h b/include/opaque.h -index 256261c2ad..398d4b4e51 100644 ---- a/include/opaque.h -+++ b/include/opaque.h -@@ -74,4 +74,6 @@ extern _X_EXPORT Bool bgNoneRoot; - extern _X_EXPORT Bool CoreDump; - extern _X_EXPORT Bool NoListenAll; - -+extern _X_EXPORT Bool AllowByteSwappedClients; -+ - #endif /* OPAQUE_H */ -diff --git a/man/Xserver.man b/man/Xserver.man -index 764bd1d907..e7adf9eb35 100644 ---- a/man/Xserver.man -+++ b/man/Xserver.man -@@ -114,6 +114,12 @@ pattern. This is the default unless -retro or -wr is specified. - .B \-bs - disables backing store support on all screens. - .TP 8 -+.B \+byteswappedclients -+Allow connections from clients with an endianess different to that of the server. -+.TP 8 -+.B \-byteswappedclients -+Prohibit connections from clients with an endianess different to that of the server. -+.TP 8 - .B \-c - turns off key-click. - .TP 8 -diff --git a/os/utils.c b/os/utils.c -index fe94912f34..405bf7d8b4 100644 ---- a/os/utils.c -+++ b/os/utils.c -@@ -189,6 +189,8 @@ Bool CoreDump; - - Bool enableIndirectGLX = FALSE; - -+Bool AllowByteSwappedClients = FALSE; -+ - #ifdef PANORAMIX - Bool PanoramiXExtensionDisabledHack = FALSE; - #endif -@@ -523,6 +525,8 @@ UseMsg(void) - ErrorF("-br create root window with black background\n"); - ErrorF("+bs enable any backing store support\n"); - ErrorF("-bs disable any backing store support\n"); -+ ErrorF("+byteswappedclients Allow clients with endianess different to that of the server\n"); -+ ErrorF("-byteswappedclients Prohibit clients with endianess different to that of the server\n"); - ErrorF("-c turns off key-click\n"); - ErrorF("c # key-click volume (0-100)\n"); - ErrorF("-cc int default color visual class\n"); -@@ -720,6 +724,11 @@ ProcessCommandLine(int argc, char *argv[]) - else - UseMsg(); - } -+ else if (strcmp(argv[i], "-byteswappedclients") == 0) { -+ AllowByteSwappedClients = FALSE; -+ } else if (strcmp(argv[i], "+byteswappedclients") == 0) { -+ AllowByteSwappedClients = TRUE; -+ } - else if (strcmp(argv[i], "-br") == 0); /* default */ - else if (strcmp(argv[i], "+bs") == 0) - enableBackingStore = TRUE; --- -2.39.0 - diff --git a/0001-Don-t-hardcode-fps-for-fake-screen.patch b/0001-Don-t-hardcode-fps-for-fake-screen.patch deleted file mode 100644 index 465a92b..0000000 --- a/0001-Don-t-hardcode-fps-for-fake-screen.patch +++ /dev/null @@ -1,135 +0,0 @@ -From 6497eeeb1a6552315132340565a3901d4db2144c Mon Sep 17 00:00:00 2001 -From: Boris-Barboris -Date: Tue, 22 Jun 2021 00:51:08 +0300 -Subject: [PATCH] Don't hardcode fps for fake screen - -Currently, when main hardware screen is powered-off, -X server initializes fake screen's timer with -1 second update interval. - -Streaming software like Nomachine or Vnc, as well as -desktop input automation suffers from it, since it -will forever be stuck on 1 fps until the display is -turned back on. - -This commit adds command line option -fakescreenfps -that allows the user to change the default fake screen -timer. - -Signed-off-by: Baranin Alexander ---- - man/Xserver.man | 3 +++ - os/utils.c | 12 ++++++++++++ - present/present.h | 2 ++ - present/present_fake.c | 28 ++++++++++++++++++---------- - 4 files changed, 35 insertions(+), 10 deletions(-) - -diff --git a/man/Xserver.man b/man/Xserver.man -index 31ffb8c..b1a3f40 100644 ---- a/man/Xserver.man -+++ b/man/Xserver.man -@@ -169,6 +169,9 @@ sets default cursor font. - .B \-fn \fIfont\fP - sets the default font. - .TP 8 -+.B \-fakescreenfps \fFps\fP -+sets fake presenter screen default fps (allowable range: 1-600). -+.TP 8 - .B \-fp \fIfontPath\fP - sets the search path for fonts. This path is a comma separated list - of directories which the X server searches for font databases. -diff --git a/os/utils.c b/os/utils.c -index 2ba1c80..721d4e9 100644 ---- a/os/utils.c -+++ b/os/utils.c -@@ -110,6 +110,8 @@ __stdcall unsigned long GetTickCount(void); - - #include "picture.h" - -+#include "present.h" -+ - Bool noTestExtensions; - - #ifdef COMPOSITE -@@ -526,6 +528,7 @@ UseMsg(void) - ErrorF - ("-deferglyphs [none|all|16] defer loading of [no|all|16-bit] glyphs\n"); - ErrorF("-f # bell base (0-100)\n"); -+ ErrorF("-fakescreenfps # fake screen default fps (1-600)\n"); - ErrorF("-fc string cursor font\n"); - ErrorF("-fn string default font name\n"); - ErrorF("-fp string default font path\n"); -@@ -776,6 +779,15 @@ ProcessCommandLine(int argc, char *argv[]) - else - UseMsg(); - } -+ else if (strcmp(argv[i], "-fakescreenfps") == 0) { -+ if (++i < argc) { -+ FakeScreenFps = (uint32_t) atoi(argv[i]); -+ if (FakeScreenFps < 1 || FakeScreenFps > 600) -+ FatalError("fakescreenfps must be an integer in [1;600] range\n"); -+ } -+ else -+ UseMsg(); -+ } - else if (strcmp(argv[i], "-fc") == 0) { - if (++i < argc) - defaultCursorFont = argv[i]; -diff --git a/present/present.h b/present/present.h -index 3d0b972..e7cc50d 100644 ---- a/present/present.h -+++ b/present/present.h -@@ -190,4 +190,6 @@ present_register_complete_notify(present_complete_notify_proc proc); - extern _X_EXPORT Bool - present_can_window_flip(WindowPtr window); - -+extern _X_EXPORT uint32_t FakeScreenFps; -+ - #endif /* _PRESENT_H_ */ -diff --git a/present/present_fake.c b/present/present_fake.c -index 2350638..d9ac598 100644 ---- a/present/present_fake.c -+++ b/present/present_fake.c -@@ -117,21 +117,29 @@ present_fake_queue_vblank(ScreenPtr screen, - return Success; - } - -+uint32_t FakeScreenFps = 0; -+ - void - present_fake_screen_init(ScreenPtr screen) - { -+ uint32_t fake_fps; - present_screen_priv_ptr screen_priv = present_screen_priv(screen); - -- /* For screens with hardware vblank support, the fake code -- * will be used for off-screen windows and while screens are blanked, -- * in which case we want a slow interval here -- * -- * Otherwise, pretend that the screen runs at 60Hz -- */ -- if (screen_priv->info && screen_priv->info->get_crtc) -- screen_priv->fake_interval = 1000000; -- else -- screen_priv->fake_interval = 16667; -+ if (FakeScreenFps) -+ fake_fps = FakeScreenFps; -+ else { -+ /* For screens with hardware vblank support, the fake code -+ * will be used for off-screen windows and while screens are blanked, -+ * in which case we want a large interval here: 1Hz -+ * -+ * Otherwise, pretend that the screen runs at 60Hz -+ */ -+ if (screen_priv->info && screen_priv->info->get_crtc) -+ fake_fps = 1; -+ else -+ fake_fps = 60; -+ } -+ screen_priv->fake_interval = 1000000 / fake_fps; - } - - void --- -2.34.1 - diff --git a/0001-Xi-ProcXIGetSelectedEvents-needs-to-use-unswapped-le.patch b/0001-Xi-ProcXIGetSelectedEvents-needs-to-use-unswapped-le.patch deleted file mode 100644 index 5a64c75..0000000 --- a/0001-Xi-ProcXIGetSelectedEvents-needs-to-use-unswapped-le.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 96798fc1967491c80a4d0c8d9e0a80586cb2152b Mon Sep 17 00:00:00 2001 -From: Alan Coopersmith -Date: Fri, 22 Mar 2024 18:51:45 -0700 -Subject: [PATCH 1/4] Xi: ProcXIGetSelectedEvents needs to use unswapped length - to send reply - -CVE-2024-31080 - -Reported-by: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=69762 -Fixes: 53e821ab4 ("Xi: add request processing for XIGetSelectedEvents.") -Signed-off-by: Alan Coopersmith -Part-of: ---- - Xi/xiselectev.c | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/Xi/xiselectev.c b/Xi/xiselectev.c -index edcb8a0d3..ac1494987 100644 ---- a/Xi/xiselectev.c -+++ b/Xi/xiselectev.c -@@ -349,6 +349,7 @@ ProcXIGetSelectedEvents(ClientPtr client) - InputClientsPtr others = NULL; - xXIEventMask *evmask = NULL; - DeviceIntPtr dev; -+ uint32_t length; - - REQUEST(xXIGetSelectedEventsReq); - REQUEST_SIZE_MATCH(xXIGetSelectedEventsReq); -@@ -418,10 +419,12 @@ ProcXIGetSelectedEvents(ClientPtr client) - } - } - -+ /* save the value before SRepXIGetSelectedEvents swaps it */ -+ length = reply.length; - WriteReplyToClient(client, sizeof(xXIGetSelectedEventsReply), &reply); - - if (reply.num_masks) -- WriteToClient(client, reply.length * 4, buffer); -+ WriteToClient(client, length * 4, buffer); - - free(buffer); - return Success; --- -2.44.0 - diff --git a/0001-Xi-allocate-enough-XkbActions-for-our-buttons.patch b/0001-Xi-allocate-enough-XkbActions-for-our-buttons.patch deleted file mode 100644 index 11236a1..0000000 --- a/0001-Xi-allocate-enough-XkbActions-for-our-buttons.patch +++ /dev/null @@ -1,77 +0,0 @@ -From a7bda3080d2b44eae668cdcec7a93095385b9652 Mon Sep 17 00:00:00 2001 -From: Peter Hutterer -Date: Tue, 28 Nov 2023 15:19:04 +1000 -Subject: [PATCH xserver] Xi: allocate enough XkbActions for our buttons - -button->xkb_acts is supposed to be an array sufficiently large for all -our buttons, not just a single XkbActions struct. Allocating -insufficient memory here means when we memcpy() later in -XkbSetDeviceInfo we write into memory that wasn't ours to begin with, -leading to the usual security ooopsiedaisies. - -CVE-2023-6377, ZDI-CAN-22412, ZDI-CAN-22413 - -This vulnerability was discovered by: -Jan-Niklas Sohn working with Trend Micro Zero Day Initiative - -(cherry picked from commit 0c1a93d319558fe3ab2d94f51d174b4f93810afd) ---- - Xi/exevents.c | 12 ++++++------ - dix/devices.c | 10 ++++++++++ - 2 files changed, 16 insertions(+), 6 deletions(-) - -diff --git a/Xi/exevents.c b/Xi/exevents.c -index dcd4efb3bc..54ea11a938 100644 ---- a/Xi/exevents.c -+++ b/Xi/exevents.c -@@ -611,13 +611,13 @@ DeepCopyPointerClasses(DeviceIntPtr from, DeviceIntPtr to) - } - - if (from->button->xkb_acts) { -- if (!to->button->xkb_acts) { -- to->button->xkb_acts = calloc(1, sizeof(XkbAction)); -- if (!to->button->xkb_acts) -- FatalError("[Xi] not enough memory for xkb_acts.\n"); -- } -+ size_t maxbuttons = max(to->button->numButtons, from->button->numButtons); -+ to->button->xkb_acts = xnfreallocarray(to->button->xkb_acts, -+ maxbuttons, -+ sizeof(XkbAction)); -+ memset(to->button->xkb_acts, 0, maxbuttons * sizeof(XkbAction)); - memcpy(to->button->xkb_acts, from->button->xkb_acts, -- sizeof(XkbAction)); -+ from->button->numButtons * sizeof(XkbAction)); - } - else { - free(to->button->xkb_acts); -diff --git a/dix/devices.c b/dix/devices.c -index 5bf956ead4..15e46a9a5f 100644 ---- a/dix/devices.c -+++ b/dix/devices.c -@@ -2525,6 +2525,8 @@ RecalculateMasterButtons(DeviceIntPtr slave) - - if (master->button && master->button->numButtons != maxbuttons) { - int i; -+ int last_num_buttons = master->button->numButtons; -+ - DeviceChangedEvent event = { - .header = ET_Internal, - .type = ET_DeviceChanged, -@@ -2535,6 +2537,14 @@ RecalculateMasterButtons(DeviceIntPtr slave) - }; - - master->button->numButtons = maxbuttons; -+ if (last_num_buttons < maxbuttons) { -+ master->button->xkb_acts = xnfreallocarray(master->button->xkb_acts, -+ maxbuttons, -+ sizeof(XkbAction)); -+ memset(&master->button->xkb_acts[last_num_buttons], -+ 0, -+ (maxbuttons - last_num_buttons) * sizeof(XkbAction)); -+ } - - memcpy(&event.buttons.names, master->button->labels, maxbuttons * - sizeof(Atom)); --- -2.43.0 - diff --git a/0001-Xi-fix-potential-use-after-free-in-DeepCopyPointerCl.patch b/0001-Xi-fix-potential-use-after-free-in-DeepCopyPointerCl.patch deleted file mode 100644 index 2389895..0000000 --- a/0001-Xi-fix-potential-use-after-free-in-DeepCopyPointerCl.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 7150ba655c0cc08fa6ded309b81265bb672f2869 Mon Sep 17 00:00:00 2001 -From: Peter Hutterer -Date: Wed, 25 Jan 2023 11:41:40 +1000 -Subject: [PATCH xserver] Xi: fix potential use-after-free in - DeepCopyPointerClasses - -CVE-2023-0494, ZDI-CAN 19596 - -This vulnerability was discovered by: -Jan-Niklas Sohn working with Trend Micro Zero Day Initiative - -Signed-off-by: Peter Hutterer ---- - Xi/exevents.c | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/Xi/exevents.c b/Xi/exevents.c -index 217baa9561..dcd4efb3bc 100644 ---- a/Xi/exevents.c -+++ b/Xi/exevents.c -@@ -619,8 +619,10 @@ DeepCopyPointerClasses(DeviceIntPtr from, DeviceIntPtr to) - memcpy(to->button->xkb_acts, from->button->xkb_acts, - sizeof(XkbAction)); - } -- else -+ else { - free(to->button->xkb_acts); -+ to->button->xkb_acts = NULL; -+ } - - memcpy(to->button->labels, from->button->labels, - from->button->numButtons * sizeof(Atom)); --- -2.39.0 - diff --git a/0001-Xi-randr-fix-handling-of-PropModeAppend-Prepend.patch b/0001-Xi-randr-fix-handling-of-PropModeAppend-Prepend.patch deleted file mode 100644 index 99625dd..0000000 --- a/0001-Xi-randr-fix-handling-of-PropModeAppend-Prepend.patch +++ /dev/null @@ -1,80 +0,0 @@ -From a31ba141824a7649e11f0ef7673718ce559d6337 Mon Sep 17 00:00:00 2001 -From: Peter Hutterer -Date: Tue, 3 Oct 2023 11:53:05 +1000 -Subject: [PATCH xserver 1/4] Xi/randr: fix handling of PropModeAppend/Prepend - -The handling of appending/prepending properties was incorrect, with at -least two bugs: the property length was set to the length of the new -part only, i.e. appending or prepending N elements to a property with P -existing elements always resulted in the property having N elements -instead of N + P. - -Second, when pre-pending a value to a property, the offset for the old -values was incorrect, leaving the new property with potentially -uninitalized values and/or resulting in OOB memory writes. -For example, prepending a 3 element value to a 5 element property would -result in this 8 value array: - [N, N, N, ?, ?, P, P, P ] P, P - ^OOB write - -The XI2 code is a copy/paste of the RandR code, so the bug exists in -both. - -CVE-2023-5367, ZDI-CAN-22153 - -This vulnerability was discovered by: -Jan-Niklas Sohn working with Trend Micro Zero Day Initiative - -Signed-off-by: Peter Hutterer ---- - Xi/xiproperty.c | 4 ++-- - randr/rrproperty.c | 4 ++-- - 2 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/Xi/xiproperty.c b/Xi/xiproperty.c -index 6ec419e870..563c4f31a5 100644 ---- a/Xi/xiproperty.c -+++ b/Xi/xiproperty.c -@@ -730,7 +730,7 @@ XIChangeDeviceProperty(DeviceIntPtr dev, Atom property, Atom type, - XIDestroyDeviceProperty(prop); - return BadAlloc; - } -- new_value.size = len; -+ new_value.size = total_len; - new_value.type = type; - new_value.format = format; - -@@ -747,7 +747,7 @@ XIChangeDeviceProperty(DeviceIntPtr dev, Atom property, Atom type, - case PropModePrepend: - new_data = new_value.data; - old_data = (void *) (((char *) new_value.data) + -- (prop_value->size * size_in_bytes)); -+ (len * size_in_bytes)); - break; - } - if (new_data) -diff --git a/randr/rrproperty.c b/randr/rrproperty.c -index c2fb9585c6..25469f57b2 100644 ---- a/randr/rrproperty.c -+++ b/randr/rrproperty.c -@@ -209,7 +209,7 @@ RRChangeOutputProperty(RROutputPtr output, Atom property, Atom type, - RRDestroyOutputProperty(prop); - return BadAlloc; - } -- new_value.size = len; -+ new_value.size = total_len; - new_value.type = type; - new_value.format = format; - -@@ -226,7 +226,7 @@ RRChangeOutputProperty(RROutputPtr output, Atom property, Atom type, - case PropModePrepend: - new_data = new_value.data; - old_data = (void *) (((char *) new_value.data) + -- (prop_value->size * size_in_bytes)); -+ (len * size_in_bytes)); - break; - } - if (new_data) --- -2.41.0 - diff --git a/0001-Xtest-disallow-GenericEvents-in-XTestSwapFakeInput.patch b/0001-Xtest-disallow-GenericEvents-in-XTestSwapFakeInput.patch deleted file mode 100644 index 017f247..0000000 --- a/0001-Xtest-disallow-GenericEvents-in-XTestSwapFakeInput.patch +++ /dev/null @@ -1,52 +0,0 @@ -From 8dba686dc277d6d262ad0c77b4632a5b276697ba Mon Sep 17 00:00:00 2001 -From: Peter Hutterer -Date: Tue, 29 Nov 2022 12:55:45 +1000 -Subject: [PATCH xserver 1/7] Xtest: disallow GenericEvents in - XTestSwapFakeInput - -XTestSwapFakeInput assumes all events in this request are -sizeof(xEvent) and iterates through these in 32-byte increments. -However, a GenericEvent may be of arbitrary length longer than 32 bytes, -so any GenericEvent in this list would result in subsequent events to be -misparsed. - -Additional, the swapped event is written into a stack-allocated struct -xEvent (size 32 bytes). For any GenericEvent longer than 32 bytes, -swapping the event may thus smash the stack like an avocado on toast. - -Catch this case early and return BadValue for any GenericEvent. -Which is what would happen in unswapped setups anyway since XTest -doesn't support GenericEvent. - -CVE-2022-46340, ZDI-CAN 19265 - -This vulnerability was discovered by: -Jan-Niklas Sohn working with Trend Micro Zero Day Initiative - -Signed-off-by: Peter Hutterer -Acked-by: Olivier Fourdan ---- - Xext/xtest.c | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - -diff --git a/Xext/xtest.c b/Xext/xtest.c -index bf27eb590b..2985a4ce6e 100644 ---- a/Xext/xtest.c -+++ b/Xext/xtest.c -@@ -502,10 +502,11 @@ XTestSwapFakeInput(ClientPtr client, xReq * req) - - nev = ((req->length << 2) - sizeof(xReq)) / sizeof(xEvent); - for (ev = (xEvent *) &req[1]; --nev >= 0; ev++) { -+ int evtype = ev->u.u.type & 0x177; - /* Swap event */ -- proc = EventSwapVector[ev->u.u.type & 0177]; -+ proc = EventSwapVector[evtype]; - /* no swapping proc; invalid event type? */ -- if (!proc || proc == NotImplemented) { -+ if (!proc || proc == NotImplemented || evtype == GenericEvent) { - client->errorValue = ev->u.u.type; - return BadValue; - } --- -2.38.1 - diff --git a/0001-add-a-quirk-for-apple-silicon.patch b/0001-add-a-quirk-for-apple-silicon.patch deleted file mode 100644 index 17c40e5..0000000 --- a/0001-add-a-quirk-for-apple-silicon.patch +++ /dev/null @@ -1,30 +0,0 @@ -commit 39934a656a44722d16a80bf4db411c53e2d67b38 (HEAD -> master, origin/master, origin/HEAD) -Author: Eric Curtin -Date: Fri Dec 16 11:10:12 2022 +0000 - - config: add a quirk for Apple Silicon appledrm - - Xorg server does not correctly select the DCP for the display without a - quirk on Apple Silicon. - - Signed-off-by: Eric Curtin - Suggested-by: Hector Martin - -diff --git a/config/10-quirks.conf b/config/10-quirks.conf -index 47907d82d..54dd908a7 100644 ---- a/config/10-quirks.conf -+++ b/config/10-quirks.conf -@@ -36,3 +36,13 @@ Section "InputClass" - MatchDriver "evdev" - Option "TypeName" "MOUSE" - EndSection -+ -+# https://bugzilla.redhat.com/show_bug.cgi?id=2152414 -+# Xorg server does not correctly select the DCP for the display without -+# a quirk on Apple Silicon -+Section "OutputClass" -+ Identifier "appledrm" -+ MatchDriver "apple" -+ Driver "modesetting" -+ Option "PrimaryGPU" "true" -+EndSection diff --git a/0001-autobind-GPUs-to-the-screen.patch b/0001-autobind-GPUs-to-the-screen.patch deleted file mode 100644 index 86b96a2..0000000 --- a/0001-autobind-GPUs-to-the-screen.patch +++ /dev/null @@ -1,293 +0,0 @@ -From 471289fa1dc359555ceed6302f7d9605ab6be3ea Mon Sep 17 00:00:00 2001 -From: Dave Airlie -Date: Mon, 2 Apr 2018 16:49:02 -0400 -Subject: [PATCH] autobind GPUs to the screen - -This is a modified version of a patch we've been carry-ing in Fedora and -RHEL for years now. This patch automatically adds secondary GPUs to the -master as output sink / offload source making e.g. the use of -slave-outputs just work, with requiring the user to manually run -"xrandr --setprovideroutputsource" before he can hookup an external -monitor to his hybrid graphics laptop. - -There is one problem with this patch, which is why it was not upstreamed -before. What to do when a secondary GPU gets detected really is a policy -decission (e.g. one may want to autobind PCI GPUs but not USB ones) and -as such should be under control of the Desktop Environment. - -Unconditionally adding autobinding support to the xserver will result -in races between the DE dealing with the hotplug of a secondary GPU -and the server itself dealing with it. - -However we've waited for years for any Desktop Environments to actually -start doing some sort of autoconfiguration of secondary GPUs and there -is still not a single DE dealing with this, so I believe that it is -time to upstream this now. - -To avoid potential future problems if any DEs get support for doing -secondary GPU configuration themselves, the new autobind functionality -is made optional. Since no DEs currently support doing this themselves it -is enabled by default. When DEs grow support for doing this themselves -they can disable the servers autobinding through the servers cmdline or a -xorg.conf snippet. - -Signed-off-by: Dave Airlie -[hdegoede@redhat.com: Make configurable, fix with nvidia, submit upstream] -Signed-off-by: Hans de Goede ---- - hw/xfree86/common/xf86Config.c | 19 +++++++++++++++++++ - hw/xfree86/common/xf86Globals.c | 2 ++ - hw/xfree86/common/xf86Init.c | 20 ++++++++++++++++++++ - hw/xfree86/common/xf86Priv.h | 1 + - hw/xfree86/common/xf86Privstr.h | 1 + - hw/xfree86/common/xf86platformBus.c | 4 ++++ - hw/xfree86/man/Xorg.man | 7 +++++++ - hw/xfree86/man/xorg.conf.man | 6 ++++++ - randr/randrstr.h | 3 +++ - randr/rrprovider.c | 22 ++++++++++++++++++++++ - 10 files changed, 85 insertions(+) - -diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c -index 2c1d335..d7d7c2e 100644 ---- a/hw/xfree86/common/xf86Config.c -+++ b/hw/xfree86/common/xf86Config.c -@@ -643,6 +643,7 @@ typedef enum { - FLAG_DRI2, - FLAG_USE_SIGIO, - FLAG_AUTO_ADD_GPU, -+ FLAG_AUTO_BIND_GPU, - FLAG_MAX_CLIENTS, - FLAG_IGLX, - FLAG_DEBUG, -@@ -699,6 +700,8 @@ static OptionInfoRec FlagOptions[] = { - {0}, FALSE}, - {FLAG_AUTO_ADD_GPU, "AutoAddGPU", OPTV_BOOLEAN, - {0}, FALSE}, -+ {FLAG_AUTO_BIND_GPU, "AutoBindGPU", OPTV_BOOLEAN, -+ {0}, FALSE}, - {FLAG_MAX_CLIENTS, "MaxClients", OPTV_INTEGER, - {0}, FALSE }, - {FLAG_IGLX, "IndirectGLX", OPTV_BOOLEAN, -@@ -779,6 +782,22 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts) - } - xf86Msg(from, "%sutomatically adding GPU devices\n", - xf86Info.autoAddGPU ? "A" : "Not a"); -+ -+ if (xf86AutoBindGPUDisabled) { -+ xf86Info.autoBindGPU = FALSE; -+ from = X_CMDLINE; -+ } -+ else if (xf86IsOptionSet(FlagOptions, FLAG_AUTO_BIND_GPU)) { -+ xf86GetOptValBool(FlagOptions, FLAG_AUTO_BIND_GPU, -+ &xf86Info.autoBindGPU); -+ from = X_CONFIG; -+ } -+ else { -+ from = X_DEFAULT; -+ } -+ xf86Msg(from, "%sutomatically binding GPU devices\n", -+ xf86Info.autoBindGPU ? "A" : "Not a"); -+ - /* - * Set things up based on the config file information. Some of these - * settings may be overridden later when the command line options are -diff --git a/hw/xfree86/common/xf86Globals.c b/hw/xfree86/common/xf86Globals.c -index e890f05..7b27b4c 100644 ---- a/hw/xfree86/common/xf86Globals.c -+++ b/hw/xfree86/common/xf86Globals.c -@@ -131,6 +131,7 @@ xf86InfoRec xf86Info = { - #else - .autoAddGPU = FALSE, - #endif -+ .autoBindGPU = TRUE, - }; - - const char *xf86ConfigFile = NULL; -@@ -191,6 +192,7 @@ Bool xf86FlipPixels = FALSE; - Gamma xf86Gamma = { 0.0, 0.0, 0.0 }; - - Bool xf86AllowMouseOpenFail = FALSE; -+Bool xf86AutoBindGPUDisabled = FALSE; - - #ifdef XF86VIDMODE - Bool xf86VidModeDisabled = FALSE; -diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c -index ea42ec9..ec255b6 100644 ---- a/hw/xfree86/common/xf86Init.c -+++ b/hw/xfree86/common/xf86Init.c -@@ -76,6 +76,7 @@ - #include "xf86DDC.h" - #include "xf86Xinput.h" - #include "xf86InPriv.h" -+#include "xf86Crtc.h" - #include "picturestr.h" - #include "randrstr.h" - #include "glxvndabi.h" -@@ -237,6 +238,19 @@ xf86PrivsElevated(void) - return PrivsElevated(); - } - -+static void -+xf86AutoConfigOutputDevices(void) -+{ -+ int i; -+ -+ if (!xf86Info.autoBindGPU) -+ return; -+ -+ for (i = 0; i < xf86NumGPUScreens; i++) -+ RRProviderAutoConfigGpuScreen(xf86ScrnToScreen(xf86GPUScreens[i]), -+ xf86ScrnToScreen(xf86Screens[0])); -+} -+ - static void - TrapSignals(void) - { -@@ -770,6 +784,8 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv) - for (i = 0; i < xf86NumGPUScreens; i++) - AttachUnboundGPU(xf86Screens[0]->pScreen, xf86GPUScreens[i]->pScreen); - -+ xf86AutoConfigOutputDevices(); -+ - xf86VGAarbiterWrapFunctions(); - if (sigio_blocked) - input_unlock(); -@@ -1278,6 +1294,10 @@ ddxProcessArgument(int argc, char **argv, int i) - xf86Info.iglxFrom = X_CMDLINE; - return 0; - } -+ if (!strcmp(argv[i], "-noautoBindGPU")) { -+ xf86AutoBindGPUDisabled = TRUE; -+ return 1; -+ } - - /* OS-specific processing */ - return xf86ProcessArgument(argc, argv, i); -diff --git a/hw/xfree86/common/xf86Priv.h b/hw/xfree86/common/xf86Priv.h -index 4fe2b5f..6566622 100644 ---- a/hw/xfree86/common/xf86Priv.h -+++ b/hw/xfree86/common/xf86Priv.h -@@ -46,6 +46,7 @@ - extern _X_EXPORT const char *xf86ConfigFile; - extern _X_EXPORT const char *xf86ConfigDir; - extern _X_EXPORT Bool xf86AllowMouseOpenFail; -+extern _X_EXPORT Bool xf86AutoBindGPUDisabled; - - #ifdef XF86VIDMODE - extern _X_EXPORT Bool xf86VidModeDisabled; -diff --git a/hw/xfree86/common/xf86Privstr.h b/hw/xfree86/common/xf86Privstr.h -index 21c2e1f..6c71863 100644 ---- a/hw/xfree86/common/xf86Privstr.h -+++ b/hw/xfree86/common/xf86Privstr.h -@@ -98,6 +98,7 @@ typedef struct { - - Bool autoAddGPU; - const char *debug; -+ Bool autoBindGPU; - } xf86InfoRec, *xf86InfoPtr; - - /* ISC's cc can't handle ~ of UL constants, so explicitly type cast them. */ -diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c -index cef47da..913a324 100644 ---- a/hw/xfree86/common/xf86platformBus.c -+++ b/hw/xfree86/common/xf86platformBus.c -@@ -49,6 +49,7 @@ - #include "Pci.h" - #include "xf86platformBus.h" - #include "xf86Config.h" -+#include "xf86Crtc.h" - - #include "randrstr.h" - int platformSlotClaimed; -@@ -665,6 +666,9 @@ xf86platformAddDevice(int index) - } - /* attach unbound to 0 protocol screen */ - AttachUnboundGPU(xf86Screens[0]->pScreen, xf86GPUScreens[i]->pScreen); -+ if (xf86Info.autoBindGPU) -+ RRProviderAutoConfigGpuScreen(xf86ScrnToScreen(xf86GPUScreens[i]), -+ xf86ScrnToScreen(xf86Screens[0])); - - RRResourcesChanged(xf86Screens[0]->pScreen); - RRTellChanged(xf86Screens[0]->pScreen); -diff --git a/hw/xfree86/man/Xorg.man b/hw/xfree86/man/Xorg.man -index 13a9dc3..745f986 100644 ---- a/hw/xfree86/man/Xorg.man -+++ b/hw/xfree86/man/Xorg.man -@@ -283,6 +283,13 @@ is a comma separated list of directories to search for - server modules. This option is only available when the server is run - as root (i.e, with real-uid 0). - .TP 8 -+.B \-noautoBindGPU -+Disable automatically setting secondary GPUs up as output sinks and offload -+sources. This is equivalent to setting the -+.B AutoBindGPU -+xorg.conf(__filemansuffix__) file option. To -+.B false. -+.TP 8 - .B \-nosilk - Disable Silken Mouse support. - .TP 8 -diff --git a/hw/xfree86/man/xorg.conf.man b/hw/xfree86/man/xorg.conf.man -index 9589262..8d51e06 100644 ---- a/hw/xfree86/man/xorg.conf.man -+++ b/hw/xfree86/man/xorg.conf.man -@@ -672,6 +672,12 @@ Enabled by default. - If this option is disabled, then no GPU devices will be added from the udev - backend. Enabled by default. (May need to be disabled to setup Xinerama). - .TP 7 -+.BI "Option \*qAutoBindGPU\*q \*q" boolean \*q -+If enabled then secondary GPUs will be automatically set up as output-sinks and -+offload-sources. Making e.g. laptop outputs connected only to the secondary -+GPU directly available for use without needing to run -+"xrandr --setprovideroutputsource". Enabled by default. -+.TP 7 - .BI "Option \*qLog\*q \*q" string \*q - This option controls whether the log is flushed and/or synced to disk after - each message. -diff --git a/randr/randrstr.h b/randr/randrstr.h -index f94174b..092d726 100644 ---- a/randr/randrstr.h -+++ b/randr/randrstr.h -@@ -1039,6 +1039,9 @@ RRProviderLookup(XID id, RRProviderPtr *provider_p); - extern _X_EXPORT void - RRDeliverProviderEvent(ClientPtr client, WindowPtr pWin, RRProviderPtr provider); - -+extern _X_EXPORT void -+RRProviderAutoConfigGpuScreen(ScreenPtr pScreen, ScreenPtr masterScreen); -+ - /* rrproviderproperty.c */ - - extern _X_EXPORT void -diff --git a/randr/rrprovider.c b/randr/rrprovider.c -index e4bc2bf..e04c18f 100644 ---- a/randr/rrprovider.c -+++ b/randr/rrprovider.c -@@ -485,3 +485,25 @@ RRDeliverProviderEvent(ClientPtr client, WindowPtr pWin, RRProviderPtr provider) - - WriteEventsToClient(client, 1, (xEvent *) &pe); - } -+ -+void -+RRProviderAutoConfigGpuScreen(ScreenPtr pScreen, ScreenPtr masterScreen) -+{ -+ rrScrPrivPtr pScrPriv = rrGetScrPriv(pScreen); -+ rrScrPrivPtr masterPriv = rrGetScrPriv(masterScreen); -+ RRProviderPtr provider = pScrPriv->provider; -+ RRProviderPtr master_provider = masterPriv->provider; -+ -+ if (!provider || !master_provider) -+ return; -+ -+ if ((provider->capabilities & RR_Capability_SinkOutput) && -+ (master_provider->capabilities & RR_Capability_SourceOutput)) { -+ pScrPriv->rrProviderSetOutputSource(pScreen, provider, master_provider); -+ RRInitPrimeSyncProps(pScreen); -+ } -+ -+ if ((provider->capabilities & RR_Capability_SourceOffload) && -+ (master_provider->capabilities & RR_Capability_SinkOffload)) -+ pScrPriv->rrProviderSetOffloadSink(pScreen, provider, master_provider); -+} --- -2.16.2 - diff --git a/0001-composite-Fix-use-after-free-of-the-COW.patch b/0001-composite-Fix-use-after-free-of-the-COW.patch deleted file mode 100644 index bb21d7e..0000000 --- a/0001-composite-Fix-use-after-free-of-the-COW.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 26ef545b3502f61ca722a7a3373507e88ef64110 Mon Sep 17 00:00:00 2001 -From: Olivier Fourdan -Date: Mon, 13 Mar 2023 11:08:47 +0100 -Subject: [PATCH xserver] composite: Fix use-after-free of the COW - -ZDI-CAN-19866/CVE-2023-1393 - -If a client explicitly destroys the compositor overlay window (aka COW), -we would leave a dangling pointer to that window in the CompScreen -structure, which will trigger a use-after-free later. - -Make sure to clear the CompScreen pointer to the COW when the latter gets -destroyed explicitly by the client. - -This vulnerability was discovered by: -Jan-Niklas Sohn working with Trend Micro Zero Day Initiative - -Signed-off-by: Olivier Fourdan -Reviewed-by: Adam Jackson ---- - composite/compwindow.c | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/composite/compwindow.c b/composite/compwindow.c -index 4e2494b86..b30da589e 100644 ---- a/composite/compwindow.c -+++ b/composite/compwindow.c -@@ -620,6 +620,11 @@ compDestroyWindow(WindowPtr pWin) - ret = (*pScreen->DestroyWindow) (pWin); - cs->DestroyWindow = pScreen->DestroyWindow; - pScreen->DestroyWindow = compDestroyWindow; -+ -+ /* Did we just destroy the overlay window? */ -+ if (pWin == cs->pOverlayWin) -+ cs->pOverlayWin = NULL; -+ - /* compCheckTree (pWin->drawable.pScreen); can't check -- tree isn't good*/ - return ret; - } --- -2.40.0 - diff --git a/0001-dix-Fix-use-after-free-in-input-device-shutdown.patch b/0001-dix-Fix-use-after-free-in-input-device-shutdown.patch deleted file mode 100644 index c2d723f..0000000 --- a/0001-dix-Fix-use-after-free-in-input-device-shutdown.patch +++ /dev/null @@ -1,77 +0,0 @@ -From 1801fe0ac3926882d47d7e1ad6c0518a2cdffd41 Mon Sep 17 00:00:00 2001 -From: Povilas Kanapickas -Date: Sun, 19 Dec 2021 18:11:07 +0200 -Subject: [PATCH] dix: Fix use after free in input device shutdown - -This fixes access to freed heap memory via dev->master. E.g. when -running BarrierNotify.ReceivesNotifyEvents/7 test from -xorg-integration-tests: - -==24736==ERROR: AddressSanitizer: heap-use-after-free on address -0x619000065020 at pc 0x55c450e2b9cf bp 0x7fffc532fd20 sp 0x7fffc532fd10 -READ of size 4 at 0x619000065020 thread T0 - #0 0x55c450e2b9ce in GetMaster ../../../dix/devices.c:2722 - #1 0x55c450e9d035 in IsFloating ../../../dix/events.c:346 - #2 0x55c4513209c6 in GetDeviceUse ../../../Xi/xiquerydevice.c:525 -../../../Xi/xichangehierarchy.c:95 - #4 0x55c450e3455c in RemoveDevice ../../../dix/devices.c:1204 -../../../hw/xfree86/common/xf86Xinput.c:1142 - #6 0x55c450e17b04 in CloseDeviceList ../../../dix/devices.c:1038 - #7 0x55c450e1de85 in CloseDownDevices ../../../dix/devices.c:1068 - #8 0x55c450e837ef in dix_main ../../../dix/main.c:302 - #9 0x55c4517a8d93 in main ../../../dix/stubmain.c:34 -(/lib/x86_64-linux-gnu/libc.so.6+0x28564) - #11 0x55c450d0113d in _start (/usr/lib/xorg/Xorg+0x117713d) - -0x619000065020 is located 160 bytes inside of 912-byte region -[0x619000064f80,0x619000065310) -freed by thread T0 here: -(/usr/lib/x86_64-linux-gnu/libasan.so.5+0x10d7cf) - #1 0x55c450e19f1c in CloseDevice ../../../dix/devices.c:1014 - #2 0x55c450e343a4 in RemoveDevice ../../../dix/devices.c:1186 -../../../hw/xfree86/common/xf86Xinput.c:1142 - #4 0x55c450e17b04 in CloseDeviceList ../../../dix/devices.c:1038 - #5 0x55c450e1de85 in CloseDownDevices ../../../dix/devices.c:1068 - #6 0x55c450e837ef in dix_main ../../../dix/main.c:302 - #7 0x55c4517a8d93 in main ../../../dix/stubmain.c:34 -(/lib/x86_64-linux-gnu/libc.so.6+0x28564) - -previously allocated by thread T0 here: -(/usr/lib/x86_64-linux-gnu/libasan.so.5+0x10ddc6) - #1 0x55c450e1c57b in AddInputDevice ../../../dix/devices.c:259 - #2 0x55c450e34840 in AllocDevicePair ../../../dix/devices.c:2755 - #3 0x55c45130318f in add_master ../../../Xi/xichangehierarchy.c:152 -../../../Xi/xichangehierarchy.c:465 - #5 0x55c4512cb9f5 in ProcIDispatch ../../../Xi/extinit.c:390 - #6 0x55c450e6a92b in Dispatch ../../../dix/dispatch.c:551 - #7 0x55c450e834b7 in dix_main ../../../dix/main.c:272 - #8 0x55c4517a8d93 in main ../../../dix/stubmain.c:34 -(/lib/x86_64-linux-gnu/libc.so.6+0x28564) - -The problem is caused by dev->master being not reset when disabling the -device, which then causes dangling pointer when the master device itself -is being deleted when exiting whole server. - -Note that RecalculateMasterButtons() requires dev->master to be still -valid, so we can reset it only at the end of function. - -Signed-off-by: Povilas Kanapickas ---- - dix/devices.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/dix/devices.c b/dix/devices.c -index e62c34c55..5f9ce1678 100644 ---- a/dix/devices.c -+++ b/dix/devices.c -@@ -520,6 +520,7 @@ DisableDevice(DeviceIntPtr dev, BOOL sendevent) - } - - RecalculateMasterButtons(dev); -+ dev->master = NULL; - - return TRUE; - } --- -2.43.0 - diff --git a/0001-dix-allocate-enough-space-for-logical-button-maps.patch b/0001-dix-allocate-enough-space-for-logical-button-maps.patch deleted file mode 100644 index e11eb0e..0000000 --- a/0001-dix-allocate-enough-space-for-logical-button-maps.patch +++ /dev/null @@ -1,51 +0,0 @@ -From 9e2ecb2af8302dedc49cb6a63ebe063c58a9e7e3 Mon Sep 17 00:00:00 2001 -From: Peter Hutterer -Date: Thu, 14 Dec 2023 11:29:49 +1000 -Subject: [PATCH 1/9] dix: allocate enough space for logical button maps - -Both DeviceFocusEvent and the XIQueryPointer reply contain a bit for -each logical button currently down. Since buttons can be arbitrarily mapped -to anything up to 255 make sure we have enough bits for the maximum mapping. - -CVE-2023-6816, ZDI-CAN-22664, ZDI-CAN-22665 - -This vulnerability was discovered by: -Jan-Niklas Sohn working with Trend Micro Zero Day Initiative ---- - Xi/xiquerypointer.c | 3 +-- - dix/enterleave.c | 5 +++-- - 2 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/Xi/xiquerypointer.c b/Xi/xiquerypointer.c -index 5b77b1a44..2b05ac5f3 100644 ---- a/Xi/xiquerypointer.c -+++ b/Xi/xiquerypointer.c -@@ -149,8 +149,7 @@ ProcXIQueryPointer(ClientPtr client) - if (pDev->button) { - int i; - -- rep.buttons_len = -- bytes_to_int32(bits_to_bytes(pDev->button->numButtons)); -+ rep.buttons_len = bytes_to_int32(bits_to_bytes(256)); /* button map up to 255 */ - rep.length += rep.buttons_len; - buttons = calloc(rep.buttons_len, 4); - if (!buttons) -diff --git a/dix/enterleave.c b/dix/enterleave.c -index 867ec7436..ded8679d7 100644 ---- a/dix/enterleave.c -+++ b/dix/enterleave.c -@@ -784,8 +784,9 @@ DeviceFocusEvent(DeviceIntPtr dev, int type, int mode, int detail, - - mouse = IsFloating(dev) ? dev : GetMaster(dev, MASTER_POINTER); - -- /* XI 2 event */ -- btlen = (mouse->button) ? bits_to_bytes(mouse->button->numButtons) : 0; -+ /* XI 2 event contains the logical button map - maps are CARD8 -+ * so we need 256 bits for the possibly maximum mapping */ -+ btlen = (mouse->button) ? bits_to_bytes(256) : 0; - btlen = bytes_to_int32(btlen); - len = sizeof(xXIFocusInEvent) + btlen * 4; - --- -2.43.0 - diff --git a/0001-dix-fix-valuator-copy-paste-error-in-the-DeviceState.patch b/0001-dix-fix-valuator-copy-paste-error-in-the-DeviceState.patch deleted file mode 100644 index 363af1f..0000000 --- a/0001-dix-fix-valuator-copy-paste-error-in-the-DeviceState.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 133e0d651c5d12bf01999d6289e84e224ba77adc Mon Sep 17 00:00:00 2001 -From: Peter Hutterer -Date: Mon, 22 Jan 2024 14:22:12 +1000 -Subject: [PATCH] dix: fix valuator copy/paste error in the DeviceStateNotify - event - -Fixes 219c54b8a3337456ce5270ded6a67bcde53553d5 ---- - dix/enterleave.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/dix/enterleave.c b/dix/enterleave.c -index 7b7ba1098..c1e6ac600 100644 ---- a/dix/enterleave.c -+++ b/dix/enterleave.c -@@ -619,11 +619,11 @@ FixDeviceValuator(DeviceIntPtr dev, deviceValuator * ev, ValuatorClassPtr v, - ev->first_valuator = first; - switch (ev->num_valuators) { - case 6: -- ev->valuator2 = v->axisVal[first + 5]; -+ ev->valuator5 = v->axisVal[first + 5]; - case 5: -- ev->valuator2 = v->axisVal[first + 4]; -+ ev->valuator4 = v->axisVal[first + 4]; - case 4: -- ev->valuator2 = v->axisVal[first + 3]; -+ ev->valuator3 = v->axisVal[first + 3]; - case 3: - ev->valuator2 = v->axisVal[first + 2]; - case 2: --- -2.44.0 - diff --git a/0001-hw-Rename-boolean-config-value-field-from-bool-to-bo.patch b/0001-hw-Rename-boolean-config-value-field-from-bool-to-bo.patch deleted file mode 100644 index 52ea4d0..0000000 --- a/0001-hw-Rename-boolean-config-value-field-from-bool-to-bo.patch +++ /dev/null @@ -1,154 +0,0 @@ -From 454b3a826edb5fc6d0fea3a9cfd1a5e8fc568747 Mon Sep 17 00:00:00 2001 -From: Adam Jackson -Date: Mon, 22 Jul 2019 13:51:06 -0400 -Subject: [PATCH xserver] hw: Rename boolean config value field from bool to - boolean - -"bool" conflicts with C++ (meh) and stdbool.h (ngh alright fine). This -is a driver-visible change and will likely break the build for mach64, -but it can be fixed by simply using xf86ReturnOptValBool like every -other driver. - -Signed-off-by: Adam Jackson ---- - hw/xfree86/common/xf86Opt.h | 2 +- - hw/xfree86/common/xf86Option.c | 10 +++++----- - hw/xwin/winconfig.c | 22 +++++++++++----------- - hw/xwin/winconfig.h | 2 +- - 4 files changed, 18 insertions(+), 18 deletions(-) - -diff --git a/hw/xfree86/common/xf86Opt.h b/hw/xfree86/common/xf86Opt.h -index 3be2a0fc7..3046fbd41 100644 ---- a/hw/xfree86/common/xf86Opt.h -+++ b/hw/xfree86/common/xf86Opt.h -@@ -41,7 +41,7 @@ typedef union { - unsigned long num; - const char *str; - double realnum; -- Bool bool; -+ Bool boolean; - OptFrequency freq; - } ValueUnion; - -diff --git a/hw/xfree86/common/xf86Option.c b/hw/xfree86/common/xf86Option.c -index 06973bca3..ca538cc57 100644 ---- a/hw/xfree86/common/xf86Option.c -+++ b/hw/xfree86/common/xf86Option.c -@@ -213,7 +213,7 @@ LookupBoolOption(XF86OptionPtr optlist, const char *name, int deflt, - o.name = name; - o.type = OPTV_BOOLEAN; - if (ParseOptionValue(-1, optlist, &o, markUsed)) -- deflt = o.value.bool; -+ deflt = o.value.boolean; - return deflt; - } - -@@ -474,7 +474,7 @@ xf86ShowUnusedOptions(int scrnIndex, XF86OptionPtr opt) - static Bool - GetBoolValue(OptionInfoPtr p, const char *s) - { -- return xf86getBoolValue(&p->value.bool, s); -+ return xf86getBoolValue(&p->value.boolean, s); - } - - static Bool -@@ -678,7 +678,7 @@ ParseOptionValue(int scrnIndex, XF86OptionPtr options, OptionInfoPtr p, - if (markUsed) - xf86MarkOptionUsedByName(options, newn); - if (GetBoolValue(&opt, s)) { -- p->value.bool = !opt.value.bool; -+ p->value.boolean = !opt.value.boolean; - p->found = TRUE; - } - else { -@@ -869,7 +869,7 @@ xf86GetOptValBool(const OptionInfoRec * table, int token, Bool *value) - - p = xf86TokenToOptinfo(table, token); - if (p && p->found) { -- *value = p->value.bool; -+ *value = p->value.boolean; - return TRUE; - } - else -@@ -883,7 +883,7 @@ xf86ReturnOptValBool(const OptionInfoRec * table, int token, Bool def) - - p = xf86TokenToOptinfo(table, token); - if (p && p->found) { -- return p->value.bool; -+ return p->value.boolean; - } - else - return def; -diff --git a/hw/xwin/winconfig.c b/hw/xwin/winconfig.c -index 31894d2fb..646d69006 100644 ---- a/hw/xwin/winconfig.c -+++ b/hw/xwin/winconfig.c -@@ -623,7 +623,7 @@ winSetBoolOption(void *optlist, const char *name, int deflt) - o.name = name; - o.type = OPTV_BOOLEAN; - if (ParseOptionValue(-1, optlist, &o)) -- deflt = o.value.bool; -+ deflt = o.value.boolean; - return deflt; - } - -@@ -918,7 +918,7 @@ ParseOptionValue(int scrnIndex, void *options, OptionInfoPtr p) - } - if ((s = winFindOptionValue(options, newn)) != NULL) { - if (GetBoolValue(&opt, s)) { -- p->value.bool = !opt.value.bool; -+ p->value.boolean = !opt.value.boolean; - p->found = TRUE; - } - else { -@@ -968,25 +968,25 @@ static Bool - GetBoolValue(OptionInfoPtr p, const char *s) - { - if (*s == 0) { -- p->value.bool = TRUE; -+ p->value.boolean = TRUE; - } - else { - if (winNameCompare(s, "1") == 0) -- p->value.bool = TRUE; -+ p->value.boolean = TRUE; - else if (winNameCompare(s, "on") == 0) -- p->value.bool = TRUE; -+ p->value.boolean = TRUE; - else if (winNameCompare(s, "true") == 0) -- p->value.bool = TRUE; -+ p->value.boolean = TRUE; - else if (winNameCompare(s, "yes") == 0) -- p->value.bool = TRUE; -+ p->value.boolean = TRUE; - else if (winNameCompare(s, "0") == 0) -- p->value.bool = FALSE; -+ p->value.boolean = FALSE; - else if (winNameCompare(s, "off") == 0) -- p->value.bool = FALSE; -+ p->value.boolean = FALSE; - else if (winNameCompare(s, "false") == 0) -- p->value.bool = FALSE; -+ p->value.boolean = FALSE; - else if (winNameCompare(s, "no") == 0) -- p->value.bool = FALSE; -+ p->value.boolean = FALSE; - } - return TRUE; - } -diff --git a/hw/xwin/winconfig.h b/hw/xwin/winconfig.h -index f079368c7..bd1f59650 100644 ---- a/hw/xwin/winconfig.h -+++ b/hw/xwin/winconfig.h -@@ -199,7 +199,7 @@ typedef union { - unsigned long num; - char *str; - double realnum; -- Bool bool; -+ Bool boolean; - OptFrequency freq; - } ValueUnion; - --- -2.39.0 - diff --git a/0001-present-Check-for-NULL-to-prevent-crash.patch b/0001-present-Check-for-NULL-to-prevent-crash.patch deleted file mode 100644 index 894ad0e..0000000 --- a/0001-present-Check-for-NULL-to-prevent-crash.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 94b4a3d45451d29e9539ea234ce8b5e9ed58546c Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?B=C5=82a=C5=BCej=20Szczygie=C5=82?= -Date: Thu, 13 Jan 2022 00:47:27 +0100 -Subject: [PATCH xserver] present: Check for NULL to prevent crash -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1275 -Signed-off-by: Błażej Szczygieł -Tested-by: Aaron Plattner -(cherry picked from commit 22d5818851967408bb7c903cb345b7ca8766094c) ---- - present/present_scmd.c | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/present/present_scmd.c b/present/present_scmd.c -index 3c68e690b..11391adbb 100644 ---- a/present/present_scmd.c -+++ b/present/present_scmd.c -@@ -168,6 +168,9 @@ present_scmd_get_crtc(present_screen_priv_ptr screen_priv, WindowPtr window) - if (!screen_priv->info) - return NULL; - -+ if (!screen_priv->info->get_crtc) -+ return NULL; -+ - return (*screen_priv->info->get_crtc)(window); - } - -@@ -206,6 +209,9 @@ present_flush(WindowPtr window) - if (!screen_priv->info) - return; - -+ if (!screen_priv->info->flush) -+ return; -+ - (*screen_priv->info->flush) (window); - } - --- -2.34.1 - diff --git a/0001-present-Send-a-PresentConfigureNotify-event-for-dest.patch b/0001-present-Send-a-PresentConfigureNotify-event-for-dest.patch deleted file mode 100644 index d9eea48..0000000 --- a/0001-present-Send-a-PresentConfigureNotify-event-for-dest.patch +++ /dev/null @@ -1,105 +0,0 @@ -From b98fc07d3442a289c6bef82df50dd0a2d01de71a Mon Sep 17 00:00:00 2001 -From: Adam Jackson -Date: Thu, 2 Feb 2023 12:26:27 -0500 -Subject: [PATCH xserver] present: Send a PresentConfigureNotify event for - destroyed windows -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -This enables fixing a deadlock case on the client side, where the client -ends up blocked waiting for a Present event that will never come because -the window was destroyed. The new PresentWindowDestroyed flag allows the -client to avoid blocking indefinitely. - -Signed-off-by: Adam Jackson -See-also: https://gitlab.freedesktop.org/mesa/mesa/-/issues/116 -See-also: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6685 -Reviewed-by: Michel Dänzer -(cherry picked from commit 462b06033e66a32308d940eb5fc47f5e4c914dc0) ---- - present/present_event.c | 5 +++-- - present/present_priv.h | 7 ++++++- - present/present_screen.c | 11 ++++++++++- - 3 files changed, 19 insertions(+), 4 deletions(-) - -diff --git a/present/present_event.c b/present/present_event.c -index 435b26b70..849732dc8 100644 ---- a/present/present_event.c -+++ b/present/present_event.c -@@ -102,7 +102,8 @@ present_event_swap(xGenericEvent *from, xGenericEvent *to) - } - - void --present_send_config_notify(WindowPtr window, int x, int y, int w, int h, int bw, WindowPtr sibling) -+present_send_config_notify(WindowPtr window, int x, int y, int w, int h, -+ int bw, WindowPtr sibling, CARD32 flags) - { - present_window_priv_ptr window_priv = present_window_priv(window); - -@@ -122,7 +123,7 @@ present_send_config_notify(WindowPtr window, int x, int y, int w, int h, int bw, - .off_y = 0, - .pixmap_width = w, - .pixmap_height = h, -- .pixmap_flags = 0 -+ .pixmap_flags = flags - }; - present_event_ptr event; - -diff --git a/present/present_priv.h b/present/present_priv.h -index 6ebd009a2..4ad729864 100644 ---- a/present/present_priv.h -+++ b/present/present_priv.h -@@ -43,6 +43,11 @@ - #define DebugPresent(x) - #endif - -+/* XXX this belongs in presentproto */ -+#ifndef PresentWindowDestroyed -+#define PresentWindowDestroyed (1 << 0) -+#endif -+ - extern int present_request; - - extern DevPrivateKeyRec present_screen_private_key; -@@ -307,7 +312,7 @@ void - present_free_events(WindowPtr window); - - void --present_send_config_notify(WindowPtr window, int x, int y, int w, int h, int bw, WindowPtr sibling); -+present_send_config_notify(WindowPtr window, int x, int y, int w, int h, int bw, WindowPtr sibling, CARD32 flags); - - void - present_send_complete_notify(WindowPtr window, CARD8 kind, CARD8 mode, CARD32 serial, uint64_t ust, uint64_t msc); -diff --git a/present/present_screen.c b/present/present_screen.c -index 15684eda4..2c29aafd2 100644 ---- a/present/present_screen.c -+++ b/present/present_screen.c -@@ -93,6 +93,15 @@ present_destroy_window(WindowPtr window) - present_screen_priv_ptr screen_priv = present_screen_priv(screen); - present_window_priv_ptr window_priv = present_window_priv(window); - -+ present_send_config_notify(window, -+ window->drawable.x, -+ window->drawable.y, -+ window->drawable.width, -+ window->drawable.height, -+ window->borderWidth, -+ window->nextSib, -+ PresentWindowDestroyed); -+ - if (window_priv) { - present_clear_window_notifies(window); - present_free_events(window); -@@ -123,7 +132,7 @@ present_config_notify(WindowPtr window, - ScreenPtr screen = window->drawable.pScreen; - present_screen_priv_ptr screen_priv = present_screen_priv(screen); - -- present_send_config_notify(window, x, y, w, h, bw, sibling); -+ present_send_config_notify(window, x, y, w, h, bw, sibling, 0); - - unwrap(screen_priv, screen, ConfigNotify); - if (screen->ConfigNotify) --- -2.40.0 - diff --git a/0001-randr-avoid-integer-truncation-in-length-check-of-Pr.patch b/0001-randr-avoid-integer-truncation-in-length-check-of-Pr.patch deleted file mode 100644 index d88a8d5..0000000 --- a/0001-randr-avoid-integer-truncation-in-length-check-of-Pr.patch +++ /dev/null @@ -1,61 +0,0 @@ -From 58e83c683950ac9e253ab05dd7a13a8368b70a3c Mon Sep 17 00:00:00 2001 -From: Peter Hutterer -Date: Mon, 27 Nov 2023 16:27:49 +1000 -Subject: [PATCH xserver] randr: avoid integer truncation in length check of - ProcRRChange*Property - -Affected are ProcRRChangeProviderProperty and ProcRRChangeOutputProperty. -See also xserver@8f454b79 where this same bug was fixed for the core -protocol and XI. - -This fixes an OOB read and the resulting information disclosure. - -Length calculation for the request was clipped to a 32-bit integer. With -the correct stuff->nUnits value the expected request size was -truncated, passing the REQUEST_FIXED_SIZE check. - -The server then proceeded with reading at least stuff->num_items bytes -(depending on stuff->format) from the request and stuffing whatever it -finds into the property. In the process it would also allocate at least -stuff->nUnits bytes, i.e. 4GB. - -CVE-2023-6478, ZDI-CAN-22561 - -This vulnerability was discovered by: -Jan-Niklas Sohn working with Trend Micro Zero Day Initiative - -(cherry picked from commit 14f480010a93ff962fef66a16412fafff81ad632) ---- - randr/rrproperty.c | 2 +- - randr/rrproviderproperty.c | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/randr/rrproperty.c b/randr/rrproperty.c -index 25469f57b2..c4fef8a1f6 100644 ---- a/randr/rrproperty.c -+++ b/randr/rrproperty.c -@@ -530,7 +530,7 @@ ProcRRChangeOutputProperty(ClientPtr client) - char format, mode; - unsigned long len; - int sizeInBytes; -- int totalSize; -+ uint64_t totalSize; - int err; - - REQUEST_AT_LEAST_SIZE(xRRChangeOutputPropertyReq); -diff --git a/randr/rrproviderproperty.c b/randr/rrproviderproperty.c -index b79c17f9bf..90c5a9a933 100644 ---- a/randr/rrproviderproperty.c -+++ b/randr/rrproviderproperty.c -@@ -498,7 +498,7 @@ ProcRRChangeProviderProperty(ClientPtr client) - char format, mode; - unsigned long len; - int sizeInBytes; -- int totalSize; -+ uint64_t totalSize; - int err; - - REQUEST_AT_LEAST_SIZE(xRRChangeProviderPropertyReq); --- -2.43.0 - diff --git a/0001-render-Avoid-possible-double-free-in-ProcRenderAddGl.patch b/0001-render-Avoid-possible-double-free-in-ProcRenderAddGl.patch deleted file mode 100644 index 549f90a..0000000 --- a/0001-render-Avoid-possible-double-free-in-ProcRenderAddGl.patch +++ /dev/null @@ -1,72 +0,0 @@ -From 337d8d48b618d4fc0168a7b978be4c3447650b04 Mon Sep 17 00:00:00 2001 -From: Olivier Fourdan -Date: Fri, 5 Apr 2024 15:24:49 +0200 -Subject: [PATCH] render: Avoid possible double-free in ProcRenderAddGlyphs() - -ProcRenderAddGlyphs() adds the glyph to the glyphset using AddGlyph() and -then frees it using FreeGlyph() to decrease the reference count, after -AddGlyph() has increased it. - -AddGlyph() however may chose to reuse an existing glyph if it's already -in the glyphSet, and free the glyph that was given, in which case the -caller function, ProcRenderAddGlyphs() will call FreeGlyph() on an -already freed glyph, as reported by ASan: - - READ of size 4 thread T0 - #0 in FreeGlyph xserver/render/glyph.c:252 - #1 in ProcRenderAddGlyphs xserver/render/render.c:1174 - #2 in Dispatch xserver/dix/dispatch.c:546 - #3 in dix_main xserver/dix/main.c:271 - #4 in main xserver/dix/stubmain.c:34 - #5 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58 - #6 in __libc_start_main_impl ../csu/libc-start.c:360 - #7 (/usr/bin/Xwayland+0x44fe4) - Address is located 0 bytes inside of 64-byte region - freed by thread T0 here: - #0 in __interceptor_free libsanitizer/asan/asan_malloc_linux.cpp:52 - #1 in _dixFreeObjectWithPrivates xserver/dix/privates.c:538 - #2 in AddGlyph xserver/render/glyph.c:295 - #3 in ProcRenderAddGlyphs xserver/render/render.c:1173 - #4 in Dispatch xserver/dix/dispatch.c:546 - #5 in dix_main xserver/dix/main.c:271 - #6 in main xserver/dix/stubmain.c:34 - #7 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58 - previously allocated by thread T0 here: - #0 in __interceptor_malloc libsanitizer/asan/asan_malloc_linux.cpp:69 - #1 in AllocateGlyph xserver/render/glyph.c:355 - #2 in ProcRenderAddGlyphs xserver/render/render.c:1085 - #3 in Dispatch xserver/dix/dispatch.c:546 - #4 in dix_main xserver/dix/main.c:271 - #5 in main xserver/dix/stubmain.c:34 - #6 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58 - SUMMARY: AddressSanitizer: heap-use-after-free xserver/render/glyph.c:252 in FreeGlyph - -To avoid that, make sure not to free the given glyph in AddGlyph(). - -v2: Simplify the test using the boolean returned from AddGlyph() (Michel) -v3: Simplify even more by not freeing the glyph in AddGlyph() (Peter) - -Fixes: bdca6c3d1 - render: fix refcounting of glyphs during ProcRenderAddGlyphs -Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1659 -Signed-off-by: Olivier Fourdan -Part-of: ---- - render/glyph.c | 2 -- - 1 file changed, 2 deletions(-) - -diff --git a/render/glyph.c b/render/glyph.c -index 13991f8a1..5fa7f3b5b 100644 ---- a/render/glyph.c -+++ b/render/glyph.c -@@ -291,8 +291,6 @@ AddGlyph(GlyphSetPtr glyphSet, GlyphPtr glyph, Glyph id) - gr = FindGlyphRef(&globalGlyphs[glyphSet->fdepth], signature, - TRUE, glyph->sha1); - if (gr->glyph && gr->glyph != DeletedGlyph && gr->glyph != glyph) { -- FreeGlyphPicture(glyph); -- dixFreeObjectWithPrivates(glyph, PRIVATE_GLYPH); - glyph = gr->glyph; - } - else if (gr->glyph != glyph) { --- -2.44.0 - diff --git a/0001-render-Fix-build-with-gcc-12.patch b/0001-render-Fix-build-with-gcc-12.patch deleted file mode 100644 index 22f2e5a..0000000 --- a/0001-render-Fix-build-with-gcc-12.patch +++ /dev/null @@ -1,90 +0,0 @@ -From 53173fdab492f0f638f6616fcf01af0b9ea6338d Mon Sep 17 00:00:00 2001 -From: Olivier Fourdan -Date: Thu, 20 Jan 2022 10:20:38 +0100 -Subject: [PATCH xserver] render: Fix build with gcc 12 -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -The xserver fails to compile with the latest gcc 12: - - render/picture.c: In function ‘CreateSolidPicture’: - render/picture.c:874:26: error: array subscript ‘union _SourcePict[0]’ is partly outside array bounds of ‘unsigned char[16]’ [-Werror=array-bounds] - 874 | pPicture->pSourcePict->type = SourcePictTypeSolidFill; - | ^~ - render/picture.c:868:45: note: object of size 16 allocated by ‘malloc’ - 868 | pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(PictSolidFill)); - | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - render/picture.c: In function ‘CreateLinearGradientPicture’: - render/picture.c:906:26: error: array subscript ‘union _SourcePict[0]’ is partly outside array bounds of ‘unsigned char[32]’ [-Werror=array-bounds] - 906 | pPicture->pSourcePict->linear.type = SourcePictTypeLinear; - | ^~ - render/picture.c:899:45: note: object of size 32 allocated by ‘malloc’ - 899 | pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(PictLinearGradient)); - | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - render/picture.c: In function ‘CreateConicalGradientPicture’: - render/picture.c:989:26: error: array subscript ‘union _SourcePict[0]’ is partly outside array bounds of ‘unsigned char[32]’ [-Werror=array-bounds] - 989 | pPicture->pSourcePict->conical.type = SourcePictTypeConical; - | ^~ - render/picture.c:982:45: note: object of size 32 allocated by ‘malloc’ - 982 | pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(PictConicalGradient)); - | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - cc1: some warnings being treated as errors - ninja: build stopped: subcommand failed. - -This is because gcc 12 has become stricter and raises a warning now. - -Fix the warning/error by allocating enough memory to store the union -struct. - -Signed-off-by: Olivier Fourdan -Acked-by: Michel Dänzer -Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1256 -(cherry picked from commit c6b0dcb82d4db07a2f32c09a8c09c85a5f57248e) ---- - render/picture.c | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/render/picture.c b/render/picture.c -index afa0d258f..2be4b1954 100644 ---- a/render/picture.c -+++ b/render/picture.c -@@ -865,7 +865,7 @@ CreateSolidPicture(Picture pid, xRenderColor * color, int *error) - } - - pPicture->id = pid; -- pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(PictSolidFill)); -+ pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(SourcePict)); - if (!pPicture->pSourcePict) { - *error = BadAlloc; - free(pPicture); -@@ -896,7 +896,7 @@ CreateLinearGradientPicture(Picture pid, xPointFixed * p1, xPointFixed * p2, - } - - pPicture->id = pid; -- pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(PictLinearGradient)); -+ pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(SourcePict)); - if (!pPicture->pSourcePict) { - *error = BadAlloc; - free(pPicture); -@@ -936,7 +936,7 @@ CreateRadialGradientPicture(Picture pid, xPointFixed * inner, - } - - pPicture->id = pid; -- pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(PictRadialGradient)); -+ pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(SourcePict)); - if (!pPicture->pSourcePict) { - *error = BadAlloc; - free(pPicture); -@@ -979,7 +979,7 @@ CreateConicalGradientPicture(Picture pid, xPointFixed * center, xFixed angle, - } - - pPicture->id = pid; -- pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(PictConicalGradient)); -+ pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(SourcePict)); - if (!pPicture->pSourcePict) { - *error = BadAlloc; - free(pPicture); --- -2.34.1 - diff --git a/0001-xf86-Accept-devices-with-the-simpledrm-driver.patch b/0001-xf86-Accept-devices-with-the-simpledrm-driver.patch deleted file mode 100644 index 3dc5796..0000000 --- a/0001-xf86-Accept-devices-with-the-simpledrm-driver.patch +++ /dev/null @@ -1,34 +0,0 @@ -From b9218fadf3c09d83566549279d68886d8258f79c Mon Sep 17 00:00:00 2001 -From: nerdopolis -Date: Thu, 30 Sep 2021 08:51:18 -0400 -Subject: [PATCH] xf86: Accept devices with the 'simpledrm' driver. - -SimpleDRM 'devices' are a fallback device, and do not have a busid -so they are getting skipped. This will allow simpledrm to work -with the modesetting driver ---- - hw/xfree86/common/xf86platformBus.c | 7 ++++++- - 1 file changed, 6 insertions(+), 1 deletion(-) - -diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c -index 0e0a995ac..45028f7a6 100644 ---- a/hw/xfree86/common/xf86platformBus.c -+++ b/hw/xfree86/common/xf86platformBus.c -@@ -557,8 +557,13 @@ xf86platformProbeDev(DriverPtr drvp) - } - else { - /* for non-seat0 servers assume first device is the master */ -- if (ServerIsNotSeat0()) -+ if (ServerIsNotSeat0()) { - break; -+ } else { -+ /* Accept the device if the driver is simpledrm */ -+ if (strcmp(xf86_platform_devices[j].attribs->driver, "simpledrm") == 0) -+ break; -+ } - - if (xf86IsPrimaryPlatform(&xf86_platform_devices[j])) - break; --- -2.35.1 - diff --git a/0001-xkb-fix-some-possible-memleaks-in-XkbGetKbdByName.patch b/0001-xkb-fix-some-possible-memleaks-in-XkbGetKbdByName.patch deleted file mode 100644 index 6e5ebb5..0000000 --- a/0001-xkb-fix-some-possible-memleaks-in-XkbGetKbdByName.patch +++ /dev/null @@ -1,59 +0,0 @@ -From 18f91b950e22c2a342a4fbc55e9ddf7534a707d2 Mon Sep 17 00:00:00 2001 -From: Peter Hutterer -Date: Wed, 13 Jul 2022 11:23:09 +1000 -Subject: [PATCH xserver] xkb: fix some possible memleaks in XkbGetKbdByName - -GetComponentByName returns an allocated string, so let's free that if we -fail somewhere. - -Signed-off-by: Peter Hutterer ---- - xkb/xkb.c | 26 ++++++++++++++++++++------ - 1 file changed, 20 insertions(+), 6 deletions(-) - -diff --git a/xkb/xkb.c b/xkb/xkb.c -index 4692895db..b79a269e3 100644 ---- a/xkb/xkb.c -+++ b/xkb/xkb.c -@@ -5935,18 +5935,32 @@ ProcXkbGetKbdByName(ClientPtr client) - xkb = dev->key->xkbInfo->desc; - status = Success; - str = (unsigned char *) &stuff[1]; -- if (GetComponentSpec(&str, TRUE, &status)) /* keymap, unsupported */ -- return BadMatch; -+ { -+ char *keymap = GetComponentSpec(&str, TRUE, &status); /* keymap, unsupported */ -+ if (keymap) { -+ free(keymap); -+ return BadMatch; -+ } -+ } - names.keycodes = GetComponentSpec(&str, TRUE, &status); - names.types = GetComponentSpec(&str, TRUE, &status); - names.compat = GetComponentSpec(&str, TRUE, &status); - names.symbols = GetComponentSpec(&str, TRUE, &status); - names.geometry = GetComponentSpec(&str, TRUE, &status); -- if (status != Success) -+ if (status == Success) { -+ len = str - ((unsigned char *) stuff); -+ if ((XkbPaddedSize(len) / 4) != stuff->length) -+ status = BadLength; -+ } -+ -+ if (status != Success) { -+ free(names.keycodes); -+ free(names.types); -+ free(names.compat); -+ free(names.symbols); -+ free(names.geometry); - return status; -- len = str - ((unsigned char *) stuff); -- if ((XkbPaddedSize(len) / 4) != stuff->length) -- return BadLength; -+ } - - CHK_MASK_LEGAL(0x01, stuff->want, XkbGBN_AllComponentsMask); - CHK_MASK_LEGAL(0x02, stuff->need, XkbGBN_AllComponentsMask); --- -2.38.1 - diff --git a/0001-xkb-proof-GetCountedString-against-request-length-at.patch b/0001-xkb-proof-GetCountedString-against-request-length-at.patch deleted file mode 100644 index d358a32..0000000 --- a/0001-xkb-proof-GetCountedString-against-request-length-at.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 11beef0b7f1ed290348e45618e5fa0d2bffcb72e Mon Sep 17 00:00:00 2001 -From: Peter Hutterer -Date: Tue, 5 Jul 2022 12:06:20 +1000 -Subject: [PATCH xserver] xkb: proof GetCountedString against request length - attacks - -GetCountedString did a check for the whole string to be within the -request buffer but not for the initial 2 bytes that contain the length -field. A swapped client could send a malformed request to trigger a -swaps() on those bytes, writing into random memory. - -Signed-off-by: Peter Hutterer ---- - xkb/xkb.c | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/xkb/xkb.c b/xkb/xkb.c -index f42f59ef3..1841cff26 100644 ---- a/xkb/xkb.c -+++ b/xkb/xkb.c -@@ -5137,6 +5137,11 @@ _GetCountedString(char **wire_inout, ClientPtr client, char **str) - CARD16 len; - - wire = *wire_inout; -+ -+ if (client->req_len < -+ bytes_to_int32(wire + 2 - (char *) client->requestBuffer)) -+ return BadValue; -+ - len = *(CARD16 *) wire; - if (client->swapped) { - swaps(&len); --- -2.38.1 - diff --git a/0001-xkb-switch-to-array-index-loops-to-moving-pointers.patch b/0001-xkb-switch-to-array-index-loops-to-moving-pointers.patch deleted file mode 100644 index a4efb7a..0000000 --- a/0001-xkb-switch-to-array-index-loops-to-moving-pointers.patch +++ /dev/null @@ -1,76 +0,0 @@ -From f1070c01d616c5f21f939d5ebc533738779451ac Mon Sep 17 00:00:00 2001 -From: Peter Hutterer -Date: Tue, 5 Jul 2022 12:40:47 +1000 -Subject: [PATCH xserver 1/3] xkb: switch to array index loops to moving - pointers - -Most similar loops here use a pointer that advances with each loop -iteration, let's do the same here for consistency. - -No functional changes. - -Signed-off-by: Peter Hutterer -Reviewed-by: Olivier Fourdan ---- - xkb/xkb.c | 20 ++++++++++---------- - 1 file changed, 10 insertions(+), 10 deletions(-) - -diff --git a/xkb/xkb.c b/xkb/xkb.c -index a29262c24..64e52611e 100644 ---- a/xkb/xkb.c -+++ b/xkb/xkb.c -@@ -5368,16 +5368,16 @@ _CheckSetSections(XkbGeometryPtr geom, - row->left = rWire->left; - row->vertical = rWire->vertical; - kWire = (xkbKeyWireDesc *) &rWire[1]; -- for (k = 0; k < rWire->nKeys; k++) { -+ for (k = 0; k < rWire->nKeys; k++, kWire++) { - XkbKeyPtr key; - - key = XkbAddGeomKey(row); - if (!key) - return BadAlloc; -- memcpy(key->name.name, kWire[k].name, XkbKeyNameLength); -- key->gap = kWire[k].gap; -- key->shape_ndx = kWire[k].shapeNdx; -- key->color_ndx = kWire[k].colorNdx; -+ memcpy(key->name.name, kWire->name, XkbKeyNameLength); -+ key->gap = kWire->gap; -+ key->shape_ndx = kWire->shapeNdx; -+ key->color_ndx = kWire->colorNdx; - if (key->shape_ndx >= geom->num_shapes) { - client->errorValue = _XkbErrCode3(0x10, key->shape_ndx, - geom->num_shapes); -@@ -5389,7 +5389,7 @@ _CheckSetSections(XkbGeometryPtr geom, - return BadMatch; - } - } -- rWire = (xkbRowWireDesc *) &kWire[rWire->nKeys]; -+ rWire = (xkbRowWireDesc *)kWire; - } - wire = (char *) rWire; - if (sWire->nDoodads > 0) { -@@ -5454,16 +5454,16 @@ _CheckSetShapes(XkbGeometryPtr geom, - return BadAlloc; - ol->corner_radius = olWire->cornerRadius; - ptWire = (xkbPointWireDesc *) &olWire[1]; -- for (p = 0, pt = ol->points; p < olWire->nPoints; p++, pt++) { -- pt->x = ptWire[p].x; -- pt->y = ptWire[p].y; -+ for (p = 0, pt = ol->points; p < olWire->nPoints; p++, pt++, ptWire++) { -+ pt->x = ptWire->x; -+ pt->y = ptWire->y; - if (client->swapped) { - swaps(&pt->x); - swaps(&pt->y); - } - } - ol->num_points = olWire->nPoints; -- olWire = (xkbOutlineWireDesc *) (&ptWire[olWire->nPoints]); -+ olWire = (xkbOutlineWireDesc *)ptWire; - } - if (shapeWire->primaryNdx != XkbNoShape) - shape->primary = &shape->outlines[shapeWire->primaryNdx]; --- -2.36.1 - diff --git a/0002-Xi-ProcXIPassiveGrabDevice-needs-to-use-unswapped-le.patch b/0002-Xi-ProcXIPassiveGrabDevice-needs-to-use-unswapped-le.patch deleted file mode 100644 index 4e061f7..0000000 --- a/0002-Xi-ProcXIPassiveGrabDevice-needs-to-use-unswapped-le.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 3e77295f888c67fc7645db5d0c00926a29ffecee Mon Sep 17 00:00:00 2001 -From: Alan Coopersmith -Date: Fri, 22 Mar 2024 18:56:27 -0700 -Subject: [PATCH 2/4] Xi: ProcXIPassiveGrabDevice needs to use unswapped length - to send reply - -CVE-2024-31081 - -Fixes: d220d6907 ("Xi: add GrabButton and GrabKeysym code.") -Signed-off-by: Alan Coopersmith -Part-of: ---- - Xi/xipassivegrab.c | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/Xi/xipassivegrab.c b/Xi/xipassivegrab.c -index c9ac2f855..896233bec 100644 ---- a/Xi/xipassivegrab.c -+++ b/Xi/xipassivegrab.c -@@ -93,6 +93,7 @@ ProcXIPassiveGrabDevice(ClientPtr client) - GrabParameters param; - void *tmp; - int mask_len; -+ uint32_t length; - - REQUEST(xXIPassiveGrabDeviceReq); - REQUEST_FIXED_SIZE(xXIPassiveGrabDeviceReq, -@@ -247,9 +248,11 @@ ProcXIPassiveGrabDevice(ClientPtr client) - } - } - -+ /* save the value before SRepXIPassiveGrabDevice swaps it */ -+ length = rep.length; - WriteReplyToClient(client, sizeof(rep), &rep); - if (rep.num_modifiers) -- WriteToClient(client, rep.length * 4, modifiers_failed); -+ WriteToClient(client, length * 4, modifiers_failed); - - out: - free(modifiers_failed); --- -2.44.0 - diff --git a/0002-Xi-return-an-error-from-XI-property-changes-if-verif.patch b/0002-Xi-return-an-error-from-XI-property-changes-if-verif.patch deleted file mode 100644 index 72bcadb..0000000 --- a/0002-Xi-return-an-error-from-XI-property-changes-if-verif.patch +++ /dev/null @@ -1,41 +0,0 @@ -From c5ff57676698f19ed3a1402aef58a15552e32d27 Mon Sep 17 00:00:00 2001 -From: Peter Hutterer -Date: Tue, 29 Nov 2022 13:24:00 +1000 -Subject: [PATCH xserver 2/7] Xi: return an error from XI property changes if - verification failed - -Both ProcXChangeDeviceProperty and ProcXIChangeProperty checked the -property for validity but didn't actually return the potential error. - -Signed-off-by: Peter Hutterer -Acked-by: Olivier Fourdan ---- - Xi/xiproperty.c | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/Xi/xiproperty.c b/Xi/xiproperty.c -index a36f7d61df..68c362c628 100644 ---- a/Xi/xiproperty.c -+++ b/Xi/xiproperty.c -@@ -902,6 +902,8 @@ ProcXChangeDeviceProperty(ClientPtr client) - - rc = check_change_property(client, stuff->property, stuff->type, - stuff->format, stuff->mode, stuff->nUnits); -+ if (rc != Success) -+ return rc; - - len = stuff->nUnits; - if (len > (bytes_to_int32(0xffffffff - sizeof(xChangeDevicePropertyReq)))) -@@ -1141,6 +1143,9 @@ ProcXIChangeProperty(ClientPtr client) - - rc = check_change_property(client, stuff->property, stuff->type, - stuff->format, stuff->mode, stuff->num_items); -+ if (rc != Success) -+ return rc; -+ - len = stuff->num_items; - if (len > bytes_to_int32(0xffffffff - sizeof(xXIChangePropertyReq))) - return BadLength; --- -2.38.1 - diff --git a/0002-dix-Allocate-sufficient-xEvents-for-our-DeviceStateN.patch b/0002-dix-Allocate-sufficient-xEvents-for-our-DeviceStateN.patch deleted file mode 100644 index 21c5622..0000000 --- a/0002-dix-Allocate-sufficient-xEvents-for-our-DeviceStateN.patch +++ /dev/null @@ -1,84 +0,0 @@ -From ece23be888a93b741aa1209d1dbf64636109d6a5 Mon Sep 17 00:00:00 2001 -From: Peter Hutterer -Date: Mon, 18 Dec 2023 14:27:50 +1000 -Subject: [PATCH 2/9] dix: Allocate sufficient xEvents for our - DeviceStateNotify - -If a device has both a button class and a key class and numButtons is -zero, we can get an OOB write due to event under-allocation. - -This function seems to assume a device has either keys or buttons, not -both. It has two virtually identical code paths, both of which assume -they're applying to the first event in the sequence. - -A device with both a key and button class triggered a logic bug - only -one xEvent was allocated but the deviceStateNotify pointer was pushed on -once per type. So effectively this logic code: - - int count = 1; - if (button && nbuttons > 32) count++; - if (key && nbuttons > 0) count++; - if (key && nkeys > 32) count++; // this is basically always true - // count is at 2 for our keys + zero button device - - ev = alloc(count * sizeof(xEvent)); - FixDeviceStateNotify(ev); - if (button) - FixDeviceStateNotify(ev++); - if (key) - FixDeviceStateNotify(ev++); // santa drops into the wrong chimney here - -If the device has more than 3 valuators, the OOB is pushed back - we're -off by one so it will happen when the last deviceValuator event is -written instead. - -Fix this by allocating the maximum number of events we may allocate. -Note that the current behavior is not protocol-correct anyway, this -patch fixes only the allocation issue. - -Note that this issue does not trigger if the device has at least one -button. While the server does not prevent a button class with zero -buttons, it is very unlikely. - -CVE-2024-0229, ZDI-CAN-22678 - -This vulnerability was discovered by: -Jan-Niklas Sohn working with Trend Micro Zero Day Initiative ---- - dix/enterleave.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/dix/enterleave.c b/dix/enterleave.c -index ded8679d7..17964b00a 100644 ---- a/dix/enterleave.c -+++ b/dix/enterleave.c -@@ -675,7 +675,8 @@ static void - DeliverStateNotifyEvent(DeviceIntPtr dev, WindowPtr win) - { - int evcount = 1; -- deviceStateNotify *ev, *sev; -+ deviceStateNotify sev[6 + (MAX_VALUATORS + 2)/3]; -+ deviceStateNotify *ev; - deviceKeyStateNotify *kev; - deviceButtonStateNotify *bev; - -@@ -714,7 +715,7 @@ DeliverStateNotifyEvent(DeviceIntPtr dev, WindowPtr win) - } - } - -- sev = ev = xallocarray(evcount, sizeof(xEvent)); -+ ev = sev; - FixDeviceStateNotify(dev, ev, NULL, NULL, NULL, first); - - if (b != NULL) { -@@ -770,7 +771,6 @@ DeliverStateNotifyEvent(DeviceIntPtr dev, WindowPtr win) - - DeliverEventsToWindow(dev, win, (xEvent *) sev, evcount, - DeviceStateNotifyMask, NullGrab); -- free(sev); - } - - void --- -2.43.0 - diff --git a/0002-mi-reset-the-PointerWindows-reference-on-screen-swit.patch b/0002-mi-reset-the-PointerWindows-reference-on-screen-swit.patch deleted file mode 100644 index cbe9804..0000000 --- a/0002-mi-reset-the-PointerWindows-reference-on-screen-swit.patch +++ /dev/null @@ -1,99 +0,0 @@ -From 004f461c440cb6611eefb48fbbb4fa53a6d49f80 Mon Sep 17 00:00:00 2001 -From: Peter Hutterer -Date: Thu, 5 Oct 2023 12:19:45 +1000 -Subject: [PATCH xserver 2/4] mi: reset the PointerWindows reference on screen - switch - -PointerWindows[] keeps a reference to the last window our sprite -entered - changes are usually handled by CheckMotion(). - -If we switch between screens via XWarpPointer our -dev->spriteInfo->sprite->win is set to the new screen's root window. -If there's another window at the cursor location CheckMotion() will -trigger the right enter/leave events later. If there is not, it skips -that process and we never trigger LeaveWindow() - PointerWindows[] for -the device still refers to the previous window. - -If that window is destroyed we have a dangling reference that will -eventually cause a use-after-free bug when checking the window hierarchy -later. - -To trigger this, we require: -- two protocol screens -- XWarpPointer to the other screen's root window -- XDestroyWindow before entering any other window - -This is a niche bug so we hack around it by making sure we reset the -PointerWindows[] entry so we cannot have a dangling pointer. This -doesn't handle Enter/Leave events correctly but the previous code didn't -either. - -CVE-2023-5380, ZDI-CAN-21608 - -This vulnerability was discovered by: -Sri working with Trend Micro Zero Day Initiative - -Signed-off-by: Peter Hutterer -Reviewed-by: Adam Jackson ---- - dix/enterleave.h | 2 -- - include/eventstr.h | 3 +++ - mi/mipointer.c | 17 +++++++++++++++-- - 3 files changed, 18 insertions(+), 4 deletions(-) - -diff --git a/dix/enterleave.h b/dix/enterleave.h -index 4b833d8a3b..e8af924c68 100644 ---- a/dix/enterleave.h -+++ b/dix/enterleave.h -@@ -58,8 +58,6 @@ extern void DeviceFocusEvent(DeviceIntPtr dev, - - extern void EnterWindow(DeviceIntPtr dev, WindowPtr win, int mode); - --extern void LeaveWindow(DeviceIntPtr dev); -- - extern void CoreFocusEvent(DeviceIntPtr kbd, - int type, int mode, int detail, WindowPtr pWin); - -diff --git a/include/eventstr.h b/include/eventstr.h -index bf3b95fe4a..2bae3b0767 100644 ---- a/include/eventstr.h -+++ b/include/eventstr.h -@@ -296,4 +296,7 @@ union _InternalEvent { - #endif - }; - -+extern void -+LeaveWindow(DeviceIntPtr dev); -+ - #endif -diff --git a/mi/mipointer.c b/mi/mipointer.c -index 75be1aeeb8..b12ae9be1d 100644 ---- a/mi/mipointer.c -+++ b/mi/mipointer.c -@@ -397,8 +397,21 @@ miPointerWarpCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y) - #ifdef PANORAMIX - && noPanoramiXExtension - #endif -- ) -- UpdateSpriteForScreen(pDev, pScreen); -+ ) { -+ DeviceIntPtr master = GetMaster(pDev, MASTER_POINTER); -+ /* Hack for CVE-2023-5380: if we're moving -+ * screens PointerWindows[] keeps referring to the -+ * old window. If that gets destroyed we have a UAF -+ * bug later. Only happens when jumping from a window -+ * to the root window on the other screen. -+ * Enter/Leave events are incorrect for that case but -+ * too niche to fix. -+ */ -+ LeaveWindow(pDev); -+ if (master) -+ LeaveWindow(master); -+ UpdateSpriteForScreen(pDev, pScreen); -+ } - } - - /** --- -2.41.0 - diff --git a/0002-xkb-swap-XkbSetDeviceInfo-and-XkbSetDeviceInfoCheck.patch b/0002-xkb-swap-XkbSetDeviceInfo-and-XkbSetDeviceInfoCheck.patch deleted file mode 100644 index 8973a0e..0000000 --- a/0002-xkb-swap-XkbSetDeviceInfo-and-XkbSetDeviceInfoCheck.patch +++ /dev/null @@ -1,179 +0,0 @@ -From dd8caf39e9e15d8f302e54045dd08d8ebf1025dc Mon Sep 17 00:00:00 2001 -From: Peter Hutterer -Date: Tue, 5 Jul 2022 09:50:41 +1000 -Subject: [PATCH xserver 2/3] xkb: swap XkbSetDeviceInfo and - XkbSetDeviceInfoCheck - -XKB often uses a FooCheck and Foo function pair, the former is supposed -to check all values in the request and error out on BadLength, -BadValue, etc. The latter is then called once we're confident the values -are good (they may still fail on an individual device, but that's a -different topic). - -In the case of XkbSetDeviceInfo, those functions were incorrectly -named, with XkbSetDeviceInfo ending up as the checker function and -XkbSetDeviceInfoCheck as the setter function. As a result, the setter -function was called before the checker function, accessing request -data and modifying device state before we ensured that the data is -valid. - -In particular, the setter function relied on values being already -byte-swapped. This in turn could lead to potential OOB memory access. - -Fix this by correctly naming the functions and moving the length checks -over to the checker function. These were added in 87c64fc5b0 to the -wrong function, probably due to the incorrect naming. - -Fixes ZDI-CAN 16070, CVE-2022-2320. - -This vulnerability was discovered by: -Jan-Niklas Sohn working with Trend Micro Zero Day Initiative - -Introduced in c06e27b2f6fd9f7b9f827623a48876a225264132 - -Signed-off-by: Peter Hutterer ---- - xkb/xkb.c | 46 +++++++++++++++++++++++++--------------------- - 1 file changed, 25 insertions(+), 21 deletions(-) - -diff --git a/xkb/xkb.c b/xkb/xkb.c -index 64e52611e..34b2c290b 100644 ---- a/xkb/xkb.c -+++ b/xkb/xkb.c -@@ -6550,7 +6550,8 @@ ProcXkbGetDeviceInfo(ClientPtr client) - static char * - CheckSetDeviceIndicators(char *wire, - DeviceIntPtr dev, -- int num, int *status_rtrn, ClientPtr client) -+ int num, int *status_rtrn, ClientPtr client, -+ xkbSetDeviceInfoReq * stuff) - { - xkbDeviceLedsWireDesc *ledWire; - int i; -@@ -6558,6 +6559,11 @@ CheckSetDeviceIndicators(char *wire, - - ledWire = (xkbDeviceLedsWireDesc *) wire; - for (i = 0; i < num; i++) { -+ if (!_XkbCheckRequestBounds(client, stuff, ledWire, ledWire + 1)) { -+ *status_rtrn = BadLength; -+ return (char *) ledWire; -+ } -+ - if (client->swapped) { - swaps(&ledWire->ledClass); - swaps(&ledWire->ledID); -@@ -6585,6 +6591,11 @@ CheckSetDeviceIndicators(char *wire, - atomWire = (CARD32 *) &ledWire[1]; - if (nNames > 0) { - for (n = 0; n < nNames; n++) { -+ if (!_XkbCheckRequestBounds(client, stuff, atomWire, atomWire + 1)) { -+ *status_rtrn = BadLength; -+ return (char *) atomWire; -+ } -+ - if (client->swapped) { - swapl(atomWire); - } -@@ -6596,6 +6607,10 @@ CheckSetDeviceIndicators(char *wire, - mapWire = (xkbIndicatorMapWireDesc *) atomWire; - if (nMaps > 0) { - for (n = 0; n < nMaps; n++) { -+ if (!_XkbCheckRequestBounds(client, stuff, mapWire, mapWire + 1)) { -+ *status_rtrn = BadLength; -+ return (char *) mapWire; -+ } - if (client->swapped) { - swaps(&mapWire->virtualMods); - swapl(&mapWire->ctrls); -@@ -6647,11 +6662,6 @@ SetDeviceIndicators(char *wire, - xkbIndicatorMapWireDesc *mapWire; - XkbSrvLedInfoPtr sli; - -- if (!_XkbCheckRequestBounds(client, stuff, ledWire, ledWire + 1)) { -- *status_rtrn = BadLength; -- return (char *) ledWire; -- } -- - namec = mapc = statec = 0; - sli = XkbFindSrvLedInfo(dev, ledWire->ledClass, ledWire->ledID, - XkbXI_IndicatorMapsMask); -@@ -6670,10 +6680,6 @@ SetDeviceIndicators(char *wire, - memset((char *) sli->names, 0, XkbNumIndicators * sizeof(Atom)); - for (n = 0, bit = 1; n < XkbNumIndicators; n++, bit <<= 1) { - if (ledWire->namesPresent & bit) { -- if (!_XkbCheckRequestBounds(client, stuff, atomWire, atomWire + 1)) { -- *status_rtrn = BadLength; -- return (char *) atomWire; -- } - sli->names[n] = (Atom) *atomWire; - if (sli->names[n] == None) - ledWire->namesPresent &= ~bit; -@@ -6691,10 +6697,6 @@ SetDeviceIndicators(char *wire, - if (ledWire->mapsPresent) { - for (n = 0, bit = 1; n < XkbNumIndicators; n++, bit <<= 1) { - if (ledWire->mapsPresent & bit) { -- if (!_XkbCheckRequestBounds(client, stuff, mapWire, mapWire + 1)) { -- *status_rtrn = BadLength; -- return (char *) mapWire; -- } - sli->maps[n].flags = mapWire->flags; - sli->maps[n].which_groups = mapWire->whichGroups; - sli->maps[n].groups = mapWire->groups; -@@ -6730,13 +6732,17 @@ SetDeviceIndicators(char *wire, - } - - static int --_XkbSetDeviceInfo(ClientPtr client, DeviceIntPtr dev, -+_XkbSetDeviceInfoCheck(ClientPtr client, DeviceIntPtr dev, - xkbSetDeviceInfoReq * stuff) - { - char *wire; - - wire = (char *) &stuff[1]; - if (stuff->change & XkbXI_ButtonActionsMask) { -+ int sz = stuff->nBtns * SIZEOF(xkbActionWireDesc); -+ if (!_XkbCheckRequestBounds(client, stuff, wire, (char *) wire + sz)) -+ return BadLength; -+ - if (!dev->button) { - client->errorValue = _XkbErrCode2(XkbErr_BadClass, ButtonClass); - return XkbKeyboardErrorCode; -@@ -6747,13 +6753,13 @@ _XkbSetDeviceInfo(ClientPtr client, DeviceIntPtr dev, - dev->button->numButtons); - return BadMatch; - } -- wire += (stuff->nBtns * SIZEOF(xkbActionWireDesc)); -+ wire += sz; - } - if (stuff->change & XkbXI_IndicatorsMask) { - int status = Success; - - wire = CheckSetDeviceIndicators(wire, dev, stuff->nDeviceLedFBs, -- &status, client); -+ &status, client, stuff); - if (status != Success) - return status; - } -@@ -6764,8 +6770,8 @@ _XkbSetDeviceInfo(ClientPtr client, DeviceIntPtr dev, - } - - static int --_XkbSetDeviceInfoCheck(ClientPtr client, DeviceIntPtr dev, -- xkbSetDeviceInfoReq * stuff) -+_XkbSetDeviceInfo(ClientPtr client, DeviceIntPtr dev, -+ xkbSetDeviceInfoReq * stuff) - { - char *wire; - xkbExtensionDeviceNotify ed; -@@ -6789,8 +6795,6 @@ _XkbSetDeviceInfoCheck(ClientPtr client, DeviceIntPtr dev, - if (stuff->firstBtn + stuff->nBtns > nBtns) - return BadValue; - sz = stuff->nBtns * SIZEOF(xkbActionWireDesc); -- if (!_XkbCheckRequestBounds(client, stuff, wire, (char *) wire + sz)) -- return BadLength; - memcpy((char *) &acts[stuff->firstBtn], (char *) wire, sz); - wire += sz; - ed.reason |= XkbXI_ButtonActionsMask; --- -2.36.1 - diff --git a/0003-Xi-avoid-integer-truncation-in-length-check-of-ProcX.patch b/0003-Xi-avoid-integer-truncation-in-length-check-of-ProcX.patch deleted file mode 100644 index d3c6541..0000000 --- a/0003-Xi-avoid-integer-truncation-in-length-check-of-ProcX.patch +++ /dev/null @@ -1,71 +0,0 @@ -From f9c435822c852659e3926502829f1b13ce6efc37 Mon Sep 17 00:00:00 2001 -From: Peter Hutterer -Date: Tue, 29 Nov 2022 13:26:57 +1000 -Subject: [PATCH xserver 3/7] Xi: avoid integer truncation in length check of - ProcXIChangeProperty - -This fixes an OOB read and the resulting information disclosure. - -Length calculation for the request was clipped to a 32-bit integer. With -the correct stuff->num_items value the expected request size was -truncated, passing the REQUEST_FIXED_SIZE check. - -The server then proceeded with reading at least stuff->num_items bytes -(depending on stuff->format) from the request and stuffing whatever it -finds into the property. In the process it would also allocate at least -stuff->num_items bytes, i.e. 4GB. - -The same bug exists in ProcChangeProperty and ProcXChangeDeviceProperty, -so let's fix that too. - -CVE-2022-46344, ZDI-CAN 19405 - -This vulnerability was discovered by: -Jan-Niklas Sohn working with Trend Micro Zero Day Initiative - -Signed-off-by: Peter Hutterer -Acked-by: Olivier Fourdan ---- - Xi/xiproperty.c | 4 ++-- - dix/property.c | 3 ++- - 2 files changed, 4 insertions(+), 3 deletions(-) - -diff --git a/Xi/xiproperty.c b/Xi/xiproperty.c -index 68c362c628..066ba21fba 100644 ---- a/Xi/xiproperty.c -+++ b/Xi/xiproperty.c -@@ -890,7 +890,7 @@ ProcXChangeDeviceProperty(ClientPtr client) - REQUEST(xChangeDevicePropertyReq); - DeviceIntPtr dev; - unsigned long len; -- int totalSize; -+ uint64_t totalSize; - int rc; - - REQUEST_AT_LEAST_SIZE(xChangeDevicePropertyReq); -@@ -1130,7 +1130,7 @@ ProcXIChangeProperty(ClientPtr client) - { - int rc; - DeviceIntPtr dev; -- int totalSize; -+ uint64_t totalSize; - unsigned long len; - - REQUEST(xXIChangePropertyReq); -diff --git a/dix/property.c b/dix/property.c -index 94ef5a0ec0..acce94b2c6 100644 ---- a/dix/property.c -+++ b/dix/property.c -@@ -205,7 +205,8 @@ ProcChangeProperty(ClientPtr client) - WindowPtr pWin; - char format, mode; - unsigned long len; -- int sizeInBytes, totalSize, err; -+ int sizeInBytes, err; -+ uint64_t totalSize; - - REQUEST(xChangePropertyReq); - --- -2.38.1 - diff --git a/0003-Xquartz-ProcAppleDRICreatePixmap-needs-to-use-unswap.patch b/0003-Xquartz-ProcAppleDRICreatePixmap-needs-to-use-unswap.patch deleted file mode 100644 index df0a498..0000000 --- a/0003-Xquartz-ProcAppleDRICreatePixmap-needs-to-use-unswap.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 6c684d035c06fd41c727f0ef0744517580864cef Mon Sep 17 00:00:00 2001 -From: Alan Coopersmith -Date: Fri, 22 Mar 2024 19:07:34 -0700 -Subject: [PATCH 3/4] Xquartz: ProcAppleDRICreatePixmap needs to use unswapped - length to send reply - -CVE-2024-31082 - -Fixes: 14205ade0 ("XQuartz: appledri: Fix byte swapping in replies") -Signed-off-by: Alan Coopersmith -Part-of: ---- - hw/xquartz/xpr/appledri.c | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/hw/xquartz/xpr/appledri.c b/hw/xquartz/xpr/appledri.c -index 77574655b..40422b61a 100644 ---- a/hw/xquartz/xpr/appledri.c -+++ b/hw/xquartz/xpr/appledri.c -@@ -272,6 +272,7 @@ ProcAppleDRICreatePixmap(ClientPtr client) - xAppleDRICreatePixmapReply rep; - int width, height, pitch, bpp; - void *ptr; -+ CARD32 stringLength; - - REQUEST_SIZE_MATCH(xAppleDRICreatePixmapReq); - -@@ -307,6 +308,7 @@ ProcAppleDRICreatePixmap(ClientPtr client) - if (sizeof(rep) != sz_xAppleDRICreatePixmapReply) - ErrorF("error sizeof(rep) is %zu\n", sizeof(rep)); - -+ stringLength = rep.stringLength; /* save unswapped value */ - if (client->swapped) { - swaps(&rep.sequenceNumber); - swapl(&rep.length); -@@ -319,7 +321,7 @@ ProcAppleDRICreatePixmap(ClientPtr client) - } - - WriteToClient(client, sizeof(rep), &rep); -- WriteToClient(client, rep.stringLength, path); -+ WriteToClient(client, stringLength, path); - - return Success; - } --- -2.44.0 - diff --git a/0003-dix-fix-DeviceStateNotify-event-calculation.patch b/0003-dix-fix-DeviceStateNotify-event-calculation.patch deleted file mode 100644 index 2fe2f8e..0000000 --- a/0003-dix-fix-DeviceStateNotify-event-calculation.patch +++ /dev/null @@ -1,217 +0,0 @@ -From 219c54b8a3337456ce5270ded6a67bcde53553d5 Mon Sep 17 00:00:00 2001 -From: Peter Hutterer -Date: Mon, 18 Dec 2023 12:26:20 +1000 -Subject: [PATCH 3/9] dix: fix DeviceStateNotify event calculation - -The previous code only made sense if one considers buttons and keys to -be mutually exclusive on a device. That is not necessarily true, causing -a number of issues. - -This function allocates and fills in the number of xEvents we need to -send the device state down the wire. This is split across multiple -32-byte devices including one deviceStateNotify event and optional -deviceKeyStateNotify, deviceButtonStateNotify and (possibly multiple) -deviceValuator events. - -The previous behavior would instead compose a sequence -of [state, buttonstate, state, keystate, valuator...]. This is not -protocol correct, and on top of that made the code extremely convoluted. - -Fix this by streamlining: add both button and key into the deviceStateNotify -and then append the key state and button state, followed by the -valuators. Finally, the deviceValuator events contain up to 6 valuators -per event but we only ever sent through 3 at a time. Let's double that -troughput. - -CVE-2024-0229, ZDI-CAN-22678 - -This vulnerability was discovered by: -Jan-Niklas Sohn working with Trend Micro Zero Day Initiative ---- - dix/enterleave.c | 121 ++++++++++++++++++++--------------------------- - 1 file changed, 52 insertions(+), 69 deletions(-) - -diff --git a/dix/enterleave.c b/dix/enterleave.c -index 17964b00a..7b7ba1098 100644 ---- a/dix/enterleave.c -+++ b/dix/enterleave.c -@@ -615,9 +615,15 @@ FixDeviceValuator(DeviceIntPtr dev, deviceValuator * ev, ValuatorClassPtr v, - - ev->type = DeviceValuator; - ev->deviceid = dev->id; -- ev->num_valuators = nval < 3 ? nval : 3; -+ ev->num_valuators = nval < 6 ? nval : 6; - ev->first_valuator = first; - switch (ev->num_valuators) { -+ case 6: -+ ev->valuator2 = v->axisVal[first + 5]; -+ case 5: -+ ev->valuator2 = v->axisVal[first + 4]; -+ case 4: -+ ev->valuator2 = v->axisVal[first + 3]; - case 3: - ev->valuator2 = v->axisVal[first + 2]; - case 2: -@@ -626,7 +632,6 @@ FixDeviceValuator(DeviceIntPtr dev, deviceValuator * ev, ValuatorClassPtr v, - ev->valuator0 = v->axisVal[first]; - break; - } -- first += ev->num_valuators; - } - - static void -@@ -646,7 +651,7 @@ FixDeviceStateNotify(DeviceIntPtr dev, deviceStateNotify * ev, KeyClassPtr k, - ev->num_buttons = b->numButtons; - memcpy((char *) ev->buttons, (char *) b->down, 4); - } -- else if (k) { -+ if (k) { - ev->classes_reported |= (1 << KeyClass); - ev->num_keys = k->xkbInfo->desc->max_key_code - - k->xkbInfo->desc->min_key_code; -@@ -670,15 +675,26 @@ FixDeviceStateNotify(DeviceIntPtr dev, deviceStateNotify * ev, KeyClassPtr k, - } - } - -- -+/** -+ * The device state notify event is split across multiple 32-byte events. -+ * The first one contains the first 32 button state bits, the first 32 -+ * key state bits, and the first 3 valuator values. -+ * -+ * If a device has more than that, the server sends out: -+ * - one deviceButtonStateNotify for buttons 32 and above -+ * - one deviceKeyStateNotify for keys 32 and above -+ * - one deviceValuator event per 6 valuators above valuator 4 -+ * -+ * All events but the last one have the deviceid binary ORed with MORE_EVENTS, -+ */ - static void - DeliverStateNotifyEvent(DeviceIntPtr dev, WindowPtr win) - { -+ /* deviceStateNotify, deviceKeyStateNotify, deviceButtonStateNotify -+ * and one deviceValuator for each 6 valuators */ -+ deviceStateNotify sev[3 + (MAX_VALUATORS + 6)/6]; - int evcount = 1; -- deviceStateNotify sev[6 + (MAX_VALUATORS + 2)/3]; -- deviceStateNotify *ev; -- deviceKeyStateNotify *kev; -- deviceButtonStateNotify *bev; -+ deviceStateNotify *ev = sev; - - KeyClassPtr k; - ButtonClassPtr b; -@@ -691,82 +707,49 @@ DeliverStateNotifyEvent(DeviceIntPtr dev, WindowPtr win) - - if ((b = dev->button) != NULL) { - nbuttons = b->numButtons; -- if (nbuttons > 32) -+ if (nbuttons > 32) /* first 32 are encoded in deviceStateNotify */ - evcount++; - } - if ((k = dev->key) != NULL) { - nkeys = k->xkbInfo->desc->max_key_code - k->xkbInfo->desc->min_key_code; -- if (nkeys > 32) -+ if (nkeys > 32) /* first 32 are encoded in deviceStateNotify */ - evcount++; -- if (nbuttons > 0) { -- evcount++; -- } - } - if ((v = dev->valuator) != NULL) { - nval = v->numAxes; -- -- if (nval > 3) -- evcount++; -- if (nval > 6) { -- if (!(k && b)) -- evcount++; -- if (nval > 9) -- evcount += ((nval - 7) / 3); -- } -+ /* first three are encoded in deviceStateNotify, then -+ * it's 6 per deviceValuator event */ -+ evcount += ((nval - 3) + 6)/6; - } - -- ev = sev; -- FixDeviceStateNotify(dev, ev, NULL, NULL, NULL, first); -- -- if (b != NULL) { -- FixDeviceStateNotify(dev, ev++, NULL, b, v, first); -- first += 3; -- nval -= 3; -- if (nbuttons > 32) { -- (ev - 1)->deviceid |= MORE_EVENTS; -- bev = (deviceButtonStateNotify *) ev++; -- bev->type = DeviceButtonStateNotify; -- bev->deviceid = dev->id; -- memcpy((char *) &bev->buttons[4], (char *) &b->down[4], -- DOWN_LENGTH - 4); -- } -- if (nval > 0) { -- (ev - 1)->deviceid |= MORE_EVENTS; -- FixDeviceValuator(dev, (deviceValuator *) ev++, v, first); -- first += 3; -- nval -= 3; -- } -+ BUG_RETURN(evcount <= ARRAY_SIZE(sev)); -+ -+ FixDeviceStateNotify(dev, ev, k, b, v, first); -+ -+ if (b != NULL && nbuttons > 32) { -+ deviceButtonStateNotify *bev = (deviceButtonStateNotify *) ++ev; -+ (ev - 1)->deviceid |= MORE_EVENTS; -+ bev->type = DeviceButtonStateNotify; -+ bev->deviceid = dev->id; -+ memcpy((char *) &bev->buttons[4], (char *) &b->down[4], -+ DOWN_LENGTH - 4); - } - -- if (k != NULL) { -- FixDeviceStateNotify(dev, ev++, k, NULL, v, first); -- first += 3; -- nval -= 3; -- if (nkeys > 32) { -- (ev - 1)->deviceid |= MORE_EVENTS; -- kev = (deviceKeyStateNotify *) ev++; -- kev->type = DeviceKeyStateNotify; -- kev->deviceid = dev->id; -- memmove((char *) &kev->keys[0], (char *) &k->down[4], 28); -- } -- if (nval > 0) { -- (ev - 1)->deviceid |= MORE_EVENTS; -- FixDeviceValuator(dev, (deviceValuator *) ev++, v, first); -- first += 3; -- nval -= 3; -- } -+ if (k != NULL && nkeys > 32) { -+ deviceKeyStateNotify *kev = (deviceKeyStateNotify *) ++ev; -+ (ev - 1)->deviceid |= MORE_EVENTS; -+ kev->type = DeviceKeyStateNotify; -+ kev->deviceid = dev->id; -+ memmove((char *) &kev->keys[0], (char *) &k->down[4], 28); - } - -+ first = 3; -+ nval -= 3; - while (nval > 0) { -- FixDeviceStateNotify(dev, ev++, NULL, NULL, v, first); -- first += 3; -- nval -= 3; -- if (nval > 0) { -- (ev - 1)->deviceid |= MORE_EVENTS; -- FixDeviceValuator(dev, (deviceValuator *) ev++, v, first); -- first += 3; -- nval -= 3; -- } -+ ev->deviceid |= MORE_EVENTS; -+ FixDeviceValuator(dev, (deviceValuator *) ++ev, v, first); -+ first += 6; -+ nval -= 6; - } - - DeliverEventsToWindow(dev, win, (xEvent *) sev, evcount, --- -2.43.0 - diff --git a/0003-xkb-add-request-length-validation-for-XkbSetGeometry.patch b/0003-xkb-add-request-length-validation-for-XkbSetGeometry.patch deleted file mode 100644 index dca4d7c..0000000 --- a/0003-xkb-add-request-length-validation-for-XkbSetGeometry.patch +++ /dev/null @@ -1,182 +0,0 @@ -From 6907b6ea2b4ce949cb07271f5b678d5966d9df42 Mon Sep 17 00:00:00 2001 -From: Peter Hutterer -Date: Tue, 5 Jul 2022 11:11:06 +1000 -Subject: [PATCH xserver 3/3] xkb: add request length validation for - XkbSetGeometry - -No validation of the various fields on that report were done, so a -malicious client could send a short request that claims it had N -sections, or rows, or keys, and the server would process the request for -N sections, running out of bounds of the actual request data. - -Fix this by adding size checks to ensure our data is valid. - -ZDI-CAN 16062, CVE-2022-2319. - -This vulnerability was discovered by: -Jan-Niklas Sohn working with Trend Micro Zero Day Initiative - -Signed-off-by: Peter Hutterer ---- - xkb/xkb.c | 43 ++++++++++++++++++++++++++++++++++++++----- - 1 file changed, 38 insertions(+), 5 deletions(-) - -diff --git a/xkb/xkb.c b/xkb/xkb.c -index 34b2c290b..4692895db 100644 ---- a/xkb/xkb.c -+++ b/xkb/xkb.c -@@ -5156,7 +5156,7 @@ _GetCountedString(char **wire_inout, ClientPtr client, char **str) - } - - static Status --_CheckSetDoodad(char **wire_inout, -+_CheckSetDoodad(char **wire_inout, xkbSetGeometryReq *req, - XkbGeometryPtr geom, XkbSectionPtr section, ClientPtr client) - { - char *wire; -@@ -5167,6 +5167,9 @@ _CheckSetDoodad(char **wire_inout, - Status status; - - dWire = (xkbDoodadWireDesc *) (*wire_inout); -+ if (!_XkbCheckRequestBounds(client, req, dWire, dWire + 1)) -+ return BadLength; -+ - any = dWire->any; - wire = (char *) &dWire[1]; - if (client->swapped) { -@@ -5269,7 +5272,7 @@ _CheckSetDoodad(char **wire_inout, - } - - static Status --_CheckSetOverlay(char **wire_inout, -+_CheckSetOverlay(char **wire_inout, xkbSetGeometryReq *req, - XkbGeometryPtr geom, XkbSectionPtr section, ClientPtr client) - { - register int r; -@@ -5280,6 +5283,9 @@ _CheckSetOverlay(char **wire_inout, - - wire = *wire_inout; - olWire = (xkbOverlayWireDesc *) wire; -+ if (!_XkbCheckRequestBounds(client, req, olWire, olWire + 1)) -+ return BadLength; -+ - if (client->swapped) { - swapl(&olWire->name); - } -@@ -5291,6 +5297,9 @@ _CheckSetOverlay(char **wire_inout, - xkbOverlayKeyWireDesc *kWire; - XkbOverlayRowPtr row; - -+ if (!_XkbCheckRequestBounds(client, req, rWire, rWire + 1)) -+ return BadLength; -+ - if (rWire->rowUnder > section->num_rows) { - client->errorValue = _XkbErrCode4(0x20, r, section->num_rows, - rWire->rowUnder); -@@ -5299,6 +5308,9 @@ _CheckSetOverlay(char **wire_inout, - row = XkbAddGeomOverlayRow(ol, rWire->rowUnder, rWire->nKeys); - kWire = (xkbOverlayKeyWireDesc *) &rWire[1]; - for (k = 0; k < rWire->nKeys; k++, kWire++) { -+ if (!_XkbCheckRequestBounds(client, req, kWire, kWire + 1)) -+ return BadLength; -+ - if (XkbAddGeomOverlayKey(ol, row, - (char *) kWire->over, - (char *) kWire->under) == NULL) { -@@ -5332,6 +5344,9 @@ _CheckSetSections(XkbGeometryPtr geom, - register int r; - xkbRowWireDesc *rWire; - -+ if (!_XkbCheckRequestBounds(client, req, sWire, sWire + 1)) -+ return BadLength; -+ - if (client->swapped) { - swapl(&sWire->name); - swaps(&sWire->top); -@@ -5357,6 +5372,9 @@ _CheckSetSections(XkbGeometryPtr geom, - XkbRowPtr row; - xkbKeyWireDesc *kWire; - -+ if (!_XkbCheckRequestBounds(client, req, rWire, rWire + 1)) -+ return BadLength; -+ - if (client->swapped) { - swaps(&rWire->top); - swaps(&rWire->left); -@@ -5371,6 +5389,9 @@ _CheckSetSections(XkbGeometryPtr geom, - for (k = 0; k < rWire->nKeys; k++, kWire++) { - XkbKeyPtr key; - -+ if (!_XkbCheckRequestBounds(client, req, kWire, kWire + 1)) -+ return BadLength; -+ - key = XkbAddGeomKey(row); - if (!key) - return BadAlloc; -@@ -5396,7 +5417,7 @@ _CheckSetSections(XkbGeometryPtr geom, - register int d; - - for (d = 0; d < sWire->nDoodads; d++) { -- status = _CheckSetDoodad(&wire, geom, section, client); -+ status = _CheckSetDoodad(&wire, req, geom, section, client); - if (status != Success) - return status; - } -@@ -5405,7 +5426,7 @@ _CheckSetSections(XkbGeometryPtr geom, - register int o; - - for (o = 0; o < sWire->nOverlays; o++) { -- status = _CheckSetOverlay(&wire, geom, section, client); -+ status = _CheckSetOverlay(&wire, req, geom, section, client); - if (status != Success) - return status; - } -@@ -5439,6 +5460,9 @@ _CheckSetShapes(XkbGeometryPtr geom, - xkbOutlineWireDesc *olWire; - XkbOutlinePtr ol; - -+ if (!_XkbCheckRequestBounds(client, req, shapeWire, shapeWire + 1)) -+ return BadLength; -+ - shape = - XkbAddGeomShape(geom, shapeWire->name, shapeWire->nOutlines); - if (!shape) -@@ -5449,12 +5473,18 @@ _CheckSetShapes(XkbGeometryPtr geom, - XkbPointPtr pt; - xkbPointWireDesc *ptWire; - -+ if (!_XkbCheckRequestBounds(client, req, olWire, olWire + 1)) -+ return BadLength; -+ - ol = XkbAddGeomOutline(shape, olWire->nPoints); - if (!ol) - return BadAlloc; - ol->corner_radius = olWire->cornerRadius; - ptWire = (xkbPointWireDesc *) &olWire[1]; - for (p = 0, pt = ol->points; p < olWire->nPoints; p++, pt++, ptWire++) { -+ if (!_XkbCheckRequestBounds(client, req, ptWire, ptWire + 1)) -+ return BadLength; -+ - pt->x = ptWire->x; - pt->y = ptWire->y; - if (client->swapped) { -@@ -5560,12 +5590,15 @@ _CheckSetGeom(XkbGeometryPtr geom, xkbSetGeometryReq * req, ClientPtr client) - return status; - - for (i = 0; i < req->nDoodads; i++) { -- status = _CheckSetDoodad(&wire, geom, NULL, client); -+ status = _CheckSetDoodad(&wire, req, geom, NULL, client); - if (status != Success) - return status; - } - - for (i = 0; i < req->nKeyAliases; i++) { -+ if (!_XkbCheckRequestBounds(client, req, wire, wire + XkbKeyNameLength)) -+ return BadLength; -+ - if (XkbAddGeomKeyAlias(geom, &wire[XkbKeyNameLength], wire) == NULL) - return BadAlloc; - wire += 2 * XkbKeyNameLength; --- -2.36.1 - diff --git a/0004-Xi-disallow-passive-grabs-with-a-detail-255.patch b/0004-Xi-disallow-passive-grabs-with-a-detail-255.patch deleted file mode 100644 index 5b189ea..0000000 --- a/0004-Xi-disallow-passive-grabs-with-a-detail-255.patch +++ /dev/null @@ -1,82 +0,0 @@ -From 0dab0b527ac5c4fe0272ea679522bd87238a733b Mon Sep 17 00:00:00 2001 -From: Peter Hutterer -Date: Tue, 29 Nov 2022 13:55:32 +1000 -Subject: [PATCH xserver 4/7] Xi: disallow passive grabs with a detail > 255 - -The XKB protocol effectively prevents us from ever using keycodes above -255. For buttons it's theoretically possible but realistically too niche -to worry about. For all other passive grabs, the detail must be zero -anyway. - -This fixes an OOB write: - -ProcXIPassiveUngrabDevice() calls DeletePassiveGrabFromList with a -temporary grab struct which contains tempGrab->detail.exact = stuff->detail. -For matching existing grabs, DeleteDetailFromMask is called with the -stuff->detail value. This function creates a new mask with the one bit -representing stuff->detail cleared. - -However, the array size for the new mask is 8 * sizeof(CARD32) bits, -thus any detail above 255 results in an OOB array write. - -CVE-2022-46341, ZDI-CAN 19381 - -This vulnerability was discovered by: -Jan-Niklas Sohn working with Trend Micro Zero Day Initiative - -Signed-off-by: Peter Hutterer -Acked-by: Olivier Fourdan ---- - Xi/xipassivegrab.c | 22 ++++++++++++++-------- - 1 file changed, 14 insertions(+), 8 deletions(-) - -diff --git a/Xi/xipassivegrab.c b/Xi/xipassivegrab.c -index 2769fb7c94..c9ac2f8553 100644 ---- a/Xi/xipassivegrab.c -+++ b/Xi/xipassivegrab.c -@@ -137,6 +137,12 @@ ProcXIPassiveGrabDevice(ClientPtr client) - return BadValue; - } - -+ /* XI2 allows 32-bit keycodes but thanks to XKB we can never -+ * implement this. Just return an error for all keycodes that -+ * cannot work anyway, same for buttons > 255. */ -+ if (stuff->detail > 255) -+ return XIAlreadyGrabbed; -+ - if (XICheckInvalidMaskBits(client, (unsigned char *) &stuff[1], - stuff->mask_len * 4) != Success) - return BadValue; -@@ -207,14 +213,8 @@ ProcXIPassiveGrabDevice(ClientPtr client) - ¶m, XI2, &mask); - break; - case XIGrabtypeKeycode: -- /* XI2 allows 32-bit keycodes but thanks to XKB we can never -- * implement this. Just return an error for all keycodes that -- * cannot work anyway */ -- if (stuff->detail > 255) -- status = XIAlreadyGrabbed; -- else -- status = GrabKey(client, dev, mod_dev, stuff->detail, -- ¶m, XI2, &mask); -+ status = GrabKey(client, dev, mod_dev, stuff->detail, -+ ¶m, XI2, &mask); - break; - case XIGrabtypeEnter: - case XIGrabtypeFocusIn: -@@ -334,6 +334,12 @@ ProcXIPassiveUngrabDevice(ClientPtr client) - return BadValue; - } - -+ /* We don't allow passive grabs for details > 255 anyway */ -+ if (stuff->detail > 255) { -+ client->errorValue = stuff->detail; -+ return BadValue; -+ } -+ - rc = dixLookupWindow(&win, stuff->grab_window, client, DixSetAttrAccess); - if (rc != Success) - return rc; --- -2.38.1 - diff --git a/0004-Xi-when-creating-a-new-ButtonClass-set-the-number-of.patch b/0004-Xi-when-creating-a-new-ButtonClass-set-the-number-of.patch deleted file mode 100644 index dbe90ce..0000000 --- a/0004-Xi-when-creating-a-new-ButtonClass-set-the-number-of.patch +++ /dev/null @@ -1,37 +0,0 @@ -From df3c65706eb169d5938df0052059f3e0d5981b74 Mon Sep 17 00:00:00 2001 -From: Peter Hutterer -Date: Thu, 21 Dec 2023 13:48:10 +1000 -Subject: [PATCH 4/9] Xi: when creating a new ButtonClass, set the number of - buttons - -There's a racy sequence where a master device may copy the button class -from the slave, without ever initializing numButtons. This leads to a -device with zero buttons but a button class which is invalid. - -Let's copy the numButtons value from the source - by definition if we -don't have a button class yet we do not have any other slave devices -with more than this number of buttons anyway. - -CVE-2024-0229, ZDI-CAN-22678 - -This vulnerability was discovered by: -Jan-Niklas Sohn working with Trend Micro Zero Day Initiative ---- - Xi/exevents.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/Xi/exevents.c b/Xi/exevents.c -index 54ea11a93..e16171468 100644 ---- a/Xi/exevents.c -+++ b/Xi/exevents.c -@@ -605,6 +605,7 @@ DeepCopyPointerClasses(DeviceIntPtr from, DeviceIntPtr to) - to->button = calloc(1, sizeof(ButtonClassRec)); - if (!to->button) - FatalError("[Xi] no memory for class shift.\n"); -+ to->button->numButtons = from->button->numButtons; - } - else - classes->button = NULL; --- -2.43.0 - diff --git a/0004-render-fix-refcounting-of-glyphs-during-ProcRenderAd.patch b/0004-render-fix-refcounting-of-glyphs-during-ProcRenderAd.patch deleted file mode 100644 index dcbf337..0000000 --- a/0004-render-fix-refcounting-of-glyphs-during-ProcRenderAd.patch +++ /dev/null @@ -1,112 +0,0 @@ -From bdca6c3d1f5057eeb31609b1280fc93237b00c77 Mon Sep 17 00:00:00 2001 -From: Peter Hutterer -Date: Tue, 30 Jan 2024 13:13:35 +1000 -Subject: [PATCH 4/4] render: fix refcounting of glyphs during - ProcRenderAddGlyphs - -Previously, AllocateGlyph would return a new glyph with refcount=0 and a -re-used glyph would end up not changing the refcount at all. The -resulting glyph_new array would thus have multiple entries pointing to -the same non-refcounted glyphs. - -AddGlyph may free a glyph, resulting in a UAF when the same glyph -pointer is then later used. - -Fix this by returning a refcount of 1 for a new glyph and always -incrementing the refcount for a re-used glyph, followed by dropping that -refcount back down again when we're done with it. - -CVE-2024-31083, ZDI-CAN-22880 - -This vulnerability was discovered by: -Jan-Niklas Sohn working with Trend Micro Zero Day Initiative - -Part-of: ---- - render/glyph.c | 5 +++-- - render/glyphstr_priv.h | 1 + - render/render.c | 15 +++++++++++---- - 3 files changed, 15 insertions(+), 6 deletions(-) - -diff --git a/render/glyph.c b/render/glyph.c -index 850ea8440..13991f8a1 100644 ---- a/render/glyph.c -+++ b/render/glyph.c -@@ -245,10 +245,11 @@ FreeGlyphPicture(GlyphPtr glyph) - } - } - --static void -+void - FreeGlyph(GlyphPtr glyph, int format) - { - CheckDuplicates(&globalGlyphs[format], "FreeGlyph"); -+ BUG_RETURN(glyph->refcnt == 0); - if (--glyph->refcnt == 0) { - GlyphRefPtr gr; - int i; -@@ -354,7 +355,7 @@ AllocateGlyph(xGlyphInfo * gi, int fdepth) - glyph = (GlyphPtr) malloc(size); - if (!glyph) - return 0; -- glyph->refcnt = 0; -+ glyph->refcnt = 1; - glyph->size = size + sizeof(xGlyphInfo); - glyph->info = *gi; - dixInitPrivates(glyph, (char *) glyph + head_size, PRIVATE_GLYPH); -diff --git a/render/glyphstr.h b/render/glyphstr.h -index 2f51bd244..3b1d806d1 100644 ---- a/render/glyphstr.h -+++ b/render/glyphstr.h -@@ -108,6 +108,7 @@ extern Bool - extern GlyphPtr FindGlyph(GlyphSetPtr glyphSet, Glyph id); - - extern GlyphPtr AllocateGlyph(xGlyphInfo * gi, int format); -+extern void FreeGlyph(GlyphPtr glyph, int format); - - extern Bool - ResizeGlyphSet(GlyphSetPtr glyphSet, CARD32 change); -diff --git a/render/render.c b/render/render.c -index 29c5055c6..fe5e37dd9 100644 ---- a/render/render.c -+++ b/render/render.c -@@ -1076,6 +1076,7 @@ ProcRenderAddGlyphs(ClientPtr client) - - if (glyph_new->glyph && glyph_new->glyph != DeletedGlyph) { - glyph_new->found = TRUE; -+ ++glyph_new->glyph->refcnt; - } - else { - GlyphPtr glyph; -@@ -1168,8 +1169,10 @@ ProcRenderAddGlyphs(ClientPtr client) - err = BadAlloc; - goto bail; - } -- for (i = 0; i < nglyphs; i++) -+ for (i = 0; i < nglyphs; i++) { - AddGlyph(glyphSet, glyphs[i].glyph, glyphs[i].id); -+ FreeGlyph(glyphs[i].glyph, glyphSet->fdepth); -+ } - - if (glyphsBase != glyphsLocal) - free(glyphsBase); -@@ -1179,9 +1182,13 @@ ProcRenderAddGlyphs(ClientPtr client) - FreePicture((void *) pSrc, 0); - if (pSrcPix) - FreeScratchPixmapHeader(pSrcPix); -- for (i = 0; i < nglyphs; i++) -- if (glyphs[i].glyph && !glyphs[i].found) -- free(glyphs[i].glyph); -+ for (i = 0; i < nglyphs; i++) { -+ if (glyphs[i].glyph) { -+ --glyphs[i].glyph->refcnt; -+ if (!glyphs[i].found) -+ free(glyphs[i].glyph); -+ } -+ } - if (glyphsBase != glyphsLocal) - free(glyphsBase); - return err; --- -2.44.0 - diff --git a/0005-Xext-free-the-screen-saver-resource-when-replacing-i.patch b/0005-Xext-free-the-screen-saver-resource-when-replacing-i.patch deleted file mode 100644 index dc2a9d9..0000000 --- a/0005-Xext-free-the-screen-saver-resource-when-replacing-i.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 94f6fe99d87cf6ba0adadd95c595158c345b7d29 Mon Sep 17 00:00:00 2001 -From: Peter Hutterer -Date: Tue, 29 Nov 2022 14:53:07 +1000 -Subject: [PATCH xserver 5/7] Xext: free the screen saver resource when - replacing it - -This fixes a use-after-free bug: - -When a client first calls ScreenSaverSetAttributes(), a struct -ScreenSaverAttrRec is allocated and added to the client's -resources. - -When the same client calls ScreenSaverSetAttributes() again, a new -struct ScreenSaverAttrRec is allocated, replacing the old struct. The -old struct was freed but not removed from the clients resources. - -Later, when the client is destroyed the resource system invokes -ScreenSaverFreeAttr and attempts to clean up the already freed struct. - -Fix this by letting the resource system free the old attrs instead. - -CVE-2022-46343, ZDI-CAN 19404 - -This vulnerability was discovered by: -Jan-Niklas Sohn working with Trend Micro Zero Day Initiative - -Signed-off-by: Peter Hutterer -Acked-by: Olivier Fourdan ---- - Xext/saver.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/Xext/saver.c b/Xext/saver.c -index f813ba08d1..fd6153c313 100644 ---- a/Xext/saver.c -+++ b/Xext/saver.c -@@ -1051,7 +1051,7 @@ ScreenSaverSetAttributes(ClientPtr client) - pVlist++; - } - if (pPriv->attr) -- FreeScreenAttr(pPriv->attr); -+ FreeResource(pPriv->attr->resource, AttrType); - pPriv->attr = pAttr; - pAttr->resource = FakeClientID(client->index); - if (!AddResource(pAttr->resource, AttrType, (void *) pAttr)) --- -2.38.1 - diff --git a/0005-Xi-flush-hierarchy-events-after-adding-removing-mast.patch b/0005-Xi-flush-hierarchy-events-after-adding-removing-mast.patch deleted file mode 100644 index 6a21b3c..0000000 --- a/0005-Xi-flush-hierarchy-events-after-adding-removing-mast.patch +++ /dev/null @@ -1,109 +0,0 @@ -From 4a5e9b1895627d40d26045bd0b7ef3dce503cbd1 Mon Sep 17 00:00:00 2001 -From: Peter Hutterer -Date: Thu, 4 Jan 2024 10:01:24 +1000 -Subject: [PATCH 5/9] Xi: flush hierarchy events after adding/removing master - devices - -The `XISendDeviceHierarchyEvent()` function allocates space to store up -to `MAXDEVICES` (256) `xXIHierarchyInfo` structures in `info`. - -If a device with a given ID was removed and a new device with the same -ID added both in the same operation, the single device ID will lead to -two info structures being written to `info`. - -Since this case can occur for every device ID at once, a total of two -times `MAXDEVICES` info structures might be written to the allocation. - -To avoid it, once one add/remove master is processed, send out the -device hierarchy event for the current state and continue. That event -thus only ever has exactly one of either added/removed in it (and -optionally slave attached/detached). - -CVE-2024-21885, ZDI-CAN-22744 - -This vulnerability was discovered by: -Jan-Niklas Sohn working with Trend Micro Zero Day Initiative ---- - Xi/xichangehierarchy.c | 27 ++++++++++++++++++++++----- - 1 file changed, 22 insertions(+), 5 deletions(-) - -diff --git a/Xi/xichangehierarchy.c b/Xi/xichangehierarchy.c -index d2d985848..72d00451e 100644 ---- a/Xi/xichangehierarchy.c -+++ b/Xi/xichangehierarchy.c -@@ -416,6 +416,11 @@ ProcXIChangeHierarchy(ClientPtr client) - size_t len; /* length of data remaining in request */ - int rc = Success; - int flags[MAXDEVICES] = { 0 }; -+ enum { -+ NO_CHANGE, -+ FLUSH, -+ CHANGED, -+ } changes = NO_CHANGE; - - REQUEST(xXIChangeHierarchyReq); - REQUEST_AT_LEAST_SIZE(xXIChangeHierarchyReq); -@@ -465,8 +470,9 @@ ProcXIChangeHierarchy(ClientPtr client) - rc = add_master(client, c, flags); - if (rc != Success) - goto unwind; -- } -+ changes = FLUSH; - break; -+ } - case XIRemoveMaster: - { - xXIRemoveMasterInfo *r = (xXIRemoveMasterInfo *) any; -@@ -475,8 +481,9 @@ ProcXIChangeHierarchy(ClientPtr client) - rc = remove_master(client, r, flags); - if (rc != Success) - goto unwind; -- } -+ changes = FLUSH; - break; -+ } - case XIDetachSlave: - { - xXIDetachSlaveInfo *c = (xXIDetachSlaveInfo *) any; -@@ -485,8 +492,9 @@ ProcXIChangeHierarchy(ClientPtr client) - rc = detach_slave(client, c, flags); - if (rc != Success) - goto unwind; -- } -+ changes = CHANGED; - break; -+ } - case XIAttachSlave: - { - xXIAttachSlaveInfo *c = (xXIAttachSlaveInfo *) any; -@@ -495,16 +503,25 @@ ProcXIChangeHierarchy(ClientPtr client) - rc = attach_slave(client, c, flags); - if (rc != Success) - goto unwind; -+ changes = CHANGED; -+ break; - } -+ default: - break; - } - -+ if (changes == FLUSH) { -+ XISendDeviceHierarchyEvent(flags); -+ memset(flags, 0, sizeof(flags)); -+ changes = NO_CHANGE; -+ } -+ - len -= any->length * 4; - any = (xXIAnyHierarchyChangeInfo *) ((char *) any + any->length * 4); - } - - unwind: -- -- XISendDeviceHierarchyEvent(flags); -+ if (changes != NO_CHANGE) -+ XISendDeviceHierarchyEvent(flags); - return rc; - } --- -2.43.0 - diff --git a/0006-Xext-free-the-XvRTVideoNotify-when-turning-off-from-.patch b/0006-Xext-free-the-XvRTVideoNotify-when-turning-off-from-.patch deleted file mode 100644 index ba8b8fa..0000000 --- a/0006-Xext-free-the-XvRTVideoNotify-when-turning-off-from-.patch +++ /dev/null @@ -1,74 +0,0 @@ -From a42635ee3c01f71a49052d83a372933504c9db04 Mon Sep 17 00:00:00 2001 -From: Peter Hutterer -Date: Wed, 30 Nov 2022 11:20:40 +1000 -Subject: [PATCH xserver 6/7] Xext: free the XvRTVideoNotify when turning off - from the same client - -This fixes a use-after-free bug: - -When a client first calls XvdiSelectVideoNotify() on a drawable with a -TRUE onoff argument, a struct XvVideoNotifyRec is allocated. This struct -is added twice to the resources: - - as the drawable's XvRTVideoNotifyList. This happens only once per - drawable, subsequent calls append to this list. - - as the client's XvRTVideoNotify. This happens for every client. - -The struct keeps the ClientPtr around once it has been added for a -client. The idea, presumably, is that if the client disconnects we can remove -all structs from the drawable's list that match the client (by resetting -the ClientPtr to NULL), but if the drawable is destroyed we can remove -and free the whole list. - -However, if the same client then calls XvdiSelectVideoNotify() on the -same drawable with a FALSE onoff argument, only the ClientPtr on the -existing struct was set to NULL. The struct itself remained in the -client's resources. - -If the drawable is now destroyed, the resource system invokes -XvdiDestroyVideoNotifyList which frees the whole list for this drawable -- including our struct. This function however does not free the resource -for the client since our ClientPtr is NULL. - -Later, when the client is destroyed and the resource system invokes -XvdiDestroyVideoNotify, we unconditionally set the ClientPtr to NULL. On -a struct that has been freed previously. This is generally frowned upon. - -Fix this by calling FreeResource() on the second call instead of merely -setting the ClientPtr to NULL. This removes the struct from the client -resources (but not from the list), ensuring that it won't be accessed -again when the client quits. - -Note that the assignment tpn->client = NULL; is superfluous since the -XvdiDestroyVideoNotify function will do this anyway. But it's left for -clarity and to match a similar invocation in XvdiSelectPortNotify. - -CVE-2022-46342, ZDI-CAN 19400 - -This vulnerability was discovered by: -Jan-Niklas Sohn working with Trend Micro Zero Day Initiative - -Signed-off-by: Peter Hutterer -Acked-by: Olivier Fourdan ---- - Xext/xvmain.c | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/Xext/xvmain.c b/Xext/xvmain.c -index f627471938..2a08f8744a 100644 ---- a/Xext/xvmain.c -+++ b/Xext/xvmain.c -@@ -811,8 +811,10 @@ XvdiSelectVideoNotify(ClientPtr client, DrawablePtr pDraw, BOOL onoff) - tpn = pn; - while (tpn) { - if (tpn->client == client) { -- if (!onoff) -+ if (!onoff) { - tpn->client = NULL; -+ FreeResource(tpn->id, XvRTVideoNotify); -+ } - return Success; - } - if (!tpn->client) --- -2.38.1 - diff --git a/0006-Xi-do-not-keep-linked-list-pointer-during-recursion.patch b/0006-Xi-do-not-keep-linked-list-pointer-during-recursion.patch deleted file mode 100644 index 3174635..0000000 --- a/0006-Xi-do-not-keep-linked-list-pointer-during-recursion.patch +++ /dev/null @@ -1,70 +0,0 @@ -From bc1fdbe46559dd947674375946bbef54dd0ce36b Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Jos=C3=A9=20Exp=C3=B3sito?= -Date: Fri, 22 Dec 2023 18:28:31 +0100 -Subject: [PATCH 6/9] Xi: do not keep linked list pointer during recursion - -The `DisableDevice()` function is called whenever an enabled device -is disabled and it moves the device from the `inputInfo.devices` linked -list to the `inputInfo.off_devices` linked list. - -However, its link/unlink operation has an issue during the recursive -call to `DisableDevice()` due to the `prev` pointer pointing to a -removed device. - -This issue leads to a length mismatch between the total number of -devices and the number of device in the list, leading to a heap -overflow and, possibly, to local privilege escalation. - -Simplify the code that checked whether the device passed to -`DisableDevice()` was in `inputInfo.devices` or not and find the -previous device after the recursion. - -CVE-2024-21886, ZDI-CAN-22840 - -This vulnerability was discovered by: -Jan-Niklas Sohn working with Trend Micro Zero Day Initiative ---- - dix/devices.c | 15 ++++++++++++--- - 1 file changed, 12 insertions(+), 3 deletions(-) - -diff --git a/dix/devices.c b/dix/devices.c -index dca98c8d1..389d28a23 100644 ---- a/dix/devices.c -+++ b/dix/devices.c -@@ -453,14 +453,20 @@ DisableDevice(DeviceIntPtr dev, BOOL sendevent) - { - DeviceIntPtr *prev, other; - BOOL enabled; -+ BOOL dev_in_devices_list = FALSE; - int flags[MAXDEVICES] = { 0 }; - - if (!dev->enabled) - return TRUE; - -- for (prev = &inputInfo.devices; -- *prev && (*prev != dev); prev = &(*prev)->next); -- if (*prev != dev) -+ for (other = inputInfo.devices; other; other = other->next) { -+ if (other == dev) { -+ dev_in_devices_list = TRUE; -+ break; -+ } -+ } -+ -+ if (!dev_in_devices_list) - return FALSE; - - TouchEndPhysicallyActiveTouches(dev); -@@ -511,6 +517,9 @@ DisableDevice(DeviceIntPtr dev, BOOL sendevent) - LeaveWindow(dev); - SetFocusOut(dev); - -+ for (prev = &inputInfo.devices; -+ *prev && (*prev != dev); prev = &(*prev)->next); -+ - *prev = dev->next; - dev->next = inputInfo.off_devices; - inputInfo.off_devices = dev; --- -2.43.0 - diff --git a/0007-dix-when-disabling-a-master-float-disabled-slaved-de.patch b/0007-dix-when-disabling-a-master-float-disabled-slaved-de.patch deleted file mode 100644 index 32a326a..0000000 --- a/0007-dix-when-disabling-a-master-float-disabled-slaved-de.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 26769aa71fcbe0a8403b7fb13b7c9010cc07c3a8 Mon Sep 17 00:00:00 2001 -From: Peter Hutterer -Date: Fri, 5 Jan 2024 09:40:27 +1000 -Subject: [PATCH 7/9] dix: when disabling a master, float disabled slaved - devices too - -Disabling a master device floats all slave devices but we didn't do this -to already-disabled slave devices. As a result those devices kept their -reference to the master device resulting in access to already freed -memory if the master device was removed before the corresponding slave -device. - -And to match this behavior, also forcibly reset that pointer during -CloseDownDevices(). - -Related to CVE-2024-21886, ZDI-CAN-22840 ---- - dix/devices.c | 12 ++++++++++++ - 1 file changed, 12 insertions(+) - -diff --git a/dix/devices.c b/dix/devices.c -index 389d28a23..84a6406d1 100644 ---- a/dix/devices.c -+++ b/dix/devices.c -@@ -483,6 +483,13 @@ DisableDevice(DeviceIntPtr dev, BOOL sendevent) - flags[other->id] |= XISlaveDetached; - } - } -+ -+ for (other = inputInfo.off_devices; other; other = other->next) { -+ if (!IsMaster(other) && GetMaster(other, MASTER_ATTACHED) == dev) { -+ AttachDevice(NULL, other, NULL); -+ flags[other->id] |= XISlaveDetached; -+ } -+ } - } - else { - for (other = inputInfo.devices; other; other = other->next) { -@@ -1088,6 +1095,11 @@ CloseDownDevices(void) - dev->master = NULL; - } - -+ for (dev = inputInfo.off_devices; dev; dev = dev->next) { -+ if (!IsMaster(dev) && !IsFloating(dev)) -+ dev->master = NULL; -+ } -+ - CloseDeviceList(&inputInfo.devices); - CloseDeviceList(&inputInfo.off_devices); - --- -2.43.0 - diff --git a/0007-xkb-reset-the-radio_groups-pointer-to-NULL-after-fre.patch b/0007-xkb-reset-the-radio_groups-pointer-to-NULL-after-fre.patch deleted file mode 100644 index c6b2352..0000000 --- a/0007-xkb-reset-the-radio_groups-pointer-to-NULL-after-fre.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 774260dbae1fa505cd2848c786baed9a8db5179d Mon Sep 17 00:00:00 2001 -From: Peter Hutterer -Date: Mon, 5 Dec 2022 15:55:54 +1000 -Subject: [PATCH xserver 7/7] xkb: reset the radio_groups pointer to NULL after - freeing it - -Unlike other elements of the keymap, this pointer was freed but not -reset. On a subsequent XkbGetKbdByName request, the server may access -already freed memory. - -CVE-2022-46283, ZDI-CAN-19530 - -This vulnerability was discovered by: -Jan-Niklas Sohn working with Trend Micro Zero Day Initiative - -Signed-off-by: Peter Hutterer -Acked-by: Olivier Fourdan ---- - xkb/xkbUtils.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/xkb/xkbUtils.c b/xkb/xkbUtils.c -index dd089c2046..3f5791a183 100644 ---- a/xkb/xkbUtils.c -+++ b/xkb/xkbUtils.c -@@ -1326,6 +1326,7 @@ _XkbCopyNames(XkbDescPtr src, XkbDescPtr dst) - } - else { - free(dst->names->radio_groups); -+ dst->names->radio_groups = NULL; - } - dst->names->num_rg = src->names->num_rg; - --- -2.38.1 - diff --git a/0008-Xext-fix-invalid-event-type-mask-in-XTestSwapFakeInp.patch b/0008-Xext-fix-invalid-event-type-mask-in-XTestSwapFakeInp.patch deleted file mode 100644 index c84d387..0000000 --- a/0008-Xext-fix-invalid-event-type-mask-in-XTestSwapFakeInp.patch +++ /dev/null @@ -1,35 +0,0 @@ -From bb1711b7fba42f2a0c7d1c09beee241a1b2bcc30 Mon Sep 17 00:00:00 2001 -From: Peter Hutterer -Date: Mon, 19 Dec 2022 10:06:45 +1000 -Subject: [PATCH xserver] Xext: fix invalid event type mask in - XTestSwapFakeInput - -In commit b320ca0 the mask was inadvertently changed from octal 0177 to -hexadecimal 0x177. - -Fixes commit b320ca0ffe4c0c872eeb3a93d9bde21f765c7c63 - Xtest: disallow GenericEvents in XTestSwapFakeInput - -Found by Stuart Cassoff - -Signed-off-by: Peter Hutterer ---- - Xext/xtest.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/Xext/xtest.c b/Xext/xtest.c -index 2985a4ce6e..dde5c4cf9d 100644 ---- a/Xext/xtest.c -+++ b/Xext/xtest.c -@@ -502,7 +502,7 @@ XTestSwapFakeInput(ClientPtr client, xReq * req) - - nev = ((req->length << 2) - sizeof(xReq)) / sizeof(xEvent); - for (ev = (xEvent *) &req[1]; --nev >= 0; ev++) { -- int evtype = ev->u.u.type & 0x177; -+ int evtype = ev->u.u.type & 0177; - /* Swap event */ - proc = EventSwapVector[evtype]; - /* no swapping proc; invalid event type? */ --- -2.38.1 - diff --git a/0008-glx-Call-XACE-hooks-on-the-GLX-buffer.patch b/0008-glx-Call-XACE-hooks-on-the-GLX-buffer.patch deleted file mode 100644 index 0e9e4a0..0000000 --- a/0008-glx-Call-XACE-hooks-on-the-GLX-buffer.patch +++ /dev/null @@ -1,60 +0,0 @@ -From e5e8586a12a3ec915673edffa10dc8fe5e15dac3 Mon Sep 17 00:00:00 2001 -From: Olivier Fourdan -Date: Wed, 6 Dec 2023 12:09:41 +0100 -Subject: [PATCH 8/9] glx: Call XACE hooks on the GLX buffer - -The XSELINUX code will label resources at creation by checking the -access mode. When the access mode is DixCreateAccess, it will call the -function to label the new resource SELinuxLabelResource(). - -However, GLX buffers do not go through the XACE hooks when created, -hence leaving the resource actually unlabeled. - -When, later, the client tries to create another resource using that -drawable (like a GC for example), the XSELINUX code would try to use -the security ID of that object which has never been labeled, get a NULL -pointer and crash when checking whether the requested permissions are -granted for subject security ID. - -To avoid the issue, make sure to call the XACE hooks when creating the -GLX buffers. - -Credit goes to Donn Seeley for providing the patch. - -CVE-2024-0408 - -Signed-off-by: Olivier Fourdan -Acked-by: Peter Hutterer ---- - glx/glxcmds.c | 8 ++++++++ - 1 file changed, 8 insertions(+) - -diff --git a/glx/glxcmds.c b/glx/glxcmds.c -index fc26a2e34..1e46d0c72 100644 ---- a/glx/glxcmds.c -+++ b/glx/glxcmds.c -@@ -48,6 +48,7 @@ - #include "indirect_util.h" - #include "protocol-versions.h" - #include "glxvndabi.h" -+#include "xace.h" - - static char GLXServerVendorName[] = "SGI"; - -@@ -1392,6 +1393,13 @@ DoCreatePbuffer(ClientPtr client, int screenNum, XID fbconfigId, - if (!pPixmap) - return BadAlloc; - -+ err = XaceHook(XACE_RESOURCE_ACCESS, client, glxDrawableId, RT_PIXMAP, -+ pPixmap, RT_NONE, NULL, DixCreateAccess); -+ if (err != Success) { -+ (*pGlxScreen->pScreen->DestroyPixmap) (pPixmap); -+ return err; -+ } -+ - /* Assign the pixmap the same id as the pbuffer and add it as a - * resource so it and the DRI2 drawable will be reclaimed when the - * pbuffer is destroyed. */ --- -2.43.0 - diff --git a/0009-ephyr-xwayland-Use-the-proper-private-key-for-cursor.patch b/0009-ephyr-xwayland-Use-the-proper-private-key-for-cursor.patch deleted file mode 100644 index 5fa80fd..0000000 --- a/0009-ephyr-xwayland-Use-the-proper-private-key-for-cursor.patch +++ /dev/null @@ -1,56 +0,0 @@ -From 2ef0f1116c65d5cb06d7b6d83f8a1aea702c94f7 Mon Sep 17 00:00:00 2001 -From: Olivier Fourdan -Date: Wed, 6 Dec 2023 11:51:56 +0100 -Subject: [PATCH 9/9] ephyr,xwayland: Use the proper private key for cursor - -The cursor in DIX is actually split in two parts, the cursor itself and -the cursor bits, each with their own devPrivates. - -The cursor itself includes the cursor bits, meaning that the cursor bits -devPrivates in within structure of the cursor. - -Both Xephyr and Xwayland were using the private key for the cursor bits -to store the data for the cursor, and when using XSELINUX which comes -with its own special devPrivates, the data stored in that cursor bits' -devPrivates would interfere with the XSELINUX devPrivates data and the -SELINUX security ID would point to some other unrelated data, causing a -crash in the XSELINUX code when trying to (re)use the security ID. - -CVE-2024-0409 - -Signed-off-by: Olivier Fourdan -Reviewed-by: Peter Hutterer ---- - hw/kdrive/ephyr/ephyrcursor.c | 2 +- - hw/xwayland/xwayland-cursor.c | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/hw/kdrive/ephyr/ephyrcursor.c b/hw/kdrive/ephyr/ephyrcursor.c -index f991899c5..3f192d034 100644 ---- a/hw/kdrive/ephyr/ephyrcursor.c -+++ b/hw/kdrive/ephyr/ephyrcursor.c -@@ -246,7 +246,7 @@ miPointerSpriteFuncRec EphyrPointerSpriteFuncs = { - Bool - ephyrCursorInit(ScreenPtr screen) - { -- if (!dixRegisterPrivateKey(&ephyrCursorPrivateKey, PRIVATE_CURSOR_BITS, -+ if (!dixRegisterPrivateKey(&ephyrCursorPrivateKey, PRIVATE_CURSOR, - sizeof(ephyrCursorRec))) - return FALSE; - -diff --git a/hw/xwayland/xwayland-cursor.c b/hw/xwayland/xwayland-cursor.c -index e3c1aaa50..bd94b0cfb 100644 ---- a/hw/xwayland/xwayland-cursor.c -+++ b/hw/xwayland/xwayland-cursor.c -@@ -431,7 +431,7 @@ static miPointerScreenFuncRec xwl_pointer_screen_funcs = { - Bool - xwl_screen_init_cursor(struct xwl_screen *xwl_screen) - { -- if (!dixRegisterPrivateKey(&xwl_cursor_private_key, PRIVATE_CURSOR_BITS, 0)) -+ if (!dixRegisterPrivateKey(&xwl_cursor_private_key, PRIVATE_CURSOR, 0)) - return FALSE; - - return miPointerInitialize(xwl_screen->screen, --- -2.43.0 - diff --git a/xorg-x11-server-fb-access-wrapper.patch b/xorg-x11-server-fb-access-wrapper.patch deleted file mode 100644 index 7bb0e23..0000000 --- a/xorg-x11-server-fb-access-wrapper.patch +++ /dev/null @@ -1,31 +0,0 @@ -fb: Declare wfbFinishScreenInit, wfbScreenInit for !FB_ACCESS_WRAPPER - -xorg-x11-drv-nouveau wfbScreenInit without defining FB_ACCESS_WRAPPER -(which has other unintended side effects). Presently, this compiles -and links because compilers still support implicit function -declarations, but this is going to change fairly soon. This seems to -be the most straightforward change to keep the driver building. - -Submitted upstream: - - - -diff -ur xorg-server-1.20.14.orig/fb/fb.h xorg-server-1.20.14/fb/fb.h ---- xorg-server-1.20.14.orig/fb/fb.h 2021-12-15 20:01:24.000000000 +0100 -+++ xorg-server-1.20.14/fb/fb.h 2023-04-13 13:59:47.325341537 +0200 -@@ -1027,7 +1027,6 @@ - int dpiy, int width, /* pixel width of frame buffer */ - int bpp); /* bits per pixel of frame buffer */ - --#ifdef FB_ACCESS_WRAPPER - extern _X_EXPORT Bool - wfbFinishScreenInit(ScreenPtr pScreen, - void *pbits, -@@ -1049,7 +1048,6 @@ - int width, - int bpp, - SetupWrapProcPtr setupWrap, FinishWrapProcPtr finishWrap); --#endif - - extern _X_EXPORT Bool - fbFinishScreenInit(ScreenPtr pScreen, From fefea377b3789bdcdd7345092505e59bdde84cc3 Mon Sep 17 00:00:00 2001 From: Simone Caronni Date: Thu, 26 Sep 2024 22:12:11 +0200 Subject: [PATCH 107/131] Spec file update - Drop support for building snapshots. - Drop custom cflags. - Trim changelog. --- Makefile | 30 --- commitid | 1 - gitignore | 306 ------------------------- import.log | 6 - make-git-snapshot.sh | 17 -- xorg-x11-server.spec | 372 +------------------------------ xserver-sdk-abi-requires.git | 14 -- xserver-sdk-abi-requires.release | 19 -- 8 files changed, 10 insertions(+), 755 deletions(-) delete mode 100644 Makefile delete mode 100644 commitid delete mode 100644 gitignore delete mode 100644 import.log delete mode 100755 make-git-snapshot.sh delete mode 100755 xserver-sdk-abi-requires.git delete mode 100755 xserver-sdk-abi-requires.release diff --git a/Makefile b/Makefile deleted file mode 100644 index 4041668..0000000 --- a/Makefile +++ /dev/null @@ -1,30 +0,0 @@ -# Makefile for source rpm: xorg-x11-server -# $Id$ -NAME := xorg-x11-server -SPECFILE = $(firstword $(wildcard *.spec)) - -define find-makefile-common -for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$d/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done -endef - -MAKEFILE_COMMON := $(shell $(find-makefile-common)) - -ifeq ($(MAKEFILE_COMMON),) -# attempt a checkout -define checkout-makefile-common -test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2 -endef - -MAKEFILE_COMMON := $(shell $(checkout-makefile-common)) -endif - -include $(MAKEFILE_COMMON) - -ifeq ($(MAKECMDGOALS),me a sandwich) -.PHONY :: me a sandwich -me a: - @: - -sandwich: - @[ `id -u` -ne 0 ] && echo "What? Make it yourself." || echo Okay. -endif diff --git a/commitid b/commitid deleted file mode 100644 index 7420e41..0000000 --- a/commitid +++ /dev/null @@ -1 +0,0 @@ -d13cb974426f7f1110b0bdb08c4ebb46ff8975f7 diff --git a/gitignore b/gitignore deleted file mode 100644 index 524cfc6..0000000 --- a/gitignore +++ /dev/null @@ -1,306 +0,0 @@ -Makefile -Makefile.in -.deps -.libs -.msg -*.lo -*.la -*.a -*.o -*~ -.*sw? -*.pbxuser -*.mode1v3 -obj* -build* -local -aclocal.m4 -autom4te.cache -compile -config.guess -config.log -config.status -config.sub -configure -configure.lineno -depcomp -install-sh -libtool -ltmain.sh -missing -TAGS -tags -ylwrap -xorg-server.pc -stamp-h? -do-not-use-config.h -do-not-use-config.h.in -afb/afbbltC.c -afb/afbbltCI.c -afb/afbbltG.c -afb/afbbltO.c -afb/afbbltX.c -afb/afbseg.c -afb/afbtileC.c -afb/afbtileG.c -cfb/cfb8lineCO.c -cfb/cfb8lineCP.c -cfb/cfb8lineG.c -cfb/cfb8lineX.c -cfb/cfb8segC.c -cfb/cfb8segCS.c -cfb/cfb8segX.c -cfb/cfb8setG.c -cfb/cfbbltC.c -cfb/cfbbltG.c -cfb/cfbbltO.c -cfb/cfbbltX.c -cfb/cfbfillarcC.c -cfb/cfbfillarcG.c -cfb/cfbglrop8.c -cfb/cfbply1rctC.c -cfb/cfbply1rctG.c -cfb/cfbseg.c -cfb/cfbsolidC.c -cfb/cfbsolidG.c -cfb/cfbsolidX.c -cfb/cfbtile32C.c -cfb/cfbtile32G.c -cfb/cfbtileoddC.c -cfb/cfbtileoddG.c -cfb/cfbzerarcC.c -cfb/cfbzerarcG.c -cfb/cfbzerarcX.c -cfb32/cfb8lineCO.c -cfb32/cfb8lineCP.c -cfb32/cfb8lineG.c -cfb32/cfb8lineX.c -cfb32/cfb8segC.c -cfb32/cfb8segCS.c -cfb32/cfb8segX.c -cfb32/cfb8setG.c -cfb32/cfbbltC.c -cfb32/cfbbltG.c -cfb32/cfbbltO.c -cfb32/cfbbltX.c -cfb32/cfbfillarcC.c -cfb32/cfbfillarcG.c -cfb32/cfbply1rctC.c -cfb32/cfbply1rctG.c -cfb32/cfbseg.c -cfb32/cfbsolidC.c -cfb32/cfbsolidG.c -cfb32/cfbsolidX.c -cfb32/cfbtile32C.c -cfb32/cfbtile32G.c -cfb32/cfbtileoddC.c -cfb32/cfbtileoddG.c -cfb32/cfbzerarcC.c -cfb32/cfbzerarcG.c -cfb32/cfbzerarcX.c -doc/Xserver.1x -doc/Xserver.man -hw/dmx/Xdmx -hw/dmx/Xdmx.1x -hw/dmx/config/dmxtodmx -hw/dmx/config/dmxtodmx.1x -hw/dmx/config/parser.c -hw/dmx/config/parser.h -hw/dmx/config/scanner.c -hw/dmx/config/vdltodmx -hw/dmx/config/vdltodmx.1x -hw/dmx/config/xdmxconfig -hw/dmx/config/xdmxconfig.1x -hw/dmx/examples/dmxaddinput -hw/dmx/examples/dmxaddscreen -hw/dmx/examples/dmxreconfig -hw/dmx/examples/dmxresize -hw/dmx/examples/dmxrminput -hw/dmx/examples/dmxrmscreen -hw/dmx/examples/dmxwininfo -hw/dmx/examples/ev -hw/dmx/examples/evi -hw/dmx/examples/res -hw/dmx/examples/xbell -hw/dmx/examples/xdmx -hw/dmx/examples/xinput -hw/dmx/examples/xled -hw/dmx/examples/xtest -hw/kdrive/ati/Xati -hw/kdrive/chips/Xchips -hw/kdrive/ephyr/Xephyr -hw/kdrive/epson/Xepson -hw/kdrive/fake/Xfake -hw/kdrive/fbdev/Xfbdev -hw/kdrive/i810/Xi810 -hw/kdrive/mach64/Xmach64 -hw/kdrive/mga/Xmga -hw/kdrive/neomagic/Xneomagic -hw/kdrive/nvidia/Xnvidia -hw/kdrive/pm2/Xpm2 -hw/kdrive/r128/Xr128 -hw/kdrive/sdl/Xsdl -hw/kdrive/sis300/Xsis -hw/kdrive/smi/Xsmi -hw/kdrive/vesa/Xvesa -hw/kdrive/via/Xvia -hw/vfb/Xvfb -hw/vfb/Xvfb.1x -hw/vfb/Xvfb.man -hw/xfree86/Xorg -hw/xfree86/common/xf86Build.h -hw/xfree86/common/xf86DefModeSet.c -hw/xfree86/doc/man/Xorg.1x -hw/xfree86/doc/man/Xorg.man -hw/xfree86/doc/man/xorg.conf.5x -hw/xfree86/doc/man/xorg.conf.man -hw/xfree86/exa/exa.4 -hw/xfree86/exa/exa.4x -hw/xfree86/exa/exa.man -hw/xfree86/fbdevhw/fbdevhw.4x -hw/xfree86/fbdevhw/fbdevhw.man -hw/xfree86/getconfig/cfg.man -hw/xfree86/getconfig/getconfig.1x -hw/xfree86/getconfig/getconfig.5x -hw/xfree86/getconfig/getconfig.man -hw/xfree86/os-support/xorgos.c -hw/xfree86/osandcommon.c -hw/xfree86/ramdac/xf86BitOrder.c -hw/xfree86/scanpci/xf86PciData.c -hw/xfree86/scanpci/xf86PciIds.h -hw/xfree86/utils/cvt/cvt -hw/xfree86/utils/cvt/cvt.man -hw/xfree86/utils/gtf/gtf -hw/xfree86/utils/gtf/gtf.1x -hw/xfree86/utils/gtf/gtf.man -hw/xfree86/utils/ioport/inb -hw/xfree86/utils/ioport/inl -hw/xfree86/utils/ioport/inw -hw/xfree86/utils/ioport/ioport -hw/xfree86/utils/ioport/outb -hw/xfree86/utils/ioport/outl -hw/xfree86/utils/ioport/outw -hw/xfree86/utils/pcitweak/pcitweak -hw/xfree86/utils/pcitweak/pcitweak.1x -hw/xfree86/utils/pcitweak/pcitweak.man -hw/xfree86/utils/scanpci/scanpci -hw/xfree86/utils/scanpci/scanpci.1x -hw/xfree86/utils/scanpci/scanpci.man -hw/xfree86/utils/xorgcfg/XOrgCfg -hw/xfree86/utils/xorgcfg/xorgcfg -hw/xfree86/utils/xorgcfg/xorgcfg.1x -hw/xfree86/utils/xorgcfg/xorgcfg.man -hw/xfree86/utils/xorgconfig/xorgconfig -hw/xfree86/utils/xorgconfig/xorgconfig.1x -hw/xfree86/utils/xorgconfig/xorgconfig.man -hw/xfree86/xaa/l-xaaBitmap.c -hw/xfree86/xaa/l-xaaStipple.c -hw/xfree86/xaa/l-xaaTEGlyph.c -hw/xfree86/xaa/l3-xaaBitmap.c -hw/xfree86/xaa/l3-xaaStipple.c -hw/xfree86/xaa/lf-xaaBitmap.c -hw/xfree86/xaa/lf-xaaStipple.c -hw/xfree86/xaa/lf-xaaTEGlyph.c -hw/xfree86/xaa/lf3-xaaBitmap.c -hw/xfree86/xaa/lf3-xaaStipple.c -hw/xfree86/xaa/m-xaaBitmap.c -hw/xfree86/xaa/m-xaaStipple.c -hw/xfree86/xaa/m-xaaTEGlyph.c -hw/xfree86/xaa/m3-xaaBitmap.c -hw/xfree86/xaa/m3-xaaStipple.c -hw/xfree86/xaa/mf-xaaBitmap.c -hw/xfree86/xaa/mf-xaaStipple.c -hw/xfree86/xaa/mf-xaaTEGlyph.c -hw/xfree86/xaa/mf3-xaaBitmap.c -hw/xfree86/xaa/mf3-xaaStipple.c -hw/xfree86/xaa/s-xaaDashLine.c -hw/xfree86/xaa/s-xaaLine.c -hw/xfree86/xf1bpp/maskbits.c -hw/xfree86/xf1bpp/mfbbitblt.c -hw/xfree86/xf1bpp/mfbbltC.c -hw/xfree86/xf1bpp/mfbbltCI.c -hw/xfree86/xf1bpp/mfbbltG.c -hw/xfree86/xf1bpp/mfbbltO.c -hw/xfree86/xf1bpp/mfbbltX.c -hw/xfree86/xf1bpp/mfbbres.c -hw/xfree86/xf1bpp/mfbbresd.c -hw/xfree86/xf1bpp/mfbclip.c -hw/xfree86/xf1bpp/mfbcmap.c -hw/xfree86/xf1bpp/mfbfillarc.c -hw/xfree86/xf1bpp/mfbfillrct.c -hw/xfree86/xf1bpp/mfbfillsp.c -hw/xfree86/xf1bpp/mfbfont.c -hw/xfree86/xf1bpp/mfbgc.c -hw/xfree86/xf1bpp/mfbgetsp.c -hw/xfree86/xf1bpp/mfbigbblak.c -hw/xfree86/xf1bpp/mfbigbwht.c -hw/xfree86/xf1bpp/mfbhrzvert.c -hw/xfree86/xf1bpp/mfbimage.c -hw/xfree86/xf1bpp/mfbline.c -hw/xfree86/xf1bpp/mfbmisc.c -hw/xfree86/xf1bpp/mfbpablack.c -hw/xfree86/xf1bpp/mfbpainv.c -hw/xfree86/xf1bpp/mfbpawhite.c -hw/xfree86/xf1bpp/mfbpgbblak.c -hw/xfree86/xf1bpp/mfbpgbinv.c -hw/xfree86/xf1bpp/mfbpgbwht.c -hw/xfree86/xf1bpp/mfbpixmap.c -hw/xfree86/xf1bpp/mfbplyblack.c -hw/xfree86/xf1bpp/mfbplyinv.c -hw/xfree86/xf1bpp/mfbplywhite.c -hw/xfree86/xf1bpp/mfbpntwin.c -hw/xfree86/xf1bpp/mfbpolypnt.c -hw/xfree86/xf1bpp/mfbpushpxl.c -hw/xfree86/xf1bpp/mfbscrclse.c -hw/xfree86/xf1bpp/mfbscrinit.c -hw/xfree86/xf1bpp/mfbseg.c -hw/xfree86/xf1bpp/mfbsetsp.c -hw/xfree86/xf1bpp/mfbteblack.c -hw/xfree86/xf1bpp/mfbtewhite.c -hw/xfree86/xf1bpp/mfbtileC.c -hw/xfree86/xf1bpp/mfbtileG.c -hw/xfree86/xf1bpp/mfbwindow.c -hw/xfree86/xf1bpp/mfbzerarc.c -hw/xfree86/xf4bpp/mfbseg.c -hw/xfree86/xf8_32bpp/cfbgc32.c -hw/xfree86/xf8_32bpp/cfbgc8.c -hw/xfree86/xorg.c -hw/xfree86/xorg.conf.example -hw/xfree86/xorg.conf.example.pre -hw/xnest/Xnest -hw/xnest/Xnest.1x -hw/xnest/Xnest.man -hw/xprint/Xprt -hw/xprint/config/C/print/Xprinters.ghostscript -hw/xprint/doc/Xprt.1x -hw/xprint/doc/Xprt.man -hw/xprint/dpmsstubs-wrapper.c -hw/xprint/miinitext-wrapper.c -include/dix-config.h -include/kdrive-config.h -include/xgl-config.h -include/xkb-config.h -include/xorg-config.h -include/xorg-server.h -include/xwin-config.h -mfb/mfbbltC.c -mfb/mfbbltCI.c -mfb/mfbbltG.c -mfb/mfbbltO.c -mfb/mfbbltX.c -mfb/mfbigbblak.c -mfb/mfbigbwht.c -mfb/mfbpablack.c -mfb/mfbpainv.c -mfb/mfbpawhite.c -mfb/mfbpgbblak.c -mfb/mfbpgbinv.c -mfb/mfbpgbwht.c -mfb/mfbplyblack.c -mfb/mfbplyinv.c -mfb/mfbplywhite.c -mfb/mfbseg.c -mfb/mfbteblack.c -mfb/mfbtewhite.c -mfb/mfbtileC.c -mfb/mfbtileG.c diff --git a/import.log b/import.log deleted file mode 100644 index 782e371..0000000 --- a/import.log +++ /dev/null @@ -1,6 +0,0 @@ -xorg-x11-server-1_5_0-1_fc10:HEAD:xorg-x11-server-1.5.0-1.fc10.src.rpm:1220485219 -xorg-x11-server-1_5_1-1_fc10:HEAD:xorg-x11-server-1.5.1-1.fc10.src.rpm:1222198557 -xorg-x11-server-1_5_2-1_fc10:HEAD:xorg-x11-server-1.5.2-1.fc10.src.rpm:1223667007 -xorg-x11-server-1_5_3-1_fc10:HEAD:xorg-x11-server-1.5.3-1.fc10.src.rpm:1225918317 -xorg-x11-server-1_6_0-1_fc11:HEAD:xorg-x11-server-1.6.0-1.fc11.src.rpm:1235594175 -xorg-x11-server-1_6_1-1_fc11:HEAD:xorg-x11-server-1.6.1-1.fc11.src.rpm:1239742477 diff --git a/make-git-snapshot.sh b/make-git-snapshot.sh deleted file mode 100755 index 0d9b2ad..0000000 --- a/make-git-snapshot.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh - -DIRNAME=xorg-server-$( date +%Y%m%d ) - -rm -rf $DIRNAME -git clone git://git.freedesktop.org/git/xorg/xserver $DIRNAME -cd $DIRNAME -if [ -z "$1" ]; then - git log | head -1 -else - git checkout $1 -fi -git log | head -1 | awk '{ print $2 }' > ../commitid -git repack -a -d -cd .. -tar cf - $DIRNAME | xz -c9 > $DIRNAME.tar.xz -rm -rf $DIRNAME diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 01c5b1f..3f514a5 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -1,21 +1,7 @@ -# This package is an experiment in active integration of upstream SCM with -# Fedora packaging. It works something like this: -# -# The "pristine" source is actually a git repo (with no working checkout). -# The first step of %%prep is to check it out and switch to a "fedora" branch. -# If you need to add a patch to the server, just do it like a normal git -# operation, dump it with git-format-patch to a file in the standard naming -# format, and add a PatchN: line. If you want to push something upstream, -# check out the master branch, pull, cherry-pick, and push. - # X.org requires lazy relocations to work. %undefine _hardened_build %undefine _strict_symbol_defs_build -#global gitdate 20161026 -%global stable_abi 1 - -%if !0%{?gitdate} || %{stable_abi} # Released ABI versions. Have to keep these manually in sync with the # source because rpm is a terrible language. %global ansic_major 0 @@ -26,43 +12,18 @@ %global xinput_minor 4 %global extension_major 10 %global extension_minor 0 -%endif - -%if 0%{?gitdate} -# For git snapshots, use date for major and a serial number for minor -%global minor_serial 0 -%global git_ansic_major %{gitdate} -%global git_ansic_minor %{minor_serial} -%global git_videodrv_major %{gitdate} -%global git_videodrv_minor %{minor_serial} -%global git_xinput_major %{gitdate} -%global git_xinput_minor %{minor_serial} -%global git_extension_major %{gitdate} -%global git_extension_minor %{minor_serial} -%endif %global pkgname xorg-server Summary: X.Org X11 X server Name: xorg-x11-server Version: 21.1.13 -Release: 1%{?gitdate:.%{gitdate}}%{?dist} +Release: 2%{?dist} URL: http://www.x.org # SPDX License: Adobe-Display-PostScript AND BSD-3-Clause AND DEC-3-Clause AND HPND AND HPND-sell-MIT-disclaimer-xserver AND HPND-sell-variant AND ICU AND ISC AND MIT AND MIT-open-group AND NTP AND SGI-B-2.0 AND SMLNJ AND X11 AND X11-distribute-modifications-variant -#VCS: git:git://git.freedesktop.org/git/xorg/xserver -%if 0%{?gitdate} -# git snapshot. to recreate, run: -# ./make-git-snapshot.sh `cat commitid` -Source0: xorg-server-%{gitdate}.tar.xz -#Source0: http://www.x.org/pub/individual/xserver/%{pkgname}-%{version}.tar.bz2 -Source1: make-git-snapshot.sh -Source2: commitid -%else Source0: https://www.x.org/pub/individual/xserver/%{pkgname}-%{version}.tar.xz -Source1: gitignore -%endif Source10: xserver.pamd @@ -70,8 +31,7 @@ Source10: xserver.pamd Source20: http://svn.exactcode.de/t2/trunk/package/xorg/xorg-server/xvfb-run.sh # for requires generation in drivers -Source30: xserver-sdk-abi-requires.release -Source31: xserver-sdk-abi-requires.git +Source30: xserver-sdk-abi-requires # maintainer convenience script Source40: driver-abi-rebuild.sh @@ -80,24 +40,17 @@ Source40: driver-abi-rebuild.sh Patch1: 06_use-intel-only-on-pre-gen4.diff # Default to xf86-video-modesetting on GeForce 8 and newer Patch2: 0001-xfree86-use-modesetting-driver-by-default-on-GeForce.patch - # Default to va_gl on intel i965 as we use the modesetting drv there # va_gl should probably just be the default everywhere ? Patch3: 0001-xf86-dri2-Use-va_gl-as-vdpau_driver-for-Intel-i965-G.patch - # because the display-managers are not ready yet, do not upstream Patch6: 0001-Fedora-hack-Make-the-suid-root-wrapper-always-start-.patch - # Not sure anyone else cares about this so let's keep this Fedora-only for now # Upstream PR for the meson.build equivalent is here, so we can drop this patch # when we start building with meson. # https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1001` Patch7: 0001-configure.ac-search-for-the-fontrootdir-ourselves.patch - -# Backports from current stable "server-21.1-branch": -# - -# Fix compilation error on i686 +# Fix compilation error on i686 (21.1.14+) # https://gitlab.freedesktop.org/xorg/xserver/-/commit/8407181c7dfe14086d99697af0b86120320ab73e Patch1024: 0001-ephyr-Fix-incompatible-pointer-type-build-error.patch @@ -183,18 +136,10 @@ Provides: Xserver # HdG: This should be moved to the wrapper package once the wrapper gets # its own sub-package: Provides: xorg-x11-server-wrapper = %{version}-%{release} -%if !0%{?gitdate} || %{stable_abi} Provides: xserver-abi(ansic-%{ansic_major}) = %{ansic_minor} Provides: xserver-abi(videodrv-%{videodrv_major}) = %{videodrv_minor} Provides: xserver-abi(xinput-%{xinput_major}) = %{xinput_minor} Provides: xserver-abi(extension-%{extension_major}) = %{extension_minor} -%endif -%if 0%{?gitdate} -Provides: xserver-abi(ansic-%{git_ansic_major}) = %{git_ansic_minor} -Provides: xserver-abi(videodrv-%{git_videodrv_major}) = %{git_videodrv_minor} -Provides: xserver-abi(xinput-%{git_xinput_major}) = %{git_xinput_minor} -Provides: xserver-abi(extension-%{git_extension_major}) = %{git_extension_minor} -%endif Obsoletes: xorg-x11-glamor < %{version}-%{release} Provides: xorg-x11-glamor = %{version}-%{release} Obsoletes: xorg-x11-drv-modesetting < %{version}-%{release} @@ -290,16 +235,8 @@ Xserver source code needed to build VNC server (Xvnc) %prep -%autosetup -N -n %{pkgname}-%{?gitdate:%{gitdate}}%{!?gitdate:%{version}} -rm -rf .git -cp %{SOURCE1} .gitignore -%global _default_patch_flags -f -# ick -#%%global __scm git -#%%{expand:%%__scm_setup_git -q} -%autopatch -p1 +%autosetup -p1 -n %{pkgname}-%{version} -%if 0%{?stable_abi} # check the ABI in the source against what we expect. getmajor() { grep -i ^#define.ABI.$1_VERSION hw/xfree86/common/xf86Module.h | @@ -320,14 +257,8 @@ test `getminor xinput` == %{xinput_minor} test `getmajor extension` == %{extension_major} test `getminor extension` == %{extension_minor} -%endif - %build -export CFLAGS="$RPM_OPT_FLAGS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1" -export CXXFLAGS="$RPM_OPT_FLAGS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1" -export LDFLAGS="$RPM_LD_FLAGS -specs=/usr/lib/rpm/redhat/redhat-hardened-ld" - %if !0%{?rhel} %ifarch %{ix86} x86_64 %global int10_arch 1 @@ -381,13 +312,7 @@ install -m 644 %{SOURCE10} $RPM_BUILD_ROOT%{_sysconfdir}/pam.d/xserver # relies on it more or less. mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/X11/xorg.conf.d -%if %{stable_abi} install -m 755 %{SOURCE30} $RPM_BUILD_ROOT%{_bindir}/xserver-sdk-abi-requires -%else -sed -e s/@MAJOR@/%{gitdate}/g -e s/@MINOR@/%{minor_serial}/g %{SOURCE31} > \ - $RPM_BUILD_ROOT%{_bindir}/xserver-sdk-abi-requires -chmod 755 $RPM_BUILD_ROOT%{_bindir}/xserver-sdk-abi-requires -%endif install -m 0755 %{SOURCE20} $RPM_BUILD_ROOT%{_bindir}/xvfb-run @@ -502,6 +427,12 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Thu Sep 26 2024 Simone Caronni - 21.1.13-2 +- Drop support for building snapshots. If they need to be built, there are + anyway more simpler ways. +- Trim changelog. +- Drop custom compileri/linker flags that are part of the standard already. + * Mon Sep 02 2024 Sérgio Basto - 21.1.13-1 - Update X11-server to 21.1.13 and ABI numbers of videodrv and xinput - DMX DDX was dropped @@ -626,286 +557,3 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete * Sat Jan 22 2022 Fedora Release Engineering - 1.20.14-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild - -* Fri Dec 17 2021 Olivier - 1.20.14-1 -- xserver 1.20.14 - CVE-2021-4008/ZDI-CAN-14192 (#2026059, #2032941) - CVE-2021-4009/ZDI-CAN-14950 (#2026072, #2032943) - CVE-2021-4010/ZDI-CAN-14951 (#2026073, #2032944) - CVE-2021-4011/ZDI-CAN-14952 (#2026074, #2032945) - -* Tue Sep 14 2021 Sahana Prasad - 1.20.11-3 -- Rebuilt with OpenSSL 3.0.0 - -* Fri Jul 23 2021 Fedora Release Engineering - 1.20.11-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild - -* Wed Apr 14 2021 Olivier Fourdan - 1.20.11-1 -- xserver 1.20.11 (CVE-2021-3472 / ZDI-CAN-1259) - -* Wed Feb 03 2021 Peter Hutterer 1.20.10-5 -- Drop BuildRequires for flex-devel (#1871101) - -* Mon Feb 1 2021 Olivier Fourdan - 1.20.10-4 -- Remove Xwayland from the xserver builds - -* Thu Jan 28 2021 Fedora Release Engineering - 1.20.10-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild - -* Tue Jan 19 2021 Adam Jackson - 1.20.10-2 -- Disable int10 and vbe on RHEL -- Disable DRI1 -- Stop overriding the vendor name - -* Wed Dec 2 2020 Olivier Fourdan - 1.20.10-1 -- xserver 1.20.10 (CVE-2020-14360, CVE-2020-25712) - -* Thu Nov 5 10:35:09 AEST 2020 Peter Hutterer - 1.20.9-3 -- Add BuildRequires for make - -* Wed Nov 04 2020 Peter Hutterer 1.20.9-2 -- Drop BuildRequires to git-core only - -* Thu Oct 8 2020 Olivier Fourdan - 1.20.9-1 -- xserver 1.20.9 + all current fixes from upstream - -* Wed Aug 12 2020 Adam Jackson - 1.20.8-4 -- Enable XC-SECURITY - -* Fri Jul 31 2020 Adam Jackson - 1.20.8-3 -- Fix information disclosure bug in pixmap allocation (CVE-2020-14347) - -* Wed Jul 29 2020 Fedora Release Engineering - 1.20.8-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild - -* Mon Mar 30 2020 Olivier Fourdan - 1.20.8-1 -- xserver 1.20.8 -- Backport latest Xwayland randr resolution change emulation support - patches. - -* Wed Mar 18 2020 Olivier Fourdan - 1.20.7-2 -- Fix a crash on closing a window using Present found upstream: - https://gitlab.freedesktop.org/xorg/xserver/issues/1000 - -* Fri Mar 13 2020 Olivier Fourdan - 1.20.7-1 -- xserver 1.20.7 -- backport from stable "xserver-1.20-branch" up to commit ad7364d8d - (for mutter fullscreen unredirect on Wayland) -- Update videodrv minor ABI as 1.20.7 changed the minor ABI version - (backward compatible, API addition in glamor) -- Rebase Xwayland randr resolution change emulation support patches - -* Fri Jan 31 2020 Fedora Release Engineering - 1.20.6-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild - -* Mon Nov 25 2019 Olivier Fourdan - 1.20.6-1 -- xserver 1.20.6 - -* Mon Nov 4 2019 Hans de Goede - 1.20.5-9 -- Fix building with new libglvnd-1.2.0 (E)GL headers and pkgconfig files - -* Mon Nov 4 2019 Hans de Goede - 1.20.5-8 -- Backport Xwayland randr resolution change emulation support - -* Thu Aug 29 2019 Olivier Fourdan 1.20.5-7 -- Pick latest fixes from xserver stable branch upstream (rhbz#1729925) - -* Sat Jul 27 2019 Fedora Release Engineering - 1.20.5-6 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild - -* Mon Jul 8 2019 Olivier Fourdan 1.20.5-5 -- Do not include on ARM with glibc to avoid compilation failure. -- Do not force vbe and int10 sdk headers as this enables int10 which does - not build on ARM without - -* Mon Jul 8 2019 Olivier Fourdan 1.20.5-4 -- Fix regression causing screen tearing with upstream xserver 1.20.5 - (rhbz#1726419) - -* Fri Jun 28 2019 Olivier Fourdan 1.20.5-3 -- Remove atomic downstream patches causing regressions (#1714981, #1723715) -- Xwayland crashes (#1708119, #1691745) -- Cursor issue with tablet on Xwayland -- Xorg/modesetting issue with flipping pixmaps with Present (#1645553) - -* Thu Jun 06 2019 Peter Hutterer 1.20.5-2 -- Return AlreadyGrabbed for keycodes > 255 (#1697804) - -* Thu May 30 2019 Adam Jackson - 1.20.5-1 -- xserver 1.20.5 - -* Tue Apr 23 2019 Adam Jackson - 1.20.4-4 -- Fix some non-atomic modesetting calls to be atomic - -* Wed Mar 27 2019 Peter Hutterer 1.20.4-3 -- Fix a Qt scrolling bug, don't reset the valuator on slave switch - -* Thu Mar 21 2019 Adam Jackson - 1.20.4-2 -- Backport an Xwayland crash fix in the Present code - -* Tue Feb 26 2019 Adam Jackson - 1.20.4-1 -- xserver 1.20.4 - -* Sun Feb 03 2019 Fedora Release Engineering - 1.20.3-4 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild - -* Fri Jan 11 2019 Olivier Fourdan - 1.20.3-3 -- More Xwayland/Present fixes from upstream (rhbz#1609181, rhbz#1661748) - -* Thu Dec 06 2018 Olivier Fourdan - 1.20.3-2 -- Xwayland/Present fixes from master upstream - -* Thu Nov 01 2018 Adam Jackson - 1.20.3-1 -- xserver 1.20.3 - -* Mon Oct 15 2018 Adam Jackson - 1.20.2-1 -- xserver 1.20.2 - -* Thu Oct 4 2018 Hans de Goede - 1.20.1-4 -- Rebase patch to use va_gl as vdpau driver on i965 GPUs, re-fix rhbz#1413733 - -* Thu Sep 13 2018 Dave Airlie - 1.20.1-3 -- Build with PIE enabled (this doesn't enable bind now) - -* Mon Sep 10 2018 Olivier Fourdan - 1.20.1-2 -- Include patches from upstream to fix Xwayland crashes - -* Thu Aug 09 2018 Adam Jackson - 1.20.1-1 -- xserver 1.20.1 - -* Sat Jul 14 2018 Fedora Release Engineering - 1.20.0-5 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild - -* Tue Jun 12 2018 Adam Jackson - 1.20.0-4 -- Xorg and Xwayland Requires: libEGL - -* Fri Jun 01 2018 Adam Williamson - 1.20.0-3 -- Backport fixes for RHBZ#1579067 - -* Wed May 16 2018 Adam Jackson - 1.20.0-2 -- Xorg Requires: xorg-x11-drv-libinput - -* Thu May 10 2018 Adam Jackson - 1.20.0-1 -- xserver 1.20 - -* Wed Apr 25 2018 Adam Jackson - 1.19.99.905-2 -- Fix xvfb-run's default depth to be 24 - -* Tue Apr 24 2018 Adam Jackson - 1.19.99.905-1 -- xserver 1.20 RC5 - -* Thu Apr 12 2018 Olivier Fourdan - 1.19.99.904-2 -- Re-fix "use type instead of which in xvfb-run (rhbz#1443357)" which - was overridden inadvertently - -* Tue Apr 10 2018 Adam Jackson - 1.19.99.904-1 -- xserver 1.20 RC4 - -* Mon Apr 02 2018 Adam Jackson - 1.19.99.903-1 -- xserver 1.20 RC3 - -* Tue Feb 13 2018 Olivier Fourdan 1.19.6-5 -- xwayland: avoid race condition on new keymap -- xwayland: Keep separate variables for pointer and tablet foci (rhbz#1519961) -- xvfb-run now support command line option “--auto-display” - -* Fri Feb 09 2018 Fedora Release Engineering - 1.19.6-4 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild - -* Tue Jan 30 2018 Olivier Fourdan 1.19.6-3 -- Avoid generating a core file when the Wayland compositor is gone. - -* Thu Jan 11 2018 Peter Hutterer 1.19.6-2 -- Fix handling of devices with ID_INPUT=null - -* Wed Dec 20 2017 Adam Jackson - 1.19.6-1 -- xserver 1.19.6 - -* Thu Oct 12 2017 Adam Jackson - 1.19.5-1 -- xserver 1.19.5 - -* Thu Oct 05 2017 Olivier Fourdan - 1.19.4-1 -- xserver-1.19.4 -- Backport tablet support for Xwayland - -* Fri Sep 08 2017 Troy Dawson - 1.19.3-9 -- Cleanup spec file conditionals - -* Thu Aug 03 2017 Fedora Release Engineering - 1.19.3-8 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild - -* Thu Jul 27 2017 Fedora Release Engineering - 1.19.3-7 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild - -* Sun Jul 2 2017 Ville Skyttä - 1.19.3-6 -- Use type instead of which in xvfb-run (rhbz#1443357) - -* Thu May 04 2017 Orion Poplawski - 1.19.3-5 -- Enable full build for s390/x - -* Mon Apr 24 2017 Ben Skeggs - 1.19.3-4 -- Default to xf86-video-modesetting on GeForce 8 and newer - -* Fri Apr 07 2017 Adam Jackson - 1.19.3-3 -- Inoculate against a versioning bug with libdrm 2.4.78 - -* Thu Mar 23 2017 Hans de Goede - 1.19.3-2 -- Use va_gl as vdpau driver on i965 GPUs (rhbz#1413733) - -* Wed Mar 15 2017 Adam Jackson - 1.19.3-1 -- xserver 1.19.3 - -* Thu Mar 02 2017 Adam Jackson - 1.19.2-1 -- xserver 1.19.2 - -* Sat Feb 11 2017 Fedora Release Engineering - 1.19.1-4 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild - -* Wed Feb 01 2017 Peter Hutterer 1.19.1-3 -- Fix a few input thread lock issues causing intel crashes (#1384486) - -* Mon Jan 16 2017 Adam Jackson - 1.19.1-2 -- Limit the intel driver only on F26 and up - -* Wed Jan 11 2017 Adam Jackson - 1.19.1-1 -- xserver 1.19.1 - -* Tue Jan 10 2017 Hans de Goede - 1.19.0-4 -- Follow Debian and only default to the intel ddx on gen4 or older intel GPUs - -* Tue Dec 20 2016 Hans de Goede - 1.19.0-3 -- Add one more patch for better integration with the nvidia binary driver - -* Thu Dec 15 2016 Hans de Goede - 1.19.0-2 -- Add some patches for better integration with the nvidia binary driver -- Add a patch from upstream fixing a crash (rhbz#1389886) - -* Wed Nov 23 2016 Olivier Fourdan 1.19.0-1 -- xserver 1.19.0 -- Fix use after free of cursors in Xwayland (rhbz#1385258) -- Fix an issue where some monitors would show only black, or - partially black when secondary GPU outputs are used - -* Tue Nov 15 2016 Peter Hutterer 1.19.0-0.8.rc2 -- Update device barriers for new master devices (#1384432) - -* Thu Nov 3 2016 Hans de Goede - 1.19.0-0.7.rc2 -- Update to 1.19.0-rc2 -- Fix (hopefully) various crashes in FlushAllOutput() (rhbz#1382444) -- Fix Xwayland crashing in glamor on non glamor capable hw (rhbz#1390018) - -* Tue Nov 1 2016 Ben Crocker - 1.19.0-0.6.20161028 -- Fix Config record allocation during startup: if xorg.conf.d directory -- was absent, a segfault resulted. - -* Mon Oct 31 2016 Adam Jackson - 1.19.0-0.5.20161026 -- Use %%autopatch instead of doing our own custom git-am trick - -* Fri Oct 28 2016 Hans de Goede - 1.19.0-0.4.20161026 -- Add missing Requires: libXfont2-devel to -devel sub-package (rhbz#1389711) - -* Wed Oct 26 2016 Hans de Goede - 1.19.0-0.3.20161026 -- Sync with upstream git, bringing in a bunch if bug-fixes -- Add some extra fixes which are pending upstream -- This also adds PointerWarping emulation to Xwayland, which should improve - compatiblity with many games diff --git a/xserver-sdk-abi-requires.git b/xserver-sdk-abi-requires.git deleted file mode 100755 index c033061..0000000 --- a/xserver-sdk-abi-requires.git +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -# -# The X server provides capabilities of the form: -# -# Provides: xserver-abi(ansic-0) = 4 -# -# for an ABI version of 0.4. The major number is encoded into the name so -# that major number changes force upgrades. If we didn't, then -# -# Requires: xserver-abi(ansic) >= 0.4 -# -# would also match 1.0, which is wrong since major numbers mean an ABI break. - -echo "xserver-abi($1-@MAJOR@) >= @MINOR@" diff --git a/xserver-sdk-abi-requires.release b/xserver-sdk-abi-requires.release deleted file mode 100755 index 30d77bf..0000000 --- a/xserver-sdk-abi-requires.release +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh -# -# The X server provides capabilities of the form: -# -# Provides: xserver-abi(ansic-0) = 4 -# -# for an ABI version of 0.4. The major number is encoded into the name so -# that major number changes force upgrades. If we didn't, then -# -# Requires: xserver-abi(ansic) >= 0.4 -# -# would also match 1.0, which is wrong since major numbers mean an ABI break. - -ver=$(pkg-config --variable abi_$1 xorg-server) - -major=$(echo $ver | cut -f 1 -d .) -minor=$(echo $ver | cut -f 2 -d .) - -echo "xserver-abi($1-$major) >= $minor" From 2cdddcc3e1afaa0943ffb27d160cf9689fdf8c22 Mon Sep 17 00:00:00 2001 From: Simone Caronni Date: Thu, 26 Sep 2024 22:16:51 +0200 Subject: [PATCH 108/131] Clean up .gitignore --- .gitignore | 36 +----------------------------------- 1 file changed, 1 insertion(+), 35 deletions(-) diff --git a/.gitignore b/.gitignore index 89c66cc..29790d0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,37 +1,3 @@ -xorg-server-1.9.1.tar.bz2 -/xorg-server-20101125.tar.xz -/xorg-server-20101201.tar.xz -/xorg-server-1.10.0.tar.bz2 -/xorg-server-20110418.tar.xz -/xorg-server-20110510.tar.xz -/xorg-server-20110818.tar.xz -/xorg-server-1.11.0.tar.bz2 -/xorg-server-1.11.1.tar.bz2 -/xorg-server-20111109.tar.xz -/xorg-server-20120103.tar.xz -/xorg-server-20120124.tar.xz -/xorg-server-20120215.tar.xz -/xorg-server-1.12.0.tar.bz2 -/xorg-server-1.12.1.tar.bz2 -/xorg-server-1.12.2.tar.bz2 -/xorg-server-1.12.3.tar.bz2 -/xorg-server-20120717.tar.xz -/xorg-server-20120726.tar.xz -/xorg-server-20120808.tar.xz -/xorg-server-20120822.tar.xz -/xorg-server-1.13.0.tar.bz2 -/xorg-server-1.13.1.tar.bz2 -/xorg-server-20130109.tar.xz -/xorg-server-20130215.tar.xz -/xorg-server-1.14.0.tar.bz2 -/xorg-server-1.14.1.tar.bz2 -/xorg-server-1.14.1.901.tar.bz2 -/xorg-server-1.14.2.tar.bz2 -/xorg-server-1.14.3.tar.bz2 -/xorg-server-1.14.99.3.tar.bz2 -/xorg-server-1.14.99.901.tar.bz2 -/xorg-server-1.14.99.902.tar.bz2 *.bz2 *.xz -/xorg-x11-server-1.15.0-1.fc21.src.rpm -/xorg-server-1.20.14.tar.gz +*.gz From 00592f1f261d593556a7ee396e4889b8a3300b53 Mon Sep 17 00:00:00 2001 From: Simone Caronni Date: Fri, 27 Sep 2024 09:40:24 +0200 Subject: [PATCH 109/131] Switch to meson for building --- ...search-for-the-fontrootdir-ourselves.patch | 72 --------- xorg-x11-server.spec | 140 +++++++++--------- 2 files changed, 72 insertions(+), 140 deletions(-) delete mode 100644 0001-configure.ac-search-for-the-fontrootdir-ourselves.patch diff --git a/0001-configure.ac-search-for-the-fontrootdir-ourselves.patch b/0001-configure.ac-search-for-the-fontrootdir-ourselves.patch deleted file mode 100644 index 3e29358..0000000 --- a/0001-configure.ac-search-for-the-fontrootdir-ourselves.patch +++ /dev/null @@ -1,72 +0,0 @@ -From e67e988730346c63d2f0cdf2531ed36b0c7ad5a6 Mon Sep 17 00:00:00 2001 -From: Peter Hutterer -Date: Wed, 23 Nov 2022 14:50:29 +1000 -Subject: [PATCH xserver] configure.ac: search for the fontrootdir ourselves - -This replaces the use of font-utils' .m4 macro set with a copy of the -only one we actually want: the bit for the fontrootpath. - -We don't need configure options for every single subfont directory, so -let's hardcode those in the default font path. Like meson does upstream -too. - -With this patch we no longer require the font-utils dependency. - -Signed-off-by: Peter Hutterer ---- - configure.ac | 28 +++++++++++++++++----------- - 1 file changed, 17 insertions(+), 11 deletions(-) - -diff --git a/configure.ac b/configure.ac -index 0909cc5b4d..2349320888 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -49,9 +49,6 @@ XORG_WITH_XSLTPROC - XORG_ENABLE_UNIT_TESTS - XORG_LD_WRAP([optional]) - --m4_ifndef([XORG_FONT_MACROS_VERSION], [m4_fatal([must install font-util 1.1 or later before running autoconf/autogen])]) --XORG_FONT_MACROS_VERSION(1.1) -- - dnl this gets generated by autoheader, and thus contains all the defines. we - dnl don't ever actually use it, internally. - AC_CONFIG_HEADERS(include/do-not-use-config.h) -@@ -450,18 +447,27 @@ AC_MSG_RESULT([$FALLBACK_INPUT_DRIVER]) - AC_DEFINE_UNQUOTED(FALLBACK_INPUT_DRIVER, ["$FALLBACK_INPUT_DRIVER"], [ Fallback input driver ]) - - dnl Determine font path --XORG_FONTROOTDIR --XORG_FONTSUBDIR(FONTMISCDIR, fontmiscdir, misc) --XORG_FONTSUBDIR(FONTOTFDIR, fontotfdir, OTF) --XORG_FONTSUBDIR(FONTTTFDIR, fontttfdir, TTF) --XORG_FONTSUBDIR(FONTTYPE1DIR, fonttype1dir, Type1) --XORG_FONTSUBDIR(FONT75DPIDIR, font75dpidir, 75dpi) --XORG_FONTSUBDIR(FONT100DPIDIR, font100dpidir, 100dpi) -+dnl This is a copy of XORG_FONTROOTDIR from font-utils so we can drop the dependency -+AC_MSG_CHECKING([for root directory for font files]) -+AC_ARG_WITH(fontrootdir, -+ AS_HELP_STRING([--with-fontrootdir=DIR], -+ [Path to root directory for font files]), -+ [FONTROOTDIR="$withval"]) -+# if --with-fontrootdir not specified... -+if test "x${FONTROOTDIR}" = "x"; then -+ FONTROOTDIR=`$PKG_CONFIG --variable=fontrootdir fontutil` -+fi -+# ...and if pkg-config didn't find fontdir in fontutil.pc... -+if test "x${FONTROOTDIR}" = "x"; then -+ FONTROOTDIR="${datadir}/fonts/X11" -+fi -+AC_SUBST(FONTROOTDIR) -+AC_MSG_RESULT([${FONTROOTDIR}]) - - dnl Uses --with-default-font-path if set, otherwise uses standard - dnl subdirectories of FONTROOTDIR. Some distros set the default font path to - dnl "catalogue:/etc/X11/fontpath.d,built-ins" --DEFAULT_FONT_PATH="${FONTMISCDIR}/,${FONTTTFDIR}/,${FONTOTFDIR}/,${FONTTYPE1DIR}/,${FONT100DPIDIR}/,${FONT75DPIDIR}/" -+DEFAULT_FONT_PATH="${FONTROOTDIR}/misc,${FONTROOTDIR}/OTF,${FONTROOTDIR}/TTF,${FONTROOTDIR}/Type1,${FONTROOTDIR}/75dpi,${FONTROOTDIR}/100dpi" - case $host_os in - darwin*) DEFAULT_FONT_PATH="${DEFAULT_FONT_PATH},/Library/Fonts,/System/Library/Fonts" ;; - esac --- -2.38.1 - diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 3f514a5..9a7799b 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -18,7 +18,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 21.1.13 -Release: 2%{?dist} +Release: 3%{?dist} URL: http://www.x.org # SPDX License: Adobe-Display-PostScript AND BSD-3-Clause AND DEC-3-Clause AND HPND AND HPND-sell-MIT-disclaimer-xserver AND HPND-sell-variant AND ICU AND ISC AND MIT AND MIT-open-group AND NTP AND SGI-B-2.0 AND SMLNJ AND X11 AND X11-distribute-modifications-variant @@ -45,24 +45,15 @@ Patch2: 0001-xfree86-use-modesetting-driver-by-default-on-GeForce.patch Patch3: 0001-xf86-dri2-Use-va_gl-as-vdpau_driver-for-Intel-i965-G.patch # because the display-managers are not ready yet, do not upstream Patch6: 0001-Fedora-hack-Make-the-suid-root-wrapper-always-start-.patch -# Not sure anyone else cares about this so let's keep this Fedora-only for now -# Upstream PR for the meson.build equivalent is here, so we can drop this patch -# when we start building with meson. -# https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1001` -Patch7: 0001-configure.ac-search-for-the-fontrootdir-ourselves.patch # Fix compilation error on i686 (21.1.14+) # https://gitlab.freedesktop.org/xorg/xserver/-/commit/8407181c7dfe14086d99697af0b86120320ab73e Patch1024: 0001-ephyr-Fix-incompatible-pointer-type-build-error.patch -## Add new patches above; Fedora-specific patches below - - +BuildRequires: gcc BuildRequires: make +BuildRequires: meson BuildRequires: systemtap-sdt-devel BuildRequires: git-core -BuildRequires: automake -BuildRequires: autoconf -BuildRequires: libtool BuildRequires: pkgconfig BuildRequires: xorg-x11-util-macros >= 1.17 @@ -102,12 +93,9 @@ BuildRequires: kernel-headers BuildRequires: audit-libs-devel BuildRequires: libselinux-devel >= 2.0.86-1 BuildRequires: libudev-devel -# libunwind is Exclusive for the following arches -%ifarch aarch64 %{arm} hppa ia64 mips ppc ppc64 %{ix86} x86_64 %if !0%{?rhel} BuildRequires: libunwind-devel %endif -%endif BuildRequires: pkgconfig(xcb-aux) BuildRequires: pkgconfig(xcb-image) @@ -258,52 +246,71 @@ test `getmajor extension` == %{extension_major} test `getminor extension` == %{extension_minor} %build +%meson \ + -D agp=auto \ + -D builder_string="Build ID: %{name} %{version}-%{release}" \ + -D default_font_path="catalogue:/etc/X11/fontpath.d,built-ins" \ + -D devel-docs=false \ + -D dga=true \ + -D docs-pdf=false \ + -D docs=false \ + -D dpms=true \ + -D dri1=false \ + -D dri2=true \ + -D dri3=%{?!rhel:true}%{?rhel:false} \ + -D drm=true \ + -D dtrace=false \ + -D fallback_input_driver=libinput \ + -D glamor=true \ + -D glx=true \ + -D hal=false \ + -D input_thread=true \ + -D int10=%{?!rhel:auto}%{?rhel:false} \ + -D ipv6=true \ + -D libunwind=%{?!rhel:true}%{?rhel:false} \ + -D linux_acpi=false \ + -D linux_apm=false \ + -D listen_local=true \ + -D listen_tcp=false \ + -D listen_unix=true \ + -D log_dir="%{_localstatedir}/log" \ + -D mitshm=auto \ + -D module_dir="%{_libdir}/xorg/modules" \ + -D pciaccess=true \ + -D screensaver=true \ + -D secure-rpc=false \ + -D sha1=libcrypto \ + -D suid_wrapper=true \ + -D systemd_logind=true \ + -D udev_kms=true \ + -D udev=true \ + -D vgahw=true \ + -D xace=true \ + -D xcsecurity=true \ + -D xdm-auth-1=true \ + -D xdmcp=true \ + -D xephyr=true \ + -D xf86bigfont=false \ + -D xf86-input-inputtest=true \ + -D xinerama=true \ + -D xkb_output_dir="%{_localstatedir}/lib/xkb" \ + -D xnest=true \ + -D xorg=true \ + -D xpbproxy=false \ + -D xquartz=false \ + -D xres=true \ + -D xselinux=true \ + -D xvfb=true \ + -D xvmc=true \ + -D xv=true \ + -D xwin=false -%if !0%{?rhel} -%ifarch %{ix86} x86_64 -%global int10_arch 1 -%endif -%endif - -%if %{undefined int10_arch} -%global no_int10 --disable-vbe --disable-int10-module -%endif - -%global kdrive --enable-kdrive --enable-xephyr --disable-xfake --disable-xfbdev -%global xservers --enable-xvfb --enable-xnest %{kdrive} --enable-xorg -%global default_font_path "catalogue:/etc/X11/fontpath.d,built-ins" -%global dri_flags --disable-dri --enable-dri2 %{?!rhel:--enable-dri3} --enable-suid-wrapper --enable-glamor - -autoreconf -f -v --install || exit 1 - -%configure %{xservers} \ - --enable-dependency-tracking \ - --disable-static \ - --with-pic \ - %{?no_int10} \ - --with-default-font-path=%{default_font_path} \ - --with-module-dir=%{_libdir}/xorg/modules \ - --with-builderstring="Build ID: %{name} %{version}-%{release}" \ - --with-os-name="$(hostname -s) $(uname -r)" \ - --with-xkb-output=%{_localstatedir}/lib/xkb \ - --without-dtrace \ - --disable-linux-acpi --disable-linux-apm \ - --enable-xselinux --enable-record --enable-present \ - --enable-xcsecurity \ - --enable-config-udev \ - --disable-unit-tests \ - --enable-dmx \ - --disable-xwayland \ - %{dri_flags} \ - ${CONFIGURE} - -make V=1 %{?_smp_mflags} - +%meson_build %install -%make_install +%meson_install -mkdir -p $RPM_BUILD_ROOT%{_libdir}/xorg/modules/{drivers,input} +install -D -m 0644 -p xkb/README.compiled $RPM_BUILD_ROOT%{_localstatedir}/lib/xkb/README.compiled mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/pam.d install -m 644 %{SOURCE10} $RPM_BUILD_ROOT%{_sysconfdir}/pam.d/xserver @@ -331,7 +338,7 @@ cp {,%{inst_srcdir}/}hw/xfree86/Xorg.sh.in cp xkb/README.compiled %{inst_srcdir}/xkb cp hw/xfree86/xorgconf.cpp %{inst_srcdir}/hw/xfree86 -find . -type f | egrep '.*\.(c|h|am|ac|inc|m4|h.in|pc.in|man.pre|pl|txt)$' | +find . -type f -not -path "./%{_vpath_builddir}/*" | egrep '.*\.(c|h|am|ac|inc|m4|h.in|pc.in|man.pre|pl|txt)$' | xargs tar cf - | (cd %{inst_srcdir} && tar xf -) find %{inst_srcdir}/hw/xfree86 -name \*.c -delete @@ -352,19 +359,14 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %dir %{_localstatedir}/lib/xkb %{_localstatedir}/lib/xkb/README.compiled -%if 1 -%global Xorgperms %attr(4755, root, root) -%else -# disable until module loading is audited -%global Xorgperms %attr(0711,root,root) %caps(cap_sys_admin,cap_sys_rawio,cap_dac_override=pe) -%endif - %files Xorg %config %attr(0644,root,root) %{_sysconfdir}/pam.d/xserver %{_bindir}/X %{_bindir}/Xorg %{_libexecdir}/Xorg -%{Xorgperms} %{_libexecdir}/Xorg.wrap +# Disable until module loading is audited +# %attr(0711,root,root) %caps(cap_sys_admin,cap_sys_rawio,cap_dac_override=pe) +%attr(4755, root, root) %{_libexecdir}/Xorg.wrap %{_bindir}/gtf %dir %{_libdir}/xorg %dir %{_libdir}/xorg/modules @@ -382,9 +384,8 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %{_libdir}/xorg/modules/libshadowfb.so %{_libdir}/xorg/modules/libvgahw.so %{_libdir}/xorg/modules/libwfb.so -%if %{defined int10_arch} +%if !0%{?rhel} %{_libdir}/xorg/modules/libint10.so -#%%{_libdir}/xorg/modules/libvbe.so %endif %{_mandir}/man1/gtf.1* %{_mandir}/man1/Xorg.1* @@ -427,6 +428,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Fri Sep 27 2024 Simone Caronni - 21.1.13-3 +- Switch to meson, drop no longer required patch. + * Thu Sep 26 2024 Simone Caronni - 21.1.13-2 - Drop support for building snapshots. If they need to be built, there are anyway more simpler ways. From 73f289de65aa3a37cfd7ae8e25fc62f5c5656b86 Mon Sep 17 00:00:00 2001 From: Simone Caronni Date: Fri, 27 Sep 2024 09:56:22 +0200 Subject: [PATCH 110/131] Drop Obsoletes/Provides that have been removed in ~2014 --- xorg-x11-server.spec | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 9a7799b..a20123b 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -128,12 +128,6 @@ Provides: xserver-abi(ansic-%{ansic_major}) = %{ansic_minor} Provides: xserver-abi(videodrv-%{videodrv_major}) = %{videodrv_minor} Provides: xserver-abi(xinput-%{xinput_major}) = %{xinput_minor} Provides: xserver-abi(extension-%{extension_major}) = %{extension_minor} -Obsoletes: xorg-x11-glamor < %{version}-%{release} -Provides: xorg-x11-glamor = %{version}-%{release} -Obsoletes: xorg-x11-drv-modesetting < %{version}-%{release} -Provides: xorg-x11-drv-modesetting = %{version}-%{release} -# Dropped from F25 -Obsoletes: xorg-x11-drv-vmmouse < 13.1.0-4 # Dropped from xorg-x11-server-21.1 # https://gitlab.freedesktop.org/xorg/xserver/-/commit/b3b81c8c2090cd49410960a021baf0d27fdd2ab3 Obsoletes: xorg-x11-server-Xdmx < 1.20.15 @@ -204,8 +198,6 @@ Requires: xorg-x11-proto-devel Requires: libXfont2-devel Requires: pkgconfig pixman-devel libpciaccess-devel Provides: xorg-x11-server-static -Obsoletes: xorg-x11-glamor-devel < %{version}-%{release} -Provides: xorg-x11-glamor-devel = %{version}-%{release} %description devel The SDK package provides the developmental files which are necessary for @@ -430,6 +422,7 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog * Fri Sep 27 2024 Simone Caronni - 21.1.13-3 - Switch to meson, drop no longer required patch. +- Drop Obsoletes/Provides that have been removed in ~2014. * Thu Sep 26 2024 Simone Caronni - 21.1.13-2 - Drop support for building snapshots. If they need to be built, there are From ddd6374980bc5a93c2e88976557107943b664c87 Mon Sep 17 00:00:00 2001 From: Simone Caronni Date: Fri, 27 Sep 2024 10:53:34 +0200 Subject: [PATCH 111/131] Add build depdendencies as they are searched by meson --- xorg-x11-server.spec | 119 ++++++++++++++++++++++++------------------- 1 file changed, 67 insertions(+), 52 deletions(-) diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index a20123b..abc926b 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -49,60 +49,74 @@ Patch6: 0001-Fedora-hack-Make-the-suid-root-wrapper-always-start-.patch # https://gitlab.freedesktop.org/xorg/xserver/-/commit/8407181c7dfe14086d99697af0b86120320ab73e Patch1024: 0001-ephyr-Fix-incompatible-pointer-type-build-error.patch -BuildRequires: gcc -BuildRequires: make -BuildRequires: meson -BuildRequires: systemtap-sdt-devel -BuildRequires: git-core -BuildRequires: pkgconfig -BuildRequires: xorg-x11-util-macros >= 1.17 - -BuildRequires: xorg-x11-proto-devel >= 7.7-10 - -BuildRequires: dbus-devel -BuildRequires: libepoxy-devel -BuildRequires: systemd-devel -BuildRequires: xorg-x11-xtrans-devel >= 1.3.2 -BuildRequires: libXfont2-devel -BuildRequires: libXau-devel -BuildRequires: libxkbfile-devel -BuildRequires: libXres-devel -BuildRequires: libfontenc-devel -BuildRequires: libXtst-devel -BuildRequires: libXdmcp-devel -BuildRequires: libX11-devel -BuildRequires: libXext-devel -BuildRequires: libXinerama-devel -BuildRequires: libXi-devel - -BuildRequires: pkgconfig(epoxy) -BuildRequires: pkgconfig(xshmfence) >= 1.1 -BuildRequires: libXv-devel -BuildRequires: pixman-devel >= 0.30.0 -BuildRequires: libpciaccess-devel >= 0.13.1 -BuildRequires: openssl-devel -BuildRequires: bison -BuildRequires: flex -BuildRequires: mesa-libGL-devel >= 9.2 -BuildRequires: mesa-libEGL-devel -BuildRequires: mesa-libgbm-devel -# XXX silly... -BuildRequires: libdrm-devel >= 2.4.0 -BuildRequires: kernel-headers - -BuildRequires: audit-libs-devel -BuildRequires: libselinux-devel >= 2.0.86-1 -BuildRequires: libudev-devel +BuildRequires: bison +BuildRequires: flex +BuildRequires: gcc +BuildRequires: kernel-headers +BuildRequires: libXi-devel +BuildRequires: libXinerama-devel +BuildRequires: libXres-devel +BuildRequires: libXv-devel +BuildRequires: make +BuildRequires: mesa-libEGL-devel +BuildRequires: mesa-libGL-devel >= 9.2 +BuildRequires: meson +BuildRequires: pkgconfig +BuildRequires: pkgconfig(audit) +BuildRequires: pkgconfig(bigreqsproto) >= 1.1.0 +BuildRequires: pkgconfig(compositeproto) >= 0.4 +BuildRequires: pkgconfig(damageproto) >= 1.1 +BuildRequires: pkgconfig(dbus-1) >= 1.0 +BuildRequires: pkgconfig(dri2proto) >= 2.8 +BuildRequires: pkgconfig(dri3proto) >= 1.2 +BuildRequires: pkgconfig(epoxy) +BuildRequires: pkgconfig(epoxy) >= 1.5.4 +BuildRequires: pkgconfig(fixesproto) >= 6.0 +BuildRequires: pkgconfig(fontsproto) >= 2.1.3 +BuildRequires: pkgconfig(gbm) >= 10.2 +BuildRequires: pkgconfig(inputproto) >= 2.3.99.1 +BuildRequires: pkgconfig(kbproto) >= 1.0.3 +BuildRequires: pkgconfig(libdrm) >= 2.4.89 +BuildRequires: pkgconfig(libselinux) >= 2.0.86 +BuildRequires: pkgconfig(libsystemd) >= 209 +BuildRequires: pkgconfig(libudev) >= 143 %if !0%{?rhel} -BuildRequires: libunwind-devel +BuildRequires: pkgconfig(libunwind) %endif - -BuildRequires: pkgconfig(xcb-aux) -BuildRequires: pkgconfig(xcb-image) -BuildRequires: pkgconfig(xcb-icccm) -BuildRequires: pkgconfig(xcb-keysyms) -BuildRequires: pkgconfig(xcb-renderutil) -BuildRequires: pkgconfig(libxcvt) +BuildRequires: pkgconfig(libxcvt) +BuildRequires: pkgconfig(openssl) +BuildRequires: pkgconfig(pciaccess) >= 0.12.901 +BuildRequires: pkgconfig(pixman-1) +BuildRequires: pkgconfig(randrproto) >= 1.6.0 +BuildRequires: pkgconfig(recordproto) >= 1.13.99.1 +BuildRequires: pkgconfig(renderproto) >= 0.11 +BuildRequires: pkgconfig(resourceproto) >= 1.2.0 +BuildRequires: pkgconfig(scrnsaverproto) >= 1.1 +BuildRequires: pkgconfig(videoproto) +BuildRequires: pkgconfig(x11) +BuildRequires: pkgconfig(x11-xcb) +BuildRequires: pkgconfig(xau) +BuildRequires: pkgconfig(xcb-aux) +BuildRequires: pkgconfig(xcb-icccm) +BuildRequires: pkgconfig(xcb-image) +BuildRequires: pkgconfig(xcb-keysyms) +BuildRequires: pkgconfig(xcb-renderutil) +BuildRequires: pkgconfig(xcmiscproto) >= 1.2.0 +BuildRequires: pkgconfig(xdmcp) +BuildRequires: pkgconfig(xext) >= 1.0.99.4 +BuildRequires: pkgconfig(xextproto) >= 7.2.99.901 +BuildRequires: pkgconfig(xf86bigfontproto) >= 1.2.0 +BuildRequires: pkgconfig(xf86vidmodeproto) >= 2.2.99.1 +BuildRequires: pkgconfig(xfont2) >= 2.0 +BuildRequires: pkgconfig(xineramaproto) +BuildRequires: pkgconfig(xkbfile) +BuildRequires: pkgconfig(xproto) >= 7.0.31 +BuildRequires: pkgconfig(xshmfence) >= 1.1 +BuildRequires: pkgconfig(xtrans) >= 1.3.5 +BuildRequires: pkgconfig(xtrans) >= 1.3.5 +BuildRequires: systemtap-sdt-devel +BuildRequires: xorg-x11-util-macros >= 1.17 +BuildRequires: xorg-x11-xtrans-devel >= 1.3.2 %description X.Org X11 X server @@ -423,6 +437,7 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete * Fri Sep 27 2024 Simone Caronni - 21.1.13-3 - Switch to meson, drop no longer required patch. - Drop Obsoletes/Provides that have been removed in ~2014. +- Add build depdendencies as they are searched by meson. * Thu Sep 26 2024 Simone Caronni - 21.1.13-2 - Drop support for building snapshots. If they need to be built, there are From b8c1f8e99ca043ca5b20b342c77ec3b2fd8b9ac5 Mon Sep 17 00:00:00 2001 From: Simone Caronni Date: Fri, 27 Sep 2024 10:54:01 +0200 Subject: [PATCH 112/131] Format SPEC file --- xorg-x11-server.spec | 222 +++++++++++++++++++++---------------------- 1 file changed, 106 insertions(+), 116 deletions(-) diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index abc926b..c206d12 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -2,8 +2,7 @@ %undefine _hardened_build %undefine _strict_symbol_defs_build -# Released ABI versions. Have to keep these manually in sync with the -# source because rpm is a terrible language. +# Released ABI versions: %global ansic_major 0 %global ansic_minor 4 %global videodrv_major 25 @@ -15,39 +14,36 @@ %global pkgname xorg-server -Summary: X.Org X11 X server -Name: xorg-x11-server -Version: 21.1.13 -Release: 3%{?dist} -URL: http://www.x.org +Summary: X.Org X11 X server +Name: xorg-x11-server +Version: 21.1.13 +Release: 3%{?dist} +URL: http://www.x.org # SPDX -License: Adobe-Display-PostScript AND BSD-3-Clause AND DEC-3-Clause AND HPND AND HPND-sell-MIT-disclaimer-xserver AND HPND-sell-variant AND ICU AND ISC AND MIT AND MIT-open-group AND NTP AND SGI-B-2.0 AND SMLNJ AND X11 AND X11-distribute-modifications-variant +License: Adobe-Display-PostScript AND BSD-3-Clause AND DEC-3-Clause AND HPND AND HPND-sell-MIT-disclaimer-xserver AND HPND-sell-variant AND ICU AND ISC AND MIT AND MIT-open-group AND NTP AND SGI-B-2.0 AND SMLNJ AND X11 AND X11-distribute-modifications-variant -Source0: https://www.x.org/pub/individual/xserver/%{pkgname}-%{version}.tar.xz +Source0: https://www.x.org/pub/individual/xserver/%{pkgname}-%{version}.tar.xz Source10: xserver.pamd - # "useful" xvfb-run script -Source20: http://svn.exactcode.de/t2/trunk/package/xorg/xorg-server/xvfb-run.sh - +Source20: http://svn.exactcode.de/t2/trunk/package/xorg/xorg-server/xvfb-run.sh # for requires generation in drivers -Source30: xserver-sdk-abi-requires - +Source30: xserver-sdk-abi-requires # maintainer convenience script -Source40: driver-abi-rebuild.sh +Source40: driver-abi-rebuild.sh # From Debian use intel ddx driver only for gen4 and older chipsets -Patch1: 06_use-intel-only-on-pre-gen4.diff +Patch0: 06_use-intel-only-on-pre-gen4.diff # Default to xf86-video-modesetting on GeForce 8 and newer -Patch2: 0001-xfree86-use-modesetting-driver-by-default-on-GeForce.patch +Patch1: 0001-xfree86-use-modesetting-driver-by-default-on-GeForce.patch # Default to va_gl on intel i965 as we use the modesetting drv there # va_gl should probably just be the default everywhere ? -Patch3: 0001-xf86-dri2-Use-va_gl-as-vdpau_driver-for-Intel-i965-G.patch +Patch2: 0001-xf86-dri2-Use-va_gl-as-vdpau_driver-for-Intel-i965-G.patch # because the display-managers are not ready yet, do not upstream -Patch6: 0001-Fedora-hack-Make-the-suid-root-wrapper-always-start-.patch +Patch3: 0001-Fedora-hack-Make-the-suid-root-wrapper-always-start-.patch # Fix compilation error on i686 (21.1.14+) # https://gitlab.freedesktop.org/xorg/xserver/-/commit/8407181c7dfe14086d99697af0b86120320ab73e -Patch1024: 0001-ephyr-Fix-incompatible-pointer-type-build-error.patch +Patch4: 0001-ephyr-Fix-incompatible-pointer-type-build-error.patch BuildRequires: bison BuildRequires: flex @@ -119,113 +115,110 @@ BuildRequires: xorg-x11-util-macros >= 1.17 BuildRequires: xorg-x11-xtrans-devel >= 1.3.2 %description -X.Org X11 X server +X.Org X11 X server. -%package common -Summary: Xorg server common files -Requires: pixman >= 0.30.0 -Requires: xkeyboard-config xkbcomp +%package common +Summary: Xorg server common files +Requires: pixman +Requires: xkbcomp +Requires: xkeyboard-config -%description common +%description common Common files shared among all X servers. -%package Xorg -Summary: Xorg X server -Provides: Xorg = %{version}-%{release} -Provides: Xserver +%package Xorg +Summary: Xorg X server +Requires: libEGL +Requires: system-setup-keyboard +Requires: xorg-x11-drv-libinput +Requires: xorg-x11-server-common >= %{version}-%{release} +Provides: Xorg = %{version}-%{release} +Provides: Xserver # HdG: This should be moved to the wrapper package once the wrapper gets # its own sub-package: -Provides: xorg-x11-server-wrapper = %{version}-%{release} -Provides: xserver-abi(ansic-%{ansic_major}) = %{ansic_minor} -Provides: xserver-abi(videodrv-%{videodrv_major}) = %{videodrv_minor} -Provides: xserver-abi(xinput-%{xinput_major}) = %{xinput_minor} -Provides: xserver-abi(extension-%{extension_major}) = %{extension_minor} +Provides: xorg-x11-server-wrapper = %{version}-%{release} +Provides: xserver-abi(ansic-%{ansic_major}) = %{ansic_minor} +Provides: xserver-abi(videodrv-%{videodrv_major}) = %{videodrv_minor} +Provides: xserver-abi(xinput-%{xinput_major}) = %{xinput_minor} +Provides: xserver-abi(extension-%{extension_major}) = %{extension_minor} # Dropped from xorg-x11-server-21.1 # https://gitlab.freedesktop.org/xorg/xserver/-/commit/b3b81c8c2090cd49410960a021baf0d27fdd2ab3 -Obsoletes: xorg-x11-server-Xdmx < 1.20.15 +Obsoletes: xorg-x11-server-Xdmx < 1.20.15 -Requires: xorg-x11-server-common >= %{version}-%{release} -Requires: system-setup-keyboard -Requires: xorg-x11-drv-libinput -Requires: libEGL - -%description Xorg -X.org X11 is an open source implementation of the X Window System. It -provides the basic low level functionality which full fledged -graphical user interfaces (GUIs) such as GNOME and KDE are designed -upon. +%description Xorg +X.org X11 is an open source implementation of the X Window System. It provides +the basic low level functionality which full fledged graphical user interfaces +(GUIs) such as GNOME and KDE are designed upon. -%package Xnest -Summary: A nested server -Requires: xorg-x11-server-common >= %{version}-%{release} -Provides: Xnest +%package Xnest +Summary: A nested server +Requires: xorg-x11-server-common >= %{version}-%{release} +Provides: Xnest -%description Xnest -Xnest is an X server which has been implemented as an ordinary -X application. It runs in a window just like other X applications, -but it is an X server itself in which you can run other software. It -is a very useful tool for developers who wish to test their -applications without running them on their real X server. +%description Xnest +Xnest is an X server which has been implemented as an ordinary X application. It +runs in a window just like other X applications, but it is an X server itself in +which you can run other software. It is a very useful tool for developers who +wish to test their applications without running them on their real X server. -%package Xvfb -Summary: A X Windows System virtual framebuffer X server +%package Xvfb +Summary: A X Windows System virtual framebuffer X server # xvfb-run is GPLv2, rest is MIT -License: MIT and GPLv2 -Requires: xorg-x11-server-common >= %{version}-%{release} +License: MIT and GPLv2 +Requires: xorg-x11-server-common >= %{version}-%{release} # required for xvfb-run -Requires: xorg-x11-xauth -Requires: util-linux -Provides: Xvfb +Requires: xorg-x11-xauth +Provides: Xvfb +Requires: util-linux -%description Xvfb -Xvfb (X Virtual Frame Buffer) is an X server that is able to run on -machines with no display hardware and no physical input devices. -Xvfb simulates a dumb framebuffer using virtual memory. Xvfb does -not open any devices, but behaves otherwise as an X display. Xvfb -is normally used for testing servers. +%description Xvfb +Xvfb (X Virtual Frame Buffer) is an X server that is able to run on machines +with no display hardware and no physical input devices. Xvfb simulates a dumb +framebuffer using virtual memory. Xvfb does not open any devices, but behaves +otherwise as an X display. Xvfb is normally used for testing servers. -%package Xephyr -Summary: A nested server -Requires: xorg-x11-server-common >= %{version}-%{release} -Provides: Xephyr +%package Xephyr +Summary: A nested server +Requires: xorg-x11-server-common >= %{version}-%{release} +Provides: Xephyr -%description Xephyr -Xephyr is an X server which has been implemented as an ordinary -X application. It runs in a window just like other X applications, -but it is an X server itself in which you can run other software. It -is a very useful tool for developers who wish to test their -applications without running them on their real X server. Unlike -Xnest, Xephyr renders to an X image rather than relaying the -X protocol, and therefore supports the newer X extensions like -Render and Composite. +%description Xephyr +Xephyr is an X server which has been implemented as an ordinary X application. +It runs in a window just like other X applications, but it is an X server itself +in which you can run other software. It is a very useful tool for developers who +wish to test their applications without running them on their real X server. +Unlike Xnest, Xephyr renders to an X image rather than relaying the X protocol, +and therefore supports the newer X extensions like Render and Composite. -%package devel -Summary: SDK for X server driver module development -Requires: xorg-x11-util-macros -Requires: xorg-x11-proto-devel -Requires: libXfont2-devel -Requires: pkgconfig pixman-devel libpciaccess-devel -Provides: xorg-x11-server-static +%package devel +Summary: SDK for X server driver module development +Requires: libpciaccess-devel +Requires: libXfont2-devel +Requires: xorg-x11-proto-devel +Requires: xorg-x11-util-macros +Requires: pixman-devel +Requires: pkgconfig +Provides: xorg-x11-server-static %description devel The SDK package provides the developmental files which are necessary for -developing X server driver modules, and for compiling driver modules -outside of the standard X11 source code tree. Developers writing video -drivers, input drivers, or other X modules should install this package. +developing X server driver modules, and for compiling driver modules outside of +the standard X11 source code tree. Developers writing video drivers, input +drivers, or other X modules should install this package. -%package source -Summary: Xserver source code required to build VNC server (Xvnc) -BuildArch: noarch +%package source +Summary: Xserver source code required to build VNC server (Xvnc) +BuildArch: noarch -%description source -Xserver source code needed to build VNC server (Xvnc) +%description source +Xserver source code needed to build VNC server (Xvnc). %prep @@ -316,18 +309,15 @@ test `getminor extension` == %{extension_minor} %install %meson_install -install -D -m 0644 -p xkb/README.compiled $RPM_BUILD_ROOT%{_localstatedir}/lib/xkb/README.compiled - -mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/pam.d -install -m 644 %{SOURCE10} $RPM_BUILD_ROOT%{_sysconfdir}/pam.d/xserver +install -D -m 0644 -p xkb/README.compiled %{buildroot}%{_localstatedir}/lib/xkb/README.compiled +install -D -m 0644 %{SOURCE10} %{buildroot}%{_sysconfdir}/pam.d/xserver # make sure the (empty) /etc/X11/xorg.conf.d is there, system-setup-keyboard # relies on it more or less. -mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/X11/xorg.conf.d +mkdir -p %{buildroot}%{_sysconfdir}/X11/xorg.conf.d -install -m 755 %{SOURCE30} $RPM_BUILD_ROOT%{_bindir}/xserver-sdk-abi-requires - -install -m 0755 %{SOURCE20} $RPM_BUILD_ROOT%{_bindir}/xvfb-run +install -D -m 0755 %{SOURCE30} %{buildroot}%{_bindir}/xserver-sdk-abi-requires +install -D -m 0755 %{SOURCE20} %{buildroot}%{_bindir}/xvfb-run # Make the source package %global xserver_source_dir %{_datadir}/xorg-x11-server-source @@ -350,10 +340,10 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete # Remove unwanted files/dirs { - find $RPM_BUILD_ROOT -type f -name '*.la' | xargs rm -f -- || : + find %{buildroot} -type f -name '*.la' | xargs rm -f -- || : # wtf %ifnarch %{ix86} x86_64 - rm -f $RPM_BUILD_ROOT%{_libdir}/xorg/modules/lib{int10,vbe}.so + rm -f %{buildroot}%{_libdir}/xorg/modules/lib{int10,vbe}.so %endif } @@ -367,13 +357,13 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %files Xorg %config %attr(0644,root,root) %{_sysconfdir}/pam.d/xserver +%{_bindir}/gtf %{_bindir}/X %{_bindir}/Xorg %{_libexecdir}/Xorg # Disable until module loading is audited # %attr(0711,root,root) %caps(cap_sys_admin,cap_sys_rawio,cap_dac_override=pe) %attr(4755, root, root) %{_libexecdir}/Xorg.wrap -%{_bindir}/gtf %dir %{_libdir}/xorg %dir %{_libdir}/xorg/modules %dir %{_libdir}/xorg/modules/drivers @@ -382,27 +372,27 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %{_libdir}/xorg/modules/extensions/libglx.so %dir %{_libdir}/xorg/modules/input %{_libdir}/xorg/modules/input/inputtest_drv.so -%{_libdir}/xorg/modules/libfbdevhw.so %{_libdir}/xorg/modules/libexa.so +%{_libdir}/xorg/modules/libfbdevhw.so #%%{_libdir}/xorg/modules/libfb.so %{_libdir}/xorg/modules/libglamoregl.so +%if !0%{?rhel} +%{_libdir}/xorg/modules/libint10.so +%endif %{_libdir}/xorg/modules/libshadow.so %{_libdir}/xorg/modules/libshadowfb.so %{_libdir}/xorg/modules/libvgahw.so %{_libdir}/xorg/modules/libwfb.so -%if !0%{?rhel} -%{_libdir}/xorg/modules/libint10.so -%endif %{_mandir}/man1/gtf.1* %{_mandir}/man1/Xorg.1* %{_mandir}/man1/Xorg.wrap.1* -%{_mandir}/man4/fbdevhw.4* %{_mandir}/man4/exa.4* -%{_mandir}/man4//inputtestdrv.4* +%{_mandir}/man4/fbdevhw.4* +%{_mandir}/man4/inputtestdrv.4* %{_mandir}/man4/modesetting.4* -%{_mandir}/man5/Xwrapper.config.5* %{_mandir}/man5/xorg.conf.5* %{_mandir}/man5/xorg.conf.d.5* +%{_mandir}/man5/Xwrapper.config.5* %dir %{_sysconfdir}/X11/xorg.conf.d %dir %{_datadir}/X11/xorg.conf.d %{_datadir}/X11/xorg.conf.d/10-quirks.conf @@ -422,7 +412,6 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %files devel %doc COPYING -#{_docdir}/xorg-server %{_bindir}/xserver-sdk-abi-requires %{_libdir}/pkgconfig/xorg-server.pc %dir %{_includedir}/xorg @@ -438,6 +427,7 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete - Switch to meson, drop no longer required patch. - Drop Obsoletes/Provides that have been removed in ~2014. - Add build depdendencies as they are searched by meson. +- Format SPEC file. * Thu Sep 26 2024 Simone Caronni - 21.1.13-2 - Drop support for building snapshots. If they need to be built, there are From 0bb198b86b42203bdb39600b6630a5be39fbba3e Mon Sep 17 00:00:00 2001 From: Simone Caronni Date: Fri, 27 Sep 2024 13:34:16 +0200 Subject: [PATCH 113/131] Adjust int10/unwind conditionals --- xorg-x11-server.spec | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index c206d12..3ffc437 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -14,6 +14,12 @@ %global pkgname xorg-server +%ifarch %{ix86} x86_64 +%bcond int10 %[!0%{?rhel}] +%endif + +%bcond unwind %[!0%{?rhel}] + Summary: X.Org X11 X server Name: xorg-x11-server Version: 21.1.13 @@ -47,6 +53,7 @@ Patch4: 0001-ephyr-Fix-incompatible-pointer-type-build-error.patch BuildRequires: bison BuildRequires: flex +BuildRequires: gawk BuildRequires: gcc BuildRequires: kernel-headers BuildRequires: libXi-devel @@ -76,7 +83,7 @@ BuildRequires: pkgconfig(libdrm) >= 2.4.89 BuildRequires: pkgconfig(libselinux) >= 2.0.86 BuildRequires: pkgconfig(libsystemd) >= 209 BuildRequires: pkgconfig(libudev) >= 143 -%if !0%{?rhel} +%if %{with unwind} BuildRequires: pkgconfig(libunwind) %endif BuildRequires: pkgconfig(libxcvt) @@ -264,9 +271,9 @@ test `getminor extension` == %{extension_minor} -D glx=true \ -D hal=false \ -D input_thread=true \ - -D int10=%{?!rhel:auto}%{?rhel:false} \ + -D int10=%{!?with_int10:false}%{?with_int10:auto} \ -D ipv6=true \ - -D libunwind=%{?!rhel:true}%{?rhel:false} \ + -D libunwind=%{!?with_unwind:false}%{?with_unwind:true} \ -D linux_acpi=false \ -D linux_apm=false \ -D listen_local=true \ @@ -339,13 +346,11 @@ xargs tar cf - | (cd %{inst_srcdir} && tar xf -) find %{inst_srcdir}/hw/xfree86 -name \*.c -delete # Remove unwanted files/dirs -{ - find %{buildroot} -type f -name '*.la' | xargs rm -f -- || : +find %{buildroot} -type f -name '*.la' -delete # wtf -%ifnarch %{ix86} x86_64 - rm -f %{buildroot}%{_libdir}/xorg/modules/lib{int10,vbe}.so +%if %{without int10} +rm -f %{buildroot}%{_libdir}/xorg/modules/lib{int10,vbe}.so %endif -} %files common @@ -376,7 +381,7 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %{_libdir}/xorg/modules/libfbdevhw.so #%%{_libdir}/xorg/modules/libfb.so %{_libdir}/xorg/modules/libglamoregl.so -%if !0%{?rhel} +%if %{with int10} %{_libdir}/xorg/modules/libint10.so %endif %{_libdir}/xorg/modules/libshadow.so From 51ae8aa675a59872cb22f739e0203fcda27b7b6d Mon Sep 17 00:00:00 2001 From: Simone Caronni Date: Sat, 28 Sep 2024 19:31:32 +0200 Subject: [PATCH 114/131] Remove all conditionals. Drop int10 everywhere and enable libunwind/dri3 on ELN. --- xorg-x11-server.spec | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 3ffc437..9db53cb 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -14,16 +14,10 @@ %global pkgname xorg-server -%ifarch %{ix86} x86_64 -%bcond int10 %[!0%{?rhel}] -%endif - -%bcond unwind %[!0%{?rhel}] - Summary: X.Org X11 X server Name: xorg-x11-server Version: 21.1.13 -Release: 3%{?dist} +Release: 4%{?dist} URL: http://www.x.org # SPDX License: Adobe-Display-PostScript AND BSD-3-Clause AND DEC-3-Clause AND HPND AND HPND-sell-MIT-disclaimer-xserver AND HPND-sell-variant AND ICU AND ISC AND MIT AND MIT-open-group AND NTP AND SGI-B-2.0 AND SMLNJ AND X11 AND X11-distribute-modifications-variant @@ -83,9 +77,7 @@ BuildRequires: pkgconfig(libdrm) >= 2.4.89 BuildRequires: pkgconfig(libselinux) >= 2.0.86 BuildRequires: pkgconfig(libsystemd) >= 209 BuildRequires: pkgconfig(libudev) >= 143 -%if %{with unwind} BuildRequires: pkgconfig(libunwind) -%endif BuildRequires: pkgconfig(libxcvt) BuildRequires: pkgconfig(openssl) BuildRequires: pkgconfig(pciaccess) >= 0.12.901 @@ -263,7 +255,7 @@ test `getminor extension` == %{extension_minor} -D dpms=true \ -D dri1=false \ -D dri2=true \ - -D dri3=%{?!rhel:true}%{?rhel:false} \ + -D dri3=true \ -D drm=true \ -D dtrace=false \ -D fallback_input_driver=libinput \ @@ -271,9 +263,9 @@ test `getminor extension` == %{extension_minor} -D glx=true \ -D hal=false \ -D input_thread=true \ - -D int10=%{!?with_int10:false}%{?with_int10:auto} \ + -D int10=false \ -D ipv6=true \ - -D libunwind=%{!?with_unwind:false}%{?with_unwind:true} \ + -D libunwind=true \ -D linux_acpi=false \ -D linux_apm=false \ -D listen_local=true \ @@ -347,10 +339,6 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete # Remove unwanted files/dirs find %{buildroot} -type f -name '*.la' -delete -# wtf -%if %{without int10} -rm -f %{buildroot}%{_libdir}/xorg/modules/lib{int10,vbe}.so -%endif %files common @@ -381,9 +369,6 @@ rm -f %{buildroot}%{_libdir}/xorg/modules/lib{int10,vbe}.so %{_libdir}/xorg/modules/libfbdevhw.so #%%{_libdir}/xorg/modules/libfb.so %{_libdir}/xorg/modules/libglamoregl.so -%if %{with int10} -%{_libdir}/xorg/modules/libint10.so -%endif %{_libdir}/xorg/modules/libshadow.so %{_libdir}/xorg/modules/libshadowfb.so %{_libdir}/xorg/modules/libvgahw.so @@ -428,6 +413,10 @@ rm -f %{buildroot}%{_libdir}/xorg/modules/lib{int10,vbe}.so %changelog +* Sat Sep 28 2024 Simone Caronni - 21.1.13-4 +- Remove all conditionals. Drop int10 everywhere and enable libunwind/dri3 on + ELN. + * Fri Sep 27 2024 Simone Caronni - 21.1.13-3 - Switch to meson, drop no longer required patch. - Drop Obsoletes/Provides that have been removed in ~2014. From 083eae606156350e911d9ad663a9219a92dbe363 Mon Sep 17 00:00:00 2001 From: Simone Caronni Date: Mon, 30 Sep 2024 09:46:44 +0200 Subject: [PATCH 115/131] Obsolete vesa and fbdev drivers --- xorg-x11-server.spec | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 9db53cb..5804e84 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -17,7 +17,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 21.1.13 -Release: 4%{?dist} +Release: 5%{?dist} URL: http://www.x.org # SPDX License: Adobe-Display-PostScript AND BSD-3-Clause AND DEC-3-Clause AND HPND AND HPND-sell-MIT-disclaimer-xserver AND HPND-sell-variant AND ICU AND ISC AND MIT AND MIT-open-group AND NTP AND SGI-B-2.0 AND SMLNJ AND X11 AND X11-distribute-modifications-variant @@ -145,6 +145,10 @@ Provides: xserver-abi(extension-%{extension_major}) = %{extension_minor} # Dropped from xorg-x11-server-21.1 # https://gitlab.freedesktop.org/xorg/xserver/-/commit/b3b81c8c2090cd49410960a021baf0d27fdd2ab3 Obsoletes: xorg-x11-server-Xdmx < 1.20.15 +# Legacy fbdev devices have been replaced with simpledrm: +# https://fedoraproject.org/wiki/Changes/ReplaceFbdevDrivers +Obsoletes: xorg-x11-drv-fbdev < 0.5.0-19 +Obsoletes: xorg-x11-drv-vesa < 2.6.0-3 %description Xorg X.org X11 is an open source implementation of the X Window System. It provides @@ -413,6 +417,10 @@ find %{buildroot} -type f -name '*.la' -delete %changelog +* Mon Sep 30 2024 Simone Caronni - 21.1.13-5 +- After removal of int10/vbe, obsolete vesa and fbdev X drivers: + https://fedoraproject.org/wiki/Changes/ReplaceFbdevDrivers + * Sat Sep 28 2024 Simone Caronni - 21.1.13-4 - Remove all conditionals. Drop int10 everywhere and enable libunwind/dri3 on ELN. From db932d9182321cb6fa2896b8d9987f1b4dd187b4 Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Wed, 16 Oct 2024 10:16:17 +0100 Subject: [PATCH 116/131] Obsolete xorg-x11-drv-armsoc --- xorg-x11-server.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 5804e84..72315c0 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -17,7 +17,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 21.1.13 -Release: 5%{?dist} +Release: 6%{?dist} URL: http://www.x.org # SPDX License: Adobe-Display-PostScript AND BSD-3-Clause AND DEC-3-Clause AND HPND AND HPND-sell-MIT-disclaimer-xserver AND HPND-sell-variant AND ICU AND ISC AND MIT AND MIT-open-group AND NTP AND SGI-B-2.0 AND SMLNJ AND X11 AND X11-distribute-modifications-variant @@ -149,6 +149,7 @@ Obsoletes: xorg-x11-server-Xdmx < 1.20.15 # https://fedoraproject.org/wiki/Changes/ReplaceFbdevDrivers Obsoletes: xorg-x11-drv-fbdev < 0.5.0-19 Obsoletes: xorg-x11-drv-vesa < 2.6.0-3 +Obsoletes: xorg-x11-drv-armsoc < 1.4.1-10 %description Xorg X.org X11 is an open source implementation of the X Window System. It provides @@ -417,6 +418,9 @@ find %{buildroot} -type f -name '*.la' -delete %changelog +* Wed Oct 16 2024 Peter Robinson +- Obsolete xorg-x11-drv-armsoc + * Mon Sep 30 2024 Simone Caronni - 21.1.13-5 - After removal of int10/vbe, obsolete vesa and fbdev X drivers: https://fedoraproject.org/wiki/Changes/ReplaceFbdevDrivers From d53e48508bdc6bf7812d2264fa3cfd6b4163db56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Exp=C3=B3sito?= Date: Tue, 29 Oct 2024 18:18:29 +0100 Subject: [PATCH 117/131] Update to v21.1.14 --- ...ncompatible-pointer-type-build-error.patch | 54 ------------------- sources | 2 +- xorg-x11-server.spec | 10 ++-- 3 files changed, 6 insertions(+), 60 deletions(-) delete mode 100644 0001-ephyr-Fix-incompatible-pointer-type-build-error.patch diff --git a/0001-ephyr-Fix-incompatible-pointer-type-build-error.patch b/0001-ephyr-Fix-incompatible-pointer-type-build-error.patch deleted file mode 100644 index 345e660..0000000 --- a/0001-ephyr-Fix-incompatible-pointer-type-build-error.patch +++ /dev/null @@ -1,54 +0,0 @@ -From e89edec497bac581ca9b614fb00c25365580f045 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Jos=C3=A9=20Exp=C3=B3sito?= -Date: Fri, 19 Jan 2024 13:05:51 +0100 -Subject: [PATCH] ephyr: Fix incompatible pointer type build error -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Fix a compilation error on 32 bits architectures with gcc 14: - - ephyr_glamor_xv.c: In function ‘ephyr_glamor_xv_init’: - ephyr_glamor_xv.c:154:31: error: assignment to ‘SetPortAttributeFuncPtr’ {aka ‘int (*)(struct _KdScreenInfo *, long unsigned int, int, void *)’} from incompatible pointer type ‘int (*)(KdScreenInfo *, Atom, INT32, void *)’ {aka ‘int (*)(struct _KdScreenInfo *, long unsigned int, long int, void *)’} [-Wincompatible-pointer-types] - 154 | adaptor->SetPortAttribute = ephyr_glamor_xv_set_port_attribute; - | ^ - ephyr_glamor_xv.c:155:31: error: assignment to ‘GetPortAttributeFuncPtr’ {aka ‘int (*)(struct _KdScreenInfo *, long unsigned int, int *, void *)’} from incompatible pointer type ‘int (*)(KdScreenInfo *, Atom, INT32 *, void *)’ {aka ‘int (*)(struct _KdScreenInfo *, long unsigned int, long int *, void *)’} [-Wincompatible-pointer-types] - 155 | adaptor->GetPortAttribute = ephyr_glamor_xv_get_port_attribute; - | ^ - -Build error logs: -https://koji.fedoraproject.org/koji/taskinfo?taskID=111964273 - -Signed-off-by: José Expósito ---- - hw/kdrive/ephyr/ephyr_glamor_xv.c | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/hw/kdrive/ephyr/ephyr_glamor_xv.c b/hw/kdrive/ephyr/ephyr_glamor_xv.c -index 4dd15cf41..b5eae48c8 100644 ---- a/hw/kdrive/ephyr/ephyr_glamor_xv.c -+++ b/hw/kdrive/ephyr/ephyr_glamor_xv.c -@@ -50,16 +50,16 @@ ephyr_glamor_xv_stop_video(KdScreenInfo *screen, void *data, Bool cleanup) - - static int - ephyr_glamor_xv_set_port_attribute(KdScreenInfo *screen, -- Atom attribute, INT32 value, void *data) -+ Atom attribute, int value, void *data) - { -- return glamor_xv_set_port_attribute(data, attribute, value); -+ return glamor_xv_set_port_attribute(data, attribute, (INT32)value); - } - - static int - ephyr_glamor_xv_get_port_attribute(KdScreenInfo *screen, -- Atom attribute, INT32 *value, void *data) -+ Atom attribute, int *value, void *data) - { -- return glamor_xv_get_port_attribute(data, attribute, value); -+ return glamor_xv_get_port_attribute(data, attribute, (INT32 *)value); - } - - static void --- -2.43.0 - diff --git a/sources b/sources index 475e678..7aa13d9 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (xorg-server-21.1.13.tar.xz) = a55fbeeed227c12c67f166f2c06a7f4f8d78feeea04c6e73509dbc723185fd0772349aa23f7c44cf0828ac0a0e2f9e4b26cffb220e6dfa7186d60f88b25ccaf1 +SHA512 (xorg-server-21.1.14.tar.xz) = 833d36ca4a409363dc021a50702bc29dbb32d074de319d6910a158b6e4d8f51a20c3b0de0486d9613d4e526fe4fd60ca306b3c9fcce7d014ca8cc10185afd973 diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 72315c0..aec1963 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -16,8 +16,8 @@ Summary: X.Org X11 X server Name: xorg-x11-server -Version: 21.1.13 -Release: 6%{?dist} +Version: 21.1.14 +Release: 1%{?dist} URL: http://www.x.org # SPDX License: Adobe-Display-PostScript AND BSD-3-Clause AND DEC-3-Clause AND HPND AND HPND-sell-MIT-disclaimer-xserver AND HPND-sell-variant AND ICU AND ISC AND MIT AND MIT-open-group AND NTP AND SGI-B-2.0 AND SMLNJ AND X11 AND X11-distribute-modifications-variant @@ -41,9 +41,6 @@ Patch1: 0001-xfree86-use-modesetting-driver-by-default-on-GeForce.patch Patch2: 0001-xf86-dri2-Use-va_gl-as-vdpau_driver-for-Intel-i965-G.patch # because the display-managers are not ready yet, do not upstream Patch3: 0001-Fedora-hack-Make-the-suid-root-wrapper-always-start-.patch -# Fix compilation error on i686 (21.1.14+) -# https://gitlab.freedesktop.org/xorg/xserver/-/commit/8407181c7dfe14086d99697af0b86120320ab73e -Patch4: 0001-ephyr-Fix-incompatible-pointer-type-build-error.patch BuildRequires: bison BuildRequires: flex @@ -418,6 +415,9 @@ find %{buildroot} -type f -name '*.la' -delete %changelog +* Tue Oct 29 2024 José Expósito - 21.1.14-1 +- Update to v21.1.14 + * Wed Oct 16 2024 Peter Robinson - Obsolete xorg-x11-drv-armsoc From 28edf326d982c10de016326fa90c8813841c9912 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Exp=C3=B3sito?= Date: Wed, 27 Nov 2024 09:52:42 +0100 Subject: [PATCH 118/131] Fix error copying Xorg.wrap Building the latest Rawhide code fails with this error: objcopy: unable to copy file '/builddir/build/BUILD/xorg-x11-server-21.1.14-build/BUILDROOT/usr/libexec/Xorg.wrap'; reason: Permission denied Upstream patch 09cd65233e0f ("xfree86: Set appropriate install_mode for suid_wrapper") changed the permissions of Xorg.wrap at install time, preventing it from being copied. Revert the patch to be able to build the X.Org server again. For reference, after reverting the upstream patch, the permissions of Xorg.wrap matches the permissions in my system: $ rpm -qlvp xorg-x11-server-Xorg-21.1.14-2.fc42.x86_64.rpm [...] -rwsr-xr-x 1 root root 16256 Nov 18 01:00 /usr/libexec/Xorg.wrap $ ll /usr/libexec/Xorg.wrap -rwsr-xr-x. 1 root root 15K Oct 29 01:00 /usr/libexec/Xorg.wrap --- ...et-appropriate-install_mode-for-suid.patch | 27 +++++++++++++++++++ xorg-x11-server.spec | 1 + 2 files changed, 28 insertions(+) create mode 100644 0001-Revert-xfree86-Set-appropriate-install_mode-for-suid.patch diff --git a/0001-Revert-xfree86-Set-appropriate-install_mode-for-suid.patch b/0001-Revert-xfree86-Set-appropriate-install_mode-for-suid.patch new file mode 100644 index 0000000..9bb86c6 --- /dev/null +++ b/0001-Revert-xfree86-Set-appropriate-install_mode-for-suid.patch @@ -0,0 +1,27 @@ +From f093f6192d4b145e76b6514634fd013bcd915e01 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jos=C3=A9=20Exp=C3=B3sito?= +Date: Wed, 27 Nov 2024 09:33:50 +0100 +Subject: [PATCH] Revert "xfree86: Set appropriate install_mode for + suid_wrapper" + +This reverts commit 09cd65233e0f5c04e7e3d063decf357f239a65f6. +--- + hw/xfree86/meson.build | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/hw/xfree86/meson.build b/hw/xfree86/meson.build +index c4db85cdb..78c023d12 100644 +--- a/hw/xfree86/meson.build ++++ b/hw/xfree86/meson.build +@@ -152,7 +152,7 @@ if get_option('suid_wrapper') + c_args: xorg_c_args, + install: true, + install_dir: get_option('libexecdir'), +- install_mode: ['r-sr-xr-x', 0, 0], ++ # install_mode: ['r-sr-xr-x', 0, 0], + ) + + # meson gets confused when there are two targets of the same name +-- +2.47.0 + diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index aec1963..3f4b98e 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -41,6 +41,7 @@ Patch1: 0001-xfree86-use-modesetting-driver-by-default-on-GeForce.patch Patch2: 0001-xf86-dri2-Use-va_gl-as-vdpau_driver-for-Intel-i965-G.patch # because the display-managers are not ready yet, do not upstream Patch3: 0001-Fedora-hack-Make-the-suid-root-wrapper-always-start-.patch +Patch4: 0001-Revert-xfree86-Set-appropriate-install_mode-for-suid.patch BuildRequires: bison BuildRequires: flex From 6b1c1806e3e1aa3138d07fef07dea709842d162d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Exp=C3=B3sito?= Date: Wed, 27 Nov 2024 09:53:39 +0100 Subject: [PATCH 119/131] Restore quirks for Apple silicon Fixes: 422064e45a42 ("Update X11-server to 21.1.13 and ABI numbers of videodrv and xinput") Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2152414 --- 0001-add-a-quirk-for-apple-silicon.patch | 30 ++++++++++++++++++++++++ xorg-x11-server.spec | 10 +++++++- 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 0001-add-a-quirk-for-apple-silicon.patch diff --git a/0001-add-a-quirk-for-apple-silicon.patch b/0001-add-a-quirk-for-apple-silicon.patch new file mode 100644 index 0000000..17c40e5 --- /dev/null +++ b/0001-add-a-quirk-for-apple-silicon.patch @@ -0,0 +1,30 @@ +commit 39934a656a44722d16a80bf4db411c53e2d67b38 (HEAD -> master, origin/master, origin/HEAD) +Author: Eric Curtin +Date: Fri Dec 16 11:10:12 2022 +0000 + + config: add a quirk for Apple Silicon appledrm + + Xorg server does not correctly select the DCP for the display without a + quirk on Apple Silicon. + + Signed-off-by: Eric Curtin + Suggested-by: Hector Martin + +diff --git a/config/10-quirks.conf b/config/10-quirks.conf +index 47907d82d..54dd908a7 100644 +--- a/config/10-quirks.conf ++++ b/config/10-quirks.conf +@@ -36,3 +36,13 @@ Section "InputClass" + MatchDriver "evdev" + Option "TypeName" "MOUSE" + EndSection ++ ++# https://bugzilla.redhat.com/show_bug.cgi?id=2152414 ++# Xorg server does not correctly select the DCP for the display without ++# a quirk on Apple Silicon ++Section "OutputClass" ++ Identifier "appledrm" ++ MatchDriver "apple" ++ Driver "modesetting" ++ Option "PrimaryGPU" "true" ++EndSection diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 3f4b98e..077f6ad 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -17,7 +17,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 21.1.14 -Release: 1%{?dist} +Release: 2%{?dist} URL: http://www.x.org # SPDX License: Adobe-Display-PostScript AND BSD-3-Clause AND DEC-3-Clause AND HPND AND HPND-sell-MIT-disclaimer-xserver AND HPND-sell-variant AND ICU AND ISC AND MIT AND MIT-open-group AND NTP AND SGI-B-2.0 AND SMLNJ AND X11 AND X11-distribute-modifications-variant @@ -42,6 +42,8 @@ Patch2: 0001-xf86-dri2-Use-va_gl-as-vdpau_driver-for-Intel-i965-G.patch # because the display-managers are not ready yet, do not upstream Patch3: 0001-Fedora-hack-Make-the-suid-root-wrapper-always-start-.patch Patch4: 0001-Revert-xfree86-Set-appropriate-install_mode-for-suid.patch +# https://bugzilla.redhat.com/show_bug.cgi?id=2326701 +Patch5: 0001-add-a-quirk-for-apple-silicon.patch BuildRequires: bison BuildRequires: flex @@ -416,6 +418,12 @@ find %{buildroot} -type f -name '*.la' -delete %changelog +* Mon Nov 18 2024 José Expósito - 21.1.14-2 +- Fix build issues caused by Xorg.wrap +- Restore quirks for Apple silicon + Fixes: 422064e45a42 ("Update X11-server to 21.1.13 and ABI numbers of videodrv and xinput") + Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2326701 + * Tue Oct 29 2024 José Expósito - 21.1.14-1 - Update to v21.1.14 From cb5f4ca65c1249426c7a6b1a50f5db6003aa2de6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20M=2E=20Basto?= Date: Fri, 29 Nov 2024 00:07:55 +0000 Subject: [PATCH 120/131] Revert commit "Fix error copying Xorg.wrap", debugedit-5.1-2 have the real fix --- ...et-appropriate-install_mode-for-suid.patch | 27 ------------------- xorg-x11-server.spec | 6 +++-- 2 files changed, 4 insertions(+), 29 deletions(-) delete mode 100644 0001-Revert-xfree86-Set-appropriate-install_mode-for-suid.patch diff --git a/0001-Revert-xfree86-Set-appropriate-install_mode-for-suid.patch b/0001-Revert-xfree86-Set-appropriate-install_mode-for-suid.patch deleted file mode 100644 index 9bb86c6..0000000 --- a/0001-Revert-xfree86-Set-appropriate-install_mode-for-suid.patch +++ /dev/null @@ -1,27 +0,0 @@ -From f093f6192d4b145e76b6514634fd013bcd915e01 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Jos=C3=A9=20Exp=C3=B3sito?= -Date: Wed, 27 Nov 2024 09:33:50 +0100 -Subject: [PATCH] Revert "xfree86: Set appropriate install_mode for - suid_wrapper" - -This reverts commit 09cd65233e0f5c04e7e3d063decf357f239a65f6. ---- - hw/xfree86/meson.build | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/hw/xfree86/meson.build b/hw/xfree86/meson.build -index c4db85cdb..78c023d12 100644 ---- a/hw/xfree86/meson.build -+++ b/hw/xfree86/meson.build -@@ -152,7 +152,7 @@ if get_option('suid_wrapper') - c_args: xorg_c_args, - install: true, - install_dir: get_option('libexecdir'), -- install_mode: ['r-sr-xr-x', 0, 0], -+ # install_mode: ['r-sr-xr-x', 0, 0], - ) - - # meson gets confused when there are two targets of the same name --- -2.47.0 - diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 077f6ad..5bc1630 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -17,7 +17,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 21.1.14 -Release: 2%{?dist} +Release: 3%{?dist} URL: http://www.x.org # SPDX License: Adobe-Display-PostScript AND BSD-3-Clause AND DEC-3-Clause AND HPND AND HPND-sell-MIT-disclaimer-xserver AND HPND-sell-variant AND ICU AND ISC AND MIT AND MIT-open-group AND NTP AND SGI-B-2.0 AND SMLNJ AND X11 AND X11-distribute-modifications-variant @@ -41,7 +41,6 @@ Patch1: 0001-xfree86-use-modesetting-driver-by-default-on-GeForce.patch Patch2: 0001-xf86-dri2-Use-va_gl-as-vdpau_driver-for-Intel-i965-G.patch # because the display-managers are not ready yet, do not upstream Patch3: 0001-Fedora-hack-Make-the-suid-root-wrapper-always-start-.patch -Patch4: 0001-Revert-xfree86-Set-appropriate-install_mode-for-suid.patch # https://bugzilla.redhat.com/show_bug.cgi?id=2326701 Patch5: 0001-add-a-quirk-for-apple-silicon.patch @@ -418,6 +417,9 @@ find %{buildroot} -type f -name '*.la' -delete %changelog +* Fri Nov 29 2024 Sérgio Basto - 21.1.14-3 +- Revert commit "Fix error copying Xorg.wrap", debugedit-5.1-2 have the real fix + * Mon Nov 18 2024 José Expósito - 21.1.14-2 - Fix build issues caused by Xorg.wrap - Restore quirks for Apple silicon From e3a0a54473c7d63df39467bdf0b093fedb25a962 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Exp=C3=B3sito?= Date: Fri, 20 Dec 2024 08:50:05 +0100 Subject: [PATCH 121/131] Update to v21.1.15 Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2332880 --- 0001-add-a-quirk-for-apple-silicon.patch | 30 ------------------------ sources | 2 +- xorg-x11-server.spec | 9 +++---- 3 files changed, 6 insertions(+), 35 deletions(-) delete mode 100644 0001-add-a-quirk-for-apple-silicon.patch diff --git a/0001-add-a-quirk-for-apple-silicon.patch b/0001-add-a-quirk-for-apple-silicon.patch deleted file mode 100644 index 17c40e5..0000000 --- a/0001-add-a-quirk-for-apple-silicon.patch +++ /dev/null @@ -1,30 +0,0 @@ -commit 39934a656a44722d16a80bf4db411c53e2d67b38 (HEAD -> master, origin/master, origin/HEAD) -Author: Eric Curtin -Date: Fri Dec 16 11:10:12 2022 +0000 - - config: add a quirk for Apple Silicon appledrm - - Xorg server does not correctly select the DCP for the display without a - quirk on Apple Silicon. - - Signed-off-by: Eric Curtin - Suggested-by: Hector Martin - -diff --git a/config/10-quirks.conf b/config/10-quirks.conf -index 47907d82d..54dd908a7 100644 ---- a/config/10-quirks.conf -+++ b/config/10-quirks.conf -@@ -36,3 +36,13 @@ Section "InputClass" - MatchDriver "evdev" - Option "TypeName" "MOUSE" - EndSection -+ -+# https://bugzilla.redhat.com/show_bug.cgi?id=2152414 -+# Xorg server does not correctly select the DCP for the display without -+# a quirk on Apple Silicon -+Section "OutputClass" -+ Identifier "appledrm" -+ MatchDriver "apple" -+ Driver "modesetting" -+ Option "PrimaryGPU" "true" -+EndSection diff --git a/sources b/sources index 7aa13d9..0ba10a5 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (xorg-server-21.1.14.tar.xz) = 833d36ca4a409363dc021a50702bc29dbb32d074de319d6910a158b6e4d8f51a20c3b0de0486d9613d4e526fe4fd60ca306b3c9fcce7d014ca8cc10185afd973 +SHA512 (xorg-server-21.1.15.tar.xz) = 677bbec81ecdd1d14e1d289a00c40249988985ec636e5473b30c4f63bad03a6cc5f9168cea94969e1550370eee8863595bc9c064c3d218a96123afc7567bf363 diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 5bc1630..7b79c3b 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -16,8 +16,8 @@ Summary: X.Org X11 X server Name: xorg-x11-server -Version: 21.1.14 -Release: 3%{?dist} +Version: 21.1.15 +Release: 1%{?dist} URL: http://www.x.org # SPDX License: Adobe-Display-PostScript AND BSD-3-Clause AND DEC-3-Clause AND HPND AND HPND-sell-MIT-disclaimer-xserver AND HPND-sell-variant AND ICU AND ISC AND MIT AND MIT-open-group AND NTP AND SGI-B-2.0 AND SMLNJ AND X11 AND X11-distribute-modifications-variant @@ -41,8 +41,6 @@ Patch1: 0001-xfree86-use-modesetting-driver-by-default-on-GeForce.patch Patch2: 0001-xf86-dri2-Use-va_gl-as-vdpau_driver-for-Intel-i965-G.patch # because the display-managers are not ready yet, do not upstream Patch3: 0001-Fedora-hack-Make-the-suid-root-wrapper-always-start-.patch -# https://bugzilla.redhat.com/show_bug.cgi?id=2326701 -Patch5: 0001-add-a-quirk-for-apple-silicon.patch BuildRequires: bison BuildRequires: flex @@ -417,6 +415,9 @@ find %{buildroot} -type f -name '*.la' -delete %changelog +* Fri Dec 20 2024 José Expósito - 21.1.15-1 +- Update to v21.1.15 + * Fri Nov 29 2024 Sérgio Basto - 21.1.14-3 - Revert commit "Fix error copying Xorg.wrap", debugedit-5.1-2 have the real fix From 928204fc3981ab85b5b81932001c2efeca6d68c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20M=2E=20Basto?= Date: Tue, 31 Dec 2024 17:57:55 +0000 Subject: [PATCH 122/131] Remove this unused patch which have characters that flagged by the automatic scanning tools. This pach is already in upstream code, as this patch have characters that are flagged by the automatic scanning tools, it was remove from previous commits to avoid delays. Now that we already rebase xorg-x11-server to 21.x and shipped in F41, we can complete the cleanup --- ...artz-Remove-invalid-Unicode-sequence.patch | 30 ------------------- 1 file changed, 30 deletions(-) delete mode 100644 0001-xquartz-Remove-invalid-Unicode-sequence.patch diff --git a/0001-xquartz-Remove-invalid-Unicode-sequence.patch b/0001-xquartz-Remove-invalid-Unicode-sequence.patch deleted file mode 100644 index 926849e..0000000 --- a/0001-xquartz-Remove-invalid-Unicode-sequence.patch +++ /dev/null @@ -1,30 +0,0 @@ -From a7ba1e9fe41019296a0f3ddff3d681f77e041ad7 Mon Sep 17 00:00:00 2001 -From: Olivier Fourdan -Date: Tue, 7 May 2024 18:04:02 +0200 -Subject: [PATCH] xquartz: Remove invalid Unicode sequence - -This is flagged by the automatic scanning tools. - -Signed-off-by: Olivier Fourdan -Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1673 -Part-of: ---- - hw/xquartz/bundle/Resources/he.lproj/main.nib/designable.nib | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/hw/xquartz/bundle/Resources/he.lproj/main.nib/designable.nib b/hw/xquartz/bundle/Resources/he.lproj/main.nib/designable.nib -index e56c1adbc..42042a18d 100644 ---- a/hw/xquartz/bundle/Resources/he.lproj/main.nib/designable.nib -+++ b/hw/xquartz/bundle/Resources/he.lproj/main.nib/designable.nib -@@ -438,7 +438,7 @@ - - - -- -+ - - - --- -2.45.0 - From 3e4c792ded00f648fa6962c854aeb548c2db7ec7 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sun, 19 Jan 2025 16:10:32 +0000 Subject: [PATCH 123/131] Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild --- xorg-x11-server.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 7b79c3b..8001dbb 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -17,7 +17,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 21.1.15 -Release: 1%{?dist} +Release: 2%{?dist} URL: http://www.x.org # SPDX License: Adobe-Display-PostScript AND BSD-3-Clause AND DEC-3-Clause AND HPND AND HPND-sell-MIT-disclaimer-xserver AND HPND-sell-variant AND ICU AND ISC AND MIT AND MIT-open-group AND NTP AND SGI-B-2.0 AND SMLNJ AND X11 AND X11-distribute-modifications-variant @@ -415,6 +415,9 @@ find %{buildroot} -type f -name '*.la' -delete %changelog +* Sun Jan 19 2025 Fedora Release Engineering - 21.1.15-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild + * Fri Dec 20 2024 José Expósito - 21.1.15-1 - Update to v21.1.15 From 572824c02838f507eae74def293150579d64e5db Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Tue, 25 Feb 2025 10:51:32 +0100 Subject: [PATCH 124/131] Fix DRI2 failure Resolves: #2347345 --- ...inst-dri2ClientPrivate-assertion-fai.patch | 67 +++++++++++++++++++ xorg-x11-server.spec | 8 +++ 2 files changed, 75 insertions(+) create mode 100644 0001-dri2-Protect-against-dri2ClientPrivate-assertion-fai.patch diff --git a/0001-dri2-Protect-against-dri2ClientPrivate-assertion-fai.patch b/0001-dri2-Protect-against-dri2ClientPrivate-assertion-fai.patch new file mode 100644 index 0000000..0c3a7bb --- /dev/null +++ b/0001-dri2-Protect-against-dri2ClientPrivate-assertion-fai.patch @@ -0,0 +1,67 @@ +From e71d86dafbca036f32455caa25c2733c069a5010 Mon Sep 17 00:00:00 2001 +From: Doug Brown +Date: Mon, 15 Jul 2024 19:44:23 -0700 +Subject: [PATCH xserver] dri2: Protect against dri2ClientPrivate assertion + failures +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +If DRI2ScreenInit hasn't been called yet, DRI2Authenticate and +DRI2CreateDrawable2 cause the X server to crash. This has been observed +to happen on multiple modern Linux distros in various conditions, +including QEMU and VMware VMs. Make these functions more robust in order +to prevent the crash. + +This patch was originally provided by Bernhard Übelacker and expanded +upon by Mark Wagner. + +Signed-off-by: Doug Brown +Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1053 +Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1534 +Part-of: +(cherry picked from commit a0834009cfb10b8982a1f2b47b8ed00de254c2c3) +--- + hw/xfree86/dri2/dri2.c | 14 ++++++++++++-- + 1 file changed, 12 insertions(+), 2 deletions(-) + +diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c +index 3397bb50c..3975d40ca 100644 +--- a/hw/xfree86/dri2/dri2.c ++++ b/hw/xfree86/dri2/dri2.c +@@ -356,10 +356,15 @@ DRI2CreateDrawable2(ClientPtr client, DrawablePtr pDraw, XID id, + XID *dri2_id_out) + { + DRI2DrawablePtr pPriv; +- DRI2ClientPtr dri2_client = dri2ClientPrivate(client); ++ DRI2ClientPtr dri2_client; + XID dri2_id; + int rc; + ++ if (!dixPrivateKeyRegistered(dri2ScreenPrivateKey)) ++ return BadValue; ++ ++ dri2_client = dri2ClientPrivate(client); ++ + pPriv = DRI2GetDrawable(pDraw); + if (pPriv == NULL) + pPriv = DRI2AllocateDrawable(pDraw); +@@ -1362,9 +1367,14 @@ Bool + DRI2Authenticate(ClientPtr client, ScreenPtr pScreen, uint32_t magic) + { + DRI2ScreenPtr ds; +- DRI2ClientPtr dri2_client = dri2ClientPrivate(client); ++ DRI2ClientPtr dri2_client; + ScreenPtr primescreen; + ++ if (!dixPrivateKeyRegistered(dri2ScreenPrivateKey)) ++ return FALSE; ++ ++ dri2_client = dri2ClientPrivate(client); ++ + ds = DRI2GetScreenPrime(pScreen, dri2_client->prime_id); + if (ds == NULL) + return FALSE; +-- +2.48.1 + diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 8001dbb..c8178bb 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -42,6 +42,11 @@ Patch2: 0001-xf86-dri2-Use-va_gl-as-vdpau_driver-for-Intel-i965-G.patch # because the display-managers are not ready yet, do not upstream Patch3: 0001-Fedora-hack-Make-the-suid-root-wrapper-always-start-.patch +# https://bugzilla.redhat.com/show_bug.cgi?id=2347345 +# https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1608 +# https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1824 +Patch4: 0001-dri2-Protect-against-dri2ClientPrivate-assertion-fai.patch + BuildRequires: bison BuildRequires: flex BuildRequires: gawk @@ -415,6 +420,9 @@ find %{buildroot} -type f -name '*.la' -delete %changelog +* Tue Feb 25 2025 Olivier Fourdan - 21.1.15-3 +- Fix DRI2 failure (#2347345) + * Sun Jan 19 2025 Fedora Release Engineering - 21.1.15-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild From dd5395436b87a535ea27a644b004feeea949a4a1 Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Wed, 26 Feb 2025 09:24:14 +0100 Subject: [PATCH 125/131] Update to v21.1.16 CVE fix for: CVE-2025-26594, CVE-2025-26595, CVE-2025-26596, CVE-2025-26597, CVE-2025-26598, CVE-2025-26599, CVE-2025-26600, CVE-2025-26601 Resolves: #2347558 --- ...inst-dri2ClientPrivate-assertion-fai.patch | 67 ------------------- sources | 2 +- xorg-x11-server.spec | 16 ++--- 3 files changed, 9 insertions(+), 76 deletions(-) delete mode 100644 0001-dri2-Protect-against-dri2ClientPrivate-assertion-fai.patch diff --git a/0001-dri2-Protect-against-dri2ClientPrivate-assertion-fai.patch b/0001-dri2-Protect-against-dri2ClientPrivate-assertion-fai.patch deleted file mode 100644 index 0c3a7bb..0000000 --- a/0001-dri2-Protect-against-dri2ClientPrivate-assertion-fai.patch +++ /dev/null @@ -1,67 +0,0 @@ -From e71d86dafbca036f32455caa25c2733c069a5010 Mon Sep 17 00:00:00 2001 -From: Doug Brown -Date: Mon, 15 Jul 2024 19:44:23 -0700 -Subject: [PATCH xserver] dri2: Protect against dri2ClientPrivate assertion - failures -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -If DRI2ScreenInit hasn't been called yet, DRI2Authenticate and -DRI2CreateDrawable2 cause the X server to crash. This has been observed -to happen on multiple modern Linux distros in various conditions, -including QEMU and VMware VMs. Make these functions more robust in order -to prevent the crash. - -This patch was originally provided by Bernhard Übelacker and expanded -upon by Mark Wagner. - -Signed-off-by: Doug Brown -Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1053 -Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1534 -Part-of: -(cherry picked from commit a0834009cfb10b8982a1f2b47b8ed00de254c2c3) ---- - hw/xfree86/dri2/dri2.c | 14 ++++++++++++-- - 1 file changed, 12 insertions(+), 2 deletions(-) - -diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c -index 3397bb50c..3975d40ca 100644 ---- a/hw/xfree86/dri2/dri2.c -+++ b/hw/xfree86/dri2/dri2.c -@@ -356,10 +356,15 @@ DRI2CreateDrawable2(ClientPtr client, DrawablePtr pDraw, XID id, - XID *dri2_id_out) - { - DRI2DrawablePtr pPriv; -- DRI2ClientPtr dri2_client = dri2ClientPrivate(client); -+ DRI2ClientPtr dri2_client; - XID dri2_id; - int rc; - -+ if (!dixPrivateKeyRegistered(dri2ScreenPrivateKey)) -+ return BadValue; -+ -+ dri2_client = dri2ClientPrivate(client); -+ - pPriv = DRI2GetDrawable(pDraw); - if (pPriv == NULL) - pPriv = DRI2AllocateDrawable(pDraw); -@@ -1362,9 +1367,14 @@ Bool - DRI2Authenticate(ClientPtr client, ScreenPtr pScreen, uint32_t magic) - { - DRI2ScreenPtr ds; -- DRI2ClientPtr dri2_client = dri2ClientPrivate(client); -+ DRI2ClientPtr dri2_client; - ScreenPtr primescreen; - -+ if (!dixPrivateKeyRegistered(dri2ScreenPrivateKey)) -+ return FALSE; -+ -+ dri2_client = dri2ClientPrivate(client); -+ - ds = DRI2GetScreenPrime(pScreen, dri2_client->prime_id); - if (ds == NULL) - return FALSE; --- -2.48.1 - diff --git a/sources b/sources index 0ba10a5..c71afbe 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (xorg-server-21.1.15.tar.xz) = 677bbec81ecdd1d14e1d289a00c40249988985ec636e5473b30c4f63bad03a6cc5f9168cea94969e1550370eee8863595bc9c064c3d218a96123afc7567bf363 +SHA512 (xorg-server-21.1.16.tar.xz) = 38fd4232a293a497d13f8b57e85e84cf6a531453a7d8d5de1a77d67ceaf8714d5770951a8a21f1b3f519e83be1fc0926dce269846e75a8b11aa1062dd507f67d diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index c8178bb..ff890cc 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -16,8 +16,8 @@ Summary: X.Org X11 X server Name: xorg-x11-server -Version: 21.1.15 -Release: 2%{?dist} +Version: 21.1.16 +Release: 1%{?dist} URL: http://www.x.org # SPDX License: Adobe-Display-PostScript AND BSD-3-Clause AND DEC-3-Clause AND HPND AND HPND-sell-MIT-disclaimer-xserver AND HPND-sell-variant AND ICU AND ISC AND MIT AND MIT-open-group AND NTP AND SGI-B-2.0 AND SMLNJ AND X11 AND X11-distribute-modifications-variant @@ -42,11 +42,6 @@ Patch2: 0001-xf86-dri2-Use-va_gl-as-vdpau_driver-for-Intel-i965-G.patch # because the display-managers are not ready yet, do not upstream Patch3: 0001-Fedora-hack-Make-the-suid-root-wrapper-always-start-.patch -# https://bugzilla.redhat.com/show_bug.cgi?id=2347345 -# https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1608 -# https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1824 -Patch4: 0001-dri2-Protect-against-dri2ClientPrivate-assertion-fai.patch - BuildRequires: bison BuildRequires: flex BuildRequires: gawk @@ -420,7 +415,12 @@ find %{buildroot} -type f -name '*.la' -delete %changelog -* Tue Feb 25 2025 Olivier Fourdan - 21.1.15-3 +* Wed Feb 26 2025 Olivier Fourdan - 21.1.16-1 +- Update to xserver 21.1.16 (#2347558) +- CVE fix for: CVE-2025-26594, CVE-2025-26595, CVE-2025-26596, CVE-2025-26597, + CVE-2025-26598, CVE-2025-26599, CVE-2025-26600, CVE-2025-26601 + +* Tue Feb 25 2025 Olivier Fourdan - 21.1.15-3 - Fix DRI2 failure (#2347345) * Sun Jan 19 2025 Fedora Release Engineering - 21.1.15-2 From 5b50181e4f38bdff8a253c05106f790f5f34f1e3 Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Tue, 17 Jun 2025 16:41:21 +0200 Subject: [PATCH 126/131] Update to v21.1.17 CVE fix for: CVE-2025-49175, CVE-2025-49176, CVE-2025-49177, CVE-2025-49178, CVE-2025-49179, CVE-2025-49180 --- sources | 2 +- xorg-x11-server.spec | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/sources b/sources index c71afbe..6a837c5 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (xorg-server-21.1.16.tar.xz) = 38fd4232a293a497d13f8b57e85e84cf6a531453a7d8d5de1a77d67ceaf8714d5770951a8a21f1b3f519e83be1fc0926dce269846e75a8b11aa1062dd507f67d +SHA512 (xorg-server-21.1.17.tar.xz) = 6f301c532b2ad6edfab76f21f8e88c4bd9d7df88c12e52caaed72a2c2084547c323fd29ff8769fe0c1cb230b483d4620bc3f382df80899c6b58d3c12431d62d0 diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index ff890cc..75eb82c 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -16,7 +16,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server -Version: 21.1.16 +Version: 21.1.17 Release: 1%{?dist} URL: http://www.x.org # SPDX @@ -415,6 +415,11 @@ find %{buildroot} -type f -name '*.la' -delete %changelog +* Tue Jun 17 2025 Olivier Fourdan - 21.1.17-1 +- Update to xserver 21.1.17 +- CVE fix for: CVE-2025-49175, CVE-2025-49176, CVE-2025-49177 + CVE-2025-49178, CVE-2025-49179, CVE-2025-49180 + * Wed Feb 26 2025 Olivier Fourdan - 21.1.16-1 - Update to xserver 21.1.16 (#2347558) - CVE fix for: CVE-2025-26594, CVE-2025-26595, CVE-2025-26596, CVE-2025-26597, From 5d7ed4931eb5a7d2c3832549ad66d663f872e46d Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Wed, 18 Jun 2025 19:10:33 +0200 Subject: [PATCH 127/131] Update to v21.1.18 Contains an additional fix for CVE-2025-49176 --- sources | 2 +- xorg-x11-server.spec | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/sources b/sources index 6a837c5..fc2e23f 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (xorg-server-21.1.17.tar.xz) = 6f301c532b2ad6edfab76f21f8e88c4bd9d7df88c12e52caaed72a2c2084547c323fd29ff8769fe0c1cb230b483d4620bc3f382df80899c6b58d3c12431d62d0 +SHA512 (xorg-server-21.1.18.tar.xz) = 839ce759fc0e5405599c4cff0acf381f278d22b465b9fb9e335b5fd1c63f6d546788e4e869854026eb4b1e1a77a83b60d6fef472cf8534d45630f31b587a50dd diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 75eb82c..8924b56 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -16,7 +16,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server -Version: 21.1.17 +Version: 21.1.18 Release: 1%{?dist} URL: http://www.x.org # SPDX @@ -415,6 +415,10 @@ find %{buildroot} -type f -name '*.la' -delete %changelog +* Wed Jun 18 2025 Olivier Fourdan - 21.1.18-1 +- Update to xserver 21.1.18 +- Contains an additional fix for CVE-2025-49176 + * Tue Jun 17 2025 Olivier Fourdan - 21.1.17-1 - Update to xserver 21.1.17 - CVE fix for: CVE-2025-49175, CVE-2025-49176, CVE-2025-49177 From 96c4fa6fb3a467bccfbb84fc9ef52893285edd53 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 9 Jul 2025 08:21:37 +1000 Subject: [PATCH 128/131] Update Xvfb SPDX license identifier --- xorg-x11-server.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 8924b56..9cf48dd 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -169,7 +169,7 @@ wish to test their applications without running them on their real X server. %package Xvfb Summary: A X Windows System virtual framebuffer X server # xvfb-run is GPLv2, rest is MIT -License: MIT and GPLv2 +License: MIT and GPL-2.0-only Requires: xorg-x11-server-common >= %{version}-%{release} # required for xvfb-run Requires: xorg-x11-xauth @@ -415,6 +415,9 @@ find %{buildroot} -type f -name '*.la' -delete %changelog +* Wed Jul 09 2025 Peter Hutterer +- Update Xvfb SPDX license identifier + * Wed Jun 18 2025 Olivier Fourdan - 21.1.18-1 - Update to xserver 21.1.18 - Contains an additional fix for CVE-2025-49176 From ab69deda47e577d79cfeb6bfd8be40d4d53650cd Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 25 Jul 2025 21:00:45 +0000 Subject: [PATCH 129/131] Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild --- xorg-x11-server.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 9cf48dd..ff50dbf 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -17,7 +17,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 21.1.18 -Release: 1%{?dist} +Release: 2%{?dist} URL: http://www.x.org # SPDX License: Adobe-Display-PostScript AND BSD-3-Clause AND DEC-3-Clause AND HPND AND HPND-sell-MIT-disclaimer-xserver AND HPND-sell-variant AND ICU AND ISC AND MIT AND MIT-open-group AND NTP AND SGI-B-2.0 AND SMLNJ AND X11 AND X11-distribute-modifications-variant @@ -415,6 +415,9 @@ find %{buildroot} -type f -name '*.la' -delete %changelog +* Fri Jul 25 2025 Fedora Release Engineering - 21.1.18-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild + * Wed Jul 09 2025 Peter Hutterer - Update Xvfb SPDX license identifier From 115bb19734421bf8443a8499614f87c38e092fb1 Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Tue, 28 Oct 2025 18:28:57 +0100 Subject: [PATCH 130/131] Update to v21.1.20 CVE fix for: CVE-2025-62229, CVE-2025-62230, CVE-2025-62231 Resolves: #2406803 --- sources | 2 +- xorg-x11-server.spec | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/sources b/sources index fc2e23f..fa87b01 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (xorg-server-21.1.18.tar.xz) = 839ce759fc0e5405599c4cff0acf381f278d22b465b9fb9e335b5fd1c63f6d546788e4e869854026eb4b1e1a77a83b60d6fef472cf8534d45630f31b587a50dd +SHA512 (xorg-server-21.1.20.tar.xz) = cb83cfaaa804b39d4c6d827222439c7725ee2c6fe738d5f5ac9a406c3978ef3d7fafe9ba9fda54ba93fb37447f88edbc1e48656d5771b204945c6d67d1233f80 diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index ff50dbf..3070d65 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -16,8 +16,8 @@ Summary: X.Org X11 X server Name: xorg-x11-server -Version: 21.1.18 -Release: 2%{?dist} +Version: 21.1.20 +Release: 1%{?dist} URL: http://www.x.org # SPDX License: Adobe-Display-PostScript AND BSD-3-Clause AND DEC-3-Clause AND HPND AND HPND-sell-MIT-disclaimer-xserver AND HPND-sell-variant AND ICU AND ISC AND MIT AND MIT-open-group AND NTP AND SGI-B-2.0 AND SMLNJ AND X11 AND X11-distribute-modifications-variant @@ -415,6 +415,10 @@ find %{buildroot} -type f -name '*.la' -delete %changelog +* Tue Oct 28 2025 Olivier Fourdan - 21.1.20-1 +- Update to xserver 21.1.20 (#2406803) +- CVE fix for: CVE-2025-62229, CVE-2025-62230, CVE-2025-62231 + * Fri Jul 25 2025 Fedora Release Engineering - 21.1.18-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild From e356a592b71be6324de0c655adc8e69bfb1b4c67 Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Tue, 25 Nov 2025 14:06:02 +0100 Subject: [PATCH 131/131] Update to v21.1.21 Resolves: #2417000 --- sources | 2 +- xorg-x11-server.spec | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/sources b/sources index fa87b01..888c6f9 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (xorg-server-21.1.20.tar.xz) = cb83cfaaa804b39d4c6d827222439c7725ee2c6fe738d5f5ac9a406c3978ef3d7fafe9ba9fda54ba93fb37447f88edbc1e48656d5771b204945c6d67d1233f80 +SHA512 (xorg-server-21.1.21.tar.xz) = bb2eb4e6756eb9e38b61bd47c017da44bcf5f45f2b7a906b4bb3a56b3d791cec64abb9bf37b224efe1e4fab9cc296f3672c9b2f8e00e1cdfc54337bef63cd16c diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 3070d65..788acf9 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -16,7 +16,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server -Version: 21.1.20 +Version: 21.1.21 Release: 1%{?dist} URL: http://www.x.org # SPDX @@ -415,6 +415,9 @@ find %{buildroot} -type f -name '*.la' -delete %changelog +* Tue Nov 25 2025 Olivier Fourdan - 21.1.21-1 +- Update to xserver 21.1.21 (#2417000) + * Tue Oct 28 2025 Olivier Fourdan - 21.1.20-1 - Update to xserver 21.1.20 (#2406803) - CVE fix for: CVE-2025-62229, CVE-2025-62230, CVE-2025-62231