Linux Media Controller development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Wangao Wang" <wangao.wang@oss.qualcomm.com>
Cc: linux-media@vger.kernel.org
Subject: Re: [PATCH v2 1/2] media: qcom: iris: Add gop size support for gen1 encoder
Date: Thu, 04 Jun 2026 08:14:03 +0000	[thread overview]
Message-ID: <20260604081403.B8E361F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260604-dynamic_encode-v2-1-6e97df032482@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:

New issues:
- [Medium] Undocumented addition of dynamic allowed flag to `IR_PERIOD` capability.

Pre-existing issues:
- [High] The driver lacks a `.try_ctrl` implementation to validate dependencies between controls, resulting in silent hardware configuration failures for valid V4L2 inputs like `gop_size == 0`.
--

commit 0331fb3580ba43928b379274c9bd300bf884fc44
Author: Wangao Wang <wangao.wang@oss.qualcomm.com>

media: qcom: iris: Add gop size support for gen1 encoder

This commit adds support for GOP size configuration on gen1 encoders by
enabling V4L2_CID_MPEG_VIDEO_GOP_SIZE and routing it to the hardware handler.

> diff --git a/drivers/media/platform/qcom/iris/iris_hfi_gen1.c b/drivers/media/platform/qcom/iris/iris_hfi_gen1.c
> index ca1545d28b531..eff9216bb5014 100644
> --- a/drivers/media/platform/qcom/iris/iris_hfi_gen1.c
> +++ b/drivers/media/platform/qcom/iris/iris_hfi_gen1.c
> @@ -171,7 +171,9 @@ static const struct platform_inst_fw_cap inst_fw_cap_sm8250_enc[] = {
>  		.max = (1 << 16) - 1,
>  		.step_or_mask = 1,
>  		.value = 30,
> -		.set = iris_set_u32
> +		.hfi_id = HFI_PROPERTY_CONFIG_VENC_INTRA_PERIOD,
> +		.flags = CAP_FLAG_OUTPUT_PORT,
> +		.set = iris_set_intra_period,
>  	},

[Severity: High]
This isn't a bug introduced by this patch, but this patch explicitly wires up
the GOP_SIZE control to the hardware for Gen1, bringing a pre-existing silent
failure path into active use.

The V4L2 specification defines V4L2_CID_MPEG_VIDEO_GOP_SIZE = 0 as meaning
"only I-frames are used". The driver exposes .min = 0 for this control,
allowing userspace to request it.

However, the hardware handler explicitly rejects a 0 gop_size:

iris_set_intra_period() {
    ...
    if (!gop_size || b_frame >= gop_size)
        return -EINVAL;
    ...
}

During streamon, the driver iterates over capabilities and applies them to
the firmware, but ignores any returned errors:

iris_set_properties() {
    ...
    if (cap->cap_id && cap->set)
        cap->set(inst, i);
    ...
}

Because the return value is ignored, the error is swallowed and user space
receives a success response, but the property is never dispatched to the
firmware. Could this cause the encoder hardware to operate with out-of-sync
default GOP settings instead of the requested all-I-frames configuration?

[ ... ]

> @@ -240,7 +242,7 @@ static const struct platform_inst_fw_cap inst_fw_cap_sm8250_enc[] = {
>  		.step_or_mask = 1,
>  		.value = 0,
>  		.hfi_id = HFI_PROPERTY_PARAM_VENC_INTRA_REFRESH,
> -		.flags = CAP_FLAG_OUTPUT_PORT,
> +		.flags = CAP_FLAG_OUTPUT_PORT | CAP_FLAG_DYNAMIC_ALLOWED,
>  		.set = iris_set_ir_period_gen1,
>  	},

[Severity: Medium]
Does this modification belong in this patch?

The commit message strictly states that it adds support for GOP size
configuration on gen1 encoders. However, this line modifies the IR_PERIOD
(Intra Refresh Period) capability to include the CAP_FLAG_DYNAMIC_ALLOWED
flag.

Modifying intra-refresh dynamic behavior appears to be a distinct functional
change that isn't mentioned in the commit message. Could this be split into
a separate commit or mentioned in the commit message?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260604-dynamic_encode-v2-0-6e97df032482@oss.qualcomm.com?part=1

  reply	other threads:[~2026-06-04  8:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-04  8:00 [PATCH v2 0/2] media: qcom: iris: add dynamic encoder properties Wangao Wang
2026-06-04  8:00 ` [PATCH v2 1/2] media: qcom: iris: Add gop size support for gen1 encoder Wangao Wang
2026-06-04  8:14   ` sashiko-bot [this message]
2026-06-07 20:28   ` Dmitry Baryshkov
2026-06-04  8:00 ` [PATCH v2 2/2] media: qcom: iris: Add request key frame support for encoder Wangao Wang
2026-06-04  8:19   ` sashiko-bot
2026-06-07 20:37   ` Dmitry Baryshkov
2026-06-23  6:10     ` Wangao Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260604081403.B8E361F00893@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=wangao.wang@oss.qualcomm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox