summaryrefslogtreecommitdiff
path: root/include/media/videobuf2-core.h
diff options
context:
space:
mode:
authorSergey Senozhatsky <senozhatsky@chromium.org>2020-05-14 18:01:42 +0200
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2020-06-23 13:25:11 +0200
commitf5f5fa73fbfb9f346f1b5f37ebf343bae6ef6361 (patch)
tree6dac7c8404b8b378374cd960af73577e09f0f437 /include/media/videobuf2-core.h
parent6d2199868a9aede70a4ee5fa32e6ae2800b8b25a (diff)
media: videobuf2: handle V4L2 buffer cache flags
Set video buffer cache management flags corresponding to V4L2 cache flags. Both ->prepare() and ->finish() cache management hints should be passed during this stage (buffer preparation), because there is no other way for user-space to tell V4L2 to avoid ->finish() cache flush. 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>
Diffstat (limited to 'include/media/videobuf2-core.h')
-rw-r--r--include/media/videobuf2-core.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/media/videobuf2-core.h b/include/media/videobuf2-core.h
index 7f39d9fffc8c..ccc5c498d3e3 100644
--- a/include/media/videobuf2-core.h
+++ b/include/media/videobuf2-core.h
@@ -636,6 +636,17 @@ struct vb2_queue {
};
/**
+ * vb2_queue_allows_cache_hints() - Return true if the queue allows cache
+ * and memory consistency hints.
+ *
+ * @q: pointer to &struct vb2_queue with videobuf2 queue
+ */
+static inline bool vb2_queue_allows_cache_hints(struct vb2_queue *q)
+{
+ return q->allow_cache_hints && q->memory == VB2_MEMORY_MMAP;
+}
+
+/**
* vb2_plane_vaddr() - Return a kernel virtual address of a given plane.
* @vb: pointer to &struct vb2_buffer to which the plane in
* question belongs to.