From 754a1a1ce67cf697ccccf979142de372ab47a3b2 Mon Sep 17 00:00:00 2001 From: Robert Mader Date: Thu, 20 Apr 2023 15:27:44 +0200 Subject: [PATCH] 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: --- src/wayland/meta-wayland-dma-buf.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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);