From: Lajos Molnar <[email protected]>

If DSS is suspended during a wait_for_vsync operation, it may loose its clock.
Request runtime_pm around wait_for_vsync.

Signed-off-by: Lajos Molnar <[email protected]>
Signed-off-by: Archit Taneja <[email protected]>
---
 drivers/video/omap2/dss/dispc.c |   16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index df6259e..dd08356 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -3228,11 +3228,15 @@ int omap_dispc_wait_for_irq_interruptible_timeout(u32 
irqmask,
        int r;
        DECLARE_COMPLETION_ONSTACK(completion);
 
+       r = dispc_runtime_get();
+       if (r)
+               return r;
+
        r = omap_dispc_register_isr(dispc_irq_wait_handler, &completion,
                        irqmask);
 
        if (r)
-               return r;
+               goto done;
 
        timeout = wait_for_completion_interruptible_timeout(&completion,
                        timeout);
@@ -3240,12 +3244,14 @@ int omap_dispc_wait_for_irq_interruptible_timeout(u32 
irqmask,
        omap_dispc_unregister_isr(dispc_irq_wait_handler, &completion, irqmask);
 
        if (timeout == 0)
-               return -ETIMEDOUT;
+               r = -ETIMEDOUT;
+       else if (timeout == -ERESTARTSYS)
+               r = timeout;
 
-       if (timeout == -ERESTARTSYS)
-               return -ERESTARTSYS;
+done:
+       dispc_runtime_put();
 
-       return 0;
+       return r;
 }
 
 #ifdef CONFIG_OMAP2_DSS_FAKE_VSYNC
-- 
1.7.5.4

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to