{
struct manager_cache_data *mc;
struct overlay_cache_data *oc;
- const int num_ovls = dss_feat_get_num_ovls();
- int i;
+ struct omap_overlay *ovl;
mc = &dss_cache.manager_cache[mgr->id];
configure_dispc();
mc->do_manual_update = false;
- for (i = 0; i < num_ovls; ++i) {
- oc = &dss_cache.overlay_cache[i];
- if (oc->channel != mgr->id)
- continue;
-
+ list_for_each_entry(ovl, &mgr->overlays, list) {
+ oc = &dss_cache.overlay_cache[ovl->id];
oc->shadow_dirty = false;
}
int omap_dss_mgr_apply(struct omap_overlay_manager *mgr)
{
- int i, r;
+ int r;
unsigned long flags;
+ struct omap_overlay *ovl;
DSSDBG("omap_dss_mgr_apply(%s)\n", mgr->name);
spin_lock_irqsave(&dss_cache.lock, flags);
/* Configure overlays */
- for (i = 0; i < mgr->num_overlays; ++i) {
- struct omap_overlay *ovl;
-
- ovl = mgr->overlays[i];
-
- if (ovl->manager != mgr)
- continue;
-
+ list_for_each_entry(ovl, &mgr->overlays, list)
omap_dss_mgr_apply_ovl(ovl);
- }
/* Configure manager */
omap_dss_mgr_apply_mgr(mgr);
/* Configure overlay fifos */
- for (i = 0; i < mgr->num_overlays; ++i) {
- struct omap_overlay *ovl;
-
- ovl = mgr->overlays[i];
-
- if (ovl->manager != mgr)
- continue;
-
+ list_for_each_entry(ovl, &mgr->overlays, list)
omap_dss_mgr_apply_ovl_fifos(ovl);
- }
r = 0;
if (mgr->enabled && !mgr_manual_update(mgr)) {
static int omap_dss_set_device(struct omap_overlay_manager *mgr,
struct omap_dss_device *dssdev)
{
- int i;
int r;
+ struct omap_overlay *ovl;
if (dssdev->manager) {
DSSERR("display '%s' already has a manager '%s'\n",
return -EINVAL;
}
- for (i = 0; i < mgr->num_overlays; i++) {
- struct omap_overlay *ovl = mgr->overlays[i];
-
- if (ovl->manager != mgr || !ovl->info.enabled)
+ list_for_each_entry(ovl, &mgr->overlays, list) {
+ if (!ovl->info.enabled)
continue;
r = dss_check_overlay(ovl, dssdev);
mgr->supported_displays =
dss_feat_get_supported_displays(mgr->id);
- dss_overlay_setup_dispc_manager(mgr);
+ INIT_LIST_HEAD(&mgr->overlays);
r = kobject_init_and_add(&mgr->kobj, &manager_ktype,
&pdev->dev.kobj, "manager%d", i);
}
ovl->manager = mgr;
+ list_add_tail(&ovl->list, &mgr->overlays);
ovl->manager_changed = true;
/* XXX: When there is an overlay on a DSI manual update display, and
}
ovl->manager = NULL;
+ list_del(&ovl->list);
ovl->manager_changed = true;
return 0;
}
EXPORT_SYMBOL(omap_dss_get_overlay);
-static struct omap_overlay *dispc_overlays[MAX_DSS_OVERLAYS];
-
-void dss_overlay_setup_dispc_manager(struct omap_overlay_manager *mgr)
-{
- mgr->num_overlays = dss_feat_get_num_ovls();
- mgr->overlays = dispc_overlays;
-}
-
void dss_init_overlays(struct platform_device *pdev)
{
int i, r;
if (r)
DSSERR("failed to create sysfs file\n");
-
- dispc_overlays[i] = ovl;
}
}
const char *name;
enum omap_channel id;
enum omap_overlay_manager_caps caps;
- int num_overlays;
- struct omap_overlay **overlays;
+ struct list_head overlays;
enum omap_display_type supported_displays;
/* dynamic fields */