mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-10 22:40:54 -04:00
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:
parent
b80bcd6127
commit
ec7ac2c5f2
1 changed files with 12 additions and 3 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue