[mutter] wayland/dma-buf: Always send modifiers when using surfaceless



commit 1d4cdd1eb5592b2374c99d165960594fccfebcce
Author: Jonas Ã…dahl <jadahl gmail com>
Date:   Wed Aug 17 12:29:40 2022 +0200

    wayland/dma-buf: Always send modifiers when using surfaceless
    
    We'll never scan out, which is why ADDFB2 is required otherwise, and we
    won't enable the DMA buffer extension if
    'EGL_EXT_image_dma_buf_import_modifiers' is missing, so send modifiers
    in this case.
    
    This also happens to avoid crashing when the GPU is null, since we'd
    otherwise attempt to dereference it.
    
    Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2578>

 src/wayland/meta-wayland-dma-buf.c | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/src/wayland/meta-wayland-dma-buf.c b/src/wayland/meta-wayland-dma-buf.c
index 289e255524..0f6f6be02b 100644
--- a/src/wayland/meta-wayland-dma-buf.c
+++ b/src/wayland/meta-wayland-dma-buf.c
@@ -162,6 +162,9 @@ should_send_modifiers (MetaBackend *backend)
 
   renderer_native = META_RENDERER_NATIVE (meta_backend_get_renderer (backend));
   gpu_kms = meta_renderer_native_get_primary_gpu (renderer_native);
+  if (!gpu_kms)
+    return TRUE;
+
   kms_device = meta_gpu_kms_get_kms_device (gpu_kms);
 
   flags = meta_kms_device_get_flags (kms_device);


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