diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2005-12-13 17:48:35 +1100 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-01-09 14:53:51 +1100 |
commit | 9cf84d7c97992dbe5360b241327341c07ce30fc9 (patch) | |
tree | de606aa77fb0d8c4d4c32106ac4fe7fa287cf27e /drivers/video/platinumfb.c | |
parent | f75225d0a01e4f468b0395b02e549d2763bbabfb (diff) | |
download | linux-next-9cf84d7c97992dbe5360b241327341c07ce30fc9.tar.gz |
[PATCH] powerpc: Fix platinumfb for some modes
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>
Diffstat (limited to 'drivers/video/platinumfb.c')
-rw-r--r-- | drivers/video/platinumfb.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/video/platinumfb.c b/drivers/video/platinumfb.c index ca4082ae5a18..ba0af1b66bb6 100644 --- a/drivers/video/platinumfb.c +++ b/drivers/video/platinumfb.c @@ -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) { \ |