backend-headless: use weston_output_arm_frame_timer()

headless_output_repaint() is not actually called immediately after
weston_output_finish_frame(): Weston waits for "frame-duration - repaint-window"
but at least one millisecond.
And renderning can also take an arbitrary amount of time.

So use weston_output_arm_frame_timer() like all other timer based backends. It
takes all of this into account and calculates the delay relative to the next
expected vblank time.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
This commit is contained in:
Michael Olbrich 2025-01-27 12:05:35 +01:00 committed by Daniel Stone
parent c335ec70af
commit f36a0c2cb8

View file

@ -161,7 +161,6 @@ headless_output_repaint(struct weston_output *output_base)
struct headless_output *output = to_headless_output(output_base);
struct weston_compositor *ec;
pixman_region32_t damage;
int delay_msec;
assert(output);
@ -178,8 +177,7 @@ headless_output_repaint(struct weston_output *output_base)
pixman_region32_fini(&damage);
delay_msec = millihz_to_nsec(output->mode.refresh) / 1000000;
wl_event_source_timer_update(output->finish_frame_timer, delay_msec);
weston_output_arm_frame_timer(output_base, output->finish_frame_timer);
return 0;
}