egl/drm: Use modifiers for backbuffer creation
authorBen Widawsky <ben@bwidawsk.net>
Tue, 14 Mar 2017 01:19:00 +0000 (18:19 -0700)
committerBen Widawsky <ben@bwidawsk.net>
Wed, 15 Mar 2017 17:36:05 +0000 (10:36 -0700)
Split into a separate patch from the previous patch as requested by
Emil.

Requested-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/egl/drivers/dri2/platform_drm.c

index e5e8c6059632ca14ff0beab82e603c1307a20177..cf35ce8a1f2eb813ff8e31f87bbca3a26044a72e 100644 (file)
@@ -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;