msm: mdss: use compression ratio factors passed by user space
Use the compression ratio factors shared by user space to reduce the bandwidth calculations and vote for the reduced throughput when compressed formats are used. Before this change kernel estimated the compression ratio factors to reduce the bandwidth in the compressed formats, after this change user space will set the compression factors and kernel will use those for bandwidth calculations. Change-Id: I00fc0b9f526e7ff400740d48f42f6404737eae32 Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org> [cip@codeaurora.org: Resolved merge conflict] Signed-off-by: Clarence Ip <cip@codeaurora.org>
This commit is contained in:
parent
f274a1ebec
commit
272da5e39e
4 changed files with 33 additions and 25 deletions
|
@ -525,6 +525,9 @@ struct mdss_mdp_pipe {
|
|||
struct mdss_mdp_format_params *src_fmt;
|
||||
struct mdss_mdp_plane_sizes src_planes;
|
||||
|
||||
/* compression ratio from the source format */
|
||||
struct mult_factor comp_ratio;
|
||||
|
||||
u8 mixer_stage;
|
||||
u8 is_fg;
|
||||
u8 alpha;
|
||||
|
@ -1037,8 +1040,8 @@ void mdss_mdp_ctl_notifier_unregister(struct mdss_mdp_ctl *ctl,
|
|||
struct notifier_block *notifier);
|
||||
u32 mdss_mdp_ctl_perf_get_transaction_status(struct mdss_mdp_ctl *ctl);
|
||||
u32 mdss_apply_overhead_factors(u32 quota, bool is_nrt,
|
||||
bool is_rot_read, struct mdss_mdp_format_params *fmt);
|
||||
|
||||
bool is_rot_read, struct mdss_mdp_format_params *fmt,
|
||||
struct mult_factor *comp_ratio);
|
||||
|
||||
int mdss_mdp_scan_pipes(void);
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ static inline u64 apply_fudge_factor(u64 val,
|
|||
}
|
||||
|
||||
static inline u64 apply_inverse_fudge_factor(u64 val,
|
||||
struct mdss_fudge_factor *factor)
|
||||
struct mult_factor *factor)
|
||||
{
|
||||
return fudge_factor(val, factor->denom, factor->numer);
|
||||
}
|
||||
|
@ -543,22 +543,19 @@ static u32 get_pipe_mdp_clk_rate(struct mdss_mdp_pipe *pipe,
|
|||
return rate;
|
||||
}
|
||||
|
||||
static inline bool validate_comp_ratio(struct mult_factor *factor)
|
||||
{
|
||||
return factor->numer && factor->denom;
|
||||
}
|
||||
|
||||
static u32 apply_comp_ratio_factor(u32 quota,
|
||||
struct mdss_mdp_format_params *fmt,
|
||||
bool is_nrt)
|
||||
struct mult_factor *factor)
|
||||
{
|
||||
struct mdss_fudge_factor *factor;
|
||||
struct mdss_mdp_format_params_ubwc *ubwc_fmt;
|
||||
|
||||
if (mdss_mdp_is_ubwc_format(fmt)) {
|
||||
ubwc_fmt = container_of(fmt, struct mdss_mdp_format_params_ubwc,
|
||||
mdp_format);
|
||||
|
||||
if (is_nrt)
|
||||
factor = &ubwc_fmt->comp_ratio_nrt;
|
||||
else
|
||||
factor = &ubwc_fmt->comp_ratio_rt;
|
||||
|
||||
/* apply compression ratio, only for compressed formats */
|
||||
if (mdss_mdp_is_ubwc_format(fmt) &&
|
||||
validate_comp_ratio(factor)) {
|
||||
quota = apply_inverse_fudge_factor(quota , factor);
|
||||
}
|
||||
|
||||
|
@ -567,7 +564,8 @@ static u32 apply_comp_ratio_factor(u32 quota,
|
|||
|
||||
static u32 apply_overhead_factors(u32 quota,
|
||||
bool is_nrt, bool is_rot_read,
|
||||
struct mdss_mdp_format_params *fmt)
|
||||
struct mdss_mdp_format_params *fmt,
|
||||
struct mult_factor *comp_ratio)
|
||||
{
|
||||
u32 overhead_quota;
|
||||
|
||||
|
@ -587,7 +585,8 @@ static u32 apply_overhead_factors(u32 quota,
|
|||
} else {
|
||||
/* add ~3% (0.03125) of overhead */
|
||||
overhead_quota = quota / 32;
|
||||
overhead_quota += apply_comp_ratio_factor(quota, fmt, is_nrt);
|
||||
overhead_quota += apply_comp_ratio_factor(quota, fmt,
|
||||
comp_ratio);
|
||||
}
|
||||
|
||||
return overhead_quota;
|
||||
|
@ -608,7 +607,8 @@ static u32 mdss_mdp_get_rotator_fps(struct mdss_mdp_pipe *pipe)
|
|||
}
|
||||
|
||||
u32 mdss_apply_overhead_factors(u32 quota, bool is_nrt,
|
||||
bool is_rot_read, struct mdss_mdp_format_params *fmt)
|
||||
bool is_rot_read, struct mdss_mdp_format_params *fmt,
|
||||
struct mult_factor *comp_ratio)
|
||||
{
|
||||
struct mdss_data_type *mdata = mdss_mdp_get_mdata();
|
||||
|
||||
|
@ -618,7 +618,7 @@ u32 mdss_apply_overhead_factors(u32 quota, bool is_nrt,
|
|||
if (test_bit(MDSS_QOS_OVERHEAD_FACTOR,
|
||||
mdata->mdss_qos_map)) {
|
||||
quota = apply_overhead_factors(quota,
|
||||
is_nrt, is_rot_read, fmt);
|
||||
is_nrt, is_rot_read, fmt, comp_ratio);
|
||||
}
|
||||
return quota;
|
||||
}
|
||||
|
@ -732,7 +732,8 @@ int mdss_mdp_perf_calc_pipe(struct mdss_mdp_pipe *pipe,
|
|||
mdata->mdss_qos_map)) {
|
||||
/* rotator read */
|
||||
quota = apply_overhead_factors(quota,
|
||||
true, true, pipe->src_fmt);
|
||||
true, true, pipe->src_fmt,
|
||||
&pipe->comp_ratio);
|
||||
/*
|
||||
* rotator write: here we are using src_fmt since
|
||||
* current implementation only supports calculate
|
||||
|
@ -743,7 +744,8 @@ int mdss_mdp_perf_calc_pipe(struct mdss_mdp_pipe *pipe,
|
|||
* calculation as per current support.
|
||||
*/
|
||||
quota += apply_overhead_factors(quota,
|
||||
true, false, pipe->src_fmt);
|
||||
true, false, pipe->src_fmt,
|
||||
&pipe->comp_ratio);
|
||||
} else {
|
||||
quota *= 2; /* bus read + write */
|
||||
}
|
||||
|
@ -757,7 +759,8 @@ int mdss_mdp_perf_calc_pipe(struct mdss_mdp_pipe *pipe,
|
|||
mdata->mdss_qos_map))
|
||||
quota = apply_overhead_factors(quota,
|
||||
mdss_mdp_is_nrt_ctl_path(mixer->ctl),
|
||||
false, pipe->src_fmt);
|
||||
false, pipe->src_fmt,
|
||||
&pipe->comp_ratio);
|
||||
}
|
||||
|
||||
perf->bw_overlap = quota;
|
||||
|
@ -883,7 +886,7 @@ static void mdss_mdp_perf_calc_mixer(struct mdss_mdp_mixer *mixer,
|
|||
mdata->mdss_qos_map))
|
||||
perf->bw_writeback = apply_overhead_factors(
|
||||
perf->bw_writeback,
|
||||
true, false, fmt);
|
||||
true, false, fmt, &pipe->comp_ratio);
|
||||
/* for command mode, run as fast as the link allows us */
|
||||
} else if (pinfo->type == MIPI_CMD_PANEL) {
|
||||
u32 dsi_pclk_rate = pinfo->mipi.dsi_pclk_rate;
|
||||
|
|
|
@ -428,6 +428,8 @@ static int __configure_pipe_params(struct msm_fb_data_type *mfd,
|
|||
goto end;
|
||||
}
|
||||
|
||||
pipe->comp_ratio = layer->buffer.comp_ratio;
|
||||
|
||||
if (mfd->panel_orientation)
|
||||
layer->flags ^= mfd->panel_orientation;
|
||||
|
||||
|
|
|
@ -1007,9 +1007,9 @@ static int mdss_rotator_calc_perf(struct mdss_rot_perf *perf)
|
|||
write_bw *= out_fmt->bpp;
|
||||
|
||||
read_bw = mdss_apply_overhead_factors(read_bw,
|
||||
true, true, in_fmt);
|
||||
true, true, in_fmt, &config->input.comp_ratio);
|
||||
write_bw = mdss_apply_overhead_factors(write_bw,
|
||||
true, false, out_fmt);
|
||||
true, false, out_fmt, &config->input.comp_ratio);
|
||||
|
||||
perf->bw = read_bw + write_bw;
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Reference in a new issue