Merge branch 'for-3.0-important' of git://git.drbd.org/linux-2.6-drbd into for-linus
[firefly-linux-kernel-4.4.55.git] / drivers / tty / vt / vt.c
index 4bea1efaec98edbff2dbc2e5db27ac807d70c7fb..b3915b7ad3e2facb654dbd50114623f01996f431 100644 (file)
@@ -1,6 +1,4 @@
 /*
- *  linux/drivers/char/vt.c
- *
  *  Copyright (C) 1991, 1992  Linus Torvalds
  */
 
@@ -858,7 +856,7 @@ static int vc_do_resize(struct tty_struct *tty, struct vc_data *vc,
 {
        unsigned long old_origin, new_origin, new_scr_end, rlth, rrem, err = 0;
        unsigned long end;
-       unsigned int old_cols, old_rows, old_row_size, old_screen_size;
+       unsigned int old_rows, old_row_size;
        unsigned int new_cols, new_rows, new_row_size, new_screen_size;
        unsigned int user;
        unsigned short *newscreen;
@@ -887,9 +885,7 @@ static int vc_do_resize(struct tty_struct *tty, struct vc_data *vc,
                return -ENOMEM;
 
        old_rows = vc->vc_rows;
-       old_cols = vc->vc_cols;
        old_row_size = vc->vc_size_row;
-       old_screen_size = vc->vc_screenbuf_size;
 
        err = resize_screen(vc, new_cols, new_rows, user);
        if (err) {
@@ -1197,6 +1193,13 @@ static void csi_J(struct vc_data *vc, int vpar)
                                              vc->vc_x + 1);
                        }
                        break;
+               case 3: /* erase scroll-back buffer (and whole display) */
+                       scr_memsetw(vc->vc_screenbuf, vc->vc_video_erase_char,
+                                   vc->vc_screenbuf_size >> 1);
+                       set_origin(vc);
+                       if (CON_IS_VISIBLE(vc))
+                               update_screen(vc);
+                       /* fall through */
                case 2: /* erase whole display */
                        count = vc->vc_cols * vc->vc_rows;
                        start = (unsigned short *)vc->vc_origin;