Re: [PATCH v4 2/2] media: iris: add support for vbv delay
From: Dmitry Baryshkov
Date: Sun Sep 27 2026 - 14:25:40 EST
On Sun, Sep 27, 2026 at 09:27:46AM +0530, Sachin Kumar Garg wrote:
> Add the VBV_DELAY instance capability for the HFI Gen2 encoder,
> exposed to userspace via V4L2_CID_MPEG_VIDEO_VBV_DELAY and mapped to
> HFI_PROP_VBV_DELAY through a new iris_set_vbv_delay(). The property
> is only meaningful for CBR rate-control modes.
>
> Low VBV delay values (34-100 ms) require the encoder to run
> with a single video pipe, so extend iris_set_pipe() to force
> work_route to 1 whenever the configured VBV_DELAY falls in that
> range.
>
> Reviewed-by: Vikash Garodia <vikash.garodia@xxxxxxxxxxxxxxxx>
> Signed-off-by: Sachin Kumar Garg <sachin.garg@xxxxxxxxxxxxxxxx>
> ---
> drivers/media/platform/qcom/iris/iris_ctrls.c | 37 +++++++++++++++++++++-
> drivers/media/platform/qcom/iris/iris_ctrls.h | 1 +
> drivers/media/platform/qcom/iris/iris_hfi_gen2.c | 12 ++++++-
> .../platform/qcom/iris/iris_hfi_gen2_defines.h | 1 +
> .../platform/qcom/iris/iris_platform_common.h | 1 +
> 5 files changed, 50 insertions(+), 2 deletions(-)
>
> @@ -541,8 +545,19 @@ int iris_set_stage(struct iris_inst *inst, enum platform_inst_fw_cap_type cap_id
> int iris_set_pipe(struct iris_inst *inst, enum platform_inst_fw_cap_type cap_id)
> {
> const struct iris_hfi_session_ops *hfi_ops = inst->hfi_session_ops;
> - u32 work_route = inst->fw_caps[PIPE].value;
> + u32 work_route = inst->fw_caps[PIPE].max;
Why is being set to the max value instead of using the .value?
> u32 hfi_id = inst->fw_caps[cap_id].hfi_id;
> + u32 vbv_delay;
> +
> + if (inst->domain == ENCODER &&
> + inst->fw_caps[FRAME_RC_ENABLE].value &&
> + inst->fw_caps[BITRATE_MODE].value == V4L2_MPEG_VIDEO_BITRATE_MODE_CBR) {
> + vbv_delay = inst->fw_caps[VBV_DELAY].value;
> + if (vbv_delay >= 34 && vbv_delay <= 100)
> + work_route = 1;
> + }
> +
> + inst->fw_caps[PIPE].value = work_route;
>
> return hfi_ops->session_set_property(inst, hfi_id,
> HFI_HOST_FLAGS_NONE,
--
With best wishes
Dmitry