From: Ray Strode Date: Wed, 6 Jun 2012 15:55:35 +0000 (-0400) Subject: drm: flush pending draw to kernel buffer on vt switch X-Git-Tag: 0.8.5~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=171c329f401056bdb213e4071ff7f150c6f2e7ee;p=thirdparty%2Fplymouth.git drm: flush pending draw to kernel buffer on vt switch When plymouth's VT is not the foreground VT, we tell the kernel not to scan out from the kernel buffer we manage. Also, we don't bother dispatching rendering to the kernel buffer (since it's not getting scanned out anyway). When plymouth's VT becomes the foreground VT, we tell the kernel to start scanning out from our buffer again. Unfortunately, we neglect to flush all the pending drawing that happens while VT switched away. This means we briefly show stale contents. This commit flushes all pending rendering to the kernel, before resetting the scan out buffer, so we get a current view of the splash shown immediately. --- diff --git a/src/plugins/renderers/drm/plugin.c b/src/plugins/renderers/drm/plugin.c index a4fe3bef..db953e68 100644 --- a/src/plugins/renderers/drm/plugin.c +++ b/src/plugins/renderers/drm/plugin.c @@ -136,6 +136,8 @@ static bool open_input_source (ply_renderer_backend_t *backend, ply_renderer_input_source_t *input_source); static bool reset_scan_out_buffer_if_needed (ply_renderer_backend_t *backend, ply_renderer_head_t *head); +static void flush_head (ply_renderer_backend_t *backend, + ply_renderer_head_t *head); static bool ply_renderer_head_add_connector (ply_renderer_head_t *head, @@ -465,8 +467,16 @@ activate (ply_renderer_backend_t *backend) next_node = ply_list_get_next_node (backend->heads, node); if (head->scan_out_buffer_id != 0) - 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); + + /* Then send the buffer to the monitor + */ + ply_renderer_head_set_scan_out_buffer (backend, head, + head->scan_out_buffer_id); + } node = next_node; }