aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2011-11-16 05:03:22 -0500
committerTomi Valkeinen <tomi.valkeinen@ti.com>2011-12-02 01:54:46 -0500
commit7609893c637b422eec88b57d204f02d8798cfc65 (patch)
tree6cc513addacc53df1d6644349df3e8f151a19a22
parent34861378a54e3fcac0eb87317ded2554b087494e (diff)
OMAPDSS: APPLY: clean up isr_handler
Add a helper function mgr_clear_shadow_dirty(), which clears the shadow_dirty flags for the given manager and for the overlays on that manager. This lets us simplify the code in the dss_apply_irq_handler(). Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
-rw-r--r--drivers/video/omap2/dss/apply.c52
1 files changed, 28 insertions, 24 deletions
diff --git a/drivers/video/omap2/dss/apply.c b/drivers/video/omap2/dss/apply.c
index 3bb5149b3a28..8b157b03d4b6 100644
--- a/drivers/video/omap2/dss/apply.c
+++ b/drivers/video/omap2/dss/apply.c
@@ -508,47 +508,51 @@ static void dss_unregister_vsync_isr(void)
508 dss_data.irq_enabled = false; 508 dss_data.irq_enabled = false;
509} 509}
510 510
511static void dss_apply_irq_handler(void *data, u32 mask) 511static void mgr_clear_shadow_dirty(struct omap_overlay_manager *mgr)
512{ 512{
513 struct omap_overlay *ovl; 513 struct omap_overlay *ovl;
514 struct omap_overlay_manager *mgr;
515 struct mgr_priv_data *mp; 514 struct mgr_priv_data *mp;
516 struct ovl_priv_data *op; 515 struct ovl_priv_data *op;
517 const int num_ovls = dss_feat_get_num_ovls(); 516
517 mp = get_mgr_priv(mgr);
518 mp->shadow_dirty = false;
519
520 list_for_each_entry(ovl, &mgr->overlays, list) {
521 op = get_ovl_priv(ovl);
522 op->shadow_dirty = false;
523 op->shadow_extra_info_dirty = false;
524 }
525}
526
527static void dss_apply_irq_handler(void *data, u32 mask)
528{
518 const int num_mgrs = dss_feat_get_num_mgrs(); 529 const int num_mgrs = dss_feat_get_num_mgrs();
519 int i; 530 int i;
520 531
521 spin_lock(&data_lock); 532 spin_lock(&data_lock);
522 533
534 /* clear busy, updating flags, shadow_dirty flags */
523 for (i = 0; i < num_mgrs; i++) { 535 for (i = 0; i < num_mgrs; i++) {
536 struct omap_overlay_manager *mgr;
537 struct mgr_priv_data *mp;
538
524 mgr = omap_dss_get_overlay_manager(i); 539 mgr = omap_dss_get_overlay_manager(i);
525 mp = get_mgr_priv(mgr); 540 mp = get_mgr_priv(mgr);
526 541
527 mp->busy = dispc_mgr_go_busy(i); 542 if (!mp->enabled)
528 mp->updating = dispc_mgr_is_enabled(i);
529 }
530
531 for (i = 0; i < num_ovls; ++i) {
532 ovl = omap_dss_get_overlay(i);
533 op = get_ovl_priv(ovl);
534
535 if (!op->enabled)
536 continue; 543 continue;
537 544
538 mp = get_mgr_priv(ovl->manager); 545 mp->updating = dispc_mgr_is_enabled(i);
539
540 if (!mp->busy) {
541 op->shadow_dirty = false;
542 op->shadow_extra_info_dirty = false;
543 }
544 }
545 546
546 for (i = 0; i < num_mgrs; ++i) { 547 if (!mgr_manual_update(mgr)) {
547 mgr = omap_dss_get_overlay_manager(i); 548 mp->busy = dispc_mgr_go_busy(i);
548 mp = get_mgr_priv(mgr);
549 549
550 if (!mp->busy) 550 if (!mp->busy)
551 mp->shadow_dirty = false; 551 mgr_clear_shadow_dirty(mgr);
552 } else {
553 if (!mp->updating)
554 mgr_clear_shadow_dirty(mgr);
555 }
552 } 556 }
553 557
554 dss_write_regs(); 558 dss_write_regs();