aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2/dss
diff options
context:
space:
mode:
authorArchit Taneja <archit@ti.com>2012-04-26 15:37:28 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2012-05-09 06:44:07 -0400
commitb917fa3961448903f4ee823917194bdf20709fbd (patch)
treef243fc3c8b20b1ea50071e96081e437a99890098 /drivers/video/omap2/dss
parent4172116385ede7abcfbbcc6eb6b7133385695001 (diff)
OMAPDSS: MANAGER: Create a function to check manager timings
Create a function dss_mgr_check_timings() which wraps around the function dispc_mgr_timings_ok(). This is mainly a clean up to hide dispc functions from interface drivers. dss_mgr_check_timings() is added in the function dss_mgr_check(), it currently takes the timings maintained in the omap_dss_device struct. This would be later replaced by the timings stored in the manager's private data. Make dss_mgr_check_timings() and dispc_mgr_timings_ok() take a const omap_video_timings pointer since these functions just check the timings. Signed-off-by: Archit Taneja <archit@ti.com>
Diffstat (limited to 'drivers/video/omap2/dss')
-rw-r--r--drivers/video/omap2/dss/dispc.c2
-rw-r--r--drivers/video/omap2/dss/dpi.c2
-rw-r--r--drivers/video/omap2/dss/dss.h4
-rw-r--r--drivers/video/omap2/dss/manager.c15
4 files changed, 20 insertions, 3 deletions
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index 82012d15884b..6eec08400094 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -2479,7 +2479,7 @@ static bool _dispc_lcd_timings_ok(int hsw, int hfp, int hbp,
2479} 2479}
2480 2480
2481bool dispc_mgr_timings_ok(enum omap_channel channel, 2481bool dispc_mgr_timings_ok(enum omap_channel channel,
2482 struct omap_video_timings *timings) 2482 const struct omap_video_timings *timings)
2483{ 2483{
2484 bool timings_ok; 2484 bool timings_ok;
2485 2485
diff --git a/drivers/video/omap2/dss/dpi.c b/drivers/video/omap2/dss/dpi.c
index e65cf1f9a694..e01ab9825930 100644
--- a/drivers/video/omap2/dss/dpi.c
+++ b/drivers/video/omap2/dss/dpi.c
@@ -311,7 +311,7 @@ int dpi_check_timings(struct omap_dss_device *dssdev,
311 unsigned long pck; 311 unsigned long pck;
312 struct dispc_clock_info dispc_cinfo; 312 struct dispc_clock_info dispc_cinfo;
313 313
314 if (!dispc_mgr_timings_ok(dssdev->manager->id, timings)) 314 if (dss_mgr_check_timings(dssdev->manager, timings))
315 return -EINVAL; 315 return -EINVAL;
316 316
317 if (timings->pixel_clock == 0) 317 if (timings->pixel_clock == 0)
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
index b17a2120dc25..a13b3055a447 100644
--- a/drivers/video/omap2/dss/dss.h
+++ b/drivers/video/omap2/dss/dss.h
@@ -208,6 +208,8 @@ int dss_init_overlay_managers(struct platform_device *pdev);
208void dss_uninit_overlay_managers(struct platform_device *pdev); 208void dss_uninit_overlay_managers(struct platform_device *pdev);
209int dss_mgr_simple_check(struct omap_overlay_manager *mgr, 209int dss_mgr_simple_check(struct omap_overlay_manager *mgr,
210 const struct omap_overlay_manager_info *info); 210 const struct omap_overlay_manager_info *info);
211int dss_mgr_check_timings(struct omap_overlay_manager *mgr,
212 const struct omap_video_timings *timings);
211int dss_mgr_check(struct omap_overlay_manager *mgr, 213int dss_mgr_check(struct omap_overlay_manager *mgr,
212 struct omap_dss_device *dssdev, 214 struct omap_dss_device *dssdev,
213 struct omap_overlay_manager_info *info, 215 struct omap_overlay_manager_info *info,
@@ -413,7 +415,7 @@ void dispc_enable_gamma_table(bool enable);
413void dispc_set_loadmode(enum omap_dss_load_mode mode); 415void dispc_set_loadmode(enum omap_dss_load_mode mode);
414 416
415bool dispc_mgr_timings_ok(enum omap_channel channel, 417bool dispc_mgr_timings_ok(enum omap_channel channel,
416 struct omap_video_timings *timings); 418 const struct omap_video_timings *timings);
417unsigned long dispc_fclk_rate(void); 419unsigned long dispc_fclk_rate(void);
418void dispc_find_clk_divs(bool is_tft, unsigned long req_pck, unsigned long fck, 420void dispc_find_clk_divs(bool is_tft, unsigned long req_pck, unsigned long fck,
419 struct dispc_clock_info *cinfo); 421 struct dispc_clock_info *cinfo);
diff --git a/drivers/video/omap2/dss/manager.c b/drivers/video/omap2/dss/manager.c
index e7364603f6a1..566fbba16774 100644
--- a/drivers/video/omap2/dss/manager.c
+++ b/drivers/video/omap2/dss/manager.c
@@ -654,6 +654,17 @@ static int dss_mgr_check_zorder(struct omap_overlay_manager *mgr,
654 return 0; 654 return 0;
655} 655}
656 656
657int dss_mgr_check_timings(struct omap_overlay_manager *mgr,
658 const struct omap_video_timings *timings)
659{
660 if (!dispc_mgr_timings_ok(mgr->id, timings)) {
661 DSSERR("check_manager: invalid timings\n");
662 return -EINVAL;
663 }
664
665 return 0;
666}
667
657int dss_mgr_check(struct omap_overlay_manager *mgr, 668int dss_mgr_check(struct omap_overlay_manager *mgr,
658 struct omap_dss_device *dssdev, 669 struct omap_dss_device *dssdev,
659 struct omap_overlay_manager_info *info, 670 struct omap_overlay_manager_info *info,
@@ -668,6 +679,10 @@ int dss_mgr_check(struct omap_overlay_manager *mgr,
668 return r; 679 return r;
669 } 680 }
670 681
682 r = dss_mgr_check_timings(mgr, &dssdev->panel.timings);
683 if (r)
684 return r;
685
671 list_for_each_entry(ovl, &mgr->overlays, list) { 686 list_for_each_entry(ovl, &mgr->overlays, list) {
672 struct omap_overlay_info *oi; 687 struct omap_overlay_info *oi;
673 int r; 688 int r;