From: "Antonino A. Daplas" fbcon doesn't set a unimap at boot time, so special characters come out wrongly. This is the code sequence in take_over_console(). newcon->startup() oldcon->deinit() newcon->init() The previous console driver (ie, vgacon), via its deinit method, may release the unimap allocated by fbcon in fbcon_startup. This is the reason why calling con_set_default_unimap() in fbcon_init() works, but not in fbcon_startup(). Check if the default display has an allocated unimap, and if it has none, call con_set_default_unimap(). And if the target display has no allocated unimap, then call con_copy_unimap(), where the source unimap is from the default display. Signed-off-by: Antonino Daplas Signed-off-by: Andrew Morton --- 25-akpm/drivers/video/console/fbcon.c | 16 +++++++++++++--- 1 files changed, 13 insertions(+), 3 deletions(-) diff -puN drivers/video/console/fbcon.c~fbcon-unimap-fix drivers/video/console/fbcon.c --- 25/drivers/video/console/fbcon.c~fbcon-unimap-fix Thu Sep 30 15:03:41 2004 +++ 25-akpm/drivers/video/console/fbcon.c Thu Sep 30 15:03:41 2004 @@ -740,7 +740,6 @@ static const char *fbcon_startup(void) DPRINTK("res: %dx%d-%d\n", info->var.xres, info->var.yres, info->var.bits_per_pixel); - con_set_default_unimap(vc->vc_num); #ifdef CONFIG_ATARI if (MACH_IS_ATARI) { @@ -820,6 +819,7 @@ static void fbcon_init(struct vc_data *v { struct fb_info *info = registered_fb[(int) con2fb_map[vc->vc_num]]; struct vc_data **default_mode = vc->vc_display_fg; + struct vc_data *svc = *default_mode; struct display *t, *p = &fb_display[vc->vc_num]; int display_fg = (*default_mode)->vc_num; int logo = 1, new_rows, new_cols, rows, cols, charcnt = 256; @@ -846,7 +846,6 @@ static void fbcon_init(struct vc_data *v p->userfont = t->userfont; if (p->userfont) REFCOUNT(p->fontdata)++; - con_copy_unimap(vc->vc_num, display_fg); } if (p->userfont) charcnt = FNTCHARCNT(p->fontdata); @@ -860,6 +859,11 @@ static void fbcon_init(struct vc_data *v vc->vc_complement_mask <<= 1; } + if (!*svc->vc_uni_pagedir_loc) + con_set_default_unimap(display_fg); + if (!*vc->vc_uni_pagedir_loc) + con_copy_unimap(vc->vc_num, display_fg); + cols = vc->vc_cols; rows = vc->vc_rows; new_cols = info->var.xres / vc->vc_font.width; @@ -1072,6 +1076,7 @@ static void fbcon_set_disp(struct fb_inf { struct display *p = &fb_display[vc->vc_num], *t; struct vc_data **default_mode = vc->vc_display_fg; + struct vc_data *svc = *default_mode; int display_fg = (*default_mode)->vc_num; int rows, cols, charcnt = 256; @@ -1086,7 +1091,6 @@ static void fbcon_set_disp(struct fb_inf p->userfont = t->userfont; if (p->userfont) REFCOUNT(p->fontdata)++; - con_copy_unimap(vc->vc_num, display_fg); } if (p->userfont) charcnt = FNTCHARCNT(p->fontdata); @@ -1100,6 +1104,12 @@ static void fbcon_set_disp(struct fb_inf if (vc->vc_can_do_color) vc->vc_complement_mask <<= 1; } + + if (!*svc->vc_uni_pagedir_loc) + con_set_default_unimap(display_fg); + if (!*vc->vc_uni_pagedir_loc) + con_copy_unimap(vc->vc_num, display_fg); + cols = info->var.xres / vc->vc_font.width; rows = info->var.yres / vc->vc_font.height; vc_resize(vc->vc_num, cols, rows); _