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
This commit is contained in:
Jonas Ådahl 2019-07-16 18:30:12 +02:00 committed by Georges Basile Stavracas Neto
parent 7868ab761f
commit 61e51cdef6
2 changed files with 2 additions and 2 deletions

View File

@ -1920,7 +1920,7 @@ copy_shared_framebuffer_primary_gpu (CoglOnscreen *onscre
return FALSE; 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, cogl_tex = cogl_egl_texture_2d_new_from_image (cogl_context,
dumb_fb->width, dumb_fb->width,
dumb_fb->height, dumb_fb->height,

View File

@ -135,7 +135,7 @@ meta_wayland_dma_buf_realize_texture (MetaWaylandBuffer *buffer,
if (egl_image == EGL_NO_IMAGE_KHR) if (egl_image == EGL_NO_IMAGE_KHR)
return FALSE; 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, texture = cogl_egl_texture_2d_new_from_image (cogl_context,
dma_buf->width, dma_buf->width,
dma_buf->height, dma_buf->height,