• Laurent Pinchart's avatar
    dmaengine: Add support for repeating transactions · 9c8ebd8b
    Laurent Pinchart authored
    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: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
    Reviewed-by: default avatarPeter Ujfalusi <peter.ujfalusi@ti.com>
    Link: https://lore.kernel.org/r/20200717013337.24122-3-laurent.pinchart@ideasonboard.comSigned-off-by: default avatarVinod Koul <vkoul@kernel.org>
    9c8ebd8b
provider.rst 21.6 KB