[Mesa-dev] [PATCH 4/6] egl/drm: Use modifiers for backbuffer creation
Ben Widawsky
ben at bwidawsk.net
Tue Mar 14 05:24:39 UTC 2017
Split into a separate patch from the previous patch as requested by
Emil.
Requeted-by: Emil Velikov <emil.velikov at collabora.com>
Signed-off-by: Ben Widawsky <ben at bwidawsk.net>
---
src/egl/drivers/dri2/platform_drm.c | 19 +++++++++++++++----
1 file changed, 15 insertions(+), 4 deletions(-)
diff --git a/src/egl/drivers/dri2/platform_drm.c b/src/egl/drivers/dri2/platform_drm.c
index e5e8c60596..cf35ce8a1f 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;
--
2.12.0
More information about the mesa-dev
mailing list