summaryrefslogtreecommitdiffstats
path: root/src/gbm/backends/dri/gbm_dri.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gbm/backends/dri/gbm_dri.c')
-rw-r--r--src/gbm/backends/dri/gbm_dri.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/gbm/backends/dri/gbm_dri.c b/src/gbm/backends/dri/gbm_dri.c
index 9de8cb61162..ddd153a7db4 100644
--- a/src/gbm/backends/dri/gbm_dri.c
+++ b/src/gbm/backends/dri/gbm_dri.c
@@ -255,6 +255,7 @@ gbm_dri_bo_create_from_egl_image(struct gbm_device *gbm,
{
struct gbm_dri_device *dri = gbm_dri_device(gbm);
struct gbm_dri_bo *bo;
+ unsigned dri_use = 0;
(void) egl_dpy;
@@ -276,6 +277,16 @@ gbm_dri_bo_create_from_egl_image(struct gbm_device *gbm,
if (bo->image == NULL)
return NULL;
+ if (usage & GBM_BO_USE_SCANOUT)
+ dri_use |= __DRI_IMAGE_USE_SCANOUT;
+ if (usage & GBM_BO_USE_CURSOR_64X64)
+ dri_use |= __DRI_IMAGE_USE_CURSOR;
+ if (dri->image->base.version >= 2 &&
+ !dri->image->validateUsage(bo->image, dri_use)) {
+ free(bo);
+ return NULL;
+ }
+
dri->image->queryImage(bo->image, __DRI_IMAGE_ATTRIB_HANDLE,
&bo->base.base.handle.s32);
dri->image->queryImage(bo->image, __DRI_IMAGE_ATTRIB_STRIDE,