Commit eca5cca5 authored by Daniel Stone's avatar Daniel Stone

Account for very large repaint window misses

At the bottom of weston_output_finish_frame(), code exists to account
for flips which have missed the repaint window, by shifting them to lock
on to the next repaint window rather than repainting immediately.

This code only accounted for flips which missed their target by one
repaint window. If they miss by multiples of the repaint window, adjust
them until the next repaint timestamp is in the future. This will only
happen in fairly extreme situations, such as Weston being scheduled out
for a punitively long period of time. Nevertheless, try to help recovery
by still aiming for more predictable timings.
Signed-off-by: Daniel Stone's avatarDaniel Stone <>
Reviewed-by: Pekka Paalanen's avatarPekka Paalanen <>
parent 9ad4de1f
......@@ -2510,9 +2510,14 @@ weston_output_finish_frame(struct weston_output *output,
* the deadline given by repaint_msec? In that case we delay until
* the deadline of the next frame, to give clients a more predictable
* timing of the repaint cycle to lock on. */
if (presented_flags == WP_PRESENTATION_FEEDBACK_INVALID && msec_rel < 0)
timespec_add_nsec(&output->next_repaint, &output->next_repaint,
if (presented_flags == WP_PRESENTATION_FEEDBACK_INVALID &&
msec_rel < 0) {
while (timespec_sub_to_nsec(&output->next_repaint, &now) < 0) {
output->repaint_status = REPAINT_SCHEDULED;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment