Freescale / libimxdmabuffer

Library for allocating and managing physically contiguous memory ("DMA memory" or "DMA buffers") on i.MX devices
GNU Lesser General Public License v2.1
19 stars 12 forks source link

Can't build ion allocator with 4.14.98_2.0.0 kernel #1

Closed telelaci closed 5 years ago

telelaci commented 5 years ago

Hi Carlos,

This member of the struct does not exist in the mentioned kernel version, and its not filtered by IF_LINUX_VERSION_CODE ....

https://github.com/Freescale/libimxdmabuffer/blob/master/imxdmabuffer/imxdmabuffer_ion_allocator.c#L328

So it can't be built with the above mentioned kernel headers.

Just a quick question, why do you prefer ION rather than HANTRO DWL ? Just wondering.

dv1 commented 5 years ago

Hm. This seems to contain an unpatched Android ion.h header. I cannot find ION_IOC_PHYS_DMA in it anywhere. In other branches like 4.9.123 (for the i.MX8m mini EVK), I can find it. So, I suppose the way to go is to perform a build configuration time check for the presence of ION_IOC_PHYS_DMA to see if this is the correct header.

As for why ION is preferred - it is because it is DMA-BUF backed, so anything that accepts DMA-BUF FDs can use them through said FDs.

dv1 commented 5 years ago

Alright, I pushed a commit that tests for this ioctl. I suppose that the missing member you located is also caused by you having an unpatched ion.h header. If so, this commit will fix that. Can you test it?

telelaci commented 5 years ago

Thanks. And sure, I'm gonna test it as soon as possible. Then I'll continue with the new gstreamer-imx v2 with this kernel. And I'll report the problems if there are any. Cheers.

telelaci commented 5 years ago

OK, I've checked it, and I don't understand why do you expect ION_IOC_PHYS_DMA defined in the above mentioned kernel. Let's clarify NXP BSP releases for Linux first. April 2018: L4.9.123-2.3.0_GA probably this is what you tested, its quite old (more than a year) January 2019: L4.14.78-1.0.0_GA this is the 1st 4.14 release, its obsolete now because of the newest: April 2019: L4.14.98-2.0.0_GA this is the latest one, about one month old. This is what I was talking about. You can get it's kernel in the following way: $ git clone https://source.codeaurora.org/external/imx/linux-imx $ cd linux-imx && git checkout imx_4.14.98_2.0.0_ga

I couldn't find any file containing word ION_IOC_PHYS_DMA in this kernel source. And I couldn't find any patches in meta-fsl-bsp-release for sumo imx-4.14.98_2.0.0_ga, containing the word ION_IOC_PHYS_DMA

dv1 commented 5 years ago

Right. I reverted that commit and added a new check to exclude the align field when building for newer kernels.

telelaci commented 5 years ago

OK, thank you I was able to build it, though I tested only ION and DWL, I close the issue.