aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil-cisco@xs4all.nl>2021-01-19 11:54:14 +0100
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2021-01-19 11:54:14 +0100
commit6053dad4c63a063fcd4714c85fd9dd10fe07f93e (patch)
tree60d107bcbddb776fe3054ed27ac309b39220723c
parent8301bcf83aae42482531ca0402d97b4bc2f3957a (diff)
v4l2-compliance: check correct buffer length after CREATE_BUFS
After using VIDIOC_CREATE_BUFS to allocate a double-sized buffer, check that VIDIOC_QUERYBUF reports the correct buffer size. This verifies that drivers preserve the requested size in their setup_queue callback. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-rw-r--r--utils/v4l2-compliance/v4l2-test-buffers.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/utils/v4l2-compliance/v4l2-test-buffers.cpp b/utils/v4l2-compliance/v4l2-test-buffers.cpp
index b3086abc..e40461bd 100644
--- a/utils/v4l2-compliance/v4l2-test-buffers.cpp
+++ b/utils/v4l2-compliance/v4l2-test-buffers.cpp
@@ -1360,6 +1360,13 @@ int testMmap(struct node *node, struct node *node_m2m_cap, unsigned frame_count,
fmt.s_sizeimage(fmt.g_sizeimage(p) * 2, p);
}
fail_on_test(q.create_bufs(node, 1, &fmt));
+ if (node->is_video) {
+ buffer buf(q);
+
+ fail_on_test(buf.querybuf(node, q.g_buffers() - 1));
+ for (unsigned p = 0; p < fmt.g_num_planes(); p++)
+ fail_on_test(buf.g_length(p) < fmt.g_sizeimage(p));
+ }
fail_on_test(q.reqbufs(node, 2));
}
if (v4l_type_is_output(type))

Privacy Policy