Re: Enabling ION with CMA heap on imx6


Carlos Rafael Giani
 

For i.MX8 it is enabled already.

On 20.10.20 13:31, Otavio Salvador wrote:
Hello Carlos,

Em ter., 20 de out. de 2020 às 05:19, Carlos Rafael Giani via
lists.yoctoproject.org <crg7475=mailbox.org@...>
escreveu:
On i.MX6 machines, it is currently not possible to use the ION
allocator. However, there is no hardware limitation that requires ION to
be disabled.

If ION were enabled, with a CMA heap, then it would be possible for
userspace to allocate DMA-BUF buffers. I could then enable the ion
packageconfig in the libimxdmabuffer recipe.

The defconfig only needs these additions:

CONFIG_ION=y
CONFIG_ION_SYSTEM_HEAP=y
CONFIG_ION_CMA_HEAP=y

I tried it out, worked fine.

Using DMA-BUF for allocating physically contiguous memory (via CMA) is
preferable over using other allocators (like the ones from the VPU, IPU
etc.) since it allows for proper buffer sharing, ownership transfer, is
based on FDs (though physical address are accessible via an NXP
extension), and there are extensions in OpenCL, OpenGL etc. for
importing DMA-BUF. V4L2 also has DMA-BUF support.

Opinions?
Please prepare the PR for it; also see if i.MX8 couldn't also benefit from it.




Join meta-freescale@lists.yoctoproject.org to automatically receive all group messages.