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)
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 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;
ovl = omap_dss_get_overlay(i);
oc = &dss_cache.overlay_cache[ovl->id];
if (ovl->manager_changed) {
......@@ -1028,11 +1010,11 @@ static int omap_dss_mgr_apply(struct omap_overlay_manager *mgr)
oc->enabled = false;
oc->dirty = true;
}
continue;
return 0;
}
if (!ovl->info_dirty)
continue;
return 0;
dssdev = ovl->manager->device;
......@@ -1041,7 +1023,7 @@ static int omap_dss_mgr_apply(struct omap_overlay_manager *mgr)
oc->enabled = false;
oc->dirty = true;
}
continue;
return -EINVAL;
}
ovl->info_dirty = false;
......@@ -1051,10 +1033,14 @@ static int omap_dss_mgr_apply(struct omap_overlay_manager *mgr)
oc->channel = ovl->manager->id;
oc->enabled = true;
}
/* Configure managers */
list_for_each_entry(mgr, &manager_list, list) {
return 0;
}
static void omap_dss_mgr_apply_mgr(struct omap_overlay_manager *mgr)
{
struct manager_cache_data *mc;
mc = &dss_cache.manager_cache[mgr->id];
if (mgr->device_changed) {
......@@ -1063,29 +1049,28 @@ static int omap_dss_mgr_apply(struct omap_overlay_manager *mgr)
}
if (!mgr->info_dirty)
continue;
return;
if (!mgr->device)
continue;
return;
mgr->info_dirty = false;
mc->dirty = true;
mc->info = mgr->info;
mc->manual_update = mgr_manual_update(mgr);
}
}
/* Configure overlay fifos */
for (i = 0; i < omap_dss_get_num_overlays(); ++i) {
static void omap_dss_mgr_apply_ovl_fifos(struct omap_overlay *ovl)
{
struct overlay_cache_data *oc;
struct omap_dss_device *dssdev;
u32 size, burst_size;
ovl = omap_dss_get_overlay(i);
oc = &dss_cache.overlay_cache[ovl->id];
if (!oc->enabled)
continue;
return;
dssdev = ovl->manager->device;
......@@ -1113,6 +1098,41 @@ static int omap_dss_mgr_apply(struct omap_overlay_manager *mgr)
default:
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;
......
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