From 9aa910c4d4b732860347e665f43fc7d1958ccc63 Mon Sep 17 00:00:00 2001 From: Marius Vlad Date: Tue, 25 Mar 2025 11:57:31 +0200 Subject: [PATCH] backend-drm: Fix count page flips on invalid outputs Slight oversight of counting page flips from within the atomic commit handler when we don't really have an output. Do that after *after* checking for a valid output. Fixes: cda8de10897c6, ("backend-drm: Count and display KMS page flips") Signed-off-by: Marius Vlad --- libweston/backend-drm/kms.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libweston/backend-drm/kms.c b/libweston/backend-drm/kms.c index d9f4ea999..0dc97cc36 100644 --- a/libweston/backend-drm/kms.c +++ b/libweston/backend-drm/kms.c @@ -1906,7 +1906,6 @@ atomic_flip_handler(int fd, unsigned int frame, unsigned int sec, assert(crtc); output = crtc->output; - output->page_flips_counted++; /* During the initial modeset, we can disable CRTCs which we don't * actually handle during normal operation; this will give us events @@ -1914,6 +1913,8 @@ atomic_flip_handler(int fd, unsigned int frame, unsigned int sec, if (!output || !output->base.enabled) return; + output->page_flips_counted++; + drm_output_update_msc(output, frame); if (output->state_cur->tear) {