diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2011-11-16 16:01:33 +0200 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2011-12-02 08:54:50 +0200 |
commit | e4f7ad702ef271d2b0c03e9904b05f9bcbf0808b (patch) | |
tree | d6815985f6c01ac28a550d03a78fe4c6674030aa /drivers/video/omap2/dss | |
parent | 841c09c7975c67fe7741564d98265de28a5764d0 (diff) | |
download | linux-e4f7ad702ef271d2b0c03e9904b05f9bcbf0808b.tar.bz2 |
OMAPDSS: APPLY: skip enable/disable if already enabled/disabled
Add checks to dss_mgr_enable, dss_mgr_disable, dss_ovl_enable,
dss_ovl_disable that check if the state is already the same as given in
the parameters, and exit if so.
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 | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/video/omap2/dss/apply.c b/drivers/video/omap2/dss/apply.c index ec2183721642..27d13bd9ed10 100644 --- a/drivers/video/omap2/dss/apply.c +++ b/drivers/video/omap2/dss/apply.c @@ -724,6 +724,9 @@ void dss_mgr_enable(struct omap_overlay_manager *mgr) mutex_lock(&apply_lock); + if (mp->enabled) + goto out; + spin_lock_irqsave(&data_lock, flags); mp->enabled = true; @@ -740,6 +743,7 @@ void dss_mgr_enable(struct omap_overlay_manager *mgr) if (!mgr_manual_update(mgr)) dispc_mgr_enable(mgr->id, true); +out: mutex_unlock(&apply_lock); } @@ -750,6 +754,9 @@ void dss_mgr_disable(struct omap_overlay_manager *mgr) mutex_lock(&apply_lock); + if (!mp->enabled) + goto out; + if (!mgr_manual_update(mgr)) dispc_mgr_enable(mgr->id, false); @@ -760,6 +767,7 @@ void dss_mgr_disable(struct omap_overlay_manager *mgr) spin_unlock_irqrestore(&data_lock, flags); +out: mutex_unlock(&apply_lock); } @@ -1005,6 +1013,11 @@ int dss_ovl_enable(struct omap_overlay *ovl) mutex_lock(&apply_lock); + if (op->enabled) { + r = 0; + goto err; + } + if (ovl->manager == NULL || ovl->manager->device == NULL) { r = -EINVAL; goto err; @@ -1036,6 +1049,11 @@ int dss_ovl_disable(struct omap_overlay *ovl) mutex_lock(&apply_lock); + if (!op->enabled) { + r = 0; + goto err; + } + if (ovl->manager == NULL || ovl->manager->device == NULL) { r = -EINVAL; goto err; |