diff --git a/src/backends/native/meta-kms-device.c b/src/backends/native/meta-kms-device.c index c2c04e10a..4b391a584 100644 --- a/src/backends/native/meta-kms-device.c +++ b/src/backends/native/meta-kms-device.c @@ -309,6 +309,8 @@ meta_kms_device_process_update_sync (MetaKmsDevice *device, MetaKms *kms = META_KMS (meta_kms_device_get_kms (device)); PostUpdateData data; + meta_kms_update_seal (update); + data = (PostUpdateData) { .update = update, .flags = flags, diff --git a/src/backends/native/meta-kms-update-private.h b/src/backends/native/meta-kms-update-private.h index 343628a49..362c29b30 100644 --- a/src/backends/native/meta-kms-update-private.h +++ b/src/backends/native/meta-kms-update-private.h @@ -140,12 +140,10 @@ MetaKmsFeedback * meta_kms_feedback_new_passed (GList *failed_planes); MetaKmsFeedback * meta_kms_feedback_new_failed (GList *failed_planes, GError *error); -void meta_kms_update_lock (MetaKmsUpdate *update); - -void meta_kms_update_unlock (MetaKmsUpdate *update); +void meta_kms_update_seal (MetaKmsUpdate *update); META_EXPORT_TEST -gboolean meta_kms_update_is_locked (MetaKmsUpdate *update); +gboolean meta_kms_update_is_sealed (MetaKmsUpdate *update); META_EXPORT_TEST MetaKmsDevice * meta_kms_update_get_device (MetaKmsUpdate *update); diff --git a/src/backends/native/meta-kms-update.c b/src/backends/native/meta-kms-update.c index 4d0bda8f5..ead8d2544 100644 --- a/src/backends/native/meta-kms-update.c +++ b/src/backends/native/meta-kms-update.c @@ -32,7 +32,7 @@ struct _MetaKmsUpdate { MetaKmsDevice *device; - gboolean is_locked; + gboolean is_sealed; GList *mode_sets; GList *plane_assignments; @@ -224,7 +224,7 @@ meta_kms_update_assign_plane (MetaKmsUpdate *update, MetaKmsPlaneAssignment *plane_assignment; MetaKmsAssignPlaneFlag old_flags; - g_assert (!meta_kms_update_is_locked (update)); + g_assert (!meta_kms_update_is_sealed (update)); g_assert (meta_kms_crtc_get_device (crtc) == update->device); g_assert (meta_kms_plane_get_device (plane) == update->device); g_assert (meta_kms_plane_get_plane_type (plane) != @@ -261,7 +261,7 @@ meta_kms_update_unassign_plane (MetaKmsUpdate *update, { MetaKmsPlaneAssignment *plane_assignment; - g_assert (!meta_kms_update_is_locked (update)); + g_assert (!meta_kms_update_is_sealed (update)); g_assert (meta_kms_crtc_get_device (crtc) == update->device); g_assert (meta_kms_plane_get_device (plane) == update->device); @@ -287,7 +287,7 @@ meta_kms_update_mode_set (MetaKmsUpdate *update, { MetaKmsModeSet *mode_set; - g_assert (!meta_kms_update_is_locked (update)); + g_assert (!meta_kms_update_is_sealed (update)); g_assert (meta_kms_crtc_get_device (crtc) == update->device); mode_set = g_new0 (MetaKmsModeSet, 1); @@ -332,7 +332,7 @@ meta_kms_update_set_underscanning (MetaKmsUpdate *update, { MetaKmsConnectorUpdate *connector_update; - g_assert (!meta_kms_update_is_locked (update)); + g_assert (!meta_kms_update_is_sealed (update)); g_assert (meta_kms_connector_get_device (connector) == update->device); connector_update = ensure_connector_update (update, connector); @@ -348,7 +348,7 @@ meta_kms_update_unset_underscanning (MetaKmsUpdate *update, { MetaKmsConnectorUpdate *connector_update; - g_assert (!meta_kms_update_is_locked (update)); + g_assert (!meta_kms_update_is_sealed (update)); g_assert (meta_kms_connector_get_device (connector) == update->device); connector_update = ensure_connector_update (update, connector); @@ -417,7 +417,7 @@ meta_kms_update_set_crtc_gamma (MetaKmsUpdate *update, MetaGammaLut *gamma_update = NULL; const MetaKmsCrtcState *crtc_state = meta_kms_crtc_get_current_state (crtc); - g_assert (!meta_kms_update_is_locked (update)); + g_assert (!meta_kms_update_is_sealed (update)); g_assert (meta_kms_crtc_get_device (crtc) == update->device); if (gamma) @@ -445,7 +445,7 @@ meta_kms_update_add_page_flip_listener (MetaKmsUpdate *upd { MetaKmsPageFlipListener *listener; - g_assert (!meta_kms_update_is_locked (update)); + g_assert (!meta_kms_update_is_sealed (update)); g_assert (meta_kms_crtc_get_device (crtc) == update->device); listener = g_new0 (MetaKmsPageFlipListener, 1); @@ -469,7 +469,7 @@ meta_kms_update_set_custom_page_flip (MetaKmsUpdate *update, { MetaKmsCustomPageFlip *custom_page_flip; - g_assert (!meta_kms_update_is_locked (update)); + g_assert (!meta_kms_update_is_sealed (update)); custom_page_flip = g_new0 (MetaKmsCustomPageFlip, 1); custom_page_flip->func = func; @@ -509,7 +509,7 @@ void meta_kms_plane_assignment_set_rotation (MetaKmsPlaneAssignment *plane_assignment, MetaKmsPlaneRotation rotation) { - g_assert (!meta_kms_update_is_locked (plane_assignment->update)); + g_assert (!meta_kms_update_is_sealed (plane_assignment->update)); g_warn_if_fail (rotation); plane_assignment->rotation = rotation; @@ -630,21 +630,17 @@ meta_kms_update_get_crtc_color_updates (MetaKmsUpdate *update) } void -meta_kms_update_lock (MetaKmsUpdate *update) +meta_kms_update_seal (MetaKmsUpdate *update) { - update->is_locked = TRUE; -} + g_warn_if_fail (!update->is_sealed); -void -meta_kms_update_unlock (MetaKmsUpdate *update) -{ - update->is_locked = FALSE; + update->is_sealed = TRUE; } gboolean -meta_kms_update_is_locked (MetaKmsUpdate *update) +meta_kms_update_is_sealed (MetaKmsUpdate *update) { - return update->is_locked; + return update->is_sealed; } MetaKmsDevice * diff --git a/src/backends/native/meta-kms.c b/src/backends/native/meta-kms.c index 45cd00a14..96e81cebe 100644 --- a/src/backends/native/meta-kms.c +++ b/src/backends/native/meta-kms.c @@ -264,8 +264,6 @@ meta_kms_post_pending_update_sync (MetaKms *kms, if (!update) return NULL; - meta_kms_update_lock (update); - feedback = meta_kms_device_process_update_sync (device, update, flags); result_listeners = meta_kms_update_take_result_listeners (update); @@ -295,8 +293,6 @@ meta_kms_post_test_update_sync (MetaKms *kms, g_assert (!meta_kms_update_get_mode_sets (update)); g_assert (!meta_kms_update_get_connector_updates (update)); - meta_kms_update_lock (update); - flags = META_KMS_UPDATE_FLAG_TEST_ONLY; return meta_kms_device_process_update_sync (device, update, flags); } diff --git a/src/tests/native-kms-updates.c b/src/tests/native-kms-updates.c index dc7a99c95..e13d01cfa 100644 --- a/src/tests/native-kms-updates.c +++ b/src/tests/native-kms-updates.c @@ -66,7 +66,7 @@ meta_test_kms_update_sanity (void) update = meta_kms_update_new (device); g_assert (meta_kms_update_get_device (update) == device); - g_assert_false (meta_kms_update_is_locked (update)); + g_assert_false (meta_kms_update_is_sealed (update)); g_assert_null (meta_kms_update_get_primary_plane_assignment (update, crtc)); g_assert_null (meta_kms_update_get_plane_assignments (update)); g_assert_null (meta_kms_update_get_mode_sets (update));