]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/char/vt.c
Merge git://git.infradead.org/embedded-2.6
[linux-2.6-omap-h63xx.git] / drivers / char / vt.c
index 18b7fb06dace156a2173d03390e9e6681723cdb2..82a51f38a5469cd1a56637c6635b9c16f69f5f89 100644 (file)
@@ -261,7 +261,7 @@ static void notify_update(struct vc_data *vc)
 #ifdef VT_BUF_VRAM_ONLY
 #define DO_UPDATE(vc)  0
 #else
-#define DO_UPDATE(vc)  CON_IS_VISIBLE(vc)
+#define DO_UPDATE(vc)  (CON_IS_VISIBLE(vc) && !console_blanked)
 #endif
 
 static inline unsigned short *screenpos(struct vc_data *vc, int offset, int viewed)
@@ -434,7 +434,7 @@ static void update_attr(struct vc_data *vc)
                      vc->vc_blink, vc->vc_underline,
                      vc->vc_reverse ^ vc->vc_decscnm, vc->vc_italic);
        vc->vc_video_erase_char = (build_attr(vc, vc->vc_color, 1, vc->vc_blink, 0, vc->vc_decscnm, 0) << 8) | ' ';
-       vc->vc_scrl_erase_char = (build_attr(vc, vc->vc_def_color, 1, false, false, false, false) << 8) | ' ';
+       vc->vc_scrl_erase_char = (build_attr(vc, vc->vc_def_color, 1, false, false, vc->vc_decscnm, false) << 8) | ' ';
 }
 
 /* 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)
 
        if (vc->vc_tty) {
                struct winsize ws, *cws = &vc->vc_tty->winsize;
-               unsigned long flags;
+               struct pid *pgrp = NULL;
 
                memset(&ws, 0, sizeof(ws));
                ws.ws_row = vc->vc_rows;
@@ -917,11 +917,14 @@ int vc_resize(struct vc_data *vc, unsigned int cols, unsigned int lines)
                ws.ws_ypixel = vc->vc_scan_lines;
 
                mutex_lock(&vc->vc_tty->termios_mutex);
-               spin_lock_irqsave(&vc->vc_tty->ctrl_lock, flags);
-               if ((ws.ws_row != cws->ws_row || ws.ws_col != cws->ws_col) &&
-                   vc->vc_tty->pgrp)
+               spin_lock_irq(&vc->vc_tty->ctrl_lock);
+               if ((ws.ws_row != cws->ws_row || ws.ws_col != cws->ws_col))
+                       pgrp = get_pid(vc->vc_tty->pgrp);
+               spin_unlock_irq(&vc->vc_tty->ctrl_lock);
+               if (pgrp) {
                        kill_pgrp(vc->vc_tty->pgrp, SIGWINCH, 1);
-               spin_unlock_irqrestore(&vc->vc_tty->ctrl_lock, flags);
+                       put_pid(pgrp);
+               }
                *cws = ws;
                mutex_unlock(&vc->vc_tty->termios_mutex);
        }
@@ -2746,8 +2749,8 @@ static int con_open(struct tty_struct *tty, struct file *filp)
                                tty->termios->c_iflag |= IUTF8;
                        else
                                tty->termios->c_iflag &= ~IUTF8;
-                       release_console_sem();
                        vcs_make_sysfs(tty);
+                       release_console_sem();
                        return ret;
                }
        }
@@ -2772,8 +2775,8 @@ static void con_close(struct tty_struct *tty, struct file *filp)
                if (vc)
                        vc->vc_tty = NULL;
                tty->driver_data = NULL;
-               release_console_sem();
                vcs_remove_sysfs(tty);
+               release_console_sem();
                mutex_unlock(&tty_mutex);
                /*
                 * tty_mutex is released, but we still hold BKL, so there is
@@ -3422,9 +3425,10 @@ int register_con_driver(const struct consw *csw, int first, int last)
        if (retval)
                goto err;
 
-       con_driver->dev = device_create(vtconsole_class, NULL,
-                                       MKDEV(0, con_driver->node),
-                                       "vtcon%i", con_driver->node);
+       con_driver->dev = device_create_drvdata(vtconsole_class, NULL,
+                                               MKDEV(0, con_driver->node),
+                                               NULL, "vtcon%i",
+                                               con_driver->node);
 
        if (IS_ERR(con_driver->dev)) {
                printk(KERN_WARNING "Unable to create device for %s; "
@@ -3532,9 +3536,10 @@ static int __init vtconsole_class_init(void)
                struct con_driver *con = &registered_con_driver[i];
 
                if (con->con && !con->dev) {
-                       con->dev = device_create(vtconsole_class, NULL,
-                                                MKDEV(0, con->node),
-                                                "vtcon%i", con->node);
+                       con->dev = device_create_drvdata(vtconsole_class, NULL,
+                                                        MKDEV(0, con->node),
+                                                        NULL, "vtcon%i",
+                                                        con->node);
 
                        if (IS_ERR(con->dev)) {
                                printk(KERN_WARNING "Unable to create "