1
0
Fork 0

clutter/frame-clock: Take deadline evasion into account

This is meant to be the amount of time before a CRTC deadline we're
usually dispatching at. It's not yet set by anything however.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3184>
This commit is contained in:
Jonas Ådahl 2024-07-22 16:39:19 +02:00 committed by Marge Bot
parent 61ae9eedb6
commit 5da94d2c1d
2 changed files with 15 additions and 1 deletions

View file

@ -137,6 +137,8 @@ struct _ClutterFrameClock
int64_t last_dispatch_interval_us;
int64_t deadline_evasion_us;
char *output_name;
};
@ -389,7 +391,8 @@ clutter_frame_clock_notify_presented (ClutterFrameClock *frame_clock,
frame_clock->shortterm_max_update_duration_us =
CLAMP (frame_clock->last_dispatch_lateness_us + dispatch_to_swap_us +
MAX (swap_to_rendering_done_us, swap_to_flip_us),
MAX (swap_to_rendering_done_us,
swap_to_flip_us + frame_clock->deadline_evasion_us),
frame_clock->shortterm_max_update_duration_us,
frame_clock->refresh_interval_us);
@ -1253,3 +1256,10 @@ clutter_frame_clock_class_init (ClutterFrameClockClass *klass)
G_TYPE_NONE,
0);
}
void
clutter_frame_clock_set_deadline_evasion (ClutterFrameClock *frame_clock,
int64_t deadline_evasion_us)
{
frame_clock->deadline_evasion_us = deadline_evasion_us;
}

View file

@ -106,3 +106,7 @@ void clutter_frame_clock_record_flip_time (ClutterFrameClock *frame_clock,
int64_t flip_time_us);
GString * clutter_frame_clock_get_max_render_time_debug_info (ClutterFrameClock *frame_clock);
CLUTTER_EXPORT
void clutter_frame_clock_set_deadline_evasion (ClutterFrameClock *frame_clock,
int64_t deadline_evasion_us);