diff options
author | Sergey Senozhatsky <senozhatsky@chromium.org> | 2020-05-14 18:01:47 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2020-06-23 13:34:06 +0200 |
commit | dcf3bfe7c71d8da57cda2e3e06b8c28ed155741b (patch) | |
tree | 66277100bba3963f00e3d788b948869466b62cc4 /drivers/media/common | |
parent | 38a417e88aad1e5ad5ff2647d4cd26040b567fc3 (diff) | |
download | linux-dcf3bfe7c71d8da57cda2e3e06b8c28ed155741b.tar.gz linux-dcf3bfe7c71d8da57cda2e3e06b8c28ed155741b.tar.bz2 linux-dcf3bfe7c71d8da57cda2e3e06b8c28ed155741b.zip |
media: videobuf2: do not sync caches when we are allowed not to
Skip ->prepare() or/and ->finish() cache synchronisation if
user-space requested us to do so (or when queue dma direction
permits us to skip cache syncs).
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')
-rw-r--r-- | drivers/media/common/videobuf2/videobuf2-core.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/media/common/videobuf2/videobuf2-core.c b/drivers/media/common/videobuf2/videobuf2-core.c index 1bf58e8c55e5..b15fb11be846 100644 --- a/drivers/media/common/videobuf2/videobuf2-core.c +++ b/drivers/media/common/videobuf2/videobuf2-core.c @@ -304,8 +304,11 @@ static void __vb2_buf_mem_prepare(struct vb2_buffer *vb) { unsigned int plane; - for (plane = 0; plane < vb->num_planes; ++plane) - call_void_memop(vb, prepare, vb->planes[plane].mem_priv); + if (vb->need_cache_sync_on_prepare) { + for (plane = 0; plane < vb->num_planes; ++plane) + call_void_memop(vb, prepare, + vb->planes[plane].mem_priv); + } vb->synced = 1; } @@ -317,8 +320,11 @@ static void __vb2_buf_mem_finish(struct vb2_buffer *vb) { unsigned int plane; - for (plane = 0; plane < vb->num_planes; ++plane) - call_void_memop(vb, finish, vb->planes[plane].mem_priv); + if (vb->need_cache_sync_on_finish) { + for (plane = 0; plane < vb->num_planes; ++plane) + call_void_memop(vb, finish, + vb->planes[plane].mem_priv); + } vb->synced = 0; } |