From 90ae14e792a32c45f18c0ce2a556a1a97e0cf9da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Thu, 20 Oct 2022 23:05:53 +0200 Subject: [PATCH] kms/device: Move result queueing to impl device This means there will be no entry points to the dispatch machinery that doesn't report about the results. Part-of: --- src/backends/native/meta-kms-impl-device.c | 24 ++++++++++++++++++++++ src/backends/native/meta-kms-impl-device.h | 3 ++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/src/backends/native/meta-kms-impl-device.c b/src/backends/native/meta-kms-impl-device.c index c14538975..ef2890ffd 100644 --- a/src/backends/native/meta-kms-impl-device.c +++ b/src/backends/native/meta-kms-impl-device.c @@ -1000,6 +1000,28 @@ emit_resources_changed_callback (MetaKms *kms, meta_kms_emit_resources_changed (kms, changes); } +static void +queue_result_feedback (MetaKmsImplDevice *impl_device, + MetaKmsUpdate *update, + MetaKmsFeedback *feedback) +{ + MetaKmsImplDevicePrivate *priv = + meta_kms_impl_device_get_instance_private (impl_device); + MetaKms *kms = meta_kms_device_get_kms (priv->device); + GList *result_listeners; + GList *l; + + result_listeners = meta_kms_update_take_result_listeners (update); + for (l = result_listeners; l; l = l->next) + { + MetaKmsResultListener *listener = l->data; + + meta_kms_result_listener_set_feedback (listener, feedback); + meta_kms_queue_result_callback (kms, listener); + } +} + + MetaKmsFeedback * meta_kms_impl_device_process_update (MetaKmsImplDevice *impl_device, MetaKmsUpdate *update, @@ -1024,6 +1046,8 @@ meta_kms_impl_device_process_update (MetaKmsImplDevice *impl_device, if (!(flags & META_KMS_UPDATE_FLAG_TEST_ONLY)) changes = meta_kms_impl_device_predict_states (impl_device, update); + queue_result_feedback (impl_device, update, feedback); + meta_kms_update_free (update); if (changes != META_KMS_RESOURCE_CHANGE_NONE) diff --git a/src/backends/native/meta-kms-impl-device.h b/src/backends/native/meta-kms-impl-device.h index 5fa54fc2b..20dc3cd0b 100644 --- a/src/backends/native/meta-kms-impl-device.h +++ b/src/backends/native/meta-kms-impl-device.h @@ -182,7 +182,8 @@ void meta_kms_impl_device_reload_prop_values (MetaKmsImplDevice *impl_device, MetaKmsFeedback * meta_kms_impl_device_process_update (MetaKmsImplDevice *impl_device, MetaKmsUpdate *update, - MetaKmsUpdateFlag flags); + MetaKmsUpdateFlag flags) + G_GNUC_WARN_UNUSED_RESULT; void meta_kms_impl_device_handle_page_flip_callback (MetaKmsImplDevice *impl_device, MetaKmsPageFlipData *page_flip_data);