From: Hans Verkuil <hverkuil+cisco@kernel.org>
To: opensource india <opensource206@gmail.com>
Cc: mchehab@kernel.org, hverkuil@kernel.org, ribalda@chromium.org,
laurent.pinchart@ideasonboard.com, yunkec@google.com,
sakari.ailus@linux.intel.com, james.cowgill@blaize.com,
Nicolas Dufresne <nicolas.dufresne@collabora.com>,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] media: v4l2-ctrls: add full AV1 profile validation in validate_av1_sequence()
Date: Thu, 23 Oct 2025 12:43:50 +0200 [thread overview]
Message-ID: <f9001f98-80d6-49d5-8665-d42fcef7b07d@kernel.org> (raw)
In-Reply-To: <CAKPKb8-s96v+Nh29Z5E0wgyXYgoFHJT2SHA_WpZshXspo0WY0w@mail.gmail.com>
On 23/10/2025 12:32, opensource india wrote:
> On Wed, Oct 22, 2025 at 12:44 PM Hans Verkuil <hverkuil+cisco@kernel.org> wrote:
>>
>> Hi Pavan,
>>
>> On 13/09/2025 12:52, Pavan Bobba wrote:
>>> Complete the "TODO: PROFILES" by enforcing profile-specific and
>>> monochrome constraints as defined by the AV1 specification
>>> (Section 5.5.2, "Color config syntax").
>>>
>>> The validator now checks:
>>>
>>> - Flags: reject any unknown bits set in sequence->flags
>>> - Profile range: only profiles 0..2 are valid
>>> - Profile 0: 8/10-bit only, subsampling must be 4:2:0 (sx=1, sy=1),
>>> monochrome allowed
>>> - Profile 1: 8/10-bit only, subsampling must be 4:4:4 (sx=0, sy=0),
>>> monochrome forbidden
>>> - Profile 2:
>>> * 8/10-bit: only 4:2:2 allowed (sx=1, sy=0)
>>> * 12-bit: 4:4:4 (sx=0, sy=0), 4:2:2 (sx=1, sy=0), or 4:2:0 (sx=1, sy=1)
>>> allowed
>>> - Monochrome path (all profiles except 1): forces subsampling_x=1,
>>> subsampling_y=1, separate_uv_delta_q=0
>>>
>>> These checks prevent userspace from providing invalid AV1 sequence
>>> headers that would otherwise be accepted, leading to undefined driver
>>> or hardware behavior.
>>
>> This patch was merged in our media-committers next branch, but I noticed that
>> it now fails the v4l2-compliance test for the visl driver.
>>
>> The cause is that the new validation now fails with the default values for
>> this control as set in std_init_compound().
>>
>> You can test this yourself by loading the visl driver and then running
>> v4l2-compliance -d /dev/videoX -E --verbose
>> (-E stops at the first error)
>>
>> Can you provide a patch to initialize this control with sane values?
>>
>> Apologies for not noticing this before: there are some issues with the automatic
>> regression tests in our CI, so the tests weren't run.
>>
>> Regards,
>>
>> Hans
>>
>
> Hi Hans Verkuil,
>
> Thank you so much for the review.
> yes, v4l2-compliance expected to fail indeed since it is sending
> default values which, our newly added code rejects as per
> specification
>
> when you say patch, you mean patch for v4l2-compliance tool with
> proper values so that v4l2 core driver can accept?
No, std_init_compound() in the kernel needs to be patched so the initial
value of this control passes the new validation tests. The initial control
values should always be sane.
Regards,
Hans
next prev parent reply other threads:[~2025-10-23 10:43 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-13 10:52 Pavan Bobba
2025-09-27 4:51 ` opensource india
2025-09-27 8:56 ` Daniel Almeida
2025-10-07 10:50 ` opensource india
2025-10-07 13:49 ` Daniel Almeida
2025-10-18 9:21 ` opensource india
2025-10-22 7:14 ` Hans Verkuil
2025-10-23 10:32 ` opensource india
2025-10-23 10:43 ` Hans Verkuil [this message]
2025-10-23 13:03 ` John Cox
2025-10-23 13:14 ` Hans Verkuil
[not found] ` <CAKPKb88Tov27+c227p8k0KAuZtm_LNNxDkf=5YBfDYw94afFPw@mail.gmail.com>
2025-10-27 15:54 ` Hans Verkuil
2025-10-28 6:35 ` opensource india
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=f9001f98-80d6-49d5-8665-d42fcef7b07d@kernel.org \
--to=hverkuil+cisco@kernel.org \
--cc=hverkuil@kernel.org \
--cc=james.cowgill@blaize.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=nicolas.dufresne@collabora.com \
--cc=opensource206@gmail.com \
--cc=ribalda@chromium.org \
--cc=sakari.ailus@linux.intel.com \
--cc=yunkec@google.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
all inboxes | Powered by JetHome®