ps3: Make `ps3videomode -v 0 (auto mode) work again
authorMasashi Kimoto <Masashi_Kimoto@hq.scei.sony.co.jp>
Wed, 2 May 2007 12:48:36 +0000 (14:48 +0200)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Sat, 5 May 2007 00:59:08 +0000 (17:59 -0700)
ps3: Make `ps3videomode -v 0' (auto mode) work again

Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/ps3/ps3av.c
drivers/video/ps3fb.c
include/asm-powerpc/ps3av.h

index 1a56d390fcd90274bff4f7543402bce640af5005..5a418b1b16593164c36698c2eb9def254d0053dc 100644 (file)
@@ -744,6 +744,13 @@ int ps3av_set_video_mode(u32 id, int boot)
 
 EXPORT_SYMBOL_GPL(ps3av_set_video_mode);
 
+int ps3av_get_auto_mode(int boot)
+{
+       return ps3av_auto_videomode(&ps3av.av_hw_conf, boot);
+}
+
+EXPORT_SYMBOL_GPL(ps3av_get_auto_mode);
+
 int ps3av_set_mode(u32 id, int boot)
 {
        int res;
index f7f228d1c2d9f8a7e136c67b8c10ae51cb5c10dc..9fe64829aa81884694ad53c99048e211da428fda 100644 (file)
@@ -732,6 +732,11 @@ static int ps3fb_ioctl(struct fb_info *info, unsigned int cmd,
                        if (copy_from_user(&val, argp, sizeof(val)))
                                break;
 
+                       if (!(val & PS3AV_MODE_MASK)) {
+                               u32 id = ps3av_get_auto_mode(0);
+                               if (id > 0)
+                                       val = (val & ~PS3AV_MODE_MASK) | id;
+                       }
                        DPRINTK("PS3FB_IOCTL_SETMODE:%x\n", val);
                        retval = -EINVAL;
                        old_mode = ps3fb_mode;
index 1366fc5b452d309964ed561d4ab37c4bbe39cfd2..9efc40f1c7788311d9b40847588b6381c6baa51b 100644 (file)
@@ -706,6 +706,7 @@ extern int ps3av_vuart_read(struct ps3_vuart_port_device *dev, void *buf,
 
 extern int ps3av_set_video_mode(u32, int);
 extern int ps3av_set_audio_mode(u32, u32, u32, u32, u32);
+extern int ps3av_get_auto_mode(int);
 extern int ps3av_set_mode(u32, int);
 extern int ps3av_get_mode(void);
 extern int ps3av_get_scanmode(int);