weston/compositor
Emmanuel Gil Peyrot 11ae2a3036 compositor-drm: pageflip timeout implementation
Weston will not repaint until previous update has been acked by a
pageflip event coming from the drm driver. However, some buggy drivers
won’t return those events or will stop sending them at some point and
Weston output repaints will completely freeze. To ease developers’ task
in testing their drivers, this patch makes compositor-drm use a timer
to detect cases where those pageflip events stop coming.

This timeout implementation is software only and includes basic
features usually found in a watchdog. We simply exit Weston gracefully
with a log message and an exit code when the timout is reached.

The timeout value can be set via weston.ini by adding a
pageflip-timeout=<MILLISECONDS> entry under [core]
section. Setting it to 0 disables the timeout feature.

v2:
- Made sure we would get both the pageflip and the vblank events before
  stopping the timer.
- Reordered the error and success cases in
  drm_output_pageflip_timer_create() to be more in line with the rest
  of the code.

v3:
- Reordered (de)arming of the timer with the code around it to avoid it
  being rearmed before the current dearming.
- Return the proper value for the dispatcher in the pageflip_timeout
  callback.
- Also display the output name in case the timer fires.

v4:
- Reordered a forgotten timer rearming after its drmModePageFlip().

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=83884
Signed-off-by: Frederic Plourde <frederic.plourde at collabora.co.uk>
Signed-off-by: Emmanuel Gil Peyrot <emmanuel.peyrot@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-03-07 16:42:40 +02:00
..
cms-colord.c weston: Properly namespace modules entrypoint 2017-01-17 18:24:56 +01:00
cms-helper.c include stdint.h for int32_t/uint32_t 2016-07-26 16:26:08 -07:00
cms-helper.h Move weston source to compositor/ 2016-06-23 17:44:54 +03:00
cms-static.c weston: Properly namespace modules entrypoint 2017-01-17 18:24:56 +01:00
main.c compositor-drm: pageflip timeout implementation 2017-03-07 16:42:40 +02:00
screen-share.c screen-share: Use wl_list_for_each_safe on destroy 2017-02-21 12:28:15 -08:00
systemd-notify.c systemd: fix Wincompatible-pointer-type 2017-01-27 17:25:11 +02:00
text-backend.c text-input: Clear out context->input pointer 2016-11-18 15:42:42 +02:00
weston-screenshooter.c include stdint.h for int32_t/uint32_t 2016-07-26 16:26:08 -07:00
weston.desktop Remove dbus-launch from weston.desktop 2017-01-18 12:21:57 +00:00
weston.h weston: Make the shell entrypoint specific 2017-01-17 18:24:58 +01:00
weston.pc.in libweston: use new versioning scheme 2016-08-02 13:52:58 +03:00
xwayland.c xwayland: Cleanup error message on spawn failure Signed-off-by: Bryce Harrington <bryce@osg.samsung.com> 2016-07-07 10:48:34 -07:00