Re: dmaengine/Query: What about scatter/gather for mem to mem transfers.

From: Pratyush Anand
Date: Wed Dec 14 2011 - 23:59:08 EST


Hello Vinod/Dan,

Please write your opinion.

Regards
Pratyush

On 12/14/2011 12:17 PM, Pratyush Anand wrote:
Hello Vinod/Dan,

In continuation to the scatter/gather requirement:
We might need some generic transfer where source and destination address
may be overlapped and also gap between two chunk of source and
destination might not be same.

For examaple,
Transfer size is - -0x4000
Our Src is something like this:
0x1000 -- 0x2000
0x3000 -- 0x5000
0x6000 -- 0x7000

and dst is something like this:
0x6000 -- 0x8000
0x9000 -- 0xB000

It seems that device_prep_interleaved_dma would not be able to handle
such transfer.

So, what I was thinking that to add following flags in enum dma_ctrl_flags.

DMA_SRC_INC = (1 << 10),
DMA_SRC_DEC = (2 << 10),
DMA_SRC_FIX = (3 << 10),
DMA_DST_INC = (1 << 12),
DMA_DST_DEC = (2 << 12),
DMA_DST_FIX = (3 << 12),

Now we can use these flag in device_prep_dma_sg and this function can be
implemented for generic cases.

I think, the above modifications will not affect other's platform and
should be acceptable.

Whats your opinion?

Regards
Pratyush

On 12/8/2011 1:20 PM, Viresh KUMAR wrote:
On 12/8/2011 1:07 PM, Vinod Koul wrote:
You mean something like:
struct dma_async_tx_descriptor *(*device_prep_dma_sg)(
struct dma_chan *chan,
struct scatterlist *dst_sg, unsigned int dst_nents,
struct scatterlist *src_sg, unsigned int src_nents,
unsigned long flags);

Its already there, you need to implement in your driver :)

Ok. I didn't knew it. :(



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/