Commit 50c7cd2b authored by Maxime Ripard's avatar Maxime Ripard Committed by Vinod Koul

dmaengine: Add scatter-gathered memset

The current API allows the driver to accelerate memset by using the DMA
controller.

However, it does so over a contiguous memory area, which might proves
inefficient when you have to do it over a non-contiguous yet repititive
pattern, since you have to create a number of descriptors and then submit
each other.

Add a memset operation going over a scatter list to handle such cases in a
single call.
Signed-off-by: default avatarMaxime Ripard <maxime.ripard@free-electrons.com>
Acked-by: default avatarLudovic Desroches <ludovic.desroches@atmel.com>
Signed-off-by: default avatarVinod Koul <vinod.koul@intel.com>
parent 77a68e56
...@@ -66,6 +66,7 @@ enum dma_transaction_type { ...@@ -66,6 +66,7 @@ enum dma_transaction_type {
DMA_XOR_VAL, DMA_XOR_VAL,
DMA_PQ_VAL, DMA_PQ_VAL,
DMA_MEMSET, DMA_MEMSET,
DMA_MEMSET_SG,
DMA_INTERRUPT, DMA_INTERRUPT,
DMA_SG, DMA_SG,
DMA_PRIVATE, DMA_PRIVATE,
...@@ -630,6 +631,7 @@ enum dmaengine_alignment { ...@@ -630,6 +631,7 @@ enum dmaengine_alignment {
* @device_prep_dma_pq: prepares a pq operation * @device_prep_dma_pq: prepares a pq operation
* @device_prep_dma_pq_val: prepares a pqzero_sum operation * @device_prep_dma_pq_val: prepares a pqzero_sum operation
* @device_prep_dma_memset: prepares a memset operation * @device_prep_dma_memset: prepares a memset operation
* @device_prep_dma_memset_sg: prepares a memset operation over a scatter list
* @device_prep_dma_interrupt: prepares an end of chain interrupt operation * @device_prep_dma_interrupt: prepares an end of chain interrupt operation
* @device_prep_slave_sg: prepares a slave dma operation * @device_prep_slave_sg: prepares a slave dma operation
* @device_prep_dma_cyclic: prepare a cyclic dma operation suitable for audio. * @device_prep_dma_cyclic: prepare a cyclic dma operation suitable for audio.
...@@ -696,6 +698,9 @@ struct dma_device { ...@@ -696,6 +698,9 @@ struct dma_device {
struct dma_async_tx_descriptor *(*device_prep_dma_memset)( struct dma_async_tx_descriptor *(*device_prep_dma_memset)(
struct dma_chan *chan, dma_addr_t dest, int value, size_t len, struct dma_chan *chan, dma_addr_t dest, int value, size_t len,
unsigned long flags); unsigned long flags);
struct dma_async_tx_descriptor *(*device_prep_dma_memset_sg)(
struct dma_chan *chan, struct scatterlist *sg,
unsigned int nents, int value, unsigned long flags);
struct dma_async_tx_descriptor *(*device_prep_dma_interrupt)( struct dma_async_tx_descriptor *(*device_prep_dma_interrupt)(
struct dma_chan *chan, unsigned long flags); struct dma_chan *chan, unsigned long flags);
struct dma_async_tx_descriptor *(*device_prep_dma_sg)( struct dma_async_tx_descriptor *(*device_prep_dma_sg)(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment