summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Fourdan <ofourdan@redhat.com>2023-04-07 11:05:33 +0200
committerOlivier Fourdan <ofourdan@redhat.com>2023-04-12 10:44:25 +0200
commit8f7279ade26961ae790a3345ce11a239c842c773 (patch)
tree1b52bb76ba00bb86ab39dd388c606c82e6d62fb8
parent967ad0fa1e6b249aef1c21913234c25f97966e98 (diff)
downloadxserver-8f7279ade26961ae790a3345ce11a239c842c773.tar.gz
xwayland: Use the new API to set scanout
If the format and modifiers are from a tranche which supports scanout, we can set the corresponding flag to gbm_bo_create_with_modifiers2() to benefit from scanout buffers where applicable. Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
-rw-r--r--hw/xwayland/xwayland-glamor-gbm.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/hw/xwayland/xwayland-glamor-gbm.c b/hw/xwayland/xwayland-glamor-gbm.c
index 37633ec96..4086e78ba 100644
--- a/hw/xwayland/xwayland-glamor-gbm.c
+++ b/hw/xwayland/xwayland-glamor-gbm.c
@@ -296,10 +296,14 @@ xwl_glamor_gbm_create_pixmap_internal(struct xwl_screen *xwl_screen,
if (xwl_gbm->dmabuf_capable) {
uint32_t num_modifiers = 0;
uint64_t *modifiers = NULL;
+ Bool supports_scanout = FALSE;
if (drawable) {
- xwl_glamor_get_drawable_modifiers(drawable, format,
- &num_modifiers, &modifiers);
+ xwl_glamor_get_drawable_modifiers_and_scanout(drawable,
+ format,
+ &num_modifiers,
+ &modifiers,
+ &supports_scanout);
}
if (num_modifiers == 0) {
@@ -309,9 +313,12 @@ xwl_glamor_gbm_create_pixmap_internal(struct xwl_screen *xwl_screen,
if (num_modifiers > 0) {
#ifdef GBM_BO_WITH_MODIFIERS2
+ uint32_t usage = GBM_BO_USE_RENDERING;
+ if (supports_scanout)
+ usage |= GBM_BO_USE_SCANOUT;
bo = gbm_bo_create_with_modifiers2(xwl_gbm->gbm, width, height,
format, modifiers, num_modifiers,
- GBM_BO_USE_RENDERING);
+ usage);
#else
bo = gbm_bo_create_with_modifiers(xwl_gbm->gbm, width, height,
format, modifiers, num_modifiers);