diff options
-rw-r--r-- | drivers/video/omap2/dss/apply.c | 20 |
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 | ||
77 | struct mgr_priv_data { | 83 | struct 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; |
1419 | err2: | 1426 | err2: |
1427 | op->enabling = false; | ||
1420 | spin_unlock_irqrestore(&data_lock, flags); | 1428 | spin_unlock_irqrestore(&data_lock, flags); |
1421 | err1: | 1429 | err1: |
1422 | mutex_unlock(&apply_lock); | 1430 | mutex_unlock(&apply_lock); |