This is an automatic generated email to let you know that the following patch were queued at the http://git.linuxtv.org/cgit.cgi/v4l-utils.git tree:
Subject: v4l2-compliance: add support for V4L2_SUBDEV_CLIENT_CAP_INTERVAL_USES_WHICH Author: Hans Verkuil <hverkuil-ci...@xs4all.nl> Date: Thu Dec 14 14:26:28 2023 +0100 Improve the g/s_frame_interval tests to use the new 'which' field if it is available. Signed-off-by: Hans Verkuil <hverkuil-ci...@xs4all.nl> utils/v4l2-compliance/v4l2-compliance.cpp | 12 ++++++++++-- utils/v4l2-compliance/v4l2-compliance.h | 3 ++- utils/v4l2-compliance/v4l2-test-subdevs.cpp | 27 ++++++++++++++++++++++++++- 3 files changed, 38 insertions(+), 4 deletions(-) --- http://git.linuxtv.org/cgit.cgi/v4l-utils.git/commit/?id=36b515806f81256c06ebcae13860925f51466f62 diff --git a/utils/v4l2-compliance/v4l2-compliance.cpp b/utils/v4l2-compliance/v4l2-compliance.cpp index a83d6413b836..b670b78d2c95 100644 --- a/utils/v4l2-compliance/v4l2-compliance.cpp +++ b/utils/v4l2-compliance/v4l2-compliance.cpp @@ -1341,8 +1341,9 @@ void testNode(struct node &node, struct node &node_m2m_cap, struct node &expbuf_ which ? "Active" : "Try", ok(testSubDevSelection(&node, which, pad, stream))); if (which) - printf("\ttest VIDIOC_SUBDEV_G/S_FRAME_INTERVAL: %s\n", - ok(testSubDevFrameInterval(&node, pad, stream))); + printf("\ttest %s VIDIOC_SUBDEV_G/S_FRAME_INTERVAL: %s\n", + which ? "Active" : "Try", + ok(testSubDevFrameInterval(&node, which, pad, stream))); } } @@ -1365,6 +1366,13 @@ void testNode(struct node &node, struct node &node_m2m_cap, struct node &expbuf_ if (node.has_subdev_selection && node.has_subdev_selection != node.has_subdev_fmt) fail("VIDIOC_SUBDEV_G/S_SELECTION: fmt/selection mismatch\n"); + if (node.has_ival_uses_which()) { + if (node.has_subdev_frame_interval && node.has_subdev_frame_interval < 3) + fail("VIDIOC_SUBDEV_G/S_FRAME_INTERVAL: try/active mismatch\n"); + if (node.has_subdev_frame_interval && + node.has_subdev_frame_interval != node.has_subdev_fmt) + fail("VIDIOC_SUBDEV_G/S_FRAME_INTERVAL: fmt/frame_interval mismatch\n"); + } } printf("\n"); } diff --git a/utils/v4l2-compliance/v4l2-compliance.h b/utils/v4l2-compliance/v4l2-compliance.h index 4f9aa17e3749..0cfc9a378e99 100644 --- a/utils/v4l2-compliance/v4l2-compliance.h +++ b/utils/v4l2-compliance/v4l2-compliance.h @@ -149,6 +149,7 @@ struct base_node { __u8 has_subdev_enum_fival; __u8 has_subdev_fmt; __u8 has_subdev_selection; + __u8 has_subdev_frame_interval; int frame_interval_pad; int enum_frame_interval_pad; __u32 fbuf_caps; @@ -375,7 +376,7 @@ int testSubDevCap(struct node *node); int testSubDevEnum(struct node *node, unsigned which, unsigned pad, unsigned stream); int testSubDevFormat(struct node *node, unsigned which, unsigned pad, unsigned stream); int testSubDevSelection(struct node *node, unsigned which, unsigned pad, unsigned stream); -int testSubDevFrameInterval(struct node *node, unsigned pad, unsigned stream); +int testSubDevFrameInterval(struct node *node, unsigned which, unsigned pad, unsigned stream); int testSubDevRouting(struct node *node, unsigned which); // Buffer ioctl tests diff --git a/utils/v4l2-compliance/v4l2-test-subdevs.cpp b/utils/v4l2-compliance/v4l2-test-subdevs.cpp index 38339ee3d083..ebca1b94f5c0 100644 --- a/utils/v4l2-compliance/v4l2-test-subdevs.cpp +++ b/utils/v4l2-compliance/v4l2-test-subdevs.cpp @@ -272,25 +272,38 @@ int testSubDevEnum(struct node *node, unsigned which, unsigned pad, unsigned str return 0; } -int testSubDevFrameInterval(struct node *node, unsigned pad, unsigned stream) +int testSubDevFrameInterval(struct node *node, unsigned which, unsigned pad, unsigned stream) { struct v4l2_subdev_frame_interval fival; struct v4l2_fract ival; + bool has_which = node->has_ival_uses_which(); int ret; + if (!has_which) + which = V4L2_SUBDEV_FORMAT_ACTIVE; memset(&fival, 0xff, sizeof(fival)); fival.pad = pad; fival.stream = stream; + if (has_which) + fival.which = which; ret = doioctl(node, VIDIOC_SUBDEV_G_FRAME_INTERVAL, &fival); + if (has_which) + node->has_subdev_frame_interval |= (ret != ENOTTY) << which; if (ret == ENOTTY) { fail_on_test(node->enum_frame_interval_pad >= 0); fail_on_test(doioctl(node, VIDIOC_SUBDEV_S_FRAME_INTERVAL, &fival) != ENOTTY); return ret; } + + if (!has_which) + warn_once("V4L2_SUBDEV_CLIENT_CAP_INTERVAL_USES_WHICH is not supported\n"); + fail_on_test(node->frame_interval_pad >= 0); fail_on_test(node->enum_frame_interval_pad != (int)pad); node->frame_interval_pad = pad; fail_on_test(check_0(fival.reserved, sizeof(fival.reserved))); + if (has_which) + fail_on_test(fival.which != which); fail_on_test(fival.pad != pad); fail_on_test(fival.stream != stream); fail_on_test(!fival.interval.numerator); @@ -303,6 +316,8 @@ int testSubDevFrameInterval(struct node *node, unsigned pad, unsigned stream) return 0; } fail_on_test(doioctl(node, VIDIOC_SUBDEV_S_FRAME_INTERVAL, &fival)); + if (has_which) + fail_on_test(fival.which != which); fail_on_test(fival.pad != pad); fail_on_test(fival.stream != stream); fail_on_test(ival.numerator != fival.interval.numerator); @@ -311,12 +326,22 @@ int testSubDevFrameInterval(struct node *node, unsigned pad, unsigned stream) memset(&fival, 0, sizeof(fival)); fival.pad = pad; fival.stream = stream; + if (has_which) + fival.which = which; fail_on_test(doioctl(node, VIDIOC_SUBDEV_G_FRAME_INTERVAL, &fival)); + if (has_which) + fail_on_test(fival.which != which); fail_on_test(fival.pad != pad); fail_on_test(fival.stream != stream); fail_on_test(ival.numerator != fival.interval.numerator); fail_on_test(ival.denominator != fival.interval.denominator); + if (has_which) { + fival.which = ~0; + fail_on_test(doioctl(node, VIDIOC_SUBDEV_G_FRAME_INTERVAL, &fival) != EINVAL); + fail_on_test(doioctl(node, VIDIOC_SUBDEV_S_FRAME_INTERVAL, &fival) != EINVAL); + fival.which = which; + } fival.pad = node->entity.pads; fival.stream = stream; fail_on_test(doioctl(node, VIDIOC_SUBDEV_G_FRAME_INTERVAL, &fival) != EINVAL); _______________________________________________ linuxtv-commits mailing list linuxtv-commits@linuxtv.org https://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits