[mutter] dma-buf: Mark DMA-BUF textures as paint-only



commit 61e51cdef612253250c27d3769c7c0b9ffdd0ffc
Author: Jonas Ã…dahl <jadahl gmail com>
Date:   Tue Jul 16 18:30:12 2019 +0200

    dma-buf: Mark DMA-BUF textures as paint-only
    
    Reading pixels directly from a texture imported from a DMA-BUF EGLImage
    may result compressed textures to be transferred into non-compressed
    texture. This may have side effects causing it to be rendered
    incorrectly in subsequent paints.
    
    Avoid this by passing the no-get-data flag to the texture creator
    function, eventually causing mutter to use an intermediate offscreen
    framebuffer when reading pixels from such textures.
    
    https://bugs.freedesktop.org/show_bug.cgi?id=111140
    https://gitlab.freedesktop.org/xorg/xserver/issues/545
    
    https://gitlab.gnome.org/GNOME/mutter/merge_requests/687

 src/backends/native/meta-renderer-native.c | 2 +-
 src/wayland/meta-wayland-dma-buf.c         | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/backends/native/meta-renderer-native.c b/src/backends/native/meta-renderer-native.c
index b491a54f8..e468fc321 100644
--- a/src/backends/native/meta-renderer-native.c
+++ b/src/backends/native/meta-renderer-native.c
@@ -1920,7 +1920,7 @@ copy_shared_framebuffer_primary_gpu (CoglOnscreen                        *onscre
       return FALSE;
     }
 
-  flags = COGL_EGL_IMAGE_FLAG_NONE;
+  flags = COGL_EGL_IMAGE_FLAG_NO_GET_DATA;
   cogl_tex = cogl_egl_texture_2d_new_from_image (cogl_context,
                                                  dumb_fb->width,
                                                  dumb_fb->height,
diff --git a/src/wayland/meta-wayland-dma-buf.c b/src/wayland/meta-wayland-dma-buf.c
index 08045cfda..e672749e4 100644
--- a/src/wayland/meta-wayland-dma-buf.c
+++ b/src/wayland/meta-wayland-dma-buf.c
@@ -135,7 +135,7 @@ meta_wayland_dma_buf_realize_texture (MetaWaylandBuffer  *buffer,
   if (egl_image == EGL_NO_IMAGE_KHR)
     return FALSE;
 
-  flags = COGL_EGL_IMAGE_FLAG_NONE;
+  flags = COGL_EGL_IMAGE_FLAG_NO_GET_DATA;
   texture = cogl_egl_texture_2d_new_from_image (cogl_context,
                                                 dma_buf->width,
                                                 dma_buf->height,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]