[mutter] kms/impl-simple: Add helper for dispatching page flip datas
- From: Marge Bot <marge-bot src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] kms/impl-simple: Add helper for dispatching page flip datas
- Date: Wed, 5 May 2021 20:26:20 +0000 (UTC)
commit 4dec1f5ddfd9d56d9973222e3b674db1ffd8b81c
Author: Jonas Ã…dahl <jadahl gmail com>
Date: Sun Apr 11 01:32:13 2021 +0200
kms/impl-simple: Add helper for dispatching page flip datas
Instead of a invoke helper, and a clear helper, use a single dispatch
helper that does both.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1822>
src/backends/native/meta-kms-impl-device-simple.c | 31 ++++++++++-------------
1 file changed, 13 insertions(+), 18 deletions(-)
---
diff --git a/src/backends/native/meta-kms-impl-device-simple.c
b/src/backends/native/meta-kms-impl-device-simple.c
index 1ca1f4d217..21ced99e8a 100644
--- a/src/backends/native/meta-kms-impl-device-simple.c
+++ b/src/backends/native/meta-kms-impl-device-simple.c
@@ -751,15 +751,11 @@ schedule_retry_page_flip (MetaKmsImplDeviceSimple *impl_device_simple,
}
static void
-invoke_page_flip_datas (GList *page_flip_datas,
- MetaPageFlipDataFeedbackFunc func)
-{
- g_list_foreach (page_flip_datas, (GFunc) func, NULL);
-}
-
-static void
-clear_page_flip_datas (GList **page_flip_datas)
+dispatch_page_flip_datas (GList **page_flip_datas,
+ GFunc func,
+ gpointer user_data)
{
+ g_list_foreach (*page_flip_datas, func, user_data);
g_clear_pointer (page_flip_datas, g_list_free);
}
@@ -778,9 +774,9 @@ mode_set_fallback_feedback_idle (gpointer user_data)
}
else
{
- invoke_page_flip_datas (impl_device_simple->mode_set_fallback_page_flip_datas,
- meta_kms_page_flip_data_mode_set_fallback_in_impl);
- clear_page_flip_datas (&impl_device_simple->mode_set_fallback_page_flip_datas);
+ dispatch_page_flip_datas (&impl_device_simple->mode_set_fallback_page_flip_datas,
+ (GFunc) meta_kms_page_flip_data_mode_set_fallback_in_impl,
+ NULL);
}
return G_SOURCE_REMOVE;
@@ -1413,13 +1409,12 @@ err:
static void
flush_postponed_page_flip_datas (MetaKmsImplDeviceSimple *impl_device_simple)
{
- invoke_page_flip_datas (impl_device_simple->postponed_page_flip_datas,
- meta_kms_page_flip_data_flipped_in_impl);
- clear_page_flip_datas (&impl_device_simple->postponed_page_flip_datas);
-
- invoke_page_flip_datas (impl_device_simple->postponed_mode_set_fallback_datas,
- meta_kms_page_flip_data_mode_set_fallback_in_impl);
- clear_page_flip_datas (&impl_device_simple->postponed_mode_set_fallback_datas);
+ dispatch_page_flip_datas (&impl_device_simple->postponed_page_flip_datas,
+ (GFunc) meta_kms_page_flip_data_flipped_in_impl,
+ NULL);
+ dispatch_page_flip_datas (&impl_device_simple->postponed_mode_set_fallback_datas,
+ (GFunc) meta_kms_page_flip_data_mode_set_fallback_in_impl,
+ NULL);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]