aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/console/fbcon.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/console/fbcon.c')
-rw-r--r--drivers/video/console/fbcon.c57
1 files changed, 39 insertions, 18 deletions
diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
index e7802ffe549a..3660e51b2612 100644
--- a/drivers/video/console/fbcon.c
+++ b/drivers/video/console/fbcon.c
@@ -106,8 +106,7 @@ enum {
106 FBCON_LOGO_DONTSHOW = -3 /* do not show the logo */ 106 FBCON_LOGO_DONTSHOW = -3 /* do not show the logo */
107}; 107};
108 108
109struct display fb_display[MAX_NR_CONSOLES]; 109static struct display fb_display[MAX_NR_CONSOLES];
110EXPORT_SYMBOL(fb_display);
111 110
112static signed char con2fb_map[MAX_NR_CONSOLES]; 111static signed char con2fb_map[MAX_NR_CONSOLES];
113static signed char con2fb_map_boot[MAX_NR_CONSOLES]; 112static 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,
653{ 652{
654 struct fbcon_ops *ops = info->fbcon_par; 653 struct fbcon_ops *ops = info->fbcon_par;
655 654
655 ops->p = (p) ? p : &fb_display[vc->vc_num];
656
656 if ((info->flags & FBINFO_MISC_TILEBLITTING)) 657 if ((info->flags & FBINFO_MISC_TILEBLITTING))
657 fbcon_set_tileops(vc, info, p, ops); 658 fbcon_set_tileops(vc, info, p, ops);
658 else { 659 else {
659 struct display *disp; 660 fbcon_set_rotation(info, ops->p);
660
661 disp = (p) ? p : &fb_display[vc->vc_num];
662 fbcon_set_rotation(info, disp);
663 fbcon_set_bitops(ops); 661 fbcon_set_bitops(ops);
664 } 662 }
665} 663}
@@ -668,11 +666,10 @@ static void set_blitting_type(struct vc_data *vc, struct fb_info *info,
668 struct display *p) 666 struct display *p)
669{ 667{
670 struct fbcon_ops *ops = info->fbcon_par; 668 struct fbcon_ops *ops = info->fbcon_par;
671 struct display *disp;
672 669
673 info->flags &= ~FBINFO_MISC_TILEBLITTING; 670 info->flags &= ~FBINFO_MISC_TILEBLITTING;
674 disp = (p) ? p : &fb_display[vc->vc_num]; 671 ops->p = (p) ? p : &fb_display[vc->vc_num];
675 fbcon_set_rotation(info, disp); 672 fbcon_set_rotation(info, ops->p);
676 fbcon_set_bitops(ops); 673 fbcon_set_bitops(ops);
677} 674}
678#endif /* CONFIG_MISC_TILEBLITTING */ 675#endif /* CONFIG_MISC_TILEBLITTING */
@@ -2051,7 +2048,7 @@ static int fbcon_switch(struct vc_data *vc)
2051 struct fbcon_ops *ops; 2048 struct fbcon_ops *ops;
2052 struct display *p = &fb_display[vc->vc_num]; 2049 struct display *p = &fb_display[vc->vc_num];
2053 struct fb_var_screeninfo var; 2050 struct fb_var_screeninfo var;
2054 int i, prev_console; 2051 int i, prev_console, charcnt = 256;
2055 2052
2056 info = registered_fb[con2fb_map[vc->vc_num]]; 2053 info = registered_fb[con2fb_map[vc->vc_num]];
2057 ops = info->fbcon_par; 2054 ops = info->fbcon_par;
@@ -2106,7 +2103,8 @@ static int fbcon_switch(struct vc_data *vc)
2106 fb_set_var(info, &var); 2103 fb_set_var(info, &var);
2107 ops->var = info->var; 2104 ops->var = info->var;
2108 2105
2109 if (old_info != NULL && old_info != info) { 2106 if (old_info != NULL && (old_info != info ||
2107 info->flags & FBINFO_MISC_ALWAYS_SETPAR)) {
2110 if (info->fbops->fb_set_par) 2108 if (info->fbops->fb_set_par)
2111 info->fbops->fb_set_par(info); 2109 info->fbops->fb_set_par(info);
2112 fbcon_del_cursor_timer(old_info); 2110 fbcon_del_cursor_timer(old_info);
@@ -2123,6 +2121,13 @@ static int fbcon_switch(struct vc_data *vc)
2123 2121
2124 vc->vc_can_do_color = (fb_get_color_depth(&info->var, &info->fix)!=1); 2122 vc->vc_can_do_color = (fb_get_color_depth(&info->var, &info->fix)!=1);
2125 vc->vc_complement_mask = vc->vc_can_do_color ? 0x7700 : 0x0800; 2123 vc->vc_complement_mask = vc->vc_can_do_color ? 0x7700 : 0x0800;
2124
2125 if (p->userfont)
2126 charcnt = FNTCHARCNT(vc->vc_font.data);
2127
2128 if (charcnt > 256)
2129 vc->vc_complement_mask <<= 1;
2130
2126 updatescrollmode(p, info, vc); 2131 updatescrollmode(p, info, vc);
2127 2132
2128 switch (p->scrollmode) { 2133 switch (p->scrollmode) {
@@ -2142,8 +2147,12 @@ static int fbcon_switch(struct vc_data *vc)
2142 2147
2143 scrollback_max = 0; 2148 scrollback_max = 0;
2144 scrollback_current = 0; 2149 scrollback_current = 0;
2145 ops->var.xoffset = ops->var.yoffset = p->yscroll = 0; 2150
2146 ops->update_start(info); 2151 if (!fbcon_is_inactive(vc, info)) {
2152 ops->var.xoffset = ops->var.yoffset = p->yscroll = 0;
2153 ops->update_start(info);
2154 }
2155
2147 fbcon_set_palette(vc, color_table); 2156 fbcon_set_palette(vc, color_table);
2148 fbcon_clear_margins(vc, 0); 2157 fbcon_clear_margins(vc, 0);
2149 2158
@@ -2187,11 +2196,14 @@ static int fbcon_blank(struct vc_data *vc, int blank, int mode_switch)
2187 ops->graphics = 1; 2196 ops->graphics = 1;
2188 2197
2189 if (!blank) { 2198 if (!blank) {
2199 if (info->fbops->fb_save_state)
2200 info->fbops->fb_save_state(info);
2190 var.activate = FB_ACTIVATE_NOW | FB_ACTIVATE_FORCE; 2201 var.activate = FB_ACTIVATE_NOW | FB_ACTIVATE_FORCE;
2191 fb_set_var(info, &var); 2202 fb_set_var(info, &var);
2192 ops->graphics = 0; 2203 ops->graphics = 0;
2193 ops->var = info->var; 2204 ops->var = info->var;
2194 } 2205 } else if (info->fbops->fb_restore_state)
2206 info->fbops->fb_restore_state(info);
2195 } 2207 }
2196 2208
2197 if (!fbcon_is_inactive(vc, info)) { 2209 if (!fbcon_is_inactive(vc, info)) {
@@ -2739,8 +2751,12 @@ static void fbcon_modechanged(struct fb_info *info)
2739 updatescrollmode(p, info, vc); 2751 updatescrollmode(p, info, vc);
2740 scrollback_max = 0; 2752 scrollback_max = 0;
2741 scrollback_current = 0; 2753 scrollback_current = 0;
2742 ops->var.xoffset = ops->var.yoffset = p->yscroll = 0; 2754
2743 ops->update_start(info); 2755 if (!fbcon_is_inactive(vc, info)) {
2756 ops->var.xoffset = ops->var.yoffset = p->yscroll = 0;
2757 ops->update_start(info);
2758 }
2759
2744 fbcon_set_palette(vc, color_table); 2760 fbcon_set_palette(vc, color_table);
2745 update_screen(vc); 2761 update_screen(vc);
2746 if (softback_buf) 2762 if (softback_buf)
@@ -2777,8 +2793,13 @@ static void fbcon_set_all_vcs(struct fb_info *info)
2777 updatescrollmode(p, info, vc); 2793 updatescrollmode(p, info, vc);
2778 scrollback_max = 0; 2794 scrollback_max = 0;
2779 scrollback_current = 0; 2795 scrollback_current = 0;
2780 ops->var.xoffset = ops->var.yoffset = p->yscroll = 0; 2796
2781 ops->update_start(info); 2797 if (!fbcon_is_inactive(vc, info)) {
2798 ops->var.xoffset = ops->var.yoffset =
2799 p->yscroll = 0;
2800 ops->update_start(info);
2801 }
2802
2782 fbcon_set_palette(vc, color_table); 2803 fbcon_set_palette(vc, color_table);
2783 update_screen(vc); 2804 update_screen(vc);
2784 if (softback_buf) 2805 if (softback_buf)