compositor: add repaint delay timer

Graphics / Wayland / Weston - Pekka Paalanen [collabora.co.uk] - 20 March 2015 05:19 UTC

This timer delays the output_repaint towards the end of the refresh period, reducing the time from repaint to present.

The length of the repaint window can be set in weston.ini.

The call to weston_output_schedule_repaint_reset() is delayed by one more period. If we exit the continuous repaint loop (set output->repaint_scheduled to false) in finish_frame, we may call start_repaint_loop() unnecessarily. The problem case was actually observed with two outputs on the DRM backend at 60 Hz, and 7 ms repaint-window. During a window move, one output was constantly falling off the continuous repaint loop and introducing additional one frame latency, leading to jerky window motion. This code now avoids the problem.

Changes in v2:

- Rename repaint_delay_timer to repaint_timer and output_repaint_delay_handler to output_repaint_timer_handler.

- When computing the delay, take the current time into account. The timer uses a relative timeout, so we have to subtract any time already gone.

Note, that 'gone' may also be negative. DRM has a habit of predicting the page flip timestamp so it may be still in the future when we get the completion event.

- Do also a sanity check 'msec > 1000'. In the unlikely case that something fails to provide a good timestamp, never delay for more than one second.

0513a95 compositor: add repaint delay timer
man/weston.ini.man | 10 +++++++
src/compositor.c | 83 +++++++++++++++++++++++++++++++++++++++++++++-------
src/compositor.h | 2 ++
3 files changed, 84 insertions(+), 11 deletions(-)

Upstream: cgit.freedesktop.org


  • Share