msm:vidc: Modify input buffer size calculation

calculate buffer size as per the max resolution
for the targets that does not support 4k and also
ensure the size is equal to YUV size by overriding
the div factor to 1.

Change-Id: Ia63676d30d1ee1e697518780a03a48010380555d
Signed-off-by: Manikanta Kanamarlapudi <kmanikan@codeaurora.org>
This commit is contained in:
Manikanta Kanamarlapudi 2020-04-09 23:07:42 +05:30 • committed by Gerrit - the friendly Code Review server
commit ec7ac2c5f2

View file

@ -845,6 +845,18 @@ u32 msm_vidc_calculate_dec_input_frame_size(struct msm_vidc_inst *inst)
div_factor = 2;
}
if (is_secure_session(inst))
div_factor = div_factor << 1;
/*
* For targets that doesn't support 4k, consider max mb's for that
* target and allocate max input buffer size for the same
*/
if (base_res_mbs > inst->capability.cap[CAP_MBS_PER_FRAME].max) {
base_res_mbs = inst->capability.cap[CAP_MBS_PER_FRAME].max;
div_factor = 1;
}
frame_size = base_res_mbs * MB_SIZE_IN_PIXEL * 3 / 2 / div_factor;
/* multiply by 10/8 (1.25) to get size for 10 bit case */
@ -852,9 +864,6 @@ u32 msm_vidc_calculate_dec_input_frame_size(struct msm_vidc_inst *inst)
(f->fmt.pix_mp.pixelformat == V4L2_PIX_FMT_HEVC))
frame_size = frame_size + (frame_size >> 2);
if (is_secure_session(inst))
frame_size /= 2;
if (inst->buffer_size_limit &&
(inst->buffer_size_limit < frame_size)) {
frame_size = inst->buffer_size_limit;