Circular DMA buffers and userspace vma(s)

Ilyes Gouta ilyes.gouta at gmail.com
Sat May 4 17:54:43 EDT 2013


Hi,

(userspace DMA)

I'm writing a device driver for a h/w decoder which (dma) source buffers
should (preferably) be visible to userspace (mmap'ed) so that the
application can directly load data into these.

The h/w expects the buffer to be circular in physical ram (ring buffer)
with data starting from the middle of it, whereas userspace would be
providing a vma when mmap()'ing which is linear in its virtual address
space.

Is it possible to alter the incoming vma so that a first region of that vma
is mapped to the bottom of the dma buffer whereas a second region of the
vma is mapped to the beginning of the dma buffer? This way the circular
layout constraint of the dma buffer won't be visible to the userspace
application, while also enabling it to directly load data in the correct
order.

Is it possible to achieve this (such as via split_vma() and a couple of
remap_pfn_range() calls into the mmap handler)?

Thanks,

Ilyes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20130504/18636180/attachment.html 


More information about the Kernelnewbies mailing list