CHROMIUM: vb2: Add a new "use_dma_bidirectional" queue flag.
authorPawel Osciak <posciak@chromium.org>
Wed, 16 Sep 2015 12:21:49 +0000 (21:21 +0900)
committerHuang, Tao <huangtao@rock-chips.com>
Thu, 30 Jun 2016 11:58:12 +0000 (19:58 +0800)
commitbd60ad374e87b77eb9cca8aa69584bdda1dd81b6
treea8218ffa06df9fb9f755c31969e070ce505ad7dc
parente21bcf16b39e0ca3385505aacd0002dfd0aae049
CHROMIUM: vb2: Add a new "use_dma_bidirectional" queue flag.

When set to 1 for CAPTURE queues by the driver on calling vb2_queue_init(),
forces the buffers on the queue to be allocated/mapped with
DMA_BIDIRECTIONAL DMA direction flag, instead of DMA_FROM_DEVICE. This
allows the device not only to write to the buffers, but also read out from
them. This may be useful e.g. for codec hardware, which may be using
CAPTURE buffers as reference to decode other buffers.

This flag is ignored for OUTPUT queues, as we don't want to allow HW to
be able to write to OUTPUT buffers.

Signed-off-by: Pawel Osciak <posciak@chromium.org>
BUG=chrome-os-partner:45346
TEST=video playback

Reviewed-on: https://chromium-review.googlesource.com/300726
Commit-Ready: Pawel Osciak <posciak@chromium.org>
Tested-by: Pawel Osciak <posciak@chromium.org>
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Change-Id: Ifba955eef75ac23c9a13edab04bc1fe7f5375c70
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
drivers/media/v4l2-core/videobuf2-core.c
include/media/videobuf2-core.h