]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/video/console/fbcon.c
Merge branch 'master'
[linux-2.6-omap-h63xx.git] / drivers / video / console / fbcon.c
index e7802ffe549ae402144f82aaf052e0ada28de9be..3660e51b2612996a80963137777db21b4e9f65a0 100644 (file)
@@ -106,8 +106,7 @@ enum {
        FBCON_LOGO_DONTSHOW     = -3    /* do not show the logo */
 };
 
-struct display fb_display[MAX_NR_CONSOLES];
-EXPORT_SYMBOL(fb_display);
+static struct display fb_display[MAX_NR_CONSOLES];
 
 static signed char con2fb_map[MAX_NR_CONSOLES];
 static signed char con2fb_map_boot[MAX_NR_CONSOLES];
@@ -653,13 +652,12 @@ static void set_blitting_type(struct vc_data *vc, struct fb_info *info,
 {
        struct fbcon_ops *ops = info->fbcon_par;
 
+       ops->p = (p) ? p : &fb_display[vc->vc_num];
+
        if ((info->flags & FBINFO_MISC_TILEBLITTING))
                fbcon_set_tileops(vc, info, p, ops);
        else {
-               struct display *disp;
-
-               disp = (p) ? p : &fb_display[vc->vc_num];
-               fbcon_set_rotation(info, disp);
+               fbcon_set_rotation(info, ops->p);
                fbcon_set_bitops(ops);
        }
 }
@@ -668,11 +666,10 @@ static void set_blitting_type(struct vc_data *vc, struct fb_info *info,
                              struct display *p)
 {
        struct fbcon_ops *ops = info->fbcon_par;
-       struct display *disp;
 
        info->flags &= ~FBINFO_MISC_TILEBLITTING;
-       disp = (p) ? p : &fb_display[vc->vc_num];
-       fbcon_set_rotation(info, disp);
+       ops->p = (p) ? p : &fb_display[vc->vc_num];
+       fbcon_set_rotation(info, ops->p);
        fbcon_set_bitops(ops);
 }
 #endif /* CONFIG_MISC_TILEBLITTING */
@@ -2051,7 +2048,7 @@ static int fbcon_switch(struct vc_data *vc)
        struct fbcon_ops *ops;
        struct display *p = &fb_display[vc->vc_num];
        struct fb_var_screeninfo var;
-       int i, prev_console;
+       int i, prev_console, charcnt = 256;
 
        info = registered_fb[con2fb_map[vc->vc_num]];
        ops = info->fbcon_par;
@@ -2106,7 +2103,8 @@ static int fbcon_switch(struct vc_data *vc)
        fb_set_var(info, &var);
        ops->var = info->var;
 
-       if (old_info != NULL && old_info != info) {
+       if (old_info != NULL && (old_info != info ||
+                                info->flags & FBINFO_MISC_ALWAYS_SETPAR)) {
                if (info->fbops->fb_set_par)
                        info->fbops->fb_set_par(info);
                fbcon_del_cursor_timer(old_info);
@@ -2123,6 +2121,13 @@ static int fbcon_switch(struct vc_data *vc)
 
        vc->vc_can_do_color = (fb_get_color_depth(&info->var, &info->fix)!=1);
        vc->vc_complement_mask = vc->vc_can_do_color ? 0x7700 : 0x0800;
+
+       if (p->userfont)
+               charcnt = FNTCHARCNT(vc->vc_font.data);
+
+       if (charcnt > 256)
+               vc->vc_complement_mask <<= 1;
+
        updatescrollmode(p, info, vc);
 
        switch (p->scrollmode) {
@@ -2142,8 +2147,12 @@ static int fbcon_switch(struct vc_data *vc)
 
        scrollback_max = 0;
        scrollback_current = 0;
-       ops->var.xoffset = ops->var.yoffset = p->yscroll = 0;
-       ops->update_start(info);
+
+       if (!fbcon_is_inactive(vc, info)) {
+           ops->var.xoffset = ops->var.yoffset = p->yscroll = 0;
+           ops->update_start(info);
+       }
+
        fbcon_set_palette(vc, color_table);     
        fbcon_clear_margins(vc, 0);
 
@@ -2187,11 +2196,14 @@ static int fbcon_blank(struct vc_data *vc, int blank, int mode_switch)
                ops->graphics = 1;
 
                if (!blank) {
+                       if (info->fbops->fb_save_state)
+                               info->fbops->fb_save_state(info);
                        var.activate = FB_ACTIVATE_NOW | FB_ACTIVATE_FORCE;
                        fb_set_var(info, &var);
                        ops->graphics = 0;
                        ops->var = info->var;
-               }
+               } else if (info->fbops->fb_restore_state)
+                       info->fbops->fb_restore_state(info);
        }
 
        if (!fbcon_is_inactive(vc, info)) {
@@ -2739,8 +2751,12 @@ static void fbcon_modechanged(struct fb_info *info)
                updatescrollmode(p, info, vc);
                scrollback_max = 0;
                scrollback_current = 0;
-               ops->var.xoffset = ops->var.yoffset = p->yscroll = 0;
-               ops->update_start(info);
+
+               if (!fbcon_is_inactive(vc, info)) {
+                   ops->var.xoffset = ops->var.yoffset = p->yscroll = 0;
+                   ops->update_start(info);
+               }
+
                fbcon_set_palette(vc, color_table);
                update_screen(vc);
                if (softback_buf)
@@ -2777,8 +2793,13 @@ static void fbcon_set_all_vcs(struct fb_info *info)
                        updatescrollmode(p, info, vc);
                        scrollback_max = 0;
                        scrollback_current = 0;
-                       ops->var.xoffset = ops->var.yoffset = p->yscroll = 0;
-                       ops->update_start(info);
+
+                       if (!fbcon_is_inactive(vc, info)) {
+                           ops->var.xoffset = ops->var.yoffset =
+                               p->yscroll = 0;
+                           ops->update_start(info);
+                       }
+
                        fbcon_set_palette(vc, color_table);
                        update_screen(vc);
                        if (softback_buf)