summaryrefslogtreecommitdiff
path: root/src/compositor.h
diff options
context:
space:
mode:
authorPekka Paalanen <pekka.paalanen@collabora.co.uk>2014-12-17 16:20:40 +0200
committerBryce Harrington <bryce@osg.samsung.com>2015-01-20 17:13:05 -0800
commit363aa7bc76bb1341467b7c073d08b7ebca26cdcb (patch)
tree15447ffbd54e4c2d9eea28ea835f1006dd179819 /src/compositor.h
parent0de22a38e6376521ec4003c1e6140714fd3500bc (diff)
downloadweston-363aa7bc76bb1341467b7c073d08b7ebca26cdcb.tar.gz
compositor: set presentation.presented flags
Change weston_output_finish_frame() signature so that backends are required to set the flags, that will be reported on the Presentation 'presented' event. This is meant for output-wide feedback flags. Flags that vary per wl_surface are subject for the following patch. All start_repaint_loop functions use the special private flag PRESENTATION_FEEDBACK_INVALID to mark, that this call of weston_output_finish_frame() cannot trigger the 'presented' event. If it does, we now hit an assert, and should then investigate why a fake update triggered Presentation feedback. DRM: Page flip is always vsync'd, and always gets the completion timestamp from the kernel which should correspond well to hardware. Completion is triggered by the kernel/hardware. Vblank handler is only used with the broken planes path, therefore do not report VSYNC, because we cannot guarantee all the planes updated at the same time. We cannot set the INVALID, because it would abort the compositor if the broken planes path was ever used. This is a hack that will get fixed with nuclear pageflip support in the future. fbdev: No vsync, update done by copy, no completion event from hardware, and completion time is totally fake. headless: No real output to update. RDP: Guessing that maybe no vsync, fake time, and copy make sense (pixels sent over network). Also no event that the pixels have been shown? RPI: Presumably Dispmanx updates are vsync'd. We get a completion event from the driver, but need to read the clock ourselves, so the completion time is somewhat unreliable. Zero-copy flag not implemented though it would be theoretically possible with EGL clients (zero-copy is a per-surface flag anyway, so in this patch). Wayland: No information how the host compositor is doing updates, so make a safe guess without assuming vsync or hardware completion event. While we do get some timestamp from the host compositor, it is not the completion time. Would need to hook to the Presentation extension of the host compositor to get more accurate flags. X11: No idea about vsync, completion event, or copying. Also the timestamp is a fake. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Mario Kleiner <mario.kleiner.de@gmail.com> Tested-by: Mario Kleiner <mario.kleiner.de@gmail.com> Acked-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Diffstat (limited to 'src/compositor.h')
-rw-r--r--src/compositor.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/compositor.h b/src/compositor.h
index 3f7ed4a1..3a266356 100644
--- a/src/compositor.h
+++ b/src/compositor.h
@@ -1066,9 +1066,13 @@ weston_compositor_stack_plane(struct weston_compositor *ec,
struct weston_plane *plane,
struct weston_plane *above);
+/* An invalid flag in presented_flags to catch logic errors. */
+#define PRESENTATION_FEEDBACK_INVALID (1U << 31)
+
void
weston_output_finish_frame(struct weston_output *output,
- const struct timespec *stamp);
+ const struct timespec *stamp,
+ uint32_t presented_flags);
void
weston_output_schedule_repaint(struct weston_output *output);
void