aboutsummaryrefslogtreecommitdiff
path: root/drivers/media/common/videobuf2/videobuf2-v4l2.c
diff options
context:
space:
mode:
authorGravatar Sergey Senozhatsky <senozhatsky@chromium.org> 2021-09-09 13:24:25 +0200
committerGravatar Mauro Carvalho Chehab <mchehab+huawei@kernel.org> 2021-09-30 10:07:56 +0200
commit0a12d652fcfe0c1be8fec7439b27d8392aa45678 (patch)
tree6a3bb7de03e47c9eda60275c4f606a8a456375d8 /drivers/media/common/videobuf2/videobuf2-v4l2.c
parentmedia: videobuf2: inverse buffer cache_hints flags (diff)
downloadlinux-0a12d652fcfe0c1be8fec7439b27d8392aa45678.tar.gz
linux-0a12d652fcfe0c1be8fec7439b27d8392aa45678.tar.bz2
linux-0a12d652fcfe0c1be8fec7439b27d8392aa45678.zip
media: videobuf2: split buffer cache_hints initialisation
V4L2 is not the perfect place to manage vb2 buffer cache hints. It works for V4L2 users, but there are backends that use vb2 core and don't use V4L2. Factor out buffer cache hints initialisation and call it when we allocate vb2 buffer. 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 'drivers/media/common/videobuf2/videobuf2-v4l2.c')
-rw-r--r--drivers/media/common/videobuf2/videobuf2-v4l2.c18
1 files changed, 0 insertions, 18 deletions
diff --git a/drivers/media/common/videobuf2/videobuf2-v4l2.c b/drivers/media/common/videobuf2/videobuf2-v4l2.c
index 454d58268602..2fbae9bd7b52 100644
--- a/drivers/media/common/videobuf2/videobuf2-v4l2.c
+++ b/drivers/media/common/videobuf2/videobuf2-v4l2.c
@@ -345,17 +345,6 @@ static void set_buffer_cache_hints(struct vb2_queue *q,
struct vb2_buffer *vb,
struct v4l2_buffer *b)
{
- /*
- * DMA exporter should take care of cache syncs, so we can avoid
- * explicit ->prepare()/->finish() syncs. For other ->memory types
- * we always need ->prepare() or/and ->finish() cache sync.
- */
- if (q->memory == VB2_MEMORY_DMABUF) {
- vb->skip_cache_sync_on_finish = 1;
- vb->skip_cache_sync_on_prepare = 1;
- return;
- }
-
if (!vb2_queue_allows_cache_hints(q)) {
/*
* Clear buffer cache flags if queue does not support user
@@ -367,13 +356,6 @@ static void set_buffer_cache_hints(struct vb2_queue *q,
return;
}
- /*
- * ->finish() cache sync can be avoided when queue direction is
- * TO_DEVICE.
- */
- if (q->dma_dir == DMA_TO_DEVICE)
- vb->skip_cache_sync_on_finish = 1;
-
if (b->flags & V4L2_BUF_FLAG_NO_CACHE_INVALIDATE)
vb->skip_cache_sync_on_finish = 1;