kms/impl-device: Move up ensure_deadline_timer_armed definition

Preparation for next commit, no functional change intended.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3964>
This commit is contained in:
Michel Dänzer 2024-08-19 18:57:52 +02:00 committed by Marge Bot
parent 37d1a20644
commit 3353962c38

View File

@ -1359,6 +1359,30 @@ arm_crtc_frame_deadline_timer (CrtcFrame *crtc_frame,
crtc_frame->deadline.armed = TRUE;
}
static gboolean
ensure_deadline_timer_armed (MetaKmsImplDevice *impl_device,
CrtcFrame *crtc_frame,
GError **error)
{
int64_t next_deadline_us;
int64_t next_presentation_us;
if (crtc_frame->deadline.armed)
return TRUE;
if (!meta_kms_crtc_determine_deadline (crtc_frame->crtc,
&next_deadline_us,
&next_presentation_us,
error))
return FALSE;
arm_crtc_frame_deadline_timer (crtc_frame,
next_deadline_us,
next_presentation_us);
return TRUE;
}
static void
notify_crtc_frame_ready (CrtcFrame *crtc_frame)
{
@ -1975,30 +1999,6 @@ meta_kms_impl_device_await_flush (MetaKmsImplDevice *impl_device,
disarm_crtc_frame_deadline_timer (crtc_frame);
}
static gboolean
ensure_deadline_timer_armed (MetaKmsImplDevice *impl_device,
CrtcFrame *crtc_frame,
GError **error)
{
int64_t next_deadline_us;
int64_t next_presentation_us;
if (crtc_frame->deadline.armed)
return TRUE;
if (!meta_kms_crtc_determine_deadline (crtc_frame->crtc,
&next_deadline_us,
&next_presentation_us,
error))
return FALSE;
arm_crtc_frame_deadline_timer (crtc_frame,
next_deadline_us,
next_presentation_us);
return TRUE;
}
void
meta_kms_impl_device_schedule_process (MetaKmsImplDevice *impl_device,
MetaKmsCrtc *crtc)