From a81a6bb88e1887cb6a09605ebbacb2e12dc1e36e Mon Sep 17 00:00:00 2001 From: Carlos Rafael Giani Date: Wed, 30 Mar 2022 22:55:33 +0200 Subject: libimxdmabuffer: Upgrade to version 1.1.0 * Add dma-heap allocator * Documentation and typo fixes * Use RW flags in ION allocator if no mapping flags are specified * Add checks for attempts to map already mapped buffers with different flags than in the original mapping Signed-off-by: Carlos Rafael Giani --- .../libimxdmabuffer/libimxdmabuffer_1.0.1.bb | 54 ------------------ .../libimxdmabuffer/libimxdmabuffer_1.1.0.bb | 65 ++++++++++++++++++++++ 2 files changed, 65 insertions(+), 54 deletions(-) delete mode 100644 recipes-bsp/libimxdmabuffer/libimxdmabuffer_1.0.1.bb create mode 100644 recipes-bsp/libimxdmabuffer/libimxdmabuffer_1.1.0.bb diff --git a/recipes-bsp/libimxdmabuffer/libimxdmabuffer_1.0.1.bb b/recipes-bsp/libimxdmabuffer/libimxdmabuffer_1.0.1.bb deleted file mode 100644 index 7589e5145..000000000 --- a/recipes-bsp/libimxdmabuffer/libimxdmabuffer_1.0.1.bb +++ /dev/null @@ -1,54 +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 = "d2058aa404ee1e8e8abd552c6a637787bcdcf514" -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} \ - ${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 = "" - -PACKAGECONFIG ?= " " -PACKAGECONFIG:append:imxgpu2d = " ${LIBG2D_PACKAGECONFIG}" -PACKAGECONFIG:append:imxipu = " ipu" -PACKAGECONFIG:append:imxpxp = " pxp" -PACKAGECONFIG:append:mx8m-nxp-bsp = " ion dwl" -PACKAGECONFIG:append:mx8qm-nxp-bsp = " ion" -PACKAGECONFIG:append:mx8qxp-nxp-bsp = " ion" - -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," - -# 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.0.bb b/recipes-bsp/libimxdmabuffer/libimxdmabuffer_1.1.0.bb new file mode 100644 index 000000000..3b820ed6b --- /dev/null +++ b/recipes-bsp/libimxdmabuffer/libimxdmabuffer_1.1.0.bb @@ -0,0 +1,65 @@ +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 = "5e15481b71468e689f7529d7609dc31790275504" +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 + +# Device node path to the DMA-BUF heap to use in the dma-heap allocator. +# This must be one that allocates physically contiguous memory, otherwise +# it cannot allocate usable DMA buffers. +DMA_HEAP_DEVICE_NODE_PATH = "/dev/dma_heap/linux,cma" + +EXTRA_OECONF = "--imx-linux-headers-path=${STAGING_INCDIR_IMX} \ + --dma-heap-device-node-path=${DMA_HEAP_DEVICE_NODE_PATH} \ + --libdir=${libdir} \ + ${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 = "" + +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. +PACKAGECONFIG:append:mx8-nxp-bsp = " dma-heap" +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," +PACKAGECONFIG[dma-heap] = "--with-dma-heap-allocator=yes, --with-dma-heap-allocator=no," + +# 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