diff options
author | Tomi Valkeinen <Tomi.Valkeinen@nokia.com> | 2010-05-21 03:09:18 -0400 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@nokia.com> | 2010-08-05 09:52:07 -0400 |
commit | ffb63c95b2fa52b02b45537d18f0ca698bef5496 (patch) | |
tree | ff1df1051e9d6353af7880150691c0e363d93fb6 | |
parent | a602771c43ed7f1a02c7766c94fda74ac5d72a8b (diff) |
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>
-rw-r--r-- | drivers/video/omap2/displays/panel-taal.c | 15 |
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) | |||
1210 | int r; | 1210 | int r; |
1211 | 1211 | ||
1212 | mutex_lock(&td->lock); | 1212 | mutex_lock(&td->lock); |
1213 | |||
1214 | if (td->te_enabled == enable) | ||
1215 | goto end; | ||
1216 | |||
1213 | dsi_bus_lock(); | 1217 | dsi_bus_lock(); |
1214 | 1218 | ||
1215 | if (td->enabled) { | 1219 | if (td->enabled) { |
@@ -1221,6 +1225,7 @@ static int taal_enable_te(struct omap_dss_device *dssdev, bool enable) | |||
1221 | td->te_enabled = enable; | 1225 | td->te_enabled = enable; |
1222 | 1226 | ||
1223 | dsi_bus_unlock(); | 1227 | dsi_bus_unlock(); |
1228 | end: | ||
1224 | mutex_unlock(&td->lock); | 1229 | mutex_unlock(&td->lock); |
1225 | 1230 | ||
1226 | return 0; | 1231 | return 0; |
@@ -1251,6 +1256,10 @@ static int taal_rotate(struct omap_dss_device *dssdev, u8 rotate) | |||
1251 | dev_dbg(&dssdev->dev, "rotate %d\n", rotate); | 1256 | dev_dbg(&dssdev->dev, "rotate %d\n", rotate); |
1252 | 1257 | ||
1253 | mutex_lock(&td->lock); | 1258 | mutex_lock(&td->lock); |
1259 | |||
1260 | if (td->rotate == rotate) | ||
1261 | goto end; | ||
1262 | |||
1254 | dsi_bus_lock(); | 1263 | dsi_bus_lock(); |
1255 | 1264 | ||
1256 | if (td->enabled) { | 1265 | if (td->enabled) { |
@@ -1262,6 +1271,7 @@ static int taal_rotate(struct omap_dss_device *dssdev, u8 rotate) | |||
1262 | td->rotate = rotate; | 1271 | td->rotate = rotate; |
1263 | 1272 | ||
1264 | dsi_bus_unlock(); | 1273 | dsi_bus_unlock(); |
1274 | end: | ||
1265 | mutex_unlock(&td->lock); | 1275 | mutex_unlock(&td->lock); |
1266 | return 0; | 1276 | return 0; |
1267 | err: | 1277 | err: |
@@ -1290,6 +1300,10 @@ static int taal_mirror(struct omap_dss_device *dssdev, bool enable) | |||
1290 | dev_dbg(&dssdev->dev, "mirror %d\n", enable); | 1300 | dev_dbg(&dssdev->dev, "mirror %d\n", enable); |
1291 | 1301 | ||
1292 | mutex_lock(&td->lock); | 1302 | mutex_lock(&td->lock); |
1303 | |||
1304 | if (td->mirror == enable) | ||
1305 | goto end; | ||
1306 | |||
1293 | dsi_bus_lock(); | 1307 | dsi_bus_lock(); |
1294 | if (td->enabled) { | 1308 | if (td->enabled) { |
1295 | r = taal_set_addr_mode(td->rotate, enable); | 1309 | r = taal_set_addr_mode(td->rotate, enable); |
@@ -1300,6 +1314,7 @@ static int taal_mirror(struct omap_dss_device *dssdev, bool enable) | |||
1300 | td->mirror = enable; | 1314 | td->mirror = enable; |
1301 | 1315 | ||
1302 | dsi_bus_unlock(); | 1316 | dsi_bus_unlock(); |
1317 | end: | ||
1303 | mutex_unlock(&td->lock); | 1318 | mutex_unlock(&td->lock); |
1304 | return 0; | 1319 | return 0; |
1305 | err: | 1320 | err: |