1
0
Fork 0

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: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3320>
This commit is contained in:
Olivier Fourdan 2023-10-13 13:51:50 +02:00 committed by Marge Bot
parent b5a59ec109
commit 8de5bdc89c
2 changed files with 11 additions and 1 deletions

View file

@ -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",

View file

@ -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);