compositor, backends: weston_compositor_read_presentation_clock
Create a new function weston_compositor_read_presentation_clock() to
wrap the clock_gettime() call for the Presentation clock.
Reading the presentation clock is never supposed to fail, but if it
does, this will notify about it. I have not seen it fail yet, though.
This prepares for new testing features in the future that might allow
controlling the presentation clock. Right now it is just a convenience
function for clock_gettime().
All presentation clock readers are converted to call this new function
except rpi-backend's rpi_flippipe_update_complete(), because it gets its
clock id via a thread-safe mechanism. There shouldn't be anything really
thread-unsafe in weston_compositor_read_presentation_clock() at the
moment, but might be in the future, and weston core is not expected to
need to be thread-safe.
This is based on the original patch by
Cc: Derek Foreman <derekf@osg.samsung.com>
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
diff --git a/src/compositor.h b/src/compositor.h
index 26df74b..a05b208 100644
--- a/src/compositor.h
+++ b/src/compositor.h
@@ -1343,6 +1343,11 @@
weston_compositor_set_presentation_clock_software(
struct weston_compositor *compositor);
void
+weston_compositor_read_presentation_clock(
+ const struct weston_compositor *compositor,
+ struct timespec *ts);
+
+void
weston_compositor_shutdown(struct weston_compositor *ec);
void
weston_compositor_exit_with_code(struct weston_compositor *compositor,