diff options
author | Olivier Fourdan <ofourdan@redhat.com> | 2023-03-28 18:01:06 +0200 |
---|---|---|
committer | Olivier Fourdan <ofourdan@redhat.com> | 2023-04-03 11:46:15 +0200 |
commit | 684580d06f9ea0724d4da9a4876509909b0fa791 (patch) | |
tree | 032b63dab00b3d8a02533a93c76786fd68d02c2b | |
parent | 111d318fc2262c03c289be172696264622e50156 (diff) | |
download | xserver-684580d06f9ea0724d4da9a4876509909b0fa791.tar.gz |
xwayland: Try the Xwayland glamor hook to create pixmaps
When creating the window buffer's backing pixmap, try the Xwayland
glamor hook first and fallback to the regular CreatePixmap() code path
otherwise.
That allows to enable direct scanout if possible, either through the
regular dmabuf v4 code path, or from the implicit fallback code path.
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
-rw-r--r-- | hw/xwayland/xwayland-window-buffers.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/hw/xwayland/xwayland-window-buffers.c b/hw/xwayland/xwayland-window-buffers.c index f04c79a8a..f7bb571bb 100644 --- a/hw/xwayland/xwayland-window-buffers.c +++ b/hw/xwayland/xwayland-window-buffers.c @@ -328,12 +328,19 @@ xwl_window_buffers_get_pixmap(struct xwl_window *xwl_window, pBox++; } } else { +#ifdef XWL_HAS_GLAMOR + /* Try the xwayland/glamor direct hook first */ xwl_window_buffer->pixmap = - (*xwl_screen->screen->CreatePixmap) (window_pixmap->drawable.pScreen, - window_pixmap->drawable.width, - window_pixmap->drawable.height, - window_pixmap->drawable.depth, - CREATE_PIXMAP_USAGE_BACKING_PIXMAP); + xwl_glamor_create_pixmap_for_window(xwl_window); +#endif /* XWL_HAS_GLAMOR */ + if (!xwl_window_buffer->pixmap) { + xwl_window_buffer->pixmap = + (*xwl_screen->screen->CreatePixmap) (window_pixmap->drawable.pScreen, + window_pixmap->drawable.width, + window_pixmap->drawable.height, + window_pixmap->drawable.depth, + CREATE_PIXMAP_USAGE_BACKING_PIXMAP); + } if (!xwl_window_buffer->pixmap) return window_pixmap; |