From 6428fd13b781859bcb8649c374becbead4162243 Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Thu, 3 Nov 2022 14:34:17 -0500 Subject: [PATCH] pixman-renderer: Use paced logger for overdraw warning Mimic the existing behaviour of logging once, but make it once per output instead of per run. Signed-off-by: Derek Foreman --- include/libweston/libweston.h | 1 + libweston/pixman-renderer.c | 14 ++++++-------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/include/libweston/libweston.h b/include/libweston/libweston.h index 92941ec0..0e7d9846 100644 --- a/include/libweston/libweston.h +++ b/include/libweston/libweston.h @@ -520,6 +520,7 @@ struct weston_output { bool allow_protection; struct weston_log_pacer repaint_delay_pacer; + struct weston_log_pacer pixman_overdraw_pacer; int (*start_repaint_loop)(struct weston_output *output); int (*repaint)(struct weston_output *output, pixman_region32_t *damage); diff --git a/libweston/pixman-renderer.c b/libweston/pixman-renderer.c index 4af010bc..da81a50c 100644 --- a/libweston/pixman-renderer.c +++ b/libweston/pixman-renderer.c @@ -234,7 +234,8 @@ composite_whole(pixman_op_t op, } static void -composite_clipped(pixman_image_t *src, +composite_clipped(struct weston_output *output, + pixman_image_t *src, pixman_image_t *mask, pixman_image_t *dest, const pixman_transform_t *transform, @@ -303,12 +304,9 @@ composite_clipped(pixman_image_t *src, } if (n_box > 1) { - static bool warned = false; - - if (!warned) - weston_log("Pixman-renderer warning: %dx overdraw\n", - n_box); - warned = true; + weston_log_paced(&output->pixman_overdraw_pacer, 1, 0, + "Pixman-renderer warning: %dx overdraw\n", + n_box); } } @@ -364,7 +362,7 @@ repaint_region(struct weston_view *ev, struct weston_output *output, } if (source_clip) - composite_clipped(ps->image, mask_image, target_image, + composite_clipped(output, ps->image, mask_image, target_image, &transform, filter, source_clip); else composite_whole(pixman_op, ps->image, mask_image,