From e0928370b60fa3646c6c866ac82e88d3db98db29 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 21 Oct 2019 16:05:56 +0200 Subject: [PATCH] drm: Mark buffer as clean in ply_renderer_head_new() We do not want to set our buffer as scanout source before it has been drawn to by the splash, to avoid a flicker caused by us installing a black buffer for scanout. To avoid this, flush_head() only calls reset_scan_out_buffer() if the buffer for the head has updated_areas, iow if it already has been drawn to. Our ply_pixel_buffer_fill_with_color() call in ply_renderer_head_new() causes updated_areas to be non-empty, triggering a reset_scan_out_buffer() call before the buffer has been drawn at least once. This commit fixes this by clearing the updated_areas after the ply_pixel_buffer_fill_with_color() call. Signed-off-by: Hans de Goede --- src/plugins/renderers/drm/plugin.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/renderers/drm/plugin.c b/src/plugins/renderers/drm/plugin.c index 32ed4d11..b1e0ed61 100644 --- a/src/plugins/renderers/drm/plugin.c +++ b/src/plugins/renderers/drm/plugin.c @@ -644,6 +644,8 @@ ply_renderer_head_new (ply_renderer_backend_t *backend, ply_trace ("Creating %ldx%ld renderer head", head->area.width, head->area.height); ply_pixel_buffer_fill_with_color (head->pixel_buffer, NULL, 0.0, 0.0, 0.0, 1.0); + /* Delay flush till first actual draw */ + ply_region_clear (ply_pixel_buffer_get_updated_areas (head->pixel_buffer)); if (output->connector_type == DRM_MODE_CONNECTOR_LVDS || output->connector_type == DRM_MODE_CONNECTOR_eDP ||