diff mbox series

[v4l-utils,2/2] v4l2-compliance: Drop stream support for the subdev crop API

Message ID 20240403232425.22304-3-laurent.pinchart@ideasonboard.com
State New
Headers show
Series Drop stream support for the subdev crop API | expand

Commit Message

Laurent Pinchart April 3, 2024, 11:24 p.m. UTC
The subdev crop API has never had working streams support in the kernel.
The stream field of the v4l2_subdev_crop structure will be removed,
prepare for that by not setting it.

As the selection API tests checks that the crop and selection APIs
return the same results, we also need to skip all those checks when
testing selection support on streams.

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

Patch

diff --git a/utils/v4l2-compliance/v4l2-test-subdevs.cpp b/utils/v4l2-compliance/v4l2-test-subdevs.cpp
index da304a8caa8a..2e4d20f657f8 100644
--- a/utils/v4l2-compliance/v4l2-test-subdevs.cpp
+++ b/utils/v4l2-compliance/v4l2-test-subdevs.cpp
@@ -484,7 +484,6 @@  int testSubDevSelection(struct node *node, unsigned which, unsigned pad, unsigne
 	targets[V4L2_SEL_TGT_NATIVE_SIZE].readonly = is_sink;
 	memset(&crop, 0, sizeof(crop));
 	crop.pad = pad;
-	crop.stream = stream;
 	crop.which = which;
 	memset(&sel, 0, sizeof(sel));
 	sel.which = which;
@@ -493,17 +492,20 @@  int testSubDevSelection(struct node *node, unsigned which, unsigned pad, unsigne
 	sel.target = V4L2_SEL_TGT_CROP;
 	ret = doioctl(node, VIDIOC_SUBDEV_G_SELECTION, &sel);
 	node->has_subdev_selection |= (ret != ENOTTY) << which;
-	fail_on_test(doioctl(node, VIDIOC_SUBDEV_G_CROP, &crop) != ret);
+	if (!stream)
+		fail_on_test(doioctl(node, VIDIOC_SUBDEV_G_CROP, &crop) != ret);
 	if (ret == ENOTTY) {
 		fail_on_test(doioctl(node, VIDIOC_SUBDEV_S_SELECTION, &sel) != ENOTTY);
-		fail_on_test(doioctl(node, VIDIOC_SUBDEV_S_CROP, &crop) != ENOTTY);
+		if (!stream)
+			fail_on_test(doioctl(node, VIDIOC_SUBDEV_S_CROP, &crop) != ENOTTY);
 		return ret;
 	}
-	fail_on_test(check_0(crop.reserved, sizeof(crop.reserved)));
-	fail_on_test(crop.which != which);
-	fail_on_test(crop.pad != pad);
-	fail_on_test(crop.stream != stream);
-	fail_on_test(memcmp(&crop.rect, &sel.r, sizeof(sel.r)));
+	if (!stream) {
+		fail_on_test(check_0(crop.reserved, sizeof(crop.reserved)));
+		fail_on_test(crop.which != which);
+		fail_on_test(crop.pad != pad);
+		fail_on_test(memcmp(&crop.rect, &sel.r, sizeof(sel.r)));
+	}
 
 	for (unsigned tgt = 0; targets[tgt].target != ~0U; tgt++) {
 		targets[tgt].found = false;
@@ -544,7 +546,7 @@  int testSubDevSelection(struct node *node, unsigned which, unsigned pad, unsigne
 		ret = doioctl(node, VIDIOC_SUBDEV_S_SELECTION, &s_sel);
 		if (node->is_ro_subdev && which == V4L2_SUBDEV_FORMAT_ACTIVE)
 			fail_on_test(ret != EPERM);
-		if (tgt == V4L2_SEL_TGT_CROP) {
+		if (tgt == V4L2_SEL_TGT_CROP && !stream) {
 			crop.rect = sel.r;
 			memset(crop.reserved, 0xff, sizeof(crop.reserved));
 			fail_on_test(doioctl(node, VIDIOC_SUBDEV_S_CROP, &crop) != ret);
@@ -552,7 +554,6 @@  int testSubDevSelection(struct node *node, unsigned which, unsigned pad, unsigne
 				fail_on_test(check_0(crop.reserved, sizeof(crop.reserved)));
 				fail_on_test(crop.which != which);
 				fail_on_test(crop.pad != pad);
-				fail_on_test(crop.stream != stream);
 				fail_on_test(memcmp(&crop.rect, &sel.r, sizeof(sel.r)));
 			}
 		}