diff mbox series

[v6,22/24] media: uapi: add MEDIA_PAD_FL_MULTIPLEXED flag

Message ID 20210427124523.990938-23-tomi.valkeinen@ideasonboard.com
State New
Headers show
Series v4l: subdev internal routing | expand

Commit Message

Tomi Valkeinen April 27, 2021, 12:45 p.m. UTC
Add a pad flag to indicate that the pad uses multiplexed streams. A pad
with multiplexed streams won't support pad format configuration and e.g.
VIDIOC_SUBDEV_S_FMT should return -ENOIOCTLCMD.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
---
 Documentation/userspace-api/media/mediactl/media-types.rst | 6 ++++++
 include/uapi/linux/media.h                                 | 1 +
 2 files changed, 7 insertions(+)

Comments

Laurent Pinchart April 29, 2021, 2:53 a.m. UTC | #1
Hi Tomi,

Thank you for the patch.

On Tue, Apr 27, 2021 at 03:45:21PM +0300, Tomi Valkeinen wrote:
> Add a pad flag to indicate that the pad uses multiplexed streams. A pad

> with multiplexed streams won't support pad format configuration and e.g.

> VIDIOC_SUBDEV_S_FMT should return -ENOIOCTLCMD.

> 

> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>

> ---

>  Documentation/userspace-api/media/mediactl/media-types.rst | 6 ++++++

>  include/uapi/linux/media.h                                 | 1 +

>  2 files changed, 7 insertions(+)

> 

> diff --git a/Documentation/userspace-api/media/mediactl/media-types.rst b/Documentation/userspace-api/media/mediactl/media-types.rst

> index 0a26397bd01d..d1dca50649f9 100644

> --- a/Documentation/userspace-api/media/mediactl/media-types.rst

> +++ b/Documentation/userspace-api/media/mediactl/media-types.rst

> @@ -361,6 +361,7 @@ Types and flags used to represent the media graph elements

>  .. _MEDIA-PAD-FL-SINK:

>  .. _MEDIA-PAD-FL-SOURCE:

>  .. _MEDIA-PAD-FL-MUST-CONNECT:

> +.. _MEDIA-PAD-FL-MULTIPLEXED:

>  

>  .. flat-table:: Media pad flags

>      :header-rows:  0

> @@ -382,6 +383,11 @@ Types and flags used to represent the media graph elements

>  	  when this flag isn't set; the absence of the flag doesn't imply

>  	  there is none.

>  

> +    *  -  ``MEDIA_PAD_FL_MULTIPLEXED``

> +       -  The pad has multiplexed streams. A pad with multiplexed streams

> +          won't support pad format configuration and e.g. VIDIOC_SUBDEV_S_FMT

> +          should return -ENOIOCTLCMD.


This should also mention if the flag is set by drivers or by userspace,
and if it static or can change dynamically. If it can change
dynamically, the documentation should explain the circumstances under
which the flag can change.

Other than expanding the documentation, I see no issue here, this looks
good.

> +

>  

>  One and only one of ``MEDIA_PAD_FL_SINK`` and ``MEDIA_PAD_FL_SOURCE``

>  must be set for every pad.

> diff --git a/include/uapi/linux/media.h b/include/uapi/linux/media.h

> index 200fa8462b90..bdaadef80cbd 100644

> --- a/include/uapi/linux/media.h

> +++ b/include/uapi/linux/media.h

> @@ -211,6 +211,7 @@ struct media_entity_desc {

>  #define MEDIA_PAD_FL_SINK			(1 << 0)

>  #define MEDIA_PAD_FL_SOURCE			(1 << 1)

>  #define MEDIA_PAD_FL_MUST_CONNECT		(1 << 2)

> +#define MEDIA_PAD_FL_MULTIPLEXED		(1 << 3)

>  

>  struct media_pad_desc {

>  	__u32 entity;		/* entity ID */


-- 
Regards,

Laurent Pinchart
diff mbox series

Patch

diff --git a/Documentation/userspace-api/media/mediactl/media-types.rst b/Documentation/userspace-api/media/mediactl/media-types.rst
index 0a26397bd01d..d1dca50649f9 100644
--- a/Documentation/userspace-api/media/mediactl/media-types.rst
+++ b/Documentation/userspace-api/media/mediactl/media-types.rst
@@ -361,6 +361,7 @@  Types and flags used to represent the media graph elements
 .. _MEDIA-PAD-FL-SINK:
 .. _MEDIA-PAD-FL-SOURCE:
 .. _MEDIA-PAD-FL-MUST-CONNECT:
+.. _MEDIA-PAD-FL-MULTIPLEXED:
 
 .. flat-table:: Media pad flags
     :header-rows:  0
@@ -382,6 +383,11 @@  Types and flags used to represent the media graph elements
 	  when this flag isn't set; the absence of the flag doesn't imply
 	  there is none.
 
+    *  -  ``MEDIA_PAD_FL_MULTIPLEXED``
+       -  The pad has multiplexed streams. A pad with multiplexed streams
+          won't support pad format configuration and e.g. VIDIOC_SUBDEV_S_FMT
+          should return -ENOIOCTLCMD.
+
 
 One and only one of ``MEDIA_PAD_FL_SINK`` and ``MEDIA_PAD_FL_SOURCE``
 must be set for every pad.
diff --git a/include/uapi/linux/media.h b/include/uapi/linux/media.h
index 200fa8462b90..bdaadef80cbd 100644
--- a/include/uapi/linux/media.h
+++ b/include/uapi/linux/media.h
@@ -211,6 +211,7 @@  struct media_entity_desc {
 #define MEDIA_PAD_FL_SINK			(1 << 0)
 #define MEDIA_PAD_FL_SOURCE			(1 << 1)
 #define MEDIA_PAD_FL_MUST_CONNECT		(1 << 2)
+#define MEDIA_PAD_FL_MULTIPLEXED		(1 << 3)
 
 struct media_pad_desc {
 	__u32 entity;		/* entity ID */