[PATCH] v4l2-compliance: add EOPNOTSUPP for create_bufs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If VIDIOC_CREATE_BUFS is supported on one queue but not the other, then
the driver should return EOPNOTSUPP for the unsupported queue only.

Signed-off-by: Deborah Brouwer <deborah.brouwer@xxxxxxxxxxxxx>
---
On the wave5 driver, v4l2-compliance -d0 -v now shows:
<snip>
Buffer ioctls:
        info: test buftype Video Capture Multiplanar
        info: VIDIOC_CREATE_BUFS not supported for Video Capture Multiplanar
        info: test buftype Video Output Multiplanar
    test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK
    test VIDIOC_EXPBUF: OK
        info: could not test the Request API, no suitable control found
    test Requests: OK (Not Supported)

Total for wave5-dec device /dev/video0: 45, Succeeded: 45, Failed: 0, Warnings: 0

 utils/v4l2-compliance/v4l2-compliance.h     | 1 +
 utils/v4l2-compliance/v4l2-test-buffers.cpp | 8 ++++++++
 2 files changed, 9 insertions(+)

diff --git a/utils/v4l2-compliance/v4l2-compliance.h b/utils/v4l2-compliance/v4l2-compliance.h
index 7caf254b..99c98916 100644
--- a/utils/v4l2-compliance/v4l2-compliance.h
+++ b/utils/v4l2-compliance/v4l2-compliance.h
@@ -165,6 +165,7 @@ struct base_node {
 	bool supports_orphaned_bufs;
 	// support for this was introduced in 5.9
 	bool might_support_cache_hints;
+	bool create_bufs_on_one_queue_only;
 };
 
 struct node : public base_node, public cv4l_fd {
diff --git a/utils/v4l2-compliance/v4l2-test-buffers.cpp b/utils/v4l2-compliance/v4l2-test-buffers.cpp
index 6d592c9b..e709580b 100644
--- a/utils/v4l2-compliance/v4l2-test-buffers.cpp
+++ b/utils/v4l2-compliance/v4l2-test-buffers.cpp
@@ -693,6 +693,14 @@ int testReqBufs(struct node *node)
 				warn("VIDIOC_CREATE_BUFS not supported\n");
 				break;
 			}
+			if (ret == EOPNOTSUPP) {
+				/* VIDIOC_CREATE_BUFS is supported on one queue but not the other. */
+				fail_on_test(node->create_bufs_on_one_queue_only);
+				node->create_bufs_on_one_queue_only = true;
+				info("VIDIOC_CREATE_BUFS not supported for %s\n",
+				     buftype2s(q.g_type()).c_str());
+				break;
+			}
 
 			memset(&crbufs, 0xff, sizeof(crbufs));
 			node->g_fmt(crbufs.format, i);
-- 
2.40.1




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux