From 191ff914a2c77d7d982048ef21422a209e1e7e06 Mon Sep 17 00:00:00 2001 From: Ben Widawsky Date: Mon, 13 Mar 2017 18:19:00 -0700 Subject: [PATCH] egl/drm: Use modifiers for backbuffer creation Split into a separate patch from the previous patch as requested by Emil. Requested-by: Emil Velikov Signed-off-by: Ben Widawsky Reviewed-by: Jason Ekstrand --- 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 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; -- 2.30.2