| From ca80a9939af23d3739f2c959b2637257809c297d Mon Sep 17 00:00:00 2001 |
| From: Hans Verkuil <hansverk@cisco.com> |
| Date: Thu, 23 Aug 2018 09:56:22 -0400 |
| Subject: [PATCH 4/4] BACKPORT: media: videodev2.h: add new capabilities for |
| buffer types |
| |
| VIDIOC_REQBUFS and VIDIOC_CREATE_BUFFERS will return capabilities |
| telling userspace what the given buffer type is capable of. |
| |
| Signed-off-by: Hans Verkuil <hansverk@cisco.com> |
| Reviewed-by: Tomasz Figa <tfiga@chromium.org> |
| Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> |
| Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> |
| (cherry picked from commit f35f5d72e70e6b91389eb98fcabf43b79f40587f) |
| Signed-off-by: Alexandre Courbot <acourbot@chromium.org> |
| --- |
| include/uapi/linux/videodev2.h | 13 +++++++++++-- |
| 1 file changed, 11 insertions(+), 2 deletions(-) |
| |
| diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h |
| index ed8bc83..8c8e635 100644 |
| --- a/include/uapi/linux/videodev2.h |
| +++ b/include/uapi/linux/videodev2.h |
| @@ -861,9 +861,16 @@ struct v4l2_requestbuffers { |
| __u32 count; |
| __u32 type; /* enum v4l2_buf_type */ |
| __u32 memory; /* enum v4l2_memory */ |
| - __u32 reserved[2]; |
| + __u32 capabilities; |
| + __u32 reserved[1]; |
| }; |
| |
| +/* capabilities for struct v4l2_requestbuffers and v4l2_create_buffers */ |
| +#define V4L2_BUF_CAP_SUPPORTS_MMAP (1 << 0) |
| +#define V4L2_BUF_CAP_SUPPORTS_USERPTR (1 << 1) |
| +#define V4L2_BUF_CAP_SUPPORTS_DMABUF (1 << 2) |
| +#define V4L2_BUF_CAP_SUPPORTS_REQUESTS (1 << 3) |
| + |
| /** |
| * struct v4l2_plane - plane info for multi-planar buffers |
| * @bytesused: number of bytes occupied by data in the plane (payload) |
| @@ -2341,6 +2348,7 @@ struct v4l2_dbg_chip_info { |
| * return: number of created buffers |
| * @memory: enum v4l2_memory; buffer memory type |
| * @format: frame format, for which buffers are requested |
| + * @capabilities: capabilities of this buffer type. |
| * @reserved: future extensions |
| */ |
| struct v4l2_create_buffers { |
| @@ -2348,7 +2356,8 @@ struct v4l2_create_buffers { |
| __u32 count; |
| __u32 memory; |
| struct v4l2_format format; |
| - __u32 reserved[8]; |
| + __u32 capabilities; |
| + __u32 reserved[7]; |
| }; |
| |
| /* |
| -- |
| 2.16.4 |
| |