msm: vidc: Update bitstream buffer size for secure case

Existing logic to calculate buffer size is based on
the max bitrate supported during a secure session. Even
the peak bitrate calculation is not sufficient to arrive
at the required frame size.
Going back to earlier logic based on macroblocks per frame.

CRs-Fixed: 2467242
Change-Id: I0fe1768036f19ad2f1d08222e3ed239be7a2e27c
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
This commit is contained in:
Vikash Garodia 2019-06-12 18:53:40 +05:30
parent 82b121236b
commit ac11cf2022

View File

@ -782,22 +782,14 @@ u32 msm_vidc_calculate_dec_input_frame_size(struct msm_vidc_inst *inst)
frame_size = base_res_mbs * MB_SIZE_IN_PIXEL * 3 / 2 / div_factor;
if (is_secure_session(inst)) {
u32 max_bitrate = inst->capability.cap[CAP_SECURE_BITRATE].max;
/*
* for secure, calc frame_size based on max bitrate,
* peak bitrate can be 10 times more and
* frame rate assumed to be 30 fps at least
*/
frame_size = (max_bitrate * 10 / 8) / 30;
}
/* multiply by 10/8 (1.25) to get size for 10 bit case */
if ((f->fmt.pix_mp.pixelformat == V4L2_PIX_FMT_VP9) ||
(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;