aboutsummaryrefslogtreecommitdiff
path: root/drivers/tty
diff options
context:
space:
mode:
authorAndrey Konovalov <andrey.konovalov@linaro.org>2012-05-22 20:38:43 +0400
committerAndrey Konovalov <andrey.konovalov@linaro.org>2012-05-22 20:38:43 +0400
commitd3ba568624762fb024c427c1ece864d594b6cdee (patch)
treebacf172f697eaf65d27c9e06f48bc22b8022e28f /drivers/tty
parent2ab4fc3b6c3af9219a0f2378fd53d525a4670f6c (diff)
parent02ec6be62ce9186511919da62bcf33f743ee1ca9 (diff)
Merge branch 'rebase-ubuntu-sauce' into merge-linux-linaro
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/vt/vt.c43
-rw-r--r--drivers/tty/vt/vt_ioctl.c10
2 files changed, 43 insertions, 10 deletions
diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c
index 2156188db4a..8ac94163ba8 100644
--- a/drivers/tty/vt/vt.c
+++ b/drivers/tty/vt/vt.c
@@ -102,6 +102,7 @@
#include <linux/uaccess.h>
#include <linux/kdb.h>
#include <linux/ctype.h>
+#include <linux/screen_info.h>
#define MAX_NR_CON_DRIVER 16
@@ -144,7 +145,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);
+ unsigned int cols, int do_clear, int mode);
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);
@@ -165,6 +166,9 @@ module_param(global_cursor_default, int, S_IRUGO | S_IWUSR);
static int cur_default = CUR_DEFAULT;
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.
@@ -694,6 +698,13 @@ 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;
@@ -807,7 +818,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);
+ vc_init(vc, vc->vc_rows, vc->vc_cols, 1, KD_TEXT);
vcs_make_sysfs(currcons);
atomic_notifier_call_chain(&vt_notifier_list, VT_ALLOCATE, &param);
}
@@ -2848,7 +2859,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)
+ unsigned int cols, int do_clear, int mode)
{
int j, k ;
@@ -2859,7 +2870,7 @@ static void vc_init(struct vc_data *vc, unsigned int rows,
set_origin(vc);
vc->vc_pos = vc->vc_origin;
- reset_vc(vc);
+ reset_vc(vc, mode);
for (j=k=0; j<16; j++) {
vc->vc_palette[k++] = default_red[j] ;
vc->vc_palette[k++] = default_grn[j] ;
@@ -2885,6 +2896,13 @@ static int __init con_init(void)
struct vc_data *vc;
unsigned int currcons = 0, i;
+ if (screen_info.flags & VIDEO_FLAGS_HANDOFF) {
+ if (vt_handoff == 0)
+ vt_handoff = 8;
+ printk(KERN_INFO "vt handoff: grub requested handoff (vt#%d)\n",
+ vt_handoff);
+ }
+
console_lock();
if (conswitchp)
@@ -2916,16 +2934,31 @@ 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);
+ 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);
visual_init(vc, currcons, 1);
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);
+ currcons || !vc->vc_sw->con_save_screen, KD_TEXT);
}
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);
diff --git a/drivers/tty/vt/vt_ioctl.c b/drivers/tty/vt/vt_ioctl.c
index ede2ef18d2f..502d15916fc 100644
--- a/drivers/tty/vt/vt_ioctl.c
+++ b/drivers/tty/vt/vt_ioctl.c
@@ -1009,9 +1009,9 @@ out:
return ret;
}
-void reset_vc(struct vc_data *vc)
+void reset_vc(struct vc_data *vc, int mode)
{
- vc->vc_mode = KD_TEXT;
+ vc->vc_mode = mode;
vt_reset_unicode(vc->vc_num);
vc->vt_mode.mode = VT_AUTO;
vc->vt_mode.waitv = 0;
@@ -1043,7 +1043,7 @@ void vc_SAK(struct work_struct *work)
*/
if (tty)
__do_SAK(tty);
- reset_vc(vc);
+ reset_vc(vc, KD_TEXT);
}
console_unlock();
}
@@ -1302,7 +1302,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);
+ reset_vc(vc, KD_TEXT);
if (old_vc_mode != vc->vc_mode) {
if (vc->vc_mode == KD_TEXT)
@@ -1374,7 +1374,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);
+ reset_vc(vc, KD_TEXT);
/*
* Fall through to normal (VT_AUTO) handling of the switch...