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.
This commit is contained in:
Ray Strode 2012-06-06 11:55:35 -04:00
parent 64ccdadae8
commit 171c329f40

View file

@ -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;
}