aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorGeert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>2007-10-16 04:29:44 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-16 12:43:21 -0400
commitce4c371a9de1f5b9e1d15f9d59c5f7d079bcd6d7 (patch)
treee1a5d3c0c8ce3656bdf7121ea8a8fbaad3140a88 /drivers
parent466c449e5feb6007841c100d385aeba7869b9946 (diff)
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: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.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')
-rw-r--r--drivers/ps3/ps3av.c35
-rw-r--r--drivers/video/ps3fb.c6
2 files changed, 8 insertions, 33 deletions
diff --git a/drivers/ps3/ps3av.c b/drivers/ps3/ps3av.c
index 53179f35264e..08296412da96 100644
--- a/drivers/ps3/ps3av.c
+++ b/drivers/ps3/ps3av.c
@@ -760,8 +760,7 @@ static void ps3av_fixup_monitor_info(struct ps3av_info_monitor *info)
760 } 760 }
761} 761}
762 762
763static int ps3av_auto_videomode(struct ps3av_pkt_av_get_hw_conf *av_hw_conf, 763static int ps3av_auto_videomode(struct ps3av_pkt_av_get_hw_conf *av_hw_conf)
764 int boot)
765{ 764{
766 int i, res, id = 0, dvi = 0, rgb = 0; 765 int i, res, id = 0, dvi = 0, rgb = 0;
767 struct ps3av_pkt_av_get_monitor_info monitor_info; 766 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 if (ps3av->region & PS3AV_REGION_RGB) 798 if (ps3av->region & PS3AV_REGION_RGB)
800 rgb = PS3AV_MODE_RGB; 799 rgb = PS3AV_MODE_RGB;
801 pr_debug("%s: Using avmulti mode %d\n", __func__, id); 800 pr_debug("%s: Using avmulti mode %d\n", __func__, id);
802 } else if (boot) {
803 /* HDMI: using DEFAULT HDMI_MODE_ID while booting up */
804 info = &monitor_info.info;
805 if (ps3av->region & PS3AV_REGION_60) {
806 if (info->res_60.res_bits & PS3AV_RESBIT_720x480P)
807 id = PS3AV_DEFAULT_HDMI_MODE_ID_REG_60;
808 else if (info->res_50.res_bits & PS3AV_RESBIT_720x576P)
809 id = PS3AV_DEFAULT_HDMI_MODE_ID_REG_50;
810 else {
811 /* default */
812 id = PS3AV_DEFAULT_HDMI_MODE_ID_REG_60;
813 }
814 } else {
815 if (info->res_50.res_bits & PS3AV_RESBIT_720x576P)
816 id = PS3AV_DEFAULT_HDMI_MODE_ID_REG_50;
817 else if (info->res_60.res_bits & PS3AV_RESBIT_720x480P)
818 id = PS3AV_DEFAULT_HDMI_MODE_ID_REG_60;
819 else {
820 /* default */
821 id = PS3AV_DEFAULT_HDMI_MODE_ID_REG_50;
822 }
823 }
824 } 801 }
825 802
826 return id | dvi | rgb; 803 return id | dvi | rgb;
@@ -862,7 +839,7 @@ static int ps3av_get_hw_conf(struct ps3av *ps3av)
862} 839}
863 840
864/* set mode using id */ 841/* set mode using id */
865int ps3av_set_video_mode(u32 id, int boot) 842int ps3av_set_video_mode(u32 id)
866{ 843{
867 int size; 844 int size;
868 u32 option; 845 u32 option;
@@ -876,7 +853,7 @@ int ps3av_set_video_mode(u32 id, int boot)
876 /* auto mode */ 853 /* auto mode */
877 option = id & ~PS3AV_MODE_MASK; 854 option = id & ~PS3AV_MODE_MASK;
878 if ((id & PS3AV_MODE_MASK) == 0) { 855 if ((id & PS3AV_MODE_MASK) == 0) {
879 id = ps3av_auto_videomode(&ps3av->av_hw_conf, boot); 856 id = ps3av_auto_videomode(&ps3av->av_hw_conf);
880 if (id < 1) { 857 if (id < 1) {
881 printk(KERN_ERR "%s: invalid id :%d\n", __func__, id); 858 printk(KERN_ERR "%s: invalid id :%d\n", __func__, id);
882 return -EINVAL; 859 return -EINVAL;
@@ -896,9 +873,9 @@ int ps3av_set_video_mode(u32 id, int boot)
896 873
897EXPORT_SYMBOL_GPL(ps3av_set_video_mode); 874EXPORT_SYMBOL_GPL(ps3av_set_video_mode);
898 875
899int ps3av_get_auto_mode(int boot) 876int ps3av_get_auto_mode(void)
900{ 877{
901 return ps3av_auto_videomode(&ps3av->av_hw_conf, boot); 878 return ps3av_auto_videomode(&ps3av->av_hw_conf);
902} 879}
903 880
904EXPORT_SYMBOL_GPL(ps3av_get_auto_mode); 881EXPORT_SYMBOL_GPL(ps3av_get_auto_mode);
@@ -1044,7 +1021,7 @@ static int ps3av_probe(struct ps3_system_bus_device *dev)
1044 res); 1021 res);
1045 1022
1046 ps3av_get_hw_conf(ps3av); 1023 ps3av_get_hw_conf(ps3av);
1047 id = ps3av_auto_videomode(&ps3av->av_hw_conf, 1); 1024 id = ps3av_auto_videomode(&ps3av->av_hw_conf);
1048 mutex_lock(&ps3av->mutex); 1025 mutex_lock(&ps3av->mutex);
1049 ps3av->ps3av_mode = id; 1026 ps3av->ps3av_mode = id;
1050 mutex_unlock(&ps3av->mutex); 1027 mutex_unlock(&ps3av->mutex);
diff --git a/drivers/video/ps3fb.c b/drivers/video/ps3fb.c
index c9037e984f8b..07fdad1604af 100644
--- a/drivers/video/ps3fb.c
+++ b/drivers/video/ps3fb.c
@@ -548,7 +548,6 @@ static int ps3fb_set_par(struct fb_info *info)
548 unsigned int mode; 548 unsigned int mode;
549 int i; 549 int i;
550 unsigned long offset; 550 unsigned long offset;
551 static int first = 1;
552 551
553 DPRINTK("xres:%d xv:%d yres:%d yv:%d clock:%d\n", 552 DPRINTK("xres:%d xv:%d yres:%d yv:%d clock:%d\n",
554 info->var.xres, info->var.xres_virtual, 553 info->var.xres, info->var.xres_virtual,
@@ -572,10 +571,9 @@ static int ps3fb_set_par(struct fb_info *info)
572 /* Keep the special bits we cannot set using fb_var_screeninfo */ 571 /* Keep the special bits we cannot set using fb_var_screeninfo */
573 ps3fb_mode = (ps3fb_mode & ~PS3AV_MODE_MASK) | mode; 572 ps3fb_mode = (ps3fb_mode & ~PS3AV_MODE_MASK) | mode;
574 573
575 if (ps3av_set_video_mode(ps3fb_mode, first)) 574 if (ps3av_set_video_mode(ps3fb_mode))
576 return -EINVAL; 575 return -EINVAL;
577 576
578 first = 0;
579 return 0; 577 return 0;
580} 578}
581 579
@@ -737,7 +735,7 @@ static int ps3fb_ioctl(struct fb_info *info, unsigned int cmd,
737 break; 735 break;
738 736
739 if (!(val & PS3AV_MODE_MASK)) { 737 if (!(val & PS3AV_MODE_MASK)) {
740 u32 id = ps3av_get_auto_mode(0); 738 u32 id = ps3av_get_auto_mode();
741 if (id > 0) 739 if (id > 0)
742 val = (val & ~PS3AV_MODE_MASK) | id; 740 val = (val & ~PS3AV_MODE_MASK) | id;
743 } 741 }