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