From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Cc: "Milen Mitkov (Consultant)" <mmitkov@quicinc.com>,
"linux-media@vger.kernel.org" <linux-media@vger.kernel.org>,
"sakari.ailus@linux.intel.com" <sakari.ailus@linux.intel.com>,
Jacopo Mondi <jacopo+renesas@jmondi.org>,
"niklas.soderlund+renesas@ragnatech.se"
<niklas.soderlund+renesas@ragnatech.se>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Hans Verkuil <hverkuil-cisco@xs4all.nl>,
Pratyush Yadav <p.yadav@ti.com>,
Kishon Vijay Abraham <kishon@ti.com>,
"satish.nagireddy@getcruise.com" <satish.nagireddy@getcruise.com>,
Tomasz Figa <tfiga@chromium.org>
Subject: Re: [PATCH v12 00/30] v4l: routing and streams support
Date: Fri, 19 Aug 2022 05:31:08 +0300 [thread overview]
Message-ID: <Yv717OFWbbgvginn@pendragon.ideasonboard.com> (raw)
In-Reply-To: <d713dfb0-5506-ce04-36eb-5ca19a1088ee@ideasonboard.com>
On Mon, Aug 08, 2022 at 09:45:38AM +0300, Tomi Valkeinen wrote:
> On 05/08/2022 18:14, Milen Mitkov (Consultant) wrote:
>
> > >> If I want to configure the CSI decoder subdev (msm_csid0) to receive 1
> > >> stream on the sink pad and route it to 2 streams on its source pad. Is
> > >> my thinking correct?
> > >
> > > Yes, if your HW can do that. I don't have HW that can split (or clone) a
> > > stream, so it's possible that the use case doesn't work.
> >
> > Now here's the main question. We use the CSI decoder (CSID) hardware to
> > split
> > one stream from the sensor into 2 or more streams based on datatype or
> > CSI virtual channel.
> >
> > Basically, the complete pipeline is something like this, for 2 virtual
> > channels:
> >
> > -> ISP line 0 -> videodev /dev/video0
> > /
> > sensor -> CSIPHY -> CSID ->
> > \
> > -> ISP line 1 -> videodev /dev/video1
> >
> >
> > So my idea was to make the CSID subdevice multistream API compliant
> > (e.g. V4L2_SUBDEV_FL_STREAMS, manage the active state with the
> > V4L2 API v4l2_subdev_get_locked_active_state, take care of routing setup
> > etc.),
> > but keep the rest of the devices the way they are.
>
> That's now how the streams support has been designed. Your sensor
> provides two streams, and all the drivers that pass through multiple
> streams needs to be ported to streams API. So in your case, I believe
> everything but the "ISP line" needs to support streams.
To add a bit of information here, the important thing to understand is
that streams and physical links are two different concepts. The above
diagram describes the physical links (both outside the SoC, and inside
it). Streams are carried by physical links, and a link can carry
multiple streams (hence the name "multiplexed streams" used in this
patch series). If the sensor outputs image data and embedded data with
two CSI-2 DT on one VC, that's two streams carried over the sensor ->
CSIPHY link, and the same two streams going over the CSIPHY -> CSID
link. The CSID demultiplexes the streams, with one stream going to ISP
line 0 and the other one to ISP line 1. As Tomi explained, every subdev
that deals with multiple streams has to implement the new API. This
includes, in this case, the sensor, the CSIPHY and the CSID.
If the sensor were to output two images in different resolutions over
two VCs, it would conceptually be the same, with two streams. If it were
to output image data, embedded data and black level lines over with 3
DTs over one VC, that would be three streams. And so on.
> > The CSID subdev must take 1 stream on the sink pad and output on 2
> > source pads.
> >
> > The routing configuration I use for the CSID subdev looks like this:
> >
> > media-ctl -R '"msm_csid0"[0/0->1/0[0x1],0/0->2/0[0x1]]'
> >
> > 0 - sink pad, 1 - first source pad, 2 - second source pad
> >
> > However, this routing setup fails with the validation in
> > v4l2_link_validate_get_streams().
> > The logic there figures these are duplicate streams because because they
> > start at the same sink pad.
> >
> > To summarize my questions:
> >
> > 1. Is there some sort of restriction that the same sink pad can't be
> > used for more than 1 stream starting from it?
>
> In theory no, but it hasn't been tested. I think this case would mainly
> be cloning of the stream, not really splitting it.
>
> > 2. Is it ok to migrate only one subdevice to the multistream API
> > or should all possible subdevices in the pipeline be migrated?
>
> It's ok to mix streams and non-streams subdevices, but the non-streams
> subdevs must only use a single stream. E.g. You could have 4 non-streams
> cameras, each providing a single stream to a bridge. The bridge would
> support streams, and the bridge would send the 4 streams in a single
> CSI-2 bus.
>
> Now, that said, I don't think anything strictly prevents from supporting
> stream splitting, but as I mentioned above, it's not been tested or
> really even considered very much. It's also a bit ambiguous and unclear
> and I'd stay away from it if full streams support makes sense.
>
> I think if a source subdev (sensor) knows that it's providing multiple
> streams, then it should use streams API to provide those. I.e. if the
> sensor is providing different types of data, using VCs or DTs, then
> those are clearly separate streams and the sensor driver must be aware
> of them.
>
> Stream splitting might came into play in situations where the sensor
> provides just a single stream, but a bridge subdev splits it based on
> information the sensor can't be aware of. For example, the sensor
> provides a normal pixel stream, and the bridge subdev splits the frames
> into two halves, sending upper half to output 1 and lower half to output 2.
We've tested splitting on an i.MX8MP, with two different processing
pipelines capturing the stream produced by a single YUV sensor, in
different resolutions and formats. It works (or at least worked with v11
of the streams series, I'll update the code to v13 and retest).
--
Regards,
Laurent Pinchart
prev parent reply other threads:[~2022-08-19 2:31 UTC|newest]
Thread overview: 65+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-27 10:36 [PATCH v12 00/30] v4l: routing and streams support Tomi Valkeinen
2022-07-27 10:36 ` [PATCH v12 01/30] media: Documentation: mc: add definitions for stream and pipeline Tomi Valkeinen
2022-07-27 10:36 ` [PATCH v12 02/30] media: mc: entity: Add iterator helper for entity pads Tomi Valkeinen
2022-07-30 11:11 ` Sakari Ailus
2022-08-01 5:58 ` Tomi Valkeinen
2022-07-27 10:36 ` [PATCH v12 03/30] media: mc: entity: Merge media_entity_enum_init and __media_entity_enum_init Tomi Valkeinen
2022-07-27 10:36 ` [PATCH v12 04/30] media: mc: entity: Move media_entity_get_fwnode_pad() out of graph walk section Tomi Valkeinen
2022-07-27 10:36 ` [PATCH v12 05/30] media: mc: entity: Add media_entity_pipeline() to access the media pipeline Tomi Valkeinen
2022-07-30 11:21 ` Sakari Ailus
2022-08-01 6:01 ` Tomi Valkeinen
2022-07-27 10:36 ` [PATCH v12 06/30] media: mc: entity: Add has_route entity operation and media_entity_has_route() helper Tomi Valkeinen
2022-07-27 10:36 ` [PATCH v12 07/30] media: mc: entity: Rename streaming_count -> start_count Tomi Valkeinen
2022-07-27 10:36 ` [PATCH v12 08/30] media: mc: entity: add media_pipeline_alloc_start & media_pipeline_stop_free Tomi Valkeinen
2022-07-29 8:30 ` [EXT] " Satish Nagireddy
2022-07-29 8:40 ` Tomi Valkeinen
2022-07-27 10:36 ` [PATCH v12 09/30] media: mc: entity: Rewrite media_pipeline_start() to support routes Tomi Valkeinen
2022-07-29 8:45 ` [EXT] " Satish Nagireddy
2022-07-29 8:53 ` Tomi Valkeinen
2022-07-29 9:19 ` [EXT] " Satish Nagireddy
2022-07-29 10:27 ` Tomi Valkeinen
2022-07-29 17:00 ` [EXT] " Satish Nagireddy
2022-07-29 17:07 ` Tomi Valkeinen
2022-07-29 18:20 ` [EXT] " Satish Nagireddy
2022-07-30 11:56 ` Sakari Ailus
2022-08-01 9:33 ` Tomi Valkeinen
2022-08-01 11:06 ` Sakari Ailus
2022-07-27 10:36 ` [PATCH v12 10/30] media: add V4L2_SUBDEV_FL_STREAMS Tomi Valkeinen
2022-07-27 10:36 ` [PATCH v12 11/30] media: add V4L2_SUBDEV_CAP_MPLEXED Tomi Valkeinen
2022-07-27 10:36 ` [PATCH v12 12/30] media: Documentation: Add GS_ROUTING documentation Tomi Valkeinen
2022-07-27 10:36 ` [PATCH v12 13/30] media: subdev: Add [GS]_ROUTING subdev ioctls and operations Tomi Valkeinen
2022-07-27 10:36 ` [PATCH v12 14/30] media: subdev: add v4l2_subdev_has_route() Tomi Valkeinen
2022-07-27 10:36 ` [PATCH v12 15/30] media: subdev: add v4l2_subdev_set_routing helper() Tomi Valkeinen
2022-08-01 6:59 ` Sakari Ailus
2022-08-01 7:38 ` Tomi Valkeinen
2022-07-27 10:36 ` [PATCH v12 16/30] media: Documentation: add multiplexed streams documentation Tomi Valkeinen
2022-07-27 10:36 ` [PATCH v12 17/30] media: subdev: add stream based configuration Tomi Valkeinen
2022-07-27 10:36 ` [PATCH v12 18/30] media: subdev: use streams in v4l2_subdev_link_validate() Tomi Valkeinen
2022-07-29 9:12 ` [EXT] " Satish Nagireddy
2022-07-29 11:00 ` Tomi Valkeinen
2022-07-29 17:33 ` [EXT] " Satish Nagireddy
2022-07-27 10:36 ` [PATCH v12 19/30] media: subdev: add "opposite" stream helper funcs Tomi Valkeinen
2022-07-27 10:36 ` [PATCH v12 20/30] media: subdev: add streams to v4l2_subdev_get_fmt() helper function Tomi Valkeinen
2022-07-29 9:16 ` [EXT] " Satish Nagireddy
2022-07-29 10:30 ` Tomi Valkeinen
2022-07-29 17:01 ` [EXT] " Satish Nagireddy
2022-07-27 10:36 ` [PATCH v12 21/30] media: subdev: add v4l2_subdev_set_routing_with_fmt() helper Tomi Valkeinen
2022-07-27 10:36 ` [PATCH v12 22/30] media: subdev: add v4l2_subdev_routing_validate() helper Tomi Valkeinen
2022-07-27 10:36 ` [PATCH v12 23/30] media: subdev: Add for_each_active_route() macro Tomi Valkeinen
2022-08-01 8:40 ` Tomi Valkeinen
2022-08-01 11:09 ` Sakari Ailus
2022-07-27 10:36 ` [PATCH v12 24/30] media: subdev: use for_each_active_route() in v4l2_subdev_init_stream_configs() Tomi Valkeinen
2022-07-27 10:36 ` [PATCH v12 25/30] media: subdev: use for_each_active_route() in v4l2_link_validate_get_streams() Tomi Valkeinen
2022-07-27 10:36 ` [PATCH v12 26/30] media: v4l2-subdev: Add v4l2_subdev_state_xlate_streams() helper Tomi Valkeinen
2022-08-01 12:37 ` Sakari Ailus
2022-08-01 14:25 ` Tomi Valkeinen
2022-07-27 10:36 ` [PATCH v12 27/30] media: v4l2-subdev: Add subdev .(enable|disable)_streams() operations Tomi Valkeinen
2022-07-27 10:36 ` [PATCH v12 28/30] media: v4l2-subdev: Add v4l2_subdev_s_stream_helper() function Tomi Valkeinen
2022-07-27 10:36 ` [PATCH v12 29/30] media: Add stream to frame descriptor Tomi Valkeinen
2022-07-27 10:36 ` [PATCH v12 30/30] media: subdev: increase V4L2_FRAME_DESC_ENTRY_MAX to 8 Tomi Valkeinen
2022-07-27 10:42 ` [PATCH v12 00/30] v4l: routing and streams support Tomi Valkeinen
2022-07-31 20:47 ` Sakari Ailus
2022-08-01 6:28 ` Tomi Valkeinen
[not found] ` <MW4PR02MB737849AF15E8004B2CB39C3BB09C9@MW4PR02MB7378.namprd02.prod.outlook.com>
2022-08-03 11:37 ` Tomi Valkeinen
[not found] ` <MW4PR02MB73781CDA5C792C28390BAF29B09E9@MW4PR02MB7378.namprd02.prod.outlook.com>
2022-08-08 6:45 ` Tomi Valkeinen
2022-08-19 2:31 ` 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=Yv717OFWbbgvginn@pendragon.ideasonboard.com \
--to=laurent.pinchart@ideasonboard.com \
--cc=hverkuil-cisco@xs4all.nl \
--cc=jacopo+renesas@jmondi.org \
--cc=kishon@ti.com \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=mmitkov@quicinc.com \
--cc=niklas.soderlund+renesas@ragnatech.se \
--cc=p.yadav@ti.com \
--cc=sakari.ailus@linux.intel.com \
--cc=satish.nagireddy@getcruise.com \
--cc=tfiga@chromium.org \
--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 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.