aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil-cisco@xs4all.nl>2021-01-06 10:13:04 +0100
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2021-01-06 10:13:04 +0100
commit3f5d1603a743c45b0592e7d4d1c5aec84df33767 (patch)
treeef1211d6a50840af7eb9c4334d7cff3246ecf720
parent4739a67dac10389559cffa6450a9ad88d37629ac (diff)
v4l2-compliance: skip sequence tests for vivid
The vivid driver still has timing issues that can cause wrong buffer sequence numbers to be returned. Replace related tests with 'info()' messages if the vivid driver is being tested to avoid noise in the test results. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-rw-r--r--utils/v4l2-compliance/v4l2-compliance.h8
-rw-r--r--utils/v4l2-compliance/v4l2-test-buffers.cpp20
2 files changed, 23 insertions, 5 deletions
diff --git a/utils/v4l2-compliance/v4l2-compliance.h b/utils/v4l2-compliance/v4l2-compliance.h
index c0cc57db..5fe3be8a 100644
--- a/utils/v4l2-compliance/v4l2-compliance.h
+++ b/utils/v4l2-compliance/v4l2-compliance.h
@@ -229,6 +229,14 @@ private:
warn("%s\n", #test); \
} while (0)
+#define warn_or_info(is_info, fmt, args...) \
+ do { \
+ if (is_info) \
+ info(fmt, ##args); \
+ else \
+ warn(fmt, ##args); \
+ } while (0)
+
#define fail(fmt, args...) \
({ \
printf("\t\t%s: %s(%d): " fmt, show_colors ? \
diff --git a/utils/v4l2-compliance/v4l2-test-buffers.cpp b/utils/v4l2-compliance/v4l2-test-buffers.cpp
index 291019c7..b3086abc 100644
--- a/utils/v4l2-compliance/v4l2-test-buffers.cpp
+++ b/utils/v4l2-compliance/v4l2-test-buffers.cpp
@@ -414,7 +414,16 @@ int buffer::check(unsigned type, unsigned memory, unsigned index,
}
fail_on_test(!g_timestamp().tv_sec && !g_timestamp().tv_usec);
fail_on_test(g_flags() & V4L2_BUF_FLAG_DONE);
- fail_on_test((int)g_sequence() < seq.last_seq + 1);
+
+ // The vivid driver has unreliable timings causing wrong
+ // sequence numbers on occasion. Skip this test until this
+ // bug is solved.
+ if (!is_vivid)
+ fail_on_test((int)g_sequence() < seq.last_seq + 1);
+ else if ((int)g_sequence() < seq.last_seq + 1)
+ info("(int)g_sequence() < seq.last_seq + 1): %d < %d\n",
+ (int)g_sequence(), seq.last_seq + 1);
+
if (v4l_type_is_video(g_type())) {
fail_on_test(g_field() == V4L2_FIELD_ALTERNATE);
fail_on_test(g_field() == V4L2_FIELD_ANY);
@@ -436,12 +445,13 @@ int buffer::check(unsigned type, unsigned memory, unsigned index,
} else {
fail_on_test(g_field() != fmt.g_field());
if (static_cast<int>(g_sequence()) != seq.last_seq + 1)
- warn("got sequence number %u, expected %u\n",
- g_sequence(), seq.last_seq + 1);
+ warn_or_info(is_vivid,
+ "got sequence number %u, expected %u\n",
+ g_sequence(), seq.last_seq + 1);
}
} else if (static_cast<int>(g_sequence()) != seq.last_seq + 1) {
- warn("got sequence number %u, expected %u\n",
- g_sequence(), seq.last_seq + 1);
+ warn_or_info(is_vivid, "got sequence number %u, expected %u\n",
+ g_sequence(), seq.last_seq + 1);
}
seq.last_seq = static_cast<int>(g_sequence());
seq.last_field = g_field();

Privacy Policy