Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 344662
b: refs/heads/master
c: 8702ee5
h: refs/heads/master
v: v3
  • Loading branch information
Tomi Valkeinen committed Nov 27, 2012
1 parent 699d085 commit 64b1856
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 20 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 251886d8bc6f565c14acb34b12c007b994c2e56d
refs/heads/master: 8702ee50645ea2046bf91838bc615dffc8644fba
31 changes: 12 additions & 19 deletions trunk/drivers/video/omap2/dss/dispc.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ struct dispc_features {
enum omap_color_mode color_mode, bool *five_taps,
int *x_predecim, int *y_predecim, int *decim_x, int *decim_y,
u16 pos_x, unsigned long *core_clk, bool mem_to_mem);
unsigned long (*calc_core_clk) (enum omap_plane plane,
unsigned long (*calc_core_clk) (unsigned long pclk,
u16 width, u16 height, u16 out_width, u16 out_height,
bool mem_to_mem);
u8 num_fifos;
Expand Down Expand Up @@ -2044,14 +2044,13 @@ static int check_horiz_timing_omap3(enum omap_plane plane,
return 0;
}

static unsigned long calc_core_clk_five_taps(enum omap_plane plane,
static unsigned long calc_core_clk_five_taps(unsigned long pclk,
const struct omap_video_timings *mgr_timings, u16 width,
u16 height, u16 out_width, u16 out_height,
enum omap_color_mode color_mode)
{
u32 core_clk = 0;
u64 tmp;
unsigned long pclk = dispc_plane_pclk_rate(plane);

if (height <= out_height && width <= out_width)
return (unsigned long) pclk;
Expand Down Expand Up @@ -2085,22 +2084,19 @@ static unsigned long calc_core_clk_five_taps(enum omap_plane plane,
return core_clk;
}

static unsigned long calc_core_clk_24xx(enum omap_plane plane, u16 width,
static unsigned long calc_core_clk_24xx(unsigned long pclk, u16 width,
u16 height, u16 out_width, u16 out_height, bool mem_to_mem)
{
unsigned long pclk = dispc_plane_pclk_rate(plane);

if (height > out_height && width > out_width)
return pclk * 4;
else
return pclk * 2;
}

static unsigned long calc_core_clk_34xx(enum omap_plane plane, u16 width,
static unsigned long calc_core_clk_34xx(unsigned long pclk, u16 width,
u16 height, u16 out_width, u16 out_height, bool mem_to_mem)
{
unsigned int hf, vf;
unsigned long pclk = dispc_plane_pclk_rate(plane);

/*
* FIXME how to determine the 'A' factor
Expand All @@ -2123,11 +2119,9 @@ static unsigned long calc_core_clk_34xx(enum omap_plane plane, u16 width,
return pclk * vf * hf;
}

static unsigned long calc_core_clk_44xx(enum omap_plane plane, u16 width,
static unsigned long calc_core_clk_44xx(unsigned long pclk, u16 width,
u16 height, u16 out_width, u16 out_height, bool mem_to_mem)
{
unsigned long pclk;

/*
* If the overlay/writeback is in mem to mem mode, there are no
* downscaling limitations with respect to pixel clock, return 1 as
Expand All @@ -2137,8 +2131,6 @@ static unsigned long calc_core_clk_44xx(enum omap_plane plane, u16 width,
if (mem_to_mem)
return 1;

pclk = dispc_plane_pclk_rate(plane);

if (width > out_width)
return DIV_ROUND_UP(pclk, out_width) * width;
else
Expand All @@ -2157,13 +2149,14 @@ static int dispc_ovl_calc_scaling_24xx(enum omap_plane plane,
int min_factor = min(*decim_x, *decim_y);
const int maxsinglelinewidth =
dss_feat_get_param_max(FEAT_PARAM_LINEWIDTH);
unsigned long pclk = dispc_plane_pclk_rate(plane);

*five_taps = false;

do {
in_height = DIV_ROUND_UP(height, *decim_y);
in_width = DIV_ROUND_UP(width, *decim_x);
*core_clk = dispc.feat->calc_core_clk(plane, in_width,
*core_clk = dispc.feat->calc_core_clk(pclk, in_width,
in_height, out_width, out_height, mem_to_mem);
error = (in_width > maxsinglelinewidth || !*core_clk ||
*core_clk > dispc_core_clk_rate());
Expand Down Expand Up @@ -2198,11 +2191,12 @@ static int dispc_ovl_calc_scaling_34xx(enum omap_plane plane,
int min_factor = min(*decim_x, *decim_y);
const int maxsinglelinewidth =
dss_feat_get_param_max(FEAT_PARAM_LINEWIDTH);
unsigned long pclk = dispc_plane_pclk_rate(plane);

do {
in_height = DIV_ROUND_UP(height, *decim_y);
in_width = DIV_ROUND_UP(width, *decim_x);
*core_clk = calc_core_clk_five_taps(plane, mgr_timings,
*core_clk = calc_core_clk_five_taps(pclk, mgr_timings,
in_width, in_height, out_width, out_height, color_mode);

error = check_horiz_timing_omap3(plane, mgr_timings,
Expand All @@ -2214,7 +2208,7 @@ static int dispc_ovl_calc_scaling_34xx(enum omap_plane plane,
in_height < out_height * 2)
*five_taps = false;
if (!*five_taps)
*core_clk = dispc.feat->calc_core_clk(plane, in_width,
*core_clk = dispc.feat->calc_core_clk(pclk, in_width,
in_height, out_width, out_height,
mem_to_mem);

Expand Down Expand Up @@ -2265,12 +2259,11 @@ static int dispc_ovl_calc_scaling_44xx(enum omap_plane plane,
const int maxsinglelinewidth =
dss_feat_get_param_max(FEAT_PARAM_LINEWIDTH);
const int maxdownscale = dss_feat_get_param_max(FEAT_PARAM_DOWNSCALE);
unsigned long pclk = dispc_plane_pclk_rate(plane);

if (mem_to_mem) {
in_width_max = out_width * maxdownscale;
} else {
unsigned long pclk = dispc_plane_pclk_rate(plane);

in_width_max = dispc_core_clk_rate() /
DIV_ROUND_UP(pclk, out_width);
}
Expand All @@ -2291,7 +2284,7 @@ static int dispc_ovl_calc_scaling_44xx(enum omap_plane plane,
return -EINVAL;
}

*core_clk = dispc.feat->calc_core_clk(plane, in_width, in_height,
*core_clk = dispc.feat->calc_core_clk(pclk, in_width, in_height,
out_width, out_height, mem_to_mem);
return 0;
}
Expand Down

0 comments on commit 64b1856

Please sign in to comment.