meta-freescale.lists.yoctoproject.org archive mirror
 help / color / mirror / Atom feed
* Enabling ION with CMA heap on imx6
@ 2020-10-20  8:19 Carlos Rafael Giani
  2020-10-20 11:31 ` [meta-freescale] " Otavio Salvador
  2020-10-20 11:38 ` Andrey Zhizhikin
  0 siblings, 2 replies; 5+ messages in thread
From: Carlos Rafael Giani @ 2020-10-20  8:19 UTC (permalink / raw)
  To: meta-freescale

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?


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [meta-freescale] Enabling ION with CMA heap on imx6
  2020-10-20  8:19 Enabling ION with CMA heap on imx6 Carlos Rafael Giani
@ 2020-10-20 11:31 ` Otavio Salvador
  2020-10-20 17:11   ` Carlos Rafael Giani
  2020-10-20 11:38 ` Andrey Zhizhikin
  1 sibling, 1 reply; 5+ messages in thread
From: Otavio Salvador @ 2020-10-20 11:31 UTC (permalink / raw)
  To: Carlos Rafael Giani; +Cc: meta-freescale

Hello Carlos,

Em ter., 20 de out. de 2020 às 05:19, Carlos Rafael Giani via
lists.yoctoproject.org <crg7475=mailbox.org@lists.yoctoproject.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.

-- 
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9 9981-7854          Mobile: +1 (347) 903-9750

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [meta-freescale] Enabling ION with CMA heap on imx6
  2020-10-20  8:19 Enabling ION with CMA heap on imx6 Carlos Rafael Giani
  2020-10-20 11:31 ` [meta-freescale] " Otavio Salvador
@ 2020-10-20 11:38 ` Andrey Zhizhikin
  2020-10-20 17:13   ` Carlos Rafael Giani
  1 sibling, 1 reply; 5+ messages in thread
From: Andrey Zhizhikin @ 2020-10-20 11:38 UTC (permalink / raw)
  To: Carlos Rafael Giani; +Cc: meta-freescale

On Tue, Oct 20, 2020 at 10:19 AM Carlos Rafael Giani via
lists.yoctoproject.org <crg7475=mailbox.org@lists.yoctoproject.org>
wrote:
>
> 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?

From the past experience I had with ION allocators in the past, I
would try to refrain from using it. It is still residing in staging
folder, which means that the API compatibility is not guaranteed. I
had an experience where Application used ION in 4.4.y kernel, and
should be re-written when 4.9.y kernel has been released due to
significant changes in the ION UAPI.

I would personally not recommend using it until it would be moved from
staging to drivers.

If one plans to base development on ION API - this should be taken
into consideration.

>
>
> 
>


-- 
Regards,
Andrey.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [meta-freescale] Enabling ION with CMA heap on imx6
  2020-10-20 11:31 ` [meta-freescale] " Otavio Salvador
@ 2020-10-20 17:11   ` Carlos Rafael Giani
  0 siblings, 0 replies; 5+ messages in thread
From: Carlos Rafael Giani @ 2020-10-20 17:11 UTC (permalink / raw)
  To: meta-freescale

[-- Attachment #1: Type: text/plain, Size: 1303 bytes --]

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@lists.yoctoproject.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.
>
>
> 
>

[-- Attachment #2: Type: text/html, Size: 1979 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [meta-freescale] Enabling ION with CMA heap on imx6
  2020-10-20 11:38 ` Andrey Zhizhikin
@ 2020-10-20 17:13   ` Carlos Rafael Giani
  0 siblings, 0 replies; 5+ messages in thread
From: Carlos Rafael Giani @ 2020-10-20 17:13 UTC (permalink / raw)
  To: meta-freescale

Yes, this happened in the past. However, the benefits of DMA-BUF 
outweigh this IMO. I also have the libimxdmabuffer library to 
encapsulate such details.

The alternative is to rely on IPU/VPU/etc. specific allocators, which 
come with more significant downsides.

On 20.10.20 13:38, Andrey Zhizhikin wrote:
> On Tue, Oct 20, 2020 at 10:19 AM Carlos Rafael Giani via
> lists.yoctoproject.org <crg7475=mailbox.org@lists.yoctoproject.org>
> wrote:
>> 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?
>  From the past experience I had with ION allocators in the past, I
> would try to refrain from using it. It is still residing in staging
> folder, which means that the API compatibility is not guaranteed. I
> had an experience where Application used ION in 4.4.y kernel, and
> should be re-written when 4.9.y kernel has been released due to
> significant changes in the ION UAPI.
>
> I would personally not recommend using it until it would be moved from
> staging to drivers.
>
> If one plans to base development on ION API - this should be taken
> into consideration.
>
>>
>> 
>>
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-10-20 17:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-20  8:19 Enabling ION with CMA heap on imx6 Carlos Rafael Giani
2020-10-20 11:31 ` [meta-freescale] " Otavio Salvador
2020-10-20 17:11   ` Carlos Rafael Giani
2020-10-20 11:38 ` Andrey Zhizhikin
2020-10-20 17:13   ` Carlos Rafael Giani

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).