egl: Use gbm_bo_create_with_modifiers2() when the surface has non-zero flags

We need to pass the flags around when creating a BO for a surface that
has explicit flags set.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27109>
This commit is contained in:
Boris Brezillon
2023-11-06 16:34:00 +01:00
committed by Marge Bot
parent d1c22c678c
commit c8bf321bf8

View File

@@ -238,7 +238,12 @@ get_back_bo(struct dri2_egl_surface *dri2_surf)
if (dri2_surf->back == NULL)
return -1;
if (dri2_surf->back->bo == NULL) {
if (surf->base.v0.modifiers)
if (surf->base.v0.modifiers && surf->base.v0.flags)
dri2_surf->back->bo = gbm_bo_create_with_modifiers2(
&dri2_dpy->gbm_dri->base, surf->base.v0.width, surf->base.v0.height,
surf->base.v0.format, surf->base.v0.modifiers, surf->base.v0.count,
surf->base.v0.flags);
else if (surf->base.v0.modifiers)
dri2_surf->back->bo = gbm_bo_create_with_modifiers(
&dri2_dpy->gbm_dri->base, surf->base.v0.width, surf->base.v0.height,
surf->base.v0.format, surf->base.v0.modifiers, surf->base.v0.count);