]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
OMAPDSS: MANAGER/APPLY: Add runtime_pm protection around wait_for_go/vsync functions
authorLajos Molnar <lajos@ti.com>
Wed, 22 Feb 2012 06:53:16 +0000 (12:23 +0530)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Tue, 6 Mar 2012 12:08:30 +0000 (14:08 +0200)
If DSS suspends within the functions dss_mgr_wait_for_go(),
dss_mgr_wait_for_go_ovl() or dss_mgr_wait_for_vsync(). It may lose it's clock
and lead to a register access failure.

Request runtime_pm around these functions.

[archit@ti.com: Moved runtime_pm calls to wait_for_go/vsync functions rather
then calling them from omap_dispc_wait_for_irq_interruptible_timeout()]

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
drivers/video/omap2/dss/apply.c
drivers/video/omap2/dss/manager.c

index b0264a164652fe93af3cd3cc52503fd1b5467d9b..f145e9cd6edd315fb977fe2a0256ecde780dcd8e 100644 (file)
@@ -391,6 +391,10 @@ int dss_mgr_wait_for_go(struct omap_overlay_manager *mgr)
        if (mgr_manual_update(mgr))
                return 0;
 
+       r = dispc_runtime_get();
+       if (r)
+               return r;
+
        irq = dispc_mgr_get_vsync_irq(mgr->id);
 
        mp = get_mgr_priv(mgr);
@@ -431,6 +435,8 @@ int dss_mgr_wait_for_go(struct omap_overlay_manager *mgr)
                }
        }
 
+       dispc_runtime_put();
+
        return r;
 }
 
@@ -454,6 +460,10 @@ int dss_mgr_wait_for_go_ovl(struct omap_overlay *ovl)
        if (ovl_manual_update(ovl))
                return 0;
 
+       r = dispc_runtime_get();
+       if (r)
+               return r;
+
        irq = dispc_mgr_get_vsync_irq(ovl->manager->id);
 
        op = get_ovl_priv(ovl);
@@ -494,6 +504,8 @@ int dss_mgr_wait_for_go_ovl(struct omap_overlay *ovl)
                }
        }
 
+       dispc_runtime_put();
+
        return r;
 }
 
index d1858e71c64e8bc448eb31e5e88680c12f4e9368..e7364603f6a1d09fa193e63ed007565388090e1b 100644 (file)
@@ -494,6 +494,11 @@ static int dss_mgr_wait_for_vsync(struct omap_overlay_manager *mgr)
 {
        unsigned long timeout = msecs_to_jiffies(500);
        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;
@@ -505,7 +510,12 @@ 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;
 }
 
 int dss_init_overlay_managers(struct platform_device *pdev)