All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans Verkuil <hverkuil@xs4all.nl>
To: Sakari Ailus <sakari.ailus@linux.intel.com>, linux-media@vger.kernel.org
Cc: laurent.pinchart@ideasonboard.com,
	tomi.valkeinen@ideasonboard.com, bingbu.cao@intel.com,
	hongju.wang@intel.com
Subject: Re: [RFC 3/7] media: uapi: v4l: Document source routes
Date: Thu, 8 Jun 2023 10:20:40 +0200	[thread overview]
Message-ID: <e635ea49-c185-c02f-fe37-adc4c30b752c@xs4all.nl> (raw)
In-Reply-To: <20230505215257.60704-4-sakari.ailus@linux.intel.com>

On 05/05/2023 23:52, Sakari Ailus wrote:
> Document how internal pads are used on source routes.
> 
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> ---
>  .../userspace-api/media/v4l/dev-subdev.rst     | 18 ++++++++++++++++++
>  .../media/v4l/vidioc-subdev-g-routing.rst      |  5 +++++
>  include/uapi/linux/v4l2-subdev.h               |  6 +++++-
>  3 files changed, 28 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/userspace-api/media/v4l/dev-subdev.rst b/Documentation/userspace-api/media/v4l/dev-subdev.rst
> index a4f1df7093e8..395e06d2f0f2 100644
> --- a/Documentation/userspace-api/media/v4l/dev-subdev.rst
> +++ b/Documentation/userspace-api/media/v4l/dev-subdev.rst
> @@ -551,6 +551,24 @@ A stream at a specific point in the media pipeline is identified by the
>  sub-device and a (pad, stream) pair. For sub-devices that do not support
>  multiplexed streams the 'stream' field is always 0.
>  
> +.. _v4l2-subdev-source-routes:
> +
> +Source routes
> +^^^^^^^^^^^^^
> +
> +Cases where a single sub-device pad is a source of multiple streams are special
> +as there is no sink pad for such a route. In those cases, an internal pad is
> +used as the sink pad. Such pads have the :ref:`MEDIA_PAD_FL_INTERNAL_SOURCE
> +<MEDIA-PAD-FL-INTERNAL-SOURCE>` flag set.

add: instead of the <MEDIA-PAD-FL-SINK> flag.

> +
> +Internal pads have all the properties of a sink pad in such case, including
> +formats and selections. The format in this case is the source format of the
> +stream. An internal pad always has a single stream only (0).
> +
> +Generally source routes are not modifiable but they can be activated and
> +inactivated using the :ref:`V4L2_SUBDEV_ROUTE_FL_ACTIVE

inactivated -> deactivated

> +<v4l2-subdev-routing-flags>` flag, depending on driver capabilities.
> +

Again, this really needs one or more examples.

>  Interaction between routes, streams, formats and selections
>  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>  
> diff --git a/Documentation/userspace-api/media/v4l/vidioc-subdev-g-routing.rst b/Documentation/userspace-api/media/v4l/vidioc-subdev-g-routing.rst
> index 68ca343c3b44..e00622071b64 100644
> --- a/Documentation/userspace-api/media/v4l/vidioc-subdev-g-routing.rst
> +++ b/Documentation/userspace-api/media/v4l/vidioc-subdev-g-routing.rst
> @@ -94,6 +94,11 @@ for all the route entries and call ``VIDIOC_SUBDEV_G_ROUTING`` again.
>      * - __u32
>        - ``sink_pad``
>        - Sink pad number.
> +    * - __u32
> +      - ``internal_source_pad``
> +      - Internal source pad number. For pads with :ref:`internal source pad flag
> +	<MEDIA-PAD-FL-INTERNAL-SOURCE>`, for use with :ref:`source routes
> +	<v4l2-subdev-source-routes>`.
>      * - __u32
>        - ``sink_stream``
>        - Sink pad stream number.
> diff --git a/include/uapi/linux/v4l2-subdev.h b/include/uapi/linux/v4l2-subdev.h
> index 4a195b68f28f..703e3a1f199b 100644
> --- a/include/uapi/linux/v4l2-subdev.h
> +++ b/include/uapi/linux/v4l2-subdev.h
> @@ -203,6 +203,7 @@ struct v4l2_subdev_capability {
>   * struct v4l2_subdev_route - A route inside a subdev
>   *
>   * @sink_pad: the sink pad index
> + * @internal_source_pad: the internal source pad
>   * @sink_stream: the sink stream identifier
>   * @source_pad: the source pad index
>   * @source_stream: the source stream identifier
> @@ -210,7 +211,10 @@ struct v4l2_subdev_capability {
>   * @reserved: drivers and applications must zero this array
>   */
>  struct v4l2_subdev_route {
> -	__u32 sink_pad;
> +	union {
> +		__u32 sink_pad;
> +		__u32 internal_source_pad;

Nobody will understand this. I think this should still be kept as
sink_pad. If the INTERNAL_SOURCE flag is changed to SINK_FROM_INTERNAL_SOURCE
(or something along those lines), then 'sink_pad' still makes sense
and you don't need this change.

It's still a sink pad, just a sink pad with a special property in that it
receives the data from an internal source.

> +	};
>  	__u32 sink_stream;
>  	__u32 source_pad;
>  	__u32 source_stream;

Regards,

	Hans

  parent reply	other threads:[~2023-06-08  8:20 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-05 21:52 [RFC 0/7] Generic line based metadata support, internal pads Sakari Ailus
2023-05-05 21:52 ` [RFC 1/7] media: mc: Add INTERNAL_SOURCE pad type flag Sakari Ailus
2023-05-08  9:52   ` Tomi Valkeinen
2023-05-08 12:04     ` Sakari Ailus
2023-05-08 12:07       ` Tomi Valkeinen
2023-05-08 12:28         ` Sakari Ailus
2023-06-02  9:18   ` Laurent Pinchart
2023-06-02 15:05     ` Sakari Ailus
2023-06-08  7:59   ` Hans Verkuil
2023-06-09 12:44     ` Sakari Ailus
2023-05-05 21:52 ` [RFC 2/7] media: v4l: subdev: Support INTERNAL_SOURCE pads in routing IOCTLs Sakari Ailus
2023-05-08 10:14   ` Tomi Valkeinen
2023-05-08 12:24     ` Sakari Ailus
2023-06-02  9:44       ` Laurent Pinchart
2023-06-02  9:46         ` Laurent Pinchart
2023-06-02 13:10           ` Sakari Ailus
2023-06-04 14:26             ` Laurent Pinchart
2023-06-05  8:06               ` Sakari Ailus
2023-06-05  8:23                 ` Laurent Pinchart
2023-06-08  8:06   ` Hans Verkuil
2023-05-05 21:52 ` [RFC 3/7] media: uapi: v4l: Document source routes Sakari Ailus
2023-05-08 10:33   ` Tomi Valkeinen
2023-05-08 16:26     ` Sakari Ailus
2023-05-08 16:35       ` Tomi Valkeinen
2023-05-08 17:41         ` Sakari Ailus
2023-06-02  9:56           ` Laurent Pinchart
2023-06-02  9:56         ` Laurent Pinchart
2023-06-09 12:55           ` Sakari Ailus
2023-06-08  8:20   ` Hans Verkuil [this message]
2023-05-05 21:52 ` [RFC 4/7] media: mc: Check pad flag validity Sakari Ailus
2023-06-02  9:58   ` Laurent Pinchart
2023-06-09 14:41     ` Sakari Ailus
2023-05-05 21:52 ` [RFC 5/7] media: uapi: Add generic serial metadata mbus formats Sakari Ailus
2023-06-02 10:36   ` Laurent Pinchart
2023-06-09 14:45     ` Sakari Ailus
2023-06-08  8:35   ` Hans Verkuil
2023-06-09 13:34     ` Sakari Ailus
2023-06-08  8:46   ` Hans Verkuil
2023-06-09 13:38     ` Sakari Ailus
2023-05-05 21:52 ` [RFC 6/7] media: uapi: Add generic 8-bit metadata format definitions Sakari Ailus
2023-06-08  8:54   ` Hans Verkuil
2023-06-09 14:27     ` Sakari Ailus
2023-05-05 21:52 ` [RFC 7/7] media: v4l: Support line-based metadata capture Sakari Ailus
2023-06-02 10:50   ` Laurent Pinchart
2023-06-09 13:46     ` Sakari Ailus
2023-06-02  7:54 ` [RFC 0/7] Generic line based metadata support, internal pads Naushir Patuck
2023-06-02  8:46   ` Sakari Ailus
2023-06-02  9:35     ` Naushir Patuck
2023-06-02 12:05       ` Sakari Ailus
2023-06-02  9:12   ` Laurent Pinchart
2023-06-02  9:43     ` Naushir Patuck
2023-06-09 13:20     ` Sakari Ailus
2023-06-09 13:59 ` Dave Stevenson
2023-06-09 14:41   ` Sakari Ailus
2023-08-03 22:36     ` 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=e635ea49-c185-c02f-fe37-adc4c30b752c@xs4all.nl \
    --to=hverkuil@xs4all.nl \
    --cc=bingbu.cao@intel.com \
    --cc=hongju.wang@intel.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=sakari.ailus@linux.intel.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 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.