diff options
author | Stanimir Varbanov <stanimir.varbanov@linaro.org> | 2017-08-29 07:26:03 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2017-12-18 15:02:08 -0500 |
commit | c0cb76589c77b9a05f6271691be8707104ff0241 (patch) | |
tree | 64b881b57039c979d61cac6a74a89c21a9efa048 /drivers/media/v4l2-core/videobuf2-dma-contig.c | |
parent | c4b72ee8acce3d1e2a2fe7398aac9567deebf837 (diff) | |
download | linux-stable-c0cb76589c77b9a05f6271691be8707104ff0241.tar.gz linux-stable-c0cb76589c77b9a05f6271691be8707104ff0241.tar.bz2 linux-stable-c0cb76589c77b9a05f6271691be8707104ff0241.zip |
media: vb2: unify calling of set_page_dirty_lock
Currently videobuf2-dma-sg checks for dma direction for
every single page and videobuf2-dc lacks any dma direction
checks and calls set_page_dirty_lock unconditionally.
Thus unify and align the invocations of set_page_dirty_lock
for videobuf2-dc, videobuf2-sg memory allocators with
videobuf2-vmalloc, i.e. the pattern used in vmalloc has been
copied to dc and dma-sg.
Suggested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/v4l2-core/videobuf2-dma-contig.c')
-rw-r--r-- | drivers/media/v4l2-core/videobuf2-dma-contig.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/media/v4l2-core/videobuf2-dma-contig.c b/drivers/media/v4l2-core/videobuf2-dma-contig.c index a9806ba6116d..f1178f6f434d 100644 --- a/drivers/media/v4l2-core/videobuf2-dma-contig.c +++ b/drivers/media/v4l2-core/videobuf2-dma-contig.c @@ -434,8 +434,10 @@ static void vb2_dc_put_userptr(void *buf_priv) pages = frame_vector_pages(buf->vec); /* sgt should exist only if vector contains pages... */ BUG_ON(IS_ERR(pages)); - for (i = 0; i < frame_vector_count(buf->vec); i++) - set_page_dirty_lock(pages[i]); + if (buf->dma_dir == DMA_FROM_DEVICE || + buf->dma_dir == DMA_BIDIRECTIONAL) + for (i = 0; i < frame_vector_count(buf->vec); i++) + set_page_dirty_lock(pages[i]); sg_free_table(sgt); kfree(sgt); } |