summaryrefslogtreecommitdiffstats
path: root/recipes-bsp/libimxdmabuffer/libimxdmabuffer_1.1.3.bb
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-bsp/libimxdmabuffer/libimxdmabuffer_1.1.3.bb')
-rw-r--r--recipes-bsp/libimxdmabuffer/libimxdmabuffer_1.1.3.bb89
1 files changed, 89 insertions, 0 deletions
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 @@
1DESCRIPTION = 'Library for allocating and managing physically contiguous memory \
2 ("DMA memory" or "DMA buffers") on i.MX devices.'
3HOMEPAGE = "https://github.com/Freescale/libimxdmabuffer"
4LICENSE = "LGPL-2.1-only"
5LIC_FILES_CHKSUM = "file://LICENSE;md5=38fa42a5a6425b26d2919b17b1527324"
6SECTION = "base"
7
8PV .= "+git${SRCPV}"
9
10SRCBRANCH ?= "master"
11SRCREV = "faf547cc2345bfbf95507ab7e86530f85289bb5b"
12SRC_URI = "git://github.com/Freescale/libimxdmabuffer.git;branch=${SRCBRANCH};protocol=https \
13 file://run-ptest \
14 "
15
16
17S = "${WORKDIR}/git"
18
19inherit pkgconfig waf use-imx-headers ptest
20
21EXTRA_OECONF = "--imx-linux-headers-path=${STAGING_INCDIR_IMX} \
22 --libdir=${libdir} \
23 ${@bb.utils.contains_any('PACKAGECONFIG', \
24 [ 'dma-heap-cached', 'dma-heap-uncached' ], \
25 '', '--with-dma-heap-allocator=no',d)} \
26 ${PACKAGECONFIG_CONFARGS}"
27
28# If imxdpu is in use, the DPU is also used for implementing
29# libg2d. However, that implementation's g2d_alloc() function
30# is broken, so we cannot use it.
31LIBG2D_PACKAGECONFIG = "g2d"
32LIBG2D_PACKAGECONFIG:imxdpu = ""
33
34# The dma-heap allocator is special in that it can use more than one heap device
35# node. In libimxdmabuffer, only heaps that allocate physically contiguous memory
36# can be used, otherwise usable DMA buffers cannot be allocated. Furthermore,
37# on NXP machines, there is a dma-heap for cached and one for uncached memory.
38#
39# One of them has to be selected by choosing either the "dma-heap-cached" or the
40# "dma-heap-uncached" PACKAGECONFIG. The uncached one is picked by default for
41# performance reasons (it does not suffer from cache coherence issues).
42#
43# Note that the uncached heap is not available prior to imx-kernel 5.15.5;
44# older kernels can only use the cached one.
45
46CACHED_DMA_HEAP_DEVICE_NODE_PATH = "/dev/dma_heap/linux,cma"
47UNCACHED_DMA_HEAP_DEVICE_NODE_PATH = "/dev/dma_heap/linux,cma-uncached"
48
49CACHED_DMA_HEAP_CONF = "--dma-heap-device-node-path=${CACHED_DMA_HEAP_DEVICE_NODE_PATH}"
50UNCACHED_DMA_HEAP_CONF = "--dma-heap-device-node-path=${UNCACHED_DMA_HEAP_DEVICE_NODE_PATH} \
51 --dma-heap-uncached-memory"
52
53PACKAGECONFIG ?= " "
54PACKAGECONFIG:append:imxgpu2d = " ${LIBG2D_PACKAGECONFIG}"
55PACKAGECONFIG:append:imxipu = " ipu"
56PACKAGECONFIG:append:imxpxp = " pxp"
57# All i.MX8 machines can use the dma-heap allocator. i.MX8m ones
58# can also use the DWL allocator, though dma-heap is preferred.
59# Vendor kernels that are older than kernel 5.6 cannot use
60# dma-heap, however, and should use ion instead, since the
61# former is not available pre-5.6. Out of the dma-heaps, we
62# pick the uncached one by default (see above).
63PACKAGECONFIG:append:mx8-nxp-bsp = " dma-heap-uncached"
64PACKAGECONFIG:append:mx8m-nxp-bsp = " dwl"
65
66HANTRO_CONF = "--hantro-headers-path=${STAGING_INCDIR}/hantro_dec --hantro-decoder-version=G2"
67
68PACKAGECONFIG[dwl] = "--with-dwl-allocator=yes ${HANTRO_CONF}, --with-dwl-allocator=no,imx-vpu-hantro"
69PACKAGECONFIG[ion] = "--with-ion-allocator=yes, --with-ion-allocator=no,"
70PACKAGECONFIG[ipu] = "--with-ipu-allocator=yes, --with-ipu-allocator=no,"
71PACKAGECONFIG[g2d] = "--with-g2d-allocator=yes, --with-g2d-allocator=no,virtual/libg2d"
72PACKAGECONFIG[pxp] = "--with-pxp-allocator=yes, --with-pxp-allocator=no,"
73# --with-dma-heap-allocator=no is not added by these packageconfigs.
74# Otherwise, it would always be added, since only one of these two
75# dma-heap-* packageconfigs can be selected. Instead, that switch
76# is added to EXTRA_OECONF above.
77PACKAGECONFIG[dma-heap-cached] = "--with-dma-heap-allocator=yes ${CACHED_DMA_HEAP_CONF}, \
78 ,,,,dma-heap-uncached"
79PACKAGECONFIG[dma-heap-uncached] = "--with-dma-heap-allocator=yes ${UNCACHED_DMA_HEAP_CONF}, \
80 ,,,,dma-heap-cached"
81
82# Using do_install_ptest_base instead of do_install_ptest, since
83# the default do_install_ptest_base is hardcoded to expect Makefiles.
84do_install_ptest_base() {
85 install -D ${WORKDIR}/run-ptest ${D}${PTEST_PATH}/run-ptest
86 install -m 0755 ${B}/test-alloc ${D}${PTEST_PATH}
87}
88
89COMPATIBLE_MACHINE = "(imx-nxp-bsp)"