[mutter] wayland/dma-buf: Don't warn if there was no render node



commit a2382f325117dbfc4dede55f72fc5b9942c3ffb9
Author: Jonas Ã…dahl <jadahl gmail com>
Date:   Wed Jan 12 12:11:01 2022 +0100

    wayland/dma-buf: Don't warn if there was no render node
    
    When running in KVM, the EGL driver supports querying the render node
    path, but it returns NULL. Handle that better by falling back to
    querying the device main device file, instead of falling back on v3 of
    the protocol and logging a warning.
    
    Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2151>

 src/wayland/meta-wayland-dma-buf.c | 33 +++++++++++++++++++--------------
 1 file changed, 19 insertions(+), 14 deletions(-)
---
diff --git a/src/wayland/meta-wayland-dma-buf.c b/src/wayland/meta-wayland-dma-buf.c
index 4e2b15afb2..c7a846c90d 100644
--- a/src/wayland/meta-wayland-dma-buf.c
+++ b/src/wayland/meta-wayland-dma-buf.c
@@ -1424,29 +1424,34 @@ meta_wayland_dma_buf_manager_new (MetaWaylandCompositor  *compositor,
       device_path = meta_egl_query_device_string (egl, egl_device,
                                                   EGL_DRM_RENDER_NODE_FILE_EXT,
                                                   &local_error);
+      if (local_error)
+        {
+          g_warning ("Failed to query EGL render node path: %s",
+                     local_error->message);
+          g_clear_error (&local_error);
+        }
     }
-  else if (meta_egl_egl_device_has_extensions (egl, egl_device, NULL,
-                                               "EGL_EXT_device_drm",
-                                               NULL))
+
+  if (!device_path &&
+      meta_egl_egl_device_has_extensions (egl, egl_device, NULL,
+                                          "EGL_EXT_device_drm",
+                                          NULL))
     {
       device_path = meta_egl_query_device_string (egl, egl_device,
                                                   EGL_DRM_DEVICE_FILE_EXT,
                                                   &local_error);
-    }
-  else
-    {
-      meta_topic (META_DEBUG_WAYLAND,
-                  "Only advertising zwp_linux_dmabuf_v1 interface version 3 "
-                  "support, missing 'EGL_EXT_device_drm' and "
-                  "'EGL_EXT_device_drm_render_node'");
-      protocol_version = 3;
-      goto initialize;
+      if (local_error)
+        {
+          g_warning ("Failed to query EGL render node path: %s",
+                     local_error->message);
+        }
     }
 
   if (!device_path)
     {
-      g_warning ("Failed to query EGL device path: %s",
-                 local_error->message);
+      meta_topic (META_DEBUG_WAYLAND,
+                  "Only advertising zwp_linux_dmabuf_v1 interface version 3 "
+                  "support, no suitable device path could be found");
       protocol_version = 3;
       goto initialize;
     }


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