From 8de5bdc89c1165e1830e97ffac067daa4ec807be Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Fri, 13 Oct 2023 13:51:50 +0200 Subject: [PATCH] renderer/native: Add a new has_addfb2 property We want to be able to tell from MetaWaylandDmabuf to fine tweak when and which modifiers should be sent. Part-of: --- src/backends/native/meta-renderer-native.c | 10 +++++++++- src/backends/native/meta-renderer-native.h | 2 ++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/backends/native/meta-renderer-native.c b/src/backends/native/meta-renderer-native.c index b5c9755af..4be977209 100644 --- a/src/backends/native/meta-renderer-native.c +++ b/src/backends/native/meta-renderer-native.c @@ -90,6 +90,7 @@ struct _MetaRendererNative gboolean use_modifiers; gboolean send_modifiers; + gboolean has_addfb2; GHashTable *gpu_datas; @@ -238,6 +239,12 @@ meta_renderer_native_use_modifiers (MetaRendererNative *renderer_native) return renderer_native->use_modifiers; } +gboolean +meta_renderer_native_has_addfb2 (MetaRendererNative *renderer_native) +{ + return renderer_native->has_addfb2; +} + MetaGles3 * meta_renderer_native_get_gles3 (MetaRendererNative *renderer_native) { @@ -2168,6 +2175,7 @@ meta_renderer_native_initable_init (GInitable *initable, kms_device = meta_gpu_kms_get_kms_device (renderer_native->primary_gpu_kms); flags = meta_kms_device_get_flags (kms_device); + renderer_native->has_addfb2 = !!(flags & META_KMS_DEVICE_FLAG_HAS_ADDFB2); kms_modifiers_debug_env = g_getenv ("MUTTER_DEBUG_USE_KMS_MODIFIERS"); if (kms_modifiers_debug_env) @@ -2179,7 +2187,7 @@ meta_renderer_native_initable_init (GInitable *initable, { renderer_native->use_modifiers = !(flags & META_KMS_DEVICE_FLAG_DISABLE_MODIFIERS) && - flags & META_KMS_DEVICE_FLAG_HAS_ADDFB2; + renderer_native->has_addfb2; } meta_topic (META_DEBUG_KMS, "Usage of KMS modifiers is %s", diff --git a/src/backends/native/meta-renderer-native.h b/src/backends/native/meta-renderer-native.h index 497b89869..f84c7741a 100644 --- a/src/backends/native/meta-renderer-native.h +++ b/src/backends/native/meta-renderer-native.h @@ -72,4 +72,6 @@ gboolean meta_renderer_native_send_modifiers (MetaRendererNative *renderer_nativ gboolean meta_renderer_native_use_modifiers (MetaRendererNative *renderer_native); +gboolean meta_renderer_native_has_addfb2 (MetaRendererNative *renderer_native); + MetaRendererNativeMode meta_renderer_native_get_mode (MetaRendererNative *renderer_native);