All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: 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>,
	Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>,
	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 12:25:59 +0200	[thread overview]
Message-ID: <20261108102559.GA103930@killaraus.ideasonboard.com> (raw)
In-Reply-To: <20261108013106.1162346-1-DelaySystem@tubot.lat>

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.

-- 
Regards,

Laurent Pinchart

  reply	other threads:[~2026-11-08 10:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-08  1:31 What should bridge drivers use instead of __v4l2_subdev_state_alloc()? DelaySystem
2026-11-08 10:25 ` Laurent Pinchart [this message]
2026-11-08 16:05   ` Tomi Valkeinen
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=20261108102559.GA103930@killaraus.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=DelaySystem@tubot.lat \
    --cc=hverkuil+cisco@kernel.org \
    --cc=jacopo.mondi@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    --cc=tomi.valkeinen+renesas@ideasonboard.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.