aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2
diff options
context:
space:
mode:
authorArchit Taneja <archit@ti.com>2012-06-26 06:06:55 -0400
committerArchit Taneja <archit@ti.com>2012-09-26 06:59:09 -0400
commitfc22a84339d387203cc2a1685fb251a5ad4c9b43 (patch)
tree5332ebab8a0d9f31fecda1bb8da9204da4c43644 /drivers/video/omap2
parent9e7e9372225a5d70256beb13fbf3b077a437e5be (diff)
OMAPDSS: APPLY: Remove omap_dss_device references in wait_for_go functions
The functions dss_mgr_wait_for_go() and dss_mgr_wait_for_go_ovl() check if there is an enabled display connected to the manager before trying to see the state of the GO bit. The checks related to the display can be replaced by checking the state of the manager, i.e, whether the manager is enabled or not. This makes more sense than checking with the connected display as the GO bit behaviour is more connected with the manager state rather than the display state. A GO bit can only be set if the manager is enabled. If a manager isn't enabled, we can safely assume that the GO bit is not set. Signed-off-by: Archit Taneja <archit@ti.com>
Diffstat (limited to 'drivers/video/omap2')
-rw-r--r--drivers/video/omap2/dss/apply.c36
1 files changed, 25 insertions, 11 deletions
diff --git a/drivers/video/omap2/dss/apply.c b/drivers/video/omap2/dss/apply.c
index 6354bb842856..72f3468b0790 100644
--- a/drivers/video/omap2/dss/apply.c
+++ b/drivers/video/omap2/dss/apply.c
@@ -421,17 +421,25 @@ static void wait_pending_extra_info_updates(void)
421int dss_mgr_wait_for_go(struct omap_overlay_manager *mgr) 421int dss_mgr_wait_for_go(struct omap_overlay_manager *mgr)
422{ 422{
423 unsigned long timeout = msecs_to_jiffies(500); 423 unsigned long timeout = msecs_to_jiffies(500);
424 struct mgr_priv_data *mp; 424 struct mgr_priv_data *mp = get_mgr_priv(mgr);
425 u32 irq; 425 u32 irq;
426 unsigned long flags;
426 int r; 427 int r;
427 int i; 428 int i;
428 struct omap_dss_device *dssdev = mgr->device;
429 429
430 if (!dssdev || dssdev->state != OMAP_DSS_DISPLAY_ACTIVE) 430 spin_lock_irqsave(&data_lock, flags);
431
432 if (mgr_manual_update(mgr)) {
433 spin_unlock_irqrestore(&data_lock, flags);
431 return 0; 434 return 0;
435 }
432 436
433 if (mgr_manual_update(mgr)) 437 if (!mp->enabled) {
438 spin_unlock_irqrestore(&data_lock, flags);
434 return 0; 439 return 0;
440 }
441
442 spin_unlock_irqrestore(&data_lock, flags);
435 443
436 r = dispc_runtime_get(); 444 r = dispc_runtime_get();
437 if (r) 445 if (r)
@@ -439,10 +447,8 @@ int dss_mgr_wait_for_go(struct omap_overlay_manager *mgr)
439 447
440 irq = dispc_mgr_get_vsync_irq(mgr->id); 448 irq = dispc_mgr_get_vsync_irq(mgr->id);
441 449
442 mp = get_mgr_priv(mgr);
443 i = 0; 450 i = 0;
444 while (1) { 451 while (1) {
445 unsigned long flags;
446 bool shadow_dirty, dirty; 452 bool shadow_dirty, dirty;
447 453
448 spin_lock_irqsave(&data_lock, flags); 454 spin_lock_irqsave(&data_lock, flags);
@@ -486,21 +492,30 @@ int dss_mgr_wait_for_go_ovl(struct omap_overlay *ovl)
486{ 492{
487 unsigned long timeout = msecs_to_jiffies(500); 493 unsigned long timeout = msecs_to_jiffies(500);
488 struct ovl_priv_data *op; 494 struct ovl_priv_data *op;
489 struct omap_dss_device *dssdev; 495 struct mgr_priv_data *mp;
490 u32 irq; 496 u32 irq;
497 unsigned long flags;
491 int r; 498 int r;
492 int i; 499 int i;
493 500
494 if (!ovl->manager) 501 if (!ovl->manager)
495 return 0; 502 return 0;
496 503
497 dssdev = ovl->manager->device; 504 mp = get_mgr_priv(ovl->manager);
505
506 spin_lock_irqsave(&data_lock, flags);
498 507
499 if (!dssdev || dssdev->state != OMAP_DSS_DISPLAY_ACTIVE) 508 if (ovl_manual_update(ovl)) {
509 spin_unlock_irqrestore(&data_lock, flags);
500 return 0; 510 return 0;
511 }
501 512
502 if (ovl_manual_update(ovl)) 513 if (!mp->enabled) {
514 spin_unlock_irqrestore(&data_lock, flags);
503 return 0; 515 return 0;
516 }
517
518 spin_unlock_irqrestore(&data_lock, flags);
504 519
505 r = dispc_runtime_get(); 520 r = dispc_runtime_get();
506 if (r) 521 if (r)
@@ -511,7 +526,6 @@ int dss_mgr_wait_for_go_ovl(struct omap_overlay *ovl)
511 op = get_ovl_priv(ovl); 526 op = get_ovl_priv(ovl);
512 i = 0; 527 i = 0;
513 while (1) { 528 while (1) {
514 unsigned long flags;
515 bool shadow_dirty, dirty; 529 bool shadow_dirty, dirty;
516 530
517 spin_lock_irqsave(&data_lock, flags); 531 spin_lock_irqsave(&data_lock, flags);