From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Cc: linux-media@vger.kernel.org, Chen-Yu Tsai <wens@csie.org>,
Eugen Hristev <eugen.hristev@collabora.com>,
Hans Verkuil <hverkuil-cisco@xs4all.nl>,
Jacopo Mondi <jacopo.mondi@ideasonboard.com>,
Kieran Bingham <kieran.bingham@ideasonboard.com>,
Maxime Ripard <mripard@kernel.org>,
Sakari Ailus <sakari.ailus@iki.fi>,
linux-renesas-soc@vger.kernel.org, linux-sunxi@lists.linux.dev
Subject: Re: [PATCH v2 6/7] media: renesas: vsp1: Implement .link_validate() for video devices
Date: Mon, 26 Aug 2024 15:14:54 +0300 [thread overview]
Message-ID: <20240826121454.GD27785@pendragon.ideasonboard.com> (raw)
In-Reply-To: <05718b7f-0c57-4217-97e1-ef4785d38c01@ideasonboard.com>
Hi Tomi,
On Mon, Aug 26, 2024 at 02:49:44PM +0300, Tomi Valkeinen wrote:
> On 22/08/2024 18:45, Laurent Pinchart wrote:
> > The v4l2_subdev_link_validate() helper prints a warning if the
> > .link_validate() operation is not implemented for video devices
> > connected to the subdevs. Implement the operation to silence the
> > warning.
> >
> > Ideally validation of the link between the video device and the subdev
> > should be implemented in that operation. That would however break
> > userspace that does not configure formats on all video devices before
> > starting streaming. While this mode of operation may not be considered
> > valid by the V4L2 API specification (interpretation differ), it is
> > nonetheless supported by the vsp1 driver at the moment and used by at
> > least the vsp1 unit test suite, and possibly other userspace
> > applciations. Removing it would be a regression.
>
> "applications"
>
> If the media graph is validated when the first stream is enabled, does
> that mean that when the graph is "enabled", we can never change e.g. the
> resolution, even for streams that have not been enabled and even if all
> the drivers would support this?
In the general case, yes. Drivers can already support this use case by
implementing their own link validation. Improvements to generic helpers
could also be possible in the future.
> The pad interdependency should help there, right? Would it help here, too?
Possibly, yes.
> > Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> > ---
> > .../media/platform/renesas/vsp1/vsp1_video.c | 22 +++++++++++++++++++
> > 1 file changed, 22 insertions(+)
> >
> > diff --git a/drivers/media/platform/renesas/vsp1/vsp1_video.c b/drivers/media/platform/renesas/vsp1/vsp1_video.c
> > index fdb46ec0c872..e728f9f5160e 100644
> > --- a/drivers/media/platform/renesas/vsp1/vsp1_video.c
> > +++ b/drivers/media/platform/renesas/vsp1/vsp1_video.c
> > @@ -1081,6 +1081,27 @@ static const struct v4l2_file_operations vsp1_video_fops = {
> > .mmap = vb2_fop_mmap,
> > };
> >
> > +/* -----------------------------------------------------------------------------
> > + * Media entity operations
> > + */
> > +
> > +static int vsp1_video_link_validate(struct media_link *link)
> > +{
> > + /*
> > + * Ideally, link validation should be implemented here instead of
> > + * calling vsp1_video_verify_format() in vsp1_video_streamon()
> > + * manually. That would however break userspace that start one video
> > + * device before configures formats on other video devices in the
> > + * pipeline. This operation is just a no-op to silence the warnings
> > + * from v4l2_subdev_link_validate().
> > + */
> > + return 0;
> > +}
> > +
> > +static const struct media_entity_operations vsp1_video_media_ops = {
> > + .link_validate = vsp1_video_link_validate,
> > +};
> > +
> > /* -----------------------------------------------------------------------------
> > * Suspend and Resume
> > */
> > @@ -1215,6 +1236,7 @@ struct vsp1_video *vsp1_video_create(struct vsp1_device *vsp1,
> >
> > /* ... and the video node... */
> > video->video.v4l2_dev = &video->vsp1->v4l2_dev;
> > + video->video.entity.ops = &vsp1_video_media_ops;
> > video->video.fops = &vsp1_video_fops;
> > snprintf(video->video.name, sizeof(video->video.name), "%s %s",
> > rwpf->entity.subdev.name, direction);
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2024-08-26 12:14 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-22 15:45 [PATCH v2 0/7] media: v4l2: Improve media link validation Laurent Pinchart
2024-08-22 15:45 ` [PATCH v2 1/7] media: microchip-isc: Drop v4l2_subdev_link_validate() for video devices Laurent Pinchart
2024-08-26 10:58 ` Tomi Valkeinen
2024-08-22 15:45 ` [PATCH v2 2/7] media: sun4i_csi: Implement link validate for sun4i_csi subdev Laurent Pinchart
2024-08-26 10:59 ` Tomi Valkeinen
2024-08-22 15:45 ` [PATCH v2 3/7] media: sun4i_csi: Don't use v4l2_subdev_link_validate() for video device Laurent Pinchart
2024-08-26 11:04 ` Tomi Valkeinen
2024-08-26 11:56 ` Laurent Pinchart
2024-08-22 15:45 ` [PATCH v2 4/7] media: v4l2-subdev: Refactor warnings in v4l2_subdev_link_validate() Laurent Pinchart
2024-08-26 11:10 ` Tomi Valkeinen
2024-08-26 12:05 ` Laurent Pinchart
2024-08-22 15:45 ` [PATCH v2 5/7] media: v4l2-subdev: Support hybrid links " Laurent Pinchart
2024-08-26 11:23 ` Tomi Valkeinen
2024-08-26 12:11 ` Laurent Pinchart
2024-08-22 15:45 ` [PATCH v2 6/7] media: renesas: vsp1: Implement .link_validate() for video devices Laurent Pinchart
2024-08-26 11:49 ` Tomi Valkeinen
2024-08-26 12:14 ` Laurent Pinchart [this message]
2024-08-22 15:45 ` [PATCH v2 7/7] [DNI] media: renesas: vsp1: Validate all links through .link_validate() Laurent Pinchart
2024-08-26 11:43 ` Tomi Valkeinen
2024-08-26 12:18 ` Laurent Pinchart
2024-08-26 12:22 ` Tomi Valkeinen
2024-08-26 12:25 ` Laurent Pinchart
2024-08-26 12:36 ` Tomi Valkeinen
-- strict thread matches above, loose matches on Subject: below --
2024-08-22 15:35 [PATCH v2 0/7] media: v4l2: Improve media link validation Laurent Pinchart
2024-08-22 15:35 ` [PATCH v2 6/7] media: renesas: vsp1: Implement .link_validate() for video devices 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=20240826121454.GD27785@pendragon.ideasonboard.com \
--to=laurent.pinchart@ideasonboard.com \
--cc=eugen.hristev@collabora.com \
--cc=hverkuil-cisco@xs4all.nl \
--cc=jacopo.mondi@ideasonboard.com \
--cc=kieran.bingham@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=linux-sunxi@lists.linux.dev \
--cc=mripard@kernel.org \
--cc=sakari.ailus@iki.fi \
--cc=tomi.valkeinen@ideasonboard.com \
--cc=wens@csie.org \
/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