This is an automatic generated email to let you know that the following patch were queued at the http://git.linuxtv.org/v4l-utils.git tree:
Subject: v4l2-compliance: improve S_HW_FREQ_SEEK tests. Author: Hans Verkuil <[email protected]> Date: Mon Aug 13 16:33:55 2012 +0200 Allow for valid ENODATA return code. Improve checks for bounded/wrapped seeks. Test seek for all tuners. Signed-off-by: Hans Verkuil <[email protected]> (cherry picked from commit 5d78eacde9d61b0f84a340eaa39c92e094ffbbbf) Signed-off-by: Gregor Jasny <[email protected]> utils/v4l2-compliance/v4l2-test-input-output.cpp | 63 +++++++++++++-------- 1 files changed, 39 insertions(+), 24 deletions(-) --- http://git.linuxtv.org/v4l-utils.git?a=commitdiff;h=6d90ff0a6a9b12854b4ed5515e5b1e405ae310b8 diff --git a/utils/v4l2-compliance/v4l2-test-input-output.cpp b/utils/v4l2-compliance/v4l2-test-input-output.cpp index e7e763d..a2e8ddb 100644 --- a/utils/v4l2-compliance/v4l2-test-input-output.cpp +++ b/utils/v4l2-compliance/v4l2-test-input-output.cpp @@ -94,6 +94,8 @@ static int checkTuner(struct node *node, const struct v4l2_tuner &tuner, return fail("V4L2_TUNER_CAP_LOW was not set for a radio tuner\n"); fail_on_test(!(tuner.capability & V4L2_TUNER_CAP_FREQ_BANDS)); fail_on_test(!(node->caps & V4L2_CAP_HW_FREQ_SEEK) && hwseek_caps); + fail_on_test((node->caps & V4L2_CAP_HW_FREQ_SEEK) && + !(tuner.capability & (V4L2_TUNER_CAP_HWSEEK_BOUNDED | V4L2_TUNER_CAP_HWSEEK_WRAP))); if (tuner.rangelow >= tuner.rangehigh) return fail("rangelow >= rangehigh\n"); if (tuner.rangelow == 0 || tuner.rangehigh == 0xffffffff) @@ -283,35 +285,48 @@ int testTunerFreq(struct node *node) int testTunerHwSeek(struct node *node) { - struct v4l2_hw_freq_seek seek; + unsigned t; int ret; - memset(&seek, 0, sizeof(seek)); - seek.type = V4L2_TUNER_RADIO; - ret = doioctl(node, VIDIOC_S_HW_FREQ_SEEK, &seek); - if (!(node->caps & V4L2_CAP_HW_FREQ_SEEK) && ret != ENOTTY) - return fail("hw seek supported but capability not set\n"); - if (!node->is_radio && ret != ENOTTY) - return fail("hw seek supported on a non-radio node?!\n"); - if (!node->is_radio || !(node->caps & V4L2_CAP_HW_FREQ_SEEK)) - return ENOTTY; - seek.type = V4L2_TUNER_ANALOG_TV; - ret = doioctl(node, VIDIOC_S_HW_FREQ_SEEK, &seek); - if (ret != EINVAL) - return fail("hw seek accepted TV tuner\n"); - seek.type = V4L2_TUNER_RADIO; - seek.seek_upward = 1; - ret = doioctl(node, VIDIOC_S_HW_FREQ_SEEK, &seek); - if (ret == EINVAL) { + for (t = 0; t < node->tuners; t++) { + struct v4l2_hw_freq_seek seek; + struct v4l2_tuner tuner; + + tuner.index = t; + ret = doioctl(node, VIDIOC_G_TUNER, &tuner); + if (ret) + return fail("could not get tuner %d\n", t); + + memset(&seek, 0, sizeof(seek)); + seek.tuner = t; + seek.type = V4L2_TUNER_RADIO; + ret = doioctl(node, VIDIOC_S_HW_FREQ_SEEK, &seek); + if (!(node->caps & V4L2_CAP_HW_FREQ_SEEK) && ret != ENOTTY) + return fail("hw seek supported but capability not set\n"); + if (!node->is_radio && ret != ENOTTY) + return fail("hw seek supported on a non-radio node?!\n"); + if (!node->is_radio || !(node->caps & V4L2_CAP_HW_FREQ_SEEK)) + return ENOTTY; + seek.type = V4L2_TUNER_ANALOG_TV; + ret = doioctl(node, VIDIOC_S_HW_FREQ_SEEK, &seek); + if (ret != EINVAL) + return fail("hw seek accepted TV tuner\n"); + seek.type = V4L2_TUNER_RADIO; + seek.seek_upward = 1; + ret = doioctl(node, VIDIOC_S_HW_FREQ_SEEK, &seek); + if (ret == EINVAL && (tuner.capability & V4L2_TUNER_CAP_HWSEEK_BOUNDED)) + return fail("hw bounded seek failed\n"); + if (ret && ret != EINVAL && ret != ENODATA) + return fail("hw bounded seek failed with error %d\n", ret); seek.wrap_around = 1; ret = doioctl(node, VIDIOC_S_HW_FREQ_SEEK, &seek); + if (ret == EINVAL && (tuner.capability & V4L2_TUNER_CAP_HWSEEK_WRAP)) + return fail("hw wrapped seek failed\n"); + if (ret && ret != EINVAL && ret != ENODATA) + return fail("hw wrapped seek failed with error %d\n", ret); + if (check_0(seek.reserved, sizeof(seek.reserved))) + return fail("non-zero reserved fields\n"); } - if (ret == EINVAL) - return fail("neither wrap_around value was accepted\n"); - if (ret) - return fail("hw seek failed with error %d\n", ret); - if (check_0(seek.reserved, sizeof(seek.reserved))) - return fail("non-zero reserved fields\n"); return 0; } _______________________________________________ linuxtv-commits mailing list [email protected] http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
