media: vb2: add bidirectional flag in vb2_queue
authorStanimir Varbanov <stanimir.varbanov@linaro.org>
Mon, 21 Aug 2017 11:34:10 +0000 (07:34 -0400)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Sat, 26 Aug 2017 18:15:54 +0000 (14:15 -0400)
commit5b6f9abe5a49df81737fbbfba890ee5b093f8168
tree4e93b0ae2f3405ff80bb61c4212be27a8f7b03d3
parentd533d5010ec373ea06ae4f253d7d69deb3fe0cfd
media: vb2: add bidirectional flag in vb2_queue

This change is intended to give to the v4l2 drivers a choice to
change the default behavior of the v4l2-core DMA mapping direction
from DMA_TO/FROM_DEVICE (depending on the buffer type CAPTURE or
OUTPUT) to DMA_BIDIRECTIONAL during queue_init time.

Initially the issue with DMA mapping direction has been found in
Venus encoder driver where the hardware (firmware side) adds few
lines padding on bottom of the image buffer, and the consequence
is triggering of IOMMU protection faults.

This will help supporting venus encoder (and probably other drivers
in the future) which wants to map output type of buffers as
read/write.

Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/v4l2-core/videobuf2-core.c
drivers/media/v4l2-core/videobuf2-dma-contig.c
drivers/media/v4l2-core/videobuf2-dma-sg.c
drivers/media/v4l2-core/videobuf2-vmalloc.c
include/media/videobuf2-core.h