From 6b3a289ab50285049d1aaa8c40878c5364a981ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Thu, 23 May 2024 15:52:53 +0200 Subject: [PATCH] wayland/drm-syncobj: Check for sync-fd cogl feature The syncobj implementation uses cogl_context_get_latest_sync_fd(), so check that that function will actually work. Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3475 Part-of: --- src/wayland/meta-wayland-linux-drm-syncobj.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/wayland/meta-wayland-linux-drm-syncobj.c b/src/wayland/meta-wayland-linux-drm-syncobj.c index a922415d9..76c9373ef 100644 --- a/src/wayland/meta-wayland-linux-drm-syncobj.c +++ b/src/wayland/meta-wayland-linux-drm-syncobj.c @@ -465,6 +465,13 @@ meta_wayland_drm_syncobj_manager_new (MetaWaylandCompositor *compositor, g_assert (backend && egl && clutter_backend && cogl_context && egl_display); + if (!cogl_has_feature (cogl_context, COGL_FEATURE_ID_SYNC_FD)) + { + g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, + "Missing 'EGL_ANDROID_native_fence_sync'"); + return NULL; + } + if (!meta_egl_query_display_attrib (egl, egl_display, EGL_DEVICE_EXT, &attrib, error))