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.
This commit is contained in:
Olivier Fourdan 2020-10-08 10:51:11 +02:00
parent eb8a79641e
commit eaf4422969
43 changed files with 1410 additions and 194 deletions

View File

@ -0,0 +1,61 @@
From 4b6fce5975c2f931a0478cf4deeec97529b05eb6 Mon Sep 17 00:00:00 2001
From: Olivier Fourdan <ofourdan@redhat.com>
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

View File

@ -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 <hdegoede@redhat.com> From: Hans de Goede <hdegoede@redhat.com>
Date: Thu, 29 Aug 2019 14:18:28 +0200 Date: Thu, 29 Aug 2019 14:18:28 +0200
Subject: [PATCH xserver 01/24] dix: Add GetCurrentClient helper Subject: [PATCH xserver 01/24] dix: Add GetCurrentClient helper
@ -112,5 +112,5 @@ index b6e2bcfde..d65060cb6 100644
extern _X_EXPORT void SetInputCheck(HWEventQueuePtr /*c0 */ , extern _X_EXPORT void SetInputCheck(HWEventQueuePtr /*c0 */ ,
HWEventQueuePtr /*c1 */ ); HWEventQueuePtr /*c1 */ );
-- --
2.25.2 2.26.2

View File

@ -1,33 +0,0 @@
From aac28e162e5108510065ad4c323affd6deffd816 Mon Sep 17 00:00:00 2001
From: Matthieu Herrb <matthieu@herrb.eu>
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 <matthieu@herrb.eu>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
---
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

View File

@ -0,0 +1,40 @@
From 39cb95e959fab97a7e255dda1a1599b096fb0f7e Mon Sep 17 00:00:00 2001
From: Olivier Fourdan <ofourdan@redhat.com>
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

View File

@ -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 <robert.mader@posteo.de> From: Robert Mader <robert.mader@posteo.de>
Date: Mon, 22 Jan 2018 22:02:32 +0100 Date: Mon, 22 Jan 2018 22:02:32 +0100
Subject: [PATCH xserver 02/24] xwayland: Add wp_viewport wayland extension Subject: [PATCH xserver 02/24] xwayland: Add wp_viewport wayland extension
@ -81,10 +81,10 @@ index 36bf2133a..4a8d171bb 100644
xwayland_glamor = [] xwayland_glamor = []
eglstream_srcs = [] eglstream_srcs = []
diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c 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 --- a/hw/xwayland/xwayland.c
+++ b/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); wl_registry_bind(registry, id, &zxdg_output_manager_v1_interface, 1);
xwl_screen_init_xdg_output(xwl_screen); xwl_screen_init_xdg_output(xwl_screen);
} }
@ -95,7 +95,7 @@ index ed9f2e3c2..2084f2afb 100644
else if (xwl_screen->glamor) { else if (xwl_screen->glamor) {
xwl_glamor_init_wl_registry(xwl_screen, registry, id, interface, xwl_glamor_init_wl_registry(xwl_screen, registry, id, interface,
diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h 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 --- a/hw/xwayland/xwayland.h
+++ b/hw/xwayland/xwayland.h +++ b/hw/xwayland/xwayland.h
@@ -48,6 +48,7 @@ @@ -48,6 +48,7 @@
@ -115,5 +115,5 @@ index daa719209..f949ea157 100644
#define XWL_FORMAT_ARGB8888 (1 << 0) #define XWL_FORMAT_ARGB8888 (1 << 0)
-- --
2.25.2 2.26.2

View File

@ -0,0 +1,133 @@
From af4c84ce8855e84c0ad89b929bc972e884f0b8e3 Mon Sep 17 00:00:00 2001
From: Olivier Fourdan <ofourdan@redhat.com>
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

View File

@ -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 <robert.mader@posteo.de> From: Robert Mader <robert.mader@posteo.de>
Date: Tue, 2 Jul 2019 12:03:12 +0200 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/24] xwayland: Use buffer_damage instead of surface
@ -28,10 +28,10 @@ Signed-off-by: Hans de Goede <hdegoede@redhat.com>
(cherry picked from commit 7c6f17790d3aedb164481264b0f05a8a14103731) (cherry picked from commit 7c6f17790d3aedb164481264b0f05a8a14103731)
--- ---
hw/xwayland/xwayland-cursor.c | 12 ++++++------ 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.c | 29 +++++++++++++++++++++++------
hw/xwayland/xwayland.h | 3 +++ 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 diff --git a/hw/xwayland/xwayland-cursor.c b/hw/xwayland/xwayland-cursor.c
index 66720bcc0..cbc715061 100644 index 66720bcc0..cbc715061 100644
@ -64,27 +64,31 @@ index 66720bcc0..cbc715061 100644
xwl_cursor->frame_cb = wl_surface_frame(xwl_cursor->surface); xwl_cursor->frame_cb = wl_surface_frame(xwl_cursor->surface);
wl_callback_add_listener(xwl_cursor->frame_cb, &frame_listener, xwl_cursor); 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 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 --- a/hw/xwayland/xwayland-present.c
+++ b/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 */ /* Realign timer */
xwl_present_reset_timer(xwl_present_window); 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->x2 - damage_box->x1,
- damage_box->y2 - damage_box->y1); - 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->x2 - damage_box->x1,
+ damage_box->y2 - damage_box->y1); + damage_box->y2 - damage_box->y1);
wl_surface_commit(xwl_window->surface); wl_surface_commit(xwl_window->surface);
diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c 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 --- a/hw/xwayland/xwayland.c
+++ b/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; return ret;
} }
@ -101,7 +105,7 @@ index 2084f2afb..942981834 100644
static void static void
xwl_window_post_damage(struct xwl_window *xwl_window) 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) { if (RegionNumRects(region) > 256) {
box = RegionExtents(region); box = RegionExtents(region);
@ -122,7 +126,7 @@ index 2084f2afb..942981834 100644
} }
xwl_window_create_frame_callback(xwl_window); 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; struct xwl_screen *xwl_screen = data;
if (strcmp(interface, "wl_compositor") == 0) { if (strcmp(interface, "wl_compositor") == 0) {
@ -138,7 +142,7 @@ index 2084f2afb..942981834 100644
else if (strcmp(interface, "wl_shm") == 0) { else if (strcmp(interface, "wl_shm") == 0) {
xwl_screen->shm = wl_registry_bind(registry, id, &wl_shm_interface, 1); xwl_screen->shm = wl_registry_bind(registry, id, &wl_shm_interface, 1);
diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h 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 --- a/hw/xwayland/xwayland.h
+++ b/hw/xwayland/xwayland.h +++ b/hw/xwayland/xwayland.h
@@ -382,6 +382,9 @@ struct xwl_output { @@ -382,6 +382,9 @@ struct xwl_output {
@ -149,8 +153,8 @@ index f949ea157..fa78b5ab9 100644
+ struct wl_surface *surface, + struct wl_surface *surface,
+ int32_t x, int32_t y, int32_t width, int32_t height); + 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

View File

@ -0,0 +1,35 @@
From b28c882889cbea9be3748d3dee1b21ba6eb90b66 Mon Sep 17 00:00:00 2001
From: Arthur Williams <taaparthur@gmail.com>
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 <taaparthur@gmail.com>
(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

View File

@ -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 <hdegoede@redhat.com> From: Hans de Goede <hdegoede@redhat.com>
Date: Wed, 26 Jun 2019 16:46:54 +0200 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/24] xwayland: Add fake output modes to xrandr
@ -25,10 +25,10 @@ Signed-off-by: Hans de Goede <hdegoede@redhat.com>
3 files changed, 124 insertions(+), 6 deletions(-) 3 files changed, 124 insertions(+), 6 deletions(-)
diff --git a/hw/xwayland/xwayland-output.c b/hw/xwayland/xwayland-output.c 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 --- a/hw/xwayland/xwayland-output.c
+++ b/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(); update_desktop_dimensions();
} }
@ -141,7 +141,7 @@ index aa6f37864..2ccc3ca60 100644
Bool need_rotate; Bool need_rotate;
/* Clear out the "done" received flags */ /* 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; mode_height = xwl_output->width;
} }
@ -163,10 +163,10 @@ index aa6f37864..2ccc3ca60 100644
xorg_list_for_each_entry(it, &xwl_screen->output_list, link) { xorg_list_for_each_entry(it, &xwl_screen->output_list, link) {
/* output done event is sent even when some property /* output done event is sent even when some property
diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c 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 --- a/hw/xwayland/xwayland.c
+++ b/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); 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, xwl_window_set_allow_commits(struct xwl_window *xwl_window, Bool allow,
const char *debug_msg) const char *debug_msg)
diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h 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 --- a/hw/xwayland/xwayland.h
+++ b/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); Bool xwl_screen_init_cursor(struct xwl_screen *xwl_screen);
struct xwl_screen *xwl_screen_get(ScreenPtr 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_tablet_tool_set_cursor(struct xwl_tablet_tool *tool);
void xwl_seat_set_cursor(struct xwl_seat *xwl_seat); void xwl_seat_set_cursor(struct xwl_seat *xwl_seat);
-- --
2.25.2 2.26.2

View File

@ -0,0 +1,71 @@
From 8c3c8bda2c44fb3d62b954b02b08e3b1771ef5bc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michel=20D=C3=A4nzer?= <mdaenzer@redhat.com>
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 <eric@anholt.net>
(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

View File

@ -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 <robert.mader@posteo.de> From: Robert Mader <robert.mader@posteo.de>
Date: Mon, 22 Jan 2018 17:57:38 +0100 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/24] xwayland: Use RandR 1.2 interface (rev 2)
@ -29,10 +29,10 @@ Signed-off-by: Hans de Goede <hdegoede@redhat.com>
1 file changed, 81 insertions(+) 1 file changed, 81 insertions(+)
diff --git a/hw/xwayland/xwayland-output.c b/hw/xwayland/xwayland-output.c 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 --- a/hw/xwayland/xwayland-output.c
+++ b/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; return TRUE;
} }
@ -113,7 +113,7 @@ index 2ccc3ca60..67e99bdab 100644
Bool Bool
xwl_screen_init_output(struct xwl_screen *xwl_screen) 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 = rrGetScrPriv(xwl_screen->screen);
rp->rrGetInfo = xwl_randr_get_info; rp->rrGetInfo = xwl_randr_get_info;
@ -135,5 +135,5 @@ index 2ccc3ca60..67e99bdab 100644
return TRUE; return TRUE;
} }
-- --
2.25.2 2.26.2

View File

@ -0,0 +1,34 @@
From 1e84fda2020b12a83c6b9c6d31ab84f993c6176c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michel=20D=C3=A4nzer?= <mdaenzer@redhat.com>
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

View File

@ -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 <hdegoede@redhat.com> From: Hans de Goede <hdegoede@redhat.com>
Date: Thu, 29 Aug 2019 22:45:12 +0200 Date: Thu, 29 Aug 2019 22:45:12 +0200
Subject: [PATCH xserver 06/24] xwayland: Add per client private data Subject: [PATCH xserver 06/24] xwayland: Add per client private data
@ -21,10 +21,10 @@ Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2 files changed, 19 insertions(+) 2 files changed, 19 insertions(+)
diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c 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 --- a/hw/xwayland/xwayland.c
+++ b/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; return 0;
} }
@ -43,7 +43,7 @@ index 3c50396f1..b0e37ceb9 100644
static struct xwl_window * static struct xwl_window *
xwl_window_get(WindowPtr 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; return FALSE;
if (!dixRegisterPrivateKey(&xwl_damage_private_key, PRIVATE_WINDOW, 0)) if (!dixRegisterPrivateKey(&xwl_damage_private_key, PRIVATE_WINDOW, 0))
return FALSE; return FALSE;
@ -58,7 +58,7 @@ index 3c50396f1..b0e37ceb9 100644
dixSetPrivate(&pScreen->devPrivates, &xwl_screen_private_key, xwl_screen); dixSetPrivate(&pScreen->devPrivates, &xwl_screen_private_key, xwl_screen);
xwl_screen->screen = pScreen; xwl_screen->screen = pScreen;
diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h 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 --- a/hw/xwayland/xwayland.h
+++ b/hw/xwayland/xwayland.h +++ b/hw/xwayland/xwayland.h
@@ -379,8 +379,13 @@ struct xwl_output { @@ -379,8 +379,13 @@ struct xwl_output {
@ -76,5 +76,5 @@ index c66997f00..593e92b64 100644
void xwl_surface_damage(struct xwl_screen *xwl_screen, void xwl_surface_damage(struct xwl_screen *xwl_screen,
struct wl_surface *surface, struct wl_surface *surface,
-- --
2.25.2 2.26.2

View File

@ -0,0 +1,37 @@
From f4006d795cb199bf7deeb00f542c592db6a5becb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michel=20D=C3=A4nzer?= <mdaenzer@redhat.com>
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 <ofourdan@redhat.com> # v1
Reviewed-by: Roman Gilg <subdiff@gmail.com>
(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

View File

@ -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 <hdegoede@redhat.com> From: Hans de Goede <hdegoede@redhat.com>
Date: Thu, 29 Aug 2019 23:04:36 +0200 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/24] xwayland: Add support for storing per client
@ -31,10 +31,10 @@ Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2 files changed, 84 insertions(+) 2 files changed, 84 insertions(+)
diff --git a/hw/xwayland/xwayland-output.c b/hw/xwayland/xwayland-output.c 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 --- a/hw/xwayland/xwayland-output.c
+++ b/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(); update_desktop_dimensions();
} }
@ -109,7 +109,7 @@ index 67e99bdab..82ff5db70 100644
const int32_t xwl_output_fake_modes[][2] = { const int32_t xwl_output_fake_modes[][2] = {
/* 4:3 (1.33) */ /* 4:3 (1.33) */
diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h 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 --- a/hw/xwayland/xwayland.h
+++ b/hw/xwayland/xwayland.h +++ b/hw/xwayland/xwayland.h
@@ -379,7 +379,21 @@ struct xwl_output { @@ -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); 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); void xwl_output_remove(struct xwl_output *xwl_output);
@ -145,5 +145,5 @@ index 593e92b64..0e6f92e63 100644
float VRefresh, Bool Reduced, Bool Interlaced); float VRefresh, Bool Reduced, Bool Interlaced);
-- --
2.25.2 2.26.2

View File

@ -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 <hdegoede@redhat.com> From: Hans de Goede <hdegoede@redhat.com>
Date: Tue, 2 Jul 2019 11:55:26 +0200 Date: Tue, 2 Jul 2019 11:55:26 +0200
Subject: [PATCH xserver 08/24] xwayland: Add support for randr-resolution Subject: [PATCH xserver 08/24] xwayland: Add support for randr-resolution
@ -37,10 +37,10 @@ Signed-off-by: Hans de Goede <hdegoede@redhat.com>
4 files changed, 276 insertions(+), 6 deletions(-) 4 files changed, 276 insertions(+), 6 deletions(-)
diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c 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 --- a/hw/xwayland/xwayland-input.c
+++ b/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 dx = xwl_seat->focus_window->window->drawable.x;
int dy = xwl_seat->focus_window->window->drawable.y; int dy = xwl_seat->focus_window->window->drawable.y;
@ -53,10 +53,10 @@ index fa46ac3e7..97b8cd132 100644
y = dy + sy; y = dy + sy;
} else { } else {
diff --git a/hw/xwayland/xwayland-output.c b/hw/xwayland/xwayland-output.c 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 --- a/hw/xwayland/xwayland-output.c
+++ b/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"); FatalError("Failed to allocate memory for list of RR modes");
} }
@ -99,7 +99,7 @@ index 82ff5db70..99ab1b288 100644
static void static void
apply_output_change(struct xwl_output *xwl_output) 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 static Bool
xwl_randr_crtc_set(ScreenPtr pScreen, xwl_randr_crtc_set(ScreenPtr pScreen,
RRCrtcPtr crtc, RRCrtcPtr crtc,
@ -143,10 +143,10 @@ index 82ff5db70..99ab1b288 100644
static Bool static Bool
diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c 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 --- a/hw/xwayland/xwayland.c
+++ b/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); return xwl_screen->rootless && xwl_screen_has_viewport_support(xwl_screen);
} }
@ -170,7 +170,7 @@ index b0e37ceb9..1ab5b3a28 100644
static void static void
xwl_window_set_allow_commits(struct xwl_window *xwl_window, Bool allow, xwl_window_set_allow_commits(struct xwl_window *xwl_window, Bool allow,
const char *debug_msg) 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); return dixLookupPrivate(&pixmap->devPrivates, &xwl_pixmap_private_key);
} }
@ -321,7 +321,7 @@ index b0e37ceb9..1ab5b3a28 100644
static void static void
xwl_window_init_allow_commits(struct xwl_window *xwl_window) 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->xwl_screen = xwl_screen;
xwl_window->window = window; xwl_window->window = window;
@ -330,7 +330,7 @@ index b0e37ceb9..1ab5b3a28 100644
xwl_window->surface = wl_compositor_create_surface(xwl_screen->compositor); xwl_window->surface = wl_compositor_create_surface(xwl_screen->compositor);
if (xwl_window->surface == NULL) { if (xwl_window->surface == NULL) {
ErrorF("wl_display_create_surface failed\n"); 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); dixSetPrivate(&window->devPrivates, &xwl_window_private_key, xwl_window);
xorg_list_init(&xwl_window->link_damage); xorg_list_init(&xwl_window->link_damage);
@ -338,7 +338,7 @@ index b0e37ceb9..1ab5b3a28 100644
#ifdef GLAMOR_HAS_GBM #ifdef GLAMOR_HAS_GBM
xorg_list_init(&xwl_window->frame_callback_list); 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) if (!xwl_window)
return ret; return ret;
@ -351,7 +351,7 @@ index b0e37ceb9..1ab5b3a28 100644
unregister_damage(window); unregister_damage(window);
if (xwl_window->frame_callback) 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); ensure_surface_for_window(window);
} }
@ -385,15 +385,15 @@ index b0e37ceb9..1ab5b3a28 100644
static void static void
frame_callback(void *data, frame_callback(void *data,
struct wl_callback *callback, 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->output_list);
xorg_list_init(&xwl_screen->seat_list); xorg_list_init(&xwl_screen->seat_list);
xorg_list_init(&xwl_screen->damage_window_list); xorg_list_init(&xwl_screen->damage_window_list);
+ xorg_list_init(&xwl_screen->window_list); + xorg_list_init(&xwl_screen->window_list);
xwl_screen->depth = 24; xwl_screen->depth = 24;
xwl_screen->display = wl_display_connect(NULL); if (!monitorResolution)
@@ -1316,6 +1512,9 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) @@ -1340,6 +1536,9 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv)
xwl_screen->CloseScreen = pScreen->CloseScreen; xwl_screen->CloseScreen = pScreen->CloseScreen;
pScreen->CloseScreen = xwl_close_screen; pScreen->CloseScreen = xwl_close_screen;
@ -404,7 +404,7 @@ index b0e37ceb9..1ab5b3a28 100644
xwl_screen->SetWindowPixmap = pScreen->SetWindowPixmap; xwl_screen->SetWindowPixmap = pScreen->SetWindowPixmap;
pScreen->SetWindowPixmap = xwl_set_window_pixmap; pScreen->SetWindowPixmap = xwl_set_window_pixmap;
diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h 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 --- a/hw/xwayland/xwayland.h
+++ b/hw/xwayland/xwayland.h +++ b/hw/xwayland/xwayland.h
@@ -135,10 +135,12 @@ struct xwl_screen { @@ -135,10 +135,12 @@ struct xwl_screen {
@ -434,7 +434,7 @@ index 0e6f92e63..9adf3af76 100644
struct wl_callback *frame_callback; struct wl_callback *frame_callback;
Bool allow_commits; Bool allow_commits;
#ifdef GLAMOR_HAS_GBM #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); struct xwl_screen *xwl_screen_get(ScreenPtr screen);
Bool xwl_screen_has_resolution_change_emulation(struct xwl_screen *xwl_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_tablet_tool_set_cursor(struct xwl_tablet_tool *tool);
void xwl_seat_set_cursor(struct xwl_seat *xwl_seat); 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_emulated_mode *xwl_output_get_emulated_mode_for_client(
struct xwl_output *xwl_output, ClientPtr client); struct xwl_output *xwl_output, ClientPtr client);
@ -458,5 +458,5 @@ index 0e6f92e63..9adf3af76 100644
float VRefresh, Bool Reduced, Bool Interlaced); float VRefresh, Bool Reduced, Bool Interlaced);
-- --
2.25.2 2.26.2

View File

@ -0,0 +1,45 @@
From 51ee6e5ceb0cacc8e2fa225ad5391ffb159e36a0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michel=20D=C3=A4nzer?= <mdaenzer@redhat.com>
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 <ofourdan@redhat.com>
Reviewed-by: Roman Gilg <subdiff@gmail.com>
(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

View File

@ -0,0 +1,33 @@
From 174cb91d82d643f78d8ba2b9999312b9d7dea98c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michel=20D=C3=A4nzer?= <mdaenzer@redhat.com>
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 <subdiff@gmail.com>
(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

View File

@ -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 <hdegoede@redhat.com> From: Hans de Goede <hdegoede@redhat.com>
Date: Mon, 8 Jul 2019 14:00:27 +0200 Date: Mon, 8 Jul 2019 14:00:27 +0200
Subject: [PATCH xserver 09/24] xwayland: Add xwlRRModeToDisplayMode() helper Subject: [PATCH xserver 09/24] xwayland: Add xwlRRModeToDisplayMode() helper
@ -20,7 +20,7 @@ Signed-off-by: Hans de Goede <hdegoede@redhat.com>
1 file changed, 28 insertions(+), 23 deletions(-) 1 file changed, 28 insertions(+), 23 deletions(-)
diff --git a/hw/xwayland/xwayland-vidmode.c b/hw/xwayland/xwayland-vidmode.c 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 --- a/hw/xwayland/xwayland-vidmode.c
+++ b/hw/xwayland/xwayland-vidmode.c +++ b/hw/xwayland/xwayland-vidmode.c
@@ -78,13 +78,37 @@ mode_refresh(const xRRModeInfo *mode_info) @@ -78,13 +78,37 @@ mode_refresh(const xRRModeInfo *mode_info)
@ -97,5 +97,5 @@ index 0bcd11401..a59c9f6a9 100644
return TRUE; return TRUE;
} }
-- --
2.25.2 2.26.2

View File

@ -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 <hdegoede@redhat.com> From: Hans de Goede <hdegoede@redhat.com>
Date: Mon, 8 Jul 2019 18:35:27 +0200 Date: Mon, 8 Jul 2019 18:35:27 +0200
Subject: [PATCH xserver 10/24] xwayland: Add xwlVidModeGetCurrentRRMode helper Subject: [PATCH xserver 10/24] xwayland: Add xwlVidModeGetCurrentRRMode helper
@ -30,7 +30,7 @@ Signed-off-by: Hans de Goede <hdegoede@redhat.com>
1 file changed, 56 insertions(+), 34 deletions(-) 1 file changed, 56 insertions(+), 34 deletions(-)
diff --git a/hw/xwayland/xwayland-vidmode.c b/hw/xwayland/xwayland-vidmode.c 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 --- a/hw/xwayland/xwayland-vidmode.c
+++ b/hw/xwayland/xwayland-vidmode.c +++ b/hw/xwayland/xwayland-vidmode.c
@@ -103,26 +103,56 @@ xwlRRModeToDisplayMode(RRModePtr rrmode, DisplayModePtr mode) @@ -103,26 +103,56 @@ xwlRRModeToDisplayMode(RRModePtr rrmode, DisplayModePtr mode)
@ -189,5 +189,5 @@ index a59c9f6a9..e9aea7269 100644
static void static void
-- --
2.25.2 2.26.2

View File

@ -0,0 +1,73 @@
From d108c2c82cba242ea5998d7c91254d90d3a5db71 Mon Sep 17 00:00:00 2001
From: Olivier Fourdan <ofourdan@redhat.com>
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 <ofourdan@redhat.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
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

View File

@ -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 <hdegoede@redhat.com> From: Hans de Goede <hdegoede@redhat.com>
Date: Tue, 9 Jul 2019 09:31:13 +0200 Date: Tue, 9 Jul 2019 09:31:13 +0200
Subject: [PATCH xserver 11/24] xwayland: Add vidmode mode changing emulation Subject: [PATCH xserver 11/24] xwayland: Add vidmode mode changing emulation
@ -19,7 +19,7 @@ Signed-off-by: Hans de Goede <hdegoede@redhat.com>
1 file changed, 86 insertions(+), 44 deletions(-) 1 file changed, 86 insertions(+), 44 deletions(-)
diff --git a/hw/xwayland/xwayland-vidmode.c b/hw/xwayland/xwayland-vidmode.c 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 --- a/hw/xwayland/xwayland-vidmode.c
+++ b/hw/xwayland/xwayland-vidmode.c +++ b/hw/xwayland/xwayland-vidmode.c
@@ -106,26 +106,25 @@ xwlRRModeToDisplayMode(RRModePtr rrmode, DisplayModePtr mode) @@ -106,26 +106,25 @@ xwlRRModeToDisplayMode(RRModePtr rrmode, DisplayModePtr mode)
@ -232,5 +232,5 @@ index e9aea7269..56aac693a 100644
static Bool static Bool
-- --
2.25.2 2.26.2

View File

@ -0,0 +1,68 @@
From 1ac389dda89b2882c80767c91bbe88e01818491c Mon Sep 17 00:00:00 2001
From: Greg V <greg@unrelenting.technology>
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 <greg@unrelenting.technology>
Reviewed-by: Emmanuel Vadot <manu@FreeBSD.org>
(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

View File

@ -0,0 +1,43 @@
From 1930ed233fdec5d22e4fc192769a0126faabb3ea Mon Sep 17 00:00:00 2001
From: Olivier Fourdan <ofourdan@redhat.com>
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 <ofourdan@redhat.com>
Tested-by: Karol Szuster <karolsz9898@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
(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

View File

@ -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 <hdegoede@redhat.com> From: Hans de Goede <hdegoede@redhat.com>
Date: Mon, 26 Aug 2019 12:26:34 +0200 Date: Mon, 26 Aug 2019 12:26:34 +0200
Subject: [PATCH xserver 12/24] xwayland: xwl_window_should_enable_viewport: Subject: [PATCH xserver 12/24] xwayland: xwl_window_should_enable_viewport:
@ -25,10 +25,10 @@ Signed-off-by: Hans de Goede <hdegoede@redhat.com>
1 file changed, 17 insertions(+) 1 file changed, 17 insertions(+)
diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c 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 --- a/hw/xwayland/xwayland.c
+++ b/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

View File

@ -0,0 +1,121 @@
From dae234efdb7bba75744aa1697386df3c0db5348a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michel=20D=C3=A4nzer?= <mdaenzer@redhat.com>
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 <subdiff@gmail.com>
Tested-by: Roman Gilg <subdiff@gmail.com>
(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

View File

@ -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 <hdegoede@redhat.com> From: Hans de Goede <hdegoede@redhat.com>
Date: Mon, 2 Sep 2019 17:32:45 +0200 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/24] xwayland: Set _XWAYLAND_RANDR_EMU_MONITOR_RECTS
@ -37,7 +37,7 @@ Signed-off-by: Hans de Goede <hdegoede@redhat.com>
3 files changed, 103 insertions(+) 3 files changed, 103 insertions(+)
diff --git a/hw/xwayland/xwayland-output.c b/hw/xwayland/xwayland-output.c 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 --- a/hw/xwayland/xwayland-output.c
+++ b/hw/xwayland/xwayland-output.c +++ b/hw/xwayland/xwayland-output.c
@@ -29,6 +29,7 @@ @@ -29,6 +29,7 @@
@ -46,9 +46,9 @@ index 99ab1b288..20c254962 100644
#include <randrstr.h> #include <randrstr.h>
+#include <X11/Xatom.h> +#include <X11/Xatom.h>
#define DEFAULT_DPI 96
#define ALL_ROTATIONS (RR_Rotate_0 | \ #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; return NULL;
} }
@ -129,7 +129,7 @@ index 99ab1b288..20c254962 100644
void void
xwl_output_set_emulated_mode(struct xwl_output *xwl_output, ClientPtr client, xwl_output_set_emulated_mode(struct xwl_output *xwl_output, ClientPtr client,
RRModePtr mode, Bool from_vidmode) 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_output_add_emulated_mode_for_client(xwl_output, client, mode, from_vidmode);
xwl_screen_check_resolution_change_emulation(xwl_output->xwl_screen); xwl_screen_check_resolution_change_emulation(xwl_output->xwl_screen);
@ -139,10 +139,10 @@ index 99ab1b288..20c254962 100644
static void static void
diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c 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 --- a/hw/xwayland/xwayland.c
+++ b/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); xwl_window_check_resolution_change_emulation(xwl_window);
} }
@ -170,7 +170,7 @@ index 85036adfe..e43f3de96 100644
static void static void
xwl_window_init_allow_commits(struct xwl_window *xwl_window) 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; return FALSE;
} }
@ -180,10 +180,10 @@ index 85036adfe..e43f3de96 100644
} }
diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h 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 --- a/hw/xwayland/xwayland.h
+++ b/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); 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); 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_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_tablet_tool_set_cursor(struct xwl_tablet_tool *tool);
void xwl_seat_set_cursor(struct xwl_seat *xwl_seat); 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, void xwl_output_set_emulated_mode(struct xwl_output *xwl_output,
ClientPtr client, RRModePtr mode, ClientPtr client, RRModePtr mode,
Bool from_vidmode); Bool from_vidmode);
@ -201,5 +201,5 @@ index 9adf3af76..eb8c4bd70 100644
RRModePtr xwayland_cvt(int HDisplay, int VDisplay, RRModePtr xwayland_cvt(int HDisplay, int VDisplay,
float VRefresh, Bool Reduced, Bool Interlaced); float VRefresh, Bool Reduced, Bool Interlaced);
-- --
2.25.2 2.26.2

View File

@ -0,0 +1,236 @@
From 669e40390c3679b649db33f0aa4ae4cfdd17e2a9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michel=20D=C3=A4nzer?= <mdaenzer@redhat.com>
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 <subdiff@gmail.com>
Tested-by: Roman Gilg <subdiff@gmail.com>
(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

View File

@ -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 <hdegoede@redhat.com> From: Hans de Goede <hdegoede@redhat.com>
Date: Mon, 27 Jan 2020 11:08:00 +0100 Date: Mon, 27 Jan 2020 11:08:00 +0100
Subject: [PATCH xserver 14/24] xwayland: Cache client-id for the Subject: [PATCH xserver 14/24] xwayland: Cache client-id for the
@ -24,10 +24,10 @@ Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2 files changed, 34 insertions(+), 16 deletions(-) 2 files changed, 34 insertions(+), 16 deletions(-)
diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c 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 --- a/hw/xwayland/xwayland.c
+++ b/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 static Bool
@ -51,7 +51,7 @@ index e43f3de96..f4d433bca 100644
} }
static ClientPtr 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 * decoration window. In that case return the client of the
* first *and only* child of the toplevel (decoration) window. * first *and only* child of the toplevel (decoration) window.
*/ */
@ -60,7 +60,7 @@ index e43f3de96..f4d433bca 100644
if (window->firstChild && window->firstChild == window->lastChild) if (window->firstChild && window->firstChild == window->lastChild)
return wClient(window->firstChild); return wClient(window->firstChild);
else 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 Bool
xwl_window_is_toplevel(WindowPtr window) xwl_window_is_toplevel(WindowPtr window)
{ {
@ -71,7 +71,7 @@ index e43f3de96..f4d433bca 100644
return FALSE; return FALSE;
/* CSD and override-redirect toplevel windows */ /* 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); ensure_surface_for_window(window);
} }
@ -102,7 +102,7 @@ index e43f3de96..f4d433bca 100644
static void static void
xwl_resize_window(WindowPtr window, xwl_resize_window(WindowPtr window,
int x, int y, 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; xwl_screen->CloseScreen = pScreen->CloseScreen;
pScreen->CloseScreen = xwl_close_screen; pScreen->CloseScreen = xwl_close_screen;
@ -113,7 +113,7 @@ index e43f3de96..f4d433bca 100644
pScreen->ResizeWindow = xwl_resize_window; pScreen->ResizeWindow = xwl_resize_window;
diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h 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 --- a/hw/xwayland/xwayland.h
+++ b/hw/xwayland/xwayland.h +++ b/hw/xwayland/xwayland.h
@@ -118,6 +118,7 @@ struct xwl_screen { @@ -118,6 +118,7 @@ struct xwl_screen {
@ -133,5 +133,5 @@ index eb8c4bd70..126af8823 100644
struct xorg_list output_list; struct xorg_list output_list;
-- --
2.25.2 2.26.2

View File

@ -0,0 +1,58 @@
From 96ef31e0f20fcffb2edfe4cb9510f994c188785f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michel=20D=C3=A4nzer?= <mdaenzer@redhat.com>
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 <subdiff@gmail.com>
Tested-by: Roman Gilg <subdiff@gmail.com>
(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

View File

@ -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 <subdiff@gmail.com> From: Roman Gilg <subdiff@gmail.com>
Date: Fri, 3 Jan 2020 17:12:14 +0100 Date: Fri, 3 Jan 2020 17:12:14 +0100
Subject: [PATCH xserver 15/24] xwayland: Reuse viewport instead of recreating Subject: [PATCH xserver 15/24] xwayland: Reuse viewport instead of recreating
@ -17,10 +17,10 @@ Signed-off-by: Hans de Goede <hdegoede@redhat.com>
1 file changed, 7 insertions(+), 11 deletions(-) 1 file changed, 7 insertions(+), 11 deletions(-)
diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c 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 --- a/hw/xwayland/xwayland.c
+++ b/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_output *xwl_output,
struct xwl_emulated_mode *emulated_mode) struct xwl_emulated_mode *emulated_mode)
{ {
@ -46,5 +46,5 @@ index f4d433bca..320589dde 100644
wp_viewport_set_source(xwl_window->viewport, wp_viewport_set_source(xwl_window->viewport,
wl_fixed_from_int(0), wl_fixed_from_int(0),
-- --
2.25.2 2.26.2

View File

@ -0,0 +1,139 @@
From c3e4c1a0fd5d4d6015e9e6317b758018317e56d1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michel=20D=C3=A4nzer?= <mdaenzer@redhat.com>
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 <subdiff@gmail.com>
Tested-by: Roman Gilg <subdiff@gmail.com>
(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

View File

@ -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 <subdiff@gmail.com> From: Roman Gilg <subdiff@gmail.com>
Date: Fri, 3 Jan 2020 17:27:28 +0100 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/24] xwayland: Recurse on finding the none-wm owner
@ -28,10 +28,10 @@ Signed-off-by: Hans de Goede <hdegoede@redhat.com>
1 file changed, 8 insertions(+), 9 deletions(-) 1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c 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 --- a/hw/xwayland/xwayland.c
+++ b/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 static ClientPtr
@ -56,7 +56,7 @@ index 320589dde..f42b80b90 100644
else else
return NULL; /* Should never happen, skip resolution emulation */ 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)) if (!xwl_screen_has_resolution_change_emulation(xwl_screen))
return FALSE; return FALSE;
@ -65,7 +65,7 @@ index 320589dde..f42b80b90 100644
if (!owner) if (!owner)
return FALSE; 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)) if (window_get_damage(window))
return TRUE; return TRUE;
@ -77,5 +77,5 @@ index 320589dde..f42b80b90 100644
static void static void
-- --
2.25.2 2.26.2

View File

@ -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 <subdiff@gmail.com> From: Roman Gilg <subdiff@gmail.com>
Date: Wed, 15 Jan 2020 10:07:58 +0100 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/24] xwayland: Make window_get_none_wm_owner return
@ -25,10 +25,10 @@ Signed-off-by: Hans de Goede <hdegoede@redhat.com>
1 file changed, 10 insertions(+), 7 deletions(-) 1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c 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 --- a/hw/xwayland/xwayland.c
+++ b/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; 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 /* If the toplevel window is owned by the window-manager, then the
* actual client toplevel window has been reparented to some window-manager * 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_is_wm_window(window)) {
if (window->firstChild && window->firstChild == window->lastChild) if (window->firstChild && window->firstChild == window->lastChild)
@ -57,7 +57,7 @@ index f42b80b90..d70d729ae 100644
} }
static Bool 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_emulated_mode *emulated_mode;
struct xwl_output *xwl_output; struct xwl_output *xwl_output;
ClientPtr owner; ClientPtr owner;
@ -78,5 +78,5 @@ index f42b80b90..d70d729ae 100644
* This path gets hit by most games / libs (e.g. SDL, SFML, OGRE) * This path gets hit by most games / libs (e.g. SDL, SFML, OGRE)
*/ */
-- --
2.25.2 2.26.2

View File

@ -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 <subdiff@gmail.com> From: Roman Gilg <subdiff@gmail.com>
Date: Fri, 3 Jan 2020 17:55:28 +0100 Date: Fri, 3 Jan 2020 17:55:28 +0100
Subject: [PATCH xserver 18/24] xwayland: Check emulation on client toplevel Subject: [PATCH xserver 18/24] xwayland: Check emulation on client toplevel
@ -25,10 +25,10 @@ Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2 files changed, 11 insertions(+), 17 deletions(-) 2 files changed, 11 insertions(+), 17 deletions(-)
diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c 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 --- a/hw/xwayland/xwayland.c
+++ b/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; struct xwl_output *xwl_output;
ClientPtr owner; ClientPtr owner;
WindowPtr window; WindowPtr window;
@ -36,7 +36,7 @@ index d70d729ae..14227a327 100644
if (!xwl_screen_has_resolution_change_emulation(xwl_screen)) if (!xwl_screen_has_resolution_change_emulation(xwl_screen))
return FALSE; 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; return FALSE;
owner = wClient(window); 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 /* 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) * 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) if (!emulated_mode)
continue; continue;
@ -59,7 +59,7 @@ index d70d729ae..14227a327 100644
*emulated_mode_ret = emulated_mode; *emulated_mode_ret = emulated_mode;
*xwl_output_ret = xwl_output; *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); emulated_mode = xwl_output_get_emulated_mode_for_client(xwl_output, owner);
if (xwl_output && xwl_window->window->overrideRedirect && if (xwl_output && xwl_window->window->overrideRedirect &&
emulated_mode && emulated_mode->from_vidmode && emulated_mode && emulated_mode->from_vidmode &&
@ -72,7 +72,7 @@ index d70d729ae..14227a327 100644
*emulated_mode_ret = emulated_mode; *emulated_mode_ret = emulated_mode;
*xwl_output_ret = xwl_output; *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->xwl_screen = xwl_screen;
xwl_window->window = window; xwl_window->window = window;
@ -81,7 +81,7 @@ index d70d729ae..14227a327 100644
xwl_window->surface = wl_compositor_create_surface(xwl_screen->compositor); xwl_window->surface = wl_compositor_create_surface(xwl_screen->compositor);
if (xwl_window->surface == NULL) { if (xwl_window->surface == NULL) {
ErrorF("wl_display_create_surface failed\n"); 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; struct xwl_window *xwl_window;
xwl_screen = xwl_screen_get(screen); xwl_screen = xwl_screen_get(screen);
@ -105,7 +105,7 @@ index d70d729ae..14227a327 100644
static void static void
diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h 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 --- a/hw/xwayland/xwayland.h
+++ b/hw/xwayland/xwayland.h +++ b/hw/xwayland/xwayland.h
@@ -184,7 +184,6 @@ struct xwl_window { @@ -184,7 +184,6 @@ struct xwl_window {
@ -117,5 +117,5 @@ index 126af8823..01aef27d2 100644
struct wl_shell_surface *shell_surface; struct wl_shell_surface *shell_surface;
WindowPtr window; WindowPtr window;
-- --
2.25.2 2.26.2

View File

@ -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 <hdegoede@redhat.com> From: Hans de Goede <hdegoede@redhat.com>
Date: Wed, 15 Jan 2020 14:36:45 +0100 Date: Wed, 15 Jan 2020 14:36:45 +0100
Subject: [PATCH xserver 19/24] xwayland: Also check Subject: [PATCH xserver 19/24] xwayland: Also check
@ -28,10 +28,10 @@ Signed-off-by: Hans de Goede <hdegoede@redhat.com>
1 file changed, 1 insertion(+), 1 deletion(-) 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c 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 --- a/hw/xwayland/xwayland.c
+++ b/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; xwl_screen->ResizeWindow = screen->ResizeWindow;
screen->ResizeWindow = xwl_resize_window; screen->ResizeWindow = xwl_resize_window;
@ -41,5 +41,5 @@ index 14227a327..298ef3ac8 100644
} }
-- --
2.25.2 2.26.2

View File

@ -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 <hdegoede@redhat.com> From: Hans de Goede <hdegoede@redhat.com>
Date: Thu, 9 Jan 2020 11:00:36 +0100 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/24] xwayland: Also hook screen's MoveWindow method
@ -24,10 +24,10 @@ Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2 files changed, 26 insertions(+) 2 files changed, 26 insertions(+)
diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c 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 --- a/hw/xwayland/xwayland.c
+++ b/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); xwl_window_check_resolution_change_emulation(xwl_window);
} }
@ -56,7 +56,7 @@ index 298ef3ac8..1294ff1d8 100644
static void static void
frame_callback(void *data, frame_callback(void *data,
struct wl_callback *callback, 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; xwl_screen->ResizeWindow = pScreen->ResizeWindow;
pScreen->ResizeWindow = xwl_resize_window; pScreen->ResizeWindow = xwl_resize_window;
@ -67,7 +67,7 @@ index 298ef3ac8..1294ff1d8 100644
xwl_screen->SetWindowPixmap = pScreen->SetWindowPixmap; xwl_screen->SetWindowPixmap = pScreen->SetWindowPixmap;
pScreen->SetWindowPixmap = xwl_set_window_pixmap; pScreen->SetWindowPixmap = xwl_set_window_pixmap;
diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h 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 --- a/hw/xwayland/xwayland.h
+++ b/hw/xwayland/xwayland.h +++ b/hw/xwayland/xwayland.h
@@ -138,6 +138,7 @@ struct xwl_screen { @@ -138,6 +138,7 @@ struct xwl_screen {
@ -79,5 +79,5 @@ index 01aef27d2..72225374b 100644
struct xorg_list output_list; struct xorg_list output_list;
struct xorg_list seat_list; struct xorg_list seat_list;
-- --
2.25.2 2.26.2

View File

@ -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 <hdegoede@redhat.com> From: Hans de Goede <hdegoede@redhat.com>
Date: Mon, 7 Oct 2019 14:27:49 +0200 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/24] xwayland: Fix emulated modes not being removed
@ -32,10 +32,10 @@ Signed-off-by: Hans de Goede <hdegoede@redhat.com>
1 file changed, 6 insertions(+), 2 deletions(-) 1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/hw/xwayland/xwayland-output.c b/hw/xwayland/xwayland-output.c 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 --- a/hw/xwayland/xwayland-output.c
+++ b/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; struct xwl_emulated_mode *emulated_mode;
emulated_mode = xwl_output_get_emulated_mode_for_client(xwl_output, client); 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 */ /* 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", from_vidmode ? "vidmode" : "randr",
mode->mode.width, mode->mode.height); mode->mode.width, mode->mode.height);
@ -59,5 +59,5 @@ index 20c254962..7d705d919 100644
else else
xwl_output_add_emulated_mode_for_client(xwl_output, client, mode, from_vidmode); xwl_output_add_emulated_mode_for_client(xwl_output, client, mode, from_vidmode);
-- --
2.25.2 2.26.2

View File

@ -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 <hdegoede@redhat.com> From: Hans de Goede <hdegoede@redhat.com>
Date: Mon, 4 Nov 2019 11:46:49 +0100 Date: Mon, 4 Nov 2019 11:46:49 +0100
Subject: [PATCH xserver 22/24] xwayland: Call Subject: [PATCH xserver 22/24] xwayland: Call
@ -28,10 +28,10 @@ Signed-off-by: Hans de Goede <hdegoede@redhat.com>
1 file changed, 5 insertions(+) 1 file changed, 5 insertions(+)
diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c 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 --- a/hw/xwayland/xwayland.c
+++ b/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); xwl_window_init_allow_commits(xwl_window);
@ -44,5 +44,5 @@ index 1294ff1d8..6b86e56bd 100644
err_surf: err_surf:
-- --
2.25.2 2.26.2

View File

@ -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 <hdegoede@redhat.com> From: Hans de Goede <hdegoede@redhat.com>
Date: Mon, 4 Nov 2019 14:32:29 +0100 Date: Mon, 4 Nov 2019 14:32:29 +0100
Subject: [PATCH xserver 23/24] xwayland: Fix setting of Subject: [PATCH xserver 23/24] xwayland: Fix setting of
@ -35,10 +35,10 @@ Signed-off-by: Hans de Goede <hdegoede@redhat.com>
1 file changed, 9 insertions(+), 3 deletions(-) 1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c 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 --- a/hw/xwayland/xwayland.c
+++ b/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_screen *xwl_screen;
struct xwl_window *xwl_window; struct xwl_window *xwl_window;
struct wl_region *region; struct wl_region *region;
@ -46,7 +46,7 @@ index 6b86e56bd..e721d6cb5 100644
if (xwl_window_get(window)) if (xwl_window_get(window))
return TRUE; 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); 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 */ /* CSD or O-R toplevel window, check viewport on creation */
xwl_window_check_resolution_change_emulation(xwl_window); 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; return FALSE;
} }
@ -72,5 +72,5 @@ index 6b86e56bd..e721d6cb5 100644
} }
-- --
2.25.2 2.26.2

View File

@ -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 <hdegoede@redhat.com> From: Hans de Goede <hdegoede@redhat.com>
Date: Mon, 4 Nov 2019 15:01:18 +0100 Date: Mon, 4 Nov 2019 15:01:18 +0100
Subject: [PATCH xserver 24/24] xwayland: Remove unnecessary Subject: [PATCH xserver 24/24] xwayland: Remove unnecessary
@ -21,10 +21,10 @@ Signed-off-by: Hans de Goede <hdegoede@redhat.com>
1 file changed, 2 insertions(+), 4 deletions(-) 1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/hw/xwayland/xwayland-output.c b/hw/xwayland/xwayland-output.c 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 --- a/hw/xwayland/xwayland-output.c
+++ b/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, xwl_output_set_randr_emu_prop(WindowPtr window,
struct xwl_output_randr_emu_prop *prop) struct xwl_output_randr_emu_prop *prop)
{ {
@ -34,7 +34,7 @@ index 7d705d919..084b669e4 100644
if (prop->rect_count) { if (prop->rect_count) {
dixChangeWindowProperty(serverClient, window, prop->atom, dixChangeWindowProperty(serverClient, window, prop->atom,
XA_CARDINAL, 32, PropModeReplace, 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 static void
xwl_output_set_randr_emu_prop_callback(void *resource, XID id, void *user_data) xwl_output_set_randr_emu_prop_callback(void *resource, XID id, void *user_data)
{ {
@ -45,5 +45,5 @@ index 7d705d919..084b669e4 100644
static void static void
-- --
2.25.2 2.26.2

View File

@ -1 +1 @@
SHA512 (xorg-server-1.20.8.tar.bz2) = ab0ec0fcbf490c61558b9297f61b58fd2dedb676c78bef6431dc9166054743b43a0091b88a8b3f4e81d1f539909440ee7e188a298cefabe13ea89159639cd805 SHA512 (xorg-server-1.20.9.tar.bz2) = d9b5f93e1b9763a89187d8b272aa7d4ce9709641b8539f4536708af153310e5a4931bffd4229c51a3b0e3b12da7838750aa71b635751fb4c0bb27438cce4e5e6

View File

@ -45,8 +45,8 @@
Summary: X.Org X11 X server Summary: X.Org X11 X server
Name: xorg-x11-server Name: xorg-x11-server
Version: 1.20.8 Version: 1.20.9
Release: 4%{?gitdate:.%{gitdate}}%{?dist} Release: 1%{?gitdate:.%{gitdate}}%{?dist}
URL: http://www.x.org URL: http://www.x.org
License: MIT 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 Patch6: 0001-Fedora-hack-Make-the-suid-root-wrapper-always-start-.patch
# Backports from current stable "server-1.20-branch": # 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: # Backports from "master" upstream:
Patch100: 0001-fix-for-ZDI-11426.patch
# Backported Xwayland randr resolution change emulation support # Backported Xwayland randr resolution change emulation support
Patch501: 0001-dix-Add-GetCurrentClient-helper.patch Patch501: 0001-dix-Add-GetCurrentClient-helper.patch
@ -548,6 +563,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete
%changelog %changelog
* Thu Oct 8 2020 Olivier Fourdan <ofourdan@redhat.com> - 1.20.9-1
- xserver 1.20.9 + all current fixes from upstream
* Wed Aug 12 2020 Adam Jackson <ajax@redhat.com> - 1.20.8-4 * Wed Aug 12 2020 Adam Jackson <ajax@redhat.com> - 1.20.8-4
- Enable XC-SECURITY - Enable XC-SECURITY