OMAPDSS: reduce vsync/go timeouts
[pandora-kernel.git] / drivers / video / omap2 / dss / manager.c
index 6e63845..b07f817 100644 (file)
@@ -608,8 +608,13 @@ static int omap_dss_unset_device(struct omap_overlay_manager *mgr)
 
 static int dss_mgr_wait_for_vsync(struct omap_overlay_manager *mgr)
 {
-       unsigned long timeout = msecs_to_jiffies(500);
+       unsigned long timeout = usecs_to_jiffies(16667 * 2);
        u32 irq;
+       int r;
+
+       r = dispc_runtime_get();
+       if (r)
+               return r;
 
        if (mgr->device->type == OMAP_DISPLAY_TYPE_VENC) {
                irq = DISPC_IRQ_EVSYNC_ODD;
@@ -621,12 +626,17 @@ static int dss_mgr_wait_for_vsync(struct omap_overlay_manager *mgr)
                else
                        irq = DISPC_IRQ_VSYNC2;
        }
-       return omap_dispc_wait_for_irq_interruptible_timeout(irq, timeout);
+
+       r = omap_dispc_wait_for_irq_interruptible_timeout(irq, timeout);
+
+       dispc_runtime_put();
+
+       return r;
 }
 
 static int dss_mgr_wait_for_go(struct omap_overlay_manager *mgr)
 {
-       unsigned long timeout = msecs_to_jiffies(500);
+       unsigned long timeout = usecs_to_jiffies(16667 * 2);
        struct manager_cache_data *mc;
        u32 irq;
        int r;
@@ -639,6 +649,10 @@ static int dss_mgr_wait_for_go(struct omap_overlay_manager *mgr)
        if (dssdev->caps & OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE)
                return 0;
 
+       r = dispc_runtime_get();
+       if (r)
+               return r;
+
        if (dssdev->type == OMAP_DISPLAY_TYPE_VENC
                        || dssdev->type == OMAP_DISPLAY_TYPE_HDMI) {
                irq = DISPC_IRQ_EVSYNC_ODD | DISPC_IRQ_EVSYNC_EVEN;
@@ -685,6 +699,8 @@ static int dss_mgr_wait_for_go(struct omap_overlay_manager *mgr)
                }
        }
 
+       dispc_runtime_put();
+
        return r;
 }
 
@@ -708,6 +724,10 @@ int dss_mgr_wait_for_go_ovl(struct omap_overlay *ovl)
        if (dssdev->caps & OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE)
                return 0;
 
+       r = dispc_runtime_get();
+       if (r)
+               return r;
+
        if (dssdev->type == OMAP_DISPLAY_TYPE_VENC
                        || dssdev->type == OMAP_DISPLAY_TYPE_HDMI) {
                irq = DISPC_IRQ_EVSYNC_ODD | DISPC_IRQ_EVSYNC_EVEN;
@@ -754,6 +774,8 @@ int dss_mgr_wait_for_go_ovl(struct omap_overlay *ovl)
                }
        }
 
+       dispc_runtime_put();
+
        return r;
 }
 
@@ -998,7 +1020,9 @@ static int configure_dispc(void)
        busy = false;
 
        for (i = 0; i < num_mgrs; i++) {
-               mgr_busy[i] = dispc_mgr_go_busy(i);
+               /* pandora HACK: if something is running faster than display,
+                * it's ok to lose older frame config. */
+               mgr_busy[i] = false; /*dispc_mgr_go_busy(i);*/
                mgr_go[i] = false;
        }