diff options
author | Archit Taneja <archit@ti.com> | 2012-09-07 08:14:51 -0400 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2012-09-26 07:58:31 -0400 |
commit | 794bc4eefa10fbc80e6ad29de1bc42424efde608 (patch) | |
tree | a9823eb2eae3a2cafed62fedf96db07b45d99e33 /drivers/video/omap2 | |
parent | 97f01b3a2ed6d46132bf4e2d237c27846e7b260a (diff) |
OMAPDSS: Remove manager->device references
With the introduction of output entities, managers will now connect to outputs.
Create helper ops for overlays and managers named get_device. This will abstract
away the information on how to get the device from an overlay or an overlay
manager. The get_device ops currently retrieve the output via a
ovl->manager->device reference. This will be later replaced by
ovl->manager->output->device references.
Signed-off-by: Archit Taneja <archit@ti.com>
Diffstat (limited to 'drivers/video/omap2')
-rw-r--r-- | drivers/video/omap2/dss/apply.c | 4 | ||||
-rw-r--r-- | drivers/video/omap2/dss/dispc.c | 10 | ||||
-rw-r--r-- | drivers/video/omap2/dss/manager-sysfs.c | 8 | ||||
-rw-r--r-- | drivers/video/omap2/dss/manager.c | 11 | ||||
-rw-r--r-- | drivers/video/omap2/dss/overlay.c | 6 |
5 files changed, 29 insertions, 10 deletions
diff --git a/drivers/video/omap2/dss/apply.c b/drivers/video/omap2/dss/apply.c index 3cc47265bb03..417b286132f5 100644 --- a/drivers/video/omap2/dss/apply.c +++ b/drivers/video/omap2/dss/apply.c | |||
@@ -1464,7 +1464,7 @@ int dss_ovl_enable(struct omap_overlay *ovl) | |||
1464 | goto err1; | 1464 | goto err1; |
1465 | } | 1465 | } |
1466 | 1466 | ||
1467 | if (ovl->manager == NULL || ovl->manager->device == NULL) { | 1467 | if (ovl->get_device(ovl) == NULL) { |
1468 | r = -EINVAL; | 1468 | r = -EINVAL; |
1469 | goto err1; | 1469 | goto err1; |
1470 | } | 1470 | } |
@@ -1514,7 +1514,7 @@ int dss_ovl_disable(struct omap_overlay *ovl) | |||
1514 | goto err; | 1514 | goto err; |
1515 | } | 1515 | } |
1516 | 1516 | ||
1517 | if (ovl->manager == NULL || ovl->manager->device == NULL) { | 1517 | if (ovl->get_device(ovl) == NULL) { |
1518 | r = -EINVAL; | 1518 | r = -EINVAL; |
1519 | goto err; | 1519 | goto err; |
1520 | } | 1520 | } |
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c index 2137d2a2cc5d..811fe381aaea 100644 --- a/drivers/video/omap2/dss/dispc.c +++ b/drivers/video/omap2/dss/dispc.c | |||
@@ -3595,7 +3595,7 @@ static void dispc_error_worker(struct work_struct *work) | |||
3595 | bit = mgr_desc[i].sync_lost_irq; | 3595 | bit = mgr_desc[i].sync_lost_irq; |
3596 | 3596 | ||
3597 | if (bit & errors) { | 3597 | if (bit & errors) { |
3598 | struct omap_dss_device *dssdev = mgr->device; | 3598 | struct omap_dss_device *dssdev = mgr->get_device(mgr); |
3599 | bool enable; | 3599 | bool enable; |
3600 | 3600 | ||
3601 | DSSERR("SYNC_LOST on channel %s, restarting the output " | 3601 | DSSERR("SYNC_LOST on channel %s, restarting the output " |
@@ -3626,9 +3626,13 @@ static void dispc_error_worker(struct work_struct *work) | |||
3626 | DSSERR("OCP_ERR\n"); | 3626 | DSSERR("OCP_ERR\n"); |
3627 | for (i = 0; i < omap_dss_get_num_overlay_managers(); ++i) { | 3627 | for (i = 0; i < omap_dss_get_num_overlay_managers(); ++i) { |
3628 | struct omap_overlay_manager *mgr; | 3628 | struct omap_overlay_manager *mgr; |
3629 | struct omap_dss_device *dssdev; | ||
3630 | |||
3629 | mgr = omap_dss_get_overlay_manager(i); | 3631 | mgr = omap_dss_get_overlay_manager(i); |
3630 | if (mgr->device && mgr->device->driver) | 3632 | dssdev = mgr->get_device(mgr); |
3631 | mgr->device->driver->disable(mgr->device); | 3633 | |
3634 | if (dssdev && dssdev->driver) | ||
3635 | dssdev->driver->disable(dssdev); | ||
3632 | } | 3636 | } |
3633 | } | 3637 | } |
3634 | 3638 | ||
diff --git a/drivers/video/omap2/dss/manager-sysfs.c b/drivers/video/omap2/dss/manager-sysfs.c index 9b875fbe757e..55cf955f663d 100644 --- a/drivers/video/omap2/dss/manager-sysfs.c +++ b/drivers/video/omap2/dss/manager-sysfs.c | |||
@@ -38,8 +38,10 @@ static ssize_t manager_name_show(struct omap_overlay_manager *mgr, char *buf) | |||
38 | 38 | ||
39 | static ssize_t manager_display_show(struct omap_overlay_manager *mgr, char *buf) | 39 | static ssize_t manager_display_show(struct omap_overlay_manager *mgr, char *buf) |
40 | { | 40 | { |
41 | return snprintf(buf, PAGE_SIZE, "%s\n", | 41 | struct omap_dss_device *dssdev = mgr->get_device(mgr); |
42 | mgr->device ? mgr->device->name : "<none>"); | 42 | |
43 | return snprintf(buf, PAGE_SIZE, "%s\n", dssdev ? | ||
44 | dssdev->name : "<none>"); | ||
43 | } | 45 | } |
44 | 46 | ||
45 | static ssize_t manager_display_store(struct omap_overlay_manager *mgr, | 47 | static ssize_t manager_display_store(struct omap_overlay_manager *mgr, |
@@ -67,7 +69,7 @@ static ssize_t manager_display_store(struct omap_overlay_manager *mgr, | |||
67 | if (dssdev) | 69 | if (dssdev) |
68 | DSSDBG("display %s found\n", dssdev->name); | 70 | DSSDBG("display %s found\n", dssdev->name); |
69 | 71 | ||
70 | if (mgr->device) { | 72 | if (mgr->get_device(mgr)) { |
71 | r = mgr->unset_device(mgr); | 73 | r = mgr->unset_device(mgr); |
72 | if (r) { | 74 | if (r) { |
73 | DSSERR("failed to unset display\n"); | 75 | DSSERR("failed to unset display\n"); |
diff --git a/drivers/video/omap2/dss/manager.c b/drivers/video/omap2/dss/manager.c index 92a2585d04b2..edc372e04bcb 100644 --- a/drivers/video/omap2/dss/manager.c +++ b/drivers/video/omap2/dss/manager.c | |||
@@ -36,9 +36,15 @@ | |||
36 | static int num_managers; | 36 | static int num_managers; |
37 | static struct omap_overlay_manager *managers; | 37 | static struct omap_overlay_manager *managers; |
38 | 38 | ||
39 | static inline struct omap_dss_device *dss_mgr_get_device(struct omap_overlay_manager *mgr) | ||
40 | { | ||
41 | return mgr->device; | ||
42 | } | ||
43 | |||
39 | static int dss_mgr_wait_for_vsync(struct omap_overlay_manager *mgr) | 44 | static int dss_mgr_wait_for_vsync(struct omap_overlay_manager *mgr) |
40 | { | 45 | { |
41 | unsigned long timeout = msecs_to_jiffies(500); | 46 | unsigned long timeout = msecs_to_jiffies(500); |
47 | struct omap_dss_device *dssdev = mgr->get_device(mgr); | ||
42 | u32 irq; | 48 | u32 irq; |
43 | int r; | 49 | int r; |
44 | 50 | ||
@@ -46,9 +52,9 @@ static int dss_mgr_wait_for_vsync(struct omap_overlay_manager *mgr) | |||
46 | if (r) | 52 | if (r) |
47 | return r; | 53 | return r; |
48 | 54 | ||
49 | if (mgr->device->type == OMAP_DISPLAY_TYPE_VENC) | 55 | if (dssdev->type == OMAP_DISPLAY_TYPE_VENC) |
50 | irq = DISPC_IRQ_EVSYNC_ODD; | 56 | irq = DISPC_IRQ_EVSYNC_ODD; |
51 | else if (mgr->device->type == OMAP_DISPLAY_TYPE_HDMI) | 57 | else if (dssdev->type == OMAP_DISPLAY_TYPE_HDMI) |
52 | irq = DISPC_IRQ_EVSYNC_EVEN; | 58 | irq = DISPC_IRQ_EVSYNC_EVEN; |
53 | else | 59 | else |
54 | irq = dispc_mgr_get_vsync_irq(mgr->id); | 60 | irq = dispc_mgr_get_vsync_irq(mgr->id); |
@@ -102,6 +108,7 @@ int dss_init_overlay_managers(struct platform_device *pdev) | |||
102 | mgr->get_manager_info = &dss_mgr_get_info; | 108 | mgr->get_manager_info = &dss_mgr_get_info; |
103 | mgr->wait_for_go = &dss_mgr_wait_for_go; | 109 | mgr->wait_for_go = &dss_mgr_wait_for_go; |
104 | mgr->wait_for_vsync = &dss_mgr_wait_for_vsync; | 110 | mgr->wait_for_vsync = &dss_mgr_wait_for_vsync; |
111 | mgr->get_device = &dss_mgr_get_device; | ||
105 | 112 | ||
106 | mgr->caps = 0; | 113 | mgr->caps = 0; |
107 | mgr->supported_displays = | 114 | mgr->supported_displays = |
diff --git a/drivers/video/omap2/dss/overlay.c b/drivers/video/omap2/dss/overlay.c index 52455a0609cb..0f799e2d91bb 100644 --- a/drivers/video/omap2/dss/overlay.c +++ b/drivers/video/omap2/dss/overlay.c | |||
@@ -38,6 +38,11 @@ | |||
38 | static int num_overlays; | 38 | static int num_overlays; |
39 | static struct omap_overlay *overlays; | 39 | static struct omap_overlay *overlays; |
40 | 40 | ||
41 | static inline struct omap_dss_device *dss_ovl_get_device(struct omap_overlay *ovl) | ||
42 | { | ||
43 | return ovl->manager ? ovl->manager->device : NULL; | ||
44 | } | ||
45 | |||
41 | int omap_dss_get_num_overlays(void) | 46 | int omap_dss_get_num_overlays(void) |
42 | { | 47 | { |
43 | return num_overlays; | 48 | return num_overlays; |
@@ -94,6 +99,7 @@ void dss_init_overlays(struct platform_device *pdev) | |||
94 | ovl->set_overlay_info = &dss_ovl_set_info; | 99 | ovl->set_overlay_info = &dss_ovl_set_info; |
95 | ovl->get_overlay_info = &dss_ovl_get_info; | 100 | ovl->get_overlay_info = &dss_ovl_get_info; |
96 | ovl->wait_for_go = &dss_mgr_wait_for_go_ovl; | 101 | ovl->wait_for_go = &dss_mgr_wait_for_go_ovl; |
102 | ovl->get_device = &dss_ovl_get_device; | ||
97 | 103 | ||
98 | ovl->caps = dss_feat_get_overlay_caps(ovl->id); | 104 | ovl->caps = dss_feat_get_overlay_caps(ovl->id); |
99 | ovl->supported_modes = | 105 | ovl->supported_modes = |