mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-02-15 13:50:33 +01:00
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>
(cherry picked from commit 8f7279ade2)
This commit is contained in:
parent
1f5cdc9cf1
commit
73e0510dee
1 changed files with 10 additions and 3 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue