From patchwork Thu Jan 19 01:03:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denys Dmytriyenko X-Patchwork-Id: 18294 X-Patchwork-Delegate: reatmon@ti.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7D49FC38159 for ; Thu, 19 Jan 2023 01:03:37 +0000 (UTC) Received: from mailout4.zoneedit.com (mailout4.zoneedit.com [64.68.198.64]) by mx.groups.io with SMTP id smtpd.web11.34994.1674090215852198947 for ; Wed, 18 Jan 2023 17:03:36 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=none, err=permanent DNS error (domain: denix.org, ip: 64.68.198.64, mailfrom: denis@denix.org) Received: from localhost (localhost [127.0.0.1]) by mailout4.zoneedit.com (Postfix) with ESMTP id 9759A40C52 for ; Thu, 19 Jan 2023 01:03:34 +0000 (UTC) Received: from mailout4.zoneedit.com ([127.0.0.1]) by localhost (zmo14-pco.easydns.vpn [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id OJ3I3h5fLcSS for ; Thu, 19 Jan 2023 01:03:34 +0000 (UTC) Received: from mail.denix.org (pool-100-15-88-116.washdc.fios.verizon.net [100.15.88.116]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mailout4.zoneedit.com (Postfix) with ESMTPSA id 826A240C2B for ; Thu, 19 Jan 2023 01:03:34 +0000 (UTC) Received: from thorin.denix (thorin.denix [192.168.30.9]) by mail.denix.org (Postfix) with ESMTP id 2FCB61636FE for ; Wed, 18 Jan 2023 20:03:15 -0500 (EST) From: Denys Dmytriyenko To: meta-ti@lists.yoctoproject.org Subject: [PATCH] meta-ti-bsp: Graphics recipe overhaul Date: Thu, 19 Jan 2023 01:03:33 +0000 Message-Id: <20230119010333.3414485-1-denis@denix.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 19 Jan 2023 01:03:37 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/meta-ti/message/15590 From: Randolph Sapp Individually package rogue graphics components to prevent conflicts with other recipes. The package ti-img-rogue-umlibs will now distribute the window system agnostic components of the DDK. This being the IMG's implementations of OpenGLES, OpenCL, and Vulkan in binary format and the device firmware. These are the only components that cannot be open source currently. The mesa component is currently piggybacking off the default mesa package. It's not elegant, but it reflects the implementation well and allows users to config mesa as needed. This all hinges off of the new rogue-gpu machine feature. Signed-off-by: Randolph Sapp Signed-off-by: Ryan Eatmon Signed-off-by: Denys Dmytriyenko --- meta-ti-bsp/conf/machine/include/am62xx.inc | 8 +-- meta-ti-bsp/conf/machine/include/j721e.inc | 8 +-- meta-ti-bsp/conf/machine/include/j721s2.inc | 8 +-- ...-OpenEmbedded-nodistro-internal-aarc.patch | 29 --------- ...bb => ti-img-rogue-driver_1.18.6276027.bb} | 12 ++-- ...bb => ti-img-rogue-umlibs_1.18.6276027.bb} | 63 +++++-------------- .../recipes-graphics/mesa/mesa_%.bbappend | 2 + .../recipes-graphics/mesa/rogue-mesa.inc | 29 +++++++++ 8 files changed, 54 insertions(+), 105 deletions(-) delete mode 100644 meta-ti-bsp/recipes-bsp/powervr-drivers/ti-img-rogue-driver/0001-compiler-support-OpenEmbedded-nodistro-internal-aarc.patch rename meta-ti-bsp/recipes-bsp/powervr-drivers/{ti-img-rogue-driver_1.15.6133109.bb => ti-img-rogue-driver_1.18.6276027.bb} (77%) rename meta-ti-bsp/recipes-graphics/libgles/{ti-img-rogue-umlibs_1.15.6133109.bb => ti-img-rogue-umlibs_1.18.6276027.bb} (24%) create mode 100644 meta-ti-bsp/recipes-graphics/mesa/mesa_%.bbappend create mode 100644 meta-ti-bsp/recipes-graphics/mesa/rogue-mesa.inc diff --git a/meta-ti-bsp/conf/machine/include/am62xx.inc b/meta-ti-bsp/conf/machine/include/am62xx.inc index 411e5265..8635a630 100644 --- a/meta-ti-bsp/conf/machine/include/am62xx.inc +++ b/meta-ti-bsp/conf/machine/include/am62xx.inc @@ -1,17 +1,11 @@ require conf/machine/include/k3.inc SOC_FAMILY:append = ":am62xx" -MACHINE_FEATURES += "screen touchscreen gpu" +MACHINE_FEATURES += "screen touchscreen gpu rogue-gpu" SERIAL_CONSOLES = "115200;ttyS2" SERIAL_CONSOLES_CHECK = "${SERIAL_CONSOLES}" -PREFERRED_PROVIDER_virtual/egl ?= "ti-img-rogue-umlibs" -PREFERRED_PROVIDER_virtual/libgles1 ?= "ti-img-rogue-umlibs" -PREFERRED_PROVIDER_virtual/libgles2 ?= "ti-img-rogue-umlibs" -PREFERRED_PROVIDER_virtual/libgbm ?= "ti-img-rogue-umlibs" -PREFERRED_PROVIDER_virtual/gpudriver ?= "ti-img-rogue-driver" - TFA_BOARD = "lite" TFA_K3_SYSTEM_SUSPEND = "1" diff --git a/meta-ti-bsp/conf/machine/include/j721e.inc b/meta-ti-bsp/conf/machine/include/j721e.inc index 6322fe46..e71782a7 100644 --- a/meta-ti-bsp/conf/machine/include/j721e.inc +++ b/meta-ti-bsp/conf/machine/include/j721e.inc @@ -1,13 +1,7 @@ require conf/machine/include/k3.inc SOC_FAMILY:append = ":j721e" -MACHINE_FEATURES += "gpu" - -PREFERRED_PROVIDER_virtual/egl ?= "ti-img-rogue-umlibs" -PREFERRED_PROVIDER_virtual/libgles1 ?= "ti-img-rogue-umlibs" -PREFERRED_PROVIDER_virtual/libgles2 ?= "ti-img-rogue-umlibs" -PREFERRED_PROVIDER_virtual/libgbm ?= "ti-img-rogue-umlibs" -PREFERRED_PROVIDER_virtual/gpudriver ?= "ti-img-rogue-driver" +MACHINE_FEATURES += "gpu rogue-gpu" # On J721e the file tiboot3.bin comes from the bootloader not ti-sci-fw do_image_wic[mcdepends] += "mc::k3r5:virtual/bootloader:do_deploy" diff --git a/meta-ti-bsp/conf/machine/include/j721s2.inc b/meta-ti-bsp/conf/machine/include/j721s2.inc index fc6493b8..15f2a506 100644 --- a/meta-ti-bsp/conf/machine/include/j721s2.inc +++ b/meta-ti-bsp/conf/machine/include/j721s2.inc @@ -1,13 +1,7 @@ require conf/machine/include/k3.inc SOC_FAMILY:append = ":j721s2" -MACHINE_FEATURES += "gpu" - -PREFERRED_PROVIDER_virtual/egl ?= "ti-img-rogue-umlibs" -PREFERRED_PROVIDER_virtual/libgles1 ?= "ti-img-rogue-umlibs" -PREFERRED_PROVIDER_virtual/libgles2 ?= "ti-img-rogue-umlibs" -PREFERRED_PROVIDER_virtual/libgbm ?= "ti-img-rogue-umlibs" -PREFERRED_PROVIDER_virtual/gpudriver ?= "ti-img-rogue-driver" +MACHINE_FEATURES += "gpu rogue-gpu" TFA_BOARD = "generic" diff --git a/meta-ti-bsp/recipes-bsp/powervr-drivers/ti-img-rogue-driver/0001-compiler-support-OpenEmbedded-nodistro-internal-aarc.patch b/meta-ti-bsp/recipes-bsp/powervr-drivers/ti-img-rogue-driver/0001-compiler-support-OpenEmbedded-nodistro-internal-aarc.patch deleted file mode 100644 index f021cc39..00000000 --- a/meta-ti-bsp/recipes-bsp/powervr-drivers/ti-img-rogue-driver/0001-compiler-support-OpenEmbedded-nodistro-internal-aarc.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 80d32fee3d768abbd77cce77ea9a7574651460a9 Mon Sep 17 00:00:00 2001 -From: Denys Dmytriyenko -Date: Wed, 7 Jul 2021 13:11:56 -0400 -Subject: [PATCH] compiler: support OpenEmbedded "nodistro" internal aarch64 - toolchain - -Upstream-Status: Pending - -Signed-off-by: Denys Dmytriyenko ---- - build/linux/config/compiler.mk | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/build/linux/config/compiler.mk b/build/linux/config/compiler.mk -index 53a0bef..d788579 100644 ---- a/build/linux/config/compiler.mk -+++ b/build/linux/config/compiler.mk -@@ -65,7 +65,7 @@ define calculate-compiler-preferred-target - ifneq ($$(filter i386-% i486-% i586-% i686-%,$$($(1)_compiler_preferred_target)),) - $(1)_compiler_preferred_target := i386-linux-gnu - endif -- ifneq ($$(filter aarch64-poky-linux,$$($(1)_compiler_preferred_target)),) -+ ifneq ($$(filter aarch64-oe-linux aarch64-poky-linux,$$($(1)_compiler_preferred_target)),) - $(1)_compiler_preferred_target := aarch64-linux-gnu - endif - ifneq ($$(filter armv7a-cros-linux-gnueabi armv7l-tizen-linux-gnueabi,$$($(1)_compiler_preferred_target)),) --- -2.7.4 - diff --git a/meta-ti-bsp/recipes-bsp/powervr-drivers/ti-img-rogue-driver_1.15.6133109.bb b/meta-ti-bsp/recipes-bsp/powervr-drivers/ti-img-rogue-driver_1.18.6276027.bb similarity index 77% rename from meta-ti-bsp/recipes-bsp/powervr-drivers/ti-img-rogue-driver_1.15.6133109.bb rename to meta-ti-bsp/recipes-bsp/powervr-drivers/ti-img-rogue-driver_1.18.6276027.bb index b4d19195..45df7c4b 100644 --- a/meta-ti-bsp/recipes-bsp/powervr-drivers/ti-img-rogue-driver_1.15.6133109.bb +++ b/meta-ti-bsp/recipes-bsp/powervr-drivers/ti-img-rogue-driver_1.18.6276027.bb @@ -11,29 +11,27 @@ MACHINE_KERNEL_PR:append = "b" PR = "${MACHINE_KERNEL_PR}" PACKAGE_ARCH = "${MACHINE_ARCH}" + COMPATIBLE_MACHINE = "j721e|j721s2|j784s4|am62xx" DEPENDS = "virtual/kernel" PROVIDES = "virtual/gpudriver" -BRANCH = "linuxws/dunfell/k5.10/${PV}_unified_fw_pagesize" +BRANCH = "linuxws/kirkstone/k5.10/${PV}" -SRC_URI = " \ - git://git.ti.com/git/graphics/ti-img-rogue-driver.git;protocol=https;branch=${BRANCH} \ - file://0001-compiler-support-OpenEmbedded-nodistro-internal-aarc.patch \ -" +SRC_URI = "git://git.ti.com/git/graphics/ti-img-rogue-driver.git;protocol=https;branch=${BRANCH}" S = "${WORKDIR}/git" -SRCREV = "c901804e8221d477983a6f7224a9cdc6e832f050" +SRCREV = "d575e4f64c95a3534e10e85da15bd303febf133f" TARGET_PRODUCT:j721e = "j721e_linux" TARGET_PRODUCT:j721s2 = "j721s2_linux" TARGET_PRODUCT:j784s4 = "j784s4_linux" TARGET_PRODUCT:am62xx = "am62_linux" PVR_BUILD = "release" -PVR_WS = "wayland" +PVR_WS = "lws-generic" EXTRA_OEMAKE += 'KERNELDIR="${STAGING_KERNEL_DIR}" BUILD=${PVR_BUILD} PVR_BUILD_DIR=${TARGET_PRODUCT} WINDOW_SYSTEM=${PVR_WS}' diff --git a/meta-ti-bsp/recipes-graphics/libgles/ti-img-rogue-umlibs_1.15.6133109.bb b/meta-ti-bsp/recipes-graphics/libgles/ti-img-rogue-umlibs_1.18.6276027.bb similarity index 24% rename from meta-ti-bsp/recipes-graphics/libgles/ti-img-rogue-umlibs_1.15.6133109.bb rename to meta-ti-bsp/recipes-graphics/libgles/ti-img-rogue-umlibs_1.18.6276027.bb index a665c614..0375b442 100644 --- a/meta-ti-bsp/recipes-graphics/libgles/ti-img-rogue-umlibs_1.15.6133109.bb +++ b/meta-ti-bsp/recipes-graphics/libgles/ti-img-rogue-umlibs_1.18.6276027.bb @@ -1,9 +1,9 @@ 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://LICENSE;md5=7232b98c1c58f99e3baa03de5207e76f" +LIC_FILES_CHKSUM = "file://${WORKDIR}/git/LICENSE;md5=7232b98c1c58f99e3baa03de5207e76f" -inherit features_check +inherit features_check bin_package REQUIRED_MACHINE_FEATURES = "gpu" @@ -12,60 +12,27 @@ COMPATIBLE_MACHINE = "j721e|j721s2|j784s4|am62xx" PR = "r2" -BRANCH = "linuxws/dunfell/k5.10/${PV}_unified_fw_pagesize" - +BRANCH = "linuxws/kirkstone/k5.10/${PV}" SRC_URI = "git://git.ti.com/git/graphics/ti-img-rogue-umlibs.git;protocol=https;branch=${BRANCH}" -SRCREV = "5977e82b96028f783d39c7219f016c1faf8dc5f5" +SRCREV = "51e598919641d51156a631efa5447124a3c0f543" +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" -PVR_BUILD ?= "release" -PVR_WS = "wayland" - -INITSCRIPT_NAME = "rc.pvr" -INITSCRIPT_PARAMS = "defaults 8" - -inherit update-rc.d - -PROVIDES += "virtual/egl virtual/libgles1 virtual/libgles2 virtual/libgbm" - -DEPENDS += "libdrm wayland expat" -RDEPENDS:${PN} += "bash" -RDEPENDS:${PN} += "wayland expat" - -RPROVIDES:${PN} = "libegl libgles1 libgles2 libgbm" -RPROVIDES:${PN}-dev = "libegl-dev libgles1-dev libgles2-dev libgbm-dev" -RPROVIDES:${PN}-dbg = "libegl-dbg libgles1-dbg libgles2-dbg" +PVR_BUILD = "release" +PVR_WS = "lws-generic" -RREPLACES:${PN} = "libegl libgles1 liblges2 libgbm" -RREPLACES:${PN}-dev = "libegl-dev libgles1-dev libgles2-dev libgbm-dev" -RREPLACES:${PN}-dbg = "libegl-dbg libgles1-dbg libgles2-dbg" +RDEPENDS:${PN} += "mesa-megadriver libdrm ti-img-rogue-driver" -RCONFLICTS:${PN} = "libegl libgles1 libgles2 libgbm" -RCONFLICTS:${PN}-dev = "libegl-dev libgles1-dev libgles2-dev libgbm-dev" -RCONFLICTS:${PN}-dbg = "libegl-dbg libgles1-dbg libgles2-dbg" - -RRECOMMENDS:${PN} += "ti-img-rogue-driver" - -S = "${WORKDIR}/git" - -do_install () { - oe_runmake install DESTDIR=${D} TARGET_PRODUCT=${TARGET_PRODUCT} BUILD=${PVR_BUILD} WINDOW_SYSTEM=${PVR_WS} - chown -R root:root ${D} +do_install:append() { + rm -rf "${D}/etc/init.d" } -FILES:${PN} += " ${nonarch_base_libdir}/firmware/" -FILES:${PN} += " ${datadir}/" - -PACKAGES =+ "${PN}-plugins" -FILES:${PN}-plugins = "${libdir}/libGLESv2.so ${libdir}/libGLESv1_CM.so ${libdir}/libEGL.so ${libdir}/dri/pvr_dri.so" -RDEPENDS:${PN} += "${PN}-plugins" - -ALLOW_EMPTY:${PN}-plugins = "1" - -INSANE_SKIP:${PN} += "ldflags arch already-stripped" -INSANE_SKIP:${PN}-plugins = "dev-so" +PACKAGES = "${PN}-tools ${PN}" +FILES:${PN}-tools = "${bindir}/" +RDEPENDS:${PN}-tools = "python3-core" +RRECOMMENDS:${PN} += "${PN}-tools" -CLEANBROKEN = "1" +INSANE_SKIP:${PN} += "ldflags arch already-stripped dev-so" diff --git a/meta-ti-bsp/recipes-graphics/mesa/mesa_%.bbappend b/meta-ti-bsp/recipes-graphics/mesa/mesa_%.bbappend new file mode 100644 index 00000000..c367cb7e --- /dev/null +++ b/meta-ti-bsp/recipes-graphics/mesa/mesa_%.bbappend @@ -0,0 +1,2 @@ +# Apply rogue driver overrides if applicable +require ${@bb.utils.contains('MACHINE_FEATURES', 'rogue-gpu', 'rogue-mesa.inc', '', d)} diff --git a/meta-ti-bsp/recipes-graphics/mesa/rogue-mesa.inc b/meta-ti-bsp/recipes-graphics/mesa/rogue-mesa.inc new file mode 100644 index 00000000..c5002fa7 --- /dev/null +++ b/meta-ti-bsp/recipes-graphics/mesa/rogue-mesa.inc @@ -0,0 +1,29 @@ +# Rogue graphics related mesa overrides + +BRANCH = "rogue/kirkstone/pvr-1.18/22.0" + +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://0002-meson.build-make-TLS-ELF-optional.patch \ + file://0001-meson-misdetects-64bit-atomics-on-mips-clang.patch \ + file://0001-futex.h-Define-__NR_futex-if-it-does-not-exist.patch \ + file://0001-util-format-Check-for-NEON-before-using-it.patch \ + file://0001-Revert-egl-wayland-deprecate-drm_handle_format-and-d.patch \ + " + +S = "${WORKDIR}/git" + +SRCREV = "fddf5106f04de2bd35892d30e5574c0b2881edd9" + +PV:append = "+rogue" + +GALLIUMDRIVERS:append = ",pvr" + +EXTRA_OEMESON:append = " -Dgallium-pvr-alias=tidss" + +do_install:append () { + # remove pvr custom pkgconfig + rm -rf ${D}${datadir}/pkgconfig +} + +RRECOMMENDS:mesa-megadriver:class-target += "ti-img-rogue-driver ti-img-rogue-umlibs"