aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2012-10-19 08:40:24 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2012-11-27 05:27:02 -0500
commit465ec13f600f1cba4def9540a450c9263c93cf8c (patch)
tree61d3f8f7d77a4ca3c6740a2d9a62a41217ce5bac
parent8702ee50645ea2046bf91838bc615dffc8644fba (diff)
OMAPDSS: DISPC: pass pclk & lclk to check_horiz_timing_omap3
In order to make the scaling calculations independent of the current hardware configuration (e.g. which manager is connected to this output), we need to change the calc funcs to get all the variables needed for the calculations via parameters. This patch changes check_horiz_timing_omap3() to get pclk and lclk as parameters. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
-rw-r--r--drivers/video/omap2/dss/dispc.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index 1704077b1f06..f274a77684ba 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -1995,7 +1995,7 @@ static void calc_tiler_rotation_offset(u16 screen_width, u16 width,
1995 * This function is used to avoid synclosts in OMAP3, because of some 1995 * This function is used to avoid synclosts in OMAP3, because of some
1996 * undocumented horizontal position and timing related limitations. 1996 * undocumented horizontal position and timing related limitations.
1997 */ 1997 */
1998static int check_horiz_timing_omap3(enum omap_plane plane, 1998static int check_horiz_timing_omap3(unsigned long pclk, unsigned long lclk,
1999 const struct omap_video_timings *t, u16 pos_x, 1999 const struct omap_video_timings *t, u16 pos_x,
2000 u16 width, u16 height, u16 out_width, u16 out_height) 2000 u16 width, u16 height, u16 out_width, u16 out_height)
2001{ 2001{
@@ -2003,8 +2003,6 @@ static int check_horiz_timing_omap3(enum omap_plane plane,
2003 unsigned long nonactive; 2003 unsigned long nonactive;
2004 static const u8 limits[3] = { 8, 10, 20 }; 2004 static const u8 limits[3] = { 8, 10, 20 };
2005 u64 val, blank; 2005 u64 val, blank;
2006 unsigned long pclk = dispc_plane_pclk_rate(plane);
2007 unsigned long lclk = dispc_plane_lclk_rate(plane);
2008 int i; 2006 int i;
2009 2007
2010 nonactive = t->x_res + t->hfp + t->hsw + t->hbp - out_width; 2008 nonactive = t->x_res + t->hfp + t->hsw + t->hbp - out_width;
@@ -2192,6 +2190,7 @@ static int dispc_ovl_calc_scaling_34xx(enum omap_plane plane,
2192 const int maxsinglelinewidth = 2190 const int maxsinglelinewidth =
2193 dss_feat_get_param_max(FEAT_PARAM_LINEWIDTH); 2191 dss_feat_get_param_max(FEAT_PARAM_LINEWIDTH);
2194 unsigned long pclk = dispc_plane_pclk_rate(plane); 2192 unsigned long pclk = dispc_plane_pclk_rate(plane);
2193 unsigned long lclk = dispc_plane_lclk_rate(plane);
2195 2194
2196 do { 2195 do {
2197 in_height = DIV_ROUND_UP(height, *decim_y); 2196 in_height = DIV_ROUND_UP(height, *decim_y);
@@ -2199,7 +2198,7 @@ static int dispc_ovl_calc_scaling_34xx(enum omap_plane plane,
2199 *core_clk = calc_core_clk_five_taps(pclk, mgr_timings, 2198 *core_clk = calc_core_clk_five_taps(pclk, mgr_timings,
2200 in_width, in_height, out_width, out_height, color_mode); 2199 in_width, in_height, out_width, out_height, color_mode);
2201 2200
2202 error = check_horiz_timing_omap3(plane, mgr_timings, 2201 error = check_horiz_timing_omap3(pclk, lclk, mgr_timings,
2203 pos_x, in_width, in_height, out_width, 2202 pos_x, in_width, in_height, out_width,
2204 out_height); 2203 out_height);
2205 2204
@@ -2227,8 +2226,8 @@ static int dispc_ovl_calc_scaling_34xx(enum omap_plane plane,
2227 } 2226 }
2228 } while (*decim_x <= *x_predecim && *decim_y <= *y_predecim && error); 2227 } while (*decim_x <= *x_predecim && *decim_y <= *y_predecim && error);
2229 2228
2230 if (check_horiz_timing_omap3(plane, mgr_timings, pos_x, width, height, 2229 if (check_horiz_timing_omap3(pclk, lclk, mgr_timings, pos_x, width,
2231 out_width, out_height)){ 2230 height, out_width, out_height)){
2232 DSSERR("horizontal timing too tight\n"); 2231 DSSERR("horizontal timing too tight\n");
2233 return -EINVAL; 2232 return -EINVAL;
2234 } 2233 }