diff mbox series

[v4l-utils,8/8] v4l2-compliance: Test IMMUTABLE route flag

Message ID 20240402000033.4007-9-laurent.pinchart@ideasonboard.com
State Superseded
Headers show
Series Support for the generic line-based metadata support | expand

Commit Message

Laurent Pinchart April 2, 2024, midnight UTC
Accept the new V4L2_SUBDEV_ROUTE_FL_IMMUTABLE route flag when testing
routing, and verify that immutable routes are active as mandated by the
routing API specification.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 utils/v4l2-compliance/v4l2-test-subdevs.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/utils/v4l2-compliance/v4l2-test-subdevs.cpp b/utils/v4l2-compliance/v4l2-test-subdevs.cpp
index 714857021fc6..e26d09ed8586 100644
--- a/utils/v4l2-compliance/v4l2-test-subdevs.cpp
+++ b/utils/v4l2-compliance/v4l2-test-subdevs.cpp
@@ -579,7 +579,8 @@  int testSubDevSelection(struct node *node, unsigned which, unsigned pad, unsigne
 
 int testSubDevRouting(struct node *node, unsigned which)
 {
-	const uint32_t all_route_flags_mask = V4L2_SUBDEV_ROUTE_FL_ACTIVE;
+	const uint32_t all_route_flags_mask = V4L2_SUBDEV_ROUTE_FL_ACTIVE
+					    | V4L2_SUBDEV_ROUTE_FL_IMMUTABLE;
 	struct v4l2_subdev_routing routing = {};
 	struct v4l2_subdev_route routes[NUM_ROUTES_MAX] = {};
 	unsigned int i;
@@ -629,6 +630,8 @@  int testSubDevRouting(struct node *node, unsigned which)
 			fail_on_test(!(sink->flags & MEDIA_PAD_FL_SINK));
 			fail_on_test(!(source->flags & MEDIA_PAD_FL_SOURCE));
 			fail_on_test(route->flags & ~all_route_flags_mask);
+			fail_on_test((route->flags & V4L2_SUBDEV_ROUTE_FL_IMMUTABLE) &&
+				     !(route->flags & V4L2_SUBDEV_ROUTE_FL_ACTIVE));
 		}
 	}