aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2/dss/apply.c
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2011-11-26 07:26:46 -0500
committerTomi Valkeinen <tomi.valkeinen@ti.com>2011-12-02 01:54:58 -0500
commit82153eda076ee4df434bb1008f24e46590f76dfc (patch)
tree29d729a78240ed8394c976961cab942cc4e63b9e /drivers/video/omap2/dss/apply.c
parent153b6e7357778267e6914f2370a059e79a751371 (diff)
OMAPDSS: APPLY: add op->enabling
When we are enabling an overlay, there's a point in time when the overlay is not actually enabled yet (nor do we want it to be enabled), but we do want to check if the configuration for the overlay is valid, and to calculate correct fifo thresholds for the soon-to-be-enabled overlay. Current code handled this in a hacky way, setting op->enabled to true temporarily when calling functions that need to consider the state when the overlay is enabled. This patch makes this a bit cleaner, adding "enabling" field, which is set when the overlay is not yet enabled but should be considered in the checks and calculations. 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.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/drivers/video/omap2/dss/apply.c b/drivers/video/omap2/dss/apply.c
index b6e608386219..c38c015d60e2 100644
--- a/drivers/video/omap2/dss/apply.c
+++ b/drivers/video/omap2/dss/apply.c
@@ -72,6 +72,12 @@ struct ovl_priv_data {
72 bool enabled; 72 bool enabled;
73 enum omap_channel channel; 73 enum omap_channel channel;
74 u32 fifo_low, fifo_high; 74 u32 fifo_low, fifo_high;
75
76 /*
77 * True if overlay is to be enabled. Used to check and calculate configs
78 * for the overlay before it is enabled in the HW.
79 */
80 bool enabling;
75}; 81};
76 82
77struct mgr_priv_data { 83struct mgr_priv_data {
@@ -297,7 +303,7 @@ static int dss_check_settings_low(struct omap_overlay_manager *mgr,
297 list_for_each_entry(ovl, &mgr->overlays, list) { 303 list_for_each_entry(ovl, &mgr->overlays, list) {
298 op = get_ovl_priv(ovl); 304 op = get_ovl_priv(ovl);
299 305
300 if (!op->enabled) 306 if (!op->enabled && !op->enabling)
301 oi = NULL; 307 oi = NULL;
302 else if (applying && op->user_info_dirty) 308 else if (applying && op->user_info_dirty)
303 oi = &op->user_info; 309 oi = &op->user_info;
@@ -998,7 +1004,7 @@ static void dss_mgr_setup_fifos(struct omap_overlay_manager *mgr)
998 list_for_each_entry(ovl, &mgr->overlays, list) { 1004 list_for_each_entry(ovl, &mgr->overlays, list) {
999 op = get_ovl_priv(ovl); 1005 op = get_ovl_priv(ovl);
1000 1006
1001 if (!op->enabled) 1007 if (!op->enabled && !op->enabling)
1002 continue; 1008 continue;
1003 1009
1004 dss_ovl_setup_fifo(ovl); 1010 dss_ovl_setup_fifo(ovl);
@@ -1395,19 +1401,20 @@ int dss_ovl_enable(struct omap_overlay *ovl)
1395 1401
1396 spin_lock_irqsave(&data_lock, flags); 1402 spin_lock_irqsave(&data_lock, flags);
1397 1403
1398 op->enabled = true; 1404 op->enabling = true;
1405
1399 r = dss_check_settings(ovl->manager, ovl->manager->device); 1406 r = dss_check_settings(ovl->manager, ovl->manager->device);
1400 op->enabled = false;
1401 if (r) { 1407 if (r) {
1402 DSSERR("failed to enable overlay %d: check_settings failed\n", 1408 DSSERR("failed to enable overlay %d: check_settings failed\n",
1403 ovl->id); 1409 ovl->id);
1404 goto err2; 1410 goto err2;
1405 } 1411 }
1406 1412
1407 dss_apply_ovl_enable(ovl, true);
1408
1409 dss_ovl_setup_fifo(ovl); 1413 dss_ovl_setup_fifo(ovl);
1410 1414
1415 op->enabling = false;
1416 dss_apply_ovl_enable(ovl, true);
1417
1411 dss_write_regs(); 1418 dss_write_regs();
1412 dss_set_go_bits(); 1419 dss_set_go_bits();
1413 1420
@@ -1417,6 +1424,7 @@ int dss_ovl_enable(struct omap_overlay *ovl)
1417 1424
1418 return 0; 1425 return 0;
1419err2: 1426err2:
1427 op->enabling = false;
1420 spin_unlock_irqrestore(&data_lock, flags); 1428 spin_unlock_irqrestore(&data_lock, flags);
1421err1: 1429err1:
1422 mutex_unlock(&apply_lock); 1430 mutex_unlock(&apply_lock);