aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/ps3fb.c
diff options
context:
space:
mode:
authorGeert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>2007-10-16 04:29:25 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-16 12:43:19 -0400
commitc95344a557099f4e4a9fd05b6145a72541b2158a (patch)
tree8444d19b7b356d8a7d1c0a48de18e099987751b1 /drivers/video/ps3fb.c
parent8ca0bf750b7d9b7e859f2f40516b914827e7afd8 (diff)
ps3fb: Fix spurious mode change failures
ps3fb: Add a `mode' parameter to ps3fb_get_res_table(), as in some cases it should check the full-screen flag of the _new_ video mode instead of the current video mode. This bug caused spurious mode change failures when switching between fullscreen and non-fullscreen modes using fbset, while ps3-video-mode worked fine. Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com> CC: Geoff Levand <geoffrey.levand@am.sony.com> Signed-off-by: Antonino Daplas <adaplas@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/video/ps3fb.c')
-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;