diff options
author | Lajos Molnar <lajos@ti.com> | 2012-02-22 01:53:16 -0500 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2012-03-06 07:08:30 -0500 |
commit | 21e56f79abad987555351c73569fc8358636b0fa (patch) | |
tree | f96b97e7903c994b776182f4a3ab6eabc3a59208 /drivers/video/omap2/dss | |
parent | c0c1cfcb577d61ec55e209bc5f869d3d80a8f371 (diff) |
OMAPDSS: MANAGER/APPLY: Add runtime_pm protection around wait_for_go/vsync functions
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>
Diffstat (limited to 'drivers/video/omap2/dss')
-rw-r--r-- | drivers/video/omap2/dss/apply.c | 12 | ||||
-rw-r--r-- | drivers/video/omap2/dss/manager.c | 12 |
2 files changed, 23 insertions, 1 deletions
diff --git a/drivers/video/omap2/dss/apply.c b/drivers/video/omap2/dss/apply.c index b0264a164652..f145e9cd6edd 100644 --- a/drivers/video/omap2/dss/apply.c +++ b/drivers/video/omap2/dss/apply.c | |||
@@ -391,6 +391,10 @@ int dss_mgr_wait_for_go(struct omap_overlay_manager *mgr) | |||
391 | if (mgr_manual_update(mgr)) | 391 | if (mgr_manual_update(mgr)) |
392 | return 0; | 392 | return 0; |
393 | 393 | ||
394 | r = dispc_runtime_get(); | ||
395 | if (r) | ||
396 | return r; | ||
397 | |||
394 | irq = dispc_mgr_get_vsync_irq(mgr->id); | 398 | irq = dispc_mgr_get_vsync_irq(mgr->id); |
395 | 399 | ||
396 | mp = get_mgr_priv(mgr); | 400 | mp = get_mgr_priv(mgr); |
@@ -431,6 +435,8 @@ int dss_mgr_wait_for_go(struct omap_overlay_manager *mgr) | |||
431 | } | 435 | } |
432 | } | 436 | } |
433 | 437 | ||
438 | dispc_runtime_put(); | ||
439 | |||
434 | return r; | 440 | return r; |
435 | } | 441 | } |
436 | 442 | ||
@@ -454,6 +460,10 @@ int dss_mgr_wait_for_go_ovl(struct omap_overlay *ovl) | |||
454 | if (ovl_manual_update(ovl)) | 460 | if (ovl_manual_update(ovl)) |
455 | return 0; | 461 | return 0; |
456 | 462 | ||
463 | r = dispc_runtime_get(); | ||
464 | if (r) | ||
465 | return r; | ||
466 | |||
457 | irq = dispc_mgr_get_vsync_irq(ovl->manager->id); | 467 | irq = dispc_mgr_get_vsync_irq(ovl->manager->id); |
458 | 468 | ||
459 | op = get_ovl_priv(ovl); | 469 | op = get_ovl_priv(ovl); |
@@ -494,6 +504,8 @@ int dss_mgr_wait_for_go_ovl(struct omap_overlay *ovl) | |||
494 | } | 504 | } |
495 | } | 505 | } |
496 | 506 | ||
507 | dispc_runtime_put(); | ||
508 | |||
497 | return r; | 509 | return r; |
498 | } | 510 | } |
499 | 511 | ||
diff --git a/drivers/video/omap2/dss/manager.c b/drivers/video/omap2/dss/manager.c index d1858e71c64e..e7364603f6a1 100644 --- a/drivers/video/omap2/dss/manager.c +++ b/drivers/video/omap2/dss/manager.c | |||
@@ -494,6 +494,11 @@ static int dss_mgr_wait_for_vsync(struct omap_overlay_manager *mgr) | |||
494 | { | 494 | { |
495 | unsigned long timeout = msecs_to_jiffies(500); | 495 | unsigned long timeout = msecs_to_jiffies(500); |
496 | u32 irq; | 496 | u32 irq; |
497 | int r; | ||
498 | |||
499 | r = dispc_runtime_get(); | ||
500 | if (r) | ||
501 | return r; | ||
497 | 502 | ||
498 | if (mgr->device->type == OMAP_DISPLAY_TYPE_VENC) { | 503 | if (mgr->device->type == OMAP_DISPLAY_TYPE_VENC) { |
499 | irq = DISPC_IRQ_EVSYNC_ODD; | 504 | irq = DISPC_IRQ_EVSYNC_ODD; |
@@ -505,7 +510,12 @@ static int dss_mgr_wait_for_vsync(struct omap_overlay_manager *mgr) | |||
505 | else | 510 | else |
506 | irq = DISPC_IRQ_VSYNC2; | 511 | irq = DISPC_IRQ_VSYNC2; |
507 | } | 512 | } |
508 | return omap_dispc_wait_for_irq_interruptible_timeout(irq, timeout); | 513 | |
514 | r = omap_dispc_wait_for_irq_interruptible_timeout(irq, timeout); | ||
515 | |||
516 | dispc_runtime_put(); | ||
517 | |||
518 | return r; | ||
509 | } | 519 | } |
510 | 520 | ||
511 | int dss_init_overlay_managers(struct platform_device *pdev) | 521 | int dss_init_overlay_managers(struct platform_device *pdev) |