]> git.hungrycats.org Git - linux/commitdiff
[PATCH] fix vga16fb.c frame buffer bad memory mapping
authorAndrew Morton <akpm@osdl.org>
Tue, 13 Apr 2004 02:22:50 +0000 (19:22 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Tue, 13 Apr 2004 02:22:50 +0000 (19:22 -0700)
From: Vincent Sanders <vince@kyllikki.org>

The vga16fb driver uses a direct ioremap on 0xa00000 to gain access to the
vga card.  This is wrong on architectures other than x86, every other driver
uses VGA_MAP_MEM macro from vga.h to ensure the correct memory mapping.

drivers/video/vga16fb.c

index d244205e35f9bb37f3efd2aeb5dd58776e726874..577355dac63b177c199ec056f4347c0a2b703ec5 100644 (file)
@@ -1347,7 +1347,7 @@ int __init vga16fb_init(void)
 
        /* XXX share VGA_FB_PHYS and I/O region with vgacon and others */
 
-        vga16fb.screen_base = ioremap(VGA_FB_PHYS, VGA_FB_PHYS_LEN);
+       vga16fb.screen_base = ioremap(VGA_MAP_MEM(VGA_FB_PHYS), VGA_FB_PHYS_LEN);
        if (!vga16fb.screen_base) {
                printk(KERN_ERR "vga16fb: unable to map device\n");
                ret = -ENOMEM;
@@ -1372,6 +1372,8 @@ int __init vga16fb_init(void)
        vga16fb.par = &vga16_par;
        vga16fb.flags = FBINFO_FLAG_DEFAULT;
 
+       vga16fb.fix.smem_start  = VGA_MAP_MEM(vga16fb.fix.smem_start);
+
        i = (vga16fb_defined.bits_per_pixel == 8) ? 256 : 16;
        ret = fb_alloc_cmap(&vga16fb.cmap, i, 0);
        if (ret) {