From 26782be24885a6384b8e0b930b6b160933fcbb3f Mon Sep 17 00:00:00 2001 From: Priyanka Gujjula Date: Mon, 22 Mar 2021 20:05:20 +0530 Subject: [PATCH 1/2] msm: vidc: Allocate required bin size for >=UHD enc Allocate equal bin size across all the pipes for encoder >=UHD Change-Id: Id6a4c2bda50da2bbd81e968be22b76bada51449a --- 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 2db5696313c7..997c1ee62749 100644 --- a/msm/vidc/msm_vidc_buffer_calculations.c +++ b/msm/vidc/msm_vidc_buffer_calculations.c @@ -1439,7 +1439,7 @@ static inline u32 calculate_enc_scratch_size(struct msm_vidc_inst *inst, bitbin_size = ALIGN(bitstream_size, VENUS_DMA_ALIGNMENT); } if (aligned_width * aligned_height >= 3840 * 2160) - size_singlePipe = bitbin_size / 4; + size_singlePipe = bitbin_size / num_vpp_pipes; else if (num_vpp_pipes > 2) size_singlePipe = bitbin_size / 2; else From 8f2e5d783215a6c74605ccc326d226a228569724 Mon Sep 17 00:00:00 2001 From: Vikash Garodia Date: Wed, 24 Mar 2021 11:31:46 +0530 Subject: [PATCH 2/2] msm: vidc: Add check for maximum height While accepting a video session, keep a check for frame height w.r.t maximum capability. CRs-Fixed: 2883699 Change-Id: I068dd9af868093dbdddf0301d8d40a95643314e0 Signed-off-by: Vikash Garodia --- msm/vidc/msm_vidc_common.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/msm/vidc/msm_vidc_common.c b/msm/vidc/msm_vidc_common.c index 7f6af02398e2..7ff136aff22e 100644 --- a/msm/vidc/msm_vidc_common.c +++ b/msm/vidc/msm_vidc_common.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-only /* - * Copyright (c) 2012-2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2021, The Linux Foundation. All rights reserved. */ #include @@ -6162,10 +6162,12 @@ int msm_vidc_check_session_supported(struct msm_vidc_inst *inst) width_min, height_min); rc = -ENOTSUPP; } - if (!rc && output_width > width_max) { + if (!rc && (output_width > width_max || + output_height > height_max)) { s_vpr_e(sid, - "Unsupported width = %u supported max width = %u\n", - output_width, width_max); + "Unsupported WxH (%u)x(%u), max supported is (%u)x(%u)\n", + output_width, output_height, + width_max, height_max); rc = -ENOTSUPP; }