glamor: use gbm_bo_create_with_modifiers2()

This allows us to pass flags to the function, avoiding the forced
implicit GBM_BO_USE_SCANOUT which happens with the older version.

Backport from Xwayland:
f31ca9238f

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
This commit is contained in:
stefan11111 2025-07-15 23:52:46 +03:00 • committed by Enrico Weigelt
commit e6885d7e8b

View file

@ -391,9 +391,16 @@ glamor_make_pixmap_exportable(PixmapPtr pixmap, Bool modifiers_ok)
glamor_get_modifiers(screen, format, &num_modifiers, &modifiers);
if (num_modifiers > 0)
if (num_modifiers > 0) {
#ifdef GBM_BO_WITH_MODIFIERS2
bo = gbm_bo_create_with_modifiers2(glamor_egl->gbm, width, height,
format, modifiers, num_modifiers,
GBM_BO_USE_RENDERING | GBM_BO_USE_SCANOUT);
#else
bo = gbm_bo_create_with_modifiers(glamor_egl->gbm, width, height,
format, modifiers, num_modifiers);
#endif
}
if (bo)
used_modifiers = TRUE;
free(modifiers);