[Mesa-dev] [PATCH] egl/wayland: Set __DRI_IMAGE_USE_SCANOUT for shared buffers

Michel Dänzer michel at daenzer.net
Wed Jan 27 01:34:38 PST 2016


From: Michel Dänzer <michel.daenzer at amd.com>

The compositor may have the hardware scan out directly from the buffers
sent by the client, so we must make sure the buffers we create are
suitable for scanout.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93866
Cc: 11.0 11.1 <mesa-stable at lists.freedesktop.org>
Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
---
 src/egl/drivers/dri2/platform_wayland.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c
index c2438f7..7ee5e21 100644
--- a/src/egl/drivers/dri2/platform_wayland.c
+++ b/src/egl/drivers/dri2/platform_wayland.c
@@ -360,6 +360,7 @@ get_back_bo(struct dri2_egl_surface *dri2_surf)
                                       dri2_surf->base.Height,
                                       dri_image_format,
                                       __DRI_IMAGE_USE_SHARE |
+                                      __DRI_IMAGE_USE_SCANOUT |
                                       __DRI_IMAGE_USE_LINEAR,
                                       NULL);
       if (dri2_surf->back->linear_copy == NULL)
@@ -372,8 +373,9 @@ get_back_bo(struct dri2_egl_surface *dri2_surf)
                                       dri2_surf->base.Width,
                                       dri2_surf->base.Height,
                                       dri_image_format,
-                                      dri2_dpy->is_different_gpu ?
-                                         0 : __DRI_IMAGE_USE_SHARE,
+                                      dri2_dpy->is_different_gpu ? 0 :
+                                      __DRI_IMAGE_USE_SHARE |
+                                      __DRI_IMAGE_USE_SCANOUT,
                                       NULL);
       dri2_surf->back->age = 0;
    }
-- 
2.7.0.rc3



More information about the mesa-dev mailing list