diff options
author | Archit Taneja <archit@ti.com> | 2013-03-26 09:45:22 -0400 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2013-04-10 08:02:52 -0400 |
commit | ca5ca69cab83f9efc301ba0b44dc4f71bb167050 (patch) | |
tree | 2d867a4aa8029380636ce140a326f6bc9a771744 /drivers | |
parent | 5303b3aa77a175a6a312aee6867e740ad1809171 (diff) |
omapdss: DISPC: add max pixel clock limits for LCD and TV managers
Each version of OMAP has a limitation on the maximum pixel clock frequency
supported by an overlay manager. This limit isn't checked by omapdss. Add
dispc feats for lcd and tv managers and check whether the target timings can
be supported or not.
The pixel clock limitations are actually more complex. They depend on which OPP
OMAP is in, and they also depend on which encoder is the manager connected to.
The OPP dependence is ignored as DSS forces the PM framework to be on OPP100
when DSS is enabled, and the encoder dependencies are ignored by DISPC for now.
These limits should come from the encoder driver.
The OMAP2 TRM doesn't mention the maximum pixel clock limit. This value is left
as half of DSS_FCLK, as OMAP2 requires the PCD to be atleast 2.
Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/video/omap2/dss/dispc.c | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c index 05ff2b91d9e8..a375de3126e5 100644 --- a/drivers/video/omap2/dss/dispc.c +++ b/drivers/video/omap2/dss/dispc.c | |||
@@ -69,6 +69,8 @@ struct dispc_features { | |||
69 | u8 mgr_height_start; | 69 | u8 mgr_height_start; |
70 | u16 mgr_width_max; | 70 | u16 mgr_width_max; |
71 | u16 mgr_height_max; | 71 | u16 mgr_height_max; |
72 | unsigned long max_lcd_pclk; | ||
73 | unsigned long max_tv_pclk; | ||
72 | int (*calc_scaling) (unsigned long pclk, unsigned long lclk, | 74 | int (*calc_scaling) (unsigned long pclk, unsigned long lclk, |
73 | const struct omap_video_timings *mgr_timings, | 75 | const struct omap_video_timings *mgr_timings, |
74 | u16 width, u16 height, u16 out_width, u16 out_height, | 76 | u16 width, u16 height, u16 out_width, u16 out_height, |
@@ -2823,6 +2825,15 @@ static bool _dispc_lcd_timings_ok(int hsw, int hfp, int hbp, | |||
2823 | return true; | 2825 | return true; |
2824 | } | 2826 | } |
2825 | 2827 | ||
2828 | static bool _dispc_mgr_pclk_ok(enum omap_channel channel, | ||
2829 | unsigned long pclk) | ||
2830 | { | ||
2831 | if (dss_mgr_is_lcd(channel)) | ||
2832 | return pclk <= dispc.feat->max_lcd_pclk ? true : false; | ||
2833 | else | ||
2834 | return pclk <= dispc.feat->max_tv_pclk ? true : false; | ||
2835 | } | ||
2836 | |||
2826 | bool dispc_mgr_timings_ok(enum omap_channel channel, | 2837 | bool dispc_mgr_timings_ok(enum omap_channel channel, |
2827 | const struct omap_video_timings *timings) | 2838 | const struct omap_video_timings *timings) |
2828 | { | 2839 | { |
@@ -2830,11 +2841,13 @@ bool dispc_mgr_timings_ok(enum omap_channel channel, | |||
2830 | 2841 | ||
2831 | timings_ok = _dispc_mgr_size_ok(timings->x_res, timings->y_res); | 2842 | timings_ok = _dispc_mgr_size_ok(timings->x_res, timings->y_res); |
2832 | 2843 | ||
2833 | if (dss_mgr_is_lcd(channel)) | 2844 | timings_ok &= _dispc_mgr_pclk_ok(channel, timings->pixel_clock * 1000); |
2834 | timings_ok = timings_ok && _dispc_lcd_timings_ok(timings->hsw, | 2845 | |
2835 | timings->hfp, timings->hbp, | 2846 | if (dss_mgr_is_lcd(channel)) { |
2836 | timings->vsw, timings->vfp, | 2847 | timings_ok &= _dispc_lcd_timings_ok(timings->hsw, timings->hfp, |
2837 | timings->vbp); | 2848 | timings->hbp, timings->vsw, timings->vfp, |
2849 | timings->vbp); | ||
2850 | } | ||
2838 | 2851 | ||
2839 | return timings_ok; | 2852 | return timings_ok; |
2840 | } | 2853 | } |
@@ -3479,6 +3492,7 @@ static const struct dispc_features omap24xx_dispc_feats __initconst = { | |||
3479 | .mgr_height_start = 26, | 3492 | .mgr_height_start = 26, |
3480 | .mgr_width_max = 2048, | 3493 | .mgr_width_max = 2048, |
3481 | .mgr_height_max = 2048, | 3494 | .mgr_height_max = 2048, |
3495 | .max_lcd_pclk = 66500000, | ||
3482 | .calc_scaling = dispc_ovl_calc_scaling_24xx, | 3496 | .calc_scaling = dispc_ovl_calc_scaling_24xx, |
3483 | .calc_core_clk = calc_core_clk_24xx, | 3497 | .calc_core_clk = calc_core_clk_24xx, |
3484 | .num_fifos = 3, | 3498 | .num_fifos = 3, |
@@ -3496,6 +3510,8 @@ static const struct dispc_features omap34xx_rev1_0_dispc_feats __initconst = { | |||
3496 | .mgr_height_start = 26, | 3510 | .mgr_height_start = 26, |
3497 | .mgr_width_max = 2048, | 3511 | .mgr_width_max = 2048, |
3498 | .mgr_height_max = 2048, | 3512 | .mgr_height_max = 2048, |
3513 | .max_lcd_pclk = 173000000, | ||
3514 | .max_tv_pclk = 59000000, | ||
3499 | .calc_scaling = dispc_ovl_calc_scaling_34xx, | 3515 | .calc_scaling = dispc_ovl_calc_scaling_34xx, |
3500 | .calc_core_clk = calc_core_clk_34xx, | 3516 | .calc_core_clk = calc_core_clk_34xx, |
3501 | .num_fifos = 3, | 3517 | .num_fifos = 3, |
@@ -3513,6 +3529,8 @@ static const struct dispc_features omap34xx_rev3_0_dispc_feats __initconst = { | |||
3513 | .mgr_height_start = 26, | 3529 | .mgr_height_start = 26, |
3514 | .mgr_width_max = 2048, | 3530 | .mgr_width_max = 2048, |
3515 | .mgr_height_max = 2048, | 3531 | .mgr_height_max = 2048, |
3532 | .max_lcd_pclk = 173000000, | ||
3533 | .max_tv_pclk = 59000000, | ||
3516 | .calc_scaling = dispc_ovl_calc_scaling_34xx, | 3534 | .calc_scaling = dispc_ovl_calc_scaling_34xx, |
3517 | .calc_core_clk = calc_core_clk_34xx, | 3535 | .calc_core_clk = calc_core_clk_34xx, |
3518 | .num_fifos = 3, | 3536 | .num_fifos = 3, |
@@ -3530,6 +3548,8 @@ static const struct dispc_features omap44xx_dispc_feats __initconst = { | |||
3530 | .mgr_height_start = 26, | 3548 | .mgr_height_start = 26, |
3531 | .mgr_width_max = 2048, | 3549 | .mgr_width_max = 2048, |
3532 | .mgr_height_max = 2048, | 3550 | .mgr_height_max = 2048, |
3551 | .max_lcd_pclk = 170000000, | ||
3552 | .max_tv_pclk = 185625000, | ||
3533 | .calc_scaling = dispc_ovl_calc_scaling_44xx, | 3553 | .calc_scaling = dispc_ovl_calc_scaling_44xx, |
3534 | .calc_core_clk = calc_core_clk_44xx, | 3554 | .calc_core_clk = calc_core_clk_44xx, |
3535 | .num_fifos = 5, | 3555 | .num_fifos = 5, |
@@ -3547,6 +3567,8 @@ static const struct dispc_features omap54xx_dispc_feats __initconst = { | |||
3547 | .mgr_height_start = 27, | 3567 | .mgr_height_start = 27, |
3548 | .mgr_width_max = 4096, | 3568 | .mgr_width_max = 4096, |
3549 | .mgr_height_max = 4096, | 3569 | .mgr_height_max = 4096, |
3570 | .max_lcd_pclk = 170000000, | ||
3571 | .max_tv_pclk = 186000000, | ||
3550 | .calc_scaling = dispc_ovl_calc_scaling_44xx, | 3572 | .calc_scaling = dispc_ovl_calc_scaling_44xx, |
3551 | .calc_core_clk = calc_core_clk_44xx, | 3573 | .calc_core_clk = calc_core_clk_44xx, |
3552 | .num_fifos = 5, | 3574 | .num_fifos = 5, |