From c9a6a16927e98afb18cb8bd31a0f1d64d0f58b03 Mon Sep 17 00:00:00 2001 From: Carlos Rafael Giani Date: Sun, 30 Jul 2023 13:48:05 +0200 Subject: libimxdmabuffer: Upgrade to version 1.1.3 * waf: update to 2.0.25 * g2d: Fix typo in G2D allocator that caused build errors * Don't check for mxcfb.h in build script mxcfb.h is no longer present in some sysroots anymore, so it is not a reliable way for verifying the imx linux headers path. Just use the path directly; if it is wrong, the build will fail anyway. Signed-off-by: Carlos Rafael Giani (cherry picked from commit 568cdfec59a93c93279397a1a839bd01d89ed453) --- .../libimxdmabuffer/files/0001-g2d-Fix-typo.patch | 28 ------- .../libimxdmabuffer/libimxdmabuffer_1.1.2.bb | 90 ---------------------- .../libimxdmabuffer/libimxdmabuffer_1.1.3.bb | 89 +++++++++++++++++++++ 3 files changed, 89 insertions(+), 118 deletions(-) delete mode 100644 recipes-bsp/libimxdmabuffer/files/0001-g2d-Fix-typo.patch delete mode 100644 recipes-bsp/libimxdmabuffer/libimxdmabuffer_1.1.2.bb create mode 100644 recipes-bsp/libimxdmabuffer/libimxdmabuffer_1.1.3.bb diff --git a/recipes-bsp/libimxdmabuffer/files/0001-g2d-Fix-typo.patch b/recipes-bsp/libimxdmabuffer/files/0001-g2d-Fix-typo.patch deleted file mode 100644 index 490d3a2f..00000000 --- a/recipes-bsp/libimxdmabuffer/files/0001-g2d-Fix-typo.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 41825b11289be251fed64470893d18b89b0dd38b Mon Sep 17 00:00:00 2001 -From: Carlos Rafael Giani -Date: Sun, 8 May 2022 16:25:44 +0200 -Subject: [PATCH] g2d: Fix typo - -Signed-off-by: Carlos Rafael Giani - -Upstream-Status: Backport [41825b11289be251fed64470893d18b89b0dd38b] ---- - imxdmabuffer/imxdmabuffer_g2d_allocator.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/imxdmabuffer/imxdmabuffer_g2d_allocator.c b/imxdmabuffer/imxdmabuffer_g2d_allocator.c -index f10a909..497dcea 100644 ---- a/imxdmabuffer/imxdmabuffer_g2d_allocator.c -+++ b/imxdmabuffer/imxdmabuffer_g2d_allocator.c -@@ -139,7 +139,7 @@ static uint8_t* imx_dma_buffer_g2d_allocator_map(ImxDmaBufferAllocator *allocato - * (Other allocators perform more steps than this.) */ - if (imx_g2d_buffer->mapping_refcount > 0) - { -- assert((imx_dwl_buffer->map_flags & flags & IMX_DMA_BUFFER_MAPPING_READWRITE_FLAG_MASK) == (flags & IMX_DMA_BUFFER_MAPPING_READWRITE_FLAG_MASK)); -+ assert((imx_g2d_buffer->map_flags & flags & IMX_DMA_BUFFER_MAPPING_READWRITE_FLAG_MASK) == (flags & IMX_DMA_BUFFER_MAPPING_READWRITE_FLAG_MASK)); - imx_g2d_buffer->mapping_refcount++; - } - else --- -2.32.0 - diff --git a/recipes-bsp/libimxdmabuffer/libimxdmabuffer_1.1.2.bb b/recipes-bsp/libimxdmabuffer/libimxdmabuffer_1.1.2.bb deleted file mode 100644 index 090593be..00000000 --- a/recipes-bsp/libimxdmabuffer/libimxdmabuffer_1.1.2.bb +++ /dev/null @@ -1,90 +0,0 @@ -DESCRIPTION = 'Library for allocating and managing physically contiguous memory \ - ("DMA memory" or "DMA buffers") on i.MX devices.' -HOMEPAGE = "https://github.com/Freescale/libimxdmabuffer" -LICENSE = "LGPL-2.1-only" -LIC_FILES_CHKSUM = "file://LICENSE;md5=38fa42a5a6425b26d2919b17b1527324" -SECTION = "base" - -PV .= "+git${SRCPV}" - -SRCBRANCH ?= "master" -SRCREV = "5410b44fb0c5bbd9fb1f3ba0681e65068d8cde57" -SRC_URI = "git://github.com/Freescale/libimxdmabuffer.git;branch=${SRCBRANCH};protocol=https \ - file://0001-g2d-Fix-typo.patch \ - file://run-ptest \ - " - - -S = "${WORKDIR}/git" - -inherit pkgconfig waf use-imx-headers ptest - -EXTRA_OECONF = "--imx-linux-headers-path=${STAGING_INCDIR_IMX} \ - --libdir=${libdir} \ - ${@bb.utils.contains_any('PACKAGECONFIG', \ - [ 'dma-heap-cached', 'dma-heap-uncached' ], \ - '', '--with-dma-heap-allocator=no',d)} \ - ${PACKAGECONFIG_CONFARGS}" - -# If imxdpu is in use, the DPU is also used for implementing -# libg2d. However, that implementation's g2d_alloc() function -# is broken, so we cannot use it. -LIBG2D_PACKAGECONFIG = "g2d" -LIBG2D_PACKAGECONFIG:imxdpu = "" - -# The dma-heap allocator is special in that it can use more than one heap device -# node. In libimxdmabuffer, only heaps that allocate physically contiguous memory -# can be used, otherwise usable DMA buffers cannot be allocated. Furthermore, -# on NXP machines, there is a dma-heap for cached and one for uncached memory. -# -# One of them has to be selected by choosing either the "dma-heap-cached" or the -# "dma-heap-uncached" PACKAGECONFIG. The uncached one is picked by default for -# performance reasons (it does not suffer from cache coherence issues). -# -# Note that the uncached heap is not available prior to imx-kernel 5.15.5; -# older kernels can only use the cached one. - -CACHED_DMA_HEAP_DEVICE_NODE_PATH = "/dev/dma_heap/linux,cma" -UNCACHED_DMA_HEAP_DEVICE_NODE_PATH = "/dev/dma_heap/linux,cma-uncached" - -CACHED_DMA_HEAP_CONF = "--dma-heap-device-node-path=${CACHED_DMA_HEAP_DEVICE_NODE_PATH}" -UNCACHED_DMA_HEAP_CONF = "--dma-heap-device-node-path=${UNCACHED_DMA_HEAP_DEVICE_NODE_PATH} \ - --dma-heap-uncached-memory" - -PACKAGECONFIG ?= " " -PACKAGECONFIG:append:imxgpu2d = " ${LIBG2D_PACKAGECONFIG}" -PACKAGECONFIG:append:imxipu = " ipu" -PACKAGECONFIG:append:imxpxp = " pxp" -# All i.MX8 machines can use the dma-heap allocator. i.MX8m ones -# can also use the DWL allocator, though dma-heap is preferred. -# Vendor kernels that are older than kernel 5.6 cannot use -# dma-heap, however, and should use ion instead, since the -# former is not available pre-5.6. Out of the dma-heaps, we -# pick the uncached one by default (see above). -PACKAGECONFIG:append:mx8-nxp-bsp = " dma-heap-uncached" -PACKAGECONFIG:append:mx8m-nxp-bsp = " dwl" - -HANTRO_CONF = "--hantro-headers-path=${STAGING_INCDIR}/hantro_dec --hantro-decoder-version=G2" - -PACKAGECONFIG[dwl] = "--with-dwl-allocator=yes ${HANTRO_CONF}, --with-dwl-allocator=no,imx-vpu-hantro" -PACKAGECONFIG[ion] = "--with-ion-allocator=yes, --with-ion-allocator=no," -PACKAGECONFIG[ipu] = "--with-ipu-allocator=yes, --with-ipu-allocator=no," -PACKAGECONFIG[g2d] = "--with-g2d-allocator=yes, --with-g2d-allocator=no,virtual/libg2d" -PACKAGECONFIG[pxp] = "--with-pxp-allocator=yes, --with-pxp-allocator=no," -# --with-dma-heap-allocator=no is not added by these packageconfigs. -# Otherwise, it would always be added, since only one of these two -# dma-heap-* packageconfigs can be selected. Instead, that switch -# is added to EXTRA_OECONF above. -PACKAGECONFIG[dma-heap-cached] = "--with-dma-heap-allocator=yes ${CACHED_DMA_HEAP_CONF}, \ - ,,,,dma-heap-uncached" -PACKAGECONFIG[dma-heap-uncached] = "--with-dma-heap-allocator=yes ${UNCACHED_DMA_HEAP_CONF}, \ - ,,,,dma-heap-cached" - -# Using do_install_ptest_base instead of do_install_ptest, since -# the default do_install_ptest_base is hardcoded to expect Makefiles. -do_install_ptest_base() { - install -D ${WORKDIR}/run-ptest ${D}${PTEST_PATH}/run-ptest - install -m 0755 ${B}/test-alloc ${D}${PTEST_PATH} -} - -COMPATIBLE_MACHINE = "(imx-nxp-bsp)" diff --git a/recipes-bsp/libimxdmabuffer/libimxdmabuffer_1.1.3.bb b/recipes-bsp/libimxdmabuffer/libimxdmabuffer_1.1.3.bb new file mode 100644 index 00000000..b160c31d --- /dev/null +++ b/recipes-bsp/libimxdmabuffer/libimxdmabuffer_1.1.3.bb @@ -0,0 +1,89 @@ +DESCRIPTION = 'Library for allocating and managing physically contiguous memory \ + ("DMA memory" or "DMA buffers") on i.MX devices.' +HOMEPAGE = "https://github.com/Freescale/libimxdmabuffer" +LICENSE = "LGPL-2.1-only" +LIC_FILES_CHKSUM = "file://LICENSE;md5=38fa42a5a6425b26d2919b17b1527324" +SECTION = "base" + +PV .= "+git${SRCPV}" + +SRCBRANCH ?= "master" +SRCREV = "faf547cc2345bfbf95507ab7e86530f85289bb5b" +SRC_URI = "git://github.com/Freescale/libimxdmabuffer.git;branch=${SRCBRANCH};protocol=https \ + file://run-ptest \ + " + + +S = "${WORKDIR}/git" + +inherit pkgconfig waf use-imx-headers ptest + +EXTRA_OECONF = "--imx-linux-headers-path=${STAGING_INCDIR_IMX} \ + --libdir=${libdir} \ + ${@bb.utils.contains_any('PACKAGECONFIG', \ + [ 'dma-heap-cached', 'dma-heap-uncached' ], \ + '', '--with-dma-heap-allocator=no',d)} \ + ${PACKAGECONFIG_CONFARGS}" + +# If imxdpu is in use, the DPU is also used for implementing +# libg2d. However, that implementation's g2d_alloc() function +# is broken, so we cannot use it. +LIBG2D_PACKAGECONFIG = "g2d" +LIBG2D_PACKAGECONFIG:imxdpu = "" + +# The dma-heap allocator is special in that it can use more than one heap device +# node. In libimxdmabuffer, only heaps that allocate physically contiguous memory +# can be used, otherwise usable DMA buffers cannot be allocated. Furthermore, +# on NXP machines, there is a dma-heap for cached and one for uncached memory. +# +# One of them has to be selected by choosing either the "dma-heap-cached" or the +# "dma-heap-uncached" PACKAGECONFIG. The uncached one is picked by default for +# performance reasons (it does not suffer from cache coherence issues). +# +# Note that the uncached heap is not available prior to imx-kernel 5.15.5; +# older kernels can only use the cached one. + +CACHED_DMA_HEAP_DEVICE_NODE_PATH = "/dev/dma_heap/linux,cma" +UNCACHED_DMA_HEAP_DEVICE_NODE_PATH = "/dev/dma_heap/linux,cma-uncached" + +CACHED_DMA_HEAP_CONF = "--dma-heap-device-node-path=${CACHED_DMA_HEAP_DEVICE_NODE_PATH}" +UNCACHED_DMA_HEAP_CONF = "--dma-heap-device-node-path=${UNCACHED_DMA_HEAP_DEVICE_NODE_PATH} \ + --dma-heap-uncached-memory" + +PACKAGECONFIG ?= " " +PACKAGECONFIG:append:imxgpu2d = " ${LIBG2D_PACKAGECONFIG}" +PACKAGECONFIG:append:imxipu = " ipu" +PACKAGECONFIG:append:imxpxp = " pxp" +# All i.MX8 machines can use the dma-heap allocator. i.MX8m ones +# can also use the DWL allocator, though dma-heap is preferred. +# Vendor kernels that are older than kernel 5.6 cannot use +# dma-heap, however, and should use ion instead, since the +# former is not available pre-5.6. Out of the dma-heaps, we +# pick the uncached one by default (see above). +PACKAGECONFIG:append:mx8-nxp-bsp = " dma-heap-uncached" +PACKAGECONFIG:append:mx8m-nxp-bsp = " dwl" + +HANTRO_CONF = "--hantro-headers-path=${STAGING_INCDIR}/hantro_dec --hantro-decoder-version=G2" + +PACKAGECONFIG[dwl] = "--with-dwl-allocator=yes ${HANTRO_CONF}, --with-dwl-allocator=no,imx-vpu-hantro" +PACKAGECONFIG[ion] = "--with-ion-allocator=yes, --with-ion-allocator=no," +PACKAGECONFIG[ipu] = "--with-ipu-allocator=yes, --with-ipu-allocator=no," +PACKAGECONFIG[g2d] = "--with-g2d-allocator=yes, --with-g2d-allocator=no,virtual/libg2d" +PACKAGECONFIG[pxp] = "--with-pxp-allocator=yes, --with-pxp-allocator=no," +# --with-dma-heap-allocator=no is not added by these packageconfigs. +# Otherwise, it would always be added, since only one of these two +# dma-heap-* packageconfigs can be selected. Instead, that switch +# is added to EXTRA_OECONF above. +PACKAGECONFIG[dma-heap-cached] = "--with-dma-heap-allocator=yes ${CACHED_DMA_HEAP_CONF}, \ + ,,,,dma-heap-uncached" +PACKAGECONFIG[dma-heap-uncached] = "--with-dma-heap-allocator=yes ${UNCACHED_DMA_HEAP_CONF}, \ + ,,,,dma-heap-cached" + +# Using do_install_ptest_base instead of do_install_ptest, since +# the default do_install_ptest_base is hardcoded to expect Makefiles. +do_install_ptest_base() { + install -D ${WORKDIR}/run-ptest ${D}${PTEST_PATH}/run-ptest + install -m 0755 ${B}/test-alloc ${D}${PTEST_PATH} +} + +COMPATIBLE_MACHINE = "(imx-nxp-bsp)" -- cgit v1.2.3-54-g00ecf