Commit 7f7cdbd6 authored by Tomi Valkeinen's avatar Tomi Valkeinen

OMAPDSS: split overlay manager creation

Split the function that creates overlay manager structs into two: one
that creates just the structs, and one that creates the sysfs files for
the manager.

This will help us use the overlay manager structs with omapdrm in the
following patches, while still leaving the sysfs files out.
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
parent be8e8e1c
...@@ -1577,7 +1577,8 @@ int omapdss_compat_init(void) ...@@ -1577,7 +1577,8 @@ int omapdss_compat_init(void)
apply_init_priv(); apply_init_priv();
dss_init_overlay_managers(pdev); dss_init_overlay_managers();
dss_init_overlay_managers_sysfs(pdev);
dss_init_overlays(pdev); dss_init_overlays(pdev);
for (i = 0; i < omap_dss_get_num_overlay_managers(); i++) { for (i = 0; i < omap_dss_get_num_overlay_managers(); i++) {
...@@ -1640,7 +1641,8 @@ int omapdss_compat_init(void) ...@@ -1640,7 +1641,8 @@ int omapdss_compat_init(void)
dss_uninstall_mgr_ops(); dss_uninstall_mgr_ops();
err_mgr_ops: err_mgr_ops:
dss_uninit_overlay_managers(pdev); dss_uninit_overlay_managers_sysfs(pdev);
dss_uninit_overlay_managers();
dss_uninit_overlays(pdev); dss_uninit_overlays(pdev);
compat_refcnt--; compat_refcnt--;
...@@ -1668,7 +1670,8 @@ void omapdss_compat_uninit(void) ...@@ -1668,7 +1670,8 @@ void omapdss_compat_uninit(void)
dss_uninstall_mgr_ops(); dss_uninstall_mgr_ops();
dss_uninit_overlay_managers(pdev); dss_uninit_overlay_managers_sysfs(pdev);
dss_uninit_overlay_managers();
dss_uninit_overlays(pdev); dss_uninit_overlays(pdev);
out: out:
mutex_unlock(&compat_init_lock); mutex_unlock(&compat_init_lock);
......
...@@ -194,8 +194,10 @@ void display_uninit_sysfs(struct platform_device *pdev, ...@@ -194,8 +194,10 @@ void display_uninit_sysfs(struct platform_device *pdev,
struct omap_dss_device *dssdev); struct omap_dss_device *dssdev);
/* manager */ /* manager */
int dss_init_overlay_managers(struct platform_device *pdev); int dss_init_overlay_managers(void);
void dss_uninit_overlay_managers(struct platform_device *pdev); void dss_uninit_overlay_managers(void);
int dss_init_overlay_managers_sysfs(struct platform_device *pdev);
void dss_uninit_overlay_managers_sysfs(struct platform_device *pdev);
int dss_mgr_simple_check(struct omap_overlay_manager *mgr, int dss_mgr_simple_check(struct omap_overlay_manager *mgr,
const struct omap_overlay_manager_info *info); const struct omap_overlay_manager_info *info);
int dss_mgr_check_timings(struct omap_overlay_manager *mgr, int dss_mgr_check_timings(struct omap_overlay_manager *mgr,
......
...@@ -511,4 +511,6 @@ void dss_manager_kobj_uninit(struct omap_overlay_manager *mgr) ...@@ -511,4 +511,6 @@ void dss_manager_kobj_uninit(struct omap_overlay_manager *mgr)
{ {
kobject_del(&mgr->kobj); kobject_del(&mgr->kobj);
kobject_put(&mgr->kobj); kobject_put(&mgr->kobj);
memset(&mgr->kobj, 0, sizeof(mgr->kobj));
} }
...@@ -36,9 +36,9 @@ ...@@ -36,9 +36,9 @@
static int num_managers; static int num_managers;
static struct omap_overlay_manager *managers; static struct omap_overlay_manager *managers;
int dss_init_overlay_managers(struct platform_device *pdev) int dss_init_overlay_managers(void)
{ {
int i, r; int i;
num_managers = dss_feat_get_num_mgrs(); num_managers = dss_feat_get_num_mgrs();
...@@ -76,6 +76,17 @@ int dss_init_overlay_managers(struct platform_device *pdev) ...@@ -76,6 +76,17 @@ int dss_init_overlay_managers(struct platform_device *pdev)
dss_feat_get_supported_outputs(mgr->id); dss_feat_get_supported_outputs(mgr->id);
INIT_LIST_HEAD(&mgr->overlays); INIT_LIST_HEAD(&mgr->overlays);
}
return 0;
}
int dss_init_overlay_managers_sysfs(struct platform_device *pdev)
{
int i, r;
for (i = 0; i < num_managers; ++i) {
struct omap_overlay_manager *mgr = &managers[i];
r = dss_manager_kobj_init(mgr, pdev); r = dss_manager_kobj_init(mgr, pdev);
if (r) if (r)
...@@ -85,18 +96,22 @@ int dss_init_overlay_managers(struct platform_device *pdev) ...@@ -85,18 +96,22 @@ int dss_init_overlay_managers(struct platform_device *pdev)
return 0; return 0;
} }
void dss_uninit_overlay_managers(struct platform_device *pdev) void dss_uninit_overlay_managers(void)
{
kfree(managers);
managers = NULL;
num_managers = 0;
}
void dss_uninit_overlay_managers_sysfs(struct platform_device *pdev)
{ {
int i; int i;
for (i = 0; i < num_managers; ++i) { for (i = 0; i < num_managers; ++i) {
struct omap_overlay_manager *mgr = &managers[i]; struct omap_overlay_manager *mgr = &managers[i];
dss_manager_kobj_uninit(mgr); dss_manager_kobj_uninit(mgr);
} }
kfree(managers);
managers = NULL;
num_managers = 0;
} }
int omap_dss_get_num_overlay_managers(void) int omap_dss_get_num_overlay_managers(void)
......
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