wayland/dma-buf: Only try to query KMS device on native backend

This fixes a crash when using the nested backend and DMA buf Wayland
clients.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2553>
This commit is contained in:
Jonas Ådahl 2022-08-04 08:09:23 +02:00
parent d3a7e9a7b5
commit a07fd4ee66

View File

@ -152,12 +152,15 @@ static GQuark quark_dma_buf_surface_feedback;
static gboolean
should_send_modifiers (MetaBackend *backend)
{
MetaRenderer *renderer = meta_backend_get_renderer (backend);
MetaRendererNative *renderer_native = META_RENDERER_NATIVE (renderer);
MetaRendererNative *renderer_native;
MetaGpuKms *gpu_kms;
MetaKmsDevice *kms_device;
MetaKmsDeviceFlag flags;
if (!META_IS_BACKEND_NATIVE (backend))
return FALSE;
renderer_native = META_RENDERER_NATIVE (meta_backend_get_renderer (backend));
gpu_kms = meta_renderer_native_get_primary_gpu (renderer_native);
kms_device = meta_gpu_kms_get_kms_device (gpu_kms);