aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/vt.c
diff options
context:
space:
mode:
authorAnton Vorontsov <cbouatmailru@gmail.com>2008-07-29 18:05:23 -0400
committerAnton Vorontsov <cbouatmailru@gmail.com>2008-07-29 18:05:23 -0400
commit9fec6060d9e48ed7db0dac0e16d0f0f0e615b7f6 (patch)
tree74b41f31a08f6500ff3dfcf64ba21e2d9a8e87e5 /drivers/char/vt.c
parentfece418418f51e92dd7e67e17c5e3fe5a28d3279 (diff)
parent6e86841d05f371b5b9b86ce76c02aaee83352298 (diff)
Merge branch 'master' of /home/cbou/linux-2.6
Conflicts: drivers/power/Kconfig drivers/power/Makefile
Diffstat (limited to 'drivers/char/vt.c')
-rw-r--r--drivers/char/vt.c43
1 files changed, 27 insertions, 16 deletions
diff --git a/drivers/char/vt.c b/drivers/char/vt.c
index e458b08139af..82a51f38a546 100644
--- a/drivers/char/vt.c
+++ b/drivers/char/vt.c
@@ -261,7 +261,7 @@ static void notify_update(struct vc_data *vc)
261#ifdef VT_BUF_VRAM_ONLY 261#ifdef VT_BUF_VRAM_ONLY
262#define DO_UPDATE(vc) 0 262#define DO_UPDATE(vc) 0
263#else 263#else
264#define DO_UPDATE(vc) CON_IS_VISIBLE(vc) 264#define DO_UPDATE(vc) (CON_IS_VISIBLE(vc) && !console_blanked)
265#endif 265#endif
266 266
267static inline unsigned short *screenpos(struct vc_data *vc, int offset, int viewed) 267static inline unsigned short *screenpos(struct vc_data *vc, int offset, int viewed)
@@ -434,7 +434,7 @@ static void update_attr(struct vc_data *vc)
434 vc->vc_blink, vc->vc_underline, 434 vc->vc_blink, vc->vc_underline,
435 vc->vc_reverse ^ vc->vc_decscnm, vc->vc_italic); 435 vc->vc_reverse ^ vc->vc_decscnm, vc->vc_italic);
436 vc->vc_video_erase_char = (build_attr(vc, vc->vc_color, 1, vc->vc_blink, 0, vc->vc_decscnm, 0) << 8) | ' '; 436 vc->vc_video_erase_char = (build_attr(vc, vc->vc_color, 1, vc->vc_blink, 0, vc->vc_decscnm, 0) << 8) | ' ';
437 vc->vc_scrl_erase_char = (build_attr(vc, vc->vc_def_color, 1, false, false, false, false) << 8) | ' '; 437 vc->vc_scrl_erase_char = (build_attr(vc, vc->vc_def_color, 1, false, false, vc->vc_decscnm, false) << 8) | ' ';
438} 438}
439 439
440/* Note: inverting the screen twice should revert to the original state */ 440/* Note: inverting the screen twice should revert to the original state */
@@ -909,7 +909,7 @@ int vc_resize(struct vc_data *vc, unsigned int cols, unsigned int lines)
909 909
910 if (vc->vc_tty) { 910 if (vc->vc_tty) {
911 struct winsize ws, *cws = &vc->vc_tty->winsize; 911 struct winsize ws, *cws = &vc->vc_tty->winsize;
912 unsigned long flags; 912 struct pid *pgrp = NULL;
913 913
914 memset(&ws, 0, sizeof(ws)); 914 memset(&ws, 0, sizeof(ws));
915 ws.ws_row = vc->vc_rows; 915 ws.ws_row = vc->vc_rows;
@@ -917,11 +917,14 @@ int vc_resize(struct vc_data *vc, unsigned int cols, unsigned int lines)
917 ws.ws_ypixel = vc->vc_scan_lines; 917 ws.ws_ypixel = vc->vc_scan_lines;
918 918
919 mutex_lock(&vc->vc_tty->termios_mutex); 919 mutex_lock(&vc->vc_tty->termios_mutex);
920 spin_lock_irqsave(&vc->vc_tty->ctrl_lock, flags); 920 spin_lock_irq(&vc->vc_tty->ctrl_lock);
921 if ((ws.ws_row != cws->ws_row || ws.ws_col != cws->ws_col) && 921 if ((ws.ws_row != cws->ws_row || ws.ws_col != cws->ws_col))
922 vc->vc_tty->pgrp) 922 pgrp = get_pid(vc->vc_tty->pgrp);
923 spin_unlock_irq(&vc->vc_tty->ctrl_lock);
924 if (pgrp) {
923 kill_pgrp(vc->vc_tty->pgrp, SIGWINCH, 1); 925 kill_pgrp(vc->vc_tty->pgrp, SIGWINCH, 1);
924 spin_unlock_irqrestore(&vc->vc_tty->ctrl_lock, flags); 926 put_pid(pgrp);
927 }
925 *cws = ws; 928 *cws = ws;
926 mutex_unlock(&vc->vc_tty->termios_mutex); 929 mutex_unlock(&vc->vc_tty->termios_mutex);
927 } 930 }
@@ -2208,7 +2211,7 @@ rescan_last_byte:
2208 c = 0xfffd; 2211 c = 0xfffd;
2209 tc = c; 2212 tc = c;
2210 } else { /* no utf or alternate charset mode */ 2213 } else { /* no utf or alternate charset mode */
2211 tc = vc->vc_translate[vc->vc_toggle_meta ? (c | 0x80) : c]; 2214 tc = vc_translate(vc, c);
2212 } 2215 }
2213 2216
2214 param.c = tc; 2217 param.c = tc;
@@ -2742,8 +2745,12 @@ static int con_open(struct tty_struct *tty, struct file *filp)
2742 tty->winsize.ws_row = vc_cons[currcons].d->vc_rows; 2745 tty->winsize.ws_row = vc_cons[currcons].d->vc_rows;
2743 tty->winsize.ws_col = vc_cons[currcons].d->vc_cols; 2746 tty->winsize.ws_col = vc_cons[currcons].d->vc_cols;
2744 } 2747 }
2745 release_console_sem(); 2748 if (vc->vc_utf)
2749 tty->termios->c_iflag |= IUTF8;
2750 else
2751 tty->termios->c_iflag &= ~IUTF8;
2746 vcs_make_sysfs(tty); 2752 vcs_make_sysfs(tty);
2753 release_console_sem();
2747 return ret; 2754 return ret;
2748 } 2755 }
2749 } 2756 }
@@ -2768,8 +2775,8 @@ static void con_close(struct tty_struct *tty, struct file *filp)
2768 if (vc) 2775 if (vc)
2769 vc->vc_tty = NULL; 2776 vc->vc_tty = NULL;
2770 tty->driver_data = NULL; 2777 tty->driver_data = NULL;
2771 release_console_sem();
2772 vcs_remove_sysfs(tty); 2778 vcs_remove_sysfs(tty);
2779 release_console_sem();
2773 mutex_unlock(&tty_mutex); 2780 mutex_unlock(&tty_mutex);
2774 /* 2781 /*
2775 * tty_mutex is released, but we still hold BKL, so there is 2782 * tty_mutex is released, but we still hold BKL, so there is
@@ -2918,6 +2925,8 @@ int __init vty_init(void)
2918 console_driver->minor_start = 1; 2925 console_driver->minor_start = 1;
2919 console_driver->type = TTY_DRIVER_TYPE_CONSOLE; 2926 console_driver->type = TTY_DRIVER_TYPE_CONSOLE;
2920 console_driver->init_termios = tty_std_termios; 2927 console_driver->init_termios = tty_std_termios;
2928 if (default_utf8)
2929 console_driver->init_termios.c_iflag |= IUTF8;
2921 console_driver->flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_RESET_TERMIOS; 2930 console_driver->flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_RESET_TERMIOS;
2922 tty_set_operations(console_driver, &con_ops); 2931 tty_set_operations(console_driver, &con_ops);
2923 if (tty_register_driver(console_driver)) 2932 if (tty_register_driver(console_driver))
@@ -3416,9 +3425,10 @@ int register_con_driver(const struct consw *csw, int first, int last)
3416 if (retval) 3425 if (retval)
3417 goto err; 3426 goto err;
3418 3427
3419 con_driver->dev = device_create(vtconsole_class, NULL, 3428 con_driver->dev = device_create_drvdata(vtconsole_class, NULL,
3420 MKDEV(0, con_driver->node), 3429 MKDEV(0, con_driver->node),
3421 "vtcon%i", con_driver->node); 3430 NULL, "vtcon%i",
3431 con_driver->node);
3422 3432
3423 if (IS_ERR(con_driver->dev)) { 3433 if (IS_ERR(con_driver->dev)) {
3424 printk(KERN_WARNING "Unable to create device for %s; " 3434 printk(KERN_WARNING "Unable to create device for %s; "
@@ -3526,9 +3536,10 @@ static int __init vtconsole_class_init(void)
3526 struct con_driver *con = &registered_con_driver[i]; 3536 struct con_driver *con = &registered_con_driver[i];
3527 3537
3528 if (con->con && !con->dev) { 3538 if (con->con && !con->dev) {
3529 con->dev = device_create(vtconsole_class, NULL, 3539 con->dev = device_create_drvdata(vtconsole_class, NULL,
3530 MKDEV(0, con->node), 3540 MKDEV(0, con->node),
3531 "vtcon%i", con->node); 3541 NULL, "vtcon%i",
3542 con->node);
3532 3543
3533 if (IS_ERR(con->dev)) { 3544 if (IS_ERR(con->dev)) {
3534 printk(KERN_WARNING "Unable to create " 3545 printk(KERN_WARNING "Unable to create "