LWN.net Logo

Integration with dma_buf

Integration with dma_buf

Posted Feb 11, 2012 16:24 UTC (Sat) by arnd (subscriber, #8866)
Parent article: The Android ION memory allocator

It should not be too hard to modify the ion code so it becomes a provider of dma_buf file descriptors and integrates into that framework.

When we discussed the design for dma_buf, it was intentionally made possible to have arbitrary subsystems provide interfaces that hand out dma_buf file descriptors to user space, although the focus so far was on having drm provide descriptors for buffers that it already manages. If I understand the article correctly, the design of ion is that you always have to know in advance how to allocate your buffer through the ion ioctl but then can pass it into any driver using it.

We should probably look into unifying the in-kernel interfaces for the two, because they are already very similar. and make ION_IOC_SHARE return a dma_buf descriptor that can be passed into any dma_buf enabled driver. The ion_import_fd function can then be replaced with the more abstract dma_buf equivalent.


(Log in to post comments)

Integration with dma_buf

Posted Feb 22, 2012 1:44 UTC (Wed) by zengtm (subscriber, #74989) [Link]

"the design of ion is that you always have to know in advance how to allocate your buffer": the answer is yes, based on the ION implementations that I have the chance to study in the current Android 4.0.x release.

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds