From aeee6b18dfe7f03c6d9b3352ecde9ad054019d9d Mon Sep 17 00:00:00 2001 From: Govindaraj Rajagopal Date: Fri, 14 Jun 2019 12:42:57 +0530 Subject: [PATCH] msm-vidc: restrict interlace clip resolution [1] Some unsupported clip resolution like 1600x1200, firmware rejects the session during load resources. [2] Allow interlaced clip playback only if below conditions were met - resolution <= 1920x1920 - max_mbs_per_frame <= (1920x1088)/256 Change-Id: I67fd5377603c9c9ca577369c18ca6133190dc386 Signed-off-by: Govindaraj Rajagopal --- msm/vidc/msm_vidc_common.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/msm/vidc/msm_vidc_common.c b/msm/vidc/msm_vidc_common.c index 2f30bd36485f..81992279be32 100644 --- a/msm/vidc/msm_vidc_common.c +++ b/msm/vidc/msm_vidc_common.c @@ -5588,6 +5588,18 @@ int msm_vidc_check_session_supported(struct msm_vidc_inst *inst) mbpf_max); rc = -ENOTSUPP; } + if (!rc && inst->pic_struct != + MSM_VIDC_PIC_STRUCT_PROGRESSIVE && + (output_width > INTERLACE_WIDTH_MAX || + output_height > INTERLACE_HEIGHT_MAX || + (NUM_MBS_PER_FRAME(output_height, output_width) > + INTERLACE_MB_PER_FRAME_MAX))) { + dprintk(VIDC_ERR, + "Unsupported interlace WxH = (%u)x(%u), max supported is - (%u)x(%u)\n", + output_width, output_height, + INTERLACE_WIDTH_MAX, INTERLACE_HEIGHT_MAX); + rc = -ENOTSUPP; + } } if (rc) { dprintk(VIDC_ERR,