aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2012-10-23 06:44:12 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2012-12-07 10:05:54 -0500
commit0c49ff747a4656e24b8990764f5ee4cd047ee982 (patch)
tree06395ab608217183bda7b141db8811300e6b168c /drivers/video
parent23dfd1ac87b56652e618fda24b035505c89c4b8c (diff)
OMAPDSS: move ovl-mgr function setup to apply.c
Most of the functions that are assigned to the fields in ovl-mgr struct are in apply.c. By moving the function pointer setup into apply.c we can make these functions static. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/omap2/dss/apply.c58
-rw-r--r--drivers/video/omap2/dss/dss.h10
-rw-r--r--drivers/video/omap2/dss/manager.c39
3 files changed, 52 insertions, 55 deletions
diff --git a/drivers/video/omap2/dss/apply.c b/drivers/video/omap2/dss/apply.c
index 6f60d0e0b7ee..98cebe30318a 100644
--- a/drivers/video/omap2/dss/apply.c
+++ b/drivers/video/omap2/dss/apply.c
@@ -416,7 +416,37 @@ static void wait_pending_extra_info_updates(void)
416 DSSWARN("timeout in wait_pending_extra_info_updates\n"); 416 DSSWARN("timeout in wait_pending_extra_info_updates\n");
417} 417}
418 418
419int dss_mgr_wait_for_go(struct omap_overlay_manager *mgr) 419static inline struct omap_dss_device *dss_mgr_get_device(struct omap_overlay_manager *mgr)
420{
421 return mgr->output ? mgr->output->device : NULL;
422}
423
424static int dss_mgr_wait_for_vsync(struct omap_overlay_manager *mgr)
425{
426 unsigned long timeout = msecs_to_jiffies(500);
427 struct omap_dss_device *dssdev = mgr->get_device(mgr);
428 u32 irq;
429 int r;
430
431 r = dispc_runtime_get();
432 if (r)
433 return r;
434
435 if (dssdev->type == OMAP_DISPLAY_TYPE_VENC)
436 irq = DISPC_IRQ_EVSYNC_ODD;
437 else if (dssdev->type == OMAP_DISPLAY_TYPE_HDMI)
438 irq = DISPC_IRQ_EVSYNC_EVEN;
439 else
440 irq = dispc_mgr_get_vsync_irq(mgr->id);
441
442 r = omap_dispc_wait_for_irq_interruptible_timeout(irq, timeout);
443
444 dispc_runtime_put();
445
446 return r;
447}
448
449static int dss_mgr_wait_for_go(struct omap_overlay_manager *mgr)
420{ 450{
421 unsigned long timeout = msecs_to_jiffies(500); 451 unsigned long timeout = msecs_to_jiffies(500);
422 struct mgr_priv_data *mp = get_mgr_priv(mgr); 452 struct mgr_priv_data *mp = get_mgr_priv(mgr);
@@ -885,7 +915,7 @@ static void omap_dss_mgr_apply_mgr(struct omap_overlay_manager *mgr)
885 mp->info = mp->user_info; 915 mp->info = mp->user_info;
886} 916}
887 917
888int omap_dss_mgr_apply(struct omap_overlay_manager *mgr) 918static int omap_dss_mgr_apply(struct omap_overlay_manager *mgr)
889{ 919{
890 unsigned long flags; 920 unsigned long flags;
891 struct omap_overlay *ovl; 921 struct omap_overlay *ovl;
@@ -1058,7 +1088,7 @@ out:
1058 mutex_unlock(&apply_lock); 1088 mutex_unlock(&apply_lock);
1059} 1089}
1060 1090
1061int dss_mgr_set_info(struct omap_overlay_manager *mgr, 1091static int dss_mgr_set_info(struct omap_overlay_manager *mgr,
1062 struct omap_overlay_manager_info *info) 1092 struct omap_overlay_manager_info *info)
1063{ 1093{
1064 struct mgr_priv_data *mp = get_mgr_priv(mgr); 1094 struct mgr_priv_data *mp = get_mgr_priv(mgr);
@@ -1079,7 +1109,7 @@ int dss_mgr_set_info(struct omap_overlay_manager *mgr,
1079 return 0; 1109 return 0;
1080} 1110}
1081 1111
1082void dss_mgr_get_info(struct omap_overlay_manager *mgr, 1112static void dss_mgr_get_info(struct omap_overlay_manager *mgr,
1083 struct omap_overlay_manager_info *info) 1113 struct omap_overlay_manager_info *info)
1084{ 1114{
1085 struct mgr_priv_data *mp = get_mgr_priv(mgr); 1115 struct mgr_priv_data *mp = get_mgr_priv(mgr);
@@ -1092,7 +1122,7 @@ void dss_mgr_get_info(struct omap_overlay_manager *mgr,
1092 spin_unlock_irqrestore(&data_lock, flags); 1122 spin_unlock_irqrestore(&data_lock, flags);
1093} 1123}
1094 1124
1095int dss_mgr_set_output(struct omap_overlay_manager *mgr, 1125static int dss_mgr_set_output(struct omap_overlay_manager *mgr,
1096 struct omap_dss_output *output) 1126 struct omap_dss_output *output)
1097{ 1127{
1098 int r; 1128 int r;
@@ -1124,7 +1154,7 @@ err:
1124 return r; 1154 return r;
1125} 1155}
1126 1156
1127int dss_mgr_unset_output(struct omap_overlay_manager *mgr) 1157static int dss_mgr_unset_output(struct omap_overlay_manager *mgr)
1128{ 1158{
1129 int r; 1159 int r;
1130 struct mgr_priv_data *mp = get_mgr_priv(mgr); 1160 struct mgr_priv_data *mp = get_mgr_priv(mgr);
@@ -1470,6 +1500,7 @@ static DEFINE_MUTEX(compat_init_lock);
1470int omapdss_compat_init(void) 1500int omapdss_compat_init(void)
1471{ 1501{
1472 struct platform_device *pdev = dss_get_core_pdev(); 1502 struct platform_device *pdev = dss_get_core_pdev();
1503 int i;
1473 1504
1474 mutex_lock(&compat_init_lock); 1505 mutex_lock(&compat_init_lock);
1475 1506
@@ -1481,6 +1512,21 @@ int omapdss_compat_init(void)
1481 dss_init_overlay_managers(pdev); 1512 dss_init_overlay_managers(pdev);
1482 dss_init_overlays(pdev); 1513 dss_init_overlays(pdev);
1483 1514
1515 for (i = 0; i < omap_dss_get_num_overlay_managers(); i++) {
1516 struct omap_overlay_manager *mgr;
1517
1518 mgr = omap_dss_get_overlay_manager(i);
1519
1520 mgr->set_output = &dss_mgr_set_output;
1521 mgr->unset_output = &dss_mgr_unset_output;
1522 mgr->apply = &omap_dss_mgr_apply;
1523 mgr->set_manager_info = &dss_mgr_set_info;
1524 mgr->get_manager_info = &dss_mgr_get_info;
1525 mgr->wait_for_go = &dss_mgr_wait_for_go;
1526 mgr->wait_for_vsync = &dss_mgr_wait_for_vsync;
1527 mgr->get_device = &dss_mgr_get_device;
1528 }
1529
1484out: 1530out:
1485 mutex_unlock(&compat_init_lock); 1531 mutex_unlock(&compat_init_lock);
1486 1532
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
index 9da3d61b8a56..9e093bc81b5f 100644
--- a/drivers/video/omap2/dss/dss.h
+++ b/drivers/video/omap2/dss/dss.h
@@ -178,20 +178,10 @@ void dss_copy_device_pdata(struct omap_dss_device *dst,
178 const struct omap_dss_device *src); 178 const struct omap_dss_device *src);
179 179
180/* apply */ 180/* apply */
181int dss_mgr_wait_for_go(struct omap_overlay_manager *mgr);
182int dss_mgr_wait_for_go_ovl(struct omap_overlay *ovl); 181int dss_mgr_wait_for_go_ovl(struct omap_overlay *ovl);
183void dss_mgr_start_update(struct omap_overlay_manager *mgr); 182void dss_mgr_start_update(struct omap_overlay_manager *mgr);
184int omap_dss_mgr_apply(struct omap_overlay_manager *mgr);
185
186int dss_mgr_enable(struct omap_overlay_manager *mgr); 183int dss_mgr_enable(struct omap_overlay_manager *mgr);
187void dss_mgr_disable(struct omap_overlay_manager *mgr); 184void dss_mgr_disable(struct omap_overlay_manager *mgr);
188int dss_mgr_set_info(struct omap_overlay_manager *mgr,
189 struct omap_overlay_manager_info *info);
190void dss_mgr_get_info(struct omap_overlay_manager *mgr,
191 struct omap_overlay_manager_info *info);
192int dss_mgr_set_output(struct omap_overlay_manager *mgr,
193 struct omap_dss_output *output);
194int dss_mgr_unset_output(struct omap_overlay_manager *mgr);
195void dss_mgr_set_timings(struct omap_overlay_manager *mgr, 185void dss_mgr_set_timings(struct omap_overlay_manager *mgr,
196 const struct omap_video_timings *timings); 186 const struct omap_video_timings *timings);
197void dss_mgr_set_lcd_config(struct omap_overlay_manager *mgr, 187void dss_mgr_set_lcd_config(struct omap_overlay_manager *mgr,
diff --git a/drivers/video/omap2/dss/manager.c b/drivers/video/omap2/dss/manager.c
index c54d2f620ce3..2551eaa14c42 100644
--- a/drivers/video/omap2/dss/manager.c
+++ b/drivers/video/omap2/dss/manager.c
@@ -36,36 +36,6 @@
36static int num_managers; 36static int num_managers;
37static struct omap_overlay_manager *managers; 37static struct omap_overlay_manager *managers;
38 38
39static inline struct omap_dss_device *dss_mgr_get_device(struct omap_overlay_manager *mgr)
40{
41 return mgr->output ? mgr->output->device : NULL;
42}
43
44static int dss_mgr_wait_for_vsync(struct omap_overlay_manager *mgr)
45{
46 unsigned long timeout = msecs_to_jiffies(500);
47 struct omap_dss_device *dssdev = mgr->get_device(mgr);
48 u32 irq;
49 int r;
50
51 r = dispc_runtime_get();
52 if (r)
53 return r;
54
55 if (dssdev->type == OMAP_DISPLAY_TYPE_VENC)
56 irq = DISPC_IRQ_EVSYNC_ODD;
57 else if (dssdev->type == OMAP_DISPLAY_TYPE_HDMI)
58 irq = DISPC_IRQ_EVSYNC_EVEN;
59 else
60 irq = dispc_mgr_get_vsync_irq(mgr->id);
61
62 r = omap_dispc_wait_for_irq_interruptible_timeout(irq, timeout);
63
64 dispc_runtime_put();
65
66 return r;
67}
68
69int dss_init_overlay_managers(struct platform_device *pdev) 39int dss_init_overlay_managers(struct platform_device *pdev)
70{ 40{
71 int i, r; 41 int i, r;
@@ -99,15 +69,6 @@ int dss_init_overlay_managers(struct platform_device *pdev)
99 break; 69 break;
100 } 70 }
101 71
102 mgr->set_output = &dss_mgr_set_output;
103 mgr->unset_output = &dss_mgr_unset_output;
104 mgr->apply = &omap_dss_mgr_apply;
105 mgr->set_manager_info = &dss_mgr_set_info;
106 mgr->get_manager_info = &dss_mgr_get_info;
107 mgr->wait_for_go = &dss_mgr_wait_for_go;
108 mgr->wait_for_vsync = &dss_mgr_wait_for_vsync;
109 mgr->get_device = &dss_mgr_get_device;
110
111 mgr->caps = 0; 72 mgr->caps = 0;
112 mgr->supported_displays = 73 mgr->supported_displays =
113 dss_feat_get_supported_displays(mgr->id); 74 dss_feat_get_supported_displays(mgr->id);