From bc9bf563603c4cd22e30448cb03c20a6a86b0364 Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Tue, 18 Jun 2024 14:02:03 +0200 Subject: [PATCH] xwayland/window-buffers: Set syncpnts for all pixmaps The wp_linux_drm_syncobj_v1 protocol states that : | If at surface commit time there is a pending buffer attached but no | pending release timeline point set, the no_release_point protocol | error is raised. So we need to set a release timeline point in any case from the swap pixmap routine, even for the early out code paths. Failing to do so may cause a Wayland protocol error that is fatal to the Wayland client, in this case Xwayland: | wp_linux_drm_syncobj_surface_v1: error 4: No Acquire point provided | (EE) failed to dispatch Wayland events: Protocol error Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1688 Fixes: 87bf2cafcc - xwayland: add support for wp_linux_drm_syncobj_v1 Signed-off-by: Olivier Fourdan Part-of: --- hw/xwayland/xwayland-window-buffers.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hw/xwayland/xwayland-window-buffers.c b/hw/xwayland/xwayland-window-buffers.c index ad2cef156..8c8475c0b 100644 --- a/hw/xwayland/xwayland-window-buffers.c +++ b/hw/xwayland/xwayland-window-buffers.c @@ -414,6 +414,8 @@ xwl_window_swap_pixmap(struct xwl_window *xwl_window, Bool handle_sync) if (xwl_is_client_pixmap(window_pixmap)) { xwl_window_buffer->pixmap = NULL; xwl_window_buffer_maybe_dispose(xwl_window_buffer); + if (handle_sync) + xwl_window_handle_pixmap_sync(xwl_window, window_pixmap, NULL); return window_pixmap; } } else { @@ -424,8 +426,11 @@ xwl_window_swap_pixmap(struct xwl_window *xwl_window, Bool handle_sync) window_pixmap->refcnt++; xwl_window_realloc_pixmap(xwl_window); - if (!xwl_window_buffer) + if (!xwl_window_buffer) { + if (handle_sync) + xwl_window_handle_pixmap_sync(xwl_window, window_pixmap, NULL); return window_pixmap; + } } xwl_window_buffer->pixmap = window_pixmap;