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,107 +993,92 @@ static void dss_apply_irq_handler(void *data, u32 mask) ...@@ -993,107 +993,92 @@ 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; struct omap_dss_device *dssdev;
int i;
struct omap_overlay *ovl;
unsigned long flags;
int r;
DSSDBG("omap_dss_mgr_apply(%s)\n", mgr->name);
r = dispc_runtime_get(); oc = &dss_cache.overlay_cache[ovl->id];
if (r)
return r;
spin_lock_irqsave(&dss_cache.lock, flags); if (ovl->manager_changed) {
ovl->manager_changed = false;
ovl->info_dirty = true;
}
/* Configure overlays */ if (!overlay_enabled(ovl)) {
for (i = 0; i < omap_dss_get_num_overlays(); ++i) { if (oc->enabled) {
struct omap_dss_device *dssdev; oc->enabled = false;
oc->dirty = true;
}
return 0;
}
ovl = omap_dss_get_overlay(i); if (!ovl->info_dirty)
return 0;
oc = &dss_cache.overlay_cache[ovl->id]; dssdev = ovl->manager->device;
if (ovl->manager_changed) { if (dss_check_overlay(ovl, dssdev)) {
ovl->manager_changed = false; if (oc->enabled) {
ovl->info_dirty = true; oc->enabled = false;
oc->dirty = true;
} }
return -EINVAL;
}
if (!overlay_enabled(ovl)) { ovl->info_dirty = false;
if (oc->enabled) { oc->dirty = true;
oc->enabled = false; oc->info = ovl->info;
oc->dirty = true;
}
continue;
}
if (!ovl->info_dirty) oc->channel = ovl->manager->id;
continue;
dssdev = ovl->manager->device; oc->enabled = true;
if (dss_check_overlay(ovl, dssdev)) { return 0;
if (oc->enabled) { }
oc->enabled = false;
oc->dirty = true;
}
continue;
}
ovl->info_dirty = false; static void omap_dss_mgr_apply_mgr(struct omap_overlay_manager *mgr)
oc->dirty = true; {
oc->info = ovl->info; struct manager_cache_data *mc;
oc->channel = ovl->manager->id; mc = &dss_cache.manager_cache[mgr->id];
oc->enabled = true; if (mgr->device_changed) {
mgr->device_changed = false;
mgr->info_dirty = true;
} }
/* Configure managers */ if (!mgr->info_dirty)
list_for_each_entry(mgr, &manager_list, list) { return;
mc = &dss_cache.manager_cache[mgr->id];
if (mgr->device_changed) {
mgr->device_changed = false;
mgr->info_dirty = true;
}
if (!mgr->info_dirty) if (!mgr->device)
continue; return;
if (!mgr->device) mgr->info_dirty = false;
continue; mc->dirty = true;
mc->info = mgr->info;
mgr->info_dirty = false; mc->manual_update = mgr_manual_update(mgr);
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) {
struct omap_dss_device *dssdev;
u32 size, burst_size;
ovl = omap_dss_get_overlay(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;
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;
size = dispc_ovl_get_fifo_size(ovl->id); size = dispc_ovl_get_fifo_size(ovl->id);
burst_size = dispc_ovl_get_burst_size(ovl->id); burst_size = dispc_ovl_get_burst_size(ovl->id);
switch (dssdev->type) { switch (dssdev->type) {
case OMAP_DISPLAY_TYPE_DPI: case OMAP_DISPLAY_TYPE_DPI:
case OMAP_DISPLAY_TYPE_DBI: case OMAP_DISPLAY_TYPE_DBI:
case OMAP_DISPLAY_TYPE_SDI: case OMAP_DISPLAY_TYPE_SDI:
...@@ -1112,7 +1097,42 @@ static int omap_dss_mgr_apply(struct omap_overlay_manager *mgr) ...@@ -1112,7 +1097,42 @@ static int omap_dss_mgr_apply(struct omap_overlay_manager *mgr)
#endif #endif
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