diff options
Diffstat (limited to 'drivers/video/console')
-rw-r--r-- | drivers/video/console/vgacon.c | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/drivers/video/console/vgacon.c b/drivers/video/console/vgacon.c index e64d42e2449e..f32b590730f2 100644 --- a/drivers/video/console/vgacon.c +++ b/drivers/video/console/vgacon.c | |||
@@ -114,6 +114,7 @@ static int vga_512_chars; | |||
114 | static int vga_video_font_height; | 114 | static int vga_video_font_height; |
115 | static int vga_scan_lines; | 115 | static int vga_scan_lines; |
116 | static unsigned int vga_rolled_over = 0; | 116 | static unsigned int vga_rolled_over = 0; |
117 | static int vga_init_done; | ||
117 | 118 | ||
118 | static int __init no_scroll(char *str) | 119 | static int __init no_scroll(char *str) |
119 | { | 120 | { |
@@ -190,7 +191,7 @@ static void vgacon_scrollback_init(int pitch) | |||
190 | } | 191 | } |
191 | } | 192 | } |
192 | 193 | ||
193 | static void __init vgacon_scrollback_startup(void) | 194 | static void vgacon_scrollback_startup(void) |
194 | { | 195 | { |
195 | vgacon_scrollback = alloc_bootmem(CONFIG_VGACON_SOFT_SCROLLBACK_SIZE | 196 | vgacon_scrollback = alloc_bootmem(CONFIG_VGACON_SOFT_SCROLLBACK_SIZE |
196 | * 1024); | 197 | * 1024); |
@@ -355,7 +356,7 @@ static int vgacon_scrolldelta(struct vc_data *c, int lines) | |||
355 | } | 356 | } |
356 | #endif /* CONFIG_VGACON_SOFT_SCROLLBACK */ | 357 | #endif /* CONFIG_VGACON_SOFT_SCROLLBACK */ |
357 | 358 | ||
358 | static const char __init *vgacon_startup(void) | 359 | static const char *vgacon_startup(void) |
359 | { | 360 | { |
360 | const char *display_desc = NULL; | 361 | const char *display_desc = NULL; |
361 | u16 saved1, saved2; | 362 | u16 saved1, saved2; |
@@ -523,7 +524,12 @@ static const char __init *vgacon_startup(void) | |||
523 | 524 | ||
524 | vgacon_xres = ORIG_VIDEO_COLS * VGA_FONTWIDTH; | 525 | vgacon_xres = ORIG_VIDEO_COLS * VGA_FONTWIDTH; |
525 | vgacon_yres = vga_scan_lines; | 526 | vgacon_yres = vga_scan_lines; |
526 | vgacon_scrollback_startup(); | 527 | |
528 | if (!vga_init_done) { | ||
529 | vgacon_scrollback_startup(); | ||
530 | vga_init_done = 1; | ||
531 | } | ||
532 | |||
527 | return display_desc; | 533 | return display_desc; |
528 | } | 534 | } |
529 | 535 | ||
@@ -531,10 +537,20 @@ static void vgacon_init(struct vc_data *c, int init) | |||
531 | { | 537 | { |
532 | unsigned long p; | 538 | unsigned long p; |
533 | 539 | ||
534 | /* We cannot be loaded as a module, therefore init is always 1 */ | 540 | /* |
541 | * We cannot be loaded as a module, therefore init is always 1, | ||
542 | * but vgacon_init can be called more than once, and init will | ||
543 | * not be 1. | ||
544 | */ | ||
535 | c->vc_can_do_color = vga_can_do_color; | 545 | c->vc_can_do_color = vga_can_do_color; |
536 | c->vc_cols = vga_video_num_columns; | 546 | |
537 | c->vc_rows = vga_video_num_lines; | 547 | /* set dimensions manually if init != 0 since vc_resize() will fail */ |
548 | if (init) { | ||
549 | c->vc_cols = vga_video_num_columns; | ||
550 | c->vc_rows = vga_video_num_lines; | ||
551 | } else | ||
552 | vc_resize(c, vga_video_num_columns, vga_video_num_lines); | ||
553 | |||
538 | c->vc_scan_lines = vga_scan_lines; | 554 | c->vc_scan_lines = vga_scan_lines; |
539 | c->vc_font.height = vga_video_font_height; | 555 | c->vc_font.height = vga_video_font_height; |
540 | c->vc_complement_mask = 0x7700; | 556 | c->vc_complement_mask = 0x7700; |