diff options
author | Robert Mader <robert.mader@collabora.com> | 2023-05-07 21:59:48 +0200 |
---|---|---|
committer | Robert Mader <robert.mader@collabora.com> | 2023-05-07 23:16:37 +0200 |
commit | 2dd519626793c2b308d46914425cf56cf8bcaa2d (patch) | |
tree | 3b2af5e951c345c93268fee53aa3f4d71dd08543 | |
parent | 29ec2d2e20eca56e4280956b3c6848bd3f6d23cc (diff) | |
download | mutter-2dd519626793c2b308d46914425cf56cf8bcaa2d.tar.gz |
egl: Set EGL_IMAGE_PRESERVED_KHR on DMABUF import
Otherwise drivers would be free to alter the buffer content. While no
driver is known to do so, it's probably good to make things explicit.
See also `import_simple_dmabuf()` in Weston.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2990>
-rw-r--r-- | src/backends/meta-egl.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/backends/meta-egl.c b/src/backends/meta-egl.c index 07e46812d..06a1661f2 100644 --- a/src/backends/meta-egl.c +++ b/src/backends/meta-egl.c @@ -609,7 +609,7 @@ meta_egl_create_dmabuf_image (MetaEgl *egl, const uint64_t *modifiers, GError **error) { - EGLint attribs[37]; + EGLint attribs[39]; int atti = 0; /* This requires the Mesa commit in @@ -626,6 +626,8 @@ meta_egl_create_dmabuf_image (MetaEgl *egl, attribs[atti++] = height; attribs[atti++] = EGL_LINUX_DRM_FOURCC_EXT; attribs[atti++] = drm_format; + attribs[atti++] = EGL_IMAGE_PRESERVED_KHR; + attribs[atti++] = EGL_TRUE; if (n_planes > 0) { |