summaryrefslogtreecommitdiff
path: root/drivers/tty/vt
diff options
context:
space:
mode:
authorManuel Schölling <manuel.schoelling@gmx.de>2017-01-13 23:07:56 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-01-25 13:54:02 +0300
commitbcd375f7f71f7106c97516bf5395149954ef8810 (patch)
treed3622fbb8a88f55aa8223c343e6dcb9b81d6740c /drivers/tty/vt
parent66da39eb91b42ab70dd49ef0b9ac5f4cfa76c9c3 (diff)
downloadlinux-bcd375f7f71f7106c97516bf5395149954ef8810.tar.xz
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 <manuel.schoelling@gmx.de> Reviewed-by: Andrey Utkin <andrey_utkin@fastmail.com> Tested-by: Andrey Utkin <andrey_utkin@fastmail.com> Tested-by: Adam Borowski <kilobyte@angband.pl> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/vt')
-rw-r--r--drivers/tty/vt/vt.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c
index 4c10a9df3b91..9d3ce505e7ab 100644
--- a/drivers/tty/vt/vt.c
+++ b/drivers/tty/vt/vt.c
@@ -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);