]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/video/console/vgacon.c
Merge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus
[linux-2.6-omap-h63xx.git] / drivers / video / console / vgacon.c
index 3e67c34df9a593d6c93f7722037330f9eaff8460..f46fe95f69fbf13504fbc740799d1d64005d7631 100644 (file)
@@ -86,8 +86,6 @@ static int vgacon_set_origin(struct vc_data *c);
 static void vgacon_save_screen(struct vc_data *c);
 static int vgacon_scroll(struct vc_data *c, int t, int b, int dir,
                         int lines);
-static u8 vgacon_build_attr(struct vc_data *c, u8 color, u8 intensity,
-                           u8 blink, u8 underline, u8 reverse);
 static void vgacon_invert_region(struct vc_data *c, u16 * p, int count);
 static unsigned long vgacon_uni_pagedir[2];
 
@@ -370,9 +368,14 @@ static const char *vgacon_startup(void)
 #endif
        }
 
+       /* SCREEN_INFO initialized? */
+       if ((ORIG_VIDEO_MODE  == 0) &&
+           (ORIG_VIDEO_LINES == 0) &&
+           (ORIG_VIDEO_COLS  == 0))
+               goto no_vga;
+
        /* VGA16 modes are not handled by VGACON */
-       if ((ORIG_VIDEO_MODE == 0x00) ||        /* SCREEN_INFO not initialized */
-           (ORIG_VIDEO_MODE == 0x0D) ||        /* 320x200/4 */
+       if ((ORIG_VIDEO_MODE == 0x0D) ||        /* 320x200/4 */
            (ORIG_VIDEO_MODE == 0x0E) ||        /* 640x200/4 */
            (ORIG_VIDEO_MODE == 0x10) ||        /* 640x350/4 */
            (ORIG_VIDEO_MODE == 0x12) ||        /* 640x480/4 */
@@ -578,12 +581,14 @@ static void vgacon_deinit(struct vc_data *c)
 }
 
 static u8 vgacon_build_attr(struct vc_data *c, u8 color, u8 intensity,
-                           u8 blink, u8 underline, u8 reverse)
+                           u8 blink, u8 underline, u8 reverse, u8 italic)
 {
        u8 attr = color;
 
        if (vga_can_do_color) {
-               if (underline)
+               if (italic)
+                       attr = (attr & 0xF0) | c->vc_itcolor;
+               else if (underline)
                        attr = (attr & 0xf0) | c->vc_ulcolor;
                else if (intensity == 0)
                        attr = (attr & 0xf0) | c->vc_halfcolor;
@@ -597,7 +602,9 @@ static u8 vgacon_build_attr(struct vc_data *c, u8 color, u8 intensity,
        if (intensity == 2)
                attr ^= 0x08;
        if (!vga_can_do_color) {
-               if (underline)
+               if (italic)
+                       attr = (attr & 0xF8) | 0x02;
+               else if (underline)
                        attr = (attr & 0xf8) | 0x01;
                else if (intensity == 0)
                        attr = (attr & 0xf0) | 0x08;
@@ -658,6 +665,9 @@ static void vgacon_set_cursor_size(int xpos, int from, int to)
 
 static void vgacon_cursor(struct vc_data *c, int mode)
 {
+       if (c->vc_mode != KD_TEXT)
+               return;
+
        vgacon_restore_screen(c);
 
        switch (mode) {
@@ -1316,7 +1326,7 @@ static int vgacon_scroll(struct vc_data *c, int t, int b, int dir,
        unsigned long oldo;
        unsigned int delta;
 
-       if (t || b != c->vc_rows || vga_is_gfx)
+       if (t || b != c->vc_rows || vga_is_gfx || c->vc_mode != KD_TEXT)
                return 0;
 
        if (!vga_hardscroll_enabled || lines >= c->vc_rows / 2)