> -----Original Message-----
> From: David Brownell [mailto:davi...@pacbell.net] 
> Sent: Thursday, June 11, 2009 1:09 PM
> To: Tivy, Robert
> Cc: davinci-linux-open-source@linux.davincidsp.com; Andrea Gasparini
> Subject: Re: EDMA with user provided virtual addresses.
> 
> On Thursday 11 June 2009, Tivy, Robert wrote:
> >      EDMA requires physically contiguous buffers,
> > so in addition to needing to know the physical address,
> > you also must ensure that your buffers are contiguous physically,
> 
> Not really.  The usual way to handle that sort of thing is to 
> make whatever user-to-kernel mapping call you need, which 
> returns something along the lines of a scatterlist.
> Then just construct a chain of DMA transfers, one for each segment.
> 
> So a 12 Kbyte userspace buffer might scan three pages:
> 
>       page N+0 offset 1K, len 3K
>       page N+1 offset 0, len 4K
>       page N+2 offset 0, len 1K
> 
> Map that to the kernel, and it'll still be three pages but 
> the page addresses will differ ... say, pages X, Y, and Z.
> Offsets and lengths will be unchanged.  Now just feed EDMA a 
> chain of three transfers.
> 
> That kind of logic is easy to wrap in utility functions.
> (If it were wrapped, would non-DSP code really need CMEM?)
> 

Good point, thanks for letting me know.

So, the requirement for phys contig buffers is mostly for HW accelerators that 
address memory w/o the benefit of an MMU or without chaining capability.   
Having one contig buf for EDMA also makes things simpler to handle, but isn't 
necessary.  CMEM can help in the non-DSP case for those HW accelerators.  One 
last advantage of CMEM - ARM/DSP-based combo code can move over to ARM only 
without any porting, or using a different allocator.

- Rob_______________________________________________
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source

Reply via email to