All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
To: Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: linux-media@vger.kernel.org,
	Jacopo Mondi <jacopo+renesas@jmondi.org>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	niklas.soderlund+renesas@ragnatech.se,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Hans Verkuil <hverkuil-cisco@xs4all.nl>,
	Kishon Vijay Abraham <kishon@ti.com>,
	satish.nagireddy@getcruise.com, Tomasz Figa <tfiga@chromium.org>
Subject: Re: [PATCH 1/1] media: Documentation: Interaction between routes, formats and selections
Date: Wed, 12 Oct 2022 13:30:53 +0300	[thread overview]
Message-ID: <dbe3ff30-df57-e981-90c1-3b917e9ee65f@ideasonboard.com> (raw)
In-Reply-To: <20221011104729.1058-1-sakari.ailus@linux.intel.com>

Hoi,

On 11/10/2022 13:47, Sakari Ailus wrote:
> Document how setting up routes interacts with formats and selections.
> 
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> ---
> Moi,
> 
> This could be added on top of the set.
> 
> Comments are welcome.
> 
>   .../userspace-api/media/v4l/dev-subdev.rst    | 48 ++++++++++++++-----
>   1 file changed, 37 insertions(+), 11 deletions(-)
> 
> diff --git a/Documentation/userspace-api/media/v4l/dev-subdev.rst b/Documentation/userspace-api/media/v4l/dev-subdev.rst
> index 5075b1828b32d..830235eb01598 100644
> --- a/Documentation/userspace-api/media/v4l/dev-subdev.rst
> +++ b/Documentation/userspace-api/media/v4l/dev-subdev.rst
> @@ -406,6 +406,8 @@ pixel array is not rectangular but cross-shaped or round. The maximum
>   size may also be smaller than the BOUNDS rectangle.
>   
>   
> +.. _format-propagation:
> +
>   Order of configuration and format propagation
>   ---------------------------------------------
>   
> @@ -507,12 +509,12 @@ source pads.
>   Streams, multiplexed media pads and internal routing
>   ----------------------------------------------------
>   
> -Commonly V4L2 subdevices support only separate video streams, that is, only a
> -single stream can pass through a media link and a media pad. Thus each pad
> -contains a format configuration for that single stream. In some cases a subdev
> -can do stream processing and split a stream into two or compose two streams
> -into one, but the inputs and outputs for the subdev are still a single stream
> -per pad.
> +Commonly V4L2 subdevices do not support multiple, unrelated video streams.

I wonder if we should use some other word than "commonly", as it seems 
pretty common nowadays that there is at least a embedded data. Should we 
instead say, e.g., "Simple V4L2 subdevices..."

> +Only a single stream can pass through a media link and a media

This could be a continuation of the previous sentence: "... video 
streams, and only a single stream..."

> +pad. Thus each pad contains a format and selection configuration for that single stream.
> +A subdev can do stream processing and split a stream into
> +two or compose two streams into one, but the inputs and outputs for the
> +subdev are still a single stream per pad.
>   
>   Some hardware, e.g. MIPI CSI-2, support multiplexed streams, that is, multiple
>   data streams are transmitted on the same bus, which is represented by a media
> @@ -539,15 +541,37 @@ streams from one end of the link to the other, and subdevices have routing
>   tables which describe how the incoming streams from sink pads are routed to the
>   source pads.
>   
> -A stream ID (often just "stream") is a media link-local identifier for a stream.
> +A stream ID is a media link-local identifier for a stream.
>   In other words, a particular stream ID must exist on both sides of a media
>   link, but another stream ID can be used for the same stream at the other side
> -of the subdevice.
> +of the subdevice. The same stream ID is used to refer to the stream on
> +both pads of the link on all ioctls operating on pads.
>   
>   A stream at a specific point in the media pipeline is identified with the
> -subdev and a (pad, stream) pair. For subdevices that do not support
> +subdev and a pad--stream pair. For subdevices that do not support

Is there a double-dash on purpose?

Btw, above you removed the "(often just "stream")", but here you use 
"stream" instead of "stream ID".

>   multiplexed streams the 'stream' is always 0.
>   
> +Interaction between routes, formats and selections
> +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> +
> +The addition of routes to the V4L2 sub-device interface moves the
> +sub-device formats and selections from pads to pad--stream pairs. Instead

I guess it is, as you use it here also...

> +of the sub-device wide merging of streams from all source pads towards all
> +sink pads, this takes place separately for each route. The stream ID on
> +the sink pad for each configured route is used to configure format and
> +selections on the sink pad. Similarly, the stream ID on the source pad of
> +each configured route is used to configure format and selections on the
> +source pad.

Hmm, "stream ID is used to configure format" sounds odd to me. The ioctl 
is used to configure the format, but rather than using only pad ID to 
identify the configuration target, you now use pad ID - stream ID pair.

And is that just extra duplication above to talk separately about sink 
and source sides? They don't matter here, the point is just the 
pad-stream vs only pad.

> +
> +Any number of routes from streams on sink pads towards streams on source

This also sounds a bit odd to me: "a route from a stream on a sink pad". 
I think we're missing a word here which means the specific point of a 
stream in the pipeline.

I have suggested "stream endpoint", but it's not really an "end" point. 
"Stream waypoint"? So you would configure a format to a subdev's stream 
waypoint. And "Any number of routes from stream waypoints on sink pads 
towards stream waypoints on source pads".

So a "stream waypoint" would be a triplet of subdev-padID-streamID, or 
just padID-streamID if the subdev is obvious.

Even if we don't find a perfect or even a very good term for this, I 
think we should just use something. Using just "stream" makes things 
quite confusing, in my opinion.

> +pads is allowed, to the extent supported by drivers. For every stream on a
> +sink pad, however, only a single route is allowed.

Hmm, why is that?

> +
> +Pad--stream pairs are not static but are replaced by calls to the
> +:ref:`VIDIOC_SUBDEV_S_ROUTING <VIDIOC_SUBDEV_G_ROUTING>` ioctl. This also
> +applies to stream format and selection configurations which that are

Should that "applies to" be "affects the"?

> +reverted to driver defaults.
> +
>   Configuring streams
>   ^^^^^^^^^^^^^^^^^^^
>   
> @@ -565,8 +589,10 @@ Controller API <media_controller>`
>   setting the routing table will reset all the stream configurations in a media
>   entity.
>   
> -3) Configure streams. Each route endpoint must be configured

Oh, here I seem to use "route endpoint".

> -with :ref:`VIDIOC_SUBDEV_S_FMT <VIDIOC_SUBDEV_G_FMT>`.
> +3) Configure formats and selections on routes. Each route is configured

I'm not sure if we "configure formats on routes". Earlier I think we've 
talked about configuring the streams (stream waypoints).

> +separately as documented plain subdevices in :ref:`<format-propagation>`.

Is there something missing from above? Or drop "plain subdevices"?

> +The stream ID is set to the same stream ID used on sink and source pads of
> +the :ref:`VIDIOC_SUBDEV_S_ROUTING <VIDIOC_SUBDEV_G_ROUTING>` ioctl.

Yes. But I think this could be said more clearly if we have a good word 
for the padID-streamID pair.

  Tomi


  reply	other threads:[~2022-10-12 10:31 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-03 12:18 [PATCH v15 00/19] v4l: routing and streams support Tomi Valkeinen
2022-10-03 12:18 ` [PATCH v15 01/19] media: v4l2-subdev: Sort includes Tomi Valkeinen
2022-10-03 16:53   ` Laurent Pinchart
2022-10-03 12:18 ` [PATCH v15 02/19] media: add V4L2_SUBDEV_FL_STREAMS Tomi Valkeinen
2022-10-03 12:18 ` [PATCH v15 03/19] media: add V4L2_SUBDEV_CAP_STREAMS Tomi Valkeinen
2022-10-03 12:18 ` [PATCH v15 04/19] media: Documentation: Add GS_ROUTING documentation Tomi Valkeinen
2022-10-03 14:31   ` Hans Verkuil
2022-10-12 10:01     ` Tomi Valkeinen
2022-10-03 12:18 ` [PATCH v15 05/19] media: subdev: Add [GS]_ROUTING subdev ioctls and operations Tomi Valkeinen
2022-10-03 14:26   ` Hans Verkuil
2022-10-03 22:01     ` Sakari Ailus
2022-10-04  8:43       ` Hans Verkuil
2022-10-04 10:05         ` Sakari Ailus
2022-10-12  8:15           ` Tomi Valkeinen
2022-10-03 12:18 ` [PATCH v15 06/19] media: subdev: add v4l2_subdev_has_pad_interdep() Tomi Valkeinen
2022-10-03 12:18 ` [PATCH v15 07/19] media: subdev: add v4l2_subdev_set_routing helper() Tomi Valkeinen
2022-10-12  6:22   ` Yunke Cao
2022-10-12  6:58     ` Tomi Valkeinen
2022-10-03 12:18 ` [PATCH v15 08/19] media: subdev: Add for_each_active_route() macro Tomi Valkeinen
2022-10-09  5:38   ` Dafna Hirschfeld
2022-10-12  6:15     ` Tomi Valkeinen
2022-10-13  7:41       ` Sakari Ailus
2022-10-03 12:18 ` [PATCH v15 09/19] media: Documentation: add multiplexed streams documentation Tomi Valkeinen
2022-10-11 10:47   ` [PATCH 1/1] media: Documentation: Interaction between routes, formats and selections Sakari Ailus
2022-10-12 10:30     ` Tomi Valkeinen [this message]
2022-12-07 10:38       ` Sakari Ailus
2022-10-03 12:18 ` [PATCH v15 10/19] media: subdev: add stream based configuration Tomi Valkeinen
2022-10-09  6:24   ` Dafna Hirschfeld
2022-10-12  6:36     ` Tomi Valkeinen
2022-10-03 12:18 ` [PATCH v15 11/19] media: subdev: use streams in v4l2_subdev_link_validate() Tomi Valkeinen
2022-10-14 10:54   ` Sakari Ailus
2022-10-14 11:10     ` Tomi Valkeinen
2022-10-16 22:37       ` Sakari Ailus
2022-10-27 10:43         ` Tomi Valkeinen
2022-10-03 12:18 ` [PATCH v15 12/19] media: subdev: add "opposite" stream helper funcs Tomi Valkeinen
2022-10-09  7:06   ` Dafna Hirschfeld
2022-10-12  6:46     ` Tomi Valkeinen
2022-10-03 12:18 ` [PATCH v15 13/19] media: subdev: add streams to v4l2_subdev_get_fmt() helper function Tomi Valkeinen
2022-10-03 12:18 ` [PATCH v15 14/19] media: subdev: add v4l2_subdev_set_routing_with_fmt() helper Tomi Valkeinen
2022-10-03 12:18 ` [PATCH v15 15/19] media: subdev: add v4l2_subdev_routing_validate() helper Tomi Valkeinen
2022-10-03 12:18 ` [PATCH v15 16/19] media: v4l2-subdev: Add v4l2_subdev_state_xlate_streams() helper Tomi Valkeinen
2022-10-03 12:18 ` [PATCH v15 17/19] media: v4l2-subdev: Add subdev .(enable|disable)_streams() operations Tomi Valkeinen
2022-10-10 16:53   ` Dafna Hirschfeld
2022-10-12  5:59     ` Tomi Valkeinen
2022-10-03 12:18 ` [PATCH v15 18/19] media: v4l2-subdev: Add v4l2_subdev_s_stream_helper() function Tomi Valkeinen
2022-10-03 12:18 ` [PATCH v15 19/19] media: Add stream to frame descriptor Tomi Valkeinen

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=dbe3ff30-df57-e981-90c1-3b917e9ee65f@ideasonboard.com \
    --to=tomi.valkeinen@ideasonboard.com \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=jacopo+renesas@jmondi.org \
    --cc=kishon@ti.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=niklas.soderlund+renesas@ragnatech.se \
    --cc=sakari.ailus@linux.intel.com \
    --cc=satish.nagireddy@getcruise.com \
    --cc=tfiga@chromium.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 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.