aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2012-10-19 08:43:29 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2012-11-27 05:47:24 -0500
commit0c6921de3710465ca35179b6e327e8b67b9ffaf7 (patch)
tree66695505f0763bb7f081156445ccf3b395338187 /drivers/video
parent465ec13f600f1cba4def9540a450c9263c93cf8c (diff)
OMAPDSS: DISPC: pass pclk & lclk to calc_scaling
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 calc_scaling to get pclk and lclk as parameters. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/omap2/dss/dispc.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index f274a77684ba..7bcc5f0d56eb 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -91,7 +91,7 @@ struct dispc_features {
91 u8 mgr_height_start; 91 u8 mgr_height_start;
92 u16 mgr_width_max; 92 u16 mgr_width_max;
93 u16 mgr_height_max; 93 u16 mgr_height_max;
94 int (*calc_scaling) (enum omap_plane plane, 94 int (*calc_scaling) (unsigned long pclk, unsigned long lclk,
95 const struct omap_video_timings *mgr_timings, 95 const struct omap_video_timings *mgr_timings,
96 u16 width, u16 height, u16 out_width, u16 out_height, 96 u16 width, u16 height, u16 out_width, u16 out_height,
97 enum omap_color_mode color_mode, bool *five_taps, 97 enum omap_color_mode color_mode, bool *five_taps,
@@ -2135,7 +2135,7 @@ static unsigned long calc_core_clk_44xx(unsigned long pclk, u16 width,
2135 return pclk; 2135 return pclk;
2136} 2136}
2137 2137
2138static int dispc_ovl_calc_scaling_24xx(enum omap_plane plane, 2138static int dispc_ovl_calc_scaling_24xx(unsigned long pclk, unsigned long lclk,
2139 const struct omap_video_timings *mgr_timings, 2139 const struct omap_video_timings *mgr_timings,
2140 u16 width, u16 height, u16 out_width, u16 out_height, 2140 u16 width, u16 height, u16 out_width, u16 out_height,
2141 enum omap_color_mode color_mode, bool *five_taps, 2141 enum omap_color_mode color_mode, bool *five_taps,
@@ -2147,7 +2147,6 @@ static int dispc_ovl_calc_scaling_24xx(enum omap_plane plane,
2147 int min_factor = min(*decim_x, *decim_y); 2147 int min_factor = min(*decim_x, *decim_y);
2148 const int maxsinglelinewidth = 2148 const int maxsinglelinewidth =
2149 dss_feat_get_param_max(FEAT_PARAM_LINEWIDTH); 2149 dss_feat_get_param_max(FEAT_PARAM_LINEWIDTH);
2150 unsigned long pclk = dispc_plane_pclk_rate(plane);
2151 2150
2152 *five_taps = false; 2151 *five_taps = false;
2153 2152
@@ -2177,7 +2176,7 @@ static int dispc_ovl_calc_scaling_24xx(enum omap_plane plane,
2177 return 0; 2176 return 0;
2178} 2177}
2179 2178
2180static int dispc_ovl_calc_scaling_34xx(enum omap_plane plane, 2179static int dispc_ovl_calc_scaling_34xx(unsigned long pclk, unsigned long lclk,
2181 const struct omap_video_timings *mgr_timings, 2180 const struct omap_video_timings *mgr_timings,
2182 u16 width, u16 height, u16 out_width, u16 out_height, 2181 u16 width, u16 height, u16 out_width, u16 out_height,
2183 enum omap_color_mode color_mode, bool *five_taps, 2182 enum omap_color_mode color_mode, bool *five_taps,
@@ -2189,8 +2188,6 @@ static int dispc_ovl_calc_scaling_34xx(enum omap_plane plane,
2189 int min_factor = min(*decim_x, *decim_y); 2188 int min_factor = min(*decim_x, *decim_y);
2190 const int maxsinglelinewidth = 2189 const int maxsinglelinewidth =
2191 dss_feat_get_param_max(FEAT_PARAM_LINEWIDTH); 2190 dss_feat_get_param_max(FEAT_PARAM_LINEWIDTH);
2192 unsigned long pclk = dispc_plane_pclk_rate(plane);
2193 unsigned long lclk = dispc_plane_lclk_rate(plane);
2194 2191
2195 do { 2192 do {
2196 in_height = DIV_ROUND_UP(height, *decim_y); 2193 in_height = DIV_ROUND_UP(height, *decim_y);
@@ -2245,7 +2242,7 @@ static int dispc_ovl_calc_scaling_34xx(enum omap_plane plane,
2245 return 0; 2242 return 0;
2246} 2243}
2247 2244
2248static int dispc_ovl_calc_scaling_44xx(enum omap_plane plane, 2245static int dispc_ovl_calc_scaling_44xx(unsigned long pclk, unsigned long lclk,
2249 const struct omap_video_timings *mgr_timings, 2246 const struct omap_video_timings *mgr_timings,
2250 u16 width, u16 height, u16 out_width, u16 out_height, 2247 u16 width, u16 height, u16 out_width, u16 out_height,
2251 enum omap_color_mode color_mode, bool *five_taps, 2248 enum omap_color_mode color_mode, bool *five_taps,
@@ -2258,7 +2255,6 @@ static int dispc_ovl_calc_scaling_44xx(enum omap_plane plane,
2258 const int maxsinglelinewidth = 2255 const int maxsinglelinewidth =
2259 dss_feat_get_param_max(FEAT_PARAM_LINEWIDTH); 2256 dss_feat_get_param_max(FEAT_PARAM_LINEWIDTH);
2260 const int maxdownscale = dss_feat_get_param_max(FEAT_PARAM_DOWNSCALE); 2257 const int maxdownscale = dss_feat_get_param_max(FEAT_PARAM_DOWNSCALE);
2261 unsigned long pclk = dispc_plane_pclk_rate(plane);
2262 2258
2263 if (mem_to_mem) { 2259 if (mem_to_mem) {
2264 in_width_max = out_width * maxdownscale; 2260 in_width_max = out_width * maxdownscale;
@@ -2300,6 +2296,8 @@ static int dispc_ovl_calc_scaling(enum omap_plane plane,
2300 const int max_decim_limit = 16; 2296 const int max_decim_limit = 16;
2301 unsigned long core_clk = 0; 2297 unsigned long core_clk = 0;
2302 int decim_x, decim_y, ret; 2298 int decim_x, decim_y, ret;
2299 unsigned long pclk = dispc_plane_pclk_rate(plane);
2300 unsigned long lclk = dispc_plane_lclk_rate(plane);
2303 2301
2304 if (width == out_width && height == out_height) 2302 if (width == out_width && height == out_height)
2305 return 0; 2303 return 0;
@@ -2335,7 +2333,7 @@ static int dispc_ovl_calc_scaling(enum omap_plane plane,
2335 if (decim_y > *y_predecim || out_height > height * 8) 2333 if (decim_y > *y_predecim || out_height > height * 8)
2336 return -EINVAL; 2334 return -EINVAL;
2337 2335
2338 ret = dispc.feat->calc_scaling(plane, mgr_timings, width, height, 2336 ret = dispc.feat->calc_scaling(pclk, lclk, mgr_timings, width, height,
2339 out_width, out_height, color_mode, five_taps, 2337 out_width, out_height, color_mode, five_taps,
2340 x_predecim, y_predecim, &decim_x, &decim_y, pos_x, &core_clk, 2338 x_predecim, y_predecim, &decim_x, &decim_y, pos_x, &core_clk,
2341 mem_to_mem); 2339 mem_to_mem);