summaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2011-11-26 14:26:46 +0200
committerTomi Valkeinen <tomi.valkeinen@ti.com>2011-12-02 08:54:58 +0200
commit82153eda076ee4df434bb1008f24e46590f76dfc (patch)
tree29d729a78240ed8394c976961cab942cc4e63b9e /drivers/video/omap2
parent153b6e7357778267e6914f2370a059e79a751371 (diff)
downloadop-kernel-dev-82153eda076ee4df434bb1008f24e46590f76dfc.zip
op-kernel-dev-82153eda076ee4df434bb1008f24e46590f76dfc.tar.gz
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')
-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 b6e6083..c38c015 100644
--- a/drivers/video/omap2/dss/apply.c
+++ b/drivers/video/omap2/dss/apply.c
@@ -72,6 +72,12 @@ struct ovl_priv_data {
bool enabled;
enum omap_channel channel;
u32 fifo_low, fifo_high;
+
+ /*
+ * True if overlay is to be enabled. Used to check and calculate configs
+ * for the overlay before it is enabled in the HW.
+ */
+ bool enabling;
};
struct mgr_priv_data {
@@ -297,7 +303,7 @@ static int dss_check_settings_low(struct omap_overlay_manager *mgr,
list_for_each_entry(ovl, &mgr->overlays, list) {
op = get_ovl_priv(ovl);
- if (!op->enabled)
+ if (!op->enabled && !op->enabling)
oi = NULL;
else if (applying && op->user_info_dirty)
oi = &op->user_info;
@@ -998,7 +1004,7 @@ static void dss_mgr_setup_fifos(struct omap_overlay_manager *mgr)
list_for_each_entry(ovl, &mgr->overlays, list) {
op = get_ovl_priv(ovl);
- if (!op->enabled)
+ if (!op->enabled && !op->enabling)
continue;
dss_ovl_setup_fifo(ovl);
@@ -1395,19 +1401,20 @@ int dss_ovl_enable(struct omap_overlay *ovl)
spin_lock_irqsave(&data_lock, flags);
- op->enabled = true;
+ op->enabling = true;
+
r = dss_check_settings(ovl->manager, ovl->manager->device);
- op->enabled = false;
if (r) {
DSSERR("failed to enable overlay %d: check_settings failed\n",
ovl->id);
goto err2;
}
- dss_apply_ovl_enable(ovl, true);
-
dss_ovl_setup_fifo(ovl);
+ op->enabling = false;
+ dss_apply_ovl_enable(ovl, true);
+
dss_write_regs();
dss_set_go_bits();
@@ -1417,6 +1424,7 @@ int dss_ovl_enable(struct omap_overlay *ovl)
return 0;
err2:
+ op->enabling = false;
spin_unlock_irqrestore(&data_lock, flags);
err1:
mutex_unlock(&apply_lock);
OpenPOWER on IntegriCloud