Commit 20928501 authored by Tomi Valkeinen's avatar Tomi Valkeinen

OMAPDSS: split omap_dss_mgr_apply() to smaller funcs

Split omap_dss_mgr_apply() into smaller functions for clarity.
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
parent 32eaa584
...@@ -993,29 +993,11 @@ static void dss_apply_irq_handler(void *data, u32 mask) ...@@ -993,29 +993,11 @@ static void dss_apply_irq_handler(void *data, u32 mask)
spin_unlock(&dss_cache.lock); spin_unlock(&dss_cache.lock);
} }
static int omap_dss_mgr_apply(struct omap_overlay_manager *mgr) static int omap_dss_mgr_apply_ovl(struct omap_overlay *ovl)
{ {
struct overlay_cache_data *oc; struct overlay_cache_data *oc;
struct manager_cache_data *mc;
int i;
struct omap_overlay *ovl;
unsigned long flags;
int r;
DSSDBG("omap_dss_mgr_apply(%s)\n", mgr->name);
r = dispc_runtime_get();
if (r)
return r;
spin_lock_irqsave(&dss_cache.lock, flags);
/* Configure overlays */
for (i = 0; i < omap_dss_get_num_overlays(); ++i) {
struct omap_dss_device *dssdev; struct omap_dss_device *dssdev;
ovl = omap_dss_get_overlay(i);
oc = &dss_cache.overlay_cache[ovl->id]; oc = &dss_cache.overlay_cache[ovl->id];
if (ovl->manager_changed) { if (ovl->manager_changed) {
...@@ -1028,11 +1010,11 @@ static int omap_dss_mgr_apply(struct omap_overlay_manager *mgr) ...@@ -1028,11 +1010,11 @@ static int omap_dss_mgr_apply(struct omap_overlay_manager *mgr)
oc->enabled = false; oc->enabled = false;
oc->dirty = true; oc->dirty = true;
} }
continue; return 0;
} }
if (!ovl->info_dirty) if (!ovl->info_dirty)
continue; return 0;
dssdev = ovl->manager->device; dssdev = ovl->manager->device;
...@@ -1041,7 +1023,7 @@ static int omap_dss_mgr_apply(struct omap_overlay_manager *mgr) ...@@ -1041,7 +1023,7 @@ static int omap_dss_mgr_apply(struct omap_overlay_manager *mgr)
oc->enabled = false; oc->enabled = false;
oc->dirty = true; oc->dirty = true;
} }
continue; return -EINVAL;
} }
ovl->info_dirty = false; ovl->info_dirty = false;
...@@ -1051,10 +1033,14 @@ static int omap_dss_mgr_apply(struct omap_overlay_manager *mgr) ...@@ -1051,10 +1033,14 @@ static int omap_dss_mgr_apply(struct omap_overlay_manager *mgr)
oc->channel = ovl->manager->id; oc->channel = ovl->manager->id;
oc->enabled = true; oc->enabled = true;
}
/* Configure managers */ return 0;
list_for_each_entry(mgr, &manager_list, list) { }
static void omap_dss_mgr_apply_mgr(struct omap_overlay_manager *mgr)
{
struct manager_cache_data *mc;
mc = &dss_cache.manager_cache[mgr->id]; mc = &dss_cache.manager_cache[mgr->id];
if (mgr->device_changed) { if (mgr->device_changed) {
...@@ -1063,29 +1049,28 @@ static int omap_dss_mgr_apply(struct omap_overlay_manager *mgr) ...@@ -1063,29 +1049,28 @@ static int omap_dss_mgr_apply(struct omap_overlay_manager *mgr)
} }
if (!mgr->info_dirty) if (!mgr->info_dirty)
continue; return;
if (!mgr->device) if (!mgr->device)
continue; return;
mgr->info_dirty = false; mgr->info_dirty = false;
mc->dirty = true; mc->dirty = true;
mc->info = mgr->info; mc->info = mgr->info;
mc->manual_update = mgr_manual_update(mgr); mc->manual_update = mgr_manual_update(mgr);
} }
/* Configure overlay fifos */ static void omap_dss_mgr_apply_ovl_fifos(struct omap_overlay *ovl)
for (i = 0; i < omap_dss_get_num_overlays(); ++i) { {
struct overlay_cache_data *oc;
struct omap_dss_device *dssdev; struct omap_dss_device *dssdev;
u32 size, burst_size; u32 size, burst_size;
ovl = omap_dss_get_overlay(i);
oc = &dss_cache.overlay_cache[ovl->id]; oc = &dss_cache.overlay_cache[ovl->id];
if (!oc->enabled) if (!oc->enabled)
continue; return;
dssdev = ovl->manager->device; dssdev = ovl->manager->device;
...@@ -1113,6 +1098,41 @@ static int omap_dss_mgr_apply(struct omap_overlay_manager *mgr) ...@@ -1113,6 +1098,41 @@ static int omap_dss_mgr_apply(struct omap_overlay_manager *mgr)
default: default:
BUG(); BUG();
} }
}
static int omap_dss_mgr_apply(struct omap_overlay_manager *mgr)
{
int i, r;
unsigned long flags;
DSSDBG("omap_dss_mgr_apply(%s)\n", mgr->name);
r = dispc_runtime_get();
if (r)
return r;
spin_lock_irqsave(&dss_cache.lock, flags);
/* Configure overlays */
for (i = 0; i < omap_dss_get_num_overlays(); ++i) {
struct omap_overlay *ovl;
ovl = omap_dss_get_overlay(i);
omap_dss_mgr_apply_ovl(ovl);
}
/* Configure managers */
list_for_each_entry(mgr, &manager_list, list)
omap_dss_mgr_apply_mgr(mgr);
/* Configure overlay fifos */
for (i = 0; i < omap_dss_get_num_overlays(); ++i) {
struct omap_overlay *ovl;
ovl = omap_dss_get_overlay(i);
omap_dss_mgr_apply_ovl_fifos(ovl);
} }
r = 0; r = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment