diff options
author | Bjorn Helgaas <bjorn.helgaas@hp.com> | 2006-06-22 17:47:32 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-22 18:05:58 -0400 |
commit | 4f1bcaf094ccc512c23e10104c05a6f8e5b7a9e4 (patch) | |
tree | 883c6ece20a28f86eb73cd329bb9d4674b1e5480 /drivers/video/console/vgacon.c | |
parent | d702ccb342e49f7591df5a87c3857c698183b0fa (diff) |
[PATCH] vgacon: make VGA_MAP_MEM take size, remove extra use
VGA_MAP_MEM translates to ioremap() on some architectures. It makes sense
to do this to vga_vram_base, because we're going to access memory between
vga_vram_base and vga_vram_end.
But it doesn't really make sense to map starting at vga_vram_end, because
we aren't going to access memory starting there. On ia64, which always has
to be different, ioremapping vga_vram_end gives you something completely
incompatible with ioremapped vga_vram_start, so vga_vram_size ends up being
nonsense.
As a bonus, we often know the size up front, so we can use ioremap()
correctly, rather than giving it a zero size.
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Cc: "Luck, Tony" <tony.luck@intel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/video/console/vgacon.c')
-rw-r--r-- | drivers/video/console/vgacon.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/drivers/video/console/vgacon.c b/drivers/video/console/vgacon.c index d5a04b68c4d4..e64d42e2449e 100644 --- a/drivers/video/console/vgacon.c +++ b/drivers/video/console/vgacon.c | |||
@@ -391,7 +391,7 @@ static const char __init *vgacon_startup(void) | |||
391 | static struct resource ega_console_resource = | 391 | static struct resource ega_console_resource = |
392 | { "ega", 0x3B0, 0x3BF }; | 392 | { "ega", 0x3B0, 0x3BF }; |
393 | vga_video_type = VIDEO_TYPE_EGAM; | 393 | vga_video_type = VIDEO_TYPE_EGAM; |
394 | vga_vram_end = 0xb8000; | 394 | vga_vram_size = 0x8000; |
395 | display_desc = "EGA+"; | 395 | display_desc = "EGA+"; |
396 | request_resource(&ioport_resource, | 396 | request_resource(&ioport_resource, |
397 | &ega_console_resource); | 397 | &ega_console_resource); |
@@ -401,7 +401,7 @@ static const char __init *vgacon_startup(void) | |||
401 | static struct resource mda2_console_resource = | 401 | static struct resource mda2_console_resource = |
402 | { "mda", 0x3BF, 0x3BF }; | 402 | { "mda", 0x3BF, 0x3BF }; |
403 | vga_video_type = VIDEO_TYPE_MDA; | 403 | vga_video_type = VIDEO_TYPE_MDA; |
404 | vga_vram_end = 0xb2000; | 404 | vga_vram_size = 0x2000; |
405 | display_desc = "*MDA"; | 405 | display_desc = "*MDA"; |
406 | request_resource(&ioport_resource, | 406 | request_resource(&ioport_resource, |
407 | &mda1_console_resource); | 407 | &mda1_console_resource); |
@@ -418,7 +418,7 @@ static const char __init *vgacon_startup(void) | |||
418 | if ((ORIG_VIDEO_EGA_BX & 0xff) != 0x10) { | 418 | if ((ORIG_VIDEO_EGA_BX & 0xff) != 0x10) { |
419 | int i; | 419 | int i; |
420 | 420 | ||
421 | vga_vram_end = 0xc0000; | 421 | vga_vram_size = 0x8000; |
422 | 422 | ||
423 | if (!ORIG_VIDEO_ISVGA) { | 423 | if (!ORIG_VIDEO_ISVGA) { |
424 | static struct resource ega_console_resource | 424 | static struct resource ega_console_resource |
@@ -443,7 +443,7 @@ static const char __init *vgacon_startup(void) | |||
443 | * and COE=1 isn't necessarily a good idea) | 443 | * and COE=1 isn't necessarily a good idea) |
444 | */ | 444 | */ |
445 | vga_vram_base = 0xa0000; | 445 | vga_vram_base = 0xa0000; |
446 | vga_vram_end = 0xb0000; | 446 | vga_vram_size = 0x10000; |
447 | outb_p(6, VGA_GFX_I); | 447 | outb_p(6, VGA_GFX_I); |
448 | outb_p(6, VGA_GFX_D); | 448 | outb_p(6, VGA_GFX_D); |
449 | #endif | 449 | #endif |
@@ -475,7 +475,7 @@ static const char __init *vgacon_startup(void) | |||
475 | static struct resource cga_console_resource = | 475 | static struct resource cga_console_resource = |
476 | { "cga", 0x3D4, 0x3D5 }; | 476 | { "cga", 0x3D4, 0x3D5 }; |
477 | vga_video_type = VIDEO_TYPE_CGA; | 477 | vga_video_type = VIDEO_TYPE_CGA; |
478 | vga_vram_end = 0xba000; | 478 | vga_vram_size = 0x2000; |
479 | display_desc = "*CGA"; | 479 | display_desc = "*CGA"; |
480 | request_resource(&ioport_resource, | 480 | request_resource(&ioport_resource, |
481 | &cga_console_resource); | 481 | &cga_console_resource); |
@@ -483,9 +483,8 @@ static const char __init *vgacon_startup(void) | |||
483 | } | 483 | } |
484 | } | 484 | } |
485 | 485 | ||
486 | vga_vram_base = VGA_MAP_MEM(vga_vram_base); | 486 | vga_vram_base = VGA_MAP_MEM(vga_vram_base, vga_vram_size); |
487 | vga_vram_end = VGA_MAP_MEM(vga_vram_end); | 487 | vga_vram_end = vga_vram_base + vga_vram_size; |
488 | vga_vram_size = vga_vram_end - vga_vram_base; | ||
489 | 488 | ||
490 | /* | 489 | /* |
491 | * Find out if there is a graphics card present. | 490 | * Find out if there is a graphics card present. |
@@ -1020,14 +1019,14 @@ static int vgacon_do_font_op(struct vgastate *state,char *arg,int set,int ch512) | |||
1020 | char *charmap; | 1019 | char *charmap; |
1021 | 1020 | ||
1022 | if (vga_video_type != VIDEO_TYPE_EGAM) { | 1021 | if (vga_video_type != VIDEO_TYPE_EGAM) { |
1023 | charmap = (char *) VGA_MAP_MEM(colourmap); | 1022 | charmap = (char *) VGA_MAP_MEM(colourmap, 0); |
1024 | beg = 0x0e; | 1023 | beg = 0x0e; |
1025 | #ifdef VGA_CAN_DO_64KB | 1024 | #ifdef VGA_CAN_DO_64KB |
1026 | if (vga_video_type == VIDEO_TYPE_VGAC) | 1025 | if (vga_video_type == VIDEO_TYPE_VGAC) |
1027 | beg = 0x06; | 1026 | beg = 0x06; |
1028 | #endif | 1027 | #endif |
1029 | } else { | 1028 | } else { |
1030 | charmap = (char *) VGA_MAP_MEM(blackwmap); | 1029 | charmap = (char *) VGA_MAP_MEM(blackwmap, 0); |
1031 | beg = 0x0a; | 1030 | beg = 0x0a; |
1032 | } | 1031 | } |
1033 | 1032 | ||