OMAP: DSS2: move wait_vsync()
authorTomi Valkeinen <tomi.valkeinen@nokia.com>
Fri, 8 Jan 2010 15:06:04 +0000 (17:06 +0200)
committerTomi Valkeinen <tomi.valkeinen@nokia.com>
Wed, 24 Feb 2010 12:31:27 +0000 (14:31 +0200)
Move wait_vsync() from omap_dss_device to overlay manager.

This is part of a larger patch-set, which moves the control from omapdss
driver to the display driver.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
arch/arm/plat-omap/include/plat/display.h
drivers/video/omap2/dss/display.c
drivers/video/omap2/dss/manager.c
drivers/video/omap2/omapfb/omapfb-ioctl.c

index 9291aa133e71e252fd91a47b9f7e0df6c4ea5eae..059b35cfd1250ec2e59db9623138d34a9fd7e8b5 100644 (file)
@@ -370,6 +370,7 @@ struct omap_overlay_manager {
 
        int (*apply)(struct omap_overlay_manager *mgr);
        int (*wait_for_go)(struct omap_overlay_manager *mgr);
+       int (*wait_for_vsync)(struct omap_overlay_manager *mgr);
 };
 
 struct omap_dss_device {
@@ -479,7 +480,6 @@ struct omap_dss_device {
        int (*update)(struct omap_dss_device *dssdev,
                               u16 x, u16 y, u16 w, u16 h);
        int (*sync)(struct omap_dss_device *dssdev);
-       int (*wait_vsync)(struct omap_dss_device *dssdev);
 
        int (*set_update_mode)(struct omap_dss_device *dssdev,
                        enum omap_dss_update_mode);
index 263d2fd93bac23bbfc7c09c599e4d0b2d548cd73..80b67d1c9d03ddb795d7b774a3df2c2a0c344f4a 100644 (file)
@@ -323,19 +323,6 @@ void default_get_overlay_fifo_thresholds(enum omap_plane plane,
        *fifo_low = fifo_size - burst_size_bytes;
 }
 
-static int default_wait_vsync(struct omap_dss_device *dssdev)
-{
-       unsigned long timeout = msecs_to_jiffies(500);
-       u32 irq;
-
-       if (dssdev->type == OMAP_DISPLAY_TYPE_VENC)
-               irq = DISPC_IRQ_EVSYNC_ODD;
-       else
-               irq = DISPC_IRQ_VSYNC;
-
-       return omap_dispc_wait_for_irq_interruptible_timeout(irq, timeout);
-}
-
 static int default_get_recommended_bpp(struct omap_dss_device *dssdev)
 {
        if (dssdev->panel.recommended_bpp)
@@ -427,7 +414,6 @@ void dss_init_device(struct platform_device *pdev,
 
        dssdev->get_resolution = default_get_resolution;
        dssdev->get_recommended_bpp = default_get_recommended_bpp;
-       dssdev->wait_vsync = default_wait_vsync;
 
        switch (dssdev->type) {
        case OMAP_DISPLAY_TYPE_DPI:
index 27d9c465c8518554cdcdb5f1ff046bd491bcdde6..486cd4aec65255da17e8e6cdc7e1d03a2227d59c 100644 (file)
@@ -501,6 +501,19 @@ static int omap_dss_unset_device(struct omap_overlay_manager *mgr)
        return 0;
 }
 
+static int dss_mgr_wait_for_vsync(struct omap_overlay_manager *mgr)
+{
+       unsigned long timeout = msecs_to_jiffies(500);
+       u32 irq;
+
+       if (mgr->device->type == OMAP_DISPLAY_TYPE_VENC)
+               irq = DISPC_IRQ_EVSYNC_ODD;
+       else
+               irq = DISPC_IRQ_VSYNC;
+
+       return omap_dispc_wait_for_irq_interruptible_timeout(irq, timeout);
+}
+
 static int dss_mgr_wait_for_go(struct omap_overlay_manager *mgr)
 {
        unsigned long timeout = msecs_to_jiffies(500);
@@ -1394,6 +1407,7 @@ int dss_init_overlay_managers(struct platform_device *pdev)
                mgr->set_manager_info = &omap_dss_mgr_set_info;
                mgr->get_manager_info = &omap_dss_mgr_get_info;
                mgr->wait_for_go = &dss_mgr_wait_for_go;
+               mgr->wait_for_vsync = &dss_mgr_wait_for_vsync;
 
                mgr->caps = OMAP_DSS_OVL_MGR_CAP_DISPC;
 
index 6e0186edc7da688ccc528b2a515285401de2d59f..36afab30921ea4946053abc3d78f28bf375b3729 100644 (file)
@@ -649,7 +649,7 @@ int omapfb_ioctl(struct fb_info *fbi, unsigned int cmd, unsigned long arg)
                        break;
                }
 
-               r = display->wait_vsync(display);
+               r = display->manager->wait_for_vsync(display->manager);
                break;
 
        case OMAPFB_WAITFORGO: