| From 34f8c2b4de70e14153dd74e05db97fc3c12829a5 Mon Sep 17 00:00:00 2001 |
| From: Sergey Senozhatsky <senozhatsky@chromium.org> |
| Date: Wed, 15 Sep 2021 12:58:32 +0900 |
| Subject: [PATCH] CHROMIUM: media: add vb2 buffer memory coherency hints |
| |
| Add V4L2_MEMORY_FLAG_NON_COHERENT macro which user-space can pass |
| via v4l2_requestbuffers and v4l2_create_buffers flags to request |
| non-coherent memory type. |
| |
| BUG=b:167319762 |
| TEST=none |
| |
| Signed-off-by: Sergey Senozhatsky <senozhatsky@chromium.org> |
| Change-Id: I423372d40ed1445f00edf2ffbdadd2bd11b2ad52 |
| --- |
| include/uapi/linux/videodev2.h | 11 +++++++++-- |
| 1 file changed, 9 insertions(+), 2 deletions(-) |
| |
| diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h |
| index a86b4f346fa5..8c822fbaaa37 100644 |
| --- a/include/uapi/linux/videodev2.h |
| +++ b/include/uapi/linux/videodev2.h |
| @@ -1000,9 +1000,12 @@ struct v4l2_requestbuffers { |
| __u32 type; /* enum v4l2_buf_type */ |
| __u32 memory; /* enum v4l2_memory */ |
| __u32 capabilities; |
| - __u32 reserved[1]; |
| + __u8 flags; |
| + __u8 reserved[3]; |
| }; |
| |
| +#define V4L2_MEMORY_FLAG_NON_COHERENT (1 << 0) |
| + |
| /* 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) |
| @@ -2529,6 +2532,9 @@ struct v4l2_dbg_chip_info { |
| * @memory: enum v4l2_memory; buffer memory type |
| * @format: frame format, for which buffers are requested |
| * @capabilities: capabilities of this buffer type. |
| + * @flags: additional buffer management attributes (ignored unless the |
| + * queue has V4L2_BUF_CAP_SUPPORTS_MMAP_CACHE_HINTS capability |
| + * and configured for MMAP streaming I/O). |
| * @reserved: future extensions |
| */ |
| struct v4l2_create_buffers { |
| @@ -2537,7 +2543,8 @@ struct v4l2_create_buffers { |
| __u32 memory; |
| struct v4l2_format format; |
| __u32 capabilities; |
| - __u32 reserved[7]; |
| + __u32 flags; |
| + __u32 reserved[6]; |
| }; |
| |
| /* |
| -- |
| 2.31.0 |
| |