summaryrefslogtreecommitdiff
path: root/compositor
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <emmanuel.peyrot@collabora.com>2017-03-07 13:27:54 +0000
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>2017-03-07 16:42:40 +0200
commit11ae2a3036bc95ff26b12a6d60f12514d8145143 (patch)
treedba5cea1e7a163a35e44b096da652b70cb9e75e2 /compositor
parent8a888a5fe52b9573f6caca4aec4a1ea0c336b0b2 (diff)
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>
Diffstat (limited to 'compositor')
-rw-r--r--compositor/main.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/compositor/main.c b/compositor/main.c
index 72c3cd10..e870dd4a 100644
--- a/compositor/main.c
+++ b/compositor/main.c
@@ -1235,6 +1235,8 @@ load_drm_backend(struct weston_compositor *c,
weston_config_section_get_string(section,
"gbm-format", &config.gbm_format,
NULL);
+ weston_config_section_get_uint(section, "pageflip-timeout",
+ &config.pageflip_timeout, 0);
config.base.struct_version = WESTON_DRM_BACKEND_CONFIG_VERSION;
config.base.struct_size = sizeof(struct weston_drm_backend_config);