xserver 1.20.7

- backport from stable "xserver-1.20-branch" up to commit ad7364d8d
  (for mutter fullscreen unredirect on Wayland)
- Update videodrv minor ABI as 1.20.7 changed the minor ABI version
  (backward compatible, API addition in glamor)
- Rebase Xwayland randr resolution change emulation support patches
This commit is contained in:
Olivier Fourdan 2020-03-13 09:33:15 +01:00
parent dafffedcc8
commit 1e468bc44a
42 changed files with 1704 additions and 157 deletions

View File

@ -1,42 +0,0 @@
From 0ad717edcf372425ddf2ba9926857419ab62f4f5 Mon Sep 17 00:00:00 2001
From: Peter Hutterer <peter.hutterer@who-t.net>
Date: Wed, 29 May 2019 16:19:55 +1000
Subject: [PATCH xserver] Xi: return AlreadyGrabbed for key grabs > 255
We can't have high keycodes because everything in XKB relies on 8 bits. XI2's
API allows for 32-bit keycodes so we have to take those but nothing in the
server is really ready for this. The effect of this right now is that any high
keycode grab is clipped to 255 and thus ends up grabbing a different key
instead.
https://bugzilla.redhat.com/show_bug.cgi?id=1697804
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
---
Xi/xipassivegrab.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/Xi/xipassivegrab.c b/Xi/xipassivegrab.c
index 65d5870f6..d30f51f3c 100644
--- a/Xi/xipassivegrab.c
+++ b/Xi/xipassivegrab.c
@@ -203,8 +203,14 @@ ProcXIPassiveGrabDevice(ClientPtr client)
&param, XI2, &mask);
break;
case XIGrabtypeKeycode:
- status = GrabKey(client, dev, mod_dev, stuff->detail,
- &param, XI2, &mask);
+ /* XI2 allows 32-bit keycodes but thanks to XKB we can never
+ * implement this. Just return an error for all keycodes that
+ * cannot work anyway */
+ if (stuff->detail > 255)
+ status = XIAlreadyGrabbed;
+ else
+ status = GrabKey(client, dev, mod_dev, stuff->detail,
+ &param, XI2, &mask);
break;
case XIGrabtypeEnter:
case XIGrabtypeFocusIn:
--
2.21.0

View File

@ -0,0 +1,57 @@
From ad7364d8d7f936b9b08195e47d2f6ee9329ff687 Mon Sep 17 00:00:00 2001
From: Kenneth Graunke <kenneth@whitecape.org>
Date: Mon, 13 Jan 2020 23:34:49 -0800
Subject: [PATCH xserver 01/22] configure: Define GLAMOR_HAS_EGL_QUERY_DRIVER
when available
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Commit 195c2ef8f9f07b9bdabc0f554a9033b7857b99c7 added this to the Meson
build but neglected to add it to autotools.
v2: Also update dix-config.h.in
Fixes: 195c2ef8f ("glamor: Add a function to get the driver name via EGL_MESA_query_driver")
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com> [v1]
Reviewed-by: Eric Engestrom <eric@engestrom.ch> [v1]
Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit 25ca99df38a2c28c25ab20a917e68442285f2353)
---
configure.ac | 4 ++++
include/dix-config.h.in | 3 +++
2 files changed, 7 insertions(+)
diff --git a/configure.ac b/configure.ac
index 9f82e2a7d..231515f0c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2053,6 +2053,10 @@ if test "x$GLAMOR" = xyes; then
[AC_DEFINE(GLAMOR_HAS_EGL_QUERY_DMABUF, 1, [Have GLAMOR_HAS_EGL_QUERY_DMABUF])],
[])
+ PKG_CHECK_EXISTS(epoxy >= 1.5.4,
+ [AC_DEFINE(GLAMOR_HAS_EGL_QUERY_DRIVER, 1, [Have GLAMOR_HAS_EGL_QUERY_DRIVER])],
+ [])
+
PKG_CHECK_MODULES(GBM, "$LIBGBM", [GBM=yes], [GBM=no])
if test "x$GBM" = xyes; then
AC_DEFINE(GLAMOR_HAS_GBM, 1,
diff --git a/include/dix-config.h.in b/include/dix-config.h.in
index c18f62370..d02bb1b81 100644
--- a/include/dix-config.h.in
+++ b/include/dix-config.h.in
@@ -485,6 +485,9 @@
/* Glamor can use eglQueryDmaBuf* functions */
#undef GLAMOR_HAS_EGL_QUERY_DMABUF
+/* Glamor can use EGL_MESA_query_driver functions */
+#undef GLAMOR_HAS_EGL_QUERY_DRIVER
+
/* byte order */
#undef X_BYTE_ORDER
--
2.24.1

View File

@ -1,7 +1,7 @@
From 7d403201820fb2bdc04bfa8f83c9dd3822c6abda Mon Sep 17 00:00:00 2001
From 23d54f7049c83fd5baf9e008c159c8ffbec3649c Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Thu, 29 Aug 2019 14:18:28 +0200
Subject: [PATCH xserver 01/14] dix: Add GetCurrentClient helper
Subject: [PATCH xserver 01/17] dix: Add GetCurrentClient helper
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@ -49,7 +49,7 @@ Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2 files changed, 23 insertions(+), 1 deletion(-)
diff --git a/dix/dispatch.c b/dix/dispatch.c
index 176c7a0dd..ce84e6c8c 100644
index a33bfaa9e..2b1cf1a74 100644
--- a/dix/dispatch.c
+++ b/dix/dispatch.c
@@ -148,6 +148,7 @@ xConnSetupPrefix connSetupPrefix;
@ -111,5 +111,5 @@ index b6e2bcfde..d65060cb6 100644
extern _X_EXPORT void SetInputCheck(HWEventQueuePtr /*c0 */ ,
HWEventQueuePtr /*c1 */ );
--
2.23.0
2.24.1

View File

@ -0,0 +1,29 @@
From c2ef88c4d3a551ff7646bfb86550cae32b02a510 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michel=20D=C3=A4nzer?= <mdaenzer@redhat.com>
Date: Tue, 14 Jan 2020 09:23:34 +0100
Subject: [PATCH xserver 02/22] modesetting: Explicitly #include "mi.h"
For the miClearDrawable prototype. Apparently it doesn't get pulled in
for some build configurations, breaking the build.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit a24a786fc8490fda08b15c3dab6fa6750f008ecb)
---
hw/xfree86/drivers/modesetting/drmmode_display.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c
index e18cc379f..3874f6e21 100644
--- a/hw/xfree86/drivers/modesetting/drmmode_display.c
+++ b/hw/xfree86/drivers/modesetting/drmmode_display.c
@@ -36,6 +36,7 @@
#include "dumb_bo.h"
#include "xf86str.h"
#include "X11/Xatom.h"
+#include "mi.h"
#include "micmap.h"
#include "xf86cmap.h"
#include "xf86DDC.h"
--
2.24.1

View File

@ -1,7 +1,7 @@
From f473d009dba1029658f6c3fb5751fbbf027ed468 Mon Sep 17 00:00:00 2001
From 707554709a1f7c0f04ef55e72c4cc41ad8e904fd Mon Sep 17 00:00:00 2001
From: Robert Mader <robert.mader@posteo.de>
Date: Mon, 22 Jan 2018 22:02:32 +0100
Subject: [PATCH xserver 02/14] xwayland: Add wp_viewport wayland extension
Subject: [PATCH xserver 02/17] xwayland: Add wp_viewport wayland extension
support
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
@ -23,7 +23,7 @@ Signed-off-by: Hans de Goede <hdegoede@redhat.com>
hw/xwayland/meson.build | 3 +++
hw/xwayland/xwayland.c | 3 +++
hw/xwayland/xwayland.h | 2 ++
5 files changed, 24 insertions(+), 1 deletion(-)
4 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/hw/xwayland/Makefile.am b/hw/xwayland/Makefile.am
index bc1cb8506..49aae3d8b 100644
@ -80,10 +80,10 @@ index 36bf2133a..4a8d171bb 100644
xwayland_glamor = []
eglstream_srcs = []
diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c
index baa08d87b..292f239e8 100644
index 5fefa5923..13b298f7f 100644
--- a/hw/xwayland/xwayland.c
+++ b/hw/xwayland/xwayland.c
@@ -863,6 +863,9 @@ registry_global(void *data, struct wl_registry *registry, uint32_t id,
@@ -916,6 +916,9 @@ registry_global(void *data, struct wl_registry *registry, uint32_t id,
wl_registry_bind(registry, id, &zxdg_output_manager_v1_interface, 1);
xwl_screen_init_xdg_output(xwl_screen);
}
@ -94,7 +94,7 @@ index baa08d87b..292f239e8 100644
else if (xwl_screen->glamor) {
xwl_glamor_init_wl_registry(xwl_screen, registry, id, interface,
diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h
index 0854df456..c4eabe4c3 100644
index a12ec257b..042e107ce 100644
--- a/hw/xwayland/xwayland.h
+++ b/hw/xwayland/xwayland.h
@@ -48,6 +48,7 @@
@ -114,5 +114,5 @@ index 0854df456..c4eabe4c3 100644
#define XWL_FORMAT_ARGB8888 (1 << 0)
--
2.23.0
2.24.1

View File

@ -0,0 +1,38 @@
From d845ceae53bb425695e6a185b51ae1b432dd4672 Mon Sep 17 00:00:00 2001
From: George Matsumura <gmmatsumura01@bvsd.org>
Date: Thu, 6 Feb 2020 17:54:36 +0100
Subject: [PATCH xserver 03/22] Restrict 1x1 pixmap filling optimization to
GXcopy
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This restricts an optimization whereby the filling of 1x1 pixmaps
went around the driver-provided function to cases where the
source color is meant to be directly copied to the destination,
as opposed to other operations which should produce different
destination values than just the foreground color.
Signed-off-by: George Matsumura <gmmatsumura01@bvsd.org>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
(cherry picked from commit 83826075e59c0393c16d2a2482dc5c9f2fdf4564)
---
exa/exa_accel.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/exa/exa_accel.c b/exa/exa_accel.c
index b26d5c804..41fcb129f 100644
--- a/exa/exa_accel.c
+++ b/exa/exa_accel.c
@@ -1037,7 +1037,7 @@ exaFillRegionSolid(DrawablePtr pDrawable, RegionPtr pRegion, Pixel pixel,
if (pExaPixmap->pDamage &&
pExaPixmap->sys_ptr && pDrawable->type == DRAWABLE_PIXMAP &&
pDrawable->width == 1 && pDrawable->height == 1 &&
- pDrawable->bitsPerPixel != 24) {
+ pDrawable->bitsPerPixel != 24 && alu == GXcopy) {
RegionPtr pending_damage = DamagePendingRegion(pExaPixmap->pDamage);
switch (pDrawable->bitsPerPixel) {
--
2.24.1

View File

@ -1,7 +1,7 @@
From 0356eff57bc1201e2bcd5fdd363a50ceabc4a4fa Mon Sep 17 00:00:00 2001
From 4f06238e319c604638693f5eb452211210b14abf Mon Sep 17 00:00:00 2001
From: Robert Mader <robert.mader@posteo.de>
Date: Tue, 2 Jul 2019 12:03:12 +0200
Subject: [PATCH xserver 03/14] xwayland: Use buffer_damage instead of surface
Subject: [PATCH xserver 03/17] xwayland: Use buffer_damage instead of surface
damage if available
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
@ -63,11 +63,11 @@ index 66720bcc0..cbc715061 100644
xwl_cursor->frame_cb = wl_surface_frame(xwl_cursor->surface);
wl_callback_add_listener(xwl_cursor->frame_cb, &frame_listener, xwl_cursor);
diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c
index 2937d9c97..df771c30f 100644
index c7c077aaa..e583708cb 100644
--- a/hw/xwayland/xwayland-present.c
+++ b/hw/xwayland/xwayland-present.c
@@ -500,9 +500,9 @@ xwl_present_flip(WindowPtr present_window,
xwl_present_window->frame_timer_firing = FALSE;
@@ -495,9 +495,9 @@ xwl_present_flip(WindowPtr present_window,
/* Realign timer */
xwl_present_reset_timer(xwl_present_window);
- wl_surface_damage(xwl_window->surface, 0, 0,
@ -80,10 +80,10 @@ index 2937d9c97..df771c30f 100644
wl_surface_commit(xwl_window->surface);
diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c
index 292f239e8..8b1c7918a 100644
index 13b298f7f..87185e6f3 100644
--- a/hw/xwayland/xwayland.c
+++ b/hw/xwayland/xwayland.c
@@ -759,6 +759,16 @@ xwl_destroy_window(WindowPtr window)
@@ -796,6 +796,16 @@ xwl_destroy_window(WindowPtr window)
return ret;
}
@ -100,7 +100,7 @@ index 292f239e8..8b1c7918a 100644
static void
xwl_window_post_damage(struct xwl_window *xwl_window)
{
@@ -795,13 +805,15 @@ xwl_window_post_damage(struct xwl_window *xwl_window)
@@ -832,13 +842,15 @@ xwl_window_post_damage(struct xwl_window *xwl_window)
*/
if (RegionNumRects(region) > 256) {
box = RegionExtents(region);
@ -120,8 +120,8 @@ index 292f239e8..8b1c7918a 100644
+ }
}
xwl_window->frame_callback = wl_surface_frame(xwl_window->surface);
@@ -844,8 +856,13 @@ registry_global(void *data, struct wl_registry *registry, uint32_t id,
xwl_window_create_frame_callback(xwl_window);
@@ -897,8 +909,13 @@ registry_global(void *data, struct wl_registry *registry, uint32_t id,
struct xwl_screen *xwl_screen = data;
if (strcmp(interface, "wl_compositor") == 0) {
@ -137,11 +137,11 @@ index 292f239e8..8b1c7918a 100644
else if (strcmp(interface, "wl_shm") == 0) {
xwl_screen->shm = wl_registry_bind(registry, id, &wl_shm_interface, 1);
diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h
index c4eabe4c3..3e973d688 100644
index 042e107ce..07baa09e2 100644
--- a/hw/xwayland/xwayland.h
+++ b/hw/xwayland/xwayland.h
@@ -381,6 +381,9 @@ struct xwl_output {
};
@@ -382,6 +382,9 @@ struct xwl_output {
void xwl_window_create_frame_callback(struct xwl_window *xwl_window);
void xwl_sync_events (struct xwl_screen *xwl_screen);
+void xwl_surface_damage(struct xwl_screen *xwl_screen,
@ -151,5 +151,5 @@ index c4eabe4c3..3e973d688 100644
Bool xwl_screen_init_cursor(struct xwl_screen *xwl_screen);
--
2.23.0
2.24.1

View File

@ -0,0 +1,34 @@
From e5293f1c5d7b20d98ed4975dc29a6f88c8bc6a0d Mon Sep 17 00:00:00 2001
From: Adam Jackson <ajax@redhat.com>
Date: Thu, 6 Feb 2020 17:55:25 +0100
Subject: [PATCH xserver 04/22] Revert "dri2: Don't make reference to
noClientException"
It's true that the value would always be -1, if it's not zero, but it's
usually zero is the problem. As a result we return failure from
otherwise successful indirect GLX paths, which isn't very nice of us.
This reverts commit 7d33ab0f8c7958b205076f71e4b47c24aace77fd.
Fixes: https://gitlab.freedesktop.org/xorg/xserver/issues/211
(cherry picked from commit e1fa3beb2fe2519e69f859f0acdc68e5a770de27)
---
glx/glxdri2.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/glx/glxdri2.c b/glx/glxdri2.c
index d402ca860..822515a86 100644
--- a/glx/glxdri2.c
+++ b/glx/glxdri2.c
@@ -295,7 +295,7 @@ __glXDRIcontextWait(__GLXcontext * baseContext,
}
if (ret) {
- *error = -1;
+ *error = cl->client->noClientException;
return TRUE;
}
--
2.24.1

View File

@ -1,7 +1,7 @@
From 873a7d2164c08ddf57e88095b34bbec092f28d31 Mon Sep 17 00:00:00 2001
From 1a24c9850144481cdc0ebf9bea5b3141ddc2c4b2 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Wed, 26 Jun 2019 16:46:54 +0200
Subject: [PATCH xserver 04/14] xwayland: Add fake output modes to xrandr
Subject: [PATCH xserver 04/17] xwayland: Add fake output modes to xrandr
output mode lists
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
@ -162,10 +162,10 @@ index aa6f37864..2ccc3ca60 100644
xorg_list_for_each_entry(it, &xwl_screen->output_list, link) {
/* output done event is sent even when some property
diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c
index 8b1c7918a..a599c022a 100644
index 87185e6f3..44eb0e042 100644
--- a/hw/xwayland/xwayland.c
+++ b/hw/xwayland/xwayland.c
@@ -139,6 +139,23 @@ xwl_screen_get(ScreenPtr screen)
@@ -152,6 +152,23 @@ xwl_screen_get(ScreenPtr screen)
return dixLookupPrivate(&screen->devPrivates, &xwl_screen_private_key);
}
@ -190,10 +190,10 @@ index 8b1c7918a..a599c022a 100644
xwl_window_set_allow_commits(struct xwl_window *xwl_window, Bool allow,
const char *debug_msg)
diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h
index 3e973d688..0fafc07a6 100644
index 07baa09e2..937977ccf 100644
--- a/hw/xwayland/xwayland.h
+++ b/hw/xwayland/xwayland.h
@@ -388,6 +388,7 @@ void xwl_surface_damage(struct xwl_screen *xwl_screen,
@@ -389,6 +389,7 @@ void xwl_surface_damage(struct xwl_screen *xwl_screen,
Bool xwl_screen_init_cursor(struct xwl_screen *xwl_screen);
struct xwl_screen *xwl_screen_get(ScreenPtr screen);
@ -202,5 +202,5 @@ index 3e973d688..0fafc07a6 100644
void xwl_tablet_tool_set_cursor(struct xwl_tablet_tool *tool);
void xwl_seat_set_cursor(struct xwl_seat *xwl_seat);
--
2.23.0
2.24.1

View File

@ -0,0 +1,39 @@
From af2fd88b1019f63fe3ce871f9e99b3e1e4608b25 Mon Sep 17 00:00:00 2001
From: Daniel Llewellyn <daniel@bowlhat.net>
Date: Thu, 6 Feb 2020 17:56:12 +0100
Subject: [PATCH xserver 05/22] os: Ignore dying client in ResetCurrentRequest
You might as well, it's harmless. Better, some cleanup code (like DRI2
swap wait) needs to run both normally and at client exit, so it
simplifies the callers to not need to check first. See 4308f5d3 for a
similar example.
Props: @ajax (Adam Jackson)
Fixes: xorg/xserver#211
Signed-off-by: Daniel Llewellyn <diddledan@ubuntu.com>
(cherry picked from commit 578371616e09364318c9fb2371a693d438b31b29)
---
os/io.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/os/io.c b/os/io.c
index b099f0967..939f51743 100644
--- a/os/io.c
+++ b/os/io.c
@@ -557,6 +557,11 @@ void
ResetCurrentRequest(ClientPtr client)
{
OsCommPtr oc = (OsCommPtr) client->osPrivate;
+
+ /* ignore dying clients */
+ if (!oc)
+ return;
+
register ConnectionInputPtr oci = oc->input;
register xReq *request;
int gotnow, needed;
--
2.24.1

View File

@ -1,7 +1,7 @@
From 81ff61afd6594e0cf00f4be7ff34f94cd9e8f9b0 Mon Sep 17 00:00:00 2001
From 10ea651c552c8a7d7a2bfab29b7def4f31f8af6c Mon Sep 17 00:00:00 2001
From: Robert Mader <robert.mader@posteo.de>
Date: Mon, 22 Jan 2018 17:57:38 +0100
Subject: [PATCH xserver 05/14] xwayland: Use RandR 1.2 interface (rev 2)
Subject: [PATCH xserver 05/17] xwayland: Use RandR 1.2 interface (rev 2)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@ -134,5 +134,5 @@ index 2ccc3ca60..67e99bdab 100644
return TRUE;
}
--
2.23.0
2.24.1

View File

@ -0,0 +1,37 @@
From 1c3e51dabadbf65e7fdedbebbdcd19a85fb03e34 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michel=20D=C3=A4nzer?= <mdaenzer@redhat.com>
Date: Thu, 6 Feb 2020 17:57:16 +0100
Subject: [PATCH xserver 06/22] xfree86/modes: Bail from xf86RotateRedisplay if
pScreen->root is NULL
Avoids a crash in xf86RotatePrepare -> DamageRegister during
CreateScreenResources if rotation or another transform is configured for
any connected RandR output in xorg.conf. The generic rotation/transform
code generally can't work without the root window currently.
Closes: https://gitlab.freedesktop.org/xorg/xserver/issues/969
Fixes: 094f42cdfe5d "xfree86/modes: Call xf86RotateRedisplay from
xf86CrtcRotate"
Acked-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
(cherry picked from commit 6a5e47c57d16de8b6a6a2636f3cbad1aebec32e2)
---
hw/xfree86/modes/xf86Rotate.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/xfree86/modes/xf86Rotate.c b/hw/xfree86/modes/xf86Rotate.c
index 05944cfcb..5415ed97c 100644
--- a/hw/xfree86/modes/xf86Rotate.c
+++ b/hw/xfree86/modes/xf86Rotate.c
@@ -176,7 +176,7 @@ xf86RotateRedisplay(ScreenPtr pScreen)
DamagePtr damage = xf86_config->rotation_damage;
RegionPtr region;
- if (!damage)
+ if (!damage || !pScreen->root)
return FALSE;
xf86RotatePrepare(pScreen);
region = DamageRegion(damage);
--
2.24.1

View File

@ -1,7 +1,7 @@
From 1dc4938467b6338695eda4224f0b0c592cb2c25c Mon Sep 17 00:00:00 2001
From 000b477eee11fddd0d4e323407aaa40afb818827 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Thu, 29 Aug 2019 22:45:12 +0200
Subject: [PATCH xserver 06/14] xwayland: Add per client private data
Subject: [PATCH xserver 06/17] xwayland: Add per client private data
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@ -20,10 +20,10 @@ Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2 files changed, 19 insertions(+)
diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c
index a599c022a..2b6065f1a 100644
index 44eb0e042..7720baab8 100644
--- a/hw/xwayland/xwayland.c
+++ b/hw/xwayland/xwayland.c
@@ -122,11 +122,18 @@ ddxProcessArgument(int argc, char *argv[], int i)
@@ -135,11 +135,18 @@ ddxProcessArgument(int argc, char *argv[], int i)
return 0;
}
@ -42,7 +42,7 @@ index a599c022a..2b6065f1a 100644
static struct xwl_window *
xwl_window_get(WindowPtr window)
{
@@ -1083,6 +1090,13 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv)
@@ -1136,6 +1143,13 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv)
return FALSE;
if (!dixRegisterPrivateKey(&xwl_damage_private_key, PRIVATE_WINDOW, 0))
return FALSE;
@ -57,12 +57,12 @@ index a599c022a..2b6065f1a 100644
dixSetPrivate(&pScreen->devPrivates, &xwl_screen_private_key, xwl_screen);
xwl_screen->screen = pScreen;
diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h
index 0fafc07a6..17018fcf5 100644
index 937977ccf..630b14e48 100644
--- a/hw/xwayland/xwayland.h
+++ b/hw/xwayland/xwayland.h
@@ -380,6 +380,11 @@ struct xwl_output {
Bool xdg_output_done;
};
@@ -381,6 +381,11 @@ struct xwl_output {
void xwl_window_create_frame_callback(struct xwl_window *xwl_window);
+struct xwl_client {
+};
@ -73,5 +73,5 @@ index 0fafc07a6..17018fcf5 100644
void xwl_surface_damage(struct xwl_screen *xwl_screen,
struct wl_surface *surface,
--
2.23.0
2.24.1

View File

@ -0,0 +1,59 @@
From 948afd768398955f043fef8e14d7d154cea25f85 Mon Sep 17 00:00:00 2001
From: Dave Airlie <airlied@redhat.com>
Date: Thu, 6 Feb 2020 17:59:08 +0100
Subject: [PATCH xserver 07/22] modesetting: remove unnecessary error message,
fix zaphod leases
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
I introduced this error with the MST hotplug code, but it can trigger
on zaphod setups, and is perfectly fine. There is no support for
MST/hotplug on zaphod setups currently, so we can just skip over
the dynamic connector handling here. However we shouldn't skip
over the lease handling so move it into the codepath.
Fixes: 9257b1252da9 ("modesetting: add dynamic connector hotplug support (MST) (v3)")
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 1cfdd1a96580733df3625bcea3384ffee3dc92df)
---
hw/xfree86/drivers/modesetting/drmmode_display.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c
index 3874f6e21..ae06fa357 100644
--- a/hw/xfree86/drivers/modesetting/drmmode_display.c
+++ b/hw/xfree86/drivers/modesetting/drmmode_display.c
@@ -3677,7 +3677,7 @@ drmmode_handle_uevents(int fd, void *closure)
goto out;
if (mode_res->count_crtcs != config->num_crtc) {
- ErrorF("number of CRTCs changed - failed to handle, %d vs %d\n", mode_res->count_crtcs, config->num_crtc);
+ /* this triggers with Zaphod mode where we don't currently support connector hotplug or MST. */
goto out_free_res;
}
@@ -3726,15 +3726,16 @@ drmmode_handle_uevents(int fd, void *closure)
drmmode_output_init(scrn, drmmode, mode_res, i, TRUE, 0);
}
- /* Check to see if a lessee has disappeared */
- drmmode_validate_leases(scrn);
-
if (changed) {
RRSetChanged(xf86ScrnToScreen(scrn));
RRTellChanged(xf86ScrnToScreen(scrn));
}
out_free_res:
+
+ /* Check to see if a lessee has disappeared */
+ drmmode_validate_leases(scrn);
+
drmModeFreeResources(mode_res);
out:
RRGetInfo(xf86ScrnToScreen(scrn), TRUE);
--
2.24.1

View File

@ -1,7 +1,7 @@
From dfb887783bfe3c5f57d46738bce13ec2d79b1769 Mon Sep 17 00:00:00 2001
From 7c9852e4e9e85000d6c8759b237ed9e9320dadfd Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Thu, 29 Aug 2019 23:04:36 +0200
Subject: [PATCH xserver 07/14] xwayland: Add support for storing per client
Subject: [PATCH xserver 07/17] xwayland: Add support for storing per client
per output emulated resolution
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
@ -108,12 +108,12 @@ index 67e99bdab..82ff5db70 100644
const int32_t xwl_output_fake_modes[][2] = {
/* 4:3 (1.33) */
diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h
index 17018fcf5..d0e87a89d 100644
index 630b14e48..7e6497b80 100644
--- a/hw/xwayland/xwayland.h
+++ b/hw/xwayland/xwayland.h
@@ -380,7 +380,21 @@ struct xwl_output {
Bool xdg_output_done;
};
@@ -381,7 +381,21 @@ struct xwl_output {
void xwl_window_create_frame_callback(struct xwl_window *xwl_window);
+/* Per client per output emulated randr/vidmode resolution info. */
+struct xwl_emulated_mode {
@ -133,7 +133,7 @@ index 17018fcf5..d0e87a89d 100644
};
struct xwl_client *xwl_client_get(ClientPtr client);
@@ -424,6 +438,9 @@ void xwl_output_destroy(struct xwl_output *xwl_output);
@@ -425,6 +439,9 @@ void xwl_output_destroy(struct xwl_output *xwl_output);
void xwl_output_remove(struct xwl_output *xwl_output);
@ -144,5 +144,5 @@ index 17018fcf5..d0e87a89d 100644
float VRefresh, Bool Reduced, Bool Interlaced);
--
2.23.0
2.24.1

View File

@ -0,0 +1,44 @@
From 428b5ce4da99a43bfa0c1933ec447f7feb3639a1 Mon Sep 17 00:00:00 2001
From: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Date: Mon, 10 Feb 2020 10:19:18 +0100
Subject: [PATCH xserver 08/22] glamor: Propagate FBO allocation failure for
picture to texture upload
When uploading a picture to a texture, glamor_upload_picture_to_texture
calls glamor_pixmap_ensure_fbo to ensure that there is backing FBO.
The FBO will be allocated if the picture's drawable pixmap does not have
one already, which can fail when there is no GL memory left.
glamor_upload_picture_to_texture checks that the call succeeded and will
enter the failure path if it did not. However, unlike many other
functions in glamor, this one has ret set to TRUE initially, so it needs
to be set to FALSE when a failure happens.
Otherwise, the error is not propagated and the failure path return TRUE.
This leads to a fault when trying to access the FBO pointer later on.
Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
(cherry picked from commit c98c7709c67d8ed6b7455ec700a49b58c396ec2c)
---
glamor/glamor_picture.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/glamor/glamor_picture.c b/glamor/glamor_picture.c
index 84a33ad6a..685d8d618 100644
--- a/glamor/glamor_picture.c
+++ b/glamor/glamor_picture.c
@@ -340,8 +340,10 @@ glamor_upload_picture_to_texture(PicturePtr picture)
else
iformat = format;
- if (!glamor_pixmap_ensure_fbo(pixmap, iformat, GLAMOR_CREATE_FBO_NO_FBO))
+ if (!glamor_pixmap_ensure_fbo(pixmap, iformat, GLAMOR_CREATE_FBO_NO_FBO)) {
+ ret = FALSE;
goto fail;
+ }
glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
--
2.24.1

View File

@ -1,7 +1,7 @@
From e997273b14a23b0ffe89f542de783adbec6e8a1b Mon Sep 17 00:00:00 2001
From 869e6f39165daeacdd9cbb3f2f0d1845a3af3360 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Tue, 2 Jul 2019 11:55:26 +0200
Subject: [PATCH xserver 08/14] xwayland: Add support for randr-resolution
Subject: [PATCH xserver 08/17] xwayland: Add support for randr-resolution
change emulation using viewport
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
@ -142,10 +142,10 @@ index 82ff5db70..99ab1b288 100644
static Bool
diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c
index 2b6065f1a..ec1b7eee4 100644
index 7720baab8..1466e1e11 100644
--- a/hw/xwayland/xwayland.c
+++ b/hw/xwayland/xwayland.c
@@ -163,6 +163,23 @@ xwl_screen_has_resolution_change_emulation(struct xwl_screen *xwl_screen)
@@ -176,6 +176,23 @@ xwl_screen_has_resolution_change_emulation(struct xwl_screen *xwl_screen)
return xwl_screen->rootless && xwl_screen_has_viewport_support(xwl_screen);
}
@ -169,7 +169,7 @@ index 2b6065f1a..ec1b7eee4 100644
static void
xwl_window_set_allow_commits(struct xwl_window *xwl_window, Bool allow,
const char *debug_msg)
@@ -499,6 +516,150 @@ xwl_pixmap_get(PixmapPtr pixmap)
@@ -512,6 +529,150 @@ xwl_pixmap_get(PixmapPtr pixmap)
return dixLookupPrivate(&pixmap->devPrivates, &xwl_pixmap_private_key);
}
@ -320,7 +320,7 @@ index 2b6065f1a..ec1b7eee4 100644
static void
xwl_window_init_allow_commits(struct xwl_window *xwl_window)
{
@@ -569,6 +730,8 @@ ensure_surface_for_window(WindowPtr window)
@@ -582,6 +743,8 @@ ensure_surface_for_window(WindowPtr window)
xwl_window->xwl_screen = xwl_screen;
xwl_window->window = window;
@ -329,15 +329,15 @@ index 2b6065f1a..ec1b7eee4 100644
xwl_window->surface = wl_compositor_create_surface(xwl_screen->compositor);
if (xwl_window->surface == NULL) {
ErrorF("wl_display_create_surface failed\n");
@@ -610,6 +773,7 @@ ensure_surface_for_window(WindowPtr window)
@@ -623,6 +786,7 @@ ensure_surface_for_window(WindowPtr window)
dixSetPrivate(&window->devPrivates, &xwl_window_private_key, xwl_window);
xorg_list_init(&xwl_window->link_damage);
+ xorg_list_add(&xwl_window->link_window, &xwl_screen->window_list);
xwl_window_init_allow_commits(xwl_window);
@@ -704,8 +868,12 @@ xwl_unrealize_window(WindowPtr window)
#ifdef GLAMOR_HAS_GBM
xorg_list_init(&xwl_window->frame_callback_list);
@@ -716,8 +880,12 @@ xwl_unrealize_window(WindowPtr window)
if (!xwl_window)
return ret;
@ -350,7 +350,7 @@ index 2b6065f1a..ec1b7eee4 100644
unregister_damage(window);
if (xwl_window->frame_callback)
@@ -743,6 +911,33 @@ xwl_set_window_pixmap(WindowPtr window,
@@ -760,6 +928,33 @@ xwl_set_window_pixmap(WindowPtr window,
ensure_surface_for_window(window);
}
@ -384,7 +384,7 @@ index 2b6065f1a..ec1b7eee4 100644
static void
frame_callback(void *data,
struct wl_callback *callback,
@@ -1158,6 +1353,7 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv)
@@ -1211,6 +1406,7 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv)
xorg_list_init(&xwl_screen->output_list);
xorg_list_init(&xwl_screen->seat_list);
xorg_list_init(&xwl_screen->damage_window_list);
@ -392,7 +392,7 @@ index 2b6065f1a..ec1b7eee4 100644
xwl_screen->depth = 24;
xwl_screen->display = wl_display_connect(NULL);
@@ -1256,6 +1452,9 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv)
@@ -1309,6 +1505,9 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv)
xwl_screen->CloseScreen = pScreen->CloseScreen;
pScreen->CloseScreen = xwl_close_screen;
@ -403,7 +403,7 @@ index 2b6065f1a..ec1b7eee4 100644
xwl_screen->SetWindowPixmap = pScreen->SetWindowPixmap;
pScreen->SetWindowPixmap = xwl_set_window_pixmap;
diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h
index d0e87a89d..b52de11d2 100644
index 7e6497b80..56e753306 100644
--- a/hw/xwayland/xwayland.h
+++ b/hw/xwayland/xwayland.h
@@ -135,10 +135,12 @@ struct xwl_screen {
@ -433,7 +433,7 @@ index d0e87a89d..b52de11d2 100644
struct wl_callback *frame_callback;
Bool allow_commits;
#ifdef GLAMOR_HAS_GBM
@@ -408,6 +414,9 @@ Bool xwl_screen_init_cursor(struct xwl_screen *xwl_screen);
@@ -409,6 +415,9 @@ Bool xwl_screen_init_cursor(struct xwl_screen *xwl_screen);
struct xwl_screen *xwl_screen_get(ScreenPtr screen);
Bool xwl_screen_has_resolution_change_emulation(struct xwl_screen *xwl_screen);
@ -443,7 +443,7 @@ index d0e87a89d..b52de11d2 100644
void xwl_tablet_tool_set_cursor(struct xwl_tablet_tool *tool);
void xwl_seat_set_cursor(struct xwl_seat *xwl_seat);
@@ -441,6 +450,12 @@ void xwl_output_remove(struct xwl_output *xwl_output);
@@ -442,6 +451,12 @@ void xwl_output_remove(struct xwl_output *xwl_output);
struct xwl_emulated_mode *xwl_output_get_emulated_mode_for_client(
struct xwl_output *xwl_output, ClientPtr client);
@ -457,5 +457,5 @@ index d0e87a89d..b52de11d2 100644
float VRefresh, Bool Reduced, Bool Interlaced);
--
2.23.0
2.24.1

View File

@ -0,0 +1,66 @@
From a7b165d994d74131778a5a9bcffec957f1d1cacb Mon Sep 17 00:00:00 2001
From: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Date: Mon, 10 Feb 2020 10:20:04 +0100
Subject: [PATCH xserver 09/22] glamor: Error out on out-of-memory when
allocating PBO for FBO access
Packed buffer allocation (which happens at glBufferData time with the
buffer bound) can fail when there is no GL memory left.
Pick up the error when it happens, print a proper error message, do
some cleanup and bail.
Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
(cherry picked from commit bc2e12239f86e5a4acd220744f42eb83ba55d328)
---
glamor/glamor_prepare.c | 17 +++++++++++++++++
glamor/glamor_priv.h | 1 +
2 files changed, 18 insertions(+)
diff --git a/glamor/glamor_prepare.c b/glamor/glamor_prepare.c
index 5a73e6c7d..6b35936fc 100644
--- a/glamor/glamor_prepare.c
+++ b/glamor/glamor_prepare.c
@@ -88,10 +88,27 @@ glamor_prep_pixmap_box(PixmapPtr pixmap, glamor_access_t access, BoxPtr box)
gl_usage = GL_STREAM_READ;
+ glamor_priv->suppress_gl_out_of_memory_logging = true;
+
glBindBuffer(GL_PIXEL_PACK_BUFFER, priv->pbo);
glBufferData(GL_PIXEL_PACK_BUFFER,
pixmap->devKind * pixmap->drawable.height, NULL,
gl_usage);
+
+ glamor_priv->suppress_gl_out_of_memory_logging = false;
+
+ if (glGetError() == GL_OUT_OF_MEMORY) {
+ if (!glamor_priv->logged_any_pbo_allocation_failure) {
+ LogMessageVerb(X_WARNING, 0, "glamor: Failed to allocate %d "
+ "bytes PBO due to GL_OUT_OF_MEMORY.\n",
+ pixmap->devKind * pixmap->drawable.height);
+ glamor_priv->logged_any_pbo_allocation_failure = true;
+ }
+ glBindBuffer(GL_PIXEL_PACK_BUFFER, 0);
+ glDeleteBuffers(1, &priv->pbo);
+ priv->pbo = 0;
+ return FALSE;
+ }
} else {
pixmap->devPrivate.ptr = xallocarray(pixmap->devKind,
pixmap->drawable.height);
diff --git a/glamor/glamor_priv.h b/glamor/glamor_priv.h
index 661c11d90..1686ef5a4 100644
--- a/glamor/glamor_priv.h
+++ b/glamor/glamor_priv.h
@@ -289,6 +289,7 @@ typedef struct glamor_screen_private {
Bool suppress_gl_out_of_memory_logging;
Bool logged_any_fbo_allocation_failure;
+ Bool logged_any_pbo_allocation_failure;
/* xv */
glamor_program xv_prog;
--
2.24.1

View File

@ -1,7 +1,7 @@
From 1ea054bda6618025838c3afb052080b749582454 Mon Sep 17 00:00:00 2001
From 3367f9a40c56b48b4945d8529934ef0ac8c395f3 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Mon, 8 Jul 2019 14:00:27 +0200
Subject: [PATCH xserver 09/14] xwayland: Add xwlRRModeToDisplayMode() helper
Subject: [PATCH xserver 09/17] xwayland: Add xwlRRModeToDisplayMode() helper
function
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
@ -96,5 +96,5 @@ index 0bcd11401..a59c9f6a9 100644
return TRUE;
}
--
2.23.0
2.24.1

View File

@ -0,0 +1,45 @@
From ca034c2f2cfff8e49b816b8ecbaa96215b796e36 Mon Sep 17 00:00:00 2001
From: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Date: Mon, 10 Feb 2020 10:20:30 +0100
Subject: [PATCH xserver 10/22] glamor: Propagate glamor_prepare_access
failures in copy helpers
glamor_prepare_access can fail for a few reasons, especially when
failing to allocate a PBO buffer. Take this in account and bail in
the copy helpers that call the helper when a failure happens.
Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
(cherry picked from commit de6b3fac1f26075ce915006c914c4a4755617715)
---
glamor/glamor_copy.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/glamor/glamor_copy.c b/glamor/glamor_copy.c
index e050c0220..1ab2be6c0 100644
--- a/glamor/glamor_copy.c
+++ b/glamor/glamor_copy.c
@@ -221,7 +221,9 @@ glamor_copy_cpu_fbo(DrawablePtr src,
goto bail;
glamor_make_current(glamor_priv);
- glamor_prepare_access(src, GLAMOR_ACCESS_RO);
+
+ if (!glamor_prepare_access(src, GLAMOR_ACCESS_RO))
+ goto bail;
glamor_get_drawable_deltas(dst, dst_pixmap, &dst_xoff, &dst_yoff);
@@ -309,7 +311,9 @@ glamor_copy_fbo_cpu(DrawablePtr src,
goto bail;
glamor_make_current(glamor_priv);
- glamor_prepare_access(dst, GLAMOR_ACCESS_RW);
+
+ if (!glamor_prepare_access(dst, GLAMOR_ACCESS_RW))
+ goto bail;
glamor_get_drawable_deltas(src, src_pixmap, &src_xoff, &src_yoff);
--
2.24.1

View File

@ -1,7 +1,7 @@
From 9edd8e37b5e2659a71b05dabed45fd7c3447de79 Mon Sep 17 00:00:00 2001
From 9da07f246b50292d24347608d5bba92efd1756af Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Mon, 8 Jul 2019 18:35:27 +0200
Subject: [PATCH xserver 10/14] xwayland: Add xwlVidModeGetCurrentRRMode helper
Subject: [PATCH xserver 10/17] xwayland: Add xwlVidModeGetCurrentRRMode helper
to the vidmode code
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
@ -188,5 +188,5 @@ index a59c9f6a9..e9aea7269 100644
static void
--
2.23.0
2.24.1

View File

@ -0,0 +1,67 @@
From d2a6c8708ca4f27c8d9aade6db2c4e7f2d8c624f Mon Sep 17 00:00:00 2001
From: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Date: Mon, 10 Feb 2020 10:21:02 +0100
Subject: [PATCH xserver 11/22] glamor: Fallback to system memory for RW PBO
buffer allocation
We currently support two modes of operation for RW PBO buffers: one
that allocates a pack buffer with GL memory and one that uses system
memory when the former is not supported.
Since allocation with system memory is less likely to fail, add a
fallback to system memory when GL memory failed instead of bailing
out.
Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
(cherry picked from commit 8c4e8d9eff03cefc987f13c900b0a47403946127)
---
glamor/glamor_prepare.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/glamor/glamor_prepare.c b/glamor/glamor_prepare.c
index 6b35936fc..c1a611f9a 100644
--- a/glamor/glamor_prepare.c
+++ b/glamor/glamor_prepare.c
@@ -107,9 +107,10 @@ glamor_prep_pixmap_box(PixmapPtr pixmap, glamor_access_t access, BoxPtr box)
glBindBuffer(GL_PIXEL_PACK_BUFFER, 0);
glDeleteBuffers(1, &priv->pbo);
priv->pbo = 0;
- return FALSE;
}
- } else {
+ }
+
+ if (!priv->pbo) {
pixmap->devPrivate.ptr = xallocarray(pixmap->devKind,
pixmap->drawable.height);
if (!pixmap->devPrivate.ptr)
@@ -123,7 +124,7 @@ glamor_prep_pixmap_box(PixmapPtr pixmap, glamor_access_t access, BoxPtr box)
RegionUninit(&region);
- if (glamor_priv->has_rw_pbo) {
+ if (priv->pbo) {
if (priv->map_access == GLAMOR_ACCESS_RW)
gl_access = GL_READ_WRITE;
else
@@ -155,7 +156,7 @@ glamor_fini_pixmap(PixmapPtr pixmap)
if (!priv->prepared)
return;
- if (glamor_priv->has_rw_pbo) {
+ if (priv->pbo) {
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, priv->pbo);
glUnmapBuffer(GL_PIXEL_UNPACK_BUFFER);
pixmap->devPrivate.ptr = NULL;
@@ -170,7 +171,7 @@ glamor_fini_pixmap(PixmapPtr pixmap)
RegionUninit(&priv->prepare_region);
- if (glamor_priv->has_rw_pbo) {
+ if (priv->pbo) {
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
glDeleteBuffers(1, &priv->pbo);
priv->pbo = 0;
--
2.24.1

View File

@ -1,7 +1,7 @@
From 984691516d78284a8ab63058b0c1d3c68666a7d9 Mon Sep 17 00:00:00 2001
From 9b119998db0d5e28e912d82de5b04674200f341b Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Tue, 9 Jul 2019 09:31:13 +0200
Subject: [PATCH xserver 11/14] xwayland: Add vidmode mode changing emulation
Subject: [PATCH xserver 11/17] xwayland: Add vidmode mode changing emulation
support
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
@ -231,5 +231,5 @@ index e9aea7269..56aac693a 100644
static Bool
--
2.23.0
2.24.1

View File

@ -0,0 +1,28 @@
From d44bbb4710961651dcf10701bc562f1f01509010 Mon Sep 17 00:00:00 2001
From: Eric Anholt <eric@anholt.net>
Date: Mon, 10 Feb 2020 10:22:34 +0100
Subject: [PATCH xserver 12/22] glamor: Fix a compiler warning since the recent
OOM fixes.
Signed-off-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 3b26b90cb787a14fa5f8bb2033eab8ab6562a9a5)
---
glamor/glamor_prepare.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/glamor/glamor_prepare.c b/glamor/glamor_prepare.c
index c1a611f9a..835c4ebea 100644
--- a/glamor/glamor_prepare.c
+++ b/glamor/glamor_prepare.c
@@ -146,8 +146,6 @@ glamor_prep_pixmap_box(PixmapPtr pixmap, glamor_access_t access, BoxPtr box)
static void
glamor_fini_pixmap(PixmapPtr pixmap)
{
- ScreenPtr screen = pixmap->drawable.pScreen;
- glamor_screen_private *glamor_priv = glamor_get_screen_private(screen);
glamor_pixmap_private *priv = glamor_get_pixmap_private(pixmap);
if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(priv))
--
2.24.1

View File

@ -1,7 +1,7 @@
From 912688326c0f9435660e86a2bdab049caa4b0e9f Mon Sep 17 00:00:00 2001
From fc9ccf1bd1dc3dadbde022bf7f353dfae93d089e Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Mon, 26 Aug 2019 12:26:34 +0200
Subject: [PATCH xserver 12/14] xwayland: xwl_window_should_enable_viewport:
Subject: [PATCH xserver 12/17] xwayland: xwl_window_should_enable_viewport:
Add extra test
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
@ -24,10 +24,10 @@ Signed-off-by: Hans de Goede <hdegoede@redhat.com>
1 file changed, 17 insertions(+)
diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c
index ec1b7eee4..58252d2e8 100644
index 1466e1e11..19a348255 100644
--- a/hw/xwayland/xwayland.c
+++ b/hw/xwayland/xwayland.c
@@ -636,6 +636,23 @@ xwl_window_should_enable_viewport(struct xwl_window *xwl_window,
@@ -649,6 +649,23 @@ xwl_window_should_enable_viewport(struct xwl_window *xwl_window,
}
}
@ -52,5 +52,5 @@ index ec1b7eee4..58252d2e8 100644
}
--
2.23.0
2.24.1

View File

@ -0,0 +1,69 @@
From 1ba5e528d52ed9d7d67eb45c5d3e04b6f5d22b05 Mon Sep 17 00:00:00 2001
From: Maarten Lankhorst <dev@mblankhorst.nl>
Date: Thu, 25 Apr 2019 11:46:41 +0200
Subject: [PATCH xserver 13/22] modesetting: Disable atomic support by default
The atomic driver has issues with modesetting when stealing
connectors from a different crtc, a black screen when doing rotation
on a different crtc, and in general is just a mapping of the legacy
helpers to atomic. This is already done in the kernel, so just
fallback to legacy by default until this is fixed.
Please backport to 1.20, as we don't want to enable it for everyone
there. It breaks for existing users.
The fixes to make the xserver more atomic have been pending on the
mailing list for ages.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=110375
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=110030
References: https://gitlab.freedesktop.org/xorg/xserver/merge_requests/36/commits
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
(cherry picked from commit f0d78b47ac49977a6007f5fe081f00c6eb19a12e)
---
hw/xfree86/drivers/modesetting/driver.c | 9 +++++++--
hw/xfree86/drivers/modesetting/driver.h | 1 +
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/hw/xfree86/drivers/modesetting/driver.c b/hw/xfree86/drivers/modesetting/driver.c
index 9beb51f36..0612a08f6 100644
--- a/hw/xfree86/drivers/modesetting/driver.c
+++ b/hw/xfree86/drivers/modesetting/driver.c
@@ -131,6 +131,7 @@ static const OptionInfoRec Options[] = {
{OPTION_PAGEFLIP, "PageFlip", OPTV_BOOLEAN, {0}, FALSE},
{OPTION_ZAPHOD_HEADS, "ZaphodHeads", OPTV_STRING, {0}, FALSE},
{OPTION_DOUBLE_SHADOW, "DoubleShadow", OPTV_BOOLEAN, {0}, FALSE},
+ {OPTION_ATOMIC, "Atomic", OPTV_BOOLEAN, {0}, FALSE},
{-1, NULL, OPTV_NONE, {0}, FALSE}
};
@@ -1038,8 +1039,12 @@ PreInit(ScrnInfoPtr pScrn, int flags)
#endif
}
- ret = drmSetClientCap(ms->fd, DRM_CLIENT_CAP_ATOMIC, 1);
- ms->atomic_modeset = (ret == 0);
+ if (xf86ReturnOptValBool(ms->drmmode.Options, OPTION_ATOMIC, FALSE)) {
+ ret = drmSetClientCap(ms->fd, DRM_CLIENT_CAP_ATOMIC, 1);
+ ms->atomic_modeset = (ret == 0);
+ } else {
+ ms->atomic_modeset = FALSE;
+ }
ms->kms_has_modifiers = FALSE;
ret = drmGetCap(ms->fd, DRM_CAP_ADDFB2_MODIFIERS, &value);
diff --git a/hw/xfree86/drivers/modesetting/driver.h b/hw/xfree86/drivers/modesetting/driver.h
index 493280c1d..8bfb2fc1a 100644
--- a/hw/xfree86/drivers/modesetting/driver.h
+++ b/hw/xfree86/drivers/modesetting/driver.h
@@ -51,6 +51,7 @@ typedef enum {
OPTION_PAGEFLIP,
OPTION_ZAPHOD_HEADS,
OPTION_DOUBLE_SHADOW,
+ OPTION_ATOMIC,
} modesettingOpts;
typedef struct
--
2.24.1

View File

@ -1,7 +1,7 @@
From d9f1d6f51f4c2d388214a675330b58ba2facb170 Mon Sep 17 00:00:00 2001
From 2fd8751593ed1268e859a9a19f0eea3820ce5f69 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Mon, 2 Sep 2019 17:32:45 +0200
Subject: [PATCH xserver 13/14] xwayland: Set _XWAYLAND_RANDR_EMU_MONITOR_RECTS
Subject: [PATCH xserver 13/17] xwayland: Set _XWAYLAND_RANDR_EMU_MONITOR_RECTS
property for resolution emulation
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
@ -138,10 +138,10 @@ index 99ab1b288..20c254962 100644
static void
diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c
index 58252d2e8..75ff9f011 100644
index 19a348255..1840ccbfb 100644
--- a/hw/xwayland/xwayland.c
+++ b/hw/xwayland/xwayland.c
@@ -677,6 +677,27 @@ xwl_screen_check_resolution_change_emulation(struct xwl_screen *xwl_screen)
@@ -690,6 +690,27 @@ xwl_screen_check_resolution_change_emulation(struct xwl_screen *xwl_screen)
xwl_window_check_resolution_change_emulation(xwl_window);
}
@ -169,7 +169,7 @@ index 58252d2e8..75ff9f011 100644
static void
xwl_window_init_allow_commits(struct xwl_window *xwl_window)
{
@@ -838,6 +859,8 @@ xwl_realize_window(WindowPtr window)
@@ -855,6 +876,8 @@ xwl_realize_window(WindowPtr window)
return FALSE;
}
@ -179,10 +179,10 @@ index 58252d2e8..75ff9f011 100644
}
diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h
index b52de11d2..2d825ee8c 100644
index 56e753306..ef1138348 100644
--- a/hw/xwayland/xwayland.h
+++ b/hw/xwayland/xwayland.h
@@ -417,6 +417,7 @@ Bool xwl_screen_has_resolution_change_emulation(struct xwl_screen *xwl_screen);
@@ -418,6 +418,7 @@ Bool xwl_screen_has_resolution_change_emulation(struct xwl_screen *xwl_screen);
struct xwl_output *xwl_screen_get_first_output(struct xwl_screen *xwl_screen);
void xwl_screen_check_resolution_change_emulation(struct xwl_screen *xwl_screen);
Bool xwl_window_has_viewport_enabled(struct xwl_window *xwl_window);
@ -190,7 +190,7 @@ index b52de11d2..2d825ee8c 100644
void xwl_tablet_tool_set_cursor(struct xwl_tablet_tool *tool);
void xwl_seat_set_cursor(struct xwl_seat *xwl_seat);
@@ -455,6 +456,8 @@ RRModePtr xwl_output_find_mode(struct xwl_output *xwl_output,
@@ -456,6 +457,8 @@ RRModePtr xwl_output_find_mode(struct xwl_output *xwl_output,
void xwl_output_set_emulated_mode(struct xwl_output *xwl_output,
ClientPtr client, RRModePtr mode,
Bool from_vidmode);
@ -200,5 +200,5 @@ index b52de11d2..2d825ee8c 100644
RRModePtr xwayland_cvt(int HDisplay, int VDisplay,
float VRefresh, Bool Reduced, Bool Interlaced);
--
2.23.0
2.24.1

View File

@ -1,7 +1,7 @@
From c392765d459bd2cac6e3f431c67d698bb905e0ab Mon Sep 17 00:00:00 2001
From a5b9f4880ab61dc0c02065e6fdf5e2f16f36be7c Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Mon, 7 Oct 2019 14:27:49 +0200
Subject: [PATCH xserver 14/14] xwayland: Fix emulated modes not being removed
Subject: [PATCH xserver 14/17] xwayland: Fix emulated modes not being removed
when screen rotation is used
The code building the mode-list does the following to deal with screen
@ -57,5 +57,5 @@ index 20c254962..7d705d919 100644
else
xwl_output_add_emulated_mode_for_client(xwl_output, client, mode, from_vidmode);
--
2.23.0
2.24.1

View File

@ -0,0 +1,64 @@
From a93bce6bfc6c610676a7fbc76639854c5553cb2c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michel=20D=C3=A4nzer?= <mdaenzer@redhat.com>
Date: Fri, 7 Feb 2020 12:06:39 +0100
Subject: [PATCH xserver 14/22] xwayland: Split up xwl_screen_post_damage into
two phases
The first phase sets the new surface properties for all damaged
windows, then the second phase commits all surface updates.
This is preparatory for the next change, there should be no observable
change in behaviour (other than the order of Wayland protocol
requests).
Reviewed-by: Adam Jackson <ajax@redhat.com>
(cherry picked from commit f88d9b1f779835302e02e255fcd45989db7f488d)
---
hw/xwayland/xwayland.c | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c
index 324c68ccf..de35a5af0 100644
--- a/hw/xwayland/xwayland.c
+++ b/hw/xwayland/xwayland.c
@@ -816,16 +816,16 @@ xwl_window_post_damage(struct xwl_window *xwl_window)
xwl_window->frame_callback = wl_surface_frame(xwl_window->surface);
wl_callback_add_listener(xwl_window->frame_callback, &frame_listener, xwl_window);
- wl_surface_commit(xwl_window->surface);
DamageEmpty(window_get_damage(xwl_window->window));
-
- xorg_list_del(&xwl_window->link_damage);
}
static void
xwl_screen_post_damage(struct xwl_screen *xwl_screen)
{
struct xwl_window *xwl_window, *next_xwl_window;
+ struct xorg_list commit_window_list;
+
+ xorg_list_init(&commit_window_list);
xorg_list_for_each_entry_safe(xwl_window, next_xwl_window,
&xwl_screen->damage_window_list, link_damage) {
@@ -843,6 +843,17 @@ xwl_screen_post_damage(struct xwl_screen *xwl_screen)
#endif
xwl_window_post_damage(xwl_window);
+ xorg_list_del(&xwl_window->link_damage);
+ xorg_list_append(&xwl_window->link_damage, &commit_window_list);
+ }
+
+ if (xorg_list_is_empty(&commit_window_list))
+ return;
+
+ xorg_list_for_each_entry_safe(xwl_window, next_xwl_window,
+ &commit_window_list, link_damage) {
+ wl_surface_commit(xwl_window->surface);
+ xorg_list_del(&xwl_window->link_damage);
}
}
--
2.24.1

View File

@ -0,0 +1,46 @@
From 0238359bced17f9db0e266111897d154ab117d68 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michel=20D=C3=A4nzer?= <mdaenzer@redhat.com>
Date: Fri, 7 Feb 2020 12:15:07 +0100
Subject: [PATCH xserver 15/22] xwayland: Call glamor_block_handler from
xwl_screen_post_damage
In between the two phases introduced by the previous change. This makes
sure all pending drawing to the new buffers is flushed before they're
committed to the Wayland server.
(cherry picked from commit a542224ea28e2e8ccaf5e0df85bf6c603e97599a)
---
hw/xwayland/xwayland.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c
index de35a5af0..d3a4684d2 100644
--- a/hw/xwayland/xwayland.c
+++ b/hw/xwayland/xwayland.c
@@ -43,6 +43,10 @@
_X_EXPORT Bool noXFree86VidModeExtension;
#endif
+#ifdef XWL_HAS_GLAMOR
+#include <glamor.h>
+#endif
+
void
ddxGiveUp(enum ExitCode error)
{
@@ -850,6 +854,13 @@ xwl_screen_post_damage(struct xwl_screen *xwl_screen)
if (xorg_list_is_empty(&commit_window_list))
return;
+#ifdef XWL_HAS_GLAMOR
+ if (xwl_screen->glamor &&
+ xwl_screen->egl_backend == &xwl_screen->gbm_backend) {
+ glamor_block_handler(xwl_screen->screen);
+ }
+#endif
+
xorg_list_for_each_entry_safe(xwl_window, next_xwl_window,
&commit_window_list, link_damage) {
wl_surface_commit(xwl_window->surface);
--
2.24.1

View File

@ -1,4 +1,4 @@
From 01629caef21b77cfabc052408eb04699e4fa5143 Mon Sep 17 00:00:00 2001
From c0bae670131d7eef3d0a4d015a14899cbd4c9b2d Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Mon, 4 Nov 2019 11:46:49 +0100
Subject: [PATCH xserver 15/17] xwayland: Call
@ -26,10 +26,10 @@ Signed-off-by: Hans de Goede <hdegoede@redhat.com>
1 file changed, 5 insertions(+)
diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c
index 75ff9f011..ed1d671ff 100644
index 1840ccbfb..181977033 100644
--- a/hw/xwayland/xwayland.c
+++ b/hw/xwayland/xwayland.c
@@ -815,6 +815,11 @@ ensure_surface_for_window(WindowPtr window)
@@ -832,6 +832,11 @@ ensure_surface_for_window(WindowPtr window)
xwl_window_init_allow_commits(xwl_window);
@ -42,5 +42,5 @@ index 75ff9f011..ed1d671ff 100644
err_surf:
--
2.23.0
2.24.1

View File

@ -1,4 +1,4 @@
From 2db2fcb97bd148476817634486cb384a1f623fa9 Mon Sep 17 00:00:00 2001
From 8a34f7eb226be8d8ae0d9920657c17848372c92e Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Mon, 4 Nov 2019 14:32:29 +0100
Subject: [PATCH xserver 16/17] xwayland: Fix setting of
@ -33,10 +33,10 @@ Signed-off-by: Hans de Goede <hdegoede@redhat.com>
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c
index ed1d671ff..1ce29c51c 100644
index 181977033..d8e65d59f 100644
--- a/hw/xwayland/xwayland.c
+++ b/hw/xwayland/xwayland.c
@@ -815,7 +815,13 @@ ensure_surface_for_window(WindowPtr window)
@@ -832,7 +832,13 @@ ensure_surface_for_window(WindowPtr window)
xwl_window_init_allow_commits(xwl_window);
@ -51,7 +51,7 @@ index ed1d671ff..1ce29c51c 100644
/* CSD or O-R toplevel window, check viewport on creation */
xwl_window_check_resolution_change_emulation(xwl_window);
}
@@ -864,8 +870,6 @@ xwl_realize_window(WindowPtr window)
@@ -881,8 +887,6 @@ xwl_realize_window(WindowPtr window)
return FALSE;
}
@ -61,5 +61,5 @@ index ed1d671ff..1ce29c51c 100644
}
--
2.23.0
2.24.1

View File

@ -0,0 +1,137 @@
From 94dad4f05133171805ee94095bbcd20ece754eba Mon Sep 17 00:00:00 2001
From: Dor Askayo <dor.askayo@gmail.com>
Date: Wed, 19 Feb 2020 17:22:11 +0100
Subject: [PATCH xserver 16/22] xwayland: clear pixmaps after creation in
rootless mode
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
When a pixmap is created with a backing FBO, the FBO should be cleared
to avoid rendering uninitialized memory. This could happen when the
pixmap is rendered without being filled in its entirety.
One example is when a top-level window without a background is
resized. The pixmap would be reallocated to prepare for more pixels,
but uninitialized memory would be rendered in the resize offset until
the client sends a frame that fills these additional pixels.
Another example is when a new top-level window is created without a
background. Uninitialized memory would be rendered after the pixmap is
allocated and before the client sends its first frame.
This issue is only apparent in OpenGL implementations that don't zero
the VRAM of allocated buffers by default, such as RadeonSI.
Signed-off-by: Dor Askayo <dor.askayo@gmail.com>
Closes: https://gitlab.freedesktop.org/xorg/xserver/issues/636
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
(cherry picked from commit 0e9a0c203c2ae4eae12bdbb95428f398211c7bee)
[ Michel Dänzer:
* Squashed in commit ebf549db2d9341d99e0d0847b948dd798d98f7dc
* Dropped code related to glamor_format, which only exists on master ]
---
glamor/glamor.c | 15 +++++++++++++++
glamor/glamor.h | 3 +++
glamor/glamor_fbo.c | 12 ++++++++++++
glamor/glamor_priv.h | 1 +
hw/xwayland/xwayland-glamor-gbm.c | 6 +++++-
5 files changed, 36 insertions(+), 1 deletion(-)
diff --git a/glamor/glamor.c b/glamor/glamor.c
index a6cc798f8..abefef614 100644
--- a/glamor/glamor.c
+++ b/glamor/glamor.c
@@ -128,6 +128,21 @@ glamor_set_pixmap_texture(PixmapPtr pixmap, unsigned int tex)
glamor_pixmap_attach_fbo(pixmap, fbo);
}
+_X_EXPORT void
+glamor_clear_pixmap(PixmapPtr pixmap)
+{
+ ScreenPtr screen = pixmap->drawable.pScreen;
+ glamor_screen_private *glamor_priv;
+ glamor_pixmap_private *pixmap_priv;
+
+ glamor_priv = glamor_get_screen_private(screen);
+ pixmap_priv = glamor_get_pixmap_private(pixmap);
+
+ assert(pixmap_priv->fbo != NULL);
+
+ glamor_pixmap_clear_fbo(glamor_priv, pixmap_priv->fbo);
+}
+
uint32_t
glamor_get_pixmap_texture(PixmapPtr pixmap)
{
diff --git a/glamor/glamor.h b/glamor/glamor.h
index 3f9d265db..be04bf858 100644
--- a/glamor/glamor.h
+++ b/glamor/glamor.h
@@ -115,6 +115,9 @@ extern _X_EXPORT void glamor_set_pixmap_texture(PixmapPtr pixmap,
extern _X_EXPORT void glamor_set_pixmap_type(PixmapPtr pixmap,
glamor_pixmap_type_t type);
+
+extern _X_EXPORT void glamor_clear_pixmap(PixmapPtr pixmap);
+
extern _X_EXPORT void glamor_block_handler(ScreenPtr screen);
extern _X_EXPORT PixmapPtr glamor_create_pixmap(ScreenPtr screen, int w, int h,
diff --git a/glamor/glamor_fbo.c b/glamor/glamor_fbo.c
index e8c4330b3..f939a6c2f 100644
--- a/glamor/glamor_fbo.c
+++ b/glamor/glamor_fbo.c
@@ -239,6 +239,18 @@ glamor_create_fbo_array(glamor_screen_private *glamor_priv,
return NULL;
}
+void
+glamor_pixmap_clear_fbo(glamor_screen_private *glamor_priv, glamor_pixmap_fbo *fbo)
+{
+ glamor_make_current(glamor_priv);
+
+ assert(fbo->fb != 0 && fbo->tex != 0);
+
+ glamor_set_destination_pixmap_fbo(glamor_priv, fbo, 0, 0, fbo->width, fbo->height);
+ glClearColor(0.0, 0.0, 0.0, 0.0);
+ glClear(GL_COLOR_BUFFER_BIT);
+}
+
glamor_pixmap_fbo *
glamor_pixmap_detach_fbo(glamor_pixmap_private *pixmap_priv)
{
diff --git a/glamor/glamor_priv.h b/glamor/glamor_priv.h
index 1686ef5a4..4353a99f1 100644
--- a/glamor/glamor_priv.h
+++ b/glamor/glamor_priv.h
@@ -539,6 +539,7 @@ void glamor_destroy_fbo(glamor_screen_private *glamor_priv,
glamor_pixmap_fbo *fbo);
void glamor_pixmap_destroy_fbo(PixmapPtr pixmap);
Bool glamor_pixmap_fbo_fixup(ScreenPtr screen, PixmapPtr pixmap);
+void glamor_pixmap_clear_fbo(glamor_screen_private *glamor_priv, glamor_pixmap_fbo *fbo);
/* Return whether 'picture' is alpha-only */
static inline Bool glamor_picture_is_alpha(PicturePtr picture)
diff --git a/hw/xwayland/xwayland-glamor-gbm.c b/hw/xwayland/xwayland-glamor-gbm.c
index febc0b910..c02ba7363 100644
--- a/hw/xwayland/xwayland-glamor-gbm.c
+++ b/hw/xwayland/xwayland-glamor-gbm.c
@@ -242,8 +242,12 @@ xwl_glamor_gbm_create_pixmap(ScreenPtr screen,
if (bo) {
pixmap = xwl_glamor_gbm_create_pixmap_for_bo(screen, bo, depth);
- if (!pixmap)
+ if (!pixmap) {
gbm_bo_destroy(bo);
+ }
+ else if (xwl_screen->rootless && hint == CREATE_PIXMAP_USAGE_BACKING_PIXMAP) {
+ glamor_clear_pixmap(pixmap);
+ }
}
}
--
2.24.1

View File

@ -0,0 +1,62 @@
From 915cc107767624bd7914c962347bab9c2e21cdff Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michel=20D=C3=A4nzer?= <mdaenzer@redhat.com>
Date: Fri, 13 Dec 2019 18:26:35 +0100
Subject: [PATCH xserver 17/22] xwayland: Add xwl_window_create_frame_callback
helper
This will be used by the following changes. No functional change
intended.
Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
(cherry picked from commit f80eea0529b2cfb805a9c7d4994a4235451131e3)
---
hw/xwayland/xwayland.c | 12 +++++++++---
hw/xwayland/xwayland.h | 2 ++
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c
index d3a4684d2..ef01842f0 100644
--- a/hw/xwayland/xwayland.c
+++ b/hw/xwayland/xwayland.c
@@ -747,6 +747,14 @@ static const struct wl_callback_listener frame_listener = {
frame_callback
};
+void
+xwl_window_create_frame_callback(struct xwl_window *xwl_window)
+{
+ xwl_window->frame_callback = wl_surface_frame(xwl_window->surface);
+ wl_callback_add_listener(xwl_window->frame_callback, &frame_listener,
+ xwl_window);
+}
+
static Bool
xwl_destroy_window(WindowPtr window)
{
@@ -817,9 +825,7 @@ xwl_window_post_damage(struct xwl_window *xwl_window)
box->x2 - box->x1, box->y2 - box->y1);
}
- xwl_window->frame_callback = wl_surface_frame(xwl_window->surface);
- wl_callback_add_listener(xwl_window->frame_callback, &frame_listener, xwl_window);
-
+ xwl_window_create_frame_callback(xwl_window);
DamageEmpty(window_get_damage(xwl_window->window));
}
diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h
index 0854df456..d20016c5d 100644
--- a/hw/xwayland/xwayland.h
+++ b/hw/xwayland/xwayland.h
@@ -378,6 +378,8 @@ struct xwl_output {
Bool xdg_output_done;
};
+void xwl_window_create_frame_callback(struct xwl_window *xwl_window);
+
void xwl_sync_events (struct xwl_screen *xwl_screen);
Bool xwl_screen_init_cursor(struct xwl_screen *xwl_screen);
--
2.24.1

View File

@ -1,4 +1,4 @@
From f73305cc415d2fd464aae4b0dc72558fd1b6bd81 Mon Sep 17 00:00:00 2001
From 28610d4f35d8bc30f30f33656777649ea355f3c2 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Mon, 4 Nov 2019 15:01:18 +0100
Subject: [PATCH xserver 17/17] xwayland: Remove unnecessary
@ -43,5 +43,5 @@ index 7d705d919..084b669e4 100644
static void
--
2.23.0
2.24.1

View File

@ -0,0 +1,212 @@
From 99a6d6b15e0757a4652a569a1b2070c76a00b567 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michel=20D=C3=A4nzer?= <mdaenzer@redhat.com>
Date: Wed, 27 Nov 2019 18:04:06 +0100
Subject: [PATCH xserver 18/22] xwayland: Use single frame callback for Present
flips and normal updates
Using a list of Present windows that need to be called back.
This prepares for the following change, there should be no change in
observed behaviour.
v2:
* Use xwl_window_create_frame_callback instead of making the
frame_listener struct non-static (Olivier Fourdan)
Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
(cherry picked from commit c5067feaeea115761f0a72f37407c6e5e943d1a1)
---
hw/xwayland/xwayland-present.c | 40 +++++++++++++---------------------
hw/xwayland/xwayland.c | 26 +++++++++++++++++-----
hw/xwayland/xwayland.h | 4 +++-
3 files changed, 39 insertions(+), 31 deletions(-)
diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c
index 31c276623..baa97d6f3 100644
--- a/hw/xwayland/xwayland-present.c
+++ b/hw/xwayland/xwayland-present.c
@@ -60,6 +60,7 @@ xwl_present_window_get_priv(WindowPtr window)
xwl_present_window->msc = 1;
xwl_present_window->ust = GetTimeInMicros();
+ xorg_list_init(&xwl_present_window->frame_callback_list);
xorg_list_init(&xwl_present_window->event_list);
xorg_list_init(&xwl_present_window->release_queue);
@@ -96,7 +97,7 @@ xwl_present_reset_timer(struct xwl_present_window *xwl_present_window)
if (xwl_present_has_events(xwl_present_window)) {
CARD32 timeout;
- if (xwl_present_window->frame_callback)
+ if (!xorg_list_is_empty(&xwl_present_window->frame_callback_list))
timeout = TIMER_LEN_FLIP;
else
timeout = TIMER_LEN_COPY;
@@ -119,10 +120,7 @@ xwl_present_cleanup(WindowPtr window)
if (!xwl_present_window)
return;
- if (xwl_present_window->frame_callback) {
- wl_callback_destroy(xwl_present_window->frame_callback);
- xwl_present_window->frame_callback = NULL;
- }
+ xorg_list_del(&xwl_present_window->frame_callback_list);
if (xwl_present_window->sync_callback) {
wl_callback_destroy(xwl_present_window->sync_callback);
@@ -252,15 +250,10 @@ xwl_present_timer_callback(OsTimerPtr timer,
return 0;
}
-static void
-xwl_present_frame_callback(void *data,
- struct wl_callback *callback,
- uint32_t time)
+void
+xwl_present_frame_callback(struct xwl_present_window *xwl_present_window)
{
- struct xwl_present_window *xwl_present_window = data;
-
- wl_callback_destroy(xwl_present_window->frame_callback);
- xwl_present_window->frame_callback = NULL;
+ xorg_list_del(&xwl_present_window->frame_callback_list);
if (xwl_present_window->frame_timer_firing) {
/* If the timer is firing, this frame callback is too late */
@@ -275,10 +268,6 @@ xwl_present_frame_callback(void *data,
xwl_present_reset_timer(xwl_present_window);
}
-static const struct wl_callback_listener xwl_present_frame_listener = {
- xwl_present_frame_callback
-};
-
static void
xwl_present_sync_callback(void *data,
struct wl_callback *callback,
@@ -488,11 +477,12 @@ xwl_present_flip(WindowPtr present_window,
/* We can flip directly to the main surface (full screen window without clips) */
wl_surface_attach(xwl_window->surface, buffer, 0, 0);
- if (!xwl_present_window->frame_callback) {
- xwl_present_window->frame_callback = wl_surface_frame(xwl_window->surface);
- wl_callback_add_listener(xwl_present_window->frame_callback,
- &xwl_present_frame_listener,
- xwl_present_window);
+ if (!xwl_window->frame_callback)
+ xwl_window_create_frame_callback(xwl_window);
+
+ if (xorg_list_is_empty(&xwl_present_window->frame_callback_list)) {
+ xorg_list_add(&xwl_present_window->frame_callback_list,
+ &xwl_window->frame_callback_list);
}
/* Realign timer */
@@ -532,14 +522,14 @@ xwl_present_unrealize_window(WindowPtr window)
{
struct xwl_present_window *xwl_present_window = xwl_present_window_priv(window);
- if (!xwl_present_window || !xwl_present_window->frame_callback)
+ if (!xwl_present_window ||
+ xorg_list_is_empty(&xwl_present_window->frame_callback_list))
return;
/* The pending frame callback may never be called, so drop it and shorten
* the frame timer interval.
*/
- wl_callback_destroy(xwl_present_window->frame_callback);
- xwl_present_window->frame_callback = NULL;
+ xorg_list_del(&xwl_present_window->frame_callback_list);
xwl_present_reset_timer(xwl_present_window);
}
diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c
index ef01842f0..feb1058b7 100644
--- a/hw/xwayland/xwayland.c
+++ b/hw/xwayland/xwayland.c
@@ -600,6 +600,10 @@ ensure_surface_for_window(WindowPtr window)
dixSetPrivate(&window->devPrivates, &xwl_window_private_key, xwl_window);
xorg_list_init(&xwl_window->link_damage);
+#ifdef GLAMOR_HAS_GBM
+ xorg_list_init(&xwl_window->frame_callback_list);
+#endif
+
xwl_window_init_allow_commits(xwl_window);
return TRUE;
@@ -684,11 +688,6 @@ xwl_unrealize_window(WindowPtr window)
xwl_screen->UnrealizeWindow = screen->UnrealizeWindow;
screen->UnrealizeWindow = xwl_unrealize_window;
-#ifdef GLAMOR_HAS_GBM
- if (xwl_screen->present)
- xwl_present_unrealize_window(window);
-#endif
-
xwl_window = xwl_window_get(window);
if (!xwl_window)
return ret;
@@ -700,6 +699,11 @@ xwl_unrealize_window(WindowPtr window)
if (xwl_window->frame_callback)
wl_callback_destroy(xwl_window->frame_callback);
+#ifdef GLAMOR_HAS_GBM
+ if (xwl_screen->present)
+ xwl_present_unrealize_window(window);
+#endif
+
free(xwl_window);
dixSetPrivate(&window->devPrivates, &xwl_window_private_key, NULL);
@@ -741,6 +745,18 @@ frame_callback(void *data,
wl_callback_destroy (xwl_window->frame_callback);
xwl_window->frame_callback = NULL;
+
+#ifdef GLAMOR_HAS_GBM
+ if (xwl_window->xwl_screen->present) {
+ struct xwl_present_window *xwl_present_window, *tmp;
+
+ xorg_list_for_each_entry_safe(xwl_present_window, tmp,
+ &xwl_window->frame_callback_list,
+ frame_callback_list) {
+ xwl_present_frame_callback(xwl_present_window);
+ }
+ }
+#endif
}
static const struct wl_callback_listener frame_listener = {
diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h
index d20016c5d..d4eb6bf1a 100644
--- a/hw/xwayland/xwayland.h
+++ b/hw/xwayland/xwayland.h
@@ -183,6 +183,7 @@ struct xwl_window {
struct wl_callback *frame_callback;
Bool allow_commits;
#ifdef GLAMOR_HAS_GBM
+ struct xorg_list frame_callback_list;
Bool present_flipped;
#endif
};
@@ -192,7 +193,7 @@ struct xwl_present_window {
struct xwl_screen *xwl_screen;
struct xwl_present_event *sync_flip;
WindowPtr window;
- struct xorg_list link;
+ struct xorg_list frame_callback_list;
uint64_t msc;
uint64_t ust;
@@ -454,6 +455,7 @@ Bool xwl_glamor_allow_commits(struct xwl_window *xwl_window);
void xwl_glamor_egl_make_current(struct xwl_screen *xwl_screen);
#ifdef GLAMOR_HAS_GBM
+void xwl_present_frame_callback(struct xwl_present_window *xwl_present_window);
Bool xwl_present_init(ScreenPtr screen);
void xwl_present_cleanup(WindowPtr window);
void xwl_present_unrealize_window(WindowPtr window);
--
2.24.1

View File

@ -0,0 +1,99 @@
From 2a185dd22ddb5b0d7d2ef5948591028766bb9530 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michel=20D=C3=A4nzer?= <mdaenzer@redhat.com>
Date: Mon, 2 Mar 2020 18:09:31 +0100
Subject: [PATCH xserver 19/22] xwayland: Use frame callbacks for Present
vblank events
Instead of only the fallback timer.
Fixes https://gitlab.freedesktop.org/xorg/xserver/issues/854
v2:
* Drop unused frame_callback member of struct xwl_present_window
(Olivier Fourdan)
Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
(cherry picked from commit 9b31358c52e951883bf7c01c953a9da080542244)
---
hw/xwayland/xwayland-present.c | 22 ++++++++++++++--------
hw/xwayland/xwayland.h | 2 --
2 files changed, 14 insertions(+), 10 deletions(-)
diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c
index baa97d6f3..c7c077aaa 100644
--- a/hw/xwayland/xwayland-present.c
+++ b/hw/xwayland/xwayland-present.c
@@ -242,7 +242,10 @@ xwl_present_timer_callback(OsTimerPtr timer,
{
struct xwl_present_window *xwl_present_window = arg;
- xwl_present_window->frame_timer_firing = TRUE;
+ /* If we were expecting a frame callback for this window, it didn't arrive
+ * in a second. Stop listening to it to avoid double-bumping the MSC
+ */
+ xorg_list_del(&xwl_present_window->frame_callback_list);
xwl_present_msc_bump(xwl_present_window);
xwl_present_reset_timer(xwl_present_window);
@@ -255,11 +258,6 @@ xwl_present_frame_callback(struct xwl_present_window *xwl_present_window)
{
xorg_list_del(&xwl_present_window->frame_callback_list);
- if (xwl_present_window->frame_timer_firing) {
- /* If the timer is firing, this frame callback is too late */
- return;
- }
-
xwl_present_msc_bump(xwl_present_window);
/* we do not need the timer anymore for this frame,
@@ -349,6 +347,7 @@ xwl_present_queue_vblank(WindowPtr present_window,
uint64_t msc)
{
struct xwl_present_window *xwl_present_window = xwl_present_window_get_priv(present_window);
+ struct xwl_window *xwl_window = xwl_window_from_window(present_window);
struct xwl_present_event *event;
event = malloc(sizeof *event);
@@ -361,7 +360,15 @@ xwl_present_queue_vblank(WindowPtr present_window,
xorg_list_append(&event->list, &xwl_present_window->event_list);
- if (!xwl_present_window->frame_timer)
+ /* If there's a pending frame callback, use that */
+ if (xwl_window && xwl_window->frame_callback &&
+ xorg_list_is_empty(&xwl_present_window->frame_callback_list)) {
+ xorg_list_add(&xwl_present_window->frame_callback_list,
+ &xwl_window->frame_callback_list);
+ }
+
+ if ((xwl_window && xwl_window->frame_callback) ||
+ !xwl_present_window->frame_timer)
xwl_present_reset_timer(xwl_present_window);
return Success;
@@ -486,7 +493,6 @@ xwl_present_flip(WindowPtr present_window,
}
/* Realign timer */
- xwl_present_window->frame_timer_firing = FALSE;
xwl_present_reset_timer(xwl_present_window);
wl_surface_damage(xwl_window->surface, 0, 0,
diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h
index d4eb6bf1a..a12ec257b 100644
--- a/hw/xwayland/xwayland.h
+++ b/hw/xwayland/xwayland.h
@@ -199,9 +199,7 @@ struct xwl_present_window {
uint64_t ust;
OsTimerPtr frame_timer;
- Bool frame_timer_firing;
- struct wl_callback *frame_callback;
struct wl_callback *sync_callback;
struct xorg_list event_list;
--
2.24.1

View File

@ -0,0 +1,254 @@
From 1610ef1d6b5ba99da9d1a639f3b65b2e61514a7d Mon Sep 17 00:00:00 2001
From: David Seifert <soap@gentoo.org>
Date: Fri, 24 Jan 2020 12:49:44 +0100
Subject: [PATCH xserver 20/22] Fix building with `-fno-common`
* GCC 10 will switch the default to `-fno-common`.
https://gcc.gnu.org/PR85678
Bug: https://bugs.gentoo.org/705880
Signed-off-by: Matt Turner <mattst88@gmail.com>
---
hw/dmx/config/dmxconfig.c | 2 +-
hw/dmx/config/xdmxconfig.c | 2 +-
hw/dmx/glxProxy/glxext.c | 2 --
hw/xwayland/xwayland.c | 2 +-
test/misc.c | 2 +-
test/xi1/protocol-xchangedevicecontrol.c | 2 +-
test/xi2/protocol-common.c | 2 ++
test/xi2/protocol-common.h | 2 +-
test/xi2/protocol-xigetclientpointer.c | 2 +-
test/xi2/protocol-xigetselectedevents.c | 2 +-
test/xi2/protocol-xipassivegrabdevice.c | 2 +-
test/xi2/protocol-xiquerydevice.c | 2 +-
test/xi2/protocol-xiquerypointer.c | 2 +-
test/xi2/protocol-xiqueryversion.c | 2 +-
test/xi2/protocol-xiselectevents.c | 2 +-
test/xi2/protocol-xisetclientpointer.c | 2 +-
test/xi2/protocol-xiwarppointer.c | 2 +-
17 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/hw/dmx/config/dmxconfig.c b/hw/dmx/config/dmxconfig.c
index c1a9e1cf3..85bc0dbe4 100644
--- a/hw/dmx/config/dmxconfig.c
+++ b/hw/dmx/config/dmxconfig.c
@@ -72,7 +72,7 @@ typedef struct DMXConfigCmdStruct {
DMXConfigList *xinputs;
} DMXConfigCmd, *DMXConfigCmdPtr;
-DMXConfigEntryPtr dmxConfigEntry;
+extern DMXConfigEntryPtr dmxConfigEntry;
static DMXConfigCmd dmxConfigCmd;
static int dmxDisplaysFromCommandLine;
diff --git a/hw/dmx/config/xdmxconfig.c b/hw/dmx/config/xdmxconfig.c
index 49e4b5459..05d839688 100644
--- a/hw/dmx/config/xdmxconfig.c
+++ b/hw/dmx/config/xdmxconfig.c
@@ -65,7 +65,7 @@ extern FILE *yyin;
#define DMX_CANVAS_WIDTH 400
#define DMX_CANVAS_HEIGHT 500
-DMXConfigEntryPtr dmxConfigEntry;
+extern DMXConfigEntryPtr dmxConfigEntry;
static DMXConfigVirtualPtr dmxConfigCurrent, dmxConfigNewVirtual;
static DMXConfigDisplayPtr dmxConfigCurrentDisplay, dmxConfigNewDisplay;
static int dmxConfigGrabbed, dmxConfigGrabbedFine;
diff --git a/hw/dmx/glxProxy/glxext.c b/hw/dmx/glxProxy/glxext.c
index 49848bbff..ca9780f99 100644
--- a/hw/dmx/glxProxy/glxext.c
+++ b/hw/dmx/glxProxy/glxext.c
@@ -47,8 +47,6 @@
#include "extinit.h"
#include "glx_extinit.h"
-int noGlxExtension;
-
/*
** Forward declarations.
*/
diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c
index feb1058b7..5fefa5923 100644
--- a/hw/xwayland/xwayland.c
+++ b/hw/xwayland/xwayland.c
@@ -40,7 +40,7 @@
#ifdef XF86VIDMODE
#include <X11/extensions/xf86vmproto.h>
-_X_EXPORT Bool noXFree86VidModeExtension;
+extern _X_EXPORT Bool noXFree86VidModeExtension;
#endif
#ifdef XWL_HAS_GLAMOR
diff --git a/test/misc.c b/test/misc.c
index 3c669b677..f1f76cccd 100644
--- a/test/misc.c
+++ b/test/misc.c
@@ -33,7 +33,7 @@
#include "tests-common.h"
-ScreenInfo screenInfo;
+extern ScreenInfo screenInfo;
static void
dix_version_compare(void)
diff --git a/test/xi1/protocol-xchangedevicecontrol.c b/test/xi1/protocol-xchangedevicecontrol.c
index 57a15c407..54f1f67cb 100644
--- a/test/xi1/protocol-xchangedevicecontrol.c
+++ b/test/xi1/protocol-xchangedevicecontrol.c
@@ -37,7 +37,7 @@
#include "protocol-common.h"
-ClientRec client_window;
+extern ClientRec client_window;
static ClientRec client_request;
static void
diff --git a/test/xi2/protocol-common.c b/test/xi2/protocol-common.c
index 8cd85dd05..05dd3c4e7 100644
--- a/test/xi2/protocol-common.c
+++ b/test/xi2/protocol-common.c
@@ -45,6 +45,8 @@ static ClientRec server_client;
void *global_userdata;
+void (*reply_handler) (ClientPtr client, int len, char *data, void *userdata);
+
int enable_GrabButton_wrap = 1;
int enable_XISetEventMask_wrap = 1;
diff --git a/test/xi2/protocol-common.h b/test/xi2/protocol-common.h
index 8490529ad..742ce348f 100644
--- a/test/xi2/protocol-common.h
+++ b/test/xi2/protocol-common.h
@@ -99,7 +99,7 @@ extern void *global_userdata;
* The reply handler called from WriteToClient. Set this handler if you need
* to check the reply values.
*/
-void (*reply_handler) (ClientPtr client, int len, char *data, void *userdata);
+extern void (*reply_handler) (ClientPtr client, int len, char *data, void *userdata);
/**
* The default screen used for the windows. Initialized by init_simple().
diff --git a/test/xi2/protocol-xigetclientpointer.c b/test/xi2/protocol-xigetclientpointer.c
index 9c38bd720..244e8438f 100644
--- a/test/xi2/protocol-xigetclientpointer.c
+++ b/test/xi2/protocol-xigetclientpointer.c
@@ -46,7 +46,7 @@ static struct {
int win;
} test_data;
-ClientRec client_window;
+extern ClientRec client_window;
static ClientRec client_request;
static void
diff --git a/test/xi2/protocol-xigetselectedevents.c b/test/xi2/protocol-xigetselectedevents.c
index 9a0fac5d4..b14100224 100644
--- a/test/xi2/protocol-xigetselectedevents.c
+++ b/test/xi2/protocol-xigetselectedevents.c
@@ -60,7 +60,7 @@ static struct {
int mask_len;
} test_data;
-ClientRec client_window;
+extern ClientRec client_window;
/* AddResource is called from XISetSEventMask, we don't need this */
Bool
diff --git a/test/xi2/protocol-xipassivegrabdevice.c b/test/xi2/protocol-xipassivegrabdevice.c
index c703a1ee8..142bcecb7 100644
--- a/test/xi2/protocol-xipassivegrabdevice.c
+++ b/test/xi2/protocol-xipassivegrabdevice.c
@@ -41,7 +41,7 @@
#include "protocol-common.h"
-ClientRec client_window;
+extern ClientRec client_window;
static ClientRec client_request;
#define N_MODS 7
diff --git a/test/xi2/protocol-xiquerydevice.c b/test/xi2/protocol-xiquerydevice.c
index a068038fd..6ee8a80fc 100644
--- a/test/xi2/protocol-xiquerydevice.c
+++ b/test/xi2/protocol-xiquerydevice.c
@@ -54,7 +54,7 @@ struct test_data {
int num_devices_in_reply;
};
-ClientRec client_window;
+extern ClientRec client_window;
static void reply_XIQueryDevice_data(ClientPtr client, int len, char *data,
void *closure);
diff --git a/test/xi2/protocol-xiquerypointer.c b/test/xi2/protocol-xiquerypointer.c
index ed75d7910..0f5a2b57a 100644
--- a/test/xi2/protocol-xiquerypointer.c
+++ b/test/xi2/protocol-xiquerypointer.c
@@ -41,7 +41,7 @@
#include "protocol-common.h"
-ClientRec client_window;
+extern ClientRec client_window;
static ClientRec client_request;
static void reply_XIQueryPointer_data(ClientPtr client, int len,
char *data, void *closure);
diff --git a/test/xi2/protocol-xiqueryversion.c b/test/xi2/protocol-xiqueryversion.c
index 3ce758faa..c7ddbfc10 100644
--- a/test/xi2/protocol-xiqueryversion.c
+++ b/test/xi2/protocol-xiqueryversion.c
@@ -58,7 +58,7 @@ struct test_data {
int minor_expected;
};
-ClientRec client_window;
+extern ClientRec client_window;
static void
reply_XIQueryVersion(ClientPtr client, int len, char *data, void *closure)
diff --git a/test/xi2/protocol-xiselectevents.c b/test/xi2/protocol-xiselectevents.c
index f136c23d0..06050ade7 100644
--- a/test/xi2/protocol-xiselectevents.c
+++ b/test/xi2/protocol-xiselectevents.c
@@ -62,7 +62,7 @@
static unsigned char *data[4096 * 20]; /* the request data buffer */
-ClientRec client_window;
+extern ClientRec client_window;
int
__real_XISetEventMask(DeviceIntPtr dev, WindowPtr win, ClientPtr client,
diff --git a/test/xi2/protocol-xisetclientpointer.c b/test/xi2/protocol-xisetclientpointer.c
index 6584bb9cc..ddc9f0000 100644
--- a/test/xi2/protocol-xisetclientpointer.c
+++ b/test/xi2/protocol-xisetclientpointer.c
@@ -48,7 +48,7 @@
#include "protocol-common.h"
-ClientRec client_window;
+extern ClientRec client_window;
static ClientRec client_request;
static void
diff --git a/test/xi2/protocol-xiwarppointer.c b/test/xi2/protocol-xiwarppointer.c
index 8484d54e5..e5c2f31ea 100644
--- a/test/xi2/protocol-xiwarppointer.c
+++ b/test/xi2/protocol-xiwarppointer.c
@@ -44,7 +44,7 @@
static int expected_x = SPRITE_X;
static int expected_y = SPRITE_Y;
-ClientRec client_window;
+extern ClientRec client_window;
/**
* This function overrides the one in the screen rec.
--
2.24.1

View File

@ -0,0 +1,35 @@
From 3c48bd50ad33f2a533ac76afa38d6e3906ebc28a Mon Sep 17 00:00:00 2001
From: Arthur Williams <taaparthur@gmail.com>
Date: Sun, 6 Oct 2019 18:55:35 +0000
Subject: [PATCH xserver 21/22] dix: Check for NULL spriteInfo in
GetPairedDevice
There is a race when reseting the XServer that causes spriteInfo to be
NULL in GetPairedDevice resulting a segfault and subsequent crash. The
problem was noticed when opening a connection, creating master devices,
destroying master devices and closing the connection during testing.
Signed-off-by: Arthur Williams <taaparthur@gmail.com>
(cherry picked from commit e693c9657f98c334e9921ca2f8ebf710497c0c6a)
---
dix/devices.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dix/devices.c b/dix/devices.c
index 1b18b168e..00c453980 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -2656,7 +2656,7 @@ GetPairedDevice(DeviceIntPtr dev)
if (!IsMaster(dev) && !IsFloating(dev))
dev = GetMaster(dev, MASTER_ATTACHED);
- return dev->spriteInfo->paired;
+ return dev->spriteInfo? dev->spriteInfo->paired: NULL;
}
/**
--
2.24.1

View File

@ -0,0 +1,41 @@
From a033571644d277dc49a489f7ae32c4ad92856543 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jonas=20=C3=85dahl?= <jadahl@gmail.com>
Date: Fri, 13 Sep 2019 17:11:27 +0200
Subject: [PATCH xserver 22/22] xwayland/glamor-gbm: Handle
DRM_FORMAT_MOD_INVALID gracefully
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The compositor may send DRM_FORMAT_MOD_INVALID instead of a list of
modifiers for various reasons. Handle this gracefully by ignoring it.
Without this, if a compositor would send DRM_FORMAT_MOD_INVALID, it'd
result in empty windows provided by Xwayland.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
(cherry picked from commit edf964434eac10ffbe27cc883e3ab95505669aee)
---
hw/xwayland/xwayland-glamor-gbm.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/hw/xwayland/xwayland-glamor-gbm.c b/hw/xwayland/xwayland-glamor-gbm.c
index c02ba7363..dce782fc3 100644
--- a/hw/xwayland/xwayland-glamor-gbm.c
+++ b/hw/xwayland/xwayland-glamor-gbm.c
@@ -798,6 +798,10 @@ xwl_dmabuf_handle_modifier(void *data, struct zwp_linux_dmabuf_v1 *dmabuf,
struct xwl_format *xwl_format = NULL;
int i;
+ if (modifier_hi == (DRM_FORMAT_MOD_INVALID >> 32) &&
+ modifier_lo == (DRM_FORMAT_MOD_INVALID & 0xffffffff))
+ return;
+
for (i = 0; i < xwl_screen->num_formats; i++) {
if (xwl_screen->formats[i].format == format) {
xwl_format = &xwl_screen->formats[i];
--
2.24.1

View File

@ -1 +1 @@
SHA512 (xorg-server-1.20.6.tar.bz2) = 9aa0ba4aee92fe628f2b8c41e4fe0134dc86154bb8787f907884ef2fd970e18e68e72ea8a1beb706d11ecf155b2abc9731f1abadff251ed592f8cca3b1240dd6
SHA512 (xorg-server-1.20.7.tar.bz2) = c67612e379111c28c68941c0a660abf72be7669591b41ccaa3b3474c4540a03822a28d892831b12ce08bac6e5e7e33504c2d19ef2a0c2298f83bd083459f96f5

View File

@ -21,7 +21,7 @@
%global ansic_major 0
%global ansic_minor 4
%global videodrv_major 24
%global videodrv_minor 0
%global videodrv_minor 1
%global xinput_major 24
%global xinput_minor 1
%global extension_major 10
@ -45,8 +45,8 @@
Summary: X.Org X11 X server
Name: xorg-x11-server
Version: 1.20.6
Release: 2%{?gitdate:.%{gitdate}}%{?dist}
Version: 1.20.7
Release: 1%{?gitdate:.%{gitdate}}%{?dist}
URL: http://www.x.org
License: MIT
@ -101,13 +101,32 @@ Patch6: 0001-Fedora-hack-Make-the-suid-root-wrapper-always-start-.patch
#Patch24: 0004-modesetting-Use-atomic-instead-of-per-crtc-walks-whe.patch
# Backports from current stable "server-1.20-branch":
# ...
Patch100: 0001-configure-Define-GLAMOR_HAS_EGL_QUERY_DRIVER-when-av.patch
Patch101: 0002-modesetting-Explicitly-include-mi.h.patch
Patch102: 0003-Restrict-1x1-pixmap-filling-optimization-to-GXcopy.patch
Patch103: 0004-Revert-dri2-Don-t-make-reference-to-noClientExceptio.patch
Patch104: 0005-os-Ignore-dying-client-in-ResetCurrentRequest.patch
Patch105: 0006-xfree86-modes-Bail-from-xf86RotateRedisplay-if-pScre.patch
Patch106: 0007-modesetting-remove-unnecessary-error-message-fix-zap.patch
Patch107: 0008-glamor-Propagate-FBO-allocation-failure-for-picture-.patch
Patch108: 0009-glamor-Error-out-on-out-of-memory-when-allocating-PB.patch
Patch109: 0010-glamor-Propagate-glamor_prepare_access-failures-in-c.patch
Patch110: 0011-glamor-Fallback-to-system-memory-for-RW-PBO-buffer-a.patch
Patch111: 0012-glamor-Fix-a-compiler-warning-since-the-recent-OOM-f.patch
Patch112: 0013-modesetting-Disable-atomic-support-by-default.patch
Patch113: 0014-xwayland-Split-up-xwl_screen_post_damage-into-two-ph.patch
Patch114: 0015-xwayland-Call-glamor_block_handler-from-xwl_screen_p.patch
Patch115: 0016-xwayland-clear-pixmaps-after-creation-in-rootless-mo.patch
Patch116: 0017-xwayland-Add-xwl_window_create_frame_callback-helper.patch
Patch117: 0018-xwayland-Use-single-frame-callback-for-Present-flips.patch
Patch118: 0019-xwayland-Use-frame-callbacks-for-Present-vblank-even.patch
Patch119: 0020-Fix-building-with-fno-common.patch
Patch120: 0021-dix-Check-for-NULL-spriteInfo-in-GetPairedDevice.patch
Patch121: 0022-xwayland-glamor-gbm-Handle-DRM_FORMAT_MOD_INVALID-gr.patch
# Backports from "master" upstream:
# https://bugzilla.redhat.com/show_bug.cgi?id=1697804
Patch500: 0001-Xi-return-AlreadyGrabbed-for-key-grabs-255.patch
# Backported Xwayland randr resolution change emulation support
Patch501: 0001-dix-Add-GetCurrentClient-helper.patch
Patch502: 0002-xwayland-Add-wp_viewport-wayland-extension-support.patch
@ -551,6 +570,14 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete
%changelog
* Fri Mar 13 2020 Olivier Fourdan <ofourdan@redhat.com> - 1.20.7-1
- xserver 1.20.7
- backport from stable "xserver-1.20-branch" up to commit ad7364d8d
(for mutter fullscreen unredirect on Wayland)
- Update videodrv minor ABI as 1.20.7 changed the minor ABI version
(backward compatible, API addition in glamor)
- Rebase Xwayland randr resolution change emulation support patches
* Fri Jan 31 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.20.6-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild