aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil-cisco@xs4all.nl>2018-11-28 10:10:10 +0100
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2018-11-28 10:10:10 +0100
commit15de2e05ffa7e16f400fef5b6a7527b6b6534ef8 (patch)
tree5c4d0306c6ead76c26e20f7854dccbe967b305fa
parentff41164e10010be7209d3b7b98c209f98407a320 (diff)
v4l2-compliance: test failure during req_validate
Test what happens if the validation of a queued request fails. Testing using vivid and its error injection feature. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-rw-r--r--utils/v4l2-compliance/v4l2-test-buffers.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/utils/v4l2-compliance/v4l2-test-buffers.cpp b/utils/v4l2-compliance/v4l2-test-buffers.cpp
index b75ce4d4..bee8569b 100644
--- a/utils/v4l2-compliance/v4l2-test-buffers.cpp
+++ b/utils/v4l2-compliance/v4l2-test-buffers.cpp
@@ -38,8 +38,13 @@
#include "v4l2-compliance.h"
#define V4L2_CTRL_CLASS_VIVID 0x00f00000
-#define VIVID_CID_VIVID_BASE (V4L2_CTRL_CLASS_VIVID | 0xf000)
-#define VIVID_CID_START_STR_ERROR (VIVID_CID_VIVID_BASE + 69)
+#define VIVID_CID_VIVID_BASE (V4L2_CTRL_CLASS_VIVID | 0xf000)
+#define VIVID_CID_DISCONNECT (VIVID_CID_VIVID_BASE + 65)
+#define VIVID_CID_DQBUF_ERROR (VIVID_CID_VIVID_BASE + 66)
+#define VIVID_CID_QUEUE_SETUP_ERROR (VIVID_CID_VIVID_BASE + 67)
+#define VIVID_CID_BUF_PREPARE_ERROR (VIVID_CID_VIVID_BASE + 68)
+#define VIVID_CID_START_STR_ERROR (VIVID_CID_VIVID_BASE + 69)
+#define VIVID_CID_QUEUE_ERROR (VIVID_CID_VIVID_BASE + 70)
static struct cv4l_fmt cur_fmt;
static int stream_from_fd = -1;
@@ -1655,6 +1660,15 @@ int testRequests(struct node *node, bool test_streaming)
fail_on_test(buf.querybuf(node, i));
fail_on_test(!(buf.g_flags() & V4L2_BUF_FLAG_IN_REQUEST));
fail_on_test(!(buf.g_flags() & V4L2_BUF_FLAG_REQUEST_FD));
+ if (is_vivid && i > num_bufs - 2) {
+ v4l2_control ctrl = {
+ .id = VIVID_CID_BUF_PREPARE_ERROR,
+ };
+
+ if (!node->s_ctrl(ctrl))
+ fail_on_test(doioctl_fd(buf_req_fds[i],
+ MEDIA_REQUEST_IOC_QUEUE, 0) != EINVAL);
+ }
fail_on_test(doioctl_fd(buf_req_fds[i], MEDIA_REQUEST_IOC_QUEUE, 0));
fail_on_test(buf.querybuf(node, i));
fail_on_test(buf.g_flags() & V4L2_BUF_FLAG_IN_REQUEST);

Privacy Policy