From 49800f024d7d90bc19992ebf2dc79fc7108f9bce Mon Sep 17 00:00:00 2001 From: stefan11111 Date: Tue, 27 Jan 2026 05:49:05 +0200 Subject: [PATCH] kdrive/fbdev/fb_glamor.c: Check for egl extensions properly See: https://gitlab.freedesktop.org/mesa/mesa/-/issues/14715 Signed-off-by: stefan11111 --- hw/kdrive/fbdev/fb_glamor.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/hw/kdrive/fbdev/fb_glamor.c b/hw/kdrive/fbdev/fb_glamor.c index beb5e24b24..5a0f81fb41 100644 --- a/hw/kdrive/fbdev/fb_glamor.c +++ b/hw/kdrive/fbdev/fb_glamor.c @@ -145,8 +145,9 @@ fbdev_glamor_query_devices_ext(EGLDeviceEXT **devices, EGLint *num_devices) *devices = NULL; *num_devices = 0; - if (!epoxy_has_egl_extension(NULL, "EGL_EXT_device_query") || - !epoxy_has_egl_extension(NULL, "EGL_EXT_device_enumeration")) { + if (!epoxy_has_egl_extension(NULL, "EGL_EXT_device_base") && + !(epoxy_has_egl_extension(NULL, "EGL_EXT_device_query") && + epoxy_has_egl_extension(NULL, "EGL_EXT_device_enumeration"))) { return FALSE; } @@ -195,7 +196,9 @@ fbdev_glamor_egl_device_matches_config(EGLDeviceEXT device, int strict) #define EGL_DRIVER_NAME_EXT 0x335E #endif - const char *driver_name = eglQueryDeviceStringEXT(device, EGL_DRIVER_NAME_EXT); + const char *dev_ext = eglQueryDeviceStringEXT(device, EGL_EXTENSIONS); + const char *driver_name = (dev_ext && strstr(dev_ext, "EGL_EXT_device_persistent_id")) ? + eglQueryDeviceStringEXT(device, EGL_DRIVER_NAME_EXT) : NULL; if (!driver_name) { return FALSE; }