From 1d4cdd1eb5592b2374c99d165960594fccfebcce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Wed, 17 Aug 2022 12:29:40 +0200 Subject: [PATCH] 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: --- 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 289e25552..0f6f6be02 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);