From 07e327c9c18b382656bf455051759be8182627ae Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Sat, 5 Nov 2011 10:59:59 +0200 Subject: OMAPDSS: store overlays in a list for each manager Current way of handling overlay-manager links is a bit strange: each manager has a static array, containing pointers to all the overlays (even those used by other managers). The overlays contain a pointer to the manager being used. This patch makes the system a bit saner: each manager has a linked list of overlays, and only the overlays linked to that manager are in the list. Signed-off-by: Tomi Valkeinen --- drivers/video/omap2/dss/manager.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'drivers/video/omap2/dss/manager.c') diff --git a/drivers/video/omap2/dss/manager.c b/drivers/video/omap2/dss/manager.c index a08cc6e7f5ca..62bcc384e7ae 100644 --- a/drivers/video/omap2/dss/manager.c +++ b/drivers/video/omap2/dss/manager.c @@ -470,8 +470,8 @@ static struct kobj_type manager_ktype = { 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", @@ -485,10 +485,8 @@ static int omap_dss_set_device(struct omap_overlay_manager *mgr, 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); @@ -626,7 +624,7 @@ int dss_init_overlay_managers(struct platform_device *pdev) 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); -- cgit v1.2.3