From 31f9744ab8fda02903b9196e5433162c1511ed87 Mon Sep 17 00:00:00 2001 From: Dikshita Agarwal Date: Mon, 14 Sep 2020 20:14:37 +0530 Subject: [PATCH] msm: vidc: update calculation for BSE LB write for decoder For h264 BSE LB write should be half of BSE LB read for decoder. Update the calculation for the same. Change-Id: I5ebceff4fa0795eaaf67b569e754d174be4a8146 Signed-off-by: Dikshita Agarwal --- msm/vidc/msm_vidc_bus_iris2.c | 12 +++++++++++- msm/vidc/msm_vidc_clocks.c | 3 +++ msm/vidc/msm_vidc_internal.h | 1 + 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/msm/vidc/msm_vidc_bus_iris2.c b/msm/vidc/msm_vidc_bus_iris2.c index 6252fd3ddf27..db922351b54d 100644 --- a/msm/vidc/msm_vidc_bus_iris2.c +++ b/msm/vidc/msm_vidc_bus_iris2.c @@ -32,6 +32,7 @@ static unsigned long __calculate_decoder(struct vidc_bus_vote_data *d) /* Derived parameters */ int lcu_per_frame, collocated_bytes_per_lcu, tnbr_per_lcu; unsigned long bitrate; + unsigned int num_vpp_pipes; fp_t bins_to_bit_factor, vsp_read_factor, vsp_write_factor, dpb_factor, dpb_write_factor, y_bw_no_ubwc_8bpp; @@ -83,6 +84,8 @@ static unsigned long __calculate_decoder(struct vidc_bus_vote_data *d) opb_write_compression_factor = opb_compression_enabled ? dpb_write_compression_factor : FP_ONE; + num_vpp_pipes = d->num_vpp_pipes; + if (d->codec == HAL_VIDEO_CODEC_HEVC || d->codec == HAL_VIDEO_CODEC_VP9) { /* H264, VP8, MPEG2 use the same settings */ @@ -163,7 +166,14 @@ static unsigned long __calculate_decoder(struct vidc_bus_vote_data *d) ddr.line_buffer_read = fp_div(FP_INT(tnbr_per_lcu * lcu_per_frame * fps), FP_INT(bps(1))); - ddr.line_buffer_write = ddr.line_buffer_read; + /* This change is applicable for all IRIS2 targets, + * but currently being done for IRIS2 with 2 pipes + * only due to timeline constraints. + */ + if((num_vpp_pipes == 2) && (is_h264_category)) + ddr.line_buffer_write = fp_div(ddr.line_buffer_read,FP_INT(2)); + else + ddr.line_buffer_write = ddr.line_buffer_read; if (llc_top_line_buf_enabled) { llc.line_buffer_read = ddr.line_buffer_read; llc.line_buffer_write = ddr.line_buffer_write; diff --git a/msm/vidc/msm_vidc_clocks.c b/msm/vidc/msm_vidc_clocks.c index 92cf50997829..405dd253b1c7 100644 --- a/msm/vidc/msm_vidc_clocks.c +++ b/msm/vidc/msm_vidc_clocks.c @@ -456,6 +456,9 @@ int msm_comm_vote_bus(struct msm_vidc_inst *inst) if (core->resources.sys_cache_res_set) vote_data->use_sys_cache = true; + vote_data->num_vpp_pipes = + inst->core->platform_data->num_vpp_pipes; + call_core_op(core, calc_bw, vote_data); } diff --git a/msm/vidc/msm_vidc_internal.h b/msm/vidc/msm_vidc_internal.h index 27844dbe19a8..123ac97212c5 100644 --- a/msm/vidc/msm_vidc_internal.h +++ b/msm/vidc/msm_vidc_internal.h @@ -427,6 +427,7 @@ struct vidc_bus_vote_data { bool b_frames_enabled; unsigned long calc_bw_ddr; unsigned long calc_bw_llcc; + u32 num_vpp_pipes; }; struct profile_data {