console: Add callback to flush scrollback buffer to consw struct

This new callback is in preparation for persistent scrollback buffer
support for VGA consoles.
With a single scrollback buffer for all consoles, we could flush the
buffer just by invocating consw->con_switch(). But when each VGA console
has its own scrollback buffer, we need a new callback to tell the
video console driver which buffer to flush.

Signed-off-by: Manuel Schölling <[email protected]>
Reviewed-by: Andrey Utkin <[email protected]>
Tested-by: Andrey Utkin <[email protected]>
Tested-by: Adam Borowski <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
Manuel Schölling 2017-01-13 21:07:56 +01:00 • committed by Greg Kroah-Hartman
commit bcd375f7f7
3 changed files with 36 additions and 1 deletions

View file

@ -625,6 +625,14 @@ static void save_screen(struct vc_data *vc)
vc->vc_sw->con_save_screen(vc);
}
static void flush_scrollback(struct vc_data *vc)
{
WARN_CONSOLE_UNLOCKED();
if (vc->vc_sw->con_flush_scrollback)
vc->vc_sw->con_flush_scrollback(vc);
}
/*
* Redrawing of screen
*/
@ -1171,6 +1179,7 @@ static void csi_J(struct vc_data *vc, int vpar)
case 3: /* erase scroll-back buffer (and whole display) */
scr_memsetw(vc->vc_screenbuf, vc->vc_video_erase_char,
vc->vc_screenbuf_size);
flush_scrollback(vc);
set_origin(vc);
if (con_is_visible(vc))
update_screen(vc);