xserver 1.20.8

- Update to xserver 1.20.8
 - Backport latest Xwayland randr resolution change emulation support
   patches.
This commit is contained in:
Olivier Fourdan 2020-03-30 09:42:38 +02:00
parent 97b803e415
commit efa2d863b7
57 changed files with 745 additions and 2417 deletions

View File

@ -1,57 +0,0 @@
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 23d54f7049c83fd5baf9e008c159c8ffbec3649c Mon Sep 17 00:00:00 2001
From e78e96157efb523272404a85a9433c7b9803c1db 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/17] dix: Add GetCurrentClient helper
Subject: [PATCH xserver 01/24] dix: Add GetCurrentClient helper
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@ -43,6 +43,7 @@ to RRSetCrtc).
Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
(cherry picked from commit 834a467af978ac7a24ed17b8c8e58b6cddb4faf9)
---
dix/dispatch.c | 23 ++++++++++++++++++++++-
include/dix.h | 1 +
@ -111,5 +112,5 @@ index b6e2bcfde..d65060cb6 100644
extern _X_EXPORT void SetInputCheck(HWEventQueuePtr /*c0 */ ,
HWEventQueuePtr /*c1 */ );
--
2.24.1
2.25.2

View File

@ -1,89 +0,0 @@
From 13f9b07039484927532d913dbccc664679235bf6 Mon Sep 17 00:00:00 2001
From: Peter Hutterer <peter.hutterer@who-t.net>
Date: Mon, 25 Mar 2019 13:19:41 +1000
Subject: [PATCH xserver] dix: leave last.valuators alone on slave switch
Terms:
dev->last.valuator[] is the last value given to us by the driver
dev->valuator.axisVal[] is the last value sent to the client
dev->last.scroll[] is the abs value of the scroll axis as given by the driver,
used for button emulation calculation (and the remainder)
This function updates the device's last.valuator state based on the current
master axis state. This way, relative motion continues fluidly when switching
between devices. Before mouse 2 comes into effect, it's valuator state is
updated to wherever the pointer currently is so the relative event applies on
top of that.
This can only work for x/y axes, all other axes aren't guaranteed to have the
same meaning and/or may not be present:
- xtest device: no valuator 2
- mouse: valuator 2 is horizontal scroll axis
- tablet: valuator 2 is pressure
Scaling the current value from the pressure range into the range for
horizontal scrolling makes no sense. And it causes scroll jumps:
- scroll down, last.valuator == axisVal == 20
- xdotool click 1, the XTest device doesn't have that valuator
- scroll up
- updateSlaveDeviceCoords reset last.valuator to 0 (axisVal == 20)
- DeviceClassesChangedEvent includes value 20 for the axis
- event is processed, last.value changes from 0 to -1
- axisVal is updated to -1, causing a jump of -21
The same applies when we switch from tablet to mouse wheel if the pressure
value is 0 on proximity out (basically guaranteed). So let's drop this code
altogether and only leave the scaling for the relative x/y motion.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
---
dix/getevents.c | 25 +------------------------
1 file changed, 1 insertion(+), 24 deletions(-)
diff --git a/dix/getevents.c b/dix/getevents.c
index d8955969a..f83dac709 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -331,9 +331,6 @@ rescaleValuatorAxis(double coord, AxisInfoPtr from, AxisInfoPtr to,
static void
updateSlaveDeviceCoords(DeviceIntPtr master, DeviceIntPtr pDev)
{
- int i;
- DeviceIntPtr lastSlave;
-
/* master->last.valuators[0]/[1] is in desktop-wide coords and the actual
* position of the pointer */
pDev->last.valuators[0] = master->last.valuators[0];
@@ -358,27 +355,7 @@ updateSlaveDeviceCoords(DeviceIntPtr master, DeviceIntPtr pDev)
screenInfo.height);
}
- /* calculate the other axis as well based on info from the old
- * slave-device. If the old slave had less axes than this one,
- * last.valuators is reset to 0.
- */
- if ((lastSlave = master->last.slave) && lastSlave->valuator) {
- for (i = 2; i < pDev->valuator->numAxes; i++) {
- if (i >= lastSlave->valuator->numAxes) {
- pDev->last.valuators[i] = 0;
- valuator_mask_set_double(pDev->last.scroll, i, 0);
- }
- else {
- double val = pDev->last.valuators[i];
-
- val = rescaleValuatorAxis(val, lastSlave->valuator->axes + i,
- pDev->valuator->axes + i, 0, 0);
- pDev->last.valuators[i] = val;
- valuator_mask_set_double(pDev->last.scroll, i, val);
- }
- }
- }
-
+ /* other axes are left as-is */
}
/**
--
2.20.1

View File

@ -1,64 +0,0 @@
From 6915752b2da77c29bf8c861a6d4f2383e667323b Mon Sep 17 00:00:00 2001
From: Adam Jackson <ajax@redhat.com>
Date: Fri, 5 Oct 2018 14:07:46 -0400
Subject: [PATCH xserver 1/4] modesetting: Weaksauce atomic property debugging
This would be a good idea to have around for troubleshooting purposes,
but this particular patch is Not Good.
Signed-off-by: Adam Jackson <ajax@redhat.com>
---
hw/xfree86/drivers/modesetting/drmmode_display.c | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c
index cb48aa46b..a8d989a24 100644
--- a/hw/xfree86/drivers/modesetting/drmmode_display.c
+++ b/hw/xfree86/drivers/modesetting/drmmode_display.c
@@ -415,6 +415,13 @@ drmmode_ConvertToKMode(ScrnInfoPtr scrn,
drmModeModeInfo * kmode, DisplayModePtr mode);
+static int
+drmmodeatomicaddproperty(drmModeAtomicReqPtr req, uint32_t obj, uint32_t prop, uint64_t value)
+{
+ ErrorF("Adding to %p: %x %x %lx\n", req, obj, prop, value);
+ return drmModeAtomicAddProperty(req, obj, prop, value);
+}
+
static int
plane_add_prop(drmModeAtomicReq *req, drmmode_crtc_private_ptr drmmode_crtc,
enum drmmode_plane_property prop, uint64_t val)
@@ -425,7 +432,8 @@ plane_add_prop(drmModeAtomicReq *req, drmmode_crtc_private_ptr drmmode_crtc,
if (!info)
return -1;
- ret = drmModeAtomicAddProperty(req, drmmode_crtc->plane_id,
+ ErrorF("Setting %s\n", info->name);
+ ret = drmmodeatomicaddproperty(req, drmmode_crtc->plane_id,
info->prop_id, val);
return (ret <= 0) ? -1 : 0;
}
@@ -467,7 +475,8 @@ crtc_add_prop(drmModeAtomicReq *req, drmmode_crtc_private_ptr drmmode_crtc,
if (!info)
return -1;
- ret = drmModeAtomicAddProperty(req, drmmode_crtc->mode_crtc->crtc_id,
+ ErrorF("Setting %s\n", info->name);
+ ret = drmmodeatomicaddproperty(req, drmmode_crtc->mode_crtc->crtc_id,
info->prop_id, val);
return (ret <= 0) ? -1 : 0;
}
@@ -482,7 +491,8 @@ connector_add_prop(drmModeAtomicReq *req, drmmode_output_private_ptr drmmode_out
if (!info)
return -1;
- ret = drmModeAtomicAddProperty(req, drmmode_output->output_id,
+ ErrorF("Setting %s\n", info->name);
+ ret = drmmodeatomicaddproperty(req, drmmode_output->output_id,
info->prop_id, val);
return (ret <= 0) ? -1 : 0;
}
--
2.20.1

View File

@ -1,80 +0,0 @@
From b259485975078087fe6bde2b9e1eccf4ae14120c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michel=20D=C3=A4nzer?= <mdaenzer@redhat.com>
Date: Tue, 17 Mar 2020 11:45:22 +0100
Subject: [PATCH xserver] xwayland: Delete all frame_callback_list nodes in
xwl_unrealize_window
We were only calling xwl_present_unrealize_window for the toplevel
window, but the list can contain entries from child windows as well,
in which case we were leaving dangling pointers to freed memory.
Closes: https://gitlab.freedesktop.org/xorg/xserver/issues/1000
Fixes: c5067feaeea1 "xwayland: Use single frame callback for Present
flips and normal updates"
Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
Tested-by: Olivier Fourdan <ofourdan@redhat.com>
(cherry picked from commit 5e91587302e85fd6f0e8d5ffbe30182e18c6913f)
---
hw/xwayland/xwayland-present.c | 8 +-------
hw/xwayland/xwayland.c | 11 +++++++++--
hw/xwayland/xwayland.h | 2 +-
3 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c
index c7c077aaa..5ba7dce08 100644
--- a/hw/xwayland/xwayland-present.c
+++ b/hw/xwayland/xwayland-present.c
@@ -524,14 +524,8 @@ xwl_present_flips_stop(WindowPtr window)
}
void
-xwl_present_unrealize_window(WindowPtr window)
+xwl_present_unrealize_window(struct xwl_present_window *xwl_present_window)
{
- struct xwl_present_window *xwl_present_window = xwl_present_window_priv(window);
-
- if (!xwl_present_window ||
- xorg_list_is_empty(&xwl_present_window->frame_callback_list))
- return;
-
/* The pending frame callback may never be called, so drop it and shorten
* the frame timer interval.
*/
diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c
index 5fefa5923..ed9f2e3c2 100644
--- a/hw/xwayland/xwayland.c
+++ b/hw/xwayland/xwayland.c
@@ -700,8 +700,15 @@ xwl_unrealize_window(WindowPtr window)
wl_callback_destroy(xwl_window->frame_callback);
#ifdef GLAMOR_HAS_GBM
- if (xwl_screen->present)
- xwl_present_unrealize_window(window);
+ if (xwl_screen->present) {
+ struct xwl_present_window *xwl_present_window, *tmp;
+
+ xorg_list_for_each_entry_safe(xwl_present_window, tmp,
+ &xwl_window->frame_callback_list,
+ frame_callback_list) {
+ xwl_present_unrealize_window(xwl_present_window);
+ }
+ }
#endif
free(xwl_window);
diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h
index a12ec257b..daa719209 100644
--- a/hw/xwayland/xwayland.h
+++ b/hw/xwayland/xwayland.h
@@ -456,7 +456,7 @@ void xwl_glamor_egl_make_current(struct xwl_screen *xwl_screen);
void xwl_present_frame_callback(struct xwl_present_window *xwl_present_window);
Bool xwl_present_init(ScreenPtr screen);
void xwl_present_cleanup(WindowPtr window);
-void xwl_present_unrealize_window(WindowPtr window);
+void xwl_present_unrealize_window(struct xwl_present_window *xwl_present_window);
#endif /* GLAMOR_HAS_GBM */
#ifdef XV
--
2.25.1

View File

@ -1,36 +0,0 @@
From 2e18eec6f03cc4d9d5bf62853c65d341b363f4b3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michel=20D=C3=A4nzer?= <michel.daenzer@amd.com>
Date: Fri, 8 Mar 2019 18:49:04 +0100
Subject: [PATCH xserver] xwayland/present: Destroy sync_callback in
xwl_present_cleanup
xwl_present_cleanup frees the struct xwl_present_window memory,
so if there's a pending callback, we have to destroy it to prevent
use-after-free in xwl_present_sync_callback.
Should fix issue #645.
Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
---
hw/xwayland/xwayland-present.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c
index 192f59a653..a1b3109cc2 100644
--- a/hw/xwayland/xwayland-present.c
+++ b/hw/xwayland/xwayland-present.c
@@ -123,6 +123,11 @@ xwl_present_cleanup(WindowPtr window)
xwl_present_window->frame_callback = NULL;
}
+ if (xwl_present_window->sync_callback) {
+ wl_callback_destroy(xwl_present_window->sync_callback);
+ xwl_present_window->sync_callback = NULL;
+ }
+
/* Clear remaining events */
xorg_list_for_each_entry_safe(event, tmp, &xwl_present_window->event_list, list) {
xorg_list_del(&event->list);
--
2.20.1

View File

@ -1,29 +0,0 @@
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,31 +0,0 @@
From e262c8ae0039710422c11ae254ddb4ae7e6fac02 Mon Sep 17 00:00:00 2001
From: Adam Jackson <ajax@redhat.com>
Date: Fri, 5 Oct 2018 14:03:54 -0400
Subject: [PATCH xserver 2/4] modesetting: Propagate more failure in
drmmode_set_mode_major
It's possible that actually setting the mode would fail even though the
check succeeded. We would throw away the error in this case, which would
probably make recovery a bit difficult.
Signed-off-by: Adam Jackson <ajax@redhat.com>
---
hw/xfree86/drivers/modesetting/drmmode_display.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c
index a8d989a24..33f6cea3b 100644
--- a/hw/xfree86/drivers/modesetting/drmmode_display.c
+++ b/hw/xfree86/drivers/modesetting/drmmode_display.c
@@ -1540,7 +1540,7 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
/* if we only tested the mode previously, really set it now */
if (can_test)
- drmmode_crtc_set_mode(crtc, FALSE);
+ ret = drmmode_crtc_set_mode(crtc, FALSE);
ms->pending_modeset = FALSE;
}
--
2.20.1

View File

@ -1,7 +1,7 @@
From 707554709a1f7c0f04ef55e72c4cc41ad8e904fd Mon Sep 17 00:00:00 2001
From c0981af6a683266e3f2adfdd7d6539104f502233 Mon Sep 17 00:00:00 2001
From: Robert Mader <robert.mader@posteo.de>
Date: Mon, 22 Jan 2018 22:02:32 +0100
Subject: [PATCH xserver 02/17] xwayland: Add wp_viewport wayland extension
Subject: [PATCH xserver 02/24] xwayland: Add wp_viewport wayland extension
support
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
@ -18,6 +18,7 @@ xrandr for apps which want to change the resolution when going fullscreen.
Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
Acked-by: Michel Dänzer <mdaenzer@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
(cherry picked from commit 47bba4625339592d08b375bcd8e51029c0000850)
---
hw/xwayland/Makefile.am | 9 ++++++++-
hw/xwayland/meson.build | 3 +++
@ -80,10 +81,10 @@ index 36bf2133a..4a8d171bb 100644
xwayland_glamor = []
eglstream_srcs = []
diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c
index 5fefa5923..13b298f7f 100644
index ed9f2e3c2..2084f2afb 100644
--- a/hw/xwayland/xwayland.c
+++ b/hw/xwayland/xwayland.c
@@ -916,6 +916,9 @@ registry_global(void *data, struct wl_registry *registry, uint32_t id,
@@ -923,6 +923,9 @@ registry_global(void *data, struct wl_registry *registry, uint32_t id,
wl_registry_bind(registry, id, &zxdg_output_manager_v1_interface, 1);
xwl_screen_init_xdg_output(xwl_screen);
}
@ -94,7 +95,7 @@ index 5fefa5923..13b298f7f 100644
else if (xwl_screen->glamor) {
xwl_glamor_init_wl_registry(xwl_screen, registry, id, interface,
diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h
index a12ec257b..042e107ce 100644
index daa719209..f949ea157 100644
--- a/hw/xwayland/xwayland.h
+++ b/hw/xwayland/xwayland.h
@@ -48,6 +48,7 @@
@ -114,5 +115,5 @@ index a12ec257b..042e107ce 100644
#define XWL_FORMAT_ARGB8888 (1 << 0)
--
2.24.1
2.25.2

View File

@ -1,38 +0,0 @@
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,64 +0,0 @@
From e7f0961638818df8ee91edfae0378a02f7177e9f Mon Sep 17 00:00:00 2001
From: Adam Jackson <ajax@redhat.com>
Date: Fri, 5 Oct 2018 14:00:33 -0400
Subject: [PATCH xserver 3/4] modesetting: Factor out drmmode_target_output
Signed-off-by: Adam Jackson <ajax@redhat.com>
---
.../drivers/modesetting/drmmode_display.c | 26 ++++++++++++-------
1 file changed, 16 insertions(+), 10 deletions(-)
diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c
index 33f6cea3b..7924aa396 100644
--- a/hw/xfree86/drivers/modesetting/drmmode_display.c
+++ b/hw/xfree86/drivers/modesetting/drmmode_display.c
@@ -757,6 +757,21 @@ drmmode_crtc_disable(xf86CrtcPtr crtc)
return ret;
}
+static xf86OutputPtr
+drmmode_target_output(ScrnInfoPtr scrn, xf86CrtcPtr crtc)
+{
+ xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
+ int o;
+
+ if (config->output[config->compat_output]->crtc == crtc)
+ return config->output[config->compat_output];
+
+ for (o = 0; o < config->num_output; o++)
+ if (config->output[o]->crtc == crtc)
+ return config->output[o];
+
+ return NULL;
+}
static int
drmmode_crtc_set_mode(xf86CrtcPtr crtc, Bool test_only)
{
@@ -3448,7 +3463,6 @@ drmmode_set_desired_modes(ScrnInfoPtr pScrn, drmmode_ptr drmmode, Bool set_hw)
xf86CrtcPtr crtc = config->crtc[c];
drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
xf86OutputPtr output = NULL;
- int o;
/* Skip disabled CRTCs */
if (!crtc->enabled) {
@@ -3459,15 +3473,7 @@ drmmode_set_desired_modes(ScrnInfoPtr pScrn, drmmode_ptr drmmode, Bool set_hw)
continue;
}
- if (config->output[config->compat_output]->crtc == crtc)
- output = config->output[config->compat_output];
- else {
- for (o = 0; o < config->num_output; o++)
- if (config->output[o]->crtc == crtc) {
- output = config->output[o];
- break;
- }
- }
+ output = drmmode_target_output(pScrn, crtc);
/* paranoia */
if (!output)
continue;
--
2.20.1

View File

@ -1,7 +1,7 @@
From 4f06238e319c604638693f5eb452211210b14abf Mon Sep 17 00:00:00 2001
From ce5eef7d33d7ba37cabee6b2bb020ed62abe6208 Mon Sep 17 00:00:00 2001
From: Robert Mader <robert.mader@posteo.de>
Date: Tue, 2 Jul 2019 12:03:12 +0200
Subject: [PATCH xserver 03/17] xwayland: Use buffer_damage instead of surface
Subject: [PATCH xserver 03/24] xwayland: Use buffer_damage instead of surface
damage if available
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
@ -25,6 +25,7 @@ Changes by Hans de Goede <hdegoede@redhat.com>:
Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
Acked-by: Michel Dänzer <mdaenzer@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
(cherry picked from commit 7c6f17790d3aedb164481264b0f05a8a14103731)
---
hw/xwayland/xwayland-cursor.c | 12 ++++++------
hw/xwayland/xwayland-present.c | 6 +++---
@ -63,7 +64,7 @@ index 66720bcc0..cbc715061 100644
xwl_cursor->frame_cb = wl_surface_frame(xwl_cursor->surface);
wl_callback_add_listener(xwl_cursor->frame_cb, &frame_listener, xwl_cursor);
diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c
index c7c077aaa..e583708cb 100644
index 5ba7dce08..58c32941d 100644
--- a/hw/xwayland/xwayland-present.c
+++ b/hw/xwayland/xwayland-present.c
@@ -495,9 +495,9 @@ xwl_present_flip(WindowPtr present_window,
@ -80,10 +81,10 @@ index c7c077aaa..e583708cb 100644
wl_surface_commit(xwl_window->surface);
diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c
index 13b298f7f..87185e6f3 100644
index 2084f2afb..942981834 100644
--- a/hw/xwayland/xwayland.c
+++ b/hw/xwayland/xwayland.c
@@ -796,6 +796,16 @@ xwl_destroy_window(WindowPtr window)
@@ -803,6 +803,16 @@ xwl_destroy_window(WindowPtr window)
return ret;
}
@ -100,7 +101,7 @@ index 13b298f7f..87185e6f3 100644
static void
xwl_window_post_damage(struct xwl_window *xwl_window)
{
@@ -832,13 +842,15 @@ xwl_window_post_damage(struct xwl_window *xwl_window)
@@ -839,13 +849,15 @@ xwl_window_post_damage(struct xwl_window *xwl_window)
*/
if (RegionNumRects(region) > 256) {
box = RegionExtents(region);
@ -121,7 +122,7 @@ index 13b298f7f..87185e6f3 100644
}
xwl_window_create_frame_callback(xwl_window);
@@ -897,8 +909,13 @@ registry_global(void *data, struct wl_registry *registry, uint32_t id,
@@ -904,8 +916,13 @@ registry_global(void *data, struct wl_registry *registry, uint32_t id,
struct xwl_screen *xwl_screen = data;
if (strcmp(interface, "wl_compositor") == 0) {
@ -137,7 +138,7 @@ index 13b298f7f..87185e6f3 100644
else if (strcmp(interface, "wl_shm") == 0) {
xwl_screen->shm = wl_registry_bind(registry, id, &wl_shm_interface, 1);
diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h
index 042e107ce..07baa09e2 100644
index f949ea157..fa78b5ab9 100644
--- a/hw/xwayland/xwayland.h
+++ b/hw/xwayland/xwayland.h
@@ -382,6 +382,9 @@ struct xwl_output {
@ -151,5 +152,5 @@ index 042e107ce..07baa09e2 100644
Bool xwl_screen_init_cursor(struct xwl_screen *xwl_screen);
--
2.24.1
2.25.2

View File

@ -1,34 +0,0 @@
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,245 +0,0 @@
From e4e389447c59c89d39a5a78a5f19cdfd22d7699c Mon Sep 17 00:00:00 2001
From: Adam Jackson <ajax@redhat.com>
Date: Fri, 5 Oct 2018 14:09:35 -0400
Subject: [PATCH xserver 4/4] modesetting: Use atomic instead of per-crtc walks
where we can
drmmode_set_desired_modes (reachable from CreateScreenResources,
EnterVT, etc.) currently works by doing ->set_mode_major on each CRTC.
This is silly, as atomic lets us configure every CRTC at once. It's also
fragile, because we're not trying very hard to ensure the intermediate
states are valid.
This patch introduces drmmode_set_mode_atomic, which blasts the entire
RANDR state into the kernel in an... atomic... fashion. We change
drmmode_set_desired_modes and drmmode_xf86crtc_resize to use this
instead of walking each CRTC. We also change drmmode_crtc_set_mode to
use this, so that client RANDR requests (operating CRTC-at-a-time, since
RANDR doesn't have atomic changes yet) use the same code paths.
Signed-off-by: Adam Jackson <ajax@redhat.com>
---
.../drivers/modesetting/drmmode_display.c | 179 +++++++++++-------
1 file changed, 109 insertions(+), 70 deletions(-)
diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c
index 7924aa396..020678155 100644
--- a/hw/xfree86/drivers/modesetting/drmmode_display.c
+++ b/hw/xfree86/drivers/modesetting/drmmode_display.c
@@ -772,6 +772,96 @@ drmmode_target_output(ScrnInfoPtr scrn, xf86CrtcPtr crtc)
return NULL;
}
+
+static int
+drmmode_set_mode_atomic(ScrnInfoPtr scrn, modesettingPtr ms, Bool test_only)
+{
+ xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
+ drmModeAtomicReq *req = drmModeAtomicAlloc();
+ uint32_t flags = DRM_MODE_ATOMIC_ALLOW_MODESET;
+ int i, j, ret = 0;
+
+ if (!req)
+ return 1;
+
+ for (i = 0; i < xf86_config->num_crtc; i++) {
+ xf86CrtcPtr crtc = xf86_config->crtc[i];
+ drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
+ Bool active = crtc->enabled;
+ uint32_t fb_id;
+ int x, y;
+ drmModeModeInfo kmode;
+
+ if (active) {
+ drmmode_ConvertToKMode(crtc->scrn, &kmode, &crtc->desiredMode);
+ ret |= drm_mode_ensure_blob(crtc, kmode);
+
+ /* XXX this probably doesn't belong here */
+ if (!crtc->mode.HDisplay && crtc->desiredMode.HDisplay)
+ memcpy(&crtc->mode, &crtc->desiredMode, sizeof(crtc->mode));
+ }
+
+ ret |= !drmmode_crtc_get_fb_id(crtc, &fb_id, &x, &y);
+ ret |= crtc_add_prop(req, drmmode_crtc,
+ DRMMODE_CRTC_ACTIVE, active);
+ ret |= crtc_add_prop(req, drmmode_crtc,
+ DRMMODE_CRTC_MODE_ID,
+ active ? drmmode_crtc->current_mode->blob_id : 0);
+ ret |= plane_add_props(req, crtc, active ? fb_id : 0, x, y);
+ }
+
+ for (i = 0; i < xf86_config->num_output; i++) {
+ xf86OutputPtr output = xf86_config->output[i];
+ drmmode_output_private_ptr drmmode_output = output->driver_private;
+ drmmode_crtc_private_ptr drm_crtc =
+ output->crtc ? output->crtc->driver_private : NULL;
+
+ if (drmmode_output->output_id == -1)
+ continue;
+
+ ret |= connector_add_prop(req, drmmode_output,
+ DRMMODE_CONNECTOR_CRTC_ID,
+ drm_crtc ? drm_crtc->mode_crtc->crtc_id : 0);
+ }
+
+ if (test_only)
+ flags |= DRM_MODE_ATOMIC_TEST_ONLY;
+
+ if (ret == 0)
+ ret = drmModeAtomicCommit(ms->fd, req, flags, NULL);
+
+ if (ret == 0 && !test_only) {
+ for (i = 0; i < xf86_config->num_crtc; i++) {
+ xf86CrtcPtr crtc = xf86_config->crtc[i];
+ for (j = 0; i < xf86_config->num_output; i++) {
+ xf86OutputPtr output = xf86_config->output[j];
+ drmmode_output_private_ptr drmmode_output =
+ output->driver_private;
+
+ if (output->crtc == crtc)
+ drmmode_output->current_crtc = crtc;
+ else if (drmmode_output->current_crtc == crtc)
+ drmmode_output->current_crtc = NULL;
+ }
+ }
+ }
+
+ if (ret == 0 && test_only) {
+ for (i = 0; i < xf86_config->num_crtc; i++) {
+ xf86CrtcPtr crtc = xf86_config->crtc[i];
+ crtc->mode = crtc->desiredMode;
+ crtc->rotation = crtc->desiredRotation;
+ crtc->x = crtc->desiredX;
+ crtc->y = crtc->desiredY;
+ if (!xf86CrtcRotate(crtc))
+ ret = 1;
+ }
+ }
+
+ drmModeAtomicFree(req);
+ return ret;
+}
+
static int
drmmode_crtc_set_mode(xf86CrtcPtr crtc, Bool test_only)
{
@@ -786,73 +876,12 @@ drmmode_crtc_set_mode(xf86CrtcPtr crtc, Bool test_only)
int x, y;
int i, ret = 0;
+ if (ms->atomic_modeset)
+ return drmmode_set_mode_atomic(crtc->scrn, ms, test_only);
+
if (!drmmode_crtc_get_fb_id(crtc, &fb_id, &x, &y))
return 1;
- if (ms->atomic_modeset) {
- drmModeAtomicReq *req = drmModeAtomicAlloc();
- Bool active;
- uint32_t flags = DRM_MODE_ATOMIC_ALLOW_MODESET;
-
- if (!req)
- return 1;
-
- ret |= crtc_add_dpms_props(req, crtc, DPMSModeOn, &active);
- ret |= plane_add_props(req, crtc, active ? fb_id : 0, x, y);
-
- /* Orphaned CRTCs need to be disabled right now in atomic mode */
- for (i = 0; i < xf86_config->num_crtc; i++) {
- xf86CrtcPtr other_crtc = xf86_config->crtc[i];
- drmmode_crtc_private_ptr other_drmmode_crtc = other_crtc->driver_private;
- int lost_outputs = 0;
- int remaining_outputs = 0;
- int j;
-
- if (other_crtc == crtc)
- continue;
-
- for (j = 0; j < xf86_config->num_output; j++) {
- xf86OutputPtr output = xf86_config->output[j];
- drmmode_output_private_ptr drmmode_output = output->driver_private;
-
- if (drmmode_output->current_crtc == other_crtc) {
- if (output->crtc == crtc)
- lost_outputs++;
- else
- remaining_outputs++;
- }
- }
-
- if (lost_outputs > 0 && remaining_outputs == 0) {
- ret |= crtc_add_prop(req, other_drmmode_crtc,
- DRMMODE_CRTC_ACTIVE, 0);
- ret |= crtc_add_prop(req, other_drmmode_crtc,
- DRMMODE_CRTC_MODE_ID, 0);
- }
- }
-
- if (test_only)
- flags |= DRM_MODE_ATOMIC_TEST_ONLY;
-
- if (ret == 0)
- ret = drmModeAtomicCommit(ms->fd, req, flags, NULL);
-
- if (ret == 0 && !test_only) {
- for (i = 0; i < xf86_config->num_output; i++) {
- xf86OutputPtr output = xf86_config->output[i];
- drmmode_output_private_ptr drmmode_output = output->driver_private;
-
- if (output->crtc == crtc)
- drmmode_output->current_crtc = crtc;
- else if (drmmode_output->current_crtc == crtc)
- drmmode_output->current_crtc = NULL;
- }
- }
-
- drmModeAtomicFree(req);
- return ret;
- }
-
output_ids = calloc(sizeof(uint32_t), xf86_config->num_output);
if (!output_ids)
return -1;
@@ -3199,14 +3228,19 @@ drmmode_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height)
if (!drmmode_glamor_handle_new_screen_pixmap(drmmode))
goto fail;
- for (i = 0; i < xf86_config->num_crtc; i++) {
- xf86CrtcPtr crtc = xf86_config->crtc[i];
+ if (ms->atomic_modeset) {
+ if (drmmode_set_mode_atomic(scrn, ms, FALSE))
+ goto fail;
+ } else {
+ for (i = 0; i < xf86_config->num_crtc; i++) {
+ xf86CrtcPtr crtc = xf86_config->crtc[i];
- if (!crtc->enabled)
- continue;
+ if (!crtc->enabled)
+ continue;
- drmmode_set_mode_major(crtc, &crtc->mode,
- crtc->rotation, crtc->x, crtc->y);
+ drmmode_set_mode_major(crtc, &crtc->mode,
+ crtc->rotation, crtc->x, crtc->y);
+ }
}
if (old_fb_id) {
@@ -3457,8 +3491,13 @@ Bool
drmmode_set_desired_modes(ScrnInfoPtr pScrn, drmmode_ptr drmmode, Bool set_hw)
{
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
+ modesettingPtr ms = modesettingPTR(pScrn);
int c;
+ /* drmmode_set_mode_atomic returns 0 on success, we return TRUE */
+ if (ms->atomic_modeset)
+ return !drmmode_set_mode_atomic(pScrn, ms, /* test_only = */ !set_hw);
+
for (c = 0; c < config->num_crtc; c++) {
xf86CrtcPtr crtc = config->crtc[c];
drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
--
2.20.1

View File

@ -1,7 +1,7 @@
From 1a24c9850144481cdc0ebf9bea5b3141ddc2c4b2 Mon Sep 17 00:00:00 2001
From 6ff9bf9f005ce81b587d3b4345232c73fc12da53 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Wed, 26 Jun 2019 16:46:54 +0200
Subject: [PATCH xserver 04/17] xwayland: Add fake output modes to xrandr
Subject: [PATCH xserver 04/24] xwayland: Add fake output modes to xrandr
output mode lists
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
@ -17,6 +17,7 @@ WPviewport to scale there pixmap to cover the entire output.
Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
Acked-by: Michel Dänzer <mdaenzer@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
(cherry picked from commit 0d656d796071fb637e4969ea800855fe5d1c9728)
---
hw/xwayland/xwayland-output.c | 112 ++++++++++++++++++++++++++++++++--
hw/xwayland/xwayland.c | 17 ++++++
@ -162,7 +163,7 @@ index aa6f37864..2ccc3ca60 100644
xorg_list_for_each_entry(it, &xwl_screen->output_list, link) {
/* output done event is sent even when some property
diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c
index 87185e6f3..44eb0e042 100644
index 942981834..3c50396f1 100644
--- a/hw/xwayland/xwayland.c
+++ b/hw/xwayland/xwayland.c
@@ -152,6 +152,23 @@ xwl_screen_get(ScreenPtr screen)
@ -190,7 +191,7 @@ index 87185e6f3..44eb0e042 100644
xwl_window_set_allow_commits(struct xwl_window *xwl_window, Bool allow,
const char *debug_msg)
diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h
index 07baa09e2..937977ccf 100644
index fa78b5ab9..c66997f00 100644
--- a/hw/xwayland/xwayland.h
+++ b/hw/xwayland/xwayland.h
@@ -389,6 +389,7 @@ void xwl_surface_damage(struct xwl_screen *xwl_screen,
@ -202,5 +203,5 @@ index 07baa09e2..937977ccf 100644
void xwl_tablet_tool_set_cursor(struct xwl_tablet_tool *tool);
void xwl_seat_set_cursor(struct xwl_seat *xwl_seat);
--
2.24.1
2.25.2

View File

@ -1,39 +0,0 @@
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 10ea651c552c8a7d7a2bfab29b7def4f31f8af6c Mon Sep 17 00:00:00 2001
From d837f7003d22c5e0d5bd05d41e872e7ee331dfa4 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/17] xwayland: Use RandR 1.2 interface (rev 2)
Subject: [PATCH xserver 05/24] xwayland: Use RandR 1.2 interface (rev 2)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@ -23,6 +23,7 @@ was set.
Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
Acked-by: Michel Dänzer <mdaenzer@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
(cherry picked from commit e89872f51aa834fa9d94a4ca4822f03b0341ab4f)
---
hw/xwayland/xwayland-output.c | 81 +++++++++++++++++++++++++++++++++++
1 file changed, 81 insertions(+)
@ -134,5 +135,5 @@ index 2ccc3ca60..67e99bdab 100644
return TRUE;
}
--
2.24.1
2.25.2

View File

@ -1,37 +0,0 @@
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 000b477eee11fddd0d4e323407aaa40afb818827 Mon Sep 17 00:00:00 2001
From 80ca38c4428a499a795084dc696c390b707749b9 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/17] xwayland: Add per client private data
Subject: [PATCH xserver 06/24] xwayland: Add per client private data
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@ -14,13 +14,14 @@ change emulation.
Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
Acked-by: Michel Dänzer <mdaenzer@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
(cherry picked from commit 905cb8b9e27add5f49a45fe167a0005bf05218bc)
---
hw/xwayland/xwayland.c | 14 ++++++++++++++
hw/xwayland/xwayland.h | 5 +++++
2 files changed, 19 insertions(+)
diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c
index 44eb0e042..7720baab8 100644
index 3c50396f1..b0e37ceb9 100644
--- a/hw/xwayland/xwayland.c
+++ b/hw/xwayland/xwayland.c
@@ -135,11 +135,18 @@ ddxProcessArgument(int argc, char *argv[], int i)
@ -42,7 +43,7 @@ index 44eb0e042..7720baab8 100644
static struct xwl_window *
xwl_window_get(WindowPtr window)
{
@@ -1136,6 +1143,13 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv)
@@ -1143,6 +1150,13 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv)
return FALSE;
if (!dixRegisterPrivateKey(&xwl_damage_private_key, PRIVATE_WINDOW, 0))
return FALSE;
@ -57,21 +58,23 @@ index 44eb0e042..7720baab8 100644
dixSetPrivate(&pScreen->devPrivates, &xwl_screen_private_key, xwl_screen);
xwl_screen->screen = pScreen;
diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h
index 937977ccf..630b14e48 100644
index c66997f00..593e92b64 100644
--- a/hw/xwayland/xwayland.h
+++ b/hw/xwayland/xwayland.h
@@ -381,6 +381,11 @@ struct xwl_output {
void xwl_window_create_frame_callback(struct xwl_window *xwl_window);
@@ -379,8 +379,13 @@ struct xwl_output {
Bool xdg_output_done;
};
+struct xwl_client {
+};
+
void xwl_window_create_frame_callback(struct xwl_window *xwl_window);
+struct xwl_client *xwl_client_get(ClientPtr client);
+
void xwl_sync_events (struct xwl_screen *xwl_screen);
void xwl_surface_damage(struct xwl_screen *xwl_screen,
struct wl_surface *surface,
--
2.24.1
2.25.2

View File

@ -1,59 +0,0 @@
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 7c9852e4e9e85000d6c8759b237ed9e9320dadfd Mon Sep 17 00:00:00 2001
From 879fed575deea57462217fc31eb331db8d23637c 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/17] xwayland: Add support for storing per client
Subject: [PATCH xserver 07/24] xwayland: Add support for storing per client
per output emulated resolution
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
@ -24,6 +24,7 @@ change emulation.
Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
Acked-by: Michel Dänzer <mdaenzer@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
(cherry picked from commit aca0a588eb40a5e6669094a2ab7f71ca0ba06b16)
---
hw/xwayland/xwayland-output.c | 67 +++++++++++++++++++++++++++++++++++
hw/xwayland/xwayland.h | 17 +++++++++
@ -108,12 +109,12 @@ index 67e99bdab..82ff5db70 100644
const int32_t xwl_output_fake_modes[][2] = {
/* 4:3 (1.33) */
diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h
index 630b14e48..7e6497b80 100644
index 593e92b64..0e6f92e63 100644
--- a/hw/xwayland/xwayland.h
+++ b/hw/xwayland/xwayland.h
@@ -381,7 +381,21 @@ struct xwl_output {
void xwl_window_create_frame_callback(struct xwl_window *xwl_window);
@@ -379,7 +379,21 @@ struct xwl_output {
Bool xdg_output_done;
};
+/* Per client per output emulated randr/vidmode resolution info. */
+struct xwl_emulated_mode {
@ -132,7 +133,7 @@ index 630b14e48..7e6497b80 100644
+ struct xwl_emulated_mode emulated_modes[XWL_CLIENT_MAX_EMULATED_MODES];
};
struct xwl_client *xwl_client_get(ClientPtr client);
void xwl_window_create_frame_callback(struct xwl_window *xwl_window);
@@ -425,6 +439,9 @@ void xwl_output_destroy(struct xwl_output *xwl_output);
void xwl_output_remove(struct xwl_output *xwl_output);
@ -144,5 +145,5 @@ index 630b14e48..7e6497b80 100644
float VRefresh, Bool Reduced, Bool Interlaced);
--
2.24.1
2.25.2

View File

@ -1,44 +0,0 @@
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 869e6f39165daeacdd9cbb3f2f0d1845a3af3360 Mon Sep 17 00:00:00 2001
From a640802d33e0daccf2d4045ecb3e70cbf56bf0ac 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/17] xwayland: Add support for randr-resolution
Subject: [PATCH xserver 08/24] xwayland: Add support for randr-resolution
change emulation using viewport
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
@ -28,6 +28,7 @@ disabling resolution emulation all together when going windowed.
Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
Acked-by: Michel Dänzer <mdaenzer@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
(cherry picked from commit d99b9ff0f237d15e7eb507484493c73b393d5dba)
---
hw/xwayland/xwayland-input.c | 5 +
hw/xwayland/xwayland-output.c | 63 ++++++++++-
@ -142,7 +143,7 @@ index 82ff5db70..99ab1b288 100644
static Bool
diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c
index 7720baab8..1466e1e11 100644
index b0e37ceb9..1ab5b3a28 100644
--- a/hw/xwayland/xwayland.c
+++ b/hw/xwayland/xwayland.c
@@ -176,6 +176,23 @@ xwl_screen_has_resolution_change_emulation(struct xwl_screen *xwl_screen)
@ -350,7 +351,7 @@ index 7720baab8..1466e1e11 100644
unregister_damage(window);
if (xwl_window->frame_callback)
@@ -760,6 +928,33 @@ xwl_set_window_pixmap(WindowPtr window,
@@ -767,6 +935,33 @@ xwl_set_window_pixmap(WindowPtr window,
ensure_surface_for_window(window);
}
@ -384,7 +385,7 @@ index 7720baab8..1466e1e11 100644
static void
frame_callback(void *data,
struct wl_callback *callback,
@@ -1211,6 +1406,7 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv)
@@ -1218,6 +1413,7 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv)
xorg_list_init(&xwl_screen->output_list);
xorg_list_init(&xwl_screen->seat_list);
xorg_list_init(&xwl_screen->damage_window_list);
@ -392,7 +393,7 @@ index 7720baab8..1466e1e11 100644
xwl_screen->depth = 24;
xwl_screen->display = wl_display_connect(NULL);
@@ -1309,6 +1505,9 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv)
@@ -1316,6 +1512,9 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv)
xwl_screen->CloseScreen = pScreen->CloseScreen;
pScreen->CloseScreen = xwl_close_screen;
@ -403,7 +404,7 @@ index 7720baab8..1466e1e11 100644
xwl_screen->SetWindowPixmap = pScreen->SetWindowPixmap;
pScreen->SetWindowPixmap = xwl_set_window_pixmap;
diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h
index 7e6497b80..56e753306 100644
index 0e6f92e63..9adf3af76 100644
--- a/hw/xwayland/xwayland.h
+++ b/hw/xwayland/xwayland.h
@@ -135,10 +135,12 @@ struct xwl_screen {
@ -457,5 +458,5 @@ index 7e6497b80..56e753306 100644
float VRefresh, Bool Reduced, Bool Interlaced);
--
2.24.1
2.25.2

View File

@ -1,66 +0,0 @@
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 3367f9a40c56b48b4945d8529934ef0ac8c395f3 Mon Sep 17 00:00:00 2001
From 62e8b2ff7471f1a48b8bac9f41cceecea4931c03 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/17] xwayland: Add xwlRRModeToDisplayMode() helper
Subject: [PATCH xserver 09/24] xwayland: Add xwlRRModeToDisplayMode() helper
function
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
@ -14,6 +14,7 @@ Wayland viewport extension.
Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
Acked-by: Michel Dänzer <mdaenzer@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
(cherry picked from commit 43c80078126f6f33c6ab7d3cf4668733bde03366)
---
hw/xwayland/xwayland-vidmode.c | 51 +++++++++++++++++++---------------
1 file changed, 28 insertions(+), 23 deletions(-)
@ -96,5 +97,5 @@ index 0bcd11401..a59c9f6a9 100644
return TRUE;
}
--
2.24.1
2.25.2

View File

@ -1,45 +0,0 @@
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 9da07f246b50292d24347608d5bba92efd1756af Mon Sep 17 00:00:00 2001
From 3ecabb250841ff0423744cd2291aaebf87b4239a 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/17] xwayland: Add xwlVidModeGetCurrentRRMode helper
Subject: [PATCH xserver 10/24] xwayland: Add xwlVidModeGetCurrentRRMode helper
to the vidmode code
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
@ -24,6 +24,7 @@ support to Xwayland's XF86 vidmode extension emulation.
Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
Acked-by: Michel Dänzer <mdaenzer@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
(cherry picked from commit bcad1b813a04b9f3ff225f57a4baad09bd6315b9)
---
hw/xwayland/xwayland-vidmode.c | 90 +++++++++++++++++++++-------------
1 file changed, 56 insertions(+), 34 deletions(-)
@ -188,5 +189,5 @@ index a59c9f6a9..e9aea7269 100644
static void
--
2.24.1
2.25.2

View File

@ -1,67 +0,0 @@
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 9b119998db0d5e28e912d82de5b04674200f341b Mon Sep 17 00:00:00 2001
From 86e32a877ded8d67ec26ed2bcc06bd80ec2a5915 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/17] xwayland: Add vidmode mode changing emulation
Subject: [PATCH xserver 11/24] xwayland: Add vidmode mode changing emulation
support
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
@ -13,6 +13,7 @@ change the resolution when going fullscreen.
Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
Acked-by: Michel Dänzer <mdaenzer@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
(cherry picked from commit 38de6260816674b5430144cc38a8a27d93d1bf19)
---
hw/xwayland/xwayland-vidmode.c | 130 ++++++++++++++++++++++-----------
1 file changed, 86 insertions(+), 44 deletions(-)
@ -231,5 +232,5 @@ index e9aea7269..56aac693a 100644
static Bool
--
2.24.1
2.25.2

View File

@ -1,28 +0,0 @@
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 fc9ccf1bd1dc3dadbde022bf7f353dfae93d089e Mon Sep 17 00:00:00 2001
From fd95c9a52e35e994e140a925cfc01587257d4511 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/17] xwayland: xwl_window_should_enable_viewport:
Subject: [PATCH xserver 12/24] xwayland: xwl_window_should_enable_viewport:
Add extra test
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
@ -19,12 +19,13 @@ Xwayland.
Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
Acked-by: Michel Dänzer <mdaenzer@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
(cherry picked from commit 0c305dbff8a44f3fa3d6aefd372a967029a7a527)
---
hw/xwayland/xwayland.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c
index 1466e1e11..19a348255 100644
index 1ab5b3a28..85036adfe 100644
--- a/hw/xwayland/xwayland.c
+++ b/hw/xwayland/xwayland.c
@@ -649,6 +649,23 @@ xwl_window_should_enable_viewport(struct xwl_window *xwl_window,
@ -52,5 +53,5 @@ index 1466e1e11..19a348255 100644
}
--
2.24.1
2.25.2

View File

@ -1,69 +0,0 @@
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 2fd8751593ed1268e859a9a19f0eea3820ce5f69 Mon Sep 17 00:00:00 2001
From dda4a8b2f672eb5791f39222dd0996e07b416eb7 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/17] xwayland: Set _XWAYLAND_RANDR_EMU_MONITOR_RECTS
Subject: [PATCH xserver 13/24] xwayland: Set _XWAYLAND_RANDR_EMU_MONITOR_RECTS
property for resolution emulation
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
@ -29,6 +29,7 @@ be equal to the new resolution.
Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
Acked-by: Michel Dänzer <mdaenzer@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
(cherry picked from commit 5315f988d9f175e4850f4259f691a68d95ce7ac2)
---
hw/xwayland/xwayland-output.c | 77 +++++++++++++++++++++++++++++++++++
hw/xwayland/xwayland.c | 23 +++++++++++
@ -138,7 +139,7 @@ index 99ab1b288..20c254962 100644
static void
diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c
index 19a348255..1840ccbfb 100644
index 85036adfe..e43f3de96 100644
--- a/hw/xwayland/xwayland.c
+++ b/hw/xwayland/xwayland.c
@@ -690,6 +690,27 @@ xwl_screen_check_resolution_change_emulation(struct xwl_screen *xwl_screen)
@ -179,7 +180,7 @@ index 19a348255..1840ccbfb 100644
}
diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h
index 56e753306..ef1138348 100644
index 9adf3af76..eb8c4bd70 100644
--- a/hw/xwayland/xwayland.h
+++ b/hw/xwayland/xwayland.h
@@ -418,6 +418,7 @@ Bool xwl_screen_has_resolution_change_emulation(struct xwl_screen *xwl_screen);
@ -200,5 +201,5 @@ index 56e753306..ef1138348 100644
RRModePtr xwayland_cvt(int HDisplay, int VDisplay,
float VRefresh, Bool Reduced, Bool Interlaced);
--
2.24.1
2.25.2

View File

@ -0,0 +1,137 @@
From aa0f9ba1aa3f12f7e65ed64ac03114f27c8bff1f Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Mon, 27 Jan 2020 11:08:00 +0100
Subject: [PATCH xserver 14/24] xwayland: Cache client-id for the
window-manager client
Instead of iterating over all clients which are listening for events on the
root window and checking if the client we are dealing with is the one
listening for SubstructureRedirectMask | ResizeRedirectMask events and thus
is the window-manager, cache the client-id of the window-manager in
xwl_screen and use that when checking if a client is the window-manager.
Note that we cache and compare the client-id rather then the ClienPtr,
this saves reading the ClientPtr from the global clients array when doing
the comparison.
Suggested-by: Olivier Fourdan <ofourdan@redhat.com>
Acked-by: Olivier Fourdan <ofourdan@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
(cherry picked from commit ded89300c1dd541f59fe6e93c5c69d7fe7088244)
---
hw/xwayland/xwayland.c | 48 ++++++++++++++++++++++++++++--------------
hw/xwayland/xwayland.h | 2 ++
2 files changed, 34 insertions(+), 16 deletions(-)
diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c
index e43f3de96..f4d433bca 100644
--- a/hw/xwayland/xwayland.c
+++ b/hw/xwayland/xwayland.c
@@ -576,20 +576,11 @@ xwl_window_enable_viewport(struct xwl_window *xwl_window,
}
static Bool
-xwl_screen_client_is_window_manager(struct xwl_screen *xwl_screen,
- ClientPtr client)
+window_is_wm_window(WindowPtr window)
{
- WindowPtr root = xwl_screen->screen->root;
- OtherClients *others;
-
- for (others = wOtherClients(root); others; others = others->next) {
- if (SameClient(others, client)) {
- if (others->mask & (SubstructureRedirectMask | ResizeRedirectMask))
- return TRUE;
- }
- }
+ struct xwl_screen *xwl_screen = xwl_screen_get(window->drawable.pScreen);
- return FALSE;
+ return CLIENT_ID(window->drawable.id) == xwl_screen->wm_client_id;
}
static ClientPtr
@@ -603,7 +594,7 @@ xwl_window_get_owner(struct xwl_window *xwl_window)
* decoration window. In that case return the client of the
* first *and only* child of the toplevel (decoration) window.
*/
- if (xwl_screen_client_is_window_manager(xwl_window->xwl_screen, client)) {
+ if (window_is_wm_window(window)) {
if (window->firstChild && window->firstChild == window->lastChild)
return wClient(window->firstChild);
else
@@ -698,9 +689,7 @@ xwl_screen_check_resolution_change_emulation(struct xwl_screen *xwl_screen)
Bool
xwl_window_is_toplevel(WindowPtr window)
{
- struct xwl_screen *xwl_screen = xwl_screen_get(window->drawable.pScreen);
-
- if (xwl_screen_client_is_window_manager(xwl_screen, wClient(window)))
+ if (window_is_wm_window(window))
return FALSE;
/* CSD and override-redirect toplevel windows */
@@ -975,6 +964,30 @@ xwl_set_window_pixmap(WindowPtr window,
ensure_surface_for_window(window);
}
+static Bool
+xwl_change_window_attributes(WindowPtr window, unsigned long mask)
+{
+ ScreenPtr screen = window->drawable.pScreen;
+ struct xwl_screen *xwl_screen = xwl_screen_get(screen);
+ OtherClients *others;
+ Bool ret;
+
+ screen->ChangeWindowAttributes = xwl_screen->ChangeWindowAttributes;
+ ret = (*screen->ChangeWindowAttributes) (window, mask);
+ xwl_screen->ChangeWindowAttributes = screen->ChangeWindowAttributes;
+ screen->ChangeWindowAttributes = xwl_change_window_attributes;
+
+ if (window != screen->root || !(mask & CWEventMask))
+ return ret;
+
+ for (others = wOtherClients(window); others; others = others->next) {
+ if (others->mask & (SubstructureRedirectMask | ResizeRedirectMask))
+ xwl_screen->wm_client_id = CLIENT_ID(others->resource);
+ }
+
+ return ret;
+}
+
static void
xwl_resize_window(WindowPtr window,
int x, int y,
@@ -1552,6 +1565,9 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv)
xwl_screen->CloseScreen = pScreen->CloseScreen;
pScreen->CloseScreen = xwl_close_screen;
+ xwl_screen->ChangeWindowAttributes = pScreen->ChangeWindowAttributes;
+ pScreen->ChangeWindowAttributes = xwl_change_window_attributes;
+
xwl_screen->ResizeWindow = pScreen->ResizeWindow;
pScreen->ResizeWindow = xwl_resize_window;
diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h
index eb8c4bd70..126af8823 100644
--- a/hw/xwayland/xwayland.h
+++ b/hw/xwayland/xwayland.h
@@ -118,6 +118,7 @@ struct xwl_screen {
int height;
int depth;
ScreenPtr screen;
+ int wm_client_id;
int expecting_event;
enum RootClipMode root_clip_mode;
@@ -135,6 +136,7 @@ struct xwl_screen {
DestroyWindowProcPtr DestroyWindow;
XYToWindowProcPtr XYToWindow;
SetWindowPixmapProcPtr SetWindowPixmap;
+ ChangeWindowAttributesProcPtr ChangeWindowAttributes;
ResizeWindowProcPtr ResizeWindow;
struct xorg_list output_list;
--
2.25.2

View File

@ -1,64 +0,0 @@
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

@ -1,46 +0,0 @@
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

@ -0,0 +1,50 @@
From 1f39cb2ef51c72ec0c448c5d9571540bb0d9f3eb Mon Sep 17 00:00:00 2001
From: Roman Gilg <subdiff@gmail.com>
Date: Fri, 3 Jan 2020 17:12:14 +0100
Subject: [PATCH xserver 15/24] xwayland: Reuse viewport instead of recreating
When a viewport is already created we can reuse this object instead of
destroying it and getting a new one for updating the source rectangle and
destination size.
Signed-off-by: Roman Gilg <subdiff@gmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Olivier Fourdan <ofourdan@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
(cherry picked from commit 948e02872feb641a176b3af82b6ef1201c97bb16)
---
hw/xwayland/xwayland.c | 18 +++++++-----------
1 file changed, 7 insertions(+), 11 deletions(-)
diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c
index f4d433bca..320589dde 100644
--- a/hw/xwayland/xwayland.c
+++ b/hw/xwayland/xwayland.c
@@ -550,17 +550,13 @@ xwl_window_enable_viewport(struct xwl_window *xwl_window,
struct xwl_output *xwl_output,
struct xwl_emulated_mode *emulated_mode)
{
- /* If necessary disable old viewport to apply new settings */
- if (xwl_window_has_viewport_enabled(xwl_window))
- xwl_window_disable_viewport(xwl_window);
-
- DebugF("XWAYLAND: enabling viewport %dx%d -> %dx%d\n",
- emulated_mode->width, emulated_mode->height,
- xwl_output->width, xwl_output->height);
-
- xwl_window->viewport =
- wp_viewporter_get_viewport(xwl_window->xwl_screen->viewporter,
- xwl_window->surface);
+ if (!xwl_window_has_viewport_enabled(xwl_window)) {
+ DebugF("XWAYLAND: enabling viewport %dx%d -> %dx%d\n",
+ emulated_mode->width, emulated_mode->height,
+ xwl_output->width, xwl_output->height);
+ xwl_window->viewport = wp_viewporter_get_viewport(xwl_window->xwl_screen->viewporter,
+ xwl_window->surface);
+ }
wp_viewport_set_source(xwl_window->viewport,
wl_fixed_from_int(0),
--
2.25.2

View File

@ -0,0 +1,81 @@
From 8cedbfd448edf410a45c57addcee0e7304f11b86 Mon Sep 17 00:00:00 2001
From: Roman Gilg <subdiff@gmail.com>
Date: Fri, 3 Jan 2020 17:27:28 +0100
Subject: [PATCH xserver 16/24] xwayland: Recurse on finding the none-wm owner
An X11 window manager might add a chain of parent windows when reparenting to a
decoration window.
That is for example the case for KWin, which reparents client windows to one
decoration and another wrapper parent window.
Account for that by a recursion into the tree. For now assume as before that
all X11 window managers reparent with one child only for these parent windows.
Changes by Hans de Goede:
- Move the xwl_window_is_toplevel() from a later patch in this series here
as it really belongs together with these changes
- Drop no longer necessary xwl_window argument from window_get_none_wm_owner
parameters
Signed-off-by: Roman Gilg <subdiff@gmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Olivier Fourdan <ofourdan@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
(cherry picked from commit a69f7fbb54efc8ffad320c8afd23cb41fc9edc27)
---
hw/xwayland/xwayland.c | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c
index 320589dde..f42b80b90 100644
--- a/hw/xwayland/xwayland.c
+++ b/hw/xwayland/xwayland.c
@@ -580,19 +580,18 @@ window_is_wm_window(WindowPtr window)
}
static ClientPtr
-xwl_window_get_owner(struct xwl_window *xwl_window)
+window_get_none_wm_owner(WindowPtr window)
{
- WindowPtr window = xwl_window->window;
ClientPtr client = wClient(window);
/* If the toplevel window is owned by the window-manager, then the
- * actual client toplevel window has been reparented to a window-manager
- * decoration window. In that case return the client of the
- * first *and only* child of the toplevel (decoration) window.
+ * actual client toplevel window has been reparented to some window-manager
+ * decoration/wrapper windows. In that case recurse by checking the client
+ * of the first *and only* child of the decoration/wrapper window.
*/
if (window_is_wm_window(window)) {
if (window->firstChild && window->firstChild == window->lastChild)
- return wClient(window->firstChild);
+ return window_get_none_wm_owner(window->firstChild);
else
return NULL; /* Should never happen, skip resolution emulation */
}
@@ -613,7 +612,7 @@ xwl_window_should_enable_viewport(struct xwl_window *xwl_window,
if (!xwl_screen_has_resolution_change_emulation(xwl_screen))
return FALSE;
- owner = xwl_window_get_owner(xwl_window);
+ owner = window_get_none_wm_owner(xwl_window->window);
if (!owner)
return FALSE;
@@ -692,8 +691,8 @@ xwl_window_is_toplevel(WindowPtr window)
if (window_get_damage(window))
return TRUE;
- /* Normal toplevel client windows, reparented to decoration window */
- return (window->parent && window_get_damage(window->parent));
+ /* Normal toplevel client windows, reparented to a window-manager window */
+ return window->parent && window_is_wm_window(window->parent);
}
static void
--
2.25.2

View File

@ -1,137 +0,0 @@
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

@ -1,62 +0,0 @@
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

@ -0,0 +1,82 @@
From 939a78925a1d591e6aaf291a6609b9c6e54ee6ce Mon Sep 17 00:00:00 2001
From: Roman Gilg <subdiff@gmail.com>
Date: Wed, 15 Jan 2020 10:07:58 +0100
Subject: [PATCH xserver 17/24] xwayland: Make window_get_none_wm_owner return
a Window instead of a Client
Make window_get_none_wm_owner return the first non-wm-window instead of the
owner (client) of the first non-wm-window and rename it to
window_get_client_toplevel to match its new behavior.
This is a preparation patch for switching to using the drawable coordinates
in xwl_window_should_enable_viewport()
Changes by Hans de Goede:
- Split this change out into a separate patch for easier reviewing
- Rename window_get_none_wm_owner to window_get_client_toplevel to match
its new behavior
Signed-off-by: Roman Gilg <subdiff@gmail.com>
Acked-by: Olivier Fourdan <ofourdan@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
(cherry picked from commit 060f10062eb1761515b762b46cba56c7a53db72c)
---
hw/xwayland/xwayland.c | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c
index f42b80b90..d70d729ae 100644
--- a/hw/xwayland/xwayland.c
+++ b/hw/xwayland/xwayland.c
@@ -579,10 +579,10 @@ window_is_wm_window(WindowPtr window)
return CLIENT_ID(window->drawable.id) == xwl_screen->wm_client_id;
}
-static ClientPtr
-window_get_none_wm_owner(WindowPtr window)
+static WindowPtr
+window_get_client_toplevel(WindowPtr window)
{
- ClientPtr client = wClient(window);
+ assert(window);
/* If the toplevel window is owned by the window-manager, then the
* actual client toplevel window has been reparented to some window-manager
@@ -591,12 +591,12 @@ window_get_none_wm_owner(WindowPtr window)
*/
if (window_is_wm_window(window)) {
if (window->firstChild && window->firstChild == window->lastChild)
- return window_get_none_wm_owner(window->firstChild);
+ return window_get_client_toplevel(window->firstChild);
else
return NULL; /* Should never happen, skip resolution emulation */
}
- return client;
+ return window;
}
static Bool
@@ -608,14 +608,17 @@ xwl_window_should_enable_viewport(struct xwl_window *xwl_window,
struct xwl_emulated_mode *emulated_mode;
struct xwl_output *xwl_output;
ClientPtr owner;
+ WindowPtr window;
if (!xwl_screen_has_resolution_change_emulation(xwl_screen))
return FALSE;
- owner = window_get_none_wm_owner(xwl_window->window);
- if (!owner)
+ window = window_get_client_toplevel(xwl_window->window);
+ if (!window)
return FALSE;
+ owner = wClient(window);
+
/* 1. Test if the window matches the emulated mode on one of the outputs
* This path gets hit by most games / libs (e.g. SDL, SFML, OGRE)
*/
--
2.25.2

View File

@ -0,0 +1,121 @@
From c5d9cb5f4bc4f703b66fc524a76247c742490b30 Mon Sep 17 00:00:00 2001
From: Roman Gilg <subdiff@gmail.com>
Date: Fri, 3 Jan 2020 17:55:28 +0100
Subject: [PATCH xserver 18/24] xwayland: Check emulation on client toplevel
resize
When a reparented window is resized directly check the emulation instead of
doing this only when the window manager parent window is resized, what might
never happen.
For that to work we need to make sure that we compare the current size of the
client toplevel when looking for an emulated mode.
Changes by Hans de Goede:
- Remove xwl_window x, y, width and height members as those are no longer used.
- Add check for xwl_window_from_window() returning NULL.
Signed-off-by: Roman Gilg <subdiff@gmail.com>
Acked-by: Olivier Fourdan <ofourdan@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
(cherry picked from commit 6d98f840da6dfcf2a69e03a1b3fa0bf602ba1f27)
---
hw/xwayland/xwayland.c | 27 +++++++++++----------------
hw/xwayland/xwayland.h | 1 -
2 files changed, 11 insertions(+), 17 deletions(-)
diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c
index d70d729ae..14227a327 100644
--- a/hw/xwayland/xwayland.c
+++ b/hw/xwayland/xwayland.c
@@ -609,6 +609,7 @@ xwl_window_should_enable_viewport(struct xwl_window *xwl_window,
struct xwl_output *xwl_output;
ClientPtr owner;
WindowPtr window;
+ DrawablePtr drawable;
if (!xwl_screen_has_resolution_change_emulation(xwl_screen))
return FALSE;
@@ -618,6 +619,7 @@ xwl_window_should_enable_viewport(struct xwl_window *xwl_window,
return FALSE;
owner = wClient(window);
+ drawable = &window->drawable;
/* 1. Test if the window matches the emulated mode on one of the outputs
* This path gets hit by most games / libs (e.g. SDL, SFML, OGRE)
@@ -627,10 +629,10 @@ xwl_window_should_enable_viewport(struct xwl_window *xwl_window,
if (!emulated_mode)
continue;
- if (xwl_window->x == xwl_output->x &&
- xwl_window->y == xwl_output->y &&
- xwl_window->width == emulated_mode->width &&
- xwl_window->height == emulated_mode->height) {
+ if (drawable->x == xwl_output->x &&
+ drawable->y == xwl_output->y &&
+ drawable->width == emulated_mode->width &&
+ drawable->height == emulated_mode->height) {
*emulated_mode_ret = emulated_mode;
*xwl_output_ret = xwl_output;
@@ -646,9 +648,9 @@ xwl_window_should_enable_viewport(struct xwl_window *xwl_window,
emulated_mode = xwl_output_get_emulated_mode_for_client(xwl_output, owner);
if (xwl_output && xwl_window->window->overrideRedirect &&
emulated_mode && emulated_mode->from_vidmode &&
- xwl_window->x == 0 && xwl_window->y == 0 &&
- xwl_window->width == xwl_screen->width &&
- xwl_window->height == xwl_screen->height) {
+ drawable->x == 0 && drawable->y == 0 &&
+ drawable->width == xwl_screen->width &&
+ drawable->height == xwl_screen->height) {
*emulated_mode_ret = emulated_mode;
*xwl_output_ret = xwl_output;
@@ -768,8 +770,6 @@ ensure_surface_for_window(WindowPtr window)
xwl_window->xwl_screen = xwl_screen;
xwl_window->window = window;
- xwl_window->width = window->drawable.width;
- xwl_window->height = window->drawable.height;
xwl_window->surface = wl_compositor_create_surface(xwl_screen->compositor);
if (xwl_window->surface == NULL) {
ErrorF("wl_display_create_surface failed\n");
@@ -997,20 +997,15 @@ xwl_resize_window(WindowPtr window,
struct xwl_window *xwl_window;
xwl_screen = xwl_screen_get(screen);
- xwl_window = xwl_window_get(window);
+ xwl_window = xwl_window_from_window(window);
screen->ResizeWindow = xwl_screen->ResizeWindow;
(*screen->ResizeWindow) (window, x, y, width, height, sib);
xwl_screen->ResizeWindow = screen->ResizeWindow;
screen->ResizeWindow = xwl_resize_window;
- if (xwl_window) {
- xwl_window->x = x;
- xwl_window->y = y;
- xwl_window->width = width;
- xwl_window->height = height;
+ if (xwl_window && xwl_window_is_toplevel(window))
xwl_window_check_resolution_change_emulation(xwl_window);
- }
}
static void
diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h
index 126af8823..01aef27d2 100644
--- a/hw/xwayland/xwayland.h
+++ b/hw/xwayland/xwayland.h
@@ -184,7 +184,6 @@ struct xwl_window {
struct xwl_screen *xwl_screen;
struct wl_surface *surface;
struct wp_viewport *viewport;
- int32_t x, y, width, height;
float scale_x, scale_y;
struct wl_shell_surface *shell_surface;
WindowPtr window;
--
2.25.2

View File

@ -1,212 +0,0 @@
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,45 @@
From 63b0c0d76d1020f0cac331f3eff30fba07f79965 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Wed, 15 Jan 2020 14:36:45 +0100
Subject: [PATCH xserver 19/24] xwayland: Also check
resolution-change-emulation when the xwl_window itself moves
The recent change to use the top-level non-window-manager Window drawable
coordinates from xwl_window_check_resolution_change_emulation() in
combination with only calling it on a resize when the top-level window
is moved breaks things with mutter/gnome-shell.
When fullscreening a X11 window, mutter moves its window-decoration Window
wrapping the top-level Window to the monitor's origin coordinates (e.g. 0x0)
last. This updates the top-level's drawable coordinates, but as the
actual MoveWindow is called on the wrapper Window and not on the toplevel
we do not call xwl_window_check_resolution_change_emulation() and we never
enable the viewport.
This commit fixes this by also calling
xwl_window_check_resolution_change_emulation() if the Window being moved
is an xwl_window itself.
Acked-by: Olivier Fourdan <ofourdan@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
(cherry picked from commit 4fc107460a349a1a46f0e5251e6fd2a31f4c0428)
---
hw/xwayland/xwayland.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c
index 14227a327..298ef3ac8 100644
--- a/hw/xwayland/xwayland.c
+++ b/hw/xwayland/xwayland.c
@@ -1004,7 +1004,7 @@ xwl_resize_window(WindowPtr window,
xwl_screen->ResizeWindow = screen->ResizeWindow;
screen->ResizeWindow = xwl_resize_window;
- if (xwl_window && xwl_window_is_toplevel(window))
+ if (xwl_window && (xwl_window_get(window) || xwl_window_is_toplevel(window)))
xwl_window_check_resolution_change_emulation(xwl_window);
}
--
2.25.2

View File

@ -1,99 +0,0 @@
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

@ -1,254 +0,0 @@
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,83 @@
From 309e6e549adc5a164541d16822745c022cd8574b Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Thu, 9 Jan 2020 11:00:36 +0100
Subject: [PATCH xserver 20/24] xwayland: Also hook screen's MoveWindow method
Not only hook the ResizeWindow method of the screen (which really is
MoveAndResize) but also hook the MoveWindow method for checking if we
need to setup a viewport for resolution change emulation.
Our resolution change emulation check if the windows origin matches
the monitors origin and the windows origin can also be changed by just
a move without being resized.
Also checking on a move becomes esp. important when we move to checking
on changes to the top-level non-window-manager client (X11)Window instead
of on changes to the xwl_window later on in this patch series.
Acked-by: Olivier Fourdan <ofourdan@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
(cherry picked from commit 10df0437a2b142e61c4d84ffffa9592ac6846ef1)
---
hw/xwayland/xwayland.c | 25 +++++++++++++++++++++++++
hw/xwayland/xwayland.h | 1 +
2 files changed, 26 insertions(+)
diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c
index 298ef3ac8..1294ff1d8 100644
--- a/hw/xwayland/xwayland.c
+++ b/hw/xwayland/xwayland.c
@@ -1008,6 +1008,28 @@ xwl_resize_window(WindowPtr window,
xwl_window_check_resolution_change_emulation(xwl_window);
}
+static void
+xwl_move_window(WindowPtr window,
+ int x, int y,
+ WindowPtr next_sib,
+ VTKind kind)
+{
+ ScreenPtr screen = window->drawable.pScreen;
+ struct xwl_screen *xwl_screen;
+ struct xwl_window *xwl_window;
+
+ xwl_screen = xwl_screen_get(screen);
+ xwl_window = xwl_window_from_window(window);
+
+ screen->MoveWindow = xwl_screen->MoveWindow;
+ (*screen->MoveWindow) (window, x, y, next_sib, kind);
+ xwl_screen->MoveWindow = screen->MoveWindow;
+ screen->MoveWindow = xwl_move_window;
+
+ if (xwl_window && (xwl_window_get(window) || xwl_window_is_toplevel(window)))
+ xwl_window_check_resolution_change_emulation(xwl_window);
+}
+
static void
frame_callback(void *data,
struct wl_callback *callback,
@@ -1564,6 +1586,9 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv)
xwl_screen->ResizeWindow = pScreen->ResizeWindow;
pScreen->ResizeWindow = xwl_resize_window;
+ xwl_screen->MoveWindow = pScreen->MoveWindow;
+ pScreen->MoveWindow = xwl_move_window;
+
if (xwl_screen->rootless) {
xwl_screen->SetWindowPixmap = pScreen->SetWindowPixmap;
pScreen->SetWindowPixmap = xwl_set_window_pixmap;
diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h
index 01aef27d2..72225374b 100644
--- a/hw/xwayland/xwayland.h
+++ b/hw/xwayland/xwayland.h
@@ -138,6 +138,7 @@ struct xwl_screen {
SetWindowPixmapProcPtr SetWindowPixmap;
ChangeWindowAttributesProcPtr ChangeWindowAttributes;
ResizeWindowProcPtr ResizeWindow;
+ MoveWindowProcPtr MoveWindow;
struct xorg_list output_list;
struct xorg_list seat_list;
--
2.25.2

View File

@ -1,35 +0,0 @@
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

@ -1,7 +1,7 @@
From a5b9f4880ab61dc0c02065e6fdf5e2f16f36be7c Mon Sep 17 00:00:00 2001
From 52bbef1f55d17229684b0d76a478ec639c4032ed Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Mon, 7 Oct 2019 14:27:49 +0200
Subject: [PATCH xserver 14/17] xwayland: Fix emulated modes not being removed
Subject: [PATCH xserver 21/24] xwayland: Fix emulated modes not being removed
when screen rotation is used
The code building the mode-list does the following to deal with screen
@ -24,7 +24,9 @@ to a member of xwl_output->randr_output->modes, so we do not need to
duplicate this code, instead we can simply check that the passed in mode
is modes[0] which always is the actual output mode.
Acked-by: Olivier Fourdan <ofourdan@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
(cherry picked from commit 88342353de45e64f408c38bb10cd1506ba0f159a)
---
hw/xwayland/xwayland-output.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
@ -57,5 +59,5 @@ index 20c254962..7d705d919 100644
else
xwl_output_add_emulated_mode_for_client(xwl_output, client, mode, from_vidmode);
--
2.24.1
2.25.2

View File

@ -1,7 +1,7 @@
From c0bae670131d7eef3d0a4d015a14899cbd4c9b2d Mon Sep 17 00:00:00 2001
From 57d0ad44fd0b04fff98e9b484816dc95068a90cc Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Mon, 4 Nov 2019 11:46:49 +0100
Subject: [PATCH xserver 15/17] xwayland: Call
Subject: [PATCH xserver 22/24] xwayland: Call
xwl_window_check_resolution_change_emulation() on newly created O-R windows
Some clients, which use vidmode to change the resolution when going fullscreen,
@ -20,20 +20,22 @@ thus will not have an xwl_window.
This fixes ClanLib-0.6.x and alleggl-4.4.x using apps not properly
fullscreening.
Acked-by: Olivier Fourdan <ofourdan@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
(cherry picked from commit 4cfc2677f5c82ca5db0919de549b9b077f1ba113)
---
hw/xwayland/xwayland.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c
index 1840ccbfb..181977033 100644
index 1294ff1d8..6b86e56bd 100644
--- a/hw/xwayland/xwayland.c
+++ b/hw/xwayland/xwayland.c
@@ -832,6 +832,11 @@ ensure_surface_for_window(WindowPtr window)
@@ -819,6 +819,11 @@ ensure_surface_for_window(WindowPtr window)
xwl_window_init_allow_commits(xwl_window);
+ if (!xwl_screen_client_is_window_manager(xwl_screen, wClient(window))) {
+ if (!window_is_wm_window(window)) {
+ /* CSD or O-R toplevel window, check viewport on creation */
+ xwl_window_check_resolution_change_emulation(xwl_window);
+ }
@ -42,5 +44,5 @@ index 1840ccbfb..181977033 100644
err_surf:
--
2.24.1
2.25.2

View File

@ -1,41 +0,0 @@
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,7 +1,7 @@
From 8a34f7eb226be8d8ae0d9920657c17848372c92e Mon Sep 17 00:00:00 2001
From 87a1a7b9f8f7d848302057b9ca54f6729e82bbe7 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Mon, 4 Nov 2019 14:32:29 +0100
Subject: [PATCH xserver 16/17] xwayland: Fix setting of
Subject: [PATCH xserver 23/24] xwayland: Fix setting of
_XWAYLAND_RANDR_EMU_MONITOR_RECTS prop on new windows
For window-manager managed windows, xwl_realize_window is only called for
@ -27,31 +27,42 @@ work.
This fixes apps using the ogre3d library always running at the
monitors native resolution.
Acked-by: Olivier Fourdan <ofourdan@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
(cherry picked from commit 148f428dfccf606b932a00d5a00af06e8dca8a7e)
---
hw/xwayland/xwayland.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
hw/xwayland/xwayland.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c
index 181977033..d8e65d59f 100644
index 6b86e56bd..e721d6cb5 100644
--- a/hw/xwayland/xwayland.c
+++ b/hw/xwayland/xwayland.c
@@ -832,7 +832,13 @@ ensure_surface_for_window(WindowPtr window)
@@ -749,6 +749,7 @@ ensure_surface_for_window(WindowPtr window)
struct xwl_screen *xwl_screen;
struct xwl_window *xwl_window;
struct wl_region *region;
+ WindowPtr toplevel;
if (xwl_window_get(window))
return TRUE;
@@ -819,7 +820,14 @@ ensure_surface_for_window(WindowPtr window)
xwl_window_init_allow_commits(xwl_window);
- if (!xwl_screen_client_is_window_manager(xwl_screen, wClient(window))) {
+ /* When a new windom-manager decoration window is realized, then the randr
+ * emulation props have not been set on the managed client window yet.
- if (!window_is_wm_window(window)) {
+ /* When a new window-manager window is realized, then the randr emulation
+ * props may have not been set on the managed client window yet.
+ */
+ if (xwl_screen_client_is_window_manager(xwl_screen, wClient(window))) {
+ if (window->firstChild && window->firstChild == window->lastChild)
+ xwl_output_set_window_randr_emu_props(xwl_screen, window->firstChild);
+ if (window_is_wm_window(window)) {
+ toplevel = window_get_client_toplevel(window);
+ if (toplevel)
+ xwl_output_set_window_randr_emu_props(xwl_screen, toplevel);
+ } else {
/* CSD or O-R toplevel window, check viewport on creation */
xwl_window_check_resolution_change_emulation(xwl_window);
}
@@ -881,8 +887,6 @@ xwl_realize_window(WindowPtr window)
@@ -868,8 +876,6 @@ xwl_realize_window(WindowPtr window)
return FALSE;
}
@ -61,5 +72,5 @@ index 181977033..d8e65d59f 100644
}
--
2.24.1
2.25.2

View File

@ -1,7 +1,7 @@
From 28610d4f35d8bc30f30f33656777649ea355f3c2 Mon Sep 17 00:00:00 2001
From 231d5e2da2e1b0aee3cfe6febc54daf7a0e4b4c7 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Mon, 4 Nov 2019 15:01:18 +0100
Subject: [PATCH xserver 17/17] xwayland: Remove unnecessary
Subject: [PATCH xserver 24/24] xwayland: Remove unnecessary
xwl_window_is_toplevel() check from xwl_output_set_window_randr_emu_props()
Since the recent fix to call xwl_output_set_window_randr_emu_props() from
@ -13,7 +13,9 @@ This commit moves the check to xwl_output_set_randr_emu_prop_callback()
so that we only do it when we are walking over all Windows of a client
to update the property on a change of the emulated resolution.
Acked-by: Olivier Fourdan <ofourdan@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
(cherry picked from commit d4faab8708779df265239b203ed5f020bff681bf)
---
hw/xwayland/xwayland-output.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
@ -43,5 +45,5 @@ index 7d705d919..084b669e4 100644
static void
--
2.24.1
2.25.2

View File

@ -1 +1 @@
SHA512 (xorg-server-1.20.7.tar.bz2) = c67612e379111c28c68941c0a660abf72be7669591b41ccaa3b3474c4540a03822a28d892831b12ce08bac6e5e7e33504c2d19ef2a0c2298f83bd083459f96f5
SHA512 (xorg-server-1.20.8.tar.bz2) = ab0ec0fcbf490c61558b9297f61b58fd2dedb676c78bef6431dc9166054743b43a0091b88a8b3f4e81d1f539909440ee7e188a298cefabe13ea89159639cd805

View File

@ -45,8 +45,8 @@
Summary: X.Org X11 X server
Name: xorg-x11-server
Version: 1.20.7
Release: 2%{?gitdate:.%{gitdate}}%{?dist}
Version: 1.20.8
Release: 1%{?gitdate:.%{gitdate}}%{?dist}
URL: http://www.x.org
License: MIT
@ -92,40 +92,8 @@ Patch5: 0001-autobind-GPUs-to-the-screen.patch
# because the display-managers are not ready yet, do not upstream
Patch6: 0001-Fedora-hack-Make-the-suid-root-wrapper-always-start-.patch
# test for https://bugzilla.redhat.com/show_bug.cgi?id=1697591
# see also https://gitlab.freedesktop.org/xorg/xserver/merge_requests/36
# ofourdan> Disabling those for now, causing regressions (#1714981, #1723715)
#Patch21: 0001-modesetting-Weaksauce-atomic-property-debugging.patch
#Patch22: 0002-modesetting-Propagate-more-failure-in-drmmode_set_mo.patch
#Patch23: 0003-modesetting-Factor-out-drmmode_target_output.patch
#Patch24: 0004-modesetting-Use-atomic-instead-of-per-crtc-walks-whe.patch
# Backports from current stable "server-1.20-branch":
Patch100: 0001-configure-Define-GLAMOR_HAS_EGL_QUERY_DRIVER-when-av.patch
Patch101: 0002-modesetting-Explicitly-include-mi.h.patch
Patch102: 0003-Restrict-1x1-pixmap-filling-optimization-to-GXcopy.patch
Patch103: 0004-Revert-dri2-Don-t-make-reference-to-noClientExceptio.patch
Patch104: 0005-os-Ignore-dying-client-in-ResetCurrentRequest.patch
Patch105: 0006-xfree86-modes-Bail-from-xf86RotateRedisplay-if-pScre.patch
Patch106: 0007-modesetting-remove-unnecessary-error-message-fix-zap.patch
Patch107: 0008-glamor-Propagate-FBO-allocation-failure-for-picture-.patch
Patch108: 0009-glamor-Error-out-on-out-of-memory-when-allocating-PB.patch
Patch109: 0010-glamor-Propagate-glamor_prepare_access-failures-in-c.patch
Patch110: 0011-glamor-Fallback-to-system-memory-for-RW-PBO-buffer-a.patch
Patch111: 0012-glamor-Fix-a-compiler-warning-since-the-recent-OOM-f.patch
Patch112: 0013-modesetting-Disable-atomic-support-by-default.patch
Patch113: 0014-xwayland-Split-up-xwl_screen_post_damage-into-two-ph.patch
Patch114: 0015-xwayland-Call-glamor_block_handler-from-xwl_screen_p.patch
Patch115: 0016-xwayland-clear-pixmaps-after-creation-in-rootless-mo.patch
Patch116: 0017-xwayland-Add-xwl_window_create_frame_callback-helper.patch
Patch117: 0018-xwayland-Use-single-frame-callback-for-Present-flips.patch
Patch118: 0019-xwayland-Use-frame-callbacks-for-Present-vblank-even.patch
Patch119: 0020-Fix-building-with-fno-common.patch
Patch120: 0021-dix-Check-for-NULL-spriteInfo-in-GetPairedDevice.patch
Patch121: 0022-xwayland-glamor-gbm-Handle-DRM_FORMAT_MOD_INVALID-gr.patch
Patch122: 0001-xwayland-Delete-all-frame_callback_list-nodes-in-xwl.patch
# Backports from "master" upstream:
# Backported Xwayland randr resolution change emulation support
@ -142,10 +110,17 @@ Patch510: 0010-xwayland-Add-xwlVidModeGetCurrentRRMode-helper-to-th.patch
Patch511: 0011-xwayland-Add-vidmode-mode-changing-emulation-support.patch
Patch512: 0012-xwayland-xwl_window_should_enable_viewport-Add-extra.patch
Patch513: 0013-xwayland-Set-_XWAYLAND_RANDR_EMU_MONITOR_RECTS-prope.patch
Patch514: 0014-xwayland-Fix-emulated-modes-not-being-removed-when-s.patch
Patch515: 0015-xwayland-Call-xwl_window_check_resolution_change_emu.patch
Patch516: 0016-xwayland-Fix-setting-of-_XWAYLAND_RANDR_EMU_MONITOR_.patch
Patch517: 0017-xwayland-Remove-unnecessary-xwl_window_is_toplevel-c.patch
Patch514: 0014-xwayland-Cache-client-id-for-the-window-manager-clie.patch
Patch515: 0015-xwayland-Reuse-viewport-instead-of-recreating.patch
Patch516: 0016-xwayland-Recurse-on-finding-the-none-wm-owner.patch
Patch517: 0017-xwayland-Make-window_get_none_wm_owner-return-a-Wind.patch
Patch518: 0018-xwayland-Check-emulation-on-client-toplevel-resize.patch
Patch519: 0019-xwayland-Also-check-resolution-change-emulation-when.patch
Patch520: 0020-xwayland-Also-hook-screen-s-MoveWindow-method.patch
Patch521: 0021-xwayland-Fix-emulated-modes-not-being-removed-when-s.patch
Patch522: 0022-xwayland-Call-xwl_window_check_resolution_change_emu.patch
Patch523: 0023-xwayland-Fix-setting-of-_XWAYLAND_RANDR_EMU_MONITOR_.patch
Patch524: 0024-xwayland-Remove-unnecessary-xwl_window_is_toplevel-c.patch
BuildRequires: systemtap-sdt-devel
BuildRequires: git
@ -571,6 +546,11 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete
%changelog
* Mon Mar 30 2020 Olivier Fourdan <ofourdan@redhat.com> - 1.20.8-1
- xserver 1.20.8
- Backport latest Xwayland randr resolution change emulation support
patches.
* Wed Mar 18 2020 Olivier Fourdan <ofourdan@redhat.com> - 1.20.7-2
- Fix a crash on closing a window using Present found upstream:
https://gitlab.freedesktop.org/xorg/xserver/issues/1000

View File

@ -1,54 +0,0 @@
From patchwork Wed May 23 09:43:32 2018
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Subject: [xserver,
1/2] glamor: Always return 0 from glamor_fds_from_pixmap on error
From: =?utf-8?q?Michel_D=C3=A4nzer?= <michel@daenzer.net>
X-Patchwork-Id: 224909
Message-Id: <20180523094333.11076-1-michel@daenzer.net>
To: =?UTF-8?q?Louis-Francis=20Ratt=C3=A9-Boulianne?= <lfrb@collabora.com>,
Daniel Stone <daniels@collabora.com>
Cc: xorg-devel@lists.x.org
Date: Wed, 23 May 2018 11:43:32 +0200
From: Michel Dänzer <michel.daenzer@amd.com>
This matches what glamor_egl_fds_from_pixmap and dri3_fds_from_pixmap do
and what proc_dri3_buffers_from_pixmap expects.
Fixes: c8c276c9569b "glamor: Implement PixmapFromBuffers and
BuffersFromPixmap"
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
---
glamor/glamor.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/glamor/glamor.c b/glamor/glamor.c
index d984d20f3..e2c74d17a 100644
--- a/glamor/glamor.c
+++ b/glamor/glamor.c
@@ -836,20 +836,20 @@ glamor_fds_from_pixmap(ScreenPtr screen, PixmapPtr pixmap, int *fds,
glamor_get_screen_private(pixmap->drawable.pScreen);
if (!glamor_priv->dri3_enabled)
- return -1;
+ return 0;
switch (pixmap_priv->type) {
case GLAMOR_TEXTURE_DRM:
case GLAMOR_TEXTURE_ONLY:
if (!glamor_pixmap_ensure_fbo(pixmap, pixmap->drawable.depth == 30 ?
GL_RGB10_A2 : GL_RGBA, 0))
- return -1;
+ return 0;
return glamor_egl_fds_from_pixmap(screen, pixmap, fds,
strides, offsets,
modifier);
default:
break;
}
- return -1;
+ return 0;
}
_X_EXPORT int

View File

@ -1,58 +0,0 @@
From patchwork Wed May 23 09:43:33 2018
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Subject: [xserver, 2/2] glamor: Propagate glamor_fds_from_pixmap error in
glamor_fd_from_pixmap
From: =?utf-8?q?Michel_D=C3=A4nzer?= <michel@daenzer.net>
X-Patchwork-Id: 224910
Message-Id: <20180523094333.11076-2-michel@daenzer.net>
To: =?UTF-8?q?Louis-Francis=20Ratt=C3=A9-Boulianne?= <lfrb@collabora.com>,
Daniel Stone <daniels@collabora.com>
Cc: xorg-devel@lists.x.org
Date: Wed, 23 May 2018 11:43:33 +0200
From: Michel Dänzer <michel.daenzer@amd.com>
glamor_fds_from_pixmap returns 0 on error, but we were treating that as
success, continuing with uninitialized stride and fd values.
Also bail if the offset isn't 0, same as in dri3_fd_from_pixmap.
Fixes: c8c276c9569b "glamor: Implement PixmapFromBuffers and
BuffersFromPixmap"
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
---
glamor/glamor.c | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/glamor/glamor.c b/glamor/glamor.c
index e2c74d17a..63f0947fa 100644
--- a/glamor/glamor.c
+++ b/glamor/glamor.c
@@ -865,17 +865,15 @@ glamor_fd_from_pixmap(ScreenPtr screen,
&modifier);
/* Pixmaps with multi-planes/modifier are not supported in this interface */
- if (ret > 1) {
- while (ret > 0)
- close(fds[--ret]);
- return -1;
+ if (ret == 1 && offsets[0] == 0) {
+ *stride = strides[0];
+ *size = pixmap->drawable.height * *stride;
+ return fds[0];
}
- ret = fds[0];
- *stride = strides[0];
- *size = pixmap->drawable.height * *stride;
-
- return ret;
+ while (ret > 0)
+ close(fds[--ret]);
+ return -1;
}
_X_EXPORT int