diff options
Diffstat (limited to 'meta-ti-bsp/recipes-graphics')
17 files changed, 1072 insertions, 0 deletions
diff --git a/meta-ti-bsp/recipes-graphics/libgal/ti-gc320-libs_5.0.11.p7.bb b/meta-ti-bsp/recipes-graphics/libgal/ti-gc320-libs_5.0.11.p7.bb new file mode 100644 index 00000000..807f421c --- /dev/null +++ b/meta-ti-bsp/recipes-graphics/libgal/ti-gc320-libs_5.0.11.p7.bb @@ -0,0 +1,46 @@ +DESCRIPTION = "Userspace libraries for GC320 chipset on TI SoCs" +HOMEPAGE = "https://git.ti.com/graphics/ti-gc320-libs" +LICENSE = "TI-TSPA" +LIC_FILES_CHKSUM = "file://Manifest.html;md5=a9121e8936ace09820d23f7626daaca5" + +inherit features_check + +REQUIRED_MACHINE_FEATURES = "gc320" + +COMPATIBLE_MACHINE = "omap-a15" + +CLEANBROKEN = "1" + +BRANCH = "ti-${PV}" + +SRC_URI = "git://git.ti.com/git/graphics/ti-gc320-libs.git;protocol=https;branch=${BRANCH}" +SRCREV = "c0afab259de59909cfe74c01f3f7fbaa147f94b5" + +RRECOMMENDS:${PN} = "ti-gc320-driver" + +# There's only hardfp version available +python __anonymous() { + tunes = d.getVar("TUNE_FEATURES") + if not tunes: + return + pkgn = d.getVar("PN") + pkgv = d.getVar("PV") + if "callconvention-hard" not in tunes: + bb.warn("%s-%s ONLY supports hardfp mode for now" % (pkgn, pkgv)) + raise bb.parse.SkipPackage("%s-%s ONLY supports hardfp mode for now" % (pkgn, pkgv)) +} + +TARGET_PRODUCT = "jacinto6evm" + +PR = "r3" + +S = "${WORKDIR}/git" + +EXTRA_OEMAKE += "DESTDIR=${D} TARGET_PRODUCT=${TARGET_PRODUCT} LIBDIR=${libdir}" + +do_install() { + oe_runmake install + chown -R root:root ${D} +} + +INSANE_SKIP:${PN} += "ldflags" diff --git a/meta-ti-bsp/recipes-graphics/mesa/files/0001-fix-gallivm-limit-usage-of-LLVMContextSetOpaquePoint.patch b/meta-ti-bsp/recipes-graphics/mesa/files/0001-fix-gallivm-limit-usage-of-LLVMContextSetOpaquePoint.patch new file mode 100644 index 00000000..905fad04 --- /dev/null +++ b/meta-ti-bsp/recipes-graphics/mesa/files/0001-fix-gallivm-limit-usage-of-LLVMContextSetOpaquePoint.patch @@ -0,0 +1,128 @@ +From 1a894699354f5f984f31e5d3418b651edf486df9 Mon Sep 17 00:00:00 2001 +From: Ryan Eatmon <reatmon@ti.com> +Date: Fri, 22 Sep 2023 22:32:41 -0500 +Subject: [PATCH] fix: gallivm: limit usage of LLVMContextSetOpaquePointers() + to LLVM 15 + +LLVMContextSetOpaquePointers() was a temporary workaround offered to +allow transitioning to opaque pointers. Mesa is ready for this now with +recent versions of LLVM (16+). Therefore we limit the workaround of +using LLVMContextSetOpaquePointers() to LLVM 15 now, that this C +interface was removed in LLVM 17. + +Reference: https://github.com/llvm/llvm-project/commit/1270879376025457e266572c7cccc51eb5de9276 + +Upstream-Status: Submitted [https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21124] +Signed-off-by: Ryan Eatmon <reatmon@ti.com> +--- + src/gallium/auxiliary/draw/draw_llvm.c | 2 +- + src/gallium/drivers/llvmpipe/lp_context.c | 2 +- + src/gallium/drivers/llvmpipe/lp_test_arit.c | 2 +- + src/gallium/drivers/llvmpipe/lp_test_blend.c | 2 +- + src/gallium/drivers/llvmpipe/lp_test_conv.c | 2 +- + src/gallium/drivers/llvmpipe/lp_test_format.c | 4 ++-- + src/gallium/drivers/llvmpipe/lp_test_printf.c | 2 +- + 7 files changed, 8 insertions(+), 8 deletions(-) + +diff --git a/src/gallium/auxiliary/draw/draw_llvm.c b/src/gallium/auxiliary/draw/draw_llvm.c +index 50c157bc3cc..8b3a1522725 100644 +--- a/src/gallium/auxiliary/draw/draw_llvm.c ++++ b/src/gallium/auxiliary/draw/draw_llvm.c +@@ -784,7 +784,7 @@ draw_llvm_create(struct draw_context *draw, LLVMContextRef context) + if (!llvm->context) { + llvm->context = LLVMContextCreate(); + +-#if LLVM_VERSION_MAJOR >= 15 ++#if LLVM_VERSION_MAJOR == 15 + LLVMContextSetOpaquePointers(llvm->context, false); + #endif + +diff --git a/src/gallium/drivers/llvmpipe/lp_context.c b/src/gallium/drivers/llvmpipe/lp_context.c +index 8309335aebc..0ef4317fc76 100644 +--- a/src/gallium/drivers/llvmpipe/lp_context.c ++++ b/src/gallium/drivers/llvmpipe/lp_context.c +@@ -263,7 +263,7 @@ llvmpipe_create_context(struct pipe_screen *screen, void *priv, + if (!llvmpipe->context) + goto fail; + +-#if LLVM_VERSION_MAJOR >= 15 ++#if LLVM_VERSION_MAJOR == 15 + LLVMContextSetOpaquePointers(llvmpipe->context, false); + #endif + +diff --git a/src/gallium/drivers/llvmpipe/lp_test_arit.c b/src/gallium/drivers/llvmpipe/lp_test_arit.c +index 4118928d52e..565b1c47753 100644 +--- a/src/gallium/drivers/llvmpipe/lp_test_arit.c ++++ b/src/gallium/drivers/llvmpipe/lp_test_arit.c +@@ -434,7 +434,7 @@ test_unary(unsigned verbose, FILE *fp, const struct unary_test_t *test, unsigned + } + + context = LLVMContextCreate(); +-#if LLVM_VERSION_MAJOR >= 15 ++#if LLVM_VERSION_MAJOR == 15 + LLVMContextSetOpaquePointers(context, false); + #endif + gallivm = gallivm_create("test_module", context, NULL); +diff --git a/src/gallium/drivers/llvmpipe/lp_test_blend.c b/src/gallium/drivers/llvmpipe/lp_test_blend.c +index 37c3f731eaf..3d2899a78d4 100644 +--- a/src/gallium/drivers/llvmpipe/lp_test_blend.c ++++ b/src/gallium/drivers/llvmpipe/lp_test_blend.c +@@ -452,7 +452,7 @@ test_one(unsigned verbose, + dump_blend_type(stdout, blend, type); + + context = LLVMContextCreate(); +-#if LLVM_VERSION_MAJOR >= 15 ++#if LLVM_VERSION_MAJOR == 15 + LLVMContextSetOpaquePointers(context, false); + #endif + gallivm = gallivm_create("test_module", context, NULL); +diff --git a/src/gallium/drivers/llvmpipe/lp_test_conv.c b/src/gallium/drivers/llvmpipe/lp_test_conv.c +index c7ea9efc12d..83236f0c0ba 100644 +--- a/src/gallium/drivers/llvmpipe/lp_test_conv.c ++++ b/src/gallium/drivers/llvmpipe/lp_test_conv.c +@@ -223,7 +223,7 @@ test_one(unsigned verbose, + } + + context = LLVMContextCreate(); +-#if LLVM_VERSION_MAJOR >= 15 ++#if LLVM_VERSION_MAJOR == 15 + LLVMContextSetOpaquePointers(context, false); + #endif + gallivm = gallivm_create("test_module", context, NULL); +diff --git a/src/gallium/drivers/llvmpipe/lp_test_format.c b/src/gallium/drivers/llvmpipe/lp_test_format.c +index 0a2a1e449e8..89f7d5dec1a 100644 +--- a/src/gallium/drivers/llvmpipe/lp_test_format.c ++++ b/src/gallium/drivers/llvmpipe/lp_test_format.c +@@ -150,7 +150,7 @@ test_format_float(unsigned verbose, FILE *fp, + unsigned i, j, k, l; + + context = LLVMContextCreate(); +-#if LLVM_VERSION_MAJOR >= 15 ++#if LLVM_VERSION_MAJOR == 15 + LLVMContextSetOpaquePointers(context, false); + #endif + gallivm = gallivm_create("test_module_float", context, NULL); +@@ -254,7 +254,7 @@ test_format_unorm8(unsigned verbose, FILE *fp, + unsigned i, j, k, l; + + context = LLVMContextCreate(); +-#if LLVM_VERSION_MAJOR >= 15 ++#if LLVM_VERSION_MAJOR == 15 + LLVMContextSetOpaquePointers(context, false); + #endif + gallivm = gallivm_create("test_module_unorm8", context, NULL); +diff --git a/src/gallium/drivers/llvmpipe/lp_test_printf.c b/src/gallium/drivers/llvmpipe/lp_test_printf.c +index b3de9cb9e8b..850c0abfe22 100644 +--- a/src/gallium/drivers/llvmpipe/lp_test_printf.c ++++ b/src/gallium/drivers/llvmpipe/lp_test_printf.c +@@ -96,7 +96,7 @@ test_printf(unsigned verbose, FILE *fp, + boolean success = TRUE; + + context = LLVMContextCreate(); +-#if LLVM_VERSION_MAJOR >= 15 ++#if LLVM_VERSION_MAJOR == 15 + LLVMContextSetOpaquePointers(context, false); + #endif + gallivm = gallivm_create("test_module", context, NULL); +-- +2.17.1 diff --git a/meta-ti-bsp/recipes-graphics/mesa/files/0001-freedreno-pm4-Use-unsigned-instead-of-uint-to-fix-mu.patch b/meta-ti-bsp/recipes-graphics/mesa/files/0001-freedreno-pm4-Use-unsigned-instead-of-uint-to-fix-mu.patch new file mode 100644 index 00000000..f0775176 --- /dev/null +++ b/meta-ti-bsp/recipes-graphics/mesa/files/0001-freedreno-pm4-Use-unsigned-instead-of-uint-to-fix-mu.patch @@ -0,0 +1,43 @@ +From 8a5de0b6cf1090d7f29f3974ec79c32776cf2745 Mon Sep 17 00:00:00 2001 +From: Jami Kettunen <jami.kettunen@protonmail.com> +Date: Tue, 31 Aug 2021 00:15:58 +0300 +Subject: [PATCH] freedreno/pm4: Use unsigned instead of uint to fix musl build + +Upstream-Status: Backport + +Fixes the following error I noticed when building against aarch64 with +musl libc: + + In file included from ../src/freedreno/decode/crashdec.h:38, + from ../src/freedreno/decode/crashdec.c:40: + ../src/freedreno/common/freedreno_pm4.h:104:15: error: unknown type name 'uint' + 104 | static inline uint + | ^~~~ + ../src/freedreno/common/freedreno_pm4.h:105:25: error: unknown type name 'uint'; did you mean 'int'? + 105 | pm4_calc_odd_parity_bit(uint val) + | ^~~~ + | int + +Signed-off-by: Jami Kettunen <jami.kettunen@protonmail.com> +Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19665> +--- + src/freedreno/common/freedreno_pm4.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/freedreno/common/freedreno_pm4.h b/src/freedreno/common/freedreno_pm4.h +index 8f958953d693..091247e709a0 100644 +--- a/src/freedreno/common/freedreno_pm4.h ++++ b/src/freedreno/common/freedreno_pm4.h +@@ -105,8 +105,8 @@ pm4_pkt7_hdr(uint8_t opcode, uint16_t cnt) + #define cp_type3_opcode(pkt) (((pkt) >> 8) & 0xFF) + #define type3_pkt_size(pkt) ((((pkt) >> 16) & 0x3FFF) + 1) + +-static inline uint +-pm4_calc_odd_parity_bit(uint val) ++static inline unsigned ++pm4_calc_odd_parity_bit(unsigned val) + { + return (0x9669 >> (0xf & ((val) ^ ((val) >> 4) ^ ((val) >> 8) ^ + ((val) >> 12) ^ ((val) >> 16) ^ ((val) >> 20) ^ +-- +2.39.2 diff --git a/meta-ti-bsp/recipes-graphics/mesa/files/0001-gallium-Fix-build-with-llvm-17.patch b/meta-ti-bsp/recipes-graphics/mesa/files/0001-gallium-Fix-build-with-llvm-17.patch new file mode 100644 index 00000000..bdfe7bb8 --- /dev/null +++ b/meta-ti-bsp/recipes-graphics/mesa/files/0001-gallium-Fix-build-with-llvm-17.patch @@ -0,0 +1,58 @@ +From 2dfe0f899aeb415a5491b8c67e208673d2a2914f Mon Sep 17 00:00:00 2001 +From: Ryan Eatmon <reatmon@ti.com> +Date: Fri, 22 Sep 2023 21:50:08 -0500 +Subject: [PATCH] gallium: Fix build with llvm 17 + +These headers are not available for C files in llvm 17+ +and they seem to be not needed to compile after all with llvm 17 +so add conditions to exclude them for llvm >= 17 + +Upstream-Status: Submitted [https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21262] +Upstream-Status: Submitted [https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22980] +Signed-off-by: Ryan Eatmon <reatmon@ti.com> +--- + src/gallium/auxiliary/gallivm/lp_bld_init.c | 8 ++++---- + src/gallium/auxiliary/gallivm/lp_bld_misc.cpp | 4 ++++ + 2 files changed, 8 insertions(+), 4 deletions(-) + +diff --git a/src/gallium/auxiliary/gallivm/lp_bld_init.c b/src/gallium/auxiliary/gallivm/lp_bld_init.c +index 584ea738668..fe8bb2b11af 100644 +--- a/src/gallium/auxiliary/gallivm/lp_bld_init.c ++++ b/src/gallium/auxiliary/gallivm/lp_bld_init.c +@@ -42,14 +42,14 @@ + + #include <llvm/Config/llvm-config.h> + #include <llvm-c/Analysis.h> +-#include <llvm-c/Transforms/Scalar.h> +-#if LLVM_VERSION_MAJOR >= 7 +-#include <llvm-c/Transforms/Utils.h> +-#endif + #include <llvm-c/BitWriter.h> + #if GALLIVM_USE_NEW_PASS == 1 + #include <llvm-c/Transforms/PassBuilder.h> + #elif GALLIVM_HAVE_CORO == 1 ++#include <llvm-c/Transforms/Scalar.h> ++#if LLVM_VERSION_MAJOR >= 7 ++#include <llvm-c/Transforms/Utils.h> ++#endif + #if LLVM_VERSION_MAJOR <= 8 && (defined(PIPE_ARCH_AARCH64) || defined (PIPE_ARCH_ARM) || defined(PIPE_ARCH_S390) || defined(PIPE_ARCH_MIPS64)) + #include <llvm-c/Transforms/IPO.h> + #endif +diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp +index 2279e5acb28..0caeaf94263 100644 +--- a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp ++++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp +@@ -56,7 +56,11 @@ + #include <llvm-c/ExecutionEngine.h> + #include <llvm/Target/TargetOptions.h> + #include <llvm/ExecutionEngine/ExecutionEngine.h> ++#if LLVM_VERSION_MAJOR >= 17 ++#include <llvm/TargetParser/Triple.h> ++#else + #include <llvm/ADT/Triple.h> ++#endif + #include <llvm/Analysis/TargetLibraryInfo.h> + #include <llvm/ExecutionEngine/SectionMemoryManager.h> + #include <llvm/Support/CommandLine.h> +-- +2.17.1 diff --git a/meta-ti-bsp/recipes-graphics/mesa/files/0001-gbm-backend-fix-gbm-compile-without-dri.patch b/meta-ti-bsp/recipes-graphics/mesa/files/0001-gbm-backend-fix-gbm-compile-without-dri.patch new file mode 100644 index 00000000..289ff032 --- /dev/null +++ b/meta-ti-bsp/recipes-graphics/mesa/files/0001-gbm-backend-fix-gbm-compile-without-dri.patch @@ -0,0 +1,64 @@ +From 25946100e21cf2095bea334e8d7096798561d0b7 Mon Sep 17 00:00:00 2001 +From: Vincent Davis Jr <vince@underview.tech> +Date: Wed, 28 Dec 2022 16:28:01 -0600 +Subject: [PATCH] gbm/backend: fix gbm compile without dri + +Upstream-Status: Backport + +https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20447 +https://gitlab.freedesktop.org/mesa/mesa/-/commit/842ca284650f066e58706741a7d22d67b5088e60 + +At mesa version 22.2.3 patch wasn't introduced until after. + +Commit introduces a fix that allows for gbm to be built with an empty +backend. There are situation especially in a Yocto/OE cross compilation +environment where you want to build with an empty backend. The particular +situation is as such: + +The mesa-gl recipe is the preferred provider for virtual/libgbm, virtual/libgl, +virtual/mesa, etc... But the x11 DISTRO_FEATURE in't included this leads to build +errors such as: + +| /../../../ld: src/gbm/libgbm.so.1.0.0.p/main_backend.c.o: in function `find_backend': +| backend.c:(.text.find_backend+0xa4): undefined reference to `gbm_dri_backend' +| /../../../ld: src/gbm/libgbm.so.1.0.0.p/main_backend.c.o:(.data.rel.ro.builtin_backends+0x4): + undefined reference to `gbm_dri_backend' +| collect2: error: ld returned 1 exit status + +Issue should be replicable by setting -Ddri3=disabled and -Dgbm=enabled + +Add fix to bypasses compilation issue by excluding gbm dri backend. If +HAVE_DRI || HAVE_DRIX not specified. + +Acked-by: David Heidelberg <david.heidelberg@collabora.com> +Signed-off-by: Vincent Davis Jr <vince@underview.tech> +--- + src/gbm/main/backend.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/src/gbm/main/backend.c b/src/gbm/main/backend.c +index 974d0a76a4e..feee0703495 100644 +--- a/src/gbm/main/backend.c ++++ b/src/gbm/main/backend.c +@@ -42,7 +42,9 @@ + #define ARRAY_SIZE(a) (sizeof(a)/sizeof((a)[0])) + #define VER_MIN(a, b) ((a) < (b) ? (a) : (b)) + ++#if defined(HAVE_DRI) || defined(HAVE_DRI2) || defined(HAVE_DRI3) + extern const struct gbm_backend gbm_dri_backend; ++#endif + + struct gbm_backend_desc { + const char *name; +@@ -51,7 +53,9 @@ struct gbm_backend_desc { + }; + + static const struct gbm_backend_desc builtin_backends[] = { ++#if defined(HAVE_DRI) || defined(HAVE_DRI2) || defined(HAVE_DRI3) + { "dri", &gbm_dri_backend }, ++#endif + }; + + #define BACKEND_LIB_SUFFIX "_gbm" +-- +2.34.1 diff --git a/meta-ti-bsp/recipes-graphics/mesa/files/0001-meson-misdetects-64bit-atomics-on-mips-clang.patch b/meta-ti-bsp/recipes-graphics/mesa/files/0001-meson-misdetects-64bit-atomics-on-mips-clang.patch new file mode 100644 index 00000000..35bd0ea1 --- /dev/null +++ b/meta-ti-bsp/recipes-graphics/mesa/files/0001-meson-misdetects-64bit-atomics-on-mips-clang.patch @@ -0,0 +1,25 @@ +From 3ef37c63f03ad6f2af407de350486fdd25e9132a Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Mon, 13 Jan 2020 15:23:47 -0800 +Subject: [PATCH] meson misdetects 64bit atomics on mips/clang + +Upstream-Status: Pending +Signed-off-by: Khem Raj <raj.khem@gmail.com> + +--- + src/util/u_atomic.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/util/u_atomic.c b/src/util/u_atomic.c +index 5a5eab4..e499516 100644 +--- a/src/util/u_atomic.c ++++ b/src/util/u_atomic.c +@@ -21,7 +21,7 @@ + * IN THE SOFTWARE. + */ + +-#if defined(MISSING_64BIT_ATOMICS) && defined(HAVE_PTHREAD) ++#if !defined(__clang__) && defined(MISSING_64BIT_ATOMICS) && defined(HAVE_PTHREAD) + + #include <stdint.h> + #include <pthread.h> diff --git a/meta-ti-bsp/recipes-graphics/mesa/files/0001-meson.build-check-for-all-linux-host_os-combinations.patch b/meta-ti-bsp/recipes-graphics/mesa/files/0001-meson.build-check-for-all-linux-host_os-combinations.patch new file mode 100644 index 00000000..f0c1de46 --- /dev/null +++ b/meta-ti-bsp/recipes-graphics/mesa/files/0001-meson.build-check-for-all-linux-host_os-combinations.patch @@ -0,0 +1,43 @@ +From 3b4d6b89f644b43e507c08181fef06db4326f9da Mon Sep 17 00:00:00 2001 +From: Alistair Francis <alistair@alistair23.me> +Date: Thu, 14 Nov 2019 13:04:49 -0800 +Subject: [PATCH] meson.build: check for all linux host_os combinations + +Make sure that we are also looking for our host_os combinations like +linux-musl etc. when assuming support for DRM/KMS. + +Also delete a duplicate line. + +Upstream-Status: Pending + +Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> +Signed-off-by: Fabio Berton <fabio.berton@ossystems.com.br> +Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> +Signed-off-by: Alistair Francis <alistair@alistair23.me> + +--- + meson.build | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/meson.build b/meson.build +index 172c64a..9b5294c 100644 +--- a/meson.build ++++ b/meson.build +@@ -173,7 +173,7 @@ with_any_opengl = with_opengl or with_gles1 or with_gles2 + # Only build shared_glapi if at least one OpenGL API is enabled + with_shared_glapi = with_shared_glapi and with_any_opengl + +-system_has_kms_drm = ['openbsd', 'netbsd', 'freebsd', 'gnu/kfreebsd', 'dragonfly', 'linux', 'sunos', 'android'].contains(host_machine.system()) ++system_has_kms_drm = ['openbsd', 'netbsd', 'freebsd', 'gnu/kfreebsd', 'dragonfly', 'linux', 'sunos', 'android'].contains(host_machine.system()) or host_machine.system().startswith('linux') + + with_freedreno_kgsl = get_option('freedreno-kgsl') + if with_freedreno_kgsl +@@ -1076,7 +1076,7 @@ if cc.has_function('reallocarray') + endif + + # TODO: this is very incomplete +-if ['linux', 'cygwin', 'gnu', 'freebsd', 'gnu/kfreebsd', 'haiku', 'android'].contains(host_machine.system()) ++if ['linux', 'cygwin', 'gnu', 'freebsd', 'gnu/kfreebsd', 'haiku'].contains(host_machine.system()) or host_machine.system().startswith('linux') + pre_args += '-D_GNU_SOURCE' + elif host_machine.system() == 'sunos' + pre_args += '-D__EXTENSIONS__' diff --git a/meta-ti-bsp/recipes-graphics/mesa/files/0001-util-format-Check-for-NEON-before-using-it.patch b/meta-ti-bsp/recipes-graphics/mesa/files/0001-util-format-Check-for-NEON-before-using-it.patch new file mode 100644 index 00000000..6eea5ed8 --- /dev/null +++ b/meta-ti-bsp/recipes-graphics/mesa/files/0001-util-format-Check-for-NEON-before-using-it.patch @@ -0,0 +1,47 @@ +From f17e836ef9b1bbc6056790596420b699e48128c2 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Thu, 2 Dec 2021 19:57:42 -0800 +Subject: [PATCH] util/format: Check for NEON before using it + +This fixes build on rpi0-w and any other machine which does not have +neon unit and is not used as FPU unit + +Fixes errors e.g. + +In file included from ../mesa-21.3.0/src/util/format/u_format_unpack_neon.c:35: +/mnt/b/yoe/master/build/tmp/work/arm1176jzfshf-vfp-yoe-linux-gnueabi/mesa/2_21.3.0-r0/recipe-sysroot-native/usr/lib/clang/13.0.1/include/arm_neon.h:32:2: error: "NEON support not enabled" + +Upstream-Status: Submitted [https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14032] +Signed-off-by: Khem Raj <raj.khem@gmail.com> + +--- + src/util/format/u_format.c | 2 +- + src/util/format/u_format_unpack_neon.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/util/format/u_format.c b/src/util/format/u_format.c +index c071250..0880984 100644 +--- a/src/util/format/u_format.c ++++ b/src/util/format/u_format.c +@@ -1184,7 +1184,7 @@ static void + util_format_unpack_table_init(void) + { + for (enum pipe_format format = PIPE_FORMAT_NONE; format < PIPE_FORMAT_COUNT; format++) { +-#if (defined(PIPE_ARCH_AARCH64) || defined(PIPE_ARCH_ARM)) && !defined(NO_FORMAT_ASM) && !defined(__SOFTFP__) ++#if (defined(PIPE_ARCH_AARCH64) || (defined(__ARM_NEON) && defined(PIPE_ARCH_ARM))) && !defined(NO_FORMAT_ASM) + const struct util_format_unpack_description *unpack = util_format_unpack_description_neon(format); + if (unpack) { + util_format_unpack_table[format] = unpack; +diff --git a/src/util/format/u_format_unpack_neon.c b/src/util/format/u_format_unpack_neon.c +index a4a5cb1..1e4f794 100644 +--- a/src/util/format/u_format_unpack_neon.c ++++ b/src/util/format/u_format_unpack_neon.c +@@ -23,7 +23,7 @@ + + #include <u_format.h> + +-#if (defined(PIPE_ARCH_AARCH64) || defined(PIPE_ARCH_ARM)) && !defined(NO_FORMAT_ASM) && !defined(__SOFTFP__) ++#if (defined(PIPE_ARCH_AARCH64) || (defined(__ARM_NEON) && defined(PIPE_ARCH_ARM))) && !defined(NO_FORMAT_ASM) + + /* armhf builds default to vfp, not neon, and refuses to compile neon intrinsics + * unless you tell it "no really". diff --git a/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-23.2.1/0001-gallium-Fix-build-with-llvm-17.patch b/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-23.2.1/0001-gallium-Fix-build-with-llvm-17.patch new file mode 100644 index 00000000..738ff267 --- /dev/null +++ b/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-23.2.1/0001-gallium-Fix-build-with-llvm-17.patch @@ -0,0 +1,40 @@ +From 6d07f6aa7f92f40d78a2db645f16f0f3e7d3c2e8 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Fri, 23 Jun 2023 01:20:38 -0700 +Subject: [PATCH] gallium: Fix build with llvm 17 + +These headers are not available for C files in llvm 17+ +and they seem to be not needed to compile after all with llvm 17 +so add conditions to exclude them for llvm >= 17 + +Upstream-Status: Submitted [https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23827] +Signed-off-by: Khem Raj <raj.khem@gmail.com> + +--- + src/gallium/auxiliary/gallivm/lp_bld_init.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/src/gallium/auxiliary/gallivm/lp_bld_init.c b/src/gallium/auxiliary/gallivm/lp_bld_init.c +index cd2108f..b1a4d03 100644 +--- a/src/gallium/auxiliary/gallivm/lp_bld_init.c ++++ b/src/gallium/auxiliary/gallivm/lp_bld_init.c +@@ -46,15 +46,19 @@ + #if GALLIVM_USE_NEW_PASS == 1 + #include <llvm-c/Transforms/PassBuilder.h> + #elif GALLIVM_HAVE_CORO == 1 ++#if LLVM_VERSION_MAJOR < 17 + #include <llvm-c/Transforms/Scalar.h> +-#if LLVM_VERSION_MAJOR >= 7 ++#endif ++#if LLVM_VERSION_MAJOR >= 7 && LLVM_VERSION_MAJOR < 17 + #include <llvm-c/Transforms/Utils.h> + #endif + #if LLVM_VERSION_MAJOR <= 8 && (DETECT_ARCH_AARCH64 || DETECT_ARCH_ARM || DETECT_ARCH_S390 || DETECT_ARCH_MIPS64) + #include <llvm-c/Transforms/IPO.h> + #endif ++#if LLVM_VERSION_MAJOR < 17 + #include <llvm-c/Transforms/Coroutines.h> + #endif ++#endif + + unsigned gallivm_perf = 0; diff --git a/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-23.2.1/0001-meson-Disable-cmake-dependency-detector-for-llvm.patch b/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-23.2.1/0001-meson-Disable-cmake-dependency-detector-for-llvm.patch new file mode 100644 index 00000000..4cded054 --- /dev/null +++ b/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-23.2.1/0001-meson-Disable-cmake-dependency-detector-for-llvm.patch @@ -0,0 +1,42 @@ +From 00d41cd5aa3f4b494dc276c9b4ccdc096310c91f Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Thu, 28 Sep 2023 15:34:22 -0700 +Subject: [PATCH] meson: use llvm-config instead of cmake to fix linking errors with meson 1.2.1 + +meson dependency auto dependency detection uses cmake and then +config-tool to process dependencies, in mesa the logic to detect llvm is +using auto detection which means if it finds cmake then it will try to +use cmake method. Cmake method works ok except a case when llvm-dev +package is installed on the build host then it generates its own +native.meson file and ignores OE supplied meson.native file which has +correct llvm-config tool specified which is pointing to llvm-config from +native sysroot. The generated meson.native file points to one found in +/usr/bin and there onwards detector finds native install of llvm and +configures that into building native mesa package. + +Since cmake detector does not always work, disable it by default and use +config-tool which works in all cases. This is suggested in below issues +too + +A similar issue is open in meson upstream [1] and mesa [2] + +[1] https://github.com/mesonbuild/meson/issues/10483 +[2] https://gitlab.freedesktop.org/mesa/mesa/-/issues/6738 + +Upstream-Status: Submitted [https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25438] + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + meson.build | 1 + + 1 file changed, 1 insertion(+) + +--- a/meson.build ++++ b/meson.build +@@ -1659,6 +1659,7 @@ with_llvm = false + if _llvm.allowed() + dep_llvm = dependency( + 'llvm', ++ method : host_machine.system() == 'windows' ? 'auto' : 'config-tool', + version : _llvm_version, + modules : llvm_modules, + optional_modules : llvm_optional_modules, diff --git a/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-23.2.1/0001-meson-misdetects-64bit-atomics-on-mips-clang.patch b/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-23.2.1/0001-meson-misdetects-64bit-atomics-on-mips-clang.patch new file mode 100644 index 00000000..35bd0ea1 --- /dev/null +++ b/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-23.2.1/0001-meson-misdetects-64bit-atomics-on-mips-clang.patch @@ -0,0 +1,25 @@ +From 3ef37c63f03ad6f2af407de350486fdd25e9132a Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Mon, 13 Jan 2020 15:23:47 -0800 +Subject: [PATCH] meson misdetects 64bit atomics on mips/clang + +Upstream-Status: Pending +Signed-off-by: Khem Raj <raj.khem@gmail.com> + +--- + src/util/u_atomic.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/util/u_atomic.c b/src/util/u_atomic.c +index 5a5eab4..e499516 100644 +--- a/src/util/u_atomic.c ++++ b/src/util/u_atomic.c +@@ -21,7 +21,7 @@ + * IN THE SOFTWARE. + */ + +-#if defined(MISSING_64BIT_ATOMICS) && defined(HAVE_PTHREAD) ++#if !defined(__clang__) && defined(MISSING_64BIT_ATOMICS) && defined(HAVE_PTHREAD) + + #include <stdint.h> + #include <pthread.h> diff --git a/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-23.2.1/0001-meson.build-check-for-all-linux-host_os-combinations.patch b/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-23.2.1/0001-meson.build-check-for-all-linux-host_os-combinations.patch new file mode 100644 index 00000000..e9a6fd3f --- /dev/null +++ b/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-23.2.1/0001-meson.build-check-for-all-linux-host_os-combinations.patch @@ -0,0 +1,43 @@ +From b251af67df5a6840d2e9cc06edae2c387f8778f1 Mon Sep 17 00:00:00 2001 +From: Alistair Francis <alistair@alistair23.me> +Date: Thu, 14 Nov 2019 13:04:49 -0800 +Subject: [PATCH] meson.build: check for all linux host_os combinations + +Make sure that we are also looking for our host_os combinations like +linux-musl etc. when assuming support for DRM/KMS. + +Also delete a duplicate line. + +Upstream-Status: Pending + +Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> +Signed-off-by: Fabio Berton <fabio.berton@ossystems.com.br> +Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> +Signed-off-by: Alistair Francis <alistair@alistair23.me> + +--- + meson.build | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/meson.build b/meson.build +index 22385d8..15f48a6 100644 +--- a/meson.build ++++ b/meson.build +@@ -121,7 +121,7 @@ with_any_opengl = with_opengl or with_gles1 or with_gles2 + # Only build shared_glapi if at least one OpenGL API is enabled + with_shared_glapi = with_shared_glapi and with_any_opengl + +-system_has_kms_drm = ['openbsd', 'netbsd', 'freebsd', 'gnu/kfreebsd', 'dragonfly', 'linux', 'sunos', 'android'].contains(host_machine.system()) ++system_has_kms_drm = ['openbsd', 'netbsd', 'freebsd', 'gnu/kfreebsd', 'dragonfly', 'linux', 'sunos', 'android'].contains(host_machine.system()) or host_machine.system().startswith('linux') + + gallium_drivers = get_option('gallium-drivers') + if gallium_drivers.contains('auto') +@@ -909,7 +909,7 @@ if cc.has_function('fmemopen') + endif + + # TODO: this is very incomplete +-if ['linux', 'cygwin', 'gnu', 'freebsd', 'gnu/kfreebsd', 'haiku', 'android'].contains(host_machine.system()) ++if ['linux', 'cygwin', 'gnu', 'freebsd', 'gnu/kfreebsd', 'haiku'].contains(host_machine.system()) or host_machine.system().startswith('linux') + pre_args += '-D_GNU_SOURCE' + elif host_machine.system() == 'sunos' + pre_args += '-D__EXTENSIONS__' diff --git a/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr_22.3.5.bb b/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr_22.3.5.bb new file mode 100644 index 00000000..5abd0793 --- /dev/null +++ b/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr_22.3.5.bb @@ -0,0 +1,59 @@ +# PowerVR Graphics require several patches that have not made their way +# upstream yet. This allows us to build the shims we need without completely +# clobbering mesa. + +require recipes-graphics/mesa/mesa.inc + +SUMMARY += " (with PowerVR support for TI platforms)" + +LIC_FILES_CHKSUM = "file://docs/license.rst;md5=63779ec98d78d823a9dc533a0735ef10" + +BRANCH = "powervr/kirkstone/${PV}" + +SRC_URI = " \ + git://gitlab.freedesktop.org/StaticRocket/mesa.git;protocol=https;branch=${BRANCH} \ + file://0001-meson.build-check-for-all-linux-host_os-combinations.patch \ + file://0001-meson-misdetects-64bit-atomics-on-mips-clang.patch \ + file://0001-util-format-Check-for-NEON-before-using-it.patch \ + file://0001-gbm-backend-fix-gbm-compile-without-dri.patch \ + file://0001-freedreno-pm4-Use-unsigned-instead-of-uint-to-fix-mu.patch \ + file://0001-gallium-Fix-build-with-llvm-17.patch \ + file://0001-fix-gallivm-limit-usage-of-LLVMContextSetOpaquePoint.patch \ +" + +S = "${WORKDIR}/git" + +PACKAGECONFIG:append = " \ + ${@bb.utils.contains('PREFERRED_PROVIDER_virtual/gpudriver', 'ti-img-rogue-driver', 'pvr', '', d)} \ + ${@bb.utils.contains('PREFERRED_PROVIDER_virtual/gpudriver', 'ti-sgx-ddk-km', 'sgx', '', d)} \ +" + +SRCREV = "1be98ba80452ebe38546a7fca26b5a70f2629083" + +PVR_DISPLAY_CONTROLLER_ALIAS ??= "tidss" +PACKAGECONFIG[pvr] = "-Dgallium-pvr-alias=${PVR_DISPLAY_CONTROLLER_ALIAS}," +PACKAGECONFIG[sgx] = "-Dgallium-sgx-alias=${PVR_DISPLAY_CONTROLLER_ALIAS}," + +PACKAGECONFIG:remove = "video-codecs" +PACKAGECONFIG[video-codecs] = "" +PACKAGECONFIG:remove = "elf-tls" +PACKAGECONFIG[elf-tls] = "" +PACKAGECONFIG:remove = "xvmc" +PACKAGECONFIG[xvmc] = "" + +PACKAGE_ARCH = "${MACHINE_ARCH}" + +GALLIUMDRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'pvr', ',pvr', '', d)}" +GALLIUMDRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'sgx', ',sgx', '', d)}" + +VULKAN_DRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'pvr', ',pvr', '', d)}" + +do_install:append () { + # remove pvr custom pkgconfig + rm -rf ${D}${datadir}/pkgconfig +} + +FILES:${PN}-dev += "${datadir}/mesa/wayland-drm.xml" +FILES:mesa-vulkan-drivers += "${libdir}/libpvr_mesa_wsi.so" + +RRECOMMENDS:mesa-megadriver:append:class-target = " ${@d.getVar('PREFERRED_PROVIDER_virtual/gpudriver')}" diff --git a/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr_23.2.1.bb b/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr_23.2.1.bb new file mode 100644 index 00000000..1e66acd2 --- /dev/null +++ b/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr_23.2.1.bb @@ -0,0 +1,58 @@ +# PowerVR Graphics require several patches that have not made their way +# upstream yet. This allows us to build the shims we need without completely +# clobbering mesa. + +DEFAULT_PREFERENCE = "-1" + +require recipes-graphics/mesa/mesa.inc + +SUMMARY += " (with PowerVR support for TI platforms)" + +LIC_FILES_CHKSUM = "file://docs/license.rst;md5=63779ec98d78d823a9dc533a0735ef10" + +BRANCH = "powervr/${PV}" + +SRC_URI = " \ + git://gitlab.freedesktop.org/StaticRocket/mesa.git;protocol=https;branch=${BRANCH} \ + file://0001-meson.build-check-for-all-linux-host_os-combinations.patch \ + file://0001-meson-misdetects-64bit-atomics-on-mips-clang.patch \ + file://0001-gallium-Fix-build-with-llvm-17.patch \ + file://0001-meson-Disable-cmake-dependency-detector-for-llvm.patch \ +" + +S = "${WORKDIR}/git" + +PACKAGECONFIG:append = " \ + ${@bb.utils.contains('PREFERRED_PROVIDER_virtual/gpudriver', 'ti-img-rogue-driver', 'pvr', '', d)} \ + ${@bb.utils.contains('PREFERRED_PROVIDER_virtual/gpudriver', 'ti-sgx-ddk-km', 'sgx', '', d)} \ +" + +SRCREV = "b12290126ba6a154f0e8b0a8c8b2b0d64f98e427" + +PVR_DISPLAY_CONTROLLER_ALIAS ??= "tidss" +PACKAGECONFIG[pvr] = "-Dgallium-pvr-alias=${PVR_DISPLAY_CONTROLLER_ALIAS}," +PACKAGECONFIG[sgx] = "-Dgallium-sgx-alias=${PVR_DISPLAY_CONTROLLER_ALIAS}," + +PACKAGECONFIG:remove = "video-codecs" +PACKAGECONFIG[video-codecs] = "" +PACKAGECONFIG:remove = "elf-tls" +PACKAGECONFIG[elf-tls] = "" +PACKAGECONFIG:remove = "xvmc" +PACKAGECONFIG[xvmc] = "" + +PACKAGE_ARCH = "${MACHINE_ARCH}" + +GALLIUMDRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'pvr', ',pvr', '', d)}" +GALLIUMDRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'sgx', ',sgx', '', d)}" + +VULKAN_DRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'pvr', ',pvr', '', d)}" + +do_install:append () { + # remove pvr custom pkgconfig + rm -rf ${D}${datadir}/pkgconfig +} + +FILES:${PN}-dev += "${datadir}/mesa/wayland-drm.xml" +FILES:mesa-vulkan-drivers += "${libdir}/libpvr_mesa_wsi.so" + +RRECOMMENDS:mesa-megadriver:append:class-target = " ${@d.getVar('PREFERRED_PROVIDER_virtual/gpudriver')}" diff --git a/meta-ti-bsp/recipes-graphics/powervr-umlibs/ti-img-rogue-umlibs_23.3.6512818.bb b/meta-ti-bsp/recipes-graphics/powervr-umlibs/ti-img-rogue-umlibs_23.3.6512818.bb new file mode 100644 index 00000000..a0a9a295 --- /dev/null +++ b/meta-ti-bsp/recipes-graphics/powervr-umlibs/ti-img-rogue-umlibs_23.3.6512818.bb @@ -0,0 +1,145 @@ +DESCRIPTION = "Userspace libraries for PowerVR Rogue GPU on TI SoCs" +HOMEPAGE = "http://git.ti.com/graphics/ti-img-rogue-umlibs" +LICENSE = "TI-TFL" +LIC_FILES_CHKSUM = "file://${WORKDIR}/git/LICENSE;md5=7232b98c1c58f99e3baa03de5207e76f" + +inherit bin_package + +INHIBIT_DEFAULT_DEPS = "" + +PACKAGE_ARCH = "${MACHINE_ARCH}" +COMPATIBLE_MACHINE = "j721e|j721s2|j784s4|am62xx|am62pxx|j722s" + +PR = "r3" + +BRANCH = "linuxws/scarthgap/k6.6/${PV}" +SRC_URI = "git://git.ti.com/git/graphics/ti-img-rogue-umlibs.git;protocol=https;branch=${BRANCH}" +SRCREV = "0b9e64254269be2fa95c4f3e1dd925d6e4d58199" +S = "${WORKDIR}/git/targetfs/${TARGET_PRODUCT}/${PVR_WS}/${PVR_BUILD}" + +TARGET_PRODUCT:j721e = "j721e_linux" +TARGET_PRODUCT:j721s2 = "j721s2_linux" +TARGET_PRODUCT:j784s4 = "j784s4_linux" +TARGET_PRODUCT:am62xx = "am62_linux" +TARGET_PRODUCT:am62pxx = "am62p_linux" +TARGET_PRODUCT:j722s = "j722s_linux" +PVR_BUILD = "release" +PVR_WS = "lws-generic" + +RDEPENDS:${PN} = " \ + libdrm \ + ti-img-rogue-driver \ + ${PN}-firmware \ +" + +PACKAGECONFIG ?= " \ + ${@bb.utils.contains('DISTRO_FEATURES', 'vulkan wayland', 'vulkan', '', d)} \ + ${@bb.utils.filter('DISTRO_FEATURES', 'opengl opencl', d)} \ +" + +PACKAGECONFIG[opengl] = ",,,,${GLES_PACKAGES}" +PACKAGECONFIG[vulkan] = ",,,,${VULKAN_PACKAGES}" +PACKAGECONFIG[opencl] = ",,,,${OPENCL_PACKAGES}" + +def get_file_list(package_list_var, d): + file_list = [] + package_list = d.getVar(package_list_var) + prefix = f"{d.getVar('S')}/" + if package_list: + for package in package_list.split(): + package_file_string = d.getVar(f"FILES:{package}") + if package_file_string: + for package_file in package_file_string.split(): + file_list.append(f"{prefix}{package_file}") + return " ".join(file_list) + +do_install:prepend() { + if ${@bb.utils.contains('PACKAGECONFIG', 'opengl', 'false', 'true', d)}; then + for file in ${@get_file_list('GLES_PACKAGES', d)}; do + rm -rf ${file} + done + fi + if ${@bb.utils.contains('PACKAGECONFIG', 'vulkan', 'false', 'true', d)}; then + for file in ${@get_file_list('VULKAN_PACKAGES', d)}; do + rm -rf ${file} + done + fi + if ${@bb.utils.contains('PACKAGECONFIG', 'opencl', 'false', 'true', d)}; then + for file in ${@get_file_list('OPENCL_PACKAGES', d)}; do + rm -rf ${file} + done + fi + if ${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', 'true', 'false', d)}; then + if [ -e ${S}/lib/firmware ]; then + mv ${S}/lib/firmware ${S}${nonarch_base_libdir} + fi + fi + + # clean up any empty directories + find "${S}" -empty -type d -delete +} + +GLES_PACKAGES = "libgles1-rogue libgles2-rogue libgles3-rogue" +VULKAN_PACKAGES = "libvk-rogue" +OPENCL_PACKAGES = "libopencl-rogue libopencl-rogue-tools" + +PACKAGES = " \ + ${@bb.utils.contains('PACKAGECONFIG', 'opengl', d.getVar('GLES_PACKAGES'), '', d)} \ + ${@bb.utils.contains('PACKAGECONFIG', 'vulkan', d.getVar('VULKAN_PACKAGES'), '', d)} \ + ${@bb.utils.contains('PACKAGECONFIG', 'opencl', d.getVar('OPENCL_PACKAGES'), '', d)} \ + ${PN}-tools \ + ${PN}-firmware \ + ${PN} \ +" + +# Inject variables so that packages don't get Debian-renamed (which would +# remove the -rogue suffix), but don't RPROVIDEs/RCONFLICTs on the generic +# libgl name to prevent colliding with swrast libs +python __anonymous() { + suffix = "" + if "-native" in d.getVar("PN"): + suffix = "-native" + for p in (("vulkan", "libvk",), + ("gles", "libgles1", "libglesv1-cm1"), + ("gles", "libgles2", "libglesv2-2"), + ("gles", "libgles3",), + ("opencl", "libopencl",)): + mlprefix = d.getVar("MLPREFIX") + fullp = mlprefix + p[1] + "-rogue" + suffix + mlprefix = d.getVar("MLPREFIX") + pkgs = " " + " ".join(mlprefix + x + suffix for x in p[1:]) + d.setVar("DEBIAN_NOAUTONAME:" + fullp, "1") + d.setVar("INSANE_SKIP:" + fullp, "dev-so") + d.appendVar("RRECOMMENDS:" + fullp, " ${MLPREFIX}ti-img-rogue-umlibs" + suffix) +} + +# gles specific shared objects +FILES:libgles1-rogue = "${libdir}/libGLESv1*.so*" +FILES:libgles2-rogue = "${libdir}/libGLESv2*.so*" +RDEPENDS:libgles1-rogue += "mesa-megadriver" +RDEPENDS:libgles2-rogue += "mesa-megadriver" + +# vulkan specific shared objects and configs +FILES:libvk-rogue = "${libdir}/libVK_IMG.so* ${datadir}/vulkan" +RDEPENDS:libvk-rogue += "vulkan-loader wayland libdrm" + +# opencl specific shared objects and configs +FILES:libopencl-rogue = "${libdir}/libPVROCL.so* ${sysconfdir}/OpenCL" +RDEPENDS:libopencl-rogue += "opencl-icd-loader" +RRECOMMENDS:libopencl-rogue += "libopencl-rogue-tools" +FILES:libopencl-rogue-tools += "${bindir}/ocl*" +DEBIAN_NOAUTONAME:libopencl-rogue-tools = "1" + +# optional tools and tests +FILES:${PN}-tools = "${bindir}/" +RDEPENDS:${PN}-tools = "python3-core ${PN}" + +# required firmware +FILES:${PN}-firmware = "${base_libdir}/firmware/*" +INSANE_SKIP:${PN}-firmware += "arch" + +RRECOMMENDS:${PN} += " \ + ${PN}-tools \ +" + +INSANE_SKIP:${PN} += "already-stripped dev-so" diff --git a/meta-ti-bsp/recipes-graphics/powervr-umlibs/ti-img-rogue-umlibs_24.1.6554834.bb b/meta-ti-bsp/recipes-graphics/powervr-umlibs/ti-img-rogue-umlibs_24.1.6554834.bb new file mode 100644 index 00000000..d43d1635 --- /dev/null +++ b/meta-ti-bsp/recipes-graphics/powervr-umlibs/ti-img-rogue-umlibs_24.1.6554834.bb @@ -0,0 +1,148 @@ +DESCRIPTION = "Userspace libraries for PowerVR Rogue GPU on TI SoCs" +HOMEPAGE = "http://git.ti.com/graphics/ti-img-rogue-umlibs" +LICENSE = "TI-TFL" +LIC_FILES_CHKSUM = "file://${WORKDIR}/git/LICENSE;md5=7232b98c1c58f99e3baa03de5207e76f" + +DEFAULT_PREFERENCE = "-1" + +inherit bin_package + +INHIBIT_DEFAULT_DEPS = "" + +PACKAGE_ARCH = "${MACHINE_ARCH}" +COMPATIBLE_MACHINE = "j721e|j721s2|j784s4|am62xx|am62pxx|j722s" + +PR = "r3" + +BRANCH = "linuxws/scarthgap/k6.6/${PV}" +SRC_URI = "git://git.ti.com/git/graphics/ti-img-rogue-umlibs.git;protocol=https;branch=${BRANCH}" +SRCREV = "e473234158c736248cf71a60080b7faf76fca561" +S = "${WORKDIR}/git/targetfs/${TARGET_PRODUCT}/${PVR_WS}/${PVR_BUILD}" + +TARGET_PRODUCT:j721e = "j721e_linux" +TARGET_PRODUCT:j721s2 = "j721s2_linux" +TARGET_PRODUCT:j784s4 = "j784s4_linux" +TARGET_PRODUCT:am62xx = "am62_linux" +TARGET_PRODUCT:am62pxx = "am62p_linux" +TARGET_PRODUCT:j722s = "j722s_linux" +PVR_BUILD = "release" +PVR_WS = "lws-generic" + +RDEPENDS:${PN} = " \ + libdrm \ + ti-img-rogue-driver \ + ${PN}-firmware \ +" + +PACKAGECONFIG ?= " \ + ${@bb.utils.contains('DISTRO_FEATURES', 'vulkan wayland', 'vulkan', '', d)} \ + ${@bb.utils.filter('DISTRO_FEATURES', 'opengl opencl', d)} \ +" + +PACKAGECONFIG[opengl] = ",,,,${GLES_PACKAGES}" +PACKAGECONFIG[vulkan] = ",,,,${VULKAN_PACKAGES}" +PACKAGECONFIG[opencl] = ",,,,${OPENCL_PACKAGES}" + +def get_file_list(package_list_var, d): + file_list = [] + package_list = d.getVar(package_list_var) + prefix = f"{d.getVar('S')}/" + if package_list: + for package in package_list.split(): + package_file_string = d.getVar(f"FILES:{package}") + if package_file_string: + for package_file in package_file_string.split(): + file_list.append(f"{prefix}{package_file}") + return " ".join(file_list) + +do_install:prepend() { + if ${@bb.utils.contains('PACKAGECONFIG', 'opengl', 'false', 'true', d)}; then + for file in ${@get_file_list('GLES_PACKAGES', d)}; do + rm -rf ${file} + done + fi + if ${@bb.utils.contains('PACKAGECONFIG', 'vulkan', 'false', 'true', d)}; then + for file in ${@get_file_list('VULKAN_PACKAGES', d)}; do + rm -rf ${file} + done + fi + if ${@bb.utils.contains('PACKAGECONFIG', 'opencl', 'false', 'true', d)}; then + for file in ${@get_file_list('OPENCL_PACKAGES', d)}; do + rm -rf ${file} + done + fi + if ${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', 'true', 'false', d)}; then + if [ -e ${S}/lib/firmware ]; then + mv ${S}/lib/firmware ${S}${nonarch_base_libdir} + fi + fi + + # clean up any empty directories + find "${S}" -empty -type d -delete +} + +GLES_PACKAGES = "libgles1-rogue libgles2-rogue libgles3-rogue" +VULKAN_PACKAGES = "libvk-rogue" +OPENCL_PACKAGES = "libopencl-rogue libopencl-rogue-tools" + +PACKAGES = " \ + ${@bb.utils.contains('PACKAGECONFIG', 'opengl', d.getVar('GLES_PACKAGES'), '', d)} \ + ${@bb.utils.contains('PACKAGECONFIG', 'vulkan', d.getVar('VULKAN_PACKAGES'), '', d)} \ + ${@bb.utils.contains('PACKAGECONFIG', 'opencl', d.getVar('OPENCL_PACKAGES'), '', d)} \ + ${PN}-tools \ + ${PN}-firmware \ + ${PN} \ +" + +# Inject variables so that packages don't get Debian-renamed (which would +# remove the -rogue suffix), but don't RPROVIDEs/RCONFLICTs on the generic +# libgl name to prevent colliding with swrast libs +python __anonymous() { + suffix = "" + if "-native" in d.getVar("PN"): + suffix = "-native" + for p in (("vulkan", "libvk",), + ("gles", "libgles1", "libglesv1-cm1"), + ("gles", "libgles2", "libglesv2-2"), + ("gles", "libgles3",), + ("opencl", "libopencl",)): + mlprefix = d.getVar("MLPREFIX") + fullp = mlprefix + p[1] + "-rogue" + suffix + mlprefix = d.getVar("MLPREFIX") + pkgs = " " + " ".join(mlprefix + x + suffix for x in p[1:]) + d.setVar("DEBIAN_NOAUTONAME:" + fullp, "1") + d.setVar("INSANE_SKIP:" + fullp, "dev-so ldflags") + d.appendVar("RRECOMMENDS:" + fullp, " ${MLPREFIX}ti-img-rogue-umlibs" + suffix) +} + +# gles specific shared objects +FILES:libgles1-rogue = "${libdir}/libGLESv1*.so*" +FILES:libgles2-rogue = "${libdir}/libGLESv2*.so*" +RDEPENDS:libgles1-rogue += "mesa-megadriver" +RDEPENDS:libgles2-rogue += "mesa-megadriver" + +# vulkan specific shared objects and configs +FILES:libvk-rogue = "${libdir}/libVK_IMG.so* ${datadir}/vulkan" +RDEPENDS:libvk-rogue += "vulkan-loader wayland libdrm" + +# opencl specific shared objects and configs +FILES:libopencl-rogue = "${libdir}/libPVROCL.so* ${sysconfdir}/OpenCL" +RDEPENDS:libopencl-rogue += "opencl-icd-loader" +RRECOMMENDS:libopencl-rogue += "libopencl-rogue-tools" +FILES:libopencl-rogue-tools += "${bindir}/ocl*" +DEBIAN_NOAUTONAME:libopencl-rogue-tools = "1" + +# optional tools and tests +FILES:${PN}-tools = "${bindir}/" +RDEPENDS:${PN}-tools = "python3-core libdrm ${PN}" +INSANE_SKIP:${PN}-tools = "ldflags" + +# required firmware +FILES:${PN}-firmware = "${base_libdir}/firmware/*" +INSANE_SKIP:${PN}-firmware += "arch" + +RRECOMMENDS:${PN} += " \ + ${PN}-tools \ +" + +INSANE_SKIP:${PN} += "already-stripped dev-so ldflags" diff --git a/meta-ti-bsp/recipes-graphics/powervr-umlibs/ti-sgx-ddk-um_1.17.4948957.bb b/meta-ti-bsp/recipes-graphics/powervr-umlibs/ti-sgx-ddk-um_1.17.4948957.bb new file mode 100644 index 00000000..d2565318 --- /dev/null +++ b/meta-ti-bsp/recipes-graphics/powervr-umlibs/ti-sgx-ddk-um_1.17.4948957.bb @@ -0,0 +1,58 @@ +DESCRIPTION = "Userspace libraries for PowerVR SGX chipset on TI SoCs" +HOMEPAGE = "https://git.ti.com/graphics/omap5-sgx-ddk-um-linux" +LICENSE = "TI-TSPA" +LIC_FILES_CHKSUM = "file://LICENSE;md5=7232b98c1c58f99e3baa03de5207e76f" + +PACKAGE_ARCH = "${MACHINE_ARCH}" +COMPATIBLE_MACHINE = "ti33x|ti43x|omap-a15|am65xx" + +PR = "r38" + +BRANCH = "${PV}/mesa/glibc-2.35" + +SRC_URI = " \ + git://git.ti.com/git/graphics/omap5-sgx-ddk-um-linux.git;protocol=https;branch=${BRANCH} \ +" +SRCREV = "70364424dd496833fad5b243c9e6cc8b077f04ac" + +INITSCRIPT_NAME = "rc.pvr" +INITSCRIPT_PARAMS = "defaults 8" + +PACKAGECONFIG ??= "udev" +PACKAGECONFIG[udev] = "UDEV=true,,,udev" + +def use_sysvinit(d): + return d.getVar('VIRTUAL-RUNTIME_init_manager') == 'sysvinit' + +inherit ${@oe.utils.ifelse(use_sysvinit(d), 'update-rc.d', '')} + +TARGET_PRODUCT:ti33x = "ti335x_linux" +TARGET_PRODUCT:ti43x = "ti437x_linux" +TARGET_PRODUCT:omap-a15 = "ti572x_linux" +TARGET_PRODUCT:am65xx = "ti654x_linux" + +RDEPENDS:${PN} += "libdrm" + +RRECOMMENDS:${PN} += "ti-sgx-ddk-km" + +S = "${WORKDIR}/git" + +EXTRA_OEMAKE += "DESTDIR=${D} TARGET_PRODUCT=${TARGET_PRODUCT} ${PACKAGECONFIG_CONFARGS}" + +do_install() { + oe_runmake install +} + +FILES:${PN} = "${bindir}/*" +FILES:${PN} += " ${libdir}/*" +FILES:${PN} += "${includedir}/*" +FILES:${PN} += "${sysconfdir}/*" +FILES:${PN} += "${datadir}/*" +FILES:${PN} += "${nonarch_base_libdir}/udev/rules.d" +FILES:${PN} += "${nonarch_base_libdir}/systemd/system" + +# No debug or dev packages for this recipe +PACKAGES = "${PN}" + +INSANE_SKIP:${PN} += "ldflags" +INSANE_SKIP:${PN} += "already-stripped dev-so" |