weston/libweston
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
..
animation.c libweston: Add move (without scale) animation 2016-11-21 18:22:47 +00:00
bindings.c include stdint.h for int32_t/uint32_t 2016-07-26 16:26:08 -07:00
clipboard.c include stdint.h for int32_t/uint32_t 2016-07-26 16:26:08 -07:00
compositor-drm.c compositor-drm: pageflip timeout implementation 2017-03-07 16:42:40 +02:00
compositor-drm.h compositor-drm: pageflip timeout implementation 2017-03-07 16:42:40 +02:00
compositor-fbdev.c libweston: Properly namespace backends entrypoint 2017-01-17 18:24:49 +01:00
compositor-fbdev.h weston: Port fbdev backend to new output handling API 2016-10-03 14:24:08 +03:00
compositor-headless.c libweston: Properly namespace backends entrypoint 2017-01-17 18:24:49 +01:00
compositor-headless.h weston: Port headless backend to new output handling API 2016-10-03 14:24:08 +03:00
compositor-rdp.c compositor-rdp: Fix build with freerdp2, take 2 2017-01-27 12:23:08 +02:00
compositor-rdp.h weston: Port RDP backend to new output handling API 2016-10-03 14:24:08 +03:00
compositor-wayland.c libweston: Properly namespace backends entrypoint 2017-01-17 18:24:49 +01:00
compositor-wayland.h compositor-wayland: Convert fullscreen flag to bool 2016-10-14 10:42:17 +02:00
compositor-x11.c libweston: Properly namespace backends entrypoint 2017-01-17 18:24:49 +01:00
compositor-x11.h weston: Port X11 backend to new output handling API 2016-10-05 14:59:09 +03:00
compositor.c compositor: damage pending subsurfaces when committing them 2017-02-07 14:25:27 +02:00
compositor.h compositor: damage pending subsurfaces when committing them 2017-02-07 14:25:27 +02:00
data-device.c libweston: Rename weston_surface::configure to ::committed 2016-08-14 09:28:50 +02:00
dbus.c include stdint.h for int32_t/uint32_t 2016-07-26 16:26:08 -07:00
dbus.h Rename src/ to libweston/ 2016-06-23 17:44:54 +03:00
gl-renderer.c gl-renderer: Fix an invalid write when closing a Weston window 2016-11-28 18:11:09 +00:00
gl-renderer.h gl-renderer: Add <platform_attribs> param to gl_renderer_display_create 2016-11-07 17:06:44 +02:00
input.c Don't prepend protocol/ to include paths 2016-11-29 09:49:00 +00:00
launcher-direct.c libweston/launcher: use C99 initializers for the iface(s) 2017-02-27 21:55:11 +00:00
launcher-impl.h libweston/launcher: annotate iface(s) as constant data 2017-02-27 21:55:02 +00:00
launcher-logind.c libweston/launcher: use C99 initializers for the iface(s) 2017-02-27 21:55:11 +00:00
launcher-util.c libweston/launcher: annotate iface(s) as constant data 2017-02-27 21:55:02 +00:00
launcher-util.h Rename src/ to libweston/ 2016-06-23 17:44:54 +03:00
launcher-weston-launch.c libweston/launcher: use C99 initializers for the iface(s) 2017-02-27 21:55:11 +00:00
libbacklight.c Switch to use safe_strtoint instead of strtol 2016-08-06 18:19:22 -07:00
libbacklight.h Rename src/ to libweston/ 2016-06-23 17:44:54 +03:00
libinput-device.c include stdint.h for int32_t/uint32_t 2016-07-26 16:26:08 -07:00
libinput-device.h Rename src/ to libweston/ 2016-06-23 17:44:54 +03:00
libinput-seat.c Add configuration option for no input device. 2016-10-22 15:04:58 +01:00
libinput-seat.h Rename src/ to libweston/ 2016-06-23 17:44:54 +03:00
libweston.pc.in libweston: fix major in libweston.pc 2016-08-02 14:19:11 +03:00
linux-dmabuf.c (multiple): Use standard permission notice 2017-02-13 21:45:12 +00:00
linux-dmabuf.h (multiple): Use standard permission notice 2017-02-13 21:45:12 +00:00
log.c Rename src/ to libweston/ 2016-06-23 17:44:54 +03:00
noop-renderer.c include stdint.h for int32_t/uint32_t 2016-07-26 16:26:08 -07:00
pixman-renderer.c include stdint.h for int32_t/uint32_t 2016-07-26 16:26:08 -07:00
pixman-renderer.h Rename src/ to libweston/ 2016-06-23 17:44:54 +03:00
plugin-registry.c compositor: add plugin-registry 2016-07-01 14:10:26 +03:00
plugin-registry.h compositor: add plugin-registry 2016-07-01 14:10:26 +03:00
screenshooter.c include stdint.h for int32_t/uint32_t 2016-07-26 16:26:08 -07:00
spring-tool.c include stdint.h for int32_t/uint32_t 2016-07-26 16:26:08 -07:00
timeline-object.h Rename src/ to libweston/ 2016-06-23 17:44:54 +03:00
timeline.c Rename src/ to libweston/ 2016-06-23 17:44:54 +03:00
timeline.h Rename src/ to libweston/ 2016-06-23 17:44:54 +03:00
vaapi-recorder.c Rename src/ to libweston/ 2016-06-23 17:44:54 +03:00
vaapi-recorder.h Rename src/ to libweston/ 2016-06-23 17:44:54 +03:00
version.h.in Rename src/ to libweston/ 2016-06-23 17:44:54 +03:00
vertex-clipping.c Rename src/ to libweston/ 2016-06-23 17:44:54 +03:00
vertex-clipping.h Rename src/ to libweston/ 2016-06-23 17:44:54 +03:00
weston-launch.c weston-launch: Only run a login shell for new sessions 2016-08-15 16:58:23 +02:00
weston-launch.h Rename src/ to libweston/ 2016-06-23 17:44:54 +03:00
windowed-output-api.h libweston: Add initial output API for windowed outputs configuration 2016-10-03 13:51:24 +03:00
zoom.c include stdint.h for int32_t/uint32_t 2016-07-26 16:26:08 -07:00