Commit c95344a5 authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Linus Torvalds

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: default avatarGeert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
CC: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: default avatarAntonino Daplas <adaplas@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 8ca0bf75
...@@ -303,13 +303,13 @@ module_param(ps3fb_mode, int, 0); ...@@ -303,13 +303,13 @@ module_param(ps3fb_mode, int, 0);
static char *mode_option __devinitdata; static char *mode_option __devinitdata;
static int ps3fb_get_res_table(u32 xres, u32 yres) static int ps3fb_get_res_table(u32 xres, u32 yres, int mode)
{ {
int full_mode; int full_mode;
unsigned int i; unsigned int i;
u32 x, y, f; u32 x, y, f;
full_mode = (ps3fb_mode & PS3FB_FULL_MODE_BIT) ? PS3FB_RES_FULL : 0; full_mode = (mode & PS3FB_FULL_MODE_BIT) ? PS3FB_RES_FULL : 0;
for (i = 0;; i++) { for (i = 0;; i++) {
x = ps3fb_res[i].xres; x = ps3fb_res[i].xres;
y = ps3fb_res[i].yres; y = ps3fb_res[i].yres;
...@@ -527,7 +527,7 @@ static int ps3fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) ...@@ -527,7 +527,7 @@ static int ps3fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
} }
/* Memory limit */ /* Memory limit */
i = ps3fb_get_res_table(var->xres, var->yres); i = ps3fb_get_res_table(var->xres, var->yres, mode);
if (ps3fb_res[i].xres*ps3fb_res[i].yres*BPP > ps3fb_videomemory.size) { if (ps3fb_res[i].xres*ps3fb_res[i].yres*BPP > ps3fb_videomemory.size) {
DPRINTK("Not enough memory\n"); DPRINTK("Not enough memory\n");
return -ENOMEM; return -ENOMEM;
...@@ -553,13 +553,14 @@ static int ps3fb_set_par(struct fb_info *info) ...@@ -553,13 +553,14 @@ static int ps3fb_set_par(struct fb_info *info)
DPRINTK("xres:%d xv:%d yres:%d yv:%d clock:%d\n", DPRINTK("xres:%d xv:%d yres:%d yv:%d clock:%d\n",
info->var.xres, info->var.xres_virtual, info->var.xres, info->var.xres_virtual,
info->var.yres, info->var.yres_virtual, info->var.pixclock); info->var.yres, info->var.yres_virtual, info->var.pixclock);
i = ps3fb_get_res_table(info->var.xres, info->var.yres);
ps3fb.res_index = i;
mode = ps3fb_find_mode(&info->var, &info->fix.line_length); mode = ps3fb_find_mode(&info->var, &info->fix.line_length);
if (!mode) if (!mode)
return -EINVAL; return -EINVAL;
i = ps3fb_get_res_table(info->var.xres, info->var.yres, mode);
ps3fb.res_index = i;
offset = FB_OFF(i) + VP_OFF(i); offset = FB_OFF(i) + VP_OFF(i);
info->fix.smem_len = ps3fb_videomemory.size - offset; info->fix.smem_len = ps3fb_videomemory.size - offset;
info->screen_base = (char __iomem *)ps3fb.xdr_ea + offset; 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,7 +611,7 @@ static int ps3fb_mmap(struct fb_info *info, struct vm_area_struct *vma)
unsigned long size, offset; unsigned long size, offset;
int i; int i;
i = ps3fb_get_res_table(info->var.xres, info->var.yres); i = ps3fb_get_res_table(info->var.xres, info->var.yres, ps3fb_mode);
if (i == -1) if (i == -1)
return -EINVAL; return -EINVAL;
...@@ -999,7 +1000,7 @@ static int __devinit ps3fb_probe(struct ps3_system_bus_device *dev) ...@@ -999,7 +1000,7 @@ static int __devinit ps3fb_probe(struct ps3_system_bus_device *dev)
if (ps3fb_mode > 0 && if (ps3fb_mode > 0 &&
!ps3av_video_mode2res(ps3fb_mode, &xres, &yres)) { !ps3av_video_mode2res(ps3fb_mode, &xres, &yres)) {
ps3fb.res_index = ps3fb_get_res_table(xres, yres); ps3fb.res_index = ps3fb_get_res_table(xres, yres, ps3fb_mode);
DPRINTK("res_index:%d\n", ps3fb.res_index); DPRINTK("res_index:%d\n", ps3fb.res_index);
} else } else
ps3fb.res_index = GPU_RES_INDEX; ps3fb.res_index = GPU_RES_INDEX;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment