Blame SOURCES/0001-renderer-native-Log-render-mode-per-device.patch

1e895f
From fa70ee1cd78e2b161545bc47a1c1083063030f77 Mon Sep 17 00:00:00 2001
1e895f
From: =?UTF-8?q?Jonas=20=C3=85dahl?= <jadahl@gmail.com>
1e895f
Date: Mon, 11 Oct 2021 10:52:43 +0200
1e895f
Subject: [PATCH 1/5] renderer/native: Log render mode per device
1e895f
1e895f
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2051>
1e895f
(cherry picked from commit e8249a572d669c4c0a8464d6bce556b2cbaca4ef)
1e895f
(cherry picked from commit fe0ea79b83256d80f1dee1e4a49c94a5d6fd18a6)
1e895f
---
1e895f
 src/backends/native/meta-renderer-native.c | 30 ++++++++++++++++++++++
1e895f
 1 file changed, 30 insertions(+)
1e895f
1e895f
diff --git a/src/backends/native/meta-renderer-native.c b/src/backends/native/meta-renderer-native.c
1e895f
index 735c37202..f92f648e5 100644
1e895f
--- a/src/backends/native/meta-renderer-native.c
1e895f
+++ b/src/backends/native/meta-renderer-native.c
1e895f
@@ -1808,6 +1808,24 @@ meta_renderer_native_create_renderer_gpu_data (MetaRendererNative  *renderer_nat
1e895f
   return NULL;
1e895f
 }
1e895f
 
1e895f
+static const char *
1e895f
+renderer_data_mode_to_string (MetaRendererNativeMode mode)
1e895f
+{
1e895f
+  switch (mode)
1e895f
+    {
1e895f
+    case META_RENDERER_NATIVE_MODE_GBM:
1e895f
+      return "gbm";
1e895f
+    case META_RENDERER_NATIVE_MODE_SURFACELESS:
1e895f
+      return "surfaceless";
1e895f
+#ifdef HAVE_EGL_DEVICE
1e895f
+    case META_RENDERER_NATIVE_MODE_EGL_DEVICE:
1e895f
+      return "egldevice";
1e895f
+#endif
1e895f
+    }
1e895f
+
1e895f
+  g_assert_not_reached ();
1e895f
+}
1e895f
+
1e895f
 static gboolean
1e895f
 create_renderer_gpu_data (MetaRendererNative  *renderer_native,
1e895f
                           MetaGpuKms          *gpu_kms,
1e895f
@@ -1822,6 +1840,18 @@ create_renderer_gpu_data (MetaRendererNative  *renderer_native,
1e895f
   if (!renderer_gpu_data)
1e895f
     return FALSE;
1e895f
 
1e895f
+  if (gpu_kms)
1e895f
+    {
1e895f
+      g_message ("Created %s renderer for '%s'",
1e895f
+                 renderer_data_mode_to_string (renderer_gpu_data->mode),
1e895f
+                 meta_gpu_kms_get_file_path (gpu_kms));
1e895f
+    }
1e895f
+  else
1e895f
+    {
1e895f
+      g_message ("Created %s renderer without GPU",
1e895f
+                 renderer_data_mode_to_string (renderer_gpu_data->mode));
1e895f
+    }
1e895f
+
1e895f
   g_hash_table_insert (renderer_native->gpu_datas,
1e895f
                        gpu_kms,
1e895f
                        renderer_gpu_data);
1e895f
-- 
1e895f
2.35.1
1e895f