This patch lets user-space request a non-coherent memory allocation during CREATE_BUFS and REQBUFS ioctl calls. = CREATE_BUFS struct v4l2_create_buffers has seven 4-byte reserved areas, so reserved[0] is renamed to ->flags. The struct, thus, now has six reserved 4-byte regions. = CREATE_BUFS32 struct v4l2_create_buffers32 has seven 4-byte reserved areas, so reserved[0] is renamed to ->flags. The struct, thus, now has six reserved 4-byte regions. = REQBUFS We use one byte of a 4 byte ->reserved[1] member of struct v4l2_requestbuffers. The struct, thus, now has reserved 3 bytes.
Showing the changes to include/uapi (1 of 7 files). Show all
Unified · Split
| @@ -959,7 +959,8 @@ struct v4l2_requestbuffers { · 958 unmodified lines | ||
| 959 | 959 | __u32 type; /* enum v4l2_buf_type */ |
| 960 | 960 | __u32 memory; /* enum v4l2_memory */ |
| 961 | 961 | __u32 capabilities; |
| 962 | − __u32 reserved[1]; | |
| 962 | + __u8 flags; | |
| 963 | + __u8 reserved[3]; | |
| 963 | 964 | }; |
| 964 | 965 | |
| 965 | 966 | #define V4L2_MEMORY_FLAG_NON_COHERENT (1 << 0) |
| @@ -2507,6 +2508,9 @@ struct v4l2_dbg_chip_info { · 1541 unmodified lines | ||
| 2507 | 2508 | * @memory: enum v4l2_memory; buffer memory type |
| 2508 | 2509 | * @format: frame format, for which buffers are requested |
| 2509 | 2510 | * @capabilities: capabilities of this buffer type. |
| 2511 | + * @flags: additional buffer management attributes (ignored unless the | |
| 2512 | + * queue has V4L2_BUF_CAP_SUPPORTS_MMAP_CACHE_HINTS capability | |
| 2513 | + * and configured for MMAP streaming I/O). | |
| 2510 | 2514 | * @reserved: future extensions |
| 2511 | 2515 | */ |
| 2512 | 2516 | struct v4l2_create_buffers { |
| @@ -2515,7 +2519,8 @@ struct v4l2_create_buffers { · 2 unmodified lines | ||
| 2515 | 2519 | __u32 memory; |
| 2516 | 2520 | struct v4l2_format format; |
| 2517 | 2521 | __u32 capabilities; |
| 2518 | − __u32 reserved[7]; | |
| 2522 | + __u32 flags; | |
| 2523 | + __u32 reserved[6]; | |
| 2519 | 2524 | }; |
| 2520 | 2525 | |
| 2521 | 2526 | /* |