aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergey Senozhatsky <sergey.senozhatsky@gmail.com>2020-09-11 12:09:52 +0900
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2020-10-04 13:39:42 +0200
commitdc2b92a47c456d48063b953836cc365829b67868 (patch)
tree0881ebe0948844becbb7b00627a1ef68768976c7
parent749309117723ee4795d16ce4f744e4b099e4979a (diff)
v4l-compliance: remove NON_CONSISTENT hint test
Kernel support for V4L2_FLAG_MEMORY_NON_CONSISTENT has been reverted, so we need to to remove the memory consistency (coherency) tests from the test-buffers code. Note, the buffer cache management hints support is still there and should be tested. Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> [hverkuil: squashed this patch with the sync-to-kernel patch,] [hverkuil: otherwise bisect would fail]
-rw-r--r--contrib/freebsd/include/linux/videodev2.h13
-rw-r--r--include/linux/videodev2.h13
-rw-r--r--utils/common/cv4l-helpers.h8
-rw-r--r--utils/common/v4l-helpers.h8
-rw-r--r--utils/v4l2-compliance/v4l2-test-buffers.cpp40
5 files changed, 13 insertions, 69 deletions
diff --git a/contrib/freebsd/include/linux/videodev2.h b/contrib/freebsd/include/linux/videodev2.h
index ba4900fc..ef5f2ce7 100644
--- a/contrib/freebsd/include/linux/videodev2.h
+++ b/contrib/freebsd/include/linux/videodev2.h
@@ -223,8 +223,6 @@ enum v4l2_memory {
V4L2_MEMORY_DMABUF = 4,
};
-#define V4L2_FLAG_MEMORY_NON_CONSISTENT (1 << 0)
-
/* see also http://vektor.theorem.ca/graphics/ycbcr/ */
enum v4l2_colorspace {
/*
@@ -965,10 +963,7 @@ struct v4l2_requestbuffers {
uint32_t type; /* enum v4l2_buf_type */
uint32_t memory; /* enum v4l2_memory */
uint32_t capabilities;
- union {
- uint32_t flags;
- uint32_t reserved[1];
- };
+ uint32_t reserved[1];
};
/* capabilities for struct v4l2_requestbuffers and v4l2_create_buffers */
@@ -2458,9 +2453,6 @@ struct v4l2_dbg_chip_info {
* @memory: enum v4l2_memory; buffer memory type
* @format: frame format, for which buffers are requested
* @capabilities: capabilities of this buffer type.
- * @flags: additional buffer management attributes (ignored unless the
- * queue has V4L2_BUF_CAP_SUPPORTS_MMAP_CACHE_HINTS capability
- * and configured for MMAP streaming I/O).
* @reserved: future extensions
*/
struct v4l2_create_buffers {
@@ -2469,8 +2461,7 @@ struct v4l2_create_buffers {
uint32_t memory;
struct v4l2_format format;
uint32_t capabilities;
- uint32_t flags;
- uint32_t reserved[6];
+ uint32_t reserved[7];
};
/*
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index e3d3356b..a789dec7 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -189,8 +189,6 @@ enum v4l2_memory {
V4L2_MEMORY_DMABUF = 4,
};
-#define V4L2_FLAG_MEMORY_NON_CONSISTENT (1 << 0)
-
/* see also http://vektor.theorem.ca/graphics/ycbcr/ */
enum v4l2_colorspace {
/*
@@ -931,10 +929,7 @@ struct v4l2_requestbuffers {
__u32 type; /* enum v4l2_buf_type */
__u32 memory; /* enum v4l2_memory */
__u32 capabilities;
- union {
- __u32 flags;
- __u32 reserved[1];
- };
+ __u32 reserved[1];
};
/* capabilities for struct v4l2_requestbuffers and v4l2_create_buffers */
@@ -2424,9 +2419,6 @@ struct v4l2_dbg_chip_info {
* @memory: enum v4l2_memory; buffer memory type
* @format: frame format, for which buffers are requested
* @capabilities: capabilities of this buffer type.
- * @flags: additional buffer management attributes (ignored unless the
- * queue has V4L2_BUF_CAP_SUPPORTS_MMAP_CACHE_HINTS capability
- * and configured for MMAP streaming I/O).
* @reserved: future extensions
*/
struct v4l2_create_buffers {
@@ -2435,8 +2427,7 @@ struct v4l2_create_buffers {
__u32 memory;
struct v4l2_format format;
__u32 capabilities;
- __u32 flags;
- __u32 reserved[6];
+ __u32 reserved[7];
};
/*
diff --git a/utils/common/cv4l-helpers.h b/utils/common/cv4l-helpers.h
index 3cee372b..712efde6 100644
--- a/utils/common/cv4l-helpers.h
+++ b/utils/common/cv4l-helpers.h
@@ -754,17 +754,17 @@ public:
int g_fd(unsigned index, unsigned plane) const { return v4l_queue_g_fd(this, index, plane); }
void s_fd(unsigned index, unsigned plane, int fd) { v4l_queue_s_fd(this, index, plane, fd); }
- int reqbufs(cv4l_fd *fd, unsigned count = 0, unsigned int flags = 0)
+ int reqbufs(cv4l_fd *fd, unsigned count = 0)
{
- return v4l_queue_reqbufs(fd->g_v4l_fd(), this, count, flags);
+ return v4l_queue_reqbufs(fd->g_v4l_fd(), this, count);
}
bool has_create_bufs(cv4l_fd *fd) const
{
return v4l_queue_has_create_bufs(fd->g_v4l_fd(), this);
}
- int create_bufs(cv4l_fd *fd, unsigned count, const v4l2_format *fmt = NULL, unsigned int flags = 0)
+ int create_bufs(cv4l_fd *fd, unsigned count, const v4l2_format *fmt = NULL)
{
- return v4l_queue_create_bufs(fd->g_v4l_fd(), this, count, fmt, flags);
+ return v4l_queue_create_bufs(fd->g_v4l_fd(), this, count, fmt);
}
int mmap_bufs(cv4l_fd *fd, unsigned from = 0)
{
diff --git a/utils/common/v4l-helpers.h b/utils/common/v4l-helpers.h
index c09cd987..f96b3c38 100644
--- a/utils/common/v4l-helpers.h
+++ b/utils/common/v4l-helpers.h
@@ -1515,7 +1515,7 @@ static inline int v4l_queue_querybufs(struct v4l_fd *f, struct v4l_queue *q, uns
}
static inline int v4l_queue_reqbufs(struct v4l_fd *f,
- struct v4l_queue *q, unsigned count, unsigned int flags = 0)
+ struct v4l_queue *q, unsigned count)
{
struct v4l2_requestbuffers reqbufs;
int ret;
@@ -1523,7 +1523,6 @@ static inline int v4l_queue_reqbufs(struct v4l_fd *f,
reqbufs.type = q->type;
reqbufs.memory = q->memory;
reqbufs.count = count;
- reqbufs.flags = flags;
/*
* Problem: if REQBUFS returns an error, did it free any old
* buffers or not?
@@ -1548,7 +1547,7 @@ static inline bool v4l_queue_has_create_bufs(struct v4l_fd *f, const struct v4l_
static inline int v4l_queue_create_bufs(struct v4l_fd *f,
struct v4l_queue *q, unsigned count,
- const struct v4l2_format *fmt, unsigned int flags = 0)
+ const struct v4l2_format *fmt)
{
struct v4l2_create_buffers createbufs;
int ret;
@@ -1556,7 +1555,6 @@ static inline int v4l_queue_create_bufs(struct v4l_fd *f,
createbufs.format.type = q->type;
createbufs.memory = q->memory;
createbufs.count = count;
- createbufs.flags = flags;
if (fmt) {
createbufs.format = *fmt;
} else {
@@ -1735,7 +1733,7 @@ static inline void v4l_queue_free(struct v4l_fd *f, struct v4l_queue *q)
v4l_ioctl(f, VIDIOC_STREAMOFF, &q->type);
v4l_queue_release_bufs(f, q, 0);
v4l_queue_close_exported_fds(q);
- v4l_queue_reqbufs(f, q, 0, 0);
+ v4l_queue_reqbufs(f, q, 0);
}
static inline void v4l_queue_buffer_update(const struct v4l_queue *q,
diff --git a/utils/v4l2-compliance/v4l2-test-buffers.cpp b/utils/v4l2-compliance/v4l2-test-buffers.cpp
index aca0eb68..1651e95c 100644
--- a/utils/v4l2-compliance/v4l2-test-buffers.cpp
+++ b/utils/v4l2-compliance/v4l2-test-buffers.cpp
@@ -653,10 +653,6 @@ int testReqBufs(struct node *node)
fail_on_test(q.reqbufs(node, 0));
for (m = V4L2_MEMORY_MMAP; m <= V4L2_MEMORY_DMABUF; m++) {
- bool cache_hints_cap = false;
- bool consistent;
-
- cache_hints_cap = q.g_capabilities() & V4L2_BUF_CAP_SUPPORTS_MMAP_CACHE_HINTS;
if (!(node->valid_memorytype & (1 << m)))
continue;
cv4l_queue q2(i, m);
@@ -672,17 +668,8 @@ int testReqBufs(struct node *node)
reqbufs.count = 1;
reqbufs.type = i;
reqbufs.memory = m;
- reqbufs.flags = V4L2_FLAG_MEMORY_NON_CONSISTENT;
fail_on_test(doioctl(node, VIDIOC_REQBUFS, &reqbufs));
- consistent = reqbufs.flags & V4L2_FLAG_MEMORY_NON_CONSISTENT;
- if (!cache_hints_cap) {
- fail_on_test(consistent);
- } else {
- if (m == V4L2_MEMORY_MMAP)
- fail_on_test(!consistent);
- else
- fail_on_test(consistent);
- }
+ fail_on_test(check_0(reqbufs.reserved, sizeof(reqbufs.reserved)));
q.reqbufs(node);
ret = q.create_bufs(node, 0);
@@ -695,32 +682,9 @@ int testReqBufs(struct node *node)
node->g_fmt(crbufs.format, i);
crbufs.count = 1;
crbufs.memory = m;
- crbufs.flags = V4L2_FLAG_MEMORY_NON_CONSISTENT;
fail_on_test(doioctl(node, VIDIOC_CREATE_BUFS, &crbufs));
fail_on_test(check_0(crbufs.reserved, sizeof(crbufs.reserved)));
fail_on_test(crbufs.index != q.g_buffers());
-
- consistent = crbufs.flags & V4L2_FLAG_MEMORY_NON_CONSISTENT;
- if (!cache_hints_cap) {
- fail_on_test(consistent);
- } else {
- if (m == V4L2_MEMORY_MMAP)
- fail_on_test(!consistent);
- else
- fail_on_test(consistent);
- }
-
- if (cache_hints_cap) {
- /*
- * Different memory consistency model. Should fail for MMAP
- * queues which support cache hints.
- */
- crbufs.flags = 0;
- if (m == V4L2_MEMORY_MMAP)
- fail_on_test(doioctl(node, VIDIOC_CREATE_BUFS, &crbufs) != EINVAL);
- else
- fail_on_test(doioctl(node, VIDIOC_CREATE_BUFS, &crbufs));
- }
q.reqbufs(node);
fail_on_test(q.create_bufs(node, 1));
@@ -1352,7 +1316,7 @@ int testMmap(struct node *node, struct node *node_m2m_cap, unsigned frame_count,
have_createbufs = false;
if (have_createbufs) {
q.reqbufs(node);
- q.create_bufs(node, 2, &cur_fmt, V4L2_FLAG_MEMORY_NON_CONSISTENT);
+ q.create_bufs(node, 2, &cur_fmt);
fail_on_test(setupMmap(node, q));
q.munmap_bufs(node);
q.reqbufs(node, 2);

Privacy Policy