diff mbox series

[v9,11/46] media: Documentation: Document S_ROUTING behaviour

Message ID 20240416193319.778192-12-sakari.ailus@linux.intel.com (mailing list archive)
State New
Headers show
Series Generic line based metadata support, internal pads | expand

Commit Message

Sakari Ailus April 16, 2024, 7:32 p.m. UTC
Document S_ROUTING behaviour for different devices.

Generally in devices that produce streams the streams are static and some
can be enabled and disabled, whereas in devices that just transport them
or write them to memory, more configurability is allowed. Document this.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Julien Massot <julien.massot@collabora.com>
---
 .../userspace-api/media/v4l/dev-subdev.rst    | 24 +++++++++++++++++++
 1 file changed, 24 insertions(+)

Comments

Laurent Pinchart April 19, 2024, 5:17 p.m. UTC | #1
Hi Sakari,

Thank you for the patch.

On Tue, Apr 16, 2024 at 10:32:44PM +0300, Sakari Ailus wrote:
> Document S_ROUTING behaviour for different devices.
> 
> Generally in devices that produce streams the streams are static and some
> can be enabled and disabled, whereas in devices that just transport them
> or write them to memory, more configurability is allowed. Document this.
> 
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> Reviewed-by: Julien Massot <julien.massot@collabora.com>
> ---
>  .../userspace-api/media/v4l/dev-subdev.rst    | 24 +++++++++++++++++++
>  1 file changed, 24 insertions(+)
> 
> diff --git a/Documentation/userspace-api/media/v4l/dev-subdev.rst b/Documentation/userspace-api/media/v4l/dev-subdev.rst
> index d30dcb9e2537..de8dfd4f11a5 100644
> --- a/Documentation/userspace-api/media/v4l/dev-subdev.rst
> +++ b/Documentation/userspace-api/media/v4l/dev-subdev.rst
> @@ -593,6 +593,30 @@ Any configurations of a stream within a pad, such as format or selections,
>  are independent of similar configurations on other streams. This is
>  subject to change in the future.
>  
> +Device types and routing setup
> +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> +
> +Different kinds of sub-devices have differing behaviour for route activation,
> +depending on the hardware. In all cases, however, only routes that have the
> +``V4L2_SUBDEV_STREAM_FL_ACTIVE`` flag set are active.
> +
> +Devices generating the streams may allow enabling and disabling some of the
> +routes or the configuration is fixed. If the routes can be disabled, not

"... some of the routes, or have a fixed routing configuration."

> +declaring the routes (or declaring them without
> +``VIDIOC_SUBDEV_STREAM_FL_ACTIVE`` flag set) in ``VIDIOC_SUBDEV_S_ROUTING`` will
> +disable the routes while the sub-device driver retains the streams and their
> +format and selection configuration.

I still find the "retains their format and selection configuration"
quite unclear :-S

> The ``VIDIOC_SUBDEV_S_ROUTING`` will still

s/will still/ioctl will still/

> +return such routes back to the user in the routes array, with the
> +``V4L2_SUBDEV_STREAM_FL_ACTIVE`` flag unset.
> +
> +Devices transporting the streams almost always have more configurability with
> +respect to routing. Typically any route between the sub-device's sink and source
> +pads is possible, and multiple routes (usually up to certain limited number) may
> +be active simultaneously. For such devices, no routes are created by the driver
> +and user-created routes are fully replaced when ``VIDIOC_SUBDEV_S_ROUTING`` is
> +called on the sub-device. Such newly created routes have the device's default
> +configuration for format and selection rectangles.
> +
>  Configuring streams
>  ^^^^^^^^^^^^^^^^^^^
>
Sakari Ailus April 23, 2024, 10:08 a.m. UTC | #2
Hi Laurent,

On Fri, Apr 19, 2024 at 08:17:20PM +0300, Laurent Pinchart wrote:
> Hi Sakari,
> 
> Thank you for the patch.
> 
> On Tue, Apr 16, 2024 at 10:32:44PM +0300, Sakari Ailus wrote:
> > Document S_ROUTING behaviour for different devices.
> > 
> > Generally in devices that produce streams the streams are static and some
> > can be enabled and disabled, whereas in devices that just transport them
> > or write them to memory, more configurability is allowed. Document this.
> > 
> > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> > Reviewed-by: Julien Massot <julien.massot@collabora.com>
> > ---
> >  .../userspace-api/media/v4l/dev-subdev.rst    | 24 +++++++++++++++++++
> >  1 file changed, 24 insertions(+)
> > 
> > diff --git a/Documentation/userspace-api/media/v4l/dev-subdev.rst b/Documentation/userspace-api/media/v4l/dev-subdev.rst
> > index d30dcb9e2537..de8dfd4f11a5 100644
> > --- a/Documentation/userspace-api/media/v4l/dev-subdev.rst
> > +++ b/Documentation/userspace-api/media/v4l/dev-subdev.rst
> > @@ -593,6 +593,30 @@ Any configurations of a stream within a pad, such as format or selections,
> >  are independent of similar configurations on other streams. This is
> >  subject to change in the future.
> >  
> > +Device types and routing setup
> > +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> > +
> > +Different kinds of sub-devices have differing behaviour for route activation,
> > +depending on the hardware. In all cases, however, only routes that have the
> > +``V4L2_SUBDEV_STREAM_FL_ACTIVE`` flag set are active.
> > +
> > +Devices generating the streams may allow enabling and disabling some of the
> > +routes or the configuration is fixed. If the routes can be disabled, not
> 
> "... some of the routes, or have a fixed routing configuration."

Seems fine.

> 
> > +declaring the routes (or declaring them without
> > +``VIDIOC_SUBDEV_STREAM_FL_ACTIVE`` flag set) in ``VIDIOC_SUBDEV_S_ROUTING`` will
> > +disable the routes while the sub-device driver retains the streams and their
> > +format and selection configuration.
> 
> I still find the "retains their format and selection configuration"
> quite unclear :-S

Alternatively we could say that the routes are simply not active, without
referring to explicitly to formats and selections. I.e.:

If the routes can be disabled, not declaring the routes (or declaring them
without ``VIDIOC_SUBDEV_STREAM_FL_ACTIVE`` flag set) in
``VIDIOC_SUBDEV_S_ROUTING`` will disable the routes.

> 
> > The ``VIDIOC_SUBDEV_S_ROUTING`` will still
> 
> s/will still/ioctl will still/

Both seem to exist, more common is without "ioctl":

$ git grep '[`<]VIDIOC_SUBDEV' -- Documentation/userspace-api/media/|wc -l
84
$ git grep -i "VIDIOC_SUBDEV.*ioctl" -- Documentation/userspace-api/media/|wc -l
34

> 
> > +return such routes back to the user in the routes array, with the
> > +``V4L2_SUBDEV_STREAM_FL_ACTIVE`` flag unset.
> > +
> > +Devices transporting the streams almost always have more configurability with
> > +respect to routing. Typically any route between the sub-device's sink and source
> > +pads is possible, and multiple routes (usually up to certain limited number) may
> > +be active simultaneously. For such devices, no routes are created by the driver
> > +and user-created routes are fully replaced when ``VIDIOC_SUBDEV_S_ROUTING`` is
> > +called on the sub-device. Such newly created routes have the device's default
> > +configuration for format and selection rectangles.
> > +
> >  Configuring streams
> >  ^^^^^^^^^^^^^^^^^^^
> >  
>
Laurent Pinchart April 23, 2024, 12:59 p.m. UTC | #3
Hi Sakari,

On Tue, Apr 23, 2024 at 10:08:05AM +0000, Sakari Ailus wrote:
> On Fri, Apr 19, 2024 at 08:17:20PM +0300, Laurent Pinchart wrote:
> > On Tue, Apr 16, 2024 at 10:32:44PM +0300, Sakari Ailus wrote:
> > > Document S_ROUTING behaviour for different devices.
> > > 
> > > Generally in devices that produce streams the streams are static and some
> > > can be enabled and disabled, whereas in devices that just transport them
> > > or write them to memory, more configurability is allowed. Document this.
> > > 
> > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> > > Reviewed-by: Julien Massot <julien.massot@collabora.com>
> > > ---
> > >  .../userspace-api/media/v4l/dev-subdev.rst    | 24 +++++++++++++++++++
> > >  1 file changed, 24 insertions(+)
> > > 
> > > diff --git a/Documentation/userspace-api/media/v4l/dev-subdev.rst b/Documentation/userspace-api/media/v4l/dev-subdev.rst
> > > index d30dcb9e2537..de8dfd4f11a5 100644
> > > --- a/Documentation/userspace-api/media/v4l/dev-subdev.rst
> > > +++ b/Documentation/userspace-api/media/v4l/dev-subdev.rst
> > > @@ -593,6 +593,30 @@ Any configurations of a stream within a pad, such as format or selections,
> > >  are independent of similar configurations on other streams. This is
> > >  subject to change in the future.
> > >  
> > > +Device types and routing setup
> > > +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> > > +
> > > +Different kinds of sub-devices have differing behaviour for route activation,
> > > +depending on the hardware. In all cases, however, only routes that have the
> > > +``V4L2_SUBDEV_STREAM_FL_ACTIVE`` flag set are active.
> > > +
> > > +Devices generating the streams may allow enabling and disabling some of the
> > > +routes or the configuration is fixed. If the routes can be disabled, not
> > 
> > "... some of the routes, or have a fixed routing configuration."
> 
> Seems fine.
> 
> > > +declaring the routes (or declaring them without
> > > +``VIDIOC_SUBDEV_STREAM_FL_ACTIVE`` flag set) in ``VIDIOC_SUBDEV_S_ROUTING`` will
> > > +disable the routes while the sub-device driver retains the streams and their
> > > +format and selection configuration.
> > 
> > I still find the "retains their format and selection configuration"
> > quite unclear :-S
> 
> Alternatively we could say that the routes are simply not active, without
> referring to explicitly to formats and selections. I.e.:
> 
> If the routes can be disabled, not declaring the routes (or declaring them
> without ``VIDIOC_SUBDEV_STREAM_FL_ACTIVE`` flag set) in
> ``VIDIOC_SUBDEV_S_ROUTING`` will disable the routes.

I'm fine with that.

> > > The ``VIDIOC_SUBDEV_S_ROUTING`` will still
> > 
> > s/will still/ioctl will still/
> 
> Both seem to exist, more common is without "ioctl":
> 
> $ git grep '[`<]VIDIOC_SUBDEV' -- Documentation/userspace-api/media/|wc -l
> 84
> $ git grep -i "VIDIOC_SUBDEV.*ioctl" -- Documentation/userspace-api/media/|wc -l
> 34

You'll often find "ioctl" at the beginning of the next line :-) If you
would like to avoid it, you should drop "The" at the beginning of the
sentence.

> > > +return such routes back to the user in the routes array, with the
> > > +``V4L2_SUBDEV_STREAM_FL_ACTIVE`` flag unset.
> > > +
> > > +Devices transporting the streams almost always have more configurability with
> > > +respect to routing. Typically any route between the sub-device's sink and source
> > > +pads is possible, and multiple routes (usually up to certain limited number) may
> > > +be active simultaneously. For such devices, no routes are created by the driver
> > > +and user-created routes are fully replaced when ``VIDIOC_SUBDEV_S_ROUTING`` is
> > > +called on the sub-device. Such newly created routes have the device's default
> > > +configuration for format and selection rectangles.
> > > +
> > >  Configuring streams
> > >  ^^^^^^^^^^^^^^^^^^^
> > >
Sakari Ailus April 23, 2024, 1:33 p.m. UTC | #4
Hi Laurent,

On Tue, Apr 23, 2024 at 03:59:44PM +0300, Laurent Pinchart wrote:
> Hi Sakari,
> 
> On Tue, Apr 23, 2024 at 10:08:05AM +0000, Sakari Ailus wrote:
> > On Fri, Apr 19, 2024 at 08:17:20PM +0300, Laurent Pinchart wrote:
> > > On Tue, Apr 16, 2024 at 10:32:44PM +0300, Sakari Ailus wrote:
> > > > Document S_ROUTING behaviour for different devices.
> > > > 
> > > > Generally in devices that produce streams the streams are static and some
> > > > can be enabled and disabled, whereas in devices that just transport them
> > > > or write them to memory, more configurability is allowed. Document this.
> > > > 
> > > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> > > > Reviewed-by: Julien Massot <julien.massot@collabora.com>
> > > > ---
> > > >  .../userspace-api/media/v4l/dev-subdev.rst    | 24 +++++++++++++++++++
> > > >  1 file changed, 24 insertions(+)
> > > > 
> > > > diff --git a/Documentation/userspace-api/media/v4l/dev-subdev.rst b/Documentation/userspace-api/media/v4l/dev-subdev.rst
> > > > index d30dcb9e2537..de8dfd4f11a5 100644
> > > > --- a/Documentation/userspace-api/media/v4l/dev-subdev.rst
> > > > +++ b/Documentation/userspace-api/media/v4l/dev-subdev.rst
> > > > @@ -593,6 +593,30 @@ Any configurations of a stream within a pad, such as format or selections,
> > > >  are independent of similar configurations on other streams. This is
> > > >  subject to change in the future.
> > > >  
> > > > +Device types and routing setup
> > > > +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> > > > +
> > > > +Different kinds of sub-devices have differing behaviour for route activation,
> > > > +depending on the hardware. In all cases, however, only routes that have the
> > > > +``V4L2_SUBDEV_STREAM_FL_ACTIVE`` flag set are active.
> > > > +
> > > > +Devices generating the streams may allow enabling and disabling some of the
> > > > +routes or the configuration is fixed. If the routes can be disabled, not
> > > 
> > > "... some of the routes, or have a fixed routing configuration."
> > 
> > Seems fine.
> > 
> > > > +declaring the routes (or declaring them without
> > > > +``VIDIOC_SUBDEV_STREAM_FL_ACTIVE`` flag set) in ``VIDIOC_SUBDEV_S_ROUTING`` will
> > > > +disable the routes while the sub-device driver retains the streams and their
> > > > +format and selection configuration.
> > > 
> > > I still find the "retains their format and selection configuration"
> > > quite unclear :-S
> > 
> > Alternatively we could say that the routes are simply not active, without
> > referring to explicitly to formats and selections. I.e.:
> > 
> > If the routes can be disabled, not declaring the routes (or declaring them
> > without ``VIDIOC_SUBDEV_STREAM_FL_ACTIVE`` flag set) in
> > ``VIDIOC_SUBDEV_S_ROUTING`` will disable the routes.
> 
> I'm fine with that.
> 
> > > > The ``VIDIOC_SUBDEV_S_ROUTING`` will still
> > > 
> > > s/will still/ioctl will still/
> > 
> > Both seem to exist, more common is without "ioctl":
> > 
> > $ git grep '[`<]VIDIOC_SUBDEV' -- Documentation/userspace-api/media/|wc -l
> > 84
> > $ git grep -i "VIDIOC_SUBDEV.*ioctl" -- Documentation/userspace-api/media/|wc -l
> > 34
> 
> You'll often find "ioctl" at the beginning of the next line :-) If you
> would like to avoid it, you should drop "The" at the beginning of the
> sentence.

Sounds good.

> 
> > > > +return such routes back to the user in the routes array, with the
> > > > +``V4L2_SUBDEV_STREAM_FL_ACTIVE`` flag unset.
> > > > +
> > > > +Devices transporting the streams almost always have more configurability with
> > > > +respect to routing. Typically any route between the sub-device's sink and source
> > > > +pads is possible, and multiple routes (usually up to certain limited number) may
> > > > +be active simultaneously. For such devices, no routes are created by the driver
> > > > +and user-created routes are fully replaced when ``VIDIOC_SUBDEV_S_ROUTING`` is
> > > > +called on the sub-device. Such newly created routes have the device's default
> > > > +configuration for format and selection rectangles.
> > > > +
> > > >  Configuring streams
> > > >  ^^^^^^^^^^^^^^^^^^^
> > > >  
>
diff mbox series

Patch

diff --git a/Documentation/userspace-api/media/v4l/dev-subdev.rst b/Documentation/userspace-api/media/v4l/dev-subdev.rst
index d30dcb9e2537..de8dfd4f11a5 100644
--- a/Documentation/userspace-api/media/v4l/dev-subdev.rst
+++ b/Documentation/userspace-api/media/v4l/dev-subdev.rst
@@ -593,6 +593,30 @@  Any configurations of a stream within a pad, such as format or selections,
 are independent of similar configurations on other streams. This is
 subject to change in the future.
 
+Device types and routing setup
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Different kinds of sub-devices have differing behaviour for route activation,
+depending on the hardware. In all cases, however, only routes that have the
+``V4L2_SUBDEV_STREAM_FL_ACTIVE`` flag set are active.
+
+Devices generating the streams may allow enabling and disabling some of the
+routes or the configuration is fixed. If the routes can be disabled, not
+declaring the routes (or declaring them without
+``VIDIOC_SUBDEV_STREAM_FL_ACTIVE`` flag set) in ``VIDIOC_SUBDEV_S_ROUTING`` will
+disable the routes while the sub-device driver retains the streams and their
+format and selection configuration. The ``VIDIOC_SUBDEV_S_ROUTING`` will still
+return such routes back to the user in the routes array, with the
+``V4L2_SUBDEV_STREAM_FL_ACTIVE`` flag unset.
+
+Devices transporting the streams almost always have more configurability with
+respect to routing. Typically any route between the sub-device's sink and source
+pads is possible, and multiple routes (usually up to certain limited number) may
+be active simultaneously. For such devices, no routes are created by the driver
+and user-created routes are fully replaced when ``VIDIOC_SUBDEV_S_ROUTING`` is
+called on the sub-device. Such newly created routes have the device's default
+configuration for format and selection rectangles.
+
 Configuring streams
 ^^^^^^^^^^^^^^^^^^^