From: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
DelaySystem <DelaySystem@tubot.lat>
Cc: linux-media@vger.kernel.org,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Sakari Ailus <sakari.ailus@linux.intel.com>,
Hans Verkuil <hverkuil+cisco@kernel.org>,
Jacopo Mondi <jacopo.mondi@ideasonboard.com>,
linux-kernel@vger.kernel.org
Subject: Re: What should bridge drivers use instead of __v4l2_subdev_state_alloc()?
Date: Sun, 8 Nov 2026 18:05:34 +0200 [thread overview]
Message-ID: <8a1ff8b8-93b6-4853-a108-a3d0a45ca055@ideasonboard.com> (raw)
In-Reply-To: <20261108102559.GA103930@killaraus.ideasonboard.com>
Hi,
On 08/11/2026 12:25, Laurent Pinchart wrote:
> On Sat, Nov 07, 2026 at 05:31:06PM -0800, DelaySystem wrote:
>>
>> Hello,
>>
>> While working on drivers/staging/media/tegra-video I ran into the FIXME
>> above __tegra_channel_try_format() in vi.c (added by commit 40aaab9d773b
>> in 2022):
>>
>> /* FIXME: Drop this call, drivers are not supposed to use
>> * __v4l2_subdev_state_alloc(). */
>>
>> The driver needs a scratch TRY state to negotiate formats with the remote
>> sensor subdev from video-node ioctl context, where no subdev file handle
>> exists. I looked for the intended replacement, but:
>>
>> - there is no non-dunder allocator in drivers/media or include/media;
>> - v4l2_subdev_call_state_try() is documented for legacy non-MC drivers
>> only, has no in-tree users, and allocates one state per call, while the
>> driver needs one state across enum_frame_size + set_fmt + get_crop;
>> - the active-state APIs have the wrong semantics here, since try_fmt must
>> not disturb ACTIVE state;
>> - the same FIXME is still present in mainline vsp1 and staging atomisp,
>> and mainline stm32-dcmi still calls the dunder directly, with (as far
>> as I can tell) zero conversions since the 2022 rename.
>>
>> So my question: is a new core helper the intended direction for the
>> bridge-driver scratch-TRY-state case, and if so, is there any guidance
>> on the shape it should take? Or is there an existing pattern I missed?
>>
>> If a new helper is the answer, I am happy to implement it and convert
>> the in-tree users.
>
> No, that's not the answer.
I think converting to MC is the answer. At least for a staging driver.
Tomi
next prev parent reply other threads:[~2026-11-08 16:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-08 1:31 DelaySystem
2026-11-08 10:25 ` Laurent Pinchart
2026-11-08 16:05 ` Tomi Valkeinen [this message]
2026-11-08 16:14 ` Laurent Pinchart
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=8a1ff8b8-93b6-4853-a108-a3d0a45ca055@ideasonboard.com \
--to=tomi.valkeinen@ideasonboard.com \
--cc=DelaySystem@tubot.lat \
--cc=hverkuil+cisco@kernel.org \
--cc=jacopo.mondi@ideasonboard.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=sakari.ailus@linux.intel.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®