]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
drm: Add new plymouth.set-mode-on-redraws debug option
authorRay Strode <rstrode@redhat.com>
Tue, 5 Dec 2023 21:19:19 +0000 (16:19 -0500)
committerRay Strode <rstrode@redhat.com>
Tue, 5 Dec 2023 21:27:37 +0000 (16:27 -0500)
This option forces a modeset every frame

src/plugins/renderers/drm/plugin.c

index 60684af9e0cb96207c5cc18dd346bfe21a19df27..a410be07cd392b4974ae9c7dcef139326e89552c 100644 (file)
@@ -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",