aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2011-11-16 09:01:33 -0500
committerTomi Valkeinen <tomi.valkeinen@ti.com>2011-12-02 01:54:50 -0500
commite4f7ad702ef271d2b0c03e9904b05f9bcbf0808b (patch)
treed6815985f6c01ac28a550d03a78fe4c6674030aa /drivers/video/omap2
parent841c09c7975c67fe7741564d98265de28a5764d0 (diff)
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')
-rw-r--r--drivers/video/omap2/dss/apply.c18
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)
724 724
725 mutex_lock(&apply_lock); 725 mutex_lock(&apply_lock);
726 726
727 if (mp->enabled)
728 goto out;
729
727 spin_lock_irqsave(&data_lock, flags); 730 spin_lock_irqsave(&data_lock, flags);
728 731
729 mp->enabled = true; 732 mp->enabled = true;
@@ -740,6 +743,7 @@ void dss_mgr_enable(struct omap_overlay_manager *mgr)
740 if (!mgr_manual_update(mgr)) 743 if (!mgr_manual_update(mgr))
741 dispc_mgr_enable(mgr->id, true); 744 dispc_mgr_enable(mgr->id, true);
742 745
746out:
743 mutex_unlock(&apply_lock); 747 mutex_unlock(&apply_lock);
744} 748}
745 749
@@ -750,6 +754,9 @@ void dss_mgr_disable(struct omap_overlay_manager *mgr)
750 754
751 mutex_lock(&apply_lock); 755 mutex_lock(&apply_lock);
752 756
757 if (!mp->enabled)
758 goto out;
759
753 if (!mgr_manual_update(mgr)) 760 if (!mgr_manual_update(mgr))
754 dispc_mgr_enable(mgr->id, false); 761 dispc_mgr_enable(mgr->id, false);
755 762
@@ -760,6 +767,7 @@ void dss_mgr_disable(struct omap_overlay_manager *mgr)
760 767
761 spin_unlock_irqrestore(&data_lock, flags); 768 spin_unlock_irqrestore(&data_lock, flags);
762 769
770out:
763 mutex_unlock(&apply_lock); 771 mutex_unlock(&apply_lock);
764} 772}
765 773
@@ -1005,6 +1013,11 @@ int dss_ovl_enable(struct omap_overlay *ovl)
1005 1013
1006 mutex_lock(&apply_lock); 1014 mutex_lock(&apply_lock);
1007 1015
1016 if (op->enabled) {
1017 r = 0;
1018 goto err;
1019 }
1020
1008 if (ovl->manager == NULL || ovl->manager->device == NULL) { 1021 if (ovl->manager == NULL || ovl->manager->device == NULL) {
1009 r = -EINVAL; 1022 r = -EINVAL;
1010 goto err; 1023 goto err;
@@ -1036,6 +1049,11 @@ int dss_ovl_disable(struct omap_overlay *ovl)
1036 1049
1037 mutex_lock(&apply_lock); 1050 mutex_lock(&apply_lock);
1038 1051
1052 if (!op->enabled) {
1053 r = 0;
1054 goto err;
1055 }
1056
1039 if (ovl->manager == NULL || ovl->manager->device == NULL) { 1057 if (ovl->manager == NULL || ovl->manager->device == NULL) {
1040 r = -EINVAL; 1058 r = -EINVAL;
1041 goto err; 1059 goto err;