From 282f66f6752e74c06a3d8ba7a27bc89eadbcf23c Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Tue, 5 Dec 2023 16:19:19 -0500 Subject: [PATCH] drm: Add new plymouth.set-mode-on-redraws debug option This option forces a modeset every frame --- src/plugins/renderers/drm/plugin.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/plugins/renderers/drm/plugin.c b/src/plugins/renderers/drm/plugin.c index 60684af9..a410be07 100644 --- a/src/plugins/renderers/drm/plugin.c +++ b/src/plugins/renderers/drm/plugin.c @@ -1699,9 +1699,21 @@ flush_head (ply_renderer_backend_t *backend, ply_pixel_buffer_t *pixel_buffer; char *map_address; bool dirty = false; + static enum { PLY_SET_MODE_ON_REDRAWS_UNKNOWN = -1, + PLY_SET_MODE_ON_REDRAWS_DISABLED, + PLY_SET_MODE_ON_REDRAWS_ENABLED } set_mode_on_redraws = PLY_SET_MODE_ON_REDRAWS_UNKNOWN; assert (backend != NULL); + if (set_mode_on_redraws == PLY_SET_MODE_ON_REDRAWS_UNKNOWN) { + if (ply_kernel_command_line_has_argument ("plymouth.set-mode-on-redraws")) { + ply_trace ("Mode getting reset every redraw"); + set_mode_on_redraws = PLY_SET_MODE_ON_REDRAWS_ENABLED; + } else { + set_mode_on_redraws = PLY_SET_MODE_ON_REDRAWS_DISABLED; + } + } + if (!backend->is_active) return; @@ -1731,6 +1743,11 @@ flush_head (ply_renderer_backend_t *backend, node = ply_list_get_next_node (areas_to_flush, node); } + if (set_mode_on_redraws == PLY_SET_MODE_ON_REDRAWS_ENABLED) { + dirty = true; + head->scan_out_buffer_needs_reset = true; + } + if (dirty) { if (reset_scan_out_buffer_if_needed (backend, head)) ply_trace ("Needed to reset scan out buffer on %ldx%ld renderer head", -- 2.47.3