From 98d066d125af0602e09d18fc9e404099741f20d0 Mon Sep 17 00:00:00 2001 From: Carlos Rafael Giani Date: Sat, 7 May 2022 10:42:53 +0200 Subject: libimxdmabuffer: Upgrade to version 1.1.2 * waf: update to 2.0.23 * dma-heap: Add support for uncached dma-heap memory imx_dma_buffer_dma_heap_allocator_new_from_fd() is a new function that partially deprecates the dma_heap_fd argument of imx_dma_buffer_dma_heap_allocator_new(). * Add sync access functions to ensure cache coherency when allocating cached DMA memory; only done by dma-heap allocator at this time * Relax buffer mapping flags checks * Add API functions to retrieve dma-heap / ION FDs Signed-off-by: Carlos Rafael Giani --- .../libimxdmabuffer/files/0001-g2d-Fix-typo.patch | 28 +++++++++++ .../libimxdmabuffer/libimxdmabuffer_1.0.1.bb | 52 -------------------- .../libimxdmabuffer/libimxdmabuffer_1.1.2.bb | 55 ++++++++++++++++++++++ 3 files changed, 83 insertions(+), 52 deletions(-) create mode 100644 recipes-bsp/libimxdmabuffer/files/0001-g2d-Fix-typo.patch delete mode 100644 recipes-bsp/libimxdmabuffer/libimxdmabuffer_1.0.1.bb create mode 100644 recipes-bsp/libimxdmabuffer/libimxdmabuffer_1.1.2.bb diff --git a/recipes-bsp/libimxdmabuffer/files/0001-g2d-Fix-typo.patch b/recipes-bsp/libimxdmabuffer/files/0001-g2d-Fix-typo.patch new file mode 100644 index 00000000..490d3a2f --- /dev/null +++ b/recipes-bsp/libimxdmabuffer/files/0001-g2d-Fix-typo.patch @@ -0,0 +1,28 @@ +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.0.1.bb b/recipes-bsp/libimxdmabuffer/libimxdmabuffer_1.0.1.bb deleted file mode 100644 index b5ac6cd4..00000000 --- a/recipes-bsp/libimxdmabuffer/libimxdmabuffer_1.0.1.bb +++ /dev/null @@ -1,52 +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 = "LGPLv2.1" -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 ?= " ion " -PACKAGECONFIG_append_imxgpu2d = " ${LIBG2D_PACKAGECONFIG}" -PACKAGECONFIG_append_imxipu = " ipu" -PACKAGECONFIG_append_imxpxp = " pxp" -PACKAGECONFIG_append_mx8m = " 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," - -# 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 = "(mx6|mx7|mx8)" 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..dd3b65da --- /dev/null +++ b/recipes-bsp/libimxdmabuffer/libimxdmabuffer_1.1.2.bb @@ -0,0 +1,55 @@ +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 = "LGPLv2.1" +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 + +# dma-heap allocator is unavailable because it requires kernel 5.6 or newer. +EXTRA_OECONF = "--imx-linux-headers-path=${STAGING_INCDIR_IMX} \ + --libdir=${libdir} \ + --with-dma-heap-allocator=no \ + ${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 ?= " ion " +PACKAGECONFIG_append_imxgpu2d = " ${LIBG2D_PACKAGECONFIG}" +PACKAGECONFIG_append_imxipu = " ipu" +PACKAGECONFIG_append_imxpxp = " pxp" +PACKAGECONFIG_append_mx8m = " 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," + +# 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 = "(mx6|mx7|mx8)" -- cgit v1.2.3-54-g00ecf From d562e1e22cd4b557320386be95402ec5306c7a5e Mon Sep 17 00:00:00 2001 From: Carlos Rafael Giani Date: Wed, 11 May 2022 09:55:00 +0200 Subject: libimxvpuapi2: Upgrade to version 2.2.1 * Add option to not compile examples * imx8m-hantro: Allow for reusing decoder after drain mode finishes * imx6-coda: Reset drain mode after EOS processed * imx6-coda: Reset drain mode flags when flushing * Use libimxdmabuffer 1.1.2 sync access functions to ensure cache coherence * Add imx_vpu_api_is_color_format_10bit() function * Documentation fixes Signed-off-by: Carlos Rafael Giani --- .../libimxvpuapi/libimxvpuapi2_2.2.0.bb | 26 ---------------------- .../libimxvpuapi/libimxvpuapi2_2.2.1.bb | 26 ++++++++++++++++++++++ 2 files changed, 26 insertions(+), 26 deletions(-) delete mode 100644 recipes-multimedia/libimxvpuapi/libimxvpuapi2_2.2.0.bb create mode 100644 recipes-multimedia/libimxvpuapi/libimxvpuapi2_2.2.1.bb diff --git a/recipes-multimedia/libimxvpuapi/libimxvpuapi2_2.2.0.bb b/recipes-multimedia/libimxvpuapi/libimxvpuapi2_2.2.0.bb deleted file mode 100644 index 8b2f4138..00000000 --- a/recipes-multimedia/libimxvpuapi/libimxvpuapi2_2.2.0.bb +++ /dev/null @@ -1,26 +0,0 @@ -DESCRIPTION = "frontend for the i.MX6 / i.MX8 VPU hardware video engines" -HOMEPAGE = "https://github.com/Freescale/libimxvpuapi" -LICENSE = "LGPLv2.1" -LIC_FILES_CHKSUM = "file://LICENSE;md5=38fa42a5a6425b26d2919b17b1527324" -SECTION = "multimedia" -DEPENDS = "virtual/imxvpu libimxdmabuffer" - -PV .= "+git${SRCPV}" - -SRCBRANCH ?= "master" -SRCREV = "a650f13fb5de94e0c7c9e77f4d07ea275ea80dac" -SRC_URI = "git://github.com/Freescale/libimxvpuapi.git;branch=${SRCBRANCH};protocol=https" - -S = "${WORKDIR}/git" - -inherit waf pkgconfig use-imx-headers - -IMX_PLATFORM_mx6 = "imx6" -IMX_PLATFORM_mx8mq = "imx8m" -IMX_PLATFORM_mx8mm = "imx8mm" -IMX_PLATFORM_mx8mp = "imx8mm" - -EXTRA_OECONF = "--imx-platform=${IMX_PLATFORM} --libdir=${libdir} --imx-headers=${STAGING_INCDIR_IMX} --sysroot-path=${RECIPE_SYSROOT}" - -PACKAGE_ARCH = "${MACHINE_ARCH}" -COMPATIBLE_MACHINE = "(imxvpu)" diff --git a/recipes-multimedia/libimxvpuapi/libimxvpuapi2_2.2.1.bb b/recipes-multimedia/libimxvpuapi/libimxvpuapi2_2.2.1.bb new file mode 100644 index 00000000..ab5c5b85 --- /dev/null +++ b/recipes-multimedia/libimxvpuapi/libimxvpuapi2_2.2.1.bb @@ -0,0 +1,26 @@ +DESCRIPTION = "frontend for the i.MX6 / i.MX8 VPU hardware video engines" +HOMEPAGE = "https://github.com/Freescale/libimxvpuapi" +LICENSE = "LGPLv2.1" +LIC_FILES_CHKSUM = "file://LICENSE;md5=38fa42a5a6425b26d2919b17b1527324" +SECTION = "multimedia" +DEPENDS = "virtual/imxvpu libimxdmabuffer" + +PV .= "+git${SRCPV}" + +SRCBRANCH ?= "master" +SRCREV = "e81db32d10aee42c74ab50172487e04cbec6cbe0" +SRC_URI = "git://github.com/Freescale/libimxvpuapi.git;branch=${SRCBRANCH};protocol=https" + +S = "${WORKDIR}/git" + +inherit waf pkgconfig use-imx-headers + +IMX_PLATFORM_mx6 = "imx6" +IMX_PLATFORM_mx8mq = "imx8m" +IMX_PLATFORM_mx8mm = "imx8mm" +IMX_PLATFORM_mx8mp = "imx8mm" + +EXTRA_OECONF = "--imx-platform=${IMX_PLATFORM} --libdir=${libdir} --imx-headers=${STAGING_INCDIR_IMX} --sysroot-path=${RECIPE_SYSROOT}" + +PACKAGE_ARCH = "${MACHINE_ARCH}" +COMPATIBLE_MACHINE = "(imxvpu)" -- cgit v1.2.3-54-g00ecf From c1cbe5c6f38bd8a5c45ea19dc757644f1adaf7dd Mon Sep 17 00:00:00 2001 From: Carlos Rafael Giani Date: Wed, 11 May 2022 10:20:41 +0200 Subject: gstreamer1.0-plugins-imx: Backport version 2.1.0 from kirkstone gstreamer1.0-plugins-imx version 0.13 remains preferred by default to maintain compatibility with existing BSPs. Signed-off-by: Carlos Rafael Giani --- .../gstreamer/gstreamer1.0-plugins-imx_2.1.0.bb | 70 ++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-imx_2.1.0.bb diff --git a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-imx_2.1.0.bb b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-imx_2.1.0.bb new file mode 100644 index 00000000..9b3bc9b7 --- /dev/null +++ b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-imx_2.1.0.bb @@ -0,0 +1,70 @@ +# Copyright (C) 2018 O.S. Systems Software LTDA. +DESCRIPTION = "GStreamer 1.0 plugins for i.MX platforms" +LICENSE = "LGPLv2+" +LIC_FILES_CHKSUM = "file://LICENSE;md5=55ca817ccb7d5b5b66355690e9abc605" +SECTION = "multimedia" +DEPENDS = "gstreamer1.0 gstreamer1.0-plugins-base libimxdmabuffer" +# add the audioparsers and the videoparsersbad plugins as RDEPENDS ; audioparsers +# for the uniaudio decoder, videoparsersbad for the VPU video decoder +# the gstreamer1.0-plugins-imx RDEPENDS is necessary to ensure the -good recipe is +# built (it is not a compile-time dependency however, hence RDEPENDS and not DEPENDS) +RDEPENDS_gstreamer1.0-plugins-imx = "gstreamer1.0-plugins-good gstreamer1.0-plugins-bad" +RDEPENDS_gstreamer1.0-plugins-imx-imxaudio = "gstreamer1.0-plugins-good-audioparsers" +RDEPENDS_gstreamer1.0-plugins-imx-imxvpu = "gstreamer1.0-plugins-bad-videoparsersbad" + +PV .= "+git${SRCPV}" + +SRCBRANCH ?= "master" +SRCREV = "b1e5cca1a6df9d2c0dc505ae222775798108d340" +SRC_URI = "git://github.com/Freescale/gstreamer-imx.git;branch=${SRCBRANCH};protocol=https" + +S = "${WORKDIR}/git" + +# Setting DEFAULT_PREFERENCE to -1 since dunfell has had gstreamer-imx version +# 0.13.1 for a long time already, so silently replacing it with version 2.1.0 +# may break existing BSPs. +DEFAULT_PREFERENCE = "-1" + +inherit pkgconfig meson use-imx-headers + +# libg2d on i.MX8 SoCs with a DPU is emulated via the DPU. +# That particular libg2d .so depends on libdrm, however. +# Also, due to behavioral differences, an additional flag +# is needed to improve performance. +LIBG2D_DPU_OPTION = "-Dg2d-based-on-dpu=false" +LIBG2D_DEPENDENCIES = "virtual/libg2d" +LIBG2D_DPU_OPTION_imxdpu = "-Dg2d-based-on-dpu=true" +LIBG2D_DEPENDENCIES_imxdpu = "virtual/libg2d libdrm" + +# OE dunfell's meson version does not have the necessary +# functionality for build scripts to query the sysroot path, +# so it must be specified manually via the -Dsysroot option. +EXTRA_OEMESON += "-Dimx-headers-path=${STAGING_INCDIR_IMX} -Dsysroot=${RECIPE_SYSROOT}" + +PACKAGECONFIG ?= "uniaudiodec" +PACKAGECONFIG_append_imxgpu2d = " g2d" +PACKAGECONFIG_append_imxvpu = " vpu" +PACKAGECONFIG_append_imxipu = " ipu" +PACKAGECONFIG_append_imxpxp = " pxp" +# The custom imxv4l2 elements are only available on the i.MX6. +# The 2D blitter sinks require an MXC framebuffer, which +# is not available anymore on the i.MX8 (since these SoCs +# now use KMS instead of the old Linux framebuffer). +PACKAGECONFIG_append_mx6 = " imx2dvideosink v4l2" +PACKAGECONFIG_append_mx7 = " imx2dvideosink" + +PACKAGECONFIG[g2d] = "-Dg2d=enabled ${LIBG2D_DPU_OPTION},-Dg2d=disabled,${LIBG2D_DEPENDENCIES}" +PACKAGECONFIG[pxp] = "-Dpxp=enabled,-Dpxp=disabled," +PACKAGECONFIG[ipu] = "-Dipu=enabled,-Dipu=disabled," +PACKAGECONFIG[vpu] = "-Dvpu=enabled,-Dvpu=disabled,libimxvpuapi2" +PACKAGECONFIG[imx2dvideosink] = "-Dimx2d-videosink=true,-Dimx2d-videosink=false," +PACKAGECONFIG[v4l2] = "-Dv4l2=true,-Dv4l2=false," +PACKAGECONFIG[uniaudiodec] = "-Duniaudiodec=enabled,-Duniaudiodec=disabled,imx-codec" +PACKAGECONFIG[mp3encoder] = "-Dmp3encoder=enabled,-Dmp3encoder=disabled,imx-codec" + +require recipes-multimedia/gstreamer/gstreamer1.0-plugins-packaging.inc + +# the following line is required to produce one package for each plugin +PACKAGES_DYNAMIC = "^${PN}-.*" + +COMPATIBLE_MACHINE = "(mx6dl|mx6q|mx6sl|mx6sx|mx6ul|mx6ull|mx7d|mx8)" -- cgit v1.2.3-54-g00ecf