diff options
author | Olivier Fourdan <ofourdan@redhat.com> | 2023-03-22 10:37:52 +0100 |
---|---|---|
committer | Olivier Fourdan <ofourdan@redhat.com> | 2023-04-03 11:46:15 +0200 |
commit | 111d318fc2262c03c289be172696264622e50156 (patch) | |
tree | c230fa4358e471d4956fed677a90ae33ab841a89 /hw/xwayland | |
parent | 9730fb64ea05c620c90a23eb9999128e43752ec1 (diff) |
xwayland: Create scanout capable BO with the fallback path
Before linux_dmabuf v4 support was added, the BO were created using
gbm_bo_create_with_modifiers() which incidentally creates scanout
capable buffers.
We now need to replicate that explicitly when using the fallback path,
with buffers window, otherwise direct scanout will not be possible in
that case.
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1535
Suggested-by: Michel Dänzer <mdaenzer@redhat.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Diffstat (limited to 'hw/xwayland')
-rw-r--r-- | hw/xwayland/xwayland-glamor-gbm.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/hw/xwayland/xwayland-glamor-gbm.c b/hw/xwayland/xwayland-glamor-gbm.c index 1474eb15d..83318fe62 100644 --- a/hw/xwayland/xwayland-glamor-gbm.c +++ b/hw/xwayland/xwayland-glamor-gbm.c @@ -278,7 +278,8 @@ static PixmapPtr xwl_glamor_gbm_create_pixmap_internal(struct xwl_screen *xwl_screen, DrawablePtr drawable, int width, int height, int depth, - unsigned int hint) + unsigned int hint, + Bool implicit_scanout) { struct xwl_gbm_private *xwl_gbm = xwl_gbm_get(xwl_screen); struct gbm_bo *bo = NULL; @@ -313,9 +314,11 @@ xwl_glamor_gbm_create_pixmap_internal(struct xwl_screen *xwl_screen, } #endif if (bo == NULL) { + uint32_t usage = GBM_BO_USE_RENDERING; implicit = TRUE; - bo = gbm_bo_create(xwl_gbm->gbm, width, height, format, - GBM_BO_USE_RENDERING); + if (implicit_scanout) + usage |= GBM_BO_USE_SCANOUT; + bo = gbm_bo_create(xwl_gbm->gbm, width, height, format, usage); } if (bo) { @@ -342,21 +345,19 @@ xwl_glamor_gbm_create_pixmap(ScreenPtr screen, unsigned int hint) { return xwl_glamor_gbm_create_pixmap_internal(xwl_screen_get(screen), NULL, - width, height, depth, hint); + width, height, depth, hint, FALSE); } static PixmapPtr xwl_glamor_gbm_create_pixmap_for_window(struct xwl_window *xwl_window) { - if (xwl_window->window == NullWindow) - return NullPixmap; - return xwl_glamor_gbm_create_pixmap_internal(xwl_window->xwl_screen, &xwl_window->window->drawable, xwl_window->window->drawable.width, xwl_window->window->drawable.height, xwl_window->window->drawable.depth, - CREATE_PIXMAP_USAGE_BACKING_PIXMAP); + CREATE_PIXMAP_USAGE_BACKING_PIXMAP, + xwl_window->has_implicit_scanout_support); } static Bool |