summaryrefslogtreecommitdiff
path: root/hw/xwayland/xwayland-glamor.c
diff options
context:
space:
mode:
authorOlivier Fourdan <ofourdan@redhat.com>2023-03-28 17:54:46 +0200
committerOlivier Fourdan <ofourdan@redhat.com>2023-04-03 11:46:15 +0200
commit1ac3dd77d5adbcc0eb4365b2ff08460826ec1be1 (patch)
tree7af72317d7394b1b6ce852acb011cf98e5fd2b80 /hw/xwayland/xwayland-glamor.c
parenta4c700231dfbd20a7d48b64ff64e8cc40a6c22bc (diff)
xwayland: Add a direct hook to create pixmaps with glamor
With linux dmabuf v4 support, for direct scanout support, we need more context that just what CreatePixmap() provides, as we need the actual drawable to invoke xwl_glamor_get_drawable_modifiers(). Add a specific hook in Xwayland's glamor implementation that we can use for that purpose. This is preparation work for the direct scanout fixes. Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Diffstat (limited to 'hw/xwayland/xwayland-glamor.c')
-rw-r--r--hw/xwayland/xwayland-glamor.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/hw/xwayland/xwayland-glamor.c b/hw/xwayland/xwayland-glamor.c
index af227bb03..b714f9be0 100644
--- a/hw/xwayland/xwayland-glamor.c
+++ b/hw/xwayland/xwayland-glamor.c
@@ -919,6 +919,20 @@ xwl_glamor_needs_n_buffering(struct xwl_screen *xwl_screen)
XWL_EGL_BACKEND_NEEDS_N_BUFFERING);
}
+PixmapPtr
+xwl_glamor_create_pixmap_for_window(struct xwl_window *xwl_window)
+{
+ struct xwl_screen *xwl_screen = xwl_window->xwl_screen;
+
+ if (!xwl_screen->glamor || !xwl_screen->egl_backend)
+ return NullPixmap;
+
+ if (xwl_screen->egl_backend->create_pixmap_for_window)
+ return xwl_screen->egl_backend->create_pixmap_for_window(xwl_window);
+ else
+ return NullPixmap;
+}
+
void
xwl_glamor_init_backends(struct xwl_screen *xwl_screen, Bool use_eglstream)
{