diff options
Diffstat (limited to 'drivers/char/vt.c')
-rw-r--r-- | drivers/char/vt.c | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/drivers/char/vt.c b/drivers/char/vt.c index 6c94879e0b99..eb27eed48a86 100644 --- a/drivers/char/vt.c +++ b/drivers/char/vt.c | |||
@@ -2665,7 +2665,7 @@ int __init vty_init(void) | |||
2665 | 2665 | ||
2666 | int take_over_console(const struct consw *csw, int first, int last, int deflt) | 2666 | int take_over_console(const struct consw *csw, int first, int last, int deflt) |
2667 | { | 2667 | { |
2668 | int i, j = -1; | 2668 | int i, j = -1, k = -1; |
2669 | const char *desc; | 2669 | const char *desc; |
2670 | struct module *owner; | 2670 | struct module *owner; |
2671 | 2671 | ||
@@ -2701,8 +2701,11 @@ int take_over_console(const struct consw *csw, int first, int last, int deflt) | |||
2701 | continue; | 2701 | continue; |
2702 | 2702 | ||
2703 | j = i; | 2703 | j = i; |
2704 | if (CON_IS_VISIBLE(vc)) | 2704 | if (CON_IS_VISIBLE(vc)) { |
2705 | k = i; | ||
2705 | save_screen(vc); | 2706 | save_screen(vc); |
2707 | } | ||
2708 | |||
2706 | old_was_color = vc->vc_can_do_color; | 2709 | old_was_color = vc->vc_can_do_color; |
2707 | vc->vc_sw->con_deinit(vc); | 2710 | vc->vc_sw->con_deinit(vc); |
2708 | vc->vc_origin = (unsigned long)vc->vc_screenbuf; | 2711 | vc->vc_origin = (unsigned long)vc->vc_screenbuf; |
@@ -2718,18 +2721,23 @@ int take_over_console(const struct consw *csw, int first, int last, int deflt) | |||
2718 | */ | 2721 | */ |
2719 | if (old_was_color != vc->vc_can_do_color) | 2722 | if (old_was_color != vc->vc_can_do_color) |
2720 | clear_buffer_attributes(vc); | 2723 | clear_buffer_attributes(vc); |
2721 | |||
2722 | if (CON_IS_VISIBLE(vc)) | ||
2723 | update_screen(vc); | ||
2724 | } | 2724 | } |
2725 | |||
2725 | printk("Console: switching "); | 2726 | printk("Console: switching "); |
2726 | if (!deflt) | 2727 | if (!deflt) |
2727 | printk("consoles %d-%d ", first+1, last+1); | 2728 | printk("consoles %d-%d ", first+1, last+1); |
2728 | if (j >= 0) | 2729 | if (j >= 0) { |
2730 | struct vc_data *vc = vc_cons[j].d; | ||
2731 | |||
2729 | printk("to %s %s %dx%d\n", | 2732 | printk("to %s %s %dx%d\n", |
2730 | vc_cons[j].d->vc_can_do_color ? "colour" : "mono", | 2733 | vc->vc_can_do_color ? "colour" : "mono", |
2731 | desc, vc_cons[j].d->vc_cols, vc_cons[j].d->vc_rows); | 2734 | desc, vc->vc_cols, vc->vc_rows); |
2732 | else | 2735 | |
2736 | if (k >= 0) { | ||
2737 | vc = vc_cons[k].d; | ||
2738 | update_screen(vc); | ||
2739 | } | ||
2740 | } else | ||
2733 | printk("to %s\n", desc); | 2741 | printk("to %s\n", desc); |
2734 | 2742 | ||
2735 | release_console_sem(); | 2743 | release_console_sem(); |