diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2011-11-15 07:43:53 -0500 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2011-12-02 01:54:43 -0500 |
commit | bf213523fe9708572a0b0a9149f7196a4f058564 (patch) | |
tree | 55ec6aa25d0b7df07ab6adc87890eb267cf17861 /drivers/video/omap2/dss/apply.c | |
parent | 9a147a65de1ac89e506ef90413f41ebd96e03fd3 (diff) |
OMAPDSS: APPLY: move mgr->enabled to mgr_priv_data
struct omap_overlay_manager contains "enabled"-field, used to track if
the manager is enabled or not. This field should be internal to apply.c.
This patch moves the field to mgr_priv_data, and applies the necessary
locking when accessing the field.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video/omap2/dss/apply.c')
-rw-r--r-- | drivers/video/omap2/dss/apply.c | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/drivers/video/omap2/dss/apply.c b/drivers/video/omap2/dss/apply.c index 936571b7aace..5bde08f19920 100644 --- a/drivers/video/omap2/dss/apply.c +++ b/drivers/video/omap2/dss/apply.c | |||
@@ -86,6 +86,9 @@ struct mgr_priv_data { | |||
86 | 86 | ||
87 | bool manual_update; | 87 | bool manual_update; |
88 | bool do_manual_update; | 88 | bool do_manual_update; |
89 | |||
90 | /* If true, a display is enabled using this manager */ | ||
91 | bool enabled; | ||
89 | }; | 92 | }; |
90 | 93 | ||
91 | static struct { | 94 | static struct { |
@@ -609,6 +612,7 @@ int omap_dss_mgr_apply(struct omap_overlay_manager *mgr) | |||
609 | int r; | 612 | int r; |
610 | unsigned long flags; | 613 | unsigned long flags; |
611 | struct omap_overlay *ovl; | 614 | struct omap_overlay *ovl; |
615 | struct mgr_priv_data *mp = get_mgr_priv(mgr); | ||
612 | 616 | ||
613 | DSSDBG("omap_dss_mgr_apply(%s)\n", mgr->name); | 617 | DSSDBG("omap_dss_mgr_apply(%s)\n", mgr->name); |
614 | 618 | ||
@@ -630,7 +634,7 @@ int omap_dss_mgr_apply(struct omap_overlay_manager *mgr) | |||
630 | omap_dss_mgr_apply_ovl_fifos(ovl); | 634 | omap_dss_mgr_apply_ovl_fifos(ovl); |
631 | 635 | ||
632 | r = 0; | 636 | r = 0; |
633 | if (mgr->enabled && !mgr_manual_update(mgr)) { | 637 | if (mp->enabled && !mgr_manual_update(mgr)) { |
634 | if (!dss_data.irq_enabled) | 638 | if (!dss_data.irq_enabled) |
635 | dss_register_vsync_isr(); | 639 | dss_register_vsync_isr(); |
636 | 640 | ||
@@ -646,22 +650,38 @@ int omap_dss_mgr_apply(struct omap_overlay_manager *mgr) | |||
646 | 650 | ||
647 | void dss_mgr_enable(struct omap_overlay_manager *mgr) | 651 | void dss_mgr_enable(struct omap_overlay_manager *mgr) |
648 | { | 652 | { |
653 | struct mgr_priv_data *mp = get_mgr_priv(mgr); | ||
654 | unsigned long flags; | ||
655 | |||
649 | mutex_lock(&apply_lock); | 656 | mutex_lock(&apply_lock); |
650 | 657 | ||
651 | if (!mgr_manual_update(mgr)) | 658 | if (!mgr_manual_update(mgr)) |
652 | dispc_mgr_enable(mgr->id, true); | 659 | dispc_mgr_enable(mgr->id, true); |
653 | mgr->enabled = true; | 660 | |
661 | spin_lock_irqsave(&data_lock, flags); | ||
662 | |||
663 | mp->enabled = true; | ||
664 | |||
665 | spin_unlock_irqrestore(&data_lock, flags); | ||
654 | 666 | ||
655 | mutex_unlock(&apply_lock); | 667 | mutex_unlock(&apply_lock); |
656 | } | 668 | } |
657 | 669 | ||
658 | void dss_mgr_disable(struct omap_overlay_manager *mgr) | 670 | void dss_mgr_disable(struct omap_overlay_manager *mgr) |
659 | { | 671 | { |
672 | struct mgr_priv_data *mp = get_mgr_priv(mgr); | ||
673 | unsigned long flags; | ||
674 | |||
660 | mutex_lock(&apply_lock); | 675 | mutex_lock(&apply_lock); |
661 | 676 | ||
662 | if (!mgr_manual_update(mgr)) | 677 | if (!mgr_manual_update(mgr)) |
663 | dispc_mgr_enable(mgr->id, false); | 678 | dispc_mgr_enable(mgr->id, false); |
664 | mgr->enabled = false; | 679 | |
680 | spin_lock_irqsave(&data_lock, flags); | ||
681 | |||
682 | mp->enabled = false; | ||
683 | |||
684 | spin_unlock_irqrestore(&data_lock, flags); | ||
665 | 685 | ||
666 | mutex_unlock(&apply_lock); | 686 | mutex_unlock(&apply_lock); |
667 | } | 687 | } |