[Mesa-dev] [PATCH 2/3] Create untiled buffers in get_back_bo when needed.

Axel Davy axel.davy at ens.fr
Thu Nov 7 08:13:37 PST 2013


We must send to the compositor buffer it is able to read.

Since tiling modes are different on graphic cards, we have
to disable tiling when creating the buffers if we render
with a different graphic card than the compositor.

Signed-off-by: Axel Davy <axel.davy at ens.fr>
---
 src/egl/drivers/dri2/platform_wayland.c | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c
index 709df36..b922ff5 100644
--- a/src/egl/drivers/dri2/platform_wayland.c
+++ b/src/egl/drivers/dri2/platform_wayland.c
@@ -283,12 +283,17 @@ get_back_bo(struct dri2_egl_surface *dri2_surf, __DRIbuffer *buffer)
    if (dri2_surf->back == NULL)
       return -1;
    if (dri2_surf->back->dri_image == NULL) {
-      dri2_surf->back->dri_image = 
-         dri2_dpy->image->createImage(dri2_dpy->dri_screen,
-                                      dri2_surf->base.Width,
-                                      dri2_surf->base.Height,
-                                      __DRI_IMAGE_FORMAT_ARGB8888,
-                                      __DRI_IMAGE_USE_SHARE,
+      unsigned int use_flags = __DRI_IMAGE_USE_SHARE;
+
+      if (!dri2_dpy->enable_tiling)
+         use_flags |= __DRI_IMAGE_USE_LINEAR;
+
+       dri2_surf->back->dri_image = 
+          dri2_dpy->image->createImage(dri2_dpy->dri_screen,
+                                       dri2_surf->base.Width,
+                                       dri2_surf->base.Height,
+                                       __DRI_IMAGE_FORMAT_ARGB8888,
+                                      use_flags,
                                       NULL);
       dri2_surf->back->age = 0;
    }
-- 
1.8.1.2



More information about the mesa-dev mailing list