From 3d50069afca53a61b3837812f76d9a1255e55437 Mon Sep 17 00:00:00 2001 From: Philipp Zabel Date: Mon, 25 Sep 2023 23:15:19 +0200 Subject: [PATCH] libweston: intersect all backends' supported presentation clocks In preparation for multi-backend support, determine the presentation clocks that are supported by all backends. Signed-off-by: Philipp Zabel --- libweston/compositor.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libweston/compositor.c b/libweston/compositor.c index 81e82bf2..dc9769cf 100644 --- a/libweston/compositor.c +++ b/libweston/compositor.c @@ -9143,9 +9143,11 @@ weston_compositor_set_presentation_clock(struct weston_compositor *compositor, WL_EXPORT int weston_compositor_backends_loaded(struct weston_compositor *compositor) { - struct weston_backend *backend = - wl_container_of(compositor->backend_list.next, backend, link); - uint32_t supported_clocks = backend->supported_presentation_clocks; + struct weston_backend *backend; + uint32_t supported_clocks = 0xffffffff; + + wl_list_for_each(backend, &compositor->backend_list, link) + supported_clocks &= backend->supported_presentation_clocks; if (weston_compositor_set_presentation_clock(compositor, supported_clocks) < 0) {