summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Mader <robert.mader@collabora.com>2023-04-20 15:27:44 +0200
committerMarge Bot <marge-bot@gnome.org>2023-04-20 15:34:00 +0000
commit754a1a1ce67cf697ccccf979142de372ab47a3b2 (patch)
treec3f46f36e1712f7b289b44df7fa8d8e88759ac12
parent04fa926eea08b2c83c1cb22ca3b5fda3f1148878 (diff)
downloadmutter-754a1a1ce67cf697ccccf979142de372ab47a3b2.tar.gz
wayland/dma-buf: Enable modifiers by default on non-native backend
If the used EGL backend supports it. In practice this should currently only affect the nested backend. Enabling modifiers can help with app development. An example is `weston-simple-dmabuf-v4l`, which requires the linear modifier to be available. Note that Weston behaves similar already. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2972>
-rw-r--r--src/wayland/meta-wayland-dma-buf.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/wayland/meta-wayland-dma-buf.c b/src/wayland/meta-wayland-dma-buf.c
index 4b44ada75..950591c5e 100644
--- a/src/wayland/meta-wayland-dma-buf.c
+++ b/src/wayland/meta-wayland-dma-buf.c
@@ -157,7 +157,20 @@ should_send_modifiers (MetaBackend *backend)
MetaGpuKms *gpu_kms;
if (!META_IS_BACKEND_NATIVE (backend))
- return FALSE;
+ {
+ MetaEgl *egl = meta_backend_get_egl (backend);
+ ClutterBackend *clutter_backend =
+ meta_backend_get_clutter_backend (backend);
+ CoglContext *cogl_context =
+ clutter_backend_get_cogl_context (clutter_backend);
+ EGLDisplay egl_display = cogl_egl_context_get_egl_display (cogl_context);
+
+ return meta_egl_has_extensions (egl,
+ egl_display,
+ NULL,
+ "EGL_EXT_image_dma_buf_import_modifiers",
+ NULL);
+ }
renderer_native = META_RENDERER_NATIVE (meta_backend_get_renderer (backend));
gpu_kms = meta_renderer_native_get_primary_gpu (renderer_native);