From b560c7a295076b2bde60e2b7cfdc28fa2c44771d Mon Sep 17 00:00:00 2001 From: Vikash Garodia Date: Mon, 17 Aug 2020 17:49:35 +0530 Subject: [PATCH] msm: vidc: Restrict dynamic low latency for h264 and hevc In existing approach, dynamic low latency i.e low latency hint is restricted via specific low latency components in userspace. This change adds one more checkpoint to ensure that video firmware is configured for low latency only for desired codecs. Change-Id: Iad36c3b84ddc3b94033c4bf5f0afdd3a18600111 Signed-off-by: Vikash Garodia --- msm/vidc/msm_vdec.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/msm/vidc/msm_vdec.c b/msm/vidc/msm_vdec.c index 685f56e6c17b..a05c28d11f89 100644 --- a/msm/vidc/msm_vdec.c +++ b/msm/vidc/msm_vdec.c @@ -1326,6 +1326,7 @@ int msm_vdec_set_priority(struct msm_vidc_inst *inst) int msm_vdec_set_seqchng_at_syncframe(struct msm_vidc_inst *inst) { int rc = 0; + u32 codec; struct hfi_device *hdev; struct hfi_enable hfi_property; @@ -1339,6 +1340,13 @@ int msm_vdec_set_seqchng_at_syncframe(struct msm_vidc_inst *inst) if (!hfi_property.enable) return 0; + codec = get_v4l2_codec(inst); + if (!(codec == V4L2_PIX_FMT_HEVC || codec == V4L2_PIX_FMT_H264)) { + s_vpr_e(inst->sid, + "%s: low latency hint supported for HEVC/H264\n", + __func__); + return -EINVAL; + } s_vpr_h(inst->sid, "%s: %#x\n", __func__, hfi_property.enable); rc = call_hfi_op(hdev, session_set_property, inst->session, HFI_PROPERTY_PARAM_VDEC_SEQCHNG_AT_SYNCFRM, &hfi_property,