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 221fcadda6b5..9a4716ef16eb 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 ee6571e434b7..26e3239351b3 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 {