media: videobuf2: add V4L2_FLAG_MEMORY_NON_CONSISTENT flag
authorSergey Senozhatsky <senozhatsky@chromium.org>
Thu, 14 May 2020 16:01:43 +0000 (18:01 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Tue, 23 Jun 2020 11:28:17 +0000 (13:28 +0200)
commitac53503ee38a1ffbc47c7cca6cbfc48ba9c65c5e
treeb7ecc13ff0ade9fd511d5f7a788237cb0f126a00
parentf5f5fa73fbfb9f346f1b5f37ebf343bae6ef6361
media: videobuf2: add V4L2_FLAG_MEMORY_NON_CONSISTENT flag

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.

Signed-off-by: Sergey Senozhatsky <senozhatsky@chromium.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Documentation/userspace-api/media/v4l/buffer.rst
Documentation/userspace-api/media/v4l/vidioc-reqbufs.rst
drivers/media/common/videobuf2/videobuf2-v4l2.c
include/uapi/linux/videodev2.h