From 72f29165b3695016032bf0577129227c74f59873 Mon Sep 17 00:00:00 2001 From: Akshata Sahukar Date: Wed, 28 Aug 2019 10:59:50 -0700 Subject: [PATCH] msm: vidc: Fix to allocate right scratch1 buffer size Avoid allocating smaller encoder scratch1 buffer for Video firmware when frame height is greater than frame width. Change-Id: I663da164b3cbb945d7da2d6ab40199d8ef14d979 Signed-off-by: Akshata Sahukar --- msm/vidc/msm_vidc_buffer_calculations.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/msm/vidc/msm_vidc_buffer_calculations.c b/msm/vidc/msm_vidc_buffer_calculations.c index 3250e90bda5b..5fa0a05415e1 100644 --- a/msm/vidc/msm_vidc_buffer_calculations.c +++ b/msm/vidc/msm_vidc_buffer_calculations.c @@ -1680,7 +1680,7 @@ static inline u32 calculate_enc_scratch1_size(struct msm_vidc_inst *inst, override_buffer_size = ALIGN(override_buffer_size, VENUS_DMA_ALIGNMENT) * 2; ir_buffer_size = (((frame_num_lcu << 1) + 7) & (~7)) * 3; - vpss_line_buf = ((((width_coded + 3) >> 2) << 5) + 256) * 16; + vpss_line_buf = ((((max(width_coded, height_coded) + 3) >> 2) << 5) + 256) * 16; topline_bufsize_fe_1stg_sao = (16 * (width_coded >> 5)); topline_bufsize_fe_1stg_sao = ALIGN(topline_bufsize_fe_1stg_sao, VENUS_DMA_ALIGNMENT);