History

media: videobuf2: handle V4L2_MEMORY_FLAG_NON_COHERENT flag

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.

Sergey Senozhatsky committed 5 years ago

Commit c0acf9c1 parent b00a9e57 files · +60 −15Browse files

Showing the changes to include/uapi (1 of 7 files). Show all

Unified · Split

include/uapi/linux/videodev2.h+7−2
@@ -959,7 +959,8 @@ struct v4l2_requestbuffers { · 958 unmodified lines
959959 __u32 type; /* enum v4l2_buf_type */
960960 __u32 memory; /* enum v4l2_memory */
961961 __u32 capabilities;
962− __u32 reserved[1];
962+ __u8 flags;
963+ __u8 reserved[3];
963964 };
964965
965966 #define V4L2_MEMORY_FLAG_NON_COHERENT (1 << 0)
@@ -2507,6 +2508,9 @@ struct v4l2_dbg_chip_info { · 1541 unmodified lines
25072508 * @memory: enum v4l2_memory; buffer memory type
25082509 * @format: frame format, for which buffers are requested
25092510 * @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).
25102514 * @reserved: future extensions
25112515 */
25122516 struct v4l2_create_buffers {
@@ -2515,7 +2519,8 @@ struct v4l2_create_buffers { · 2 unmodified lines
25152519 __u32 memory;
25162520 struct v4l2_format format;
25172521 __u32 capabilities;
2518− __u32 reserved[7];
2522+ __u32 flags;
2523+ __u32 reserved[6];
25192524 };
25202525
25212526 /*