<div dir="ltr"><div dir="ltr"><div dir="ltr">Hi Carol,<div><br><div class="gmail_quote"><div dir="ltr">On Mon, Oct 8, 2018 at 11:30 AM Carol Zhu <<a href="mailto:carol.zhu@nxp.com">carol.zhu@nxp.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div lang="ZH-CN">
<div class="gmail-m_-358950331334585928WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:Calibri,sans-serif">Hi Gary,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:Calibri,sans-serif"><u></u>Â <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:Calibri,sans-serif">I updated my local build env to the latest master branch and try building the vpu hantro.
<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:Calibri,sans-serif">But I got a small build issue:<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:Calibri,sans-serif;color:red">| ./ewl/ewl_x280_common.c: In function 'EWLMallocLinear':<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:Calibri,sans-serif;color:red">| ./ewl/ewl_x280_common.c:775:25: error: storage size of 'dma_phys' isn't known<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:Calibri,sans-serif;color:red">|Â Â Â Â Â struct dma_buf_phys dma_phys;<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:Calibri,sans-serif;color:red">|Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â ^~~~~~~~<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:Calibri,sans-serif;color:red">| ./ewl/ewl_x280_common.c:799:17: warning: assignment to '__u64' {aka 'long long unsigned int'} from 'struct ion_heap_data (*)[(sizetype)(heap_cnt)]'
makes integer from pointer without a cast [-Wint-conversion]<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:Calibri,sans-serif;color:red">|Â Â Â Â Â query.heaps = &ihd;<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:Calibri,sans-serif;color:red">|Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â ^<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:Calibri,sans-serif;color:red">| ./ewl/ewl_x280_common.c:819:35: error: 'struct ion_allocation_data' has no member named 'fd'<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:Calibri,sans-serif;color:red">|Â Â Â Â Â info->ion_fd = allocation_data.fd;<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:Calibri,sans-serif;color:red">|Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â ^<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:Calibri,sans-serif;color:red">| ./ewl/ewl_x280_common.c:821:31: error: 'DMA_BUF_IOCTL_PHYS' undeclared (first use in this function); did you mean 'DMA_BUF_IOCTL_SYNC'?<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:Calibri,sans-serif;color:red">|Â Â Â Â Â ret = ioctl(info->ion_fd, DMA_BUF_IOCTL_PHYS, &dma_phys);<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:Calibri,sans-serif;color:red">|Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â ^~~~~~~~~~~~~~~~~~<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:Calibri,sans-serif;color:red">|Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â DMA_BUF_IOCTL_SYNC</span></p></div></div></blockquote><div><br></div><div>What platform are you building for?</div><div><br></div><div>I only tried 8M (Nitrogen8M) and this worked for me. But maybe the encoder part needs to be modified for 8MM.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div lang="ZH-CN"><div class="gmail-m_-358950331334585928WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:Calibri,sans-serif">It goes into >k4.14 branch as the incorrect LINUX_VERSION_CODE, so I did a update about the include directory of version.h, plz take a check.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:Calibri,sans-serif;color:rgb(68,114,196)">--- a/recipes-bsp/imx-vpu-hantro/imx-vpu-hantro/0002-Fix-version.h-inclusion-to-be-from-kernel-build-fold.patch<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:Calibri,sans-serif;color:rgb(68,114,196)">+++ b/recipes-bsp/imx-vpu-hantro/imx-vpu-hantro/0002-Fix-version.h-inclusion-to-be-from-kernel-build-fold.patch<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:Calibri,sans-serif;color:rgb(68,114,196)">@@ -34,7 +34,7 @@ index 56b4332..0be43ce 100755<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:Calibri,sans-serif;color:rgb(68,114,196)">Â ENV += -I$(LINUX_KERNEL_ROOT)/drivers/staging/android/uapi<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:Calibri,sans-serif;color:rgb(68,114,196)"><u></u>Â <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:Calibri,sans-serif;color:rgb(68,114,196)">+# LINUX_VERSION_CODE from kernel build folder instead of toolchain headers<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:Calibri,sans-serif;color:rgb(68,114,196)">-+INCLUDE_HEADERS += -I$(LINUX_KERNEL_BUILD)/include/generated/uapi<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:Calibri,sans-serif;color:rgb(68,114,196)">++ENV += -I$(LINUX_KERNEL_BUILD)/include/generated/uapi</span></p></div></div></blockquote><div><br></div><div>If you have a fix please submit it.</div><div>Â </div><div><snip>Â </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div lang="ZH-CN"><div class="gmail-m_-358950331334585928WordSection1"><p class="MsoNormal"><span style="font-family:DengXian;font-size:10.5pt">Thanks for your fix. It looks flexible and do fix the build problem.</span><br></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:DengXian">But I am still a little bit confused.
<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:DengXian">For my understanding, the version of libc-headers should match the one of kernel, or the compatibility couldn</span><span style="font-size:10.5pt;font-family:DengXian">’<span lang="EN-US">t
be guaranteed.</span></span></p></div></div></blockquote><div><br></div><div>No the toolchain header doesn't have to match the kernel version exactly as the ABI is backward compatible.</div><div>Â </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div lang="ZH-CN"><div class="gmail-m_-358950331334585928WordSection1"><p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian"><span lang="EN-US"><u></u><u></u></span></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:DengXian">And our current release maintain both libc-header and Linux-imx recipes to make them version match.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:DengXian">eg:
<a href="https://source.codeaurora.org/external/imx/meta-fsl-bsp-release/tree/imx/meta-bsp/recipes-kernel/linux-libc-headers?h=rocko-4.9.123-2.3.0_8mm_ga" target="_blank">
https://source.codeaurora.org/external/imx/meta-fsl-bsp-release/tree/imKernel headerx/meta-bsp/recipes-kernel/linux-libc-headers?h=rocko-4.9.123-2.3.0_8mm_ga</a>
<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:DengXian">For people using pre-built toolchains, they</span><span style="font-size:10.5pt;font-family:DengXian">’<span lang="EN-US">re supposed to choose proper version, which would
be better.</span></span></p></div></div></blockquote><div><br></div><div>As ABI is backwards compatible, people shouldn't have to worry about kernel headers:</div><div><a href="https://elinux.org/images/1/15/Anatomy_of_Cross-Compilation_Toolchains.pdf">https://elinux.org/images/1/15/Anatomy_of_Cross-Compilation_Toolchains.pdf</a><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div lang="ZH-CN"><div class="gmail-m_-358950331334585928WordSection1"><p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian"><span lang="EN-US"><u></u><u></u></span></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:DengXian">If libc-headers could be backwards compatible except this
</span><span style="font-size:10.5pt;font-family:DengXian">“<span lang="EN-US">LINUX_VERSION_CODE</span>â€<span lang="EN-US">, then it</span>’<span lang="EN-US">s ok with version mismatch.</span></span></p></div></div></blockquote><div><br></div><div>Exactly, if the issue is only LINUX_VERSION_CODE then it should be taken from kernel directly.</div><div><br></div><div>Also, since some headers are NXP-specific (ion.h), then even if you use a pre-built toolchain with same version headers it won't work anyway as those headers will be missing.</div><div><br></div><div>Regards,</div><div>Gary</div></div></div></div></div></div>