[PATCH weston] main: report presentation clock resolution
Hardening
rdp.effort at gmail.com
Wed Jun 15 12:28:09 UTC 2016
Le 13/06/2016 13:34, Pekka Paalanen a écrit :
> From: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
>
> For debugging weird timing issues. If your clock resolution is
> unexpectedly e.g. 10 ms, you can be sure you will have strange timing
> issues. This is almost certainly caused by kernel misconfiguration.
>
> We rely on clock_getres() being available by the same thing that gets us
> clock_gettime(), so that no new configure.ac check is needed.
>
> Signed-off-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
> ---
> src/main.c | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/src/main.c b/src/main.c
> index 193a845..28f6969 100644
> --- a/src/main.c
> +++ b/src/main.c
> @@ -647,6 +647,7 @@ weston_compositor_log_capabilities(struct weston_compositor *compositor)
> {
> unsigned i;
> int yes;
> + struct timespec res;
>
> weston_log("Compositor capabilities:\n");
> for (i = 0; i < ARRAY_LENGTH(capability_strings); i++) {
> @@ -659,6 +660,14 @@ weston_compositor_log_capabilities(struct weston_compositor *compositor)
> weston_log_continue(STAMP_SPACE "presentation clock: %s, id %d\n",
> clock_name(compositor->presentation_clock),
> compositor->presentation_clock);
> +
> + if (clock_getres(compositor->presentation_clock, &res) == 0)
> + weston_log_continue(STAMP_SPACE
> + "presentation clock resolution: %d.%09ld s\n",
> + (int)res.tv_sec, res.tv_nsec);
> + else
> + weston_log_continue(STAMP_SPACE
> + "presentation clock resolution: N/A\n");
> }
>
> static void
>
Reviewed-By: David Fort <contact at hardening-consulting.com>
--
David FORT
website: http://www.hardening-consulting.com/
More information about the wayland-devel
mailing list