kms/impl-device: Add function to handle device resumption

For now, this function only enables the deadline timer in case it was
inhibited. This would result in an attempt to use the deadline timer
again after a device is resumed.

If the conditions that resulted in the timer becoming inhibited
remain, it is expected to return to this state after the next frame
and before being armed.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3534>
This commit is contained in:
Dor Askayo 2024-01-19 02:15:51 +02:00 committed by Marge Bot
parent 98cdafdf0b
commit ada4ac49fb
2 changed files with 12 additions and 0 deletions

View File

@ -1929,6 +1929,16 @@ meta_kms_impl_device_init_mode_setting (MetaKmsImplDevice *impl_device,
return TRUE;
}
void
meta_kms_impl_device_resume (MetaKmsImplDevice *impl_device)
{
MetaKmsImplDevicePrivate *priv =
meta_kms_impl_device_get_instance_private (impl_device);
if (priv->deadline_timer_state == META_DEADLINE_TIMER_STATE_INHIBITED)
priv->deadline_timer_state = META_DEADLINE_TIMER_STATE_ENABLED;
}
void
meta_kms_impl_device_prepare_shutdown (MetaKmsImplDevice *impl_device)
{

View File

@ -195,6 +195,8 @@ void meta_kms_impl_device_discard_pending_page_flips (MetaKmsImplDevice *impl_de
gboolean meta_kms_impl_device_init_mode_setting (MetaKmsImplDevice *impl_device,
GError **error);
void meta_kms_impl_device_resume (MetaKmsImplDevice *impl_device);
void meta_kms_impl_device_prepare_shutdown (MetaKmsImplDevice *impl_device);
uint64_t meta_kms_prop_convert_value (MetaKmsProp *prop,