]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
drm: Install our fb after drawing to it
authorHans de Goede <hdegoede@redhat.com>
Sat, 12 Oct 2019 14:31:04 +0000 (16:31 +0200)
committerHans de Goede <hdegoede@redhat.com>
Sun, 13 Oct 2019 10:32:59 +0000 (12:32 +0200)
If we need to (re)install our fb as the buffer to scan-out of during
flush, then do so after updating our fb contents, rather then before.

This removes another potential source of flickering.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
src/plugins/renderers/drm/plugin.c

index 5f25099db7db4308e339d599f07b34d52ecfb463..0b7aad3e36199ee54ae1031dd8e278a73c133661 100644 (file)
@@ -1614,6 +1614,7 @@ flush_head (ply_renderer_backend_t *backend,
         ply_list_node_t *node;
         ply_pixel_buffer_t *pixel_buffer;
         char *map_address;
+        bool dirty = false;
 
         assert (backend != NULL);
 
@@ -1645,16 +1646,19 @@ flush_head (ply_renderer_backend_t *backend,
 
                 next_node = ply_list_get_next_node (areas_to_flush, node);
 
-                if (reset_scan_out_buffer_if_needed (backend, head))
-                        ply_trace ("Needed to reset scan out buffer on %ldx%ld renderer head",
-                                   head->area.width, head->area.height);
-
                 ply_renderer_head_flush_area (head, area_to_flush, map_address);
+                dirty = true;
 
                 node = next_node;
         }
 
-        end_flush (backend, head->scan_out_buffer_id);
+        if (dirty) {
+                if (reset_scan_out_buffer_if_needed (backend, head))
+                        ply_trace ("Needed to reset scan out buffer on %ldx%ld renderer head",
+                                   head->area.width, head->area.height);
+
+                end_flush (backend, head->scan_out_buffer_id);
+        }
 
         ply_region_clear (updated_region);
 }