By setting or clearing V4L2_FLAG_MEMORY_NON_CONSISTENT flag user-space should be able to set or clear queue's NON_CONSISTENT ->dma_attrs. Queue's ->dma_attrs are passed to the underlying allocator in __vb2_buf_mem_alloc(), so thus user-space is able to request vb2 buffer's memory to be either consistent (coherent) or non-consistent. The patch set also adds a corresponding capability flag: fill_buf_caps() reports V4L2_BUF_CAP_SUPPORTS_MMAP_CACHE_HINTS when queue supports user-space cache management hints. Note, however, that MMAP_CACHE_HINTS capability only valid when the queue is used for memory MMAP-ed streaming I/O.
Showing the changes to include/uapi/linux (1 of 4 files). Show all
Unified · Split
| @@ -189,6 +189,8 @@ enum v4l2_memory { · 188 unmodified lines | |||
| 189 | V4L2_MEMORY_DMABUF = 4, | 189 | V4L2_MEMORY_DMABUF = 4, |
| 190 | }; | 190 | }; |
| 191 | 191 | ||
| 192 | #define V4L2_FLAG_MEMORY_NON_CONSISTENT (1 << 0) | ||
| 193 | |||
| 192 | /* see also http://vektor.theorem.ca/graphics/ycbcr/ */ | 194 | /* see also http://vektor.theorem.ca/graphics/ycbcr/ */ |
| 193 | enum v4l2_colorspace { | 195 | enum v4l2_colorspace { |
| 194 | /* | 196 | /* |
| @@ -954,6 +956,7 @@ struct v4l2_requestbuffers { · 759 unmodified lines | |||
| 954 | #define V4L2_BUF_CAP_SUPPORTS_REQUESTS (1 << 3) | 956 | #define V4L2_BUF_CAP_SUPPORTS_REQUESTS (1 << 3) |
| 955 | #define V4L2_BUF_CAP_SUPPORTS_ORPHANED_BUFS (1 << 4) | 957 | #define V4L2_BUF_CAP_SUPPORTS_ORPHANED_BUFS (1 << 4) |
| 956 | #define V4L2_BUF_CAP_SUPPORTS_M2M_HOLD_CAPTURE_BUF (1 << 5) | 958 | #define V4L2_BUF_CAP_SUPPORTS_M2M_HOLD_CAPTURE_BUF (1 << 5) |
| 959 | #define V4L2_BUF_CAP_SUPPORTS_MMAP_CACHE_HINTS (1 << 6) | ||
| 957 | 960 | ||
| 958 | /** | 961 | /** |
| 959 | * struct v4l2_plane - plane info for multi-planar buffers | 962 | * struct v4l2_plane - plane info for multi-planar buffers |