diff --git a/src/backends/native/meta-kms-impl-device.c b/src/backends/native/meta-kms-impl-device.c index cbedd54a4..0183363f3 100644 --- a/src/backends/native/meta-kms-impl-device.c +++ b/src/backends/native/meta-kms-impl-device.c @@ -75,6 +75,13 @@ typedef struct _CrtcDeadline } deadline; } CrtcFrame; +typedef enum _MetaDeadlineTimerState +{ + META_DEADLINE_TIMER_STATE_ENABLED, + META_DEADLINE_TIMER_STATE_DISABLED, + META_DEADLINE_TIMER_STATE_INHIBITED, +} MetaDeadlineTimerState; + typedef struct _MetaKmsImplDevicePrivate { MetaKmsDevice *device; @@ -100,7 +107,7 @@ typedef struct _MetaKmsImplDevicePrivate GHashTable *crtc_frames; - gboolean deadline_timer_inhibited; + MetaDeadlineTimerState deadline_timer_state; gboolean sync_file_retrieved; int sync_file; @@ -1403,7 +1410,7 @@ is_using_deadline_timer (MetaKmsImplDevice *impl_device) MetaKmsImplDevicePrivate *priv = meta_kms_impl_device_get_instance_private (impl_device); - if (priv->deadline_timer_inhibited) + if (priv->deadline_timer_state != META_DEADLINE_TIMER_STATE_ENABLED) { return FALSE; } @@ -1626,7 +1633,7 @@ meta_kms_impl_device_schedule_process (MetaKmsImplDevice *impl_device, g_warning ("Failed to determine deadline: %s", error->message); priv = meta_kms_impl_device_get_instance_private (impl_device); - priv->deadline_timer_inhibited = TRUE; + priv->deadline_timer_state = META_DEADLINE_TIMER_STATE_DISABLED; needs_flush: meta_kms_device_set_needs_flush (meta_kms_crtc_get_device (crtc), crtc); @@ -1957,7 +1964,7 @@ get_driver_info (int fd, } static void -maybe_inhibit_deadline_timer (MetaKmsImplDevice *impl_device) +maybe_disable_deadline_timer (MetaKmsImplDevice *impl_device) { MetaKmsImplDevicePrivate *priv = meta_kms_impl_device_get_instance_private (impl_device); @@ -1970,7 +1977,7 @@ maybe_inhibit_deadline_timer (MetaKmsImplDevice *impl_device) { if (g_strcmp0 (deadline_timer_deny_list[i], priv->driver_name) == 0) { - priv->deadline_timer_inhibited = TRUE; + priv->deadline_timer_state = META_DEADLINE_TIMER_STATE_DISABLED; break; } } @@ -2001,7 +2008,7 @@ meta_kms_impl_device_initable_init (GInitable *initable, priv->driver_description = g_strdup ("Unknown"); } - maybe_inhibit_deadline_timer (impl_device); + maybe_disable_deadline_timer (impl_device); priv->crtc_frames = g_hash_table_new_full (NULL, NULL,