DSS2: add support for FBIO_WAITFORVSYNC
authorGrazvydas Ignotas <notasas@gmail.com>
Sun, 3 May 2009 12:43:15 +0000 (15:43 +0300)
committerGrazvydas Ignotas <notasas@gmail.com>
Sun, 3 May 2009 12:43:15 +0000 (15:43 +0300)
FBIO_WAITFORVSYNC is semi-stardard ioctl for waiting vsync, already
used by some userspace, so add it as an alias for OMAPFB_WAITFORVSYNC.

Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
drivers/video/omap2/omapfb/omapfb-ioctl.c
include/linux/omapfb.h

index 79d8916..c893fc9 100644 (file)
@@ -450,6 +450,7 @@ int omapfb_ioctl(struct fb_info *fbi, unsigned int cmd, unsigned long arg)
                enum omapfb_update_mode         update_mode;
                int test_num;
                struct omapfb_memory_read       memory_read;
+               u_int32_t                       crt;
        } p;
 
        int r = 0;
@@ -590,6 +591,17 @@ int omapfb_ioctl(struct fb_info *fbi, unsigned int cmd, unsigned long arg)
                        r = -EFAULT;
                break;
 
+       case FBIO_WAITFORVSYNC:
+               if (get_user(p.crt, (u_int32_t __user *)arg)) {
+                       r = -EFAULT;
+                       break;
+               }
+               if (p.crt != 0) {
+                       r = -ENODEV;
+                       break;
+               }
+               /* FALLTHROUGH */
+
        case OMAPFB_WAITFORVSYNC:
                DBG("ioctl WAITFORVSYNC\n");
                if (!display) {
index 7a34f22..f7f34d2 100644 (file)
 #define OMAPFB_WAITFORVSYNC    OMAP_IO(57)
 #define OMAPFB_MEMORY_READ     OMAP_IOR(58, struct omapfb_memory_read)
 
+#ifndef FBIO_WAITFORVSYNC
+#define FBIO_WAITFORVSYNC      _IOW('F', 0x20, u_int32_t)
+#endif
+
 #define OMAPFB_CAPS_GENERIC_MASK       0x00000fff
 #define OMAPFB_CAPS_LCDC_MASK          0x00fff000
 #define OMAPFB_CAPS_PANEL_MASK         0xff000000