From: Ben Widawsky Date: Tue, 14 Mar 2017 01:19:00 +0000 (-0700) Subject: egl/drm: Use modifiers for backbuffer creation X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=191ff914a2c77d7d982048ef21422a209e1e7e06;p=mesa.git 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 --- 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;