]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
Revert "UBUNTU: SAUCE: vt -- maintain bootloader screen mode and content until vt...
authorPaolo Pisati <paolo.pisati@canonical.com>
Fri, 10 Dec 2021 10:56:10 +0000 (11:56 +0100)
committerPaolo Pisati <paolo.pisati@canonical.com>
Fri, 10 Dec 2021 10:56:10 +0000 (11:56 +0100)
Upstream FRAMEBUFFER_CONSOLE_DEFERRED_TAKEOVER supersedes this SAUCE
patch.

This reverts commit 320cfac8ef319a24d1f6871b2b1e85fa2c3681aa.

Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
drivers/tty/vt/vt.c
drivers/tty/vt/vt_ioctl.c
include/linux/vt_kern.h
include/uapi/linux/kd.h

index 936ecb0a1891a1b1cefddde39330cd79c7532991..7359c3e80d63e2ff2ebfaa4ed98d3dc6f71f3341 100644 (file)
 #include <linux/ctype.h>
 #include <linux/bsearch.h>
 #include <linux/gcd.h>
-#include <linux/screen_info.h>
 
 #define MAX_NR_CON_DRIVER 16
 
@@ -143,7 +142,7 @@ static const struct consw *con_driver_map[MAX_NR_CONSOLES];
 
 static int con_open(struct tty_struct *, struct file *);
 static void vc_init(struct vc_data *vc, unsigned int rows,
-                   unsigned int cols, int do_clear, int mode);
+                   unsigned int cols, int do_clear);
 static void gotoxy(struct vc_data *vc, int new_x, int new_y);
 static void save_cur(struct vc_data *vc);
 static void reset_terminal(struct vc_data *vc, int do_clear);
@@ -167,9 +166,6 @@ module_param(global_cursor_default, int, S_IRUGO | S_IWUSR);
 static int cur_default = CUR_UNDERLINE;
 module_param(cur_default, int, S_IRUGO | S_IWUSR);
 
-int vt_handoff = 0;
-module_param_named(handoff, vt_handoff, int, S_IRUGO | S_IWUSR);
-
 /*
  * ignore_poke: don't unblank the screen when things are typed.  This is
  * mainly for the privacy of braille terminal users.
@@ -1012,13 +1008,6 @@ void redraw_screen(struct vc_data *vc, int is_switch)
                }
                if (tty0dev)
                        sysfs_notify(&tty0dev->kobj, NULL, "active");
-               /*
-                * If we are switching away from a transparent VT the contents
-                * will be lost, convert it into a blank text console then
-                * it will be repainted blank if we ever switch back.
-                */
-               if (old_vc->vc_mode == KD_TRANSPARENT)
-                       old_vc->vc_mode = KD_TEXT;
        } else {
                hide_cursor(vc);
                redraw = 1;
@@ -1164,7 +1153,7 @@ int vc_allocate(unsigned int currcons)    /* return 0 on success */
        if (global_cursor_default == -1)
                global_cursor_default = 1;
 
-       vc_init(vc, vc->vc_rows, vc->vc_cols, 1, KD_TEXT);
+       vc_init(vc, vc->vc_rows, vc->vc_cols, 1);
        vcs_make_sysfs(currcons);
        atomic_notifier_call_chain(&vt_notifier_list, VT_ALLOCATE, &param);
 
@@ -3459,7 +3448,7 @@ module_param_named(italic, default_italic_color, int, S_IRUGO | S_IWUSR);
 module_param_named(underline, default_underline_color, int, S_IRUGO | S_IWUSR);
 
 static void vc_init(struct vc_data *vc, unsigned int rows,
-                   unsigned int cols, int do_clear, int mode)
+                   unsigned int cols, int do_clear)
 {
        int j, k ;
 
@@ -3470,7 +3459,7 @@ static void vc_init(struct vc_data *vc, unsigned int rows,
 
        set_origin(vc);
        vc->vc_pos = vc->vc_origin;
-       reset_vc(vc, mode);
+       reset_vc(vc);
        for (j=k=0; j<16; j++) {
                vc->vc_palette[k++] = default_red[j] ;
                vc->vc_palette[k++] = default_grn[j] ;
@@ -3528,18 +3517,7 @@ static int __init con_init(void)
                mod_timer(&console_timer, jiffies + (blankinterval * HZ));
        }
 
-       if (vt_handoff > 0 && vt_handoff <= MAX_NR_CONSOLES) {
-               currcons = vt_handoff - 1;
-               vc_cons[currcons].d = vc = kzalloc(sizeof(struct vc_data), GFP_NOWAIT);
-               INIT_WORK(&vc_cons[currcons].SAK_work, vc_SAK);
-               tty_port_init(&vc->port);
-               visual_init(vc, currcons, 1);
-               vc->vc_screenbuf = kzalloc(vc->vc_screenbuf_size, GFP_NOWAIT);
-               vc_init(vc, vc->vc_rows, vc->vc_cols, 0, KD_TRANSPARENT);
-       }
        for (currcons = 0; currcons < MIN_NR_CONSOLES; currcons++) {
-               if (currcons == vt_handoff - 1)
-                       continue;
                vc_cons[currcons].d = vc = kzalloc(sizeof(struct vc_data), GFP_NOWAIT);
                INIT_WORK(&vc_cons[currcons].SAK_work, vc_SAK);
                tty_port_init(&vc->port);
@@ -3547,14 +3525,9 @@ static int __init con_init(void)
                /* Assuming vc->vc_{cols,rows,screenbuf_size} are sane here. */
                vc->vc_screenbuf = kzalloc(vc->vc_screenbuf_size, GFP_NOWAIT);
                vc_init(vc, vc->vc_rows, vc->vc_cols,
-                       currcons || !vc->vc_sw->con_save_screen, KD_TEXT);
+                       currcons || !vc->vc_sw->con_save_screen);
        }
        currcons = fg_console = 0;
-       if (vt_handoff > 0) {
-               printk(KERN_INFO "vt handoff: transparent VT on vt#%d\n",
-                                                               vt_handoff);
-               currcons = fg_console = vt_handoff - 1;
-       }
        master_display_fg = vc = vc_cons[currcons].d;
        set_origin(vc);
        save_screen(vc);
index 3aeca7997013631b507ce82de551bbe70aa9a7df..3639bb6dc372e288db75960253de4663a0dede06 100644 (file)
@@ -957,9 +957,9 @@ int vt_ioctl(struct tty_struct *tty,
        return 0;
 }
 
-void reset_vc(struct vc_data *vc, int mode)
+void reset_vc(struct vc_data *vc)
 {
-       vc->vc_mode = mode;
+       vc->vc_mode = KD_TEXT;
        vt_reset_unicode(vc->vc_num);
        vc->vt_mode.mode = VT_AUTO;
        vc->vt_mode.waitv = 0;
@@ -990,7 +990,7 @@ void vc_SAK(struct work_struct *work)
                 */
                if (tty)
                        __do_SAK(tty);
-               reset_vc(vc, KD_TEXT);
+               reset_vc(vc);
        }
        console_unlock();
 }
@@ -1176,7 +1176,7 @@ static void complete_change_console(struct vc_data *vc)
                 * this outside of VT_PROCESS but there is no single process
                 * to account for and tracking tty count may be undesirable.
                 */
-                       reset_vc(vc, KD_TEXT);
+                       reset_vc(vc);
 
                        if (old_vc_mode != vc->vc_mode) {
                                if (vc->vc_mode == KD_TEXT)
@@ -1248,7 +1248,7 @@ void change_console(struct vc_data *new_vc)
                 * this outside of VT_PROCESS but there is no single process
                 * to account for and tracking tty count may be undesirable.
                 */
-               reset_vc(vc, KD_TEXT);
+               reset_vc(vc);
 
                /*
                 * Fall through to normal (VT_AUTO) handling of the switch...
index 7bd1c04c307a0fec44449493fe95973938958aa7..b5ab452fca5b5ceaf3c741a2e0888c2950a61ce4 100644 (file)
@@ -116,7 +116,7 @@ int con_copy_unimap(struct vc_data *dst_vc, struct vc_data *src_vc)
 void vt_event_post(unsigned int event, unsigned int old, unsigned int new);
 int vt_waitactive(int n);
 void change_console(struct vc_data *new_vc);
-void reset_vc(struct vc_data *vc, int mode);
+void reset_vc(struct vc_data *vc);
 int do_unbind_con_driver(const struct consw *csw, int first, int last,
                         int deflt);
 int vty_init(const struct file_operations *console_fops);
index 061322a317b4a08714e40a1a40c3d6f703e2694a..ee929ece411277cf320b3cc4b340f1971518d9de 100644 (file)
@@ -46,8 +46,6 @@ struct consolefontdesc {
 #define                KD_GRAPHICS     0x01
 #define                KD_TEXT0        0x02    /* obsolete */
 #define                KD_TEXT1        0x03    /* obsolete */
-#define                KD_TRANSPARENT  0x04
-
 #define KDGETMODE      0x4B3B  /* get current mode */
 
 #define KDMAPDISP      0x4B3C  /* map display into address space */