From b293882d7c8d6c4d8b8b9fb25d49fa6a35cfd0ca Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 21 Oct 2019 16:00:44 +0200 Subject: [PATCH] drm: Remove explicit set_scan_out_buffer() from activate() flush_head() already sets the scan-out buffer if necessary and if it is not necessary then we do not want to do this. Specifically second and later heads do not yet have their buffer drawn to when activate gets called from the map_to_device call for the first head and then we do not want to start scanning out the uninitialized buffer. Removing the explicit ply_renderer_head_set_scan_out_buffer() call also allows removing the if (head->scan_out_buffer_id != 0) check, flush_head() already checks this itself. Signed-off-by: Hans de Goede --- src/plugins/renderers/drm/plugin.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/plugins/renderers/drm/plugin.c b/src/plugins/renderers/drm/plugin.c index b1e0ed61..fea26eb1 100644 --- a/src/plugins/renderers/drm/plugin.c +++ b/src/plugins/renderers/drm/plugin.c @@ -947,16 +947,8 @@ activate (ply_renderer_backend_t *backend) head = (ply_renderer_head_t *) ply_list_node_get_data (node); next_node = ply_list_get_next_node (backend->heads, node); - if (head->scan_out_buffer_id != 0) { - /* Flush out any pending drawing to the buffer - */ - flush_head (backend, head); - - /* Then send the buffer to the monitor - */ - ply_renderer_head_set_scan_out_buffer (backend, head, - head->scan_out_buffer_id); - } + /* Flush out any pending drawing to the buffer */ + flush_head (backend, head); node = next_node; } -- 2.47.3