summaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2011-11-04 09:19:35 +0200
committerTomi Valkeinen <tomi.valkeinen@ti.com>2011-12-02 08:54:29 +0200
commit209285012c792d3a0f758c7ace30af0ee4bc08a3 (patch)
tree0d5da1876e1bc84caaca4147298bf2faf0abbbf6 /drivers/video/omap2
parent32eaa5841021c8d812a4f62898a6e8617d648846 (diff)
downloadlinux-stable-209285012c792d3a0f758c7ace30af0ee4bc08a3.tar.gz
linux-stable-209285012c792d3a0f758c7ace30af0ee4bc08a3.tar.bz2
linux-stable-209285012c792d3a0f758c7ace30af0ee4bc08a3.zip
OMAPDSS: split omap_dss_mgr_apply() to smaller funcs
Split omap_dss_mgr_apply() into smaller functions for clarity. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video/omap2')
-rw-r--r--drivers/video/omap2/dss/manager.c168
1 files changed, 94 insertions, 74 deletions
diff --git a/drivers/video/omap2/dss/manager.c b/drivers/video/omap2/dss/manager.c
index 8423cf85f682..d0d23157110b 100644
--- a/drivers/video/omap2/dss/manager.c
+++ b/drivers/video/omap2/dss/manager.c
@@ -993,107 +993,92 @@ end:
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);
+ struct omap_dss_device *dssdev;
- r = dispc_runtime_get();
- if (r)
- return r;
+ oc = &dss_cache.overlay_cache[ovl->id];
- spin_lock_irqsave(&dss_cache.lock, flags);
+ if (ovl->manager_changed) {
+ ovl->manager_changed = false;
+ ovl->info_dirty = true;
+ }
- /* Configure overlays */
- for (i = 0; i < omap_dss_get_num_overlays(); ++i) {
- struct omap_dss_device *dssdev;
+ if (!overlay_enabled(ovl)) {
+ if (oc->enabled) {
+ 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) {
- ovl->manager_changed = false;
- ovl->info_dirty = true;
+ if (dss_check_overlay(ovl, dssdev)) {
+ if (oc->enabled) {
+ oc->enabled = false;
+ oc->dirty = true;
}
+ return -EINVAL;
+ }
- if (!overlay_enabled(ovl)) {
- if (oc->enabled) {
- oc->enabled = false;
- oc->dirty = true;
- }
- continue;
- }
+ ovl->info_dirty = false;
+ oc->dirty = true;
+ oc->info = ovl->info;
- if (!ovl->info_dirty)
- continue;
+ oc->channel = ovl->manager->id;
- dssdev = ovl->manager->device;
+ oc->enabled = true;
- if (dss_check_overlay(ovl, dssdev)) {
- if (oc->enabled) {
- oc->enabled = false;
- oc->dirty = true;
- }
- continue;
- }
+ return 0;
+}
- ovl->info_dirty = false;
- oc->dirty = true;
- oc->info = ovl->info;
+static void omap_dss_mgr_apply_mgr(struct omap_overlay_manager *mgr)
+{
+ 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 */
- list_for_each_entry(mgr, &manager_list, list) {
- mc = &dss_cache.manager_cache[mgr->id];
-
- if (mgr->device_changed) {
- mgr->device_changed = false;
- mgr->info_dirty = true;
- }
+ if (!mgr->info_dirty)
+ return;
- if (!mgr->info_dirty)
- continue;
+ if (!mgr->device)
+ return;
- if (!mgr->device)
- continue;
+ mgr->info_dirty = false;
+ mc->dirty = true;
+ mc->info = mgr->info;
- 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) {
- struct omap_dss_device *dssdev;
- u32 size, burst_size;
+ mc->manual_update = mgr_manual_update(mgr);
+}
- 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)
- continue;
+ if (!oc->enabled)
+ 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_DBI:
case OMAP_DISPLAY_TYPE_SDI:
@@ -1112,7 +1097,42 @@ static int omap_dss_mgr_apply(struct omap_overlay_manager *mgr)
#endif
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;