VIDIOC_REQBUFS and VIDIOC_CREATE_BUFFERS will return capabilities telling userspace what the given buffer type is capable of.
Showing the changes to include/uapi/linux (1 of 3 files). Show all
Unified · Split
| @@ -856,9 +856,16 @@ struct v4l2_requestbuffers { · 855 unmodified lines | ||
| 856 | 856 | __u32 count; |
| 857 | 857 | __u32 type; /* enum v4l2_buf_type */ |
| 858 | 858 | __u32 memory; /* enum v4l2_memory */ |
| 859 | − __u32 reserved[2]; | |
| 859 | + __u32 capabilities; | |
| 860 | + __u32 reserved[1]; | |
| 860 | 861 | }; |
| 861 | 862 | |
| 863 | +/* capabilities for struct v4l2_requestbuffers and v4l2_create_buffers */ | |
| 864 | +#define V4L2_BUF_CAP_SUPPORTS_MMAP (1 << 0) | |
| 865 | +#define V4L2_BUF_CAP_SUPPORTS_USERPTR (1 << 1) | |
| 866 | +#define V4L2_BUF_CAP_SUPPORTS_DMABUF (1 << 2) | |
| 867 | +#define V4L2_BUF_CAP_SUPPORTS_REQUESTS (1 << 3) | |
| 868 | + | |
| 862 | 869 | /** |
| 863 | 870 | * struct v4l2_plane - plane info for multi-planar buffers |
| 864 | 871 | * @bytesused: number of bytes occupied by data in the plane (payload) |
| @@ -2319,6 +2326,7 @@ struct v4l2_dbg_chip_info { · 1454 unmodified lines | ||
| 2319 | 2326 | * return: number of created buffers |
| 2320 | 2327 | * @memory: enum v4l2_memory; buffer memory type |
| 2321 | 2328 | * @format: frame format, for which buffers are requested |
| 2329 | + * @capabilities: capabilities of this buffer type. | |
| 2322 | 2330 | * @reserved: future extensions |
| 2323 | 2331 | */ |
| 2324 | 2332 | struct v4l2_create_buffers { |
| @@ -2326,7 +2334,8 @@ struct v4l2_create_buffers { · 1 unmodified line | ||
| 2326 | 2334 | __u32 count; |
| 2327 | 2335 | __u32 memory; |
| 2328 | 2336 | struct v4l2_format format; |
| 2329 | − __u32 reserved[8]; | |
| 2337 | + __u32 capabilities; | |
| 2338 | + __u32 reserved[7]; | |
| 2330 | 2339 | }; |
| 2331 | 2340 | |
| 2332 | 2341 | /* |