From 5984aa8137dd525149014f2628337d1d82da70bb Mon Sep 17 00:00:00 2001 From: Sebastian Wick Date: Thu, 2 Mar 2023 01:59:41 +0100 Subject: [PATCH] backends/native: Let updates require ALLOW_MODESET Part-of: --- src/backends/native/meta-kms-impl-device-atomic.c | 2 +- src/backends/native/meta-kms-update-private.h | 2 ++ src/backends/native/meta-kms-update.c | 8 ++++++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/backends/native/meta-kms-impl-device-atomic.c b/src/backends/native/meta-kms-impl-device-atomic.c index d44ca5f20..e0b2ce1dd 100644 --- a/src/backends/native/meta-kms-impl-device-atomic.c +++ b/src/backends/native/meta-kms-impl-device-atomic.c @@ -967,7 +967,7 @@ meta_kms_impl_device_atomic_process_update (MetaKmsImplDevice *impl_device, &error)) goto err; - if (meta_kms_update_get_mode_sets (update)) + if (meta_kms_update_get_needs_modeset (update)) commit_flags |= DRM_MODE_ATOMIC_ALLOW_MODESET; else commit_flags |= DRM_MODE_ATOMIC_NONBLOCK; diff --git a/src/backends/native/meta-kms-update-private.h b/src/backends/native/meta-kms-update-private.h index 0e91778e7..98a1b55d1 100644 --- a/src/backends/native/meta-kms-update-private.h +++ b/src/backends/native/meta-kms-update-private.h @@ -193,6 +193,8 @@ void meta_kms_custom_page_flip_free (MetaKmsCustomPageFlip *custom_page_flip); void meta_kms_update_realize (MetaKmsUpdate *update, MetaKmsImplDevice *impl_device); +gboolean meta_kms_update_get_needs_modeset (MetaKmsUpdate *update); + G_DEFINE_AUTOPTR_CLEANUP_FUNC (MetaKmsPlaneFeedback, meta_kms_plane_feedback_free) diff --git a/src/backends/native/meta-kms-update.c b/src/backends/native/meta-kms-update.c index f15ab3faa..4a4a3d692 100644 --- a/src/backends/native/meta-kms-update.c +++ b/src/backends/native/meta-kms-update.c @@ -46,6 +46,8 @@ struct _MetaKmsUpdate GList *page_flip_listeners; GList *result_listeners; + gboolean needs_modeset; + MetaKmsImplDevice *impl_device; }; @@ -953,6 +955,12 @@ meta_kms_update_merge_from (MetaKmsUpdate *update, merge_result_listeners_from (update, other_update); } +gboolean +meta_kms_update_get_needs_modeset (MetaKmsUpdate *update) +{ + return update->needs_modeset || update->mode_sets; +} + MetaKmsUpdate * meta_kms_update_new (MetaKmsDevice *device) {