提交 0c6921de 编写于 作者: T Tomi Valkeinen

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: NTomi Valkeinen <tomi.valkeinen@ti.com>
上级 465ec13f
...@@ -91,7 +91,7 @@ struct dispc_features { ...@@ -91,7 +91,7 @@ struct dispc_features {
u8 mgr_height_start; u8 mgr_height_start;
u16 mgr_width_max; u16 mgr_width_max;
u16 mgr_height_max; u16 mgr_height_max;
int (*calc_scaling) (enum omap_plane plane, int (*calc_scaling) (unsigned long pclk, unsigned long lclk,
const struct omap_video_timings *mgr_timings, const struct omap_video_timings *mgr_timings,
u16 width, u16 height, u16 out_width, u16 out_height, u16 width, u16 height, u16 out_width, u16 out_height,
enum omap_color_mode color_mode, bool *five_taps, 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,7 +2135,7 @@ static unsigned long calc_core_clk_44xx(unsigned long pclk, u16 width,
return pclk; return pclk;
} }
static int dispc_ovl_calc_scaling_24xx(enum omap_plane plane, static int dispc_ovl_calc_scaling_24xx(unsigned long pclk, unsigned long lclk,
const struct omap_video_timings *mgr_timings, const struct omap_video_timings *mgr_timings,
u16 width, u16 height, u16 out_width, u16 out_height, u16 width, u16 height, u16 out_width, u16 out_height,
enum omap_color_mode color_mode, bool *five_taps, 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,7 +2147,6 @@ static int dispc_ovl_calc_scaling_24xx(enum omap_plane plane,
int min_factor = min(*decim_x, *decim_y); int min_factor = min(*decim_x, *decim_y);
const int maxsinglelinewidth = const int maxsinglelinewidth =
dss_feat_get_param_max(FEAT_PARAM_LINEWIDTH); dss_feat_get_param_max(FEAT_PARAM_LINEWIDTH);
unsigned long pclk = dispc_plane_pclk_rate(plane);
*five_taps = false; *five_taps = false;
...@@ -2177,7 +2176,7 @@ static int dispc_ovl_calc_scaling_24xx(enum omap_plane plane, ...@@ -2177,7 +2176,7 @@ static int dispc_ovl_calc_scaling_24xx(enum omap_plane plane,
return 0; return 0;
} }
static int dispc_ovl_calc_scaling_34xx(enum omap_plane plane, static int dispc_ovl_calc_scaling_34xx(unsigned long pclk, unsigned long lclk,
const struct omap_video_timings *mgr_timings, const struct omap_video_timings *mgr_timings,
u16 width, u16 height, u16 out_width, u16 out_height, u16 width, u16 height, u16 out_width, u16 out_height,
enum omap_color_mode color_mode, bool *five_taps, 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,8 +2188,6 @@ static int dispc_ovl_calc_scaling_34xx(enum omap_plane plane,
int min_factor = min(*decim_x, *decim_y); int min_factor = min(*decim_x, *decim_y);
const int maxsinglelinewidth = const int maxsinglelinewidth =
dss_feat_get_param_max(FEAT_PARAM_LINEWIDTH); dss_feat_get_param_max(FEAT_PARAM_LINEWIDTH);
unsigned long pclk = dispc_plane_pclk_rate(plane);
unsigned long lclk = dispc_plane_lclk_rate(plane);
do { do {
in_height = DIV_ROUND_UP(height, *decim_y); in_height = DIV_ROUND_UP(height, *decim_y);
...@@ -2245,7 +2242,7 @@ static int dispc_ovl_calc_scaling_34xx(enum omap_plane plane, ...@@ -2245,7 +2242,7 @@ static int dispc_ovl_calc_scaling_34xx(enum omap_plane plane,
return 0; return 0;
} }
static int dispc_ovl_calc_scaling_44xx(enum omap_plane plane, static int dispc_ovl_calc_scaling_44xx(unsigned long pclk, unsigned long lclk,
const struct omap_video_timings *mgr_timings, const struct omap_video_timings *mgr_timings,
u16 width, u16 height, u16 out_width, u16 out_height, u16 width, u16 height, u16 out_width, u16 out_height,
enum omap_color_mode color_mode, bool *five_taps, 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,7 +2255,6 @@ static int dispc_ovl_calc_scaling_44xx(enum omap_plane plane,
const int maxsinglelinewidth = const int maxsinglelinewidth =
dss_feat_get_param_max(FEAT_PARAM_LINEWIDTH); dss_feat_get_param_max(FEAT_PARAM_LINEWIDTH);
const int maxdownscale = dss_feat_get_param_max(FEAT_PARAM_DOWNSCALE); const int maxdownscale = dss_feat_get_param_max(FEAT_PARAM_DOWNSCALE);
unsigned long pclk = dispc_plane_pclk_rate(plane);
if (mem_to_mem) { if (mem_to_mem) {
in_width_max = out_width * maxdownscale; in_width_max = out_width * maxdownscale;
...@@ -2300,6 +2296,8 @@ static int dispc_ovl_calc_scaling(enum omap_plane plane, ...@@ -2300,6 +2296,8 @@ static int dispc_ovl_calc_scaling(enum omap_plane plane,
const int max_decim_limit = 16; const int max_decim_limit = 16;
unsigned long core_clk = 0; unsigned long core_clk = 0;
int decim_x, decim_y, ret; int decim_x, decim_y, ret;
unsigned long pclk = dispc_plane_pclk_rate(plane);
unsigned long lclk = dispc_plane_lclk_rate(plane);
if (width == out_width && height == out_height) if (width == out_width && height == out_height)
return 0; return 0;
...@@ -2335,7 +2333,7 @@ static int dispc_ovl_calc_scaling(enum omap_plane plane, ...@@ -2335,7 +2333,7 @@ static int dispc_ovl_calc_scaling(enum omap_plane plane,
if (decim_y > *y_predecim || out_height > height * 8) if (decim_y > *y_predecim || out_height > height * 8)
return -EINVAL; return -EINVAL;
ret = dispc.feat->calc_scaling(plane, mgr_timings, width, height, ret = dispc.feat->calc_scaling(pclk, lclk, mgr_timings, width, height,
out_width, out_height, color_mode, five_taps, out_width, out_height, color_mode, five_taps,
x_predecim, y_predecim, &decim_x, &decim_y, pos_x, &core_clk, x_predecim, y_predecim, &decim_x, &decim_y, pos_x, &core_clk,
mem_to_mem); mem_to_mem);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册