Enabling ION with CMA heap on imx6


Carlos Rafael Giani
 

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?

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