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 <derek.foreman@collabora.com>
This commit is contained in:
Derek Foreman 2025-10-22 15:25:31 -05:00
parent f1bcedd089
commit 01b7e9d015
2 changed files with 3 additions and 0 deletions

View file

@ -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;

View file

@ -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) {