aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2005-12-13 01:48:35 -0500
committerPaul Mackerras <paulus@samba.org>2006-01-08 22:53:51 -0500
commit9cf84d7c97992dbe5360b241327341c07ce30fc9 (patch)
treede606aa77fb0d8c4d4c32106ac4fe7fa287cf27e
parentf75225d0a01e4f468b0395b02e549d2763bbabfb (diff)
[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>
-rw-r--r--drivers/video/platinumfb.c12
-rw-r--r--drivers/video/platinumfb.h4
2 files changed, 11 insertions, 5 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)
138 138
139 init = platinum_reg_init[pinfo->vmode-1]; 139 init = platinum_reg_init[pinfo->vmode-1];
140 140
141 if (pinfo->vmode == 13 && pinfo->cmode > 0) 141 if ((pinfo->vmode == VMODE_832_624_75) && (pinfo->cmode > CMODE_8))
142 offset = 0x10; 142 offset = 0x10;
143
143 info->screen_base = pinfo->frame_buffer + init->fb_offset + offset; 144 info->screen_base = pinfo->frame_buffer + init->fb_offset + offset;
144 info->fix.smem_start = (pinfo->frame_buffer_phys) + init->fb_offset + offset; 145 info->fix.smem_start = (pinfo->frame_buffer_phys) + init->fb_offset + offset;
145 info->fix.visual = (pinfo->cmode == CMODE_8) ? 146 info->fix.visual = (pinfo->cmode == CMODE_8) ?
146 FB_VISUAL_PSEUDOCOLOR : FB_VISUAL_DIRECTCOLOR; 147 FB_VISUAL_PSEUDOCOLOR : FB_VISUAL_DIRECTCOLOR;
147 info->fix.line_length = vmode_attrs[pinfo->vmode-1].hres * (1<<pinfo->cmode) + offset; 148 info->fix.line_length = vmode_attrs[pinfo->vmode-1].hres * (1<<pinfo->cmode)
149 + offset;
148 printk("line_length: %x\n", info->fix.line_length); 150 printk("line_length: %x\n", info->fix.line_length);
149 return 0; 151 return 0;
150} 152}
@@ -221,7 +223,9 @@ static int platinumfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
221static inline int platinum_vram_reqd(int video_mode, int color_mode) 223static inline int platinum_vram_reqd(int video_mode, int color_mode)
222{ 224{
223 return vmode_attrs[video_mode-1].vres * 225 return vmode_attrs[video_mode-1].vres *
224 (vmode_attrs[video_mode-1].hres * (1<<color_mode) + 0x20) +0x1000; 226 (vmode_attrs[video_mode-1].hres * (1<<color_mode) +
227 ((video_mode == VMODE_832_624_75) &&
228 (color_mode > CMODE_8)) ? 0x10 : 0x20) + 0x1000;
225} 229}
226 230
227#define STORE_D2(a, d) { \ 231#define STORE_D2(a, d) { \
diff --git a/drivers/video/platinumfb.h b/drivers/video/platinumfb.h
index 2834fc1c344b..f6bd77cafd17 100644
--- a/drivers/video/platinumfb.h
+++ b/drivers/video/platinumfb.h
@@ -158,7 +158,9 @@ static struct platinum_regvals platinum_reg_init_14 = {
158/* 832x624, 75Hz (13) */ 158/* 832x624, 75Hz (13) */
159static struct platinum_regvals platinum_reg_init_13 = { 159static struct platinum_regvals platinum_reg_init_13 = {
160 0x70, 160 0x70,
161 { 864, 1680, 3360 }, /* MacOS does 1680 instead of 1696 to fit 16bpp in 1MB */ 161 { 864, 1680, 3344 }, /* MacOS does 1680 instead of 1696 to fit 16bpp in 1MB,
162 * and we use 3344 instead of 3360 to fit in 2Mb
163 */
162 { 0xff0, 4, 0, 0, 0, 0, 0x299, 0, 164 { 0xff0, 4, 0, 0, 0, 0, 0x299, 0,
163 0, 0x21e, 0x120, 0x10, 0x23f, 0x1f, 0x25, 0x37, 165 0, 0x21e, 0x120, 0x10, 0x23f, 0x1f, 0x25, 0x37,
164 0x8a, 0x22a, 0x23e, 0x536, 0x534, 4, 9, 0x52, 166 0x8a, 0x22a, 0x23e, 0x536, 0x534, 4, 9, 0x52,