]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
[media] tw686x: Introduce an interface to support multiple DMA modes
authorEzequiel Garcia <ezequiel@vanguardiasur.com.ar>
Sat, 4 Jun 2016 23:47:15 +0000 (20:47 -0300)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Tue, 28 Jun 2016 10:47:40 +0000 (07:47 -0300)
commitf8afaa8dbc0dcc2995df015ba18164e7c91201fc
tree0d7daba36f628e62caf1f69f7b278548777d272c
parent068adc457f2a795b871429464dbec15388c6dc57
[media] tw686x: Introduce an interface to support multiple DMA modes

Let's set the corner stone to support all the DMA modes
available on this device.

For stability reasons, the driver is currently setting DMA frame
mode, and using single DMA buffers to get the P and B buffers.
Each frame is then memcpy'ed into the user buffer.

However, other platforms might be interested in avoiding this
memcpy, or in taking advantage of the chip's DMA scatter-gather
capabilities.

To achieve this, this commit introduces a "dma_mode" module parameter,
and a tw686x_dma_ops struct. This will allow to define functions to
alloc/free DMA buffers, and to return the frames to userspace.

The memcpy-based method described above is named as dma_mode="memcpy".
Current alloc/free functions are renamed as tw686x_memcpy_xxx,
and are now used through a memcpy_dma_ops.

Tested-by: Tim Harvey <tharvey@gateworks.com>
Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/pci/tw686x/tw686x-core.c
drivers/media/pci/tw686x/tw686x-regs.h
drivers/media/pci/tw686x/tw686x-video.c
drivers/media/pci/tw686x/tw686x.h