aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/video/ps3fb.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/video/ps3fb.c b/drivers/video/ps3fb.c
index e0beb979cecb..c9037e984f8b 100644
--- a/drivers/video/ps3fb.c
+++ b/drivers/video/ps3fb.c
@@ -303,13 +303,13 @@ module_param(ps3fb_mode, int, 0);
303 303
304static char *mode_option __devinitdata; 304static char *mode_option __devinitdata;
305 305
306static int ps3fb_get_res_table(u32 xres, u32 yres) 306static int ps3fb_get_res_table(u32 xres, u32 yres, int mode)
307{ 307{
308 int full_mode; 308 int full_mode;
309 unsigned int i; 309 unsigned int i;
310 u32 x, y, f; 310 u32 x, y, f;
311 311
312 full_mode = (ps3fb_mode & PS3FB_FULL_MODE_BIT) ? PS3FB_RES_FULL : 0; 312 full_mode = (mode & PS3FB_FULL_MODE_BIT) ? PS3FB_RES_FULL : 0;
313 for (i = 0;; i++) { 313 for (i = 0;; i++) {
314 x = ps3fb_res[i].xres; 314 x = ps3fb_res[i].xres;
315 y = ps3fb_res[i].yres; 315 y = ps3fb_res[i].yres;
@@ -527,7 +527,7 @@ static int ps3fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
527 } 527 }
528 528
529 /* Memory limit */ 529 /* Memory limit */
530 i = ps3fb_get_res_table(var->xres, var->yres); 530 i = ps3fb_get_res_table(var->xres, var->yres, mode);
531 if (ps3fb_res[i].xres*ps3fb_res[i].yres*BPP > ps3fb_videomemory.size) { 531 if (ps3fb_res[i].xres*ps3fb_res[i].yres*BPP > ps3fb_videomemory.size) {
532 DPRINTK("Not enough memory\n"); 532 DPRINTK("Not enough memory\n");
533 return -ENOMEM; 533 return -ENOMEM;
@@ -553,13 +553,14 @@ static int ps3fb_set_par(struct fb_info *info)
553 DPRINTK("xres:%d xv:%d yres:%d yv:%d clock:%d\n", 553 DPRINTK("xres:%d xv:%d yres:%d yv:%d clock:%d\n",
554 info->var.xres, info->var.xres_virtual, 554 info->var.xres, info->var.xres_virtual,
555 info->var.yres, info->var.yres_virtual, info->var.pixclock); 555 info->var.yres, info->var.yres_virtual, info->var.pixclock);
556 i = ps3fb_get_res_table(info->var.xres, info->var.yres);
557 ps3fb.res_index = i;
558 556
559 mode = ps3fb_find_mode(&info->var, &info->fix.line_length); 557 mode = ps3fb_find_mode(&info->var, &info->fix.line_length);
560 if (!mode) 558 if (!mode)
561 return -EINVAL; 559 return -EINVAL;
562 560
561 i = ps3fb_get_res_table(info->var.xres, info->var.yres, mode);
562 ps3fb.res_index = i;
563
563 offset = FB_OFF(i) + VP_OFF(i); 564 offset = FB_OFF(i) + VP_OFF(i);
564 info->fix.smem_len = ps3fb_videomemory.size - offset; 565 info->fix.smem_len = ps3fb_videomemory.size - offset;
565 info->screen_base = (char __iomem *)ps3fb.xdr_ea + offset; 566 info->screen_base = (char __iomem *)ps3fb.xdr_ea + offset;
@@ -610,7 +611,7 @@ static int ps3fb_mmap(struct fb_info *info, struct vm_area_struct *vma)
610 unsigned long size, offset; 611 unsigned long size, offset;
611 int i; 612 int i;
612 613
613 i = ps3fb_get_res_table(info->var.xres, info->var.yres); 614 i = ps3fb_get_res_table(info->var.xres, info->var.yres, ps3fb_mode);
614 if (i == -1) 615 if (i == -1)
615 return -EINVAL; 616 return -EINVAL;
616 617
@@ -999,7 +1000,7 @@ static int __devinit ps3fb_probe(struct ps3_system_bus_device *dev)
999 1000
1000 if (ps3fb_mode > 0 && 1001 if (ps3fb_mode > 0 &&
1001 !ps3av_video_mode2res(ps3fb_mode, &xres, &yres)) { 1002 !ps3av_video_mode2res(ps3fb_mode, &xres, &yres)) {
1002 ps3fb.res_index = ps3fb_get_res_table(xres, yres); 1003 ps3fb.res_index = ps3fb_get_res_table(xres, yres, ps3fb_mode);
1003 DPRINTK("res_index:%d\n", ps3fb.res_index); 1004 DPRINTK("res_index:%d\n", ps3fb.res_index);
1004 } else 1005 } else
1005 ps3fb.res_index = GPU_RES_INDEX; 1006 ps3fb.res_index = GPU_RES_INDEX;