summaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorTomi Valkeinen <Tomi.Valkeinen@nokia.com>2010-05-21 10:09:18 +0300
committerTomi Valkeinen <tomi.valkeinen@nokia.com>2010-08-05 16:52:07 +0300
commitffb63c95b2fa52b02b45537d18f0ca698bef5496 (patch)
treeff1df1051e9d6353af7880150691c0e363d93fb6 /drivers/video
parenta602771c43ed7f1a02c7766c94fda74ac5d72a8b (diff)
downloadblackbird-op-linux-ffb63c95b2fa52b02b45537d18f0ca698bef5496.tar.gz
blackbird-op-linux-ffb63c95b2fa52b02b45537d18f0ca698bef5496.zip
OMAP: DSS2: Taal: Optimize enable_te, rotate, mirror when value unchanged
Skip any further processing of taal_enable_te(), taal_rotate(), and taal_mirror() if value remains unchanged. Signed-off-by: Jani Nikula <ext-jani.1.nikula@nokia.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/omap2/displays/panel-taal.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/video/omap2/displays/panel-taal.c b/drivers/video/omap2/displays/panel-taal.c
index 6848e3633ed9..e1c765d11419 100644
--- a/drivers/video/omap2/displays/panel-taal.c
+++ b/drivers/video/omap2/displays/panel-taal.c
@@ -1210,6 +1210,10 @@ static int taal_enable_te(struct omap_dss_device *dssdev, bool enable)
int r;
mutex_lock(&td->lock);
+
+ if (td->te_enabled == enable)
+ goto end;
+
dsi_bus_lock();
if (td->enabled) {
@@ -1221,6 +1225,7 @@ static int taal_enable_te(struct omap_dss_device *dssdev, bool enable)
td->te_enabled = enable;
dsi_bus_unlock();
+end:
mutex_unlock(&td->lock);
return 0;
@@ -1251,6 +1256,10 @@ static int taal_rotate(struct omap_dss_device *dssdev, u8 rotate)
dev_dbg(&dssdev->dev, "rotate %d\n", rotate);
mutex_lock(&td->lock);
+
+ if (td->rotate == rotate)
+ goto end;
+
dsi_bus_lock();
if (td->enabled) {
@@ -1262,6 +1271,7 @@ static int taal_rotate(struct omap_dss_device *dssdev, u8 rotate)
td->rotate = rotate;
dsi_bus_unlock();
+end:
mutex_unlock(&td->lock);
return 0;
err:
@@ -1290,6 +1300,10 @@ static int taal_mirror(struct omap_dss_device *dssdev, bool enable)
dev_dbg(&dssdev->dev, "mirror %d\n", enable);
mutex_lock(&td->lock);
+
+ if (td->mirror == enable)
+ goto end;
+
dsi_bus_lock();
if (td->enabled) {
r = taal_set_addr_mode(td->rotate, enable);
@@ -1300,6 +1314,7 @@ static int taal_mirror(struct omap_dss_device *dssdev, bool enable)
td->mirror = enable;
dsi_bus_unlock();
+end:
mutex_unlock(&td->lock);
return 0;
err:
OpenPOWER on IntegriCloud