From 03206ea1772b3bfe0e0a87454f6cbe3f0da759c2 Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Thu, 13 Feb 2020 12:38:38 +1300 Subject: [PATCH] Remember if direct scanout fails If a view fails direct scanout, we remember if it fails so we don't bother trying again. This removes a lot of log spam of the atomic DRM test failing in this case. --- include/sway/tree/view.h | 1 + sway/desktop/output.c | 13 ++++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/include/sway/tree/view.h b/include/sway/tree/view.h index 29c87967e..3948599f6 100644 --- a/include/sway/tree/view.h +++ b/include/sway/tree/view.h @@ -75,6 +75,7 @@ struct sway_view { char *title_format; bool using_csd; + bool failed_scan_out; struct timespec urgent; bool allow_request_urgent; diff --git a/sway/desktop/output.c b/sway/desktop/output.c index ec662a8c5..0ae5b0d5c 100644 --- a/sway/desktop/output.c +++ b/sway/desktop/output.c @@ -453,6 +453,10 @@ static bool scan_out_fullscreen_view(struct sway_output *output, return false; } + if (view->failed_scan_out) { + return false; + } + if (view->saved_buffer) { return false; } @@ -502,9 +506,16 @@ static bool scan_out_fullscreen_view(struct sway_output *output, wlr_output); if (!wlr_output_attach_buffer(wlr_output, surface->buffer)) { + view->failed_scan_out = true; return false; } - return wlr_output_commit(wlr_output); + + if (!wlr_output_commit(wlr_output)) { + view->failed_scan_out = true; + return false; + } + + return true; } int output_repaint_timer_handler(void *data) {