diff options
Diffstat (limited to 'drivers/video/console')
-rw-r--r-- | drivers/video/console/vgacon.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/video/console/vgacon.c b/drivers/video/console/vgacon.c index 9d8feac67637..f267284b423b 100644 --- a/drivers/video/console/vgacon.c +++ b/drivers/video/console/vgacon.c | |||
@@ -87,7 +87,8 @@ static void vgacon_save_screen(struct vc_data *c); | |||
87 | static int vgacon_scroll(struct vc_data *c, int t, int b, int dir, | 87 | static int vgacon_scroll(struct vc_data *c, int t, int b, int dir, |
88 | int lines); | 88 | int lines); |
89 | static void vgacon_invert_region(struct vc_data *c, u16 * p, int count); | 89 | static void vgacon_invert_region(struct vc_data *c, u16 * p, int count); |
90 | static unsigned long vgacon_uni_pagedir[2]; | 90 | static struct uni_pagedir *vgacon_uni_pagedir; |
91 | static int vgacon_refcount; | ||
91 | 92 | ||
92 | /* Description of the hardware situation */ | 93 | /* Description of the hardware situation */ |
93 | static int vga_init_done __read_mostly; | 94 | static int vga_init_done __read_mostly; |
@@ -553,7 +554,7 @@ static const char *vgacon_startup(void) | |||
553 | 554 | ||
554 | static void vgacon_init(struct vc_data *c, int init) | 555 | static void vgacon_init(struct vc_data *c, int init) |
555 | { | 556 | { |
556 | unsigned long p; | 557 | struct uni_pagedir *p; |
557 | 558 | ||
558 | /* | 559 | /* |
559 | * We cannot be loaded as a module, therefore init is always 1, | 560 | * We cannot be loaded as a module, therefore init is always 1, |
@@ -575,12 +576,12 @@ static void vgacon_init(struct vc_data *c, int init) | |||
575 | if (vga_512_chars) | 576 | if (vga_512_chars) |
576 | c->vc_hi_font_mask = 0x0800; | 577 | c->vc_hi_font_mask = 0x0800; |
577 | p = *c->vc_uni_pagedir_loc; | 578 | p = *c->vc_uni_pagedir_loc; |
578 | if (c->vc_uni_pagedir_loc == &c->vc_uni_pagedir || | 579 | if (c->vc_uni_pagedir_loc != &vgacon_uni_pagedir) { |
579 | !--c->vc_uni_pagedir_loc[1]) | ||
580 | con_free_unimap(c); | 580 | con_free_unimap(c); |
581 | c->vc_uni_pagedir_loc = vgacon_uni_pagedir; | 581 | c->vc_uni_pagedir_loc = &vgacon_uni_pagedir; |
582 | vgacon_uni_pagedir[1]++; | 582 | vgacon_refcount++; |
583 | if (!vgacon_uni_pagedir[0] && p) | 583 | } |
584 | if (!vgacon_uni_pagedir && p) | ||
584 | con_set_default_unimap(c); | 585 | con_set_default_unimap(c); |
585 | 586 | ||
586 | /* Only set the default if the user didn't deliberately override it */ | 587 | /* Only set the default if the user didn't deliberately override it */ |
@@ -597,7 +598,7 @@ static void vgacon_deinit(struct vc_data *c) | |||
597 | vga_set_mem_top(c); | 598 | vga_set_mem_top(c); |
598 | } | 599 | } |
599 | 600 | ||
600 | if (!--vgacon_uni_pagedir[1]) | 601 | if (!--vgacon_refcount) |
601 | con_free_unimap(c); | 602 | con_free_unimap(c); |
602 | c->vc_uni_pagedir_loc = &c->vc_uni_pagedir; | 603 | c->vc_uni_pagedir_loc = &c->vc_uni_pagedir; |
603 | con_set_default_unimap(c); | 604 | con_set_default_unimap(c); |