path: root/hw/xwayland/xwayland-present.c
diff options
authorErik Kurzinger <>2020-12-03 14:57:51 -0800
committerMichel Dänzer <>2021-04-09 14:00:01 +0000
commit38e875904b039ec1889e7c81eb1d577a4f69b26d (patch)
tree59573b80a73055427a5f066d339bdf94fdae1b7f /hw/xwayland/xwayland-present.c
parentbc99dd2127f12f1aae55971c09a2792eeaa98444 (diff)
xwayland: implement pixmap_from_buffers for the eglstream backend
Provides an implementation for the pixmap_from_buffers DRI3 function for xwayland's eglstream backend. This will be used by the NVIDIA GLX driver to pass buffers from client applications to the server. These can then be presented using the PRESENT extension. To hopefully make this less error-prone, we also introduce a "type" field for this struct to distinguish between xwl_pixmaps for the new DRI3-created pixmaps and those for the existing glamor-created pixmaps. Additionally, the patch enables wnmd present mode with the eglstream backend. This involves creating a wl_buffer for the provided dma-buf before importing it into EGL and passing this to the compositor so it can be scanned out directly if possible. Since both backends now support this present mode, the HAS_PRESENT_FLIP flag is no longer needed, so it can be removed. Reviewed-by: Michel Dänzer <> Acked-by: Olivier Fourdan <> Signed-off-by: Erik Kurzinger <>
Diffstat (limited to 'hw/xwayland/xwayland-present.c')
1 files changed, 4 insertions, 1 deletions
diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c
index 666ea15e7..7ba7efc11 100644
--- a/hw/xwayland/xwayland-present.c
+++ b/hw/xwayland/xwayland-present.c
@@ -404,6 +404,9 @@ xwl_present_check_flip2(RRCrtcPtr crtc,
if (!xwl_window)
return FALSE;
+ if (!xwl_glamor_check_flip(pixmap))
+ return FALSE;
/* Can't flip if the window pixmap doesn't match the xwl_window parent
* window's, e.g. because a client redirected this window or one of its
* parents.
@@ -540,7 +543,7 @@ xwl_present_init(ScreenPtr screen)
struct xwl_screen *xwl_screen = xwl_screen_get(screen);
- if (!xwl_glamor_has_present_flip(xwl_screen))
+ if (!xwl_screen->glamor || !xwl_screen->egl_backend)
return FALSE;
if (!dixRegisterPrivateKey(&xwl_present_window_private_key, PRIVATE_WINDOW, 0))