diff mbox

[v2,0/3] media: subdev: Routing validation improvements

Message ID 20230302095748.100898-1-tomi.valkeinen@ideasonboard.com (mailing list archive)
State New, archived
Headers show

Commit Message

Tomi Valkeinen March 2, 2023, 9:57 a.m. UTC
Hi,

v1 can be found here:

https://lore.kernel.org/all/20230228092346.101105-1-tomi.valkeinen@ideasonboard.com/

v2 contains only doc/comment changes. Diff to v1 below.

 Tomi

Tomi Valkeinen (3):
  media: subdev: Use 'shall' instead of 'may' in route validation
  media: subdev: Split V4L2_SUBDEV_ROUTING_NO_STREAM_MIX
  media: subdev: Add V4L2_SUBDEV_ROUTING_NO_MULTIPLEXING

 drivers/media/v4l2-core/v4l2-subdev.c | 45 ++++++++++++++++++++++++---
 include/media/v4l2-subdev.h           | 32 ++++++++++++++++---
 2 files changed, 68 insertions(+), 9 deletions(-)

Interdiff against v1:
diff mbox

Patch

diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c
index ae74a48dd2ba..3650eb3a413f 100644
--- a/drivers/media/v4l2-core/v4l2-subdev.c
+++ b/drivers/media/v4l2-core/v4l2-subdev.c
@@ -1694,9 +1694,8 @@  int v4l2_subdev_routing_validate(struct v4l2_subdev *sd,
 		}
 
 		/*
-		 * V4L2_SUBDEV_ROUTING_NO_SINK_STREAM_MIX: Streams on the same
-		 * sink pad may not be routed to streams on different source
-		 * pads.
+		 * V4L2_SUBDEV_ROUTING_NO_SINK_STREAM_MIX: all streams from a
+		 * sink pad must be routed to a single source pad.
 		 */
 		if (disallow & V4L2_SUBDEV_ROUTING_NO_SINK_STREAM_MIX) {
 			if (remote_pads[route->sink_pad] != U32_MAX &&
@@ -1709,9 +1708,8 @@  int v4l2_subdev_routing_validate(struct v4l2_subdev *sd,
 		}
 
 		/*
-		 * V4L2_SUBDEV_ROUTING_NO_SOURCE_STREAM_MIX: Streams on the same
-		 * source pad may not be routed to streams on different sink
-		 * pads.
+		 * V4L2_SUBDEV_ROUTING_NO_SOURCE_STREAM_MIX: all streams on a
+		 * source pad must originate from a single sink pad.
 		 */
 		if (disallow & V4L2_SUBDEV_ROUTING_NO_SOURCE_STREAM_MIX) {
 			if (remote_pads[route->source_pad] != U32_MAX &&
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
index 4a8d45e2c804..fa300019844b 100644
--- a/include/media/v4l2-subdev.h
+++ b/include/media/v4l2-subdev.h
@@ -1638,26 +1638,29 @@  u64 v4l2_subdev_state_xlate_streams(const struct v4l2_subdev_state *state,
  * enum v4l2_subdev_routing_restriction - Subdevice internal routing restrictions
  *
  * @V4L2_SUBDEV_ROUTING_NO_1_TO_N:
- *	an input stream may not be routed to multiple output streams (stream
+ *	an input stream shall not be routed to multiple output streams (stream
  *	duplication)
  * @V4L2_SUBDEV_ROUTING_NO_N_TO_1:
- *	multiple input streams may not be routed to the same output stream
+ *	multiple input streams shall not be routed to the same output stream
  *	(stream merging)
  * @V4L2_SUBDEV_ROUTING_NO_SINK_STREAM_MIX:
- *	streams on the same sink pad may not be routed to streams on different
- *	source pads
+ *	all streams from a sink pad must be routed to a single source pad
  * @V4L2_SUBDEV_ROUTING_NO_SOURCE_STREAM_MIX:
- *	streams on the same source pad may not be routed to streams on different
- *	sink pads
+ *	all streams on a source pad must originate from a single sink pad
  * @V4L2_SUBDEV_ROUTING_NO_SOURCE_MULTIPLEXING:
- *	source pads may not contain multiplexed streams
+ *	source pads shall not contain multiplexed streams
  * @V4L2_SUBDEV_ROUTING_NO_SINK_MULTIPLEXING:
- *	sink pads may not contain multiplexed streams
+ *	sink pads shall not contain multiplexed streams
  * @V4L2_SUBDEV_ROUTING_ONLY_1_TO_1:
  *	only non-overlapping 1-to-1 stream routing is allowed (a combination of
  *	@V4L2_SUBDEV_ROUTING_NO_1_TO_N and @V4L2_SUBDEV_ROUTING_NO_N_TO_1)
  * @V4L2_SUBDEV_ROUTING_NO_STREAM_MIX:
- *	streams on the same pad may not be routed to streams on different pads
+ *	all streams from a sink pad must be routed to a single source pad, and
+ *	that source pad shall not get routes from any other sink pad
+ *	(a combination of @V4L2_SUBDEV_ROUTING_NO_SINK_STREAM_MIX and
+ *	@V4L2_SUBDEV_ROUTING_NO_SOURCE_STREAM_MIX)
+ * @V4L2_SUBDEV_ROUTING_NO_MULTIPLEXING:
+ *	no multiplexed streams allowed on either source or sink sides.
  */
 enum v4l2_subdev_routing_restriction {
 	V4L2_SUBDEV_ROUTING_NO_1_TO_N = BIT(0),