diff options
author | Archit Taneja <archit@ti.com> | 2012-04-26 15:37:28 -0400 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2012-05-09 06:44:07 -0400 |
commit | b917fa3961448903f4ee823917194bdf20709fbd (patch) | |
tree | f243fc3c8b20b1ea50071e96081e437a99890098 /drivers/video/omap2/dss | |
parent | 4172116385ede7abcfbbcc6eb6b7133385695001 (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.c | 2 | ||||
-rw-r--r-- | drivers/video/omap2/dss/dpi.c | 2 | ||||
-rw-r--r-- | drivers/video/omap2/dss/dss.h | 4 | ||||
-rw-r--r-- | drivers/video/omap2/dss/manager.c | 15 |
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 | ||
2481 | bool dispc_mgr_timings_ok(enum omap_channel channel, | 2481 | bool 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); | |||
208 | void dss_uninit_overlay_managers(struct platform_device *pdev); | 208 | void dss_uninit_overlay_managers(struct platform_device *pdev); |
209 | int dss_mgr_simple_check(struct omap_overlay_manager *mgr, | 209 | int 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); |
211 | int dss_mgr_check_timings(struct omap_overlay_manager *mgr, | ||
212 | const struct omap_video_timings *timings); | ||
211 | int dss_mgr_check(struct omap_overlay_manager *mgr, | 213 | int 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); | |||
413 | void dispc_set_loadmode(enum omap_dss_load_mode mode); | 415 | void dispc_set_loadmode(enum omap_dss_load_mode mode); |
414 | 416 | ||
415 | bool dispc_mgr_timings_ok(enum omap_channel channel, | 417 | bool dispc_mgr_timings_ok(enum omap_channel channel, |
416 | struct omap_video_timings *timings); | 418 | const struct omap_video_timings *timings); |
417 | unsigned long dispc_fclk_rate(void); | 419 | unsigned long dispc_fclk_rate(void); |
418 | void dispc_find_clk_divs(bool is_tft, unsigned long req_pck, unsigned long fck, | 420 | void 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 | ||
657 | int 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 | |||
657 | int dss_mgr_check(struct omap_overlay_manager *mgr, | 668 | int 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; |