From 03686c9f89e326efaa98722608de614baad03f6f Mon Sep 17 00:00:00 2001 From: Marius Vlad Date: Wed, 14 Jan 2026 13:44:31 +0200 Subject: [PATCH] libweston: Adjust order for tracking dirty paint nodes Commit 008884f28 ("compositor: Move dirty buffer handling to paint node early update") makes the dirty paint node bit being cleared in the update early function which makes t too late to check in the paint node update late where we used to accumulate painted frames. Just move it before the early update to make we still have a way to print painted frames counter. Signed-off-by: Marius Vlad --- libweston/compositor.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/libweston/compositor.c b/libweston/compositor.c index 2f8575154..2a376db8b 100644 --- a/libweston/compositor.c +++ b/libweston/compositor.c @@ -3750,8 +3750,22 @@ weston_output_repaint(struct weston_output *output) output->desired_protection = highest_requested; wl_list_for_each(pnode, &output->paint_node_z_order_list, - z_order_link) + z_order_link) { + + /* we can't place this after paint_node_update_early() as the + * paint node status would be cleared after the early update; + * + * note that this isn't perfect as the paint node visibly might + * change in output_update_visibility() such that this + * information would be a frame late of the actual visibility + * status. On the next frame this would be correct to actual + * reflect that. */ + if (pnode->status & WESTON_PAINT_NODE_BUFFER_DIRTY && + pixman_region32_not_empty(&pnode->visible)) + pnode->surface->painted_frame_counter++; + paint_node_update_early(pnode); + } output_update_visibility(output); @@ -3759,15 +3773,6 @@ weston_output_repaint(struct weston_output *output) wl_list_for_each(pnode, &output->paint_node_z_order_list, z_order_link) { - - /* we can't place this in the last paint node iteration list - * because the paint node status are cleared after the late - * update and in the same time we'd still need to check for - * paint node occlusion */ - if (pnode->status & WESTON_PAINT_NODE_BUFFER_DIRTY && - pixman_region32_not_empty(&pnode->visible)) - pnode->surface->painted_frame_counter++; - paint_node_update_late(pnode); }