diff mbox series

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

Message ID 20240424152230.31923-8-laurent.pinchart@ideasonboard.com (mailing list archive)
State New, archived
Headers show
Series Support for the generic line-based metadata support | expand

Commit Message

Laurent Pinchart April 24, 2024, 3:22 p.m. 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 41eaf77112f0..409e82dae480 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));
 		}
 	}