aboutsummaryrefslogtreecommitdiffstats
path: root/src/egl/drivers/dri2/platform_drm.c
diff options
context:
space:
mode:
authorBen Widawsky <[email protected]>2017-03-13 18:19:00 -0700
committerBen Widawsky <[email protected]>2017-03-15 10:36:05 -0700
commit191ff914a2c77d7d982048ef21422a209e1e7e06 (patch)
tree66643e840fdadf0b2aec2d12510e2f4629614a29 /src/egl/drivers/dri2/platform_drm.c
parent63bd2ae7452d48f25962ae9985a34bbdba9c52cf (diff)
egl/drm: Use modifiers for backbuffer creation
Split into a separate patch from the previous patch as requested by Emil. Requested-by: Emil Velikov <[email protected]> Signed-off-by: Ben Widawsky <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/egl/drivers/dri2/platform_drm.c')
-rw-r--r--src/egl/drivers/dri2/platform_drm.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/egl/drivers/dri2/platform_drm.c b/src/egl/drivers/dri2/platform_drm.c
index e5e8c605963..cf35ce8a1f2 100644
--- a/src/egl/drivers/dri2/platform_drm.c
+++ b/src/egl/drivers/dri2/platform_drm.c
@@ -230,10 +230,21 @@ get_back_bo(struct dri2_egl_surface *dri2_surf)
if (dri2_surf->back == NULL)
return -1;
- if (dri2_surf->back->bo == NULL)
- dri2_surf->back->bo = gbm_bo_create(&dri2_dpy->gbm_dri->base.base,
- surf->base.width, surf->base.height,
- surf->base.format, surf->base.flags);
+ if (dri2_surf->back->bo == NULL) {
+ if (surf->base.modifiers)
+ dri2_surf->back->bo = gbm_bo_create_with_modifiers(&dri2_dpy->gbm_dri->base.base,
+ surf->base.width, surf->base.height,
+ surf->base.format,
+ surf->base.modifiers,
+ surf->base.count);
+ else
+ dri2_surf->back->bo = gbm_bo_create(&dri2_dpy->gbm_dri->base.base,
+ surf->base.width,
+ surf->base.height,
+ surf->base.format,
+ surf->base.flags);
+
+ }
if (dri2_surf->back->bo == NULL)
return -1;