[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f9001f98-80d6-49d5-8665-d42fcef7b07d@kernel.org>
Date: Thu, 23 Oct 2025 12:43:50 +0200
From: Hans Verkuil <hverkuil+cisco@...nel.org>
To: opensource india <opensource206@...il.com>
Cc: mchehab@...nel.org, hverkuil@...nel.org, ribalda@...omium.org,
laurent.pinchart@...asonboard.com, yunkec@...gle.com,
sakari.ailus@...ux.intel.com, james.cowgill@...ize.com,
Nicolas Dufresne <nicolas.dufresne@...labora.com>,
linux-media@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3] media: v4l2-ctrls: add full AV1 profile validation in
validate_av1_sequence()
On 23/10/2025 12:32, opensource india wrote:
> On Wed, Oct 22, 2025 at 12:44 PM Hans Verkuil <hverkuil+cisco@...nel.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
Powered by blists - more mailing lists