From f1356ce5d3b764282e11449588c0d9433c8a973a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Mon, 28 Jun 2021 11:50:30 +0200 Subject: [PATCH] kms: Add debug env var to configure thread implementation type Set MUTTER_DEBUG_KMS_THREAD_TYPE to either 'kernel' or 'user', and the MetaThread backend will be either a kernel thread or a user thread. Part-of: --- src/backends/native/meta-kms.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/backends/native/meta-kms.c b/src/backends/native/meta-kms.c index 837af2492..8872fb4b6 100644 --- a/src/backends/native/meta-kms.c +++ b/src/backends/native/meta-kms.c @@ -431,12 +431,25 @@ meta_kms_new (MetaBackend *backend, MetaBackendNative *backend_native = META_BACKEND_NATIVE (backend); MetaUdev *udev = meta_backend_native_get_udev (backend_native); MetaKms *kms; + const char *thread_type_string; + MetaThreadType thread_type = META_THREAD_TYPE_USER; + + thread_type_string = g_getenv ("MUTTER_DEBUG_KMS_THREAD_TYPE"); + if (thread_type_string) + { + if (g_strcmp0 (thread_type_string, "user") == 0) + thread_type = META_THREAD_TYPE_USER; + else if (g_strcmp0 (thread_type_string, "kernel") == 0) + thread_type = META_THREAD_TYPE_KERNEL; + else + g_assert_not_reached (); + } kms = g_initable_new (META_TYPE_KMS, NULL, error, "backend", backend, "name", "KMS thread", - "thread-type", META_THREAD_TYPE_USER, + "thread-type", thread_type, NULL); kms->flags = flags;