diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2011-11-15 12:15:18 +0200 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2011-12-02 08:54:40 +0200 |
commit | eb70d739adf2266e744a784a1272f1c92a257b81 (patch) | |
tree | 856b0791e7f8f826e4d3e1c9ef58c4ee74d72a16 /drivers/video/omap2/dss/apply.c | |
parent | f77b30700e5c0a6b5220b3a964bf6c40d5e71416 (diff) | |
download | op-kernel-dev-eb70d739adf2266e744a784a1272f1c92a257b81.zip op-kernel-dev-eb70d739adf2266e744a784a1272f1c92a257b81.tar.gz |
OMAPDSS: APPLY: move mgr funcs to apply.c
apply.c will handle the management of dispc in the future patches. This
patch moves overlay manager related functions to apply.c so that they
will have access to the private data and functions of apply.c.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video/omap2/dss/apply.c')
-rw-r--r-- | drivers/video/omap2/dss/apply.c | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/drivers/video/omap2/dss/apply.c b/drivers/video/omap2/dss/apply.c index e42d1d3ba..1aab0a34 100644 --- a/drivers/video/omap2/dss/apply.c +++ b/drivers/video/omap2/dss/apply.c @@ -662,6 +662,89 @@ void dss_mgr_disable(struct omap_overlay_manager *mgr) mgr->enabled = false; } +int dss_mgr_set_info(struct omap_overlay_manager *mgr, + struct omap_overlay_manager_info *info) +{ + int r; + struct omap_overlay_manager_info old_info; + + old_info = mgr->info; + mgr->info = *info; + + r = dss_check_manager(mgr); + if (r) { + mgr->info = old_info; + return r; + } + + mgr->info_dirty = true; + + return 0; +} + +void dss_mgr_get_info(struct omap_overlay_manager *mgr, + struct omap_overlay_manager_info *info) +{ + *info = mgr->info; +} + +int dss_mgr_set_device(struct omap_overlay_manager *mgr, + struct omap_dss_device *dssdev) +{ + int r; + struct omap_overlay *ovl; + + if (dssdev->manager) { + DSSERR("display '%s' already has a manager '%s'\n", + dssdev->name, dssdev->manager->name); + return -EINVAL; + } + + if ((mgr->supported_displays & dssdev->type) == 0) { + DSSERR("display '%s' does not support manager '%s'\n", + dssdev->name, mgr->name); + return -EINVAL; + } + + list_for_each_entry(ovl, &mgr->overlays, list) { + if (!ovl->info.enabled) + continue; + + r = dss_check_overlay(ovl, dssdev); + if (r) + return r; + } + + dssdev->manager = mgr; + mgr->device = dssdev; + mgr->device_changed = true; + + return 0; +} + +int dss_mgr_unset_device(struct omap_overlay_manager *mgr) +{ + if (!mgr->device) { + DSSERR("failed to unset display, display not set.\n"); + return -EINVAL; + } + + /* + * Don't allow currently enabled displays to have the overlay manager + * pulled out from underneath them + */ + if (mgr->device->state != OMAP_DSS_DISPLAY_DISABLED) + return -EINVAL; + + mgr->device->manager = NULL; + mgr->device = NULL; + mgr->device_changed = true; + + return 0; +} + + + int dss_ovl_set_info(struct omap_overlay *ovl, struct omap_overlay_info *info) { |