]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit - include/linux/dmaengine.h
dmaengine: Add support for repeating transactions
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Fri, 17 Jul 2020 01:33:34 +0000 (04:33 +0300)
committerVinod Koul <vkoul@kernel.org>
Fri, 17 Jul 2020 06:07:59 +0000 (11:37 +0530)
commit9c8ebd8b82da89c2484594b61d66288d24983348
tree5723f84ada30fa6bc7d9bfe123f4511a6df8f143
parentef9303fdf46f770e8534ab6f72bad946e70ddfc3
dmaengine: Add support for repeating transactions

DMA engines used with displays perform 2D interleaved transfers to read
framebuffers from memory and feed the data to the display engine. As the
same framebuffer can be displayed for multiple frames, the DMA
transactions need to be repeated until a new framebuffer replaces the
current one. This feature is implemented natively by some DMA engines
that have the ability to repeat transactions and switch to a new
transaction at the end of a transfer without any race condition or frame
loss.

This patch implements support for this feature in the DMA engine API. A
new DMA_PREP_REPEAT transaction flag allows DMA clients to instruct the
DMA channel to repeat the transaction automatically until one or more
new transactions are issued on the channel (or until all active DMA
transfers are explicitly terminated with the dmaengine_terminate_*()
functions). A new DMA_REPEAT transaction type is also added for DMA
engine drivers to report their support of the DMA_PREP_REPEAT flag.

A new DMA_PREP_LOAD_EOT transaction flag is also introduced (with a
corresponding DMA_LOAD_EOT capability bit), as requested during the
review of v4. The flag instructs the DMA channel that the transaction
being queued should replace the active repeated transaction when the
latter terminates (at End Of Transaction). Not setting the flag will
result in the active repeated transaction to continue being repeated,
and the new transaction being silently ignored.

The DMA_PREP_REPEAT flag is currently supported for interleaved
transactions only. Its usage can easily be extended to cover more
transaction types simply by adding an appropriate check in the
corresponding dmaengine_prep_*() function.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Link: https://lore.kernel.org/r/20200717013337.24122-3-laurent.pinchart@ideasonboard.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Documentation/driver-api/dmaengine/client.rst
Documentation/driver-api/dmaengine/provider.rst
include/linux/dmaengine.h