From 01b7e9d015dff2fb60996692ddbd331bf90d91a9 Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Wed, 22 Oct 2025 15:25:31 -0500 Subject: [PATCH] compositor: store frame flags from finish frame These are used to determine if the previous frame was displayed with tearing, which is useful in determining when the next frame time should be. Store these as a step towards breaking the frame time calculations out of output_finish_frame into a separate function. Signed-off-by: Derek Foreman --- include/libweston/libweston.h | 1 + libweston/compositor.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/include/libweston/libweston.h b/include/libweston/libweston.h index 7a3f2e001..cc4a1cd3b 100644 --- a/include/libweston/libweston.h +++ b/include/libweston/libweston.h @@ -445,6 +445,7 @@ struct weston_output { struct wl_signal destroy_signal; /**< sent when disabled */ struct weston_coord_global move; struct timespec frame_time; /* presentation timestamp */ + uint32_t frame_flags; /* presentation flags */ uint64_t msc; /* media stream counter */ int disable_planes; int destroying; diff --git a/libweston/compositor.c b/libweston/compositor.c index 192af8df4..360693a61 100644 --- a/libweston/compositor.c +++ b/libweston/compositor.c @@ -4154,6 +4154,7 @@ weston_output_finish_frame(struct weston_output *output, if (!stamp) { output->next_repaint = now; output->next_present = now; + output->frame_flags = 0; goto out; } @@ -4172,6 +4173,7 @@ weston_output_finish_frame(struct weston_output *output, } output->frame_time = *stamp; + output->frame_flags = presented_flags; /* If we're tearing just repaint right away */ if (presented_flags & WESTON_FINISH_FRAME_TEARING) {