summaryrefslogtreecommitdiff
path: root/src/compositor-wayland.c
diff options
context:
space:
mode:
authorPekka Paalanen <pekka.paalanen@collabora.co.uk>2015-04-02 16:26:06 +0300
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>2015-04-07 11:27:27 +0300
commit04f8a9b3fa130b2ac9bc5af49e9ec3c9976f56e3 (patch)
tree2987982e10ff0b434e4e1d97ad228997482e54b9 /src/compositor-wayland.c
parentf30af4e50d192d2bde0e2d4c3e2b2a076a6f13bb (diff)
downloadweston-04f8a9b3fa130b2ac9bc5af49e9ec3c9976f56e3.tar.gz
compositor-wayland: ignore frame callback's time
Weston running the Wayland backend is nested. The parent compositor uses an unknown clock for the frame callback timestamps. This is quite likely a different clock from what the nested Weston chose as its presentation clock. This means we cannot reasonably read the presentation clock and assume it has any relation to the timestamp got from the frame callback. In fact, this was seen to cause absurd repaint delays, trigger the insanity check, reduce fraterate, etc. problems, because we assume we can read the clock and compute the remaining repaint delay. As we can't use the timestamp, ignore it, and read our own presentation clock instead. The X11 backend does not suffer from this, because there the parent window system never provides us any timestamps, so we always read our own clock. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Derek Foreman <derekf@osg.samsung.com> Acked-by: Giulio Camuffo <giuliocamuffo@gmail.com>
Diffstat (limited to 'src/compositor-wayland.c')
-rw-r--r--src/compositor-wayland.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/compositor-wayland.c b/src/compositor-wayland.c
index 7e59ecd5..6c333619 100644
--- a/src/compositor-wayland.c
+++ b/src/compositor-wayland.c
@@ -312,8 +312,15 @@ frame_done(void *data, struct wl_callback *callback, uint32_t time)
wl_callback_destroy(callback);
/* XXX: use the presentation extension for proper timings */
- ts.tv_sec = time / 1000;
- ts.tv_nsec = (time % 1000) * 1000000;
+
+ /*
+ * This is the fallback case, where Presentation extension is not
+ * available from the parent compositor. We do not know the base for
+ * 'time', so we cannot feed it to finish_frame(). Do the only thing
+ * we can, and pretend finish_frame time is when we process this
+ * event.
+ */
+ weston_compositor_read_presentation_clock(output->compositor, &ts);
weston_output_finish_frame(output, &ts, 0);
}