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

ps3av: dont distinguish between `boot' and `non-boot' autodetection

don't distinguish between `boot' and `non-boot' autodetection now the
autodetection code has been improved
Signed-off-by: default avatarGeert Uytterhoeven <Geert.Uytterhoeven@sonycom.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 466c449e
...@@ -760,8 +760,7 @@ static void ps3av_fixup_monitor_info(struct ps3av_info_monitor *info) ...@@ -760,8 +760,7 @@ static void ps3av_fixup_monitor_info(struct ps3av_info_monitor *info)
} }
} }
static int ps3av_auto_videomode(struct ps3av_pkt_av_get_hw_conf *av_hw_conf, static int ps3av_auto_videomode(struct ps3av_pkt_av_get_hw_conf *av_hw_conf)
int boot)
{ {
int i, res, id = 0, dvi = 0, rgb = 0; int i, res, id = 0, dvi = 0, rgb = 0;
struct ps3av_pkt_av_get_monitor_info monitor_info; struct ps3av_pkt_av_get_monitor_info monitor_info;
...@@ -799,28 +798,6 @@ static int ps3av_auto_videomode(struct ps3av_pkt_av_get_hw_conf *av_hw_conf, ...@@ -799,28 +798,6 @@ static int ps3av_auto_videomode(struct ps3av_pkt_av_get_hw_conf *av_hw_conf,
if (ps3av->region & PS3AV_REGION_RGB) if (ps3av->region & PS3AV_REGION_RGB)
rgb = PS3AV_MODE_RGB; rgb = PS3AV_MODE_RGB;
pr_debug("%s: Using avmulti mode %d\n", __func__, id); pr_debug("%s: Using avmulti mode %d\n", __func__, id);
} else if (boot) {
/* HDMI: using DEFAULT HDMI_MODE_ID while booting up */
info = &monitor_info.info;
if (ps3av->region & PS3AV_REGION_60) {
if (info->res_60.res_bits & PS3AV_RESBIT_720x480P)
id = PS3AV_DEFAULT_HDMI_MODE_ID_REG_60;
else if (info->res_50.res_bits & PS3AV_RESBIT_720x576P)
id = PS3AV_DEFAULT_HDMI_MODE_ID_REG_50;
else {
/* default */
id = PS3AV_DEFAULT_HDMI_MODE_ID_REG_60;
}
} else {
if (info->res_50.res_bits & PS3AV_RESBIT_720x576P)
id = PS3AV_DEFAULT_HDMI_MODE_ID_REG_50;
else if (info->res_60.res_bits & PS3AV_RESBIT_720x480P)
id = PS3AV_DEFAULT_HDMI_MODE_ID_REG_60;
else {
/* default */
id = PS3AV_DEFAULT_HDMI_MODE_ID_REG_50;
}
}
} }
return id | dvi | rgb; return id | dvi | rgb;
...@@ -862,7 +839,7 @@ static int ps3av_get_hw_conf(struct ps3av *ps3av) ...@@ -862,7 +839,7 @@ static int ps3av_get_hw_conf(struct ps3av *ps3av)
} }
/* set mode using id */ /* set mode using id */
int ps3av_set_video_mode(u32 id, int boot) int ps3av_set_video_mode(u32 id)
{ {
int size; int size;
u32 option; u32 option;
...@@ -876,7 +853,7 @@ int ps3av_set_video_mode(u32 id, int boot) ...@@ -876,7 +853,7 @@ int ps3av_set_video_mode(u32 id, int boot)
/* auto mode */ /* auto mode */
option = id & ~PS3AV_MODE_MASK; option = id & ~PS3AV_MODE_MASK;
if ((id & PS3AV_MODE_MASK) == 0) { if ((id & PS3AV_MODE_MASK) == 0) {
id = ps3av_auto_videomode(&ps3av->av_hw_conf, boot); id = ps3av_auto_videomode(&ps3av->av_hw_conf);
if (id < 1) { if (id < 1) {
printk(KERN_ERR "%s: invalid id :%d\n", __func__, id); printk(KERN_ERR "%s: invalid id :%d\n", __func__, id);
return -EINVAL; return -EINVAL;
...@@ -896,9 +873,9 @@ int ps3av_set_video_mode(u32 id, int boot) ...@@ -896,9 +873,9 @@ int ps3av_set_video_mode(u32 id, int boot)
EXPORT_SYMBOL_GPL(ps3av_set_video_mode); EXPORT_SYMBOL_GPL(ps3av_set_video_mode);
int ps3av_get_auto_mode(int boot) int ps3av_get_auto_mode(void)
{ {
return ps3av_auto_videomode(&ps3av->av_hw_conf, boot); return ps3av_auto_videomode(&ps3av->av_hw_conf);
} }
EXPORT_SYMBOL_GPL(ps3av_get_auto_mode); EXPORT_SYMBOL_GPL(ps3av_get_auto_mode);
...@@ -1044,7 +1021,7 @@ static int ps3av_probe(struct ps3_system_bus_device *dev) ...@@ -1044,7 +1021,7 @@ static int ps3av_probe(struct ps3_system_bus_device *dev)
res); res);
ps3av_get_hw_conf(ps3av); ps3av_get_hw_conf(ps3av);
id = ps3av_auto_videomode(&ps3av->av_hw_conf, 1); id = ps3av_auto_videomode(&ps3av->av_hw_conf);
mutex_lock(&ps3av->mutex); mutex_lock(&ps3av->mutex);
ps3av->ps3av_mode = id; ps3av->ps3av_mode = id;
mutex_unlock(&ps3av->mutex); mutex_unlock(&ps3av->mutex);
......
...@@ -548,7 +548,6 @@ static int ps3fb_set_par(struct fb_info *info) ...@@ -548,7 +548,6 @@ static int ps3fb_set_par(struct fb_info *info)
unsigned int mode; unsigned int mode;
int i; int i;
unsigned long offset; unsigned long offset;
static int first = 1;
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,
...@@ -572,10 +571,9 @@ static int ps3fb_set_par(struct fb_info *info) ...@@ -572,10 +571,9 @@ static int ps3fb_set_par(struct fb_info *info)
/* Keep the special bits we cannot set using fb_var_screeninfo */ /* Keep the special bits we cannot set using fb_var_screeninfo */
ps3fb_mode = (ps3fb_mode & ~PS3AV_MODE_MASK) | mode; ps3fb_mode = (ps3fb_mode & ~PS3AV_MODE_MASK) | mode;
if (ps3av_set_video_mode(ps3fb_mode, first)) if (ps3av_set_video_mode(ps3fb_mode))
return -EINVAL; return -EINVAL;
first = 0;
return 0; return 0;
} }
...@@ -737,7 +735,7 @@ static int ps3fb_ioctl(struct fb_info *info, unsigned int cmd, ...@@ -737,7 +735,7 @@ static int ps3fb_ioctl(struct fb_info *info, unsigned int cmd,
break; break;
if (!(val & PS3AV_MODE_MASK)) { if (!(val & PS3AV_MODE_MASK)) {
u32 id = ps3av_get_auto_mode(0); u32 id = ps3av_get_auto_mode();
if (id > 0) if (id > 0)
val = (val & ~PS3AV_MODE_MASK) | id; val = (val & ~PS3AV_MODE_MASK) | id;
} }
......
...@@ -709,9 +709,9 @@ extern int ps3av_cmd_av_get_hw_conf(struct ps3av_pkt_av_get_hw_conf *); ...@@ -709,9 +709,9 @@ extern int ps3av_cmd_av_get_hw_conf(struct ps3av_pkt_av_get_hw_conf *);
extern int ps3av_cmd_video_get_monitor_info(struct ps3av_pkt_av_get_monitor_info *, extern int ps3av_cmd_video_get_monitor_info(struct ps3av_pkt_av_get_monitor_info *,
u32); u32);
extern int ps3av_set_video_mode(u32, int); extern int ps3av_set_video_mode(u32);
extern int ps3av_set_audio_mode(u32, u32, u32, u32, u32); extern int ps3av_set_audio_mode(u32, u32, u32, u32, u32);
extern int ps3av_get_auto_mode(int); extern int ps3av_get_auto_mode(void);
extern int ps3av_get_mode(void); extern int ps3av_get_mode(void);
extern int ps3av_get_scanmode(int); extern int ps3av_get_scanmode(int);
extern int ps3av_get_refresh_rate(int); extern int ps3av_get_refresh_rate(int);
......
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