Linux Media Controller development
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Cc: Eugen Hristev <eugen.hristev@collabora.com>,
	linux-media@vger.kernel.org, Sakari Ailus <sakari.ailus@iki.fi>,
	Hans Verkuil <hverkuil-cisco@xs4all.nl>,
	Nicolas Ferre <nicolas.ferre@microchip.com>,
	Hans de Goede <hdegoede@redhat.com>,
	Thierry Reding <thierry.reding@gmail.com>,
	Jonathan Hunter <jonathanh@nvidia.com>,
	Sowjanya Komatineni <skomatineni@nvidia.com>,
	Luca Ceresoli <luca.ceresoli@bootlin.com>,
	Leon Luo <leonl@leopardimaging.com>,
	Jacopo Mondi <jacopo@jmondi.org>,
	Rui Miguel Silva <rmfrfs@gmail.com>,
	Hans de Goede <hansg@kernel.org>,
	Petr Cvek <petrcvekcz@gmail.com>
Subject: Re: [PATCH 0/7] media: v4l2-subdev: Rename pad config 'try_*' fields
Date: Tue, 24 Oct 2023 11:47:18 +0300	[thread overview]
Message-ID: <20231024084718.GC5121@pendragon.ideasonboard.com> (raw)
In-Reply-To: <8c3659ea-e844-4ad2-b2fb-4eb27d8fccc7@ideasonboard.com>

On Tue, Oct 24, 2023 at 11:41:57AM +0300, Tomi Valkeinen wrote:
> On 24/10/2023 09:55, Eugen Hristev wrote:
> > On 10/24/23 00:40, Laurent Pinchart wrote:
> >> Hello,
> > 
> > Hello Laurent,
> > 
> >>
> >> This series is the result of me getting bothered by the following note
> >> in the documentation of the v4l2_subdev_pad_config structure:
> >>
> >>   * Note: This struct is also used in active state, and the 'try' 
> >> prefix is
> >>   * historical and to be removed.
> >>
> >> So I decided to drop the prefix.
> >>
> >> Patches 1/7 to 6/7 replace direct usage of the fields in drivers with
> >> the corresponding accessor functions. There was a relatively large
> >> number of them in sensor drivers (in 6/7), but more worryingly, the
> >> atmel-isi (1/7), microchip-isc (2/7) and tegra-video (5/7) should really
> >> not have messed up with creating a v4l2_subdev_pad_config structure
> >> manually. I urge the maintainers of those drivers to address the issue.
> > 
> > Could you hint a bit about how the issue should be addressed ?
> > Instead of creating a `v4l2_subdev_pad_config`, one should use 
> > v4l2_subdev_lock_and_get_active_state() ? Is this the right way to do it ?
> 
> I had a quick look at atmel-isi. If I understand it right, it does not 
> expose the subdevs to the userspace, and 'isi->entity.subdev' refers to 
> the sensor.
> 
> In that case I think using v4l2_subdev_call_state_active() and 
> v4l2_subdev_call_state_try() should usually work.
> 
> If there are cases where the same try state needs to be used for 
> multiple calls, then the state management has to be done manually with 
> __v4l2_subdev_state_alloc() and __v4l2_subdev_state_free() (e.g. 
> drivers/media/platform/renesas/rcar-vin/rcar-v4l2.c).

And for the microchip-isc driver, my understanding is that it's an
MC-centric driver. It should therefore not call the sensor's
.enum_frame_size() operation, which would remove the stack-allocated
state in the isc_validate() function.

-- 
Regards,

Laurent Pinchart

      reply	other threads:[~2023-10-24  8:47 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-23 21:40 [PATCH 0/7] media: v4l2-subdev: Rename pad config 'try_*' fields Laurent Pinchart
2023-10-23 21:40 ` [PATCH 1/7] media: atmel-isi: Use accessors for " Laurent Pinchart
2023-10-23 21:40 ` [PATCH 2/7] media: microchip-isc: " Laurent Pinchart
2023-10-23 21:40 ` [PATCH 3/7] media: atmel-isc: " Laurent Pinchart
2023-10-23 21:40 ` [PATCH 4/7] media: atomisp: " Laurent Pinchart
2023-10-23 21:40 ` [PATCH 5/7] media: tegra-video: " Laurent Pinchart
2023-10-25  7:27   ` Luca Ceresoli
2023-10-23 21:40 ` [PATCH 6/7] media: i2c: " Laurent Pinchart
2023-10-23 21:40 ` [PATCH 7/7] media: v4l2-subdev: Rename " Laurent Pinchart
2023-10-24  6:55 ` [PATCH 0/7] " Eugen Hristev
2023-10-24  8:41   ` Tomi Valkeinen
2023-10-24  8:47     ` Laurent Pinchart [this message]

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=20231024084718.GC5121@pendragon.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=eugen.hristev@collabora.com \
    --cc=hansg@kernel.org \
    --cc=hdegoede@redhat.com \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=jacopo@jmondi.org \
    --cc=jonathanh@nvidia.com \
    --cc=leonl@leopardimaging.com \
    --cc=linux-media@vger.kernel.org \
    --cc=luca.ceresoli@bootlin.com \
    --cc=nicolas.ferre@microchip.com \
    --cc=petrcvekcz@gmail.com \
    --cc=rmfrfs@gmail.com \
    --cc=sakari.ailus@iki.fi \
    --cc=skomatineni@nvidia.com \
    --cc=thierry.reding@gmail.com \
    --cc=tomi.valkeinen@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox