libweston: Use paced logger for bad repaint delays

Ideally we'd like to see this more than just a single time, but we'd also
like to prevent it from triggering endlessly. Let's also make this happen
per output.

While we're here, use the word "abnormal" instead of "insane"

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
This commit is contained in:
Derek Foreman 2022-11-03 14:27:27 -05:00
parent 8e661b3c93
commit f9b57c5234
2 changed files with 7 additions and 6 deletions

View File

@ -519,6 +519,8 @@ struct weston_output {
enum weston_hdcp_protection current_protection;
bool allow_protection;
struct weston_log_pacer repaint_delay_pacer;
int (*start_repaint_loop)(struct weston_output *output);
int (*repaint)(struct weston_output *output, pixman_region32_t *damage);
void (*destroy)(struct weston_output *output);

View File

@ -3308,12 +3308,11 @@ weston_output_finish_frame(struct weston_output *output,
msec_rel = timespec_sub_to_msec(&output->next_repaint, &now);
if (msec_rel < -1000 || msec_rel > 1000) {
static bool warned;
if (!warned)
weston_log("Warning: computed repaint delay is "
"insane: %lld msec\n", (long long) msec_rel);
warned = true;
weston_log_paced(&output->repaint_delay_pacer,
5, 60 * 60 * 1000,
"Warning: computed repaint delay for output "
"[%s] is abnormal: %lld msec\n",
output->name, (long long) msec_rel);
output->next_repaint = now;
}