mirror of
https://github.com/brl/mutter.git
synced 2024-12-26 21:02:14 +00:00
kms/update: Change lock() to seal()
At first it was called seal(), but then updates could be amended after being posted, given a flag. That flag has been removed, so we can go back to sealing, since it's once again acts more as a seal. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2854>
This commit is contained in:
parent
02b1cfe08f
commit
b1b9a9aac1
@ -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,
|
||||
|
@ -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);
|
||||
|
@ -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 *
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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));
|
||||
|
Loading…
Reference in New Issue
Block a user