]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] powerpc: Fix platinumfb for some modes
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Tue, 13 Dec 2005 06:48:35 +0000 (17:48 +1100)
committerPaul Mackerras <paulus@samba.org>
Mon, 9 Jan 2006 03:53:51 +0000 (14:53 +1100)
The platinumfb driver used only on some powermacs has an issue with some
video modes & limited VRAM. This patch fixes it.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
drivers/video/platinumfb.c
drivers/video/platinumfb.h

index ca4082ae5a18d34313a3a71c7ef2b34b977a484e..ba0af1b66bb6018264974d56a38f5fc5bf88de23 100644 (file)
@@ -138,13 +138,15 @@ static int platinumfb_set_par (struct fb_info *info)
 
        init = platinum_reg_init[pinfo->vmode-1];
        
-       if (pinfo->vmode == 13 && pinfo->cmode > 0)
-               offset = 0x10;
+       if ((pinfo->vmode == VMODE_832_624_75) && (pinfo->cmode > CMODE_8))
+               offset = 0x10;
+
        info->screen_base = pinfo->frame_buffer + init->fb_offset + offset;
        info->fix.smem_start = (pinfo->frame_buffer_phys) + init->fb_offset + offset;
        info->fix.visual = (pinfo->cmode == CMODE_8) ?
                FB_VISUAL_PSEUDOCOLOR : FB_VISUAL_DIRECTCOLOR;
-       info->fix.line_length = vmode_attrs[pinfo->vmode-1].hres * (1<<pinfo->cmode) + offset;
+       info->fix.line_length = vmode_attrs[pinfo->vmode-1].hres * (1<<pinfo->cmode)
+               + offset;
        printk("line_length: %x\n", info->fix.line_length);
        return 0;
 }
@@ -221,7 +223,9 @@ static int platinumfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
 static inline int platinum_vram_reqd(int video_mode, int color_mode)
 {
        return vmode_attrs[video_mode-1].vres *
-              (vmode_attrs[video_mode-1].hres * (1<<color_mode) + 0x20) +0x1000;
+              (vmode_attrs[video_mode-1].hres * (1<<color_mode) +
+               ((video_mode == VMODE_832_624_75) &&
+                (color_mode > CMODE_8)) ? 0x10 : 0x20) + 0x1000;
 }
 
 #define STORE_D2(a, d) { \
index 2834fc1c344b3400bbef8a90b3576c190e8e6d45..f6bd77cafd174b3224a99ab6fba5c67687ac505f 100644 (file)
@@ -158,7 +158,9 @@ static struct platinum_regvals platinum_reg_init_14 = {
 /* 832x624, 75Hz (13) */
 static struct platinum_regvals platinum_reg_init_13 = {
        0x70,
-       { 864, 1680, 3360 },    /* MacOS does 1680 instead of 1696 to fit 16bpp in 1MB */
+       { 864, 1680, 3344 },    /* MacOS does 1680 instead of 1696 to fit 16bpp in 1MB,
+                                * and we use 3344 instead of 3360 to fit in 2Mb
+                                */
        { 0xff0, 4, 0, 0, 0, 0, 0x299, 0,
          0, 0x21e, 0x120, 0x10, 0x23f, 0x1f, 0x25, 0x37,
          0x8a, 0x22a, 0x23e, 0x536, 0x534, 4, 9, 0x52,