From 64ef093397fc5138508c28e669ed7f3a2512c41b Mon Sep 17 00:00:00 2001 From: Marius Vlad Date: Tue, 10 Mar 2026 23:36:24 +0200 Subject: [PATCH] libweston: Add Perfetto debug annotation for buffer info This adds annotation at surface attach time. Signed-off-by: Marius Vlad --- libweston/surface-state.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/libweston/surface-state.c b/libweston/surface-state.c index 59643dc76..1513655d4 100644 --- a/libweston/surface-state.c +++ b/libweston/surface-state.c @@ -200,11 +200,20 @@ weston_surface_attach(struct weston_surface *surface, struct weston_surface_state *state, enum weston_surface_status status) { - WESTON_TRACE_FUNC_FLOW(&surface->flow_id); struct weston_buffer *buffer = state->buffer_ref.buffer; struct weston_buffer *old_buffer = surface->buffer_ref.buffer; enum weston_paint_node_status pnode_changes = WESTON_PAINT_NODE_CLEAN; + WESTON_TRACE_BEGIN_ANNOTATION(); + if (buffer) { + WESTON_TRACE_ANNOTATE_ADD_STR("surface", surface->internal_name); + WESTON_TRACE_ANNOTATE_ADD_STR("format", buffer->pixel_format->drm_format_name); + WESTON_TRACE_ANNOTATE_ADD_STR("modifier", buffer->format_modifier_name); + WESTON_TRACE_ANNOTATE_ADD_INT("width", buffer->width); + WESTON_TRACE_ANNOTATE_ADD_INT("height", buffer->height); + } + WESTON_TRACE_ANNOTATE_FUNC_FLOW(&surface->flow_id); + if (!buffer) { if (weston_surface_is_mapped(surface)) { weston_surface_unmap(surface);