diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2012-10-10 03:56:05 -0400 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2012-12-07 10:05:55 -0500 |
commit | 74b65ec24560ab0df0e7b789fa91cde4a442f169 (patch) | |
tree | 2d322869cb9ea6d9196e6743dbb7d67138b2cd30 /drivers/video/omap2/dss/apply.c | |
parent | 6abae7a18a8c9dbec96915eb924dc06288a47b02 (diff) |
OMAPDSS: add manager ops
The output drivers need some operations from the overlay managers, like
enable and set_timings. These will affect the dispc registers, and need
to be synchronized with the composition-side changes with overlays and
overlay managers.
We want to handle these calls in the apply.c in the compatibility mode,
but when in non-compat mode, the calls need to be handled by some other
component (e.g. omapdrm).
To make this possible, this patch creates a set of function pointers in
a dss_mgr_ops struct, that is used to redirect the calls into the
correct destination.
The non-compat users can install their mgr ops with
dss_install_mgr_ops() function.
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 | 36 |
1 files changed, 30 insertions, 6 deletions
diff --git a/drivers/video/omap2/dss/apply.c b/drivers/video/omap2/dss/apply.c index 038876a68d1..70eaa8f70e9 100644 --- a/drivers/video/omap2/dss/apply.c +++ b/drivers/video/omap2/dss/apply.c | |||
@@ -781,7 +781,7 @@ static void mgr_clear_shadow_dirty(struct omap_overlay_manager *mgr) | |||
781 | } | 781 | } |
782 | } | 782 | } |
783 | 783 | ||
784 | void dss_mgr_start_update(struct omap_overlay_manager *mgr) | 784 | static void dss_mgr_start_update_compat(struct omap_overlay_manager *mgr) |
785 | { | 785 | { |
786 | struct mgr_priv_data *mp = get_mgr_priv(mgr); | 786 | struct mgr_priv_data *mp = get_mgr_priv(mgr); |
787 | unsigned long flags; | 787 | unsigned long flags; |
@@ -1021,7 +1021,7 @@ static void dss_setup_fifos(void) | |||
1021 | } | 1021 | } |
1022 | } | 1022 | } |
1023 | 1023 | ||
1024 | int dss_mgr_enable(struct omap_overlay_manager *mgr) | 1024 | static int dss_mgr_enable_compat(struct omap_overlay_manager *mgr) |
1025 | { | 1025 | { |
1026 | struct mgr_priv_data *mp = get_mgr_priv(mgr); | 1026 | struct mgr_priv_data *mp = get_mgr_priv(mgr); |
1027 | unsigned long flags; | 1027 | unsigned long flags; |
@@ -1071,7 +1071,7 @@ err: | |||
1071 | return r; | 1071 | return r; |
1072 | } | 1072 | } |
1073 | 1073 | ||
1074 | void dss_mgr_disable(struct omap_overlay_manager *mgr) | 1074 | static void dss_mgr_disable_compat(struct omap_overlay_manager *mgr) |
1075 | { | 1075 | { |
1076 | struct mgr_priv_data *mp = get_mgr_priv(mgr); | 1076 | struct mgr_priv_data *mp = get_mgr_priv(mgr); |
1077 | unsigned long flags; | 1077 | unsigned long flags; |
@@ -1208,7 +1208,7 @@ static void dss_apply_mgr_timings(struct omap_overlay_manager *mgr, | |||
1208 | mp->extra_info_dirty = true; | 1208 | mp->extra_info_dirty = true; |
1209 | } | 1209 | } |
1210 | 1210 | ||
1211 | void dss_mgr_set_timings(struct omap_overlay_manager *mgr, | 1211 | static void dss_mgr_set_timings_compat(struct omap_overlay_manager *mgr, |
1212 | const struct omap_video_timings *timings) | 1212 | const struct omap_video_timings *timings) |
1213 | { | 1213 | { |
1214 | unsigned long flags; | 1214 | unsigned long flags; |
@@ -1236,7 +1236,7 @@ static void dss_apply_mgr_lcd_config(struct omap_overlay_manager *mgr, | |||
1236 | mp->extra_info_dirty = true; | 1236 | mp->extra_info_dirty = true; |
1237 | } | 1237 | } |
1238 | 1238 | ||
1239 | void dss_mgr_set_lcd_config(struct omap_overlay_manager *mgr, | 1239 | static void dss_mgr_set_lcd_config_compat(struct omap_overlay_manager *mgr, |
1240 | const struct dss_lcd_mgr_config *config) | 1240 | const struct dss_lcd_mgr_config *config) |
1241 | { | 1241 | { |
1242 | unsigned long flags; | 1242 | unsigned long flags; |
@@ -1501,13 +1501,21 @@ err: | |||
1501 | return r; | 1501 | return r; |
1502 | } | 1502 | } |
1503 | 1503 | ||
1504 | static const struct dss_mgr_ops apply_mgr_ops = { | ||
1505 | .start_update = dss_mgr_start_update_compat, | ||
1506 | .enable = dss_mgr_enable_compat, | ||
1507 | .disable = dss_mgr_disable_compat, | ||
1508 | .set_timings = dss_mgr_set_timings_compat, | ||
1509 | .set_lcd_config = dss_mgr_set_lcd_config_compat, | ||
1510 | }; | ||
1511 | |||
1504 | static int compat_refcnt; | 1512 | static int compat_refcnt; |
1505 | static DEFINE_MUTEX(compat_init_lock); | 1513 | static DEFINE_MUTEX(compat_init_lock); |
1506 | 1514 | ||
1507 | int omapdss_compat_init(void) | 1515 | int omapdss_compat_init(void) |
1508 | { | 1516 | { |
1509 | struct platform_device *pdev = dss_get_core_pdev(); | 1517 | struct platform_device *pdev = dss_get_core_pdev(); |
1510 | int i; | 1518 | int i, r; |
1511 | 1519 | ||
1512 | mutex_lock(&compat_init_lock); | 1520 | mutex_lock(&compat_init_lock); |
1513 | 1521 | ||
@@ -1548,10 +1556,24 @@ int omapdss_compat_init(void) | |||
1548 | ovl->get_device = &dss_ovl_get_device; | 1556 | ovl->get_device = &dss_ovl_get_device; |
1549 | } | 1557 | } |
1550 | 1558 | ||
1559 | r = dss_install_mgr_ops(&apply_mgr_ops); | ||
1560 | if (r) | ||
1561 | goto err_mgr_ops; | ||
1562 | |||
1551 | out: | 1563 | out: |
1552 | mutex_unlock(&compat_init_lock); | 1564 | mutex_unlock(&compat_init_lock); |
1553 | 1565 | ||
1554 | return 0; | 1566 | return 0; |
1567 | |||
1568 | err_mgr_ops: | ||
1569 | dss_uninit_overlay_managers(pdev); | ||
1570 | dss_uninit_overlays(pdev); | ||
1571 | |||
1572 | compat_refcnt--; | ||
1573 | |||
1574 | mutex_unlock(&compat_init_lock); | ||
1575 | |||
1576 | return r; | ||
1555 | } | 1577 | } |
1556 | EXPORT_SYMBOL(omapdss_compat_init); | 1578 | EXPORT_SYMBOL(omapdss_compat_init); |
1557 | 1579 | ||
@@ -1564,6 +1586,8 @@ void omapdss_compat_uninit(void) | |||
1564 | if (--compat_refcnt > 0) | 1586 | if (--compat_refcnt > 0) |
1565 | goto out; | 1587 | goto out; |
1566 | 1588 | ||
1589 | dss_uninstall_mgr_ops(); | ||
1590 | |||
1567 | dss_uninit_overlay_managers(pdev); | 1591 | dss_uninit_overlay_managers(pdev); |
1568 | dss_uninit_overlays(pdev); | 1592 | dss_uninit_overlays(pdev); |
1569 | out: | 1593 | out: |