glamor: use GBM_BO_USE_RENDERING for importing gbm bo's

Inspired by 421ce458f1

Glamor should use GBM_BO_USE_RENDERING, since they are image buffers.
This change is mostly cosmetic, as mesa doesn't do anything with
this flag, other than a sanity check.
See: https://gitlab.freedesktop.org/mesa/mesa/-/issues/14130

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
This commit is contained in:
stefan11111
2025-10-31 15:07:54 +02:00
committed by Enrico Weigelt
parent cf105bc990
commit 09d35f1e0d

View File

@@ -501,7 +501,7 @@ glamor_gbm_bo_from_pixmap_internal(ScreenPtr screen, PixmapPtr pixmap)
return NULL; return NULL;
return gbm_bo_import(glamor_egl->gbm, GBM_BO_IMPORT_EGL_IMAGE, return gbm_bo_import(glamor_egl->gbm, GBM_BO_IMPORT_EGL_IMAGE,
pixmap_priv->image, 0); pixmap_priv->image, GBM_BO_USE_RENDERING);
} }
struct gbm_bo * struct gbm_bo *
@@ -686,7 +686,8 @@ glamor_back_pixmap_from_fd(PixmapPtr pixmap,
import_data.width = width; import_data.width = width;
import_data.height = height; import_data.height = height;
import_data.stride = stride; import_data.stride = stride;
bo = gbm_bo_import(glamor_egl->gbm, GBM_BO_IMPORT_FD, &import_data, 0); bo = gbm_bo_import(glamor_egl->gbm, GBM_BO_IMPORT_FD, &import_data,
GBM_BO_USE_RENDERING);
if (!bo) if (!bo)
return FALSE; return FALSE;
@@ -732,7 +733,8 @@ glamor_pixmap_from_fds(ScreenPtr screen,
import_data.strides[i] = strides[i]; import_data.strides[i] = strides[i];
import_data.offsets[i] = offsets[i]; import_data.offsets[i] = offsets[i];
} }
bo = gbm_bo_import(glamor_egl->gbm, GBM_BO_IMPORT_FD_MODIFIER, &import_data, 0); bo = gbm_bo_import(glamor_egl->gbm, GBM_BO_IMPORT_FD_MODIFIER, &import_data,
GBM_BO_USE_RENDERING);
if (bo) { if (bo) {
screen->ModifyPixmapHeader(pixmap, width, height, 0, 0, strides[0], NULL); screen->ModifyPixmapHeader(pixmap, width, height, 0, 0, strides[0], NULL);
ret = glamor_egl_create_textured_pixmap_from_gbm_bo(pixmap, bo, TRUE); ret = glamor_egl_create_textured_pixmap_from_gbm_bo(pixmap, bo, TRUE);