Skip to contentSkip to conversation

meta-ti-bsp: Graphics recipe overhaul

PATCH Superseded Randolph Sapp 4 participants 15 messages Dec 6, 2022 – Jan 11, 2023 Arm/Amlogic Meson SoC support

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 meta-ti-bsp: Graphics recipe overhaul

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.

---
 meta-ti-bsp/conf/machine/include/am62xx.inc   |   4 -
 meta-ti-bsp/conf/machine/include/j721e.inc    |   4 -
 meta-ti-bsp/conf/machine/include/j721s2.inc   |   4 -
 ...-OpenEmbedded-nodistro-internal-aarc.patch |  29 --
 ...bb => ti-img-rogue-driver_1.18.6276027.bb} |  12 +-
 .../ti-img-rogue-umlibs_1.15.6133109.bb       |  71 ----
 .../ti-img-rogue-umlibs_1.18.6276027.bb       |  55 +++
 ...nd-deprecate-drm_handle_format-and-d.patch | 158 +++++++++
 ...fine-__NR_futex-if-it-does-not-exist.patch |  34 ++
 ...sdetects-64bit-atomics-on-mips-clang.patch |  25 ++
 ...k-for-all-linux-host_os-combinations.patch |  43 +++
 ...ormat-Check-for-NEON-before-using-it.patch |  47 +++
 ...02-meson.build-make-TLS-ELF-optional.patch |  61 ++++
 .../recipes-graphics/mesa/mesa-gl_22.0.3.bb   |  13 +
 .../recipes-graphics/mesa/mesa_22.0.3.bb      |   1 +
 .../recipes-graphics/mesa/rogue-mesa.inc      |  28 ++
 .../recipes-graphics/mesa/vanilla-mesa.inc    | 320 ++++++++++++++++++
 17 files changed, 790 insertions(+), 119 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%)
 delete mode 100644 meta-ti-bsp/recipes-graphics/libgles/ti-img-rogue-umlibs_1.15.6133109.bb
 create mode 100644 meta-ti-bsp/recipes-graphics/libgles/ti-img-rogue-umlibs_1.18.6276027.bb
 create mode 100644 meta-ti-bsp/recipes-graphics/mesa/files/0001-Revert-egl-wayland-deprecate-drm_handle_format-and-d.patch
 create mode 100644 meta-ti-bsp/recipes-graphics/mesa/files/0001-futex.h-Define-__NR_futex-if-it-does-not-exist.patch
 create mode 100644 meta-ti-bsp/recipes-graphics/mesa/files/0001-meson-misdetects-64bit-atomics-on-mips-clang.patch
 create mode 100644 meta-ti-bsp/recipes-graphics/mesa/files/0001-meson.build-check-for-all-linux-host_os-combinations.patch
 create mode 100644 meta-ti-bsp/recipes-graphics/mesa/files/0001-util-format-Check-for-NEON-before-using-it.patch
 create mode 100644 meta-ti-bsp/recipes-graphics/mesa/files/0002-meson.build-make-TLS-ELF-optional.patch
 create mode 100644 meta-ti-bsp/recipes-graphics/mesa/mesa-gl_22.0.3.bb
 create mode 100644 meta-ti-bsp/recipes-graphics/mesa/mesa_22.0.3.bb
 create mode 100644 meta-ti-bsp/recipes-graphics/mesa/rogue-mesa.inc
 create mode 100644 meta-ti-bsp/recipes-graphics/mesa/vanilla-mesa.inc
meta-ti-bsp/conf/machine/include/am62xx.inc +0 -4
index a5aad994..3dc70b9b 100644
@@ -6,10 +6,6 @@ MACHINE_FEATURES += "screen touchscreen 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"
 
 do_image_wic[mcdepends] = "mc::k3r5:ti-sci-fw:do_deploy"
meta-ti-bsp/conf/machine/include/j721e.inc +0 -4
index fe260178..387a6407 100644
@@ -3,8 +3,4 @@ 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"
meta-ti-bsp/conf/machine/include/j721s2.inc +0 -4
index 5cd74683..10d639fe 100644
@@ -3,8 +3,4 @@ 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"
meta-ti-bsp/recipes-bsp/powervr-drivers/ti-img-rogue-driver/0001-compiler-support-OpenEmbedded-nodistro-internal-aarc.patch deleted +0 -29
deleted file mode 100644
index f021cc39..00000000
@@ -1,29 +0,0 @@
-From 80d32fee3d768abbd77cce77ea9a7574651460a9 Mon Sep 17 00:00:00 2001
-From: Denys Dmytriyenko <[email protected]>
-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 <[email protected]>
----
- 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
-
meta-ti-bsp/recipes-bsp/powervr-drivers/ti-img-rogue-driver_1.18.6276027.bb renamed from meta-ti-bsp/recipes-bsp/powervr-drivers/ti-img-rogue-driver_1.15.6133109.bb +5 -7
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
@@ -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}'
 
meta-ti-bsp/recipes-graphics/libgles/ti-img-rogue-umlibs_1.15.6133109.bb deleted +0 -71

71 lines not on this page · raw message

meta-ti-bsp/recipes-graphics/libgles/ti-img-rogue-umlibs_1.18.6276027.bb new file +55 -0

55 lines not on this page · raw message

meta-ti-bsp/recipes-graphics/mesa/files/0001-Revert-egl-wayland-deprecate-drm_handle_format-and-d.patch new file +158 -0

158 lines not on this page · raw message

meta-ti-bsp/recipes-graphics/mesa/files/0001-futex.h-Define-__NR_futex-if-it-does-not-exist.patch new file +34 -0
new file mode 100644
index 00000000..3b0bfa32
@@ -0,0 +1,34 @@
+From 253b042d2bf10e9abfa9cc508e0782aefd834145 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Fri, 16 Oct 2020 11:03:47 -0700
+Subject: [PATCH] futex.h: Define __NR_futex if it does not exist
+
+__NR_futex is not defines by newer architectures e.g. arc, riscv32 as
+they only have 64bit variant of time_t. Glibc defines SYS_futex interface based on
+__NR_futex, since this is used in applications, such applications start
+to fail to build for these newer architectures. This patch defines a
+fallback to alias __NR_futex to __NR_futex_tim64 so SYS_futex keeps
+working
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+
+---
+ src/util/futex.h | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/util/futex.h b/src/util/futex.h
+index 43097f4..941b0ec 100644
+--- a/src/util/futex.h
++++ b/src/util/futex.h
+@@ -34,6 +34,10 @@
+ #include <sys/syscall.h>
+ #include <sys/time.h>
+ 
++#if !defined(SYS_futex) && defined(SYS_futex_time64)
++# define SYS_futex SYS_futex_time64
++#endif
++
+ static inline long sys_futex(void *addr1, int op, int val1, const struct timespec *timeout, void *addr2, int val3)
+ {
+    return syscall(SYS_futex, addr1, op, val1, timeout, addr2, val3);
meta-ti-bsp/recipes-graphics/mesa/files/0001-meson-misdetects-64bit-atomics-on-mips-clang.patch new file +25 -0
new file mode 100644
index 00000000..b08e4d86
@@ -0,0 +1,25 @@
+From d34bdbd80e5a1f309d2ba280cdc66ff0ee0e5c43 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+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 <[email protected]>
+
+---
+ 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>
meta-ti-bsp/recipes-graphics/mesa/files/0001-meson.build-check-for-all-linux-host_os-combinations.patch new file +43 -0

43 lines not on this page · raw message

meta-ti-bsp/recipes-graphics/mesa/files/0001-util-format-Check-for-NEON-before-using-it.patch new file +47 -0

47 lines not on this page · raw message

meta-ti-bsp/recipes-graphics/mesa/files/0002-meson.build-make-TLS-ELF-optional.patch new file +61 -0

61 lines not on this page · raw message

meta-ti-bsp/recipes-graphics/mesa/mesa-gl_22.0.3.bb new file +13 -0
new file mode 100644
index 00000000..bc87e9fc
@@ -0,0 +1,13 @@
+require ${@ 'rogue' if d.getVar('PREFERRED_PROVIDER_virtual/gpudriver') == 'ti-img-rogue-driver' else 'vanilla' }-mesa.inc
+
+SUMMARY += " (OpenGL only, no EGL/GLES)"
+
+PROVIDES = "virtual/libgl virtual/mesa"
+
+S = "${WORKDIR}/mesa-${PV}"
+
+# At least one DRI rendering engine is required to build mesa.
+# When no X11 is available, use osmesa for the rendering engine.
+PACKAGECONFIG ??= "opengl ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', 'osmesa gallium', d)}"
+PACKAGECONFIG:class-target = "opengl ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', 'osmesa gallium', d)}"
+
meta-ti-bsp/recipes-graphics/mesa/mesa_22.0.3.bb new file +1 -0
new file mode 100644
index 00000000..53f8e6e5
@@ -0,0 +1 @@
+require ${@ 'rogue' if d.getVar('PREFERRED_PROVIDER_virtual/gpudriver') == 'ti-img-rogue-driver' else 'vanilla' }-mesa.inc
meta-ti-bsp/recipes-graphics/mesa/rogue-mesa.inc new file +28 -0
new file mode 100644
index 00000000..23fc708b
@@ -0,0 +1,28 @@
+require vanilla-mesa.inc
+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 += "ti-img-rogue-driver ti-img-rogue-umlibs"
meta-ti-bsp/recipes-graphics/mesa/vanilla-mesa.inc new file +320 -0

320 lines not on this page · raw message

Signature · 1 line
2.34.1
#1 lore raw
Quoted 38 lines · 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.

---
  meta-ti-bsp/conf/machine/include/am62xx.inc   |   4 -
  meta-ti-bsp/conf/machine/include/j721e.inc    |   4 -
  meta-ti-bsp/conf/machine/include/j721s2.inc   |   4 -
  ...-OpenEmbedded-nodistro-internal-aarc.patch |  29 --
  ...bb => ti-img-rogue-driver_1.18.6276027.bb} |  12 +-
  .../ti-img-rogue-umlibs_1.15.6133109.bb       |  71 ----
  .../ti-img-rogue-umlibs_1.18.6276027.bb       |  55 +++
  ...nd-deprecate-drm_handle_format-and-d.patch | 158 +++++++++
  ...fine-__NR_futex-if-it-does-not-exist.patch |  34 ++
  ...sdetects-64bit-atomics-on-mips-clang.patch |  25 ++
  ...k-for-all-linux-host_os-combinations.patch |  43 +++
  ...ormat-Check-for-NEON-before-using-it.patch |  47 +++
  ...02-meson.build-make-TLS-ELF-optional.patch |  61 ++++
  .../recipes-graphics/mesa/mesa-gl_22.0.3.bb   |  13 +
  .../recipes-graphics/mesa/mesa_22.0.3.bb      |   1 +
  .../recipes-graphics/mesa/rogue-mesa.inc      |  28 ++
  .../recipes-graphics/mesa/vanilla-mesa.inc    | 320 ++++++++++++++++++
  17 files changed, 790 insertions(+), 119 deletions(-)

meta-ti-bsp/recipes-graphics/mesa/rogue-mesa.inc line 1

Quoted 1 line
meta-ti-bsp/recipes-graphics/mesa/rogue-mesa.inc new file +1 -0
@@ -0,0 +1,28 @@
+require vanilla-mesa.inc

This include logic seems a little convoluted. I think it might a little cleaner if the mesa.bb files just included somthing like mesa.inc (like how oe is packaged).

Rename vanilla-mesa.inc to just mesa.inc.

Then at the end of the mesa.inc you could simply have something like this:

# Apply rogue driver overrides if applicable
require ${@bb.utils.contains('PREFERRED_PROVIDER_virtual/gpudriver', 'ti-img-rogue-driver', 'rogue-mesa.inc', '', d)}

Quoted 17 lines
meta-ti-bsp/recipes-graphics/mesa/rogue-mesa.inc new file +17 -0
+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"
+

meta-ti-bsp/recipes-graphics/mesa/rogue-mesa.inc line 28

Quoted 10 lines
meta-ti-bsp/recipes-graphics/mesa/rogue-mesa.inc new file +10 -0
+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 += "ti-img-rogue-driver ti-img-rogue-umlibs"

This line needs to be:

RRECOMMENDS:class-target:mesa-megadriver += "ti-img-rogue-driver ti-img-rogue-umlibs"

Otherwise there are build dependency errors related to trying to build native/nativesdk versions of the rogue driver and umlibs, which we do not need/want to do.

Signature · 3 lines
Ryan Eatmon                [email protected]
-----------------------------------------
Texas Instruments, Inc.  -  LCPD  -  MGTS
#2 lore raw
In reply to Randolph Sapp

meta-ti-bsp/conf/machine/include/am62xx.inc MACHINE_FEATURES += "screen touchscreen gpu" · line 9

Quoted 7 lines · Randolph Sapp via lists.yoctoproject.org
meta-ti-bsp/conf/machine/include/am62xx.inc +0 -4
-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"

Since the UM driver now RDEPENDS on the KM, could we also drop this last line everywhere?

Quoted 29 lines
meta-ti-bsp/recipes-graphics/libgles/ti-img-rogue-umlibs_1.18.6276027.bb new file +23 -0
new file mode 100644
index 00000000..c9110053
@@ -0,0 +1,55 @@
+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"
+
+inherit features_check
+
+REQUIRED_MACHINE_FEATURES = "gpu"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+COMPATIBLE_MACHINE = "j721e|j721s2|j784s4|am62xx"
+
+PR = "r2"
+
+BRANCH = "linuxws/kirkstone/k5.10/${PV}"
+
+SRC_URI = "git://git.ti.com/git/graphics/ti-img-rogue-umlibs.git;protocol=https;branch=${BRANCH}"
+SRCREV = "540919e26f2a3674ba6a3044a113905298125894"
+
+TARGET_PRODUCT:j721e = "j721e_linux"
+TARGET_PRODUCT:j721s2 = "j721s2_linux"
+TARGET_PRODUCT:j784s4 = "j784s4_linux"
+TARGET_PRODUCT:am62xx = "am62_linux"

meta-ti-bsp/recipes-graphics/libgles/ti-img-rogue-umlibs_1.18.6276027.bb line 33

Quoted 10 lines
meta-ti-bsp/recipes-graphics/libgles/ti-img-rogue-umlibs_1.18.6276027.bb new file +10 -0
+PVR_BUILD ?= "release"
+PVR_WS = "lws-generic"
+
+INITSCRIPT_NAME = "rc.pvr"
+INITSCRIPT_PARAMS = "defaults 8"
+
+inherit update-rc.d
+
+DEPENDS += "libdrm wayland expat"
+RDEPENDS:${PN} += "bash mesa-megadriver ti-img-rogue-driver"

Bash? Are we sure we need that?

meta-ti-bsp/recipes-graphics/libgles/ti-img-rogue-umlibs_1.18.6276027.bb line 34

Quoted 1 line
meta-ti-bsp/recipes-graphics/libgles/ti-img-rogue-umlibs_1.18.6276027.bb new file +1 -0
+RDEPENDS:${PN} += "wayland expat"

These are already in the "DEPENDS", if any of the shipped shared objects link to them, they will be auto-added to the RDEPENDS.

meta-ti-bsp/recipes-graphics/libgles/ti-img-rogue-umlibs_1.18.6276027.bb line 39

Quoted 5 lines
meta-ti-bsp/recipes-graphics/libgles/ti-img-rogue-umlibs_1.18.6276027.bb new file +5 -0
+
+S = "${WORKDIR}/git"
+
+do_install () {
+    oe_runmake install DESTDIR=${D} TARGET_PRODUCT=${TARGET_PRODUCT} BUILD=${PVR_BUILD} WINDOW_SYSTEM=${PVR_WS}

Could we add these to EXTRA_OEMAKE instead of overriding do_install()?

EXTRA_OEMAKE += 'DESTDIR=${D} TARGET_PRODUCT=${TARGET_PRODUCT} BUILD=${PVR_BUILD} WINDOW_SYSTEM=${PVR_WS}'

meta-ti-bsp/recipes-graphics/libgles/ti-img-rogue-umlibs_1.18.6276027.bb line 41

Quoted 2 lines
meta-ti-bsp/recipes-graphics/libgles/ti-img-rogue-umlibs_1.18.6276027.bb new file +2 -0
+    chown -R root:root ${D}
+}

This still needed? I'd think the default do_install() should handle file ownership.

meta-ti-bsp/recipes-graphics/libgles/ti-img-rogue-umlibs_1.18.6276027.bb line 53

Quoted 12 lines
meta-ti-bsp/recipes-graphics/libgles/ti-img-rogue-umlibs_1.18.6276027.bb new file +12 -0
+
+PACKAGES = "${PN}-tools ${PN}"
+FILES:${PN}-tools += " ${bindir}/"
+RDEPENDS:${PN}-tools += "python3-core"
+RRECOMMENDS:${PN} += "${PN}-tools"
+
+FILES:${PN} += " ${nonarch_base_libdir}/firmware/"
+FILES:${PN} += " ${datadir}/"
+FILES:${PN} += " ${libdir}/"
+FILES:${PN} += " ${etcdir}/OpenCL ${etcdir}/vulkan"
+
+INSANE_SKIP:${PN} += "ldflags arch already-stripped dev-so"

"ldflags already-stripped" should be the only skips we still need.

Andrew

#3 lore raw
Quoted 2 lines · Andrew Davis

Since the UM driver now RDEPENDS on the KM, could we also drop this last line everywhere?

Nope, we still need the one preferred provider line to indicate that rogue graphics are present. Now this could be replaced by a rogue-graphics machine feature instead if that's preferable, but something will need to signal the mesa switch.

Quoted 1 line · Andrew Davis

Bash? Are we sure we need that?

Yes. The System V init script still needs it. Now could we look at removing that init script? Sure, so long as the device probe still works. What is actually taking care of that right now? It's not udev is it?

Quoted 1 line · Andrew Davis

"ldflags already-stripped" should be the only skips we still need.

Dev-so is required because of some of the symbolic links that are shipped. I'm fine dropping arch unless that breaks something.

#4 lore raw

Hmm, some of the context of the original commenting is lost here. Any way to get the comments inline with the original patch preserved for reference?

Quoted 25 lines · Randolph Sapp via lists.yoctoproject.org
Quoted 2 lines · Andrew Davis

Since the UM driver now RDEPENDS on the KM, could we also drop this last line everywhere?

Nope, we still need the one preferred provider line to indicate that rogue graphics are present. Now this could be replaced by a rogue-graphics machine feature instead if that's preferable, but something will need to signal the mesa switch.

Quoted 1 line · Andrew Davis

Bash? Are we sure we need that?

Yes. The System V init script still needs it. Now could we look at removing that init script? Sure, so long as the device probe still works. What is actually taking care of that right now? It's not udev is it?

Quoted 1 line · Andrew Davis

"ldflags already-stripped" should be the only skips we still need.

Dev-so is required because of some of the symbolic links that are shipped. I'm fine dropping arch unless that breaks something.

#5 lore raw
In reply to Sapp, Randolph
Quoted 6 lines · Randolph
Quoted 2 lines · Andrew Davis

Since the UM driver now RDEPENDS on the KM, could we also drop this last line everywhere?

Nope, we still need the one preferred provider line to indicate that rogue graphics are present. Now this could be replaced by a rogue-graphics machine feature instead if that's preferable, but something will need to signal the mesa switch.

New machine feature sounds like the better route since it changes the content of a package. Using PREFERRED_PROVIDER for that doesn't seem right.

Quoted 5 lines · Andrew Davis
Quoted 1 line

Bash? Are we sure we need that?

Yes. The System V init script still needs it. Now could we look at removing that init script? Sure, so long as the device probe still works. What is actually taking care of that right now? It's not udev is it?

The module/device probe is automatic now. At least for SGX that script exists only to run the single command "pvrsrvctl --start --no-module" which loads some microcode. We can have yocto build that service for us to run the command, IIRC it will make it into a systemd or sysv service for us based on what kinda distro we are building.

Quoted 6 lines · Andrew Davis
Quoted 1 line

"ldflags already-stripped" should be the only skips we still need.

Dev-so is required because of some of the symbolic links that are shipped. I'm fine dropping arch unless that breaks something.

Ah, think that is /usr/lib/dri/pvr_dri.so, odd name, but yeah that skip can stay then. Lets try to drop "arch" at least.

Andrew

#6 lore raw
Quoted 10 lines · Andrew Davis
Quoted 6 lines · Randolph
Quoted 2 lines · On Wed, Dec 7 2022 at 12:48:00 PM -0600, Andrew Davis <[email protected]…

Since the UM driver now RDEPENDS on the KM, could we also drop this last line everywhere?

Nope, we still need the one preferred provider line to indicate that rogue graphics are present. Now this could be replaced by a rogue-graphics machine feature instead if that's preferable, but something will need to signal the mesa switch.

New machine feature sounds like the better route since it changes the content of a package. Using PREFERRED_PROVIDER for that doesn't seem right.

Fair enough, v4 will roll back to that method.

Quoted 11 lines · Andrew Davis
Quoted 6 lines · On Wed, Dec 7 2022 at 12:48:00 PM -0600, Andrew Davis <[email protected]…
Quoted 1 line

Bash? Are we sure we need that?

Yes. The System V init script still needs it. Now could we look at removing that init script? Sure, so long as the device probe still works. What is actually taking care of that right now? It's not udev is it?

The module/device probe is automatic now. At least for SGX that script exists only to run the single command "pvrsrvctl --start --no-module" which loads some microcode. We can have yocto build that service for us to run the command, IIRC it will make it into a systemd or sysv service for us based on what kinda distro we are building.

If that's true rogue can drop it entirely. Updating to do that now.

Quoted 10 lines · Andrew Davis
Quoted 7 lines · On Wed, Dec 7 2022 at 12:48:00 PM -0600, Andrew Davis <[email protected]…
Quoted 1 line

"ldflags already-stripped" should be the only skips we still need.

Dev-so is required because of some of the symbolic links that are shipped. I'm fine dropping arch unless that breaks something.

Ah, think that is /usr/lib/dri/pvr_dri.so, odd name, but yeah that skip can stay then. Lets try to drop "arch" at least.

Just found out the MIPS/RISC firmware bin trips the arch check so that has to stay.

If you don't mind, take a look at the v3 revision. I'm experimenting with using the binary_package class there. Not really sure how I feel about it, but it's at least less lines & steps than this revision.

#7 lore raw
Quoted 14 lines · Randolph Sapp via lists.yoctoproject.org
Quoted 12 lines · Andrew Davis
Quoted 10 lines · Randolph
Quoted 2 lines · On Wed, Dec 7 2022 at 12:48:00 PM -0600, Andrew Davis <[email protected]…

Since the UM driver now RDEPENDS on the KM, could we also drop this last line everywhere?

Nope, we still need the one preferred provider line to indicate that rogue graphics are present. Now this could be replaced by a rogue-graphics machine feature instead if that's preferable, but something will need to signal the mesa switch.

Quoted 5 lines
Quoted 3 lines

New machine feature sounds like the better route since it changes the content of a package.
Using PREFERRED_PROVIDER for that doesn't seem right.

Fair enough, v4 will roll back to that method.

Can you please explain why existing machine feature cannot be re-used and a new one is needed here? Do you plan to use both side-by-side?

Quoted 48 lines
Quoted 11 lines · Andrew Davis
Quoted 10 lines
Quoted 1 line · On Wed, Dec 7 2022 at 12:48:00 PM -0600, Andrew Davis <[email protected]…

Bash? Are we sure we need that?

Yes. The System V init script still needs it. Now could we look at removing that init script? Sure, so long as the device probe still works. What is actually taking care of that right now? It's not udev is it?

Quoted 8 lines

The module/device probe is automatic now. At least for SGX that script exists only
to run the single command "pvrsrvctl --start --no-module" which loads some microcode.
We can have yocto build that service for us to run the command, IIRC it will make
it into a systemd or sysv service for us based on what kinda distro we are building.

If that's true rogue can drop it entirely. Updating to do that now.

Quoted 11 lines · Andrew Davis
Quoted 10 lines
Quoted 1 line · On Wed, Dec 7 2022 at 12:48:00 PM -0600, Andrew Davis <[email protected]…

"ldflags already-stripped" should be the only skips we still need.

Dev-so is required because of some of the symbolic links that are shipped. I'm fine dropping arch unless that breaks something.

Quoted 3 lines

Ah, think that is /usr/lib/dri/pvr_dri.so, odd name, but yeah that skip can
stay then. Lets try to drop "arch" at least.

Just found out the MIPS/RISC firmware bin trips the arch check so that has to stay.

If you don't mind, take a look at the v3 revision. I'm experimenting with using the binary_package class there. Not really sure how I feel about it, but it's at least less lines & steps than this revision.

#8 lore raw
Quoted 2 lines · Denys Dmytriyenko

Can you please explain why existing machine feature cannot be re-used and a new one is needed here? Do you plan to use both side-by-side?

Yes, so gpu is a super generic machine feature. On our platforms this could mean anything from some minimal device with a tidss module that wants to do software rendering to a full blown device with rogue/sgx graphics processors. The gpu feature is required to build graphics libraries in either case, but if they are doing software rendering they won't need the rogue/sgx specific patches. The new machine feature makes this distinction clear and allows us to switch between rogue/sgx/swrast tooling as necessary.

#9 lore raw
Quoted 6 lines · Randolph
Quoted 3 lines · Denys Dmytriyenko

Can you please explain why existing machine feature cannot be re-used and a
new one is needed here? Do you plan to use both side-by-side?

Quoted 8 lines

Yes, so gpu is a super generic machine feature. On our platforms this could mean anything from some minimal device with a tidss module that wants to do software rendering to a full blown device with rogue/sgx graphics processors. The gpu feature is required to build graphics libraries in either case, but if they are doing software rendering they won't need the rogue/sgx specific patches. The new machine feature makes this distinction clear and allows us to switch between rogue/sgx/swrast tooling as necessary.

Well, not exactly...

We originally created "sgx" machine feature in meta-ti to be used in downstream layers (as that was not a common upstream flag), as there was a need to mark platforms with accelerated 3D GFX core and SGX was the only one used in TI platforms back then.

As J721e was the first SoC with the Rogue core, there was still a need to indicate a presence of 3D graphics regarless of the driver, hence I made the flag more generic by renaming "sgx" into "gpu":
https://git.yoctoproject.org/meta-ti/commit/?id=0d9910c1710d9d4b2dd986403824ae05b6289e63

The thinking was that for any display and graphics capabilities w/o accelerated 3D (or software-rendered 3D), there's still a standard upstream machine feature called "screen", perfectly suited for that.

So, "gpu" flag specifically means HW-accelerated 3D graphics core, regardless of the model, generation or driver used. That covers SGX and Rogue now. You can still build Mesa and other graphics components w/o "gpu" flag for software rendering just fine.

Signature · 1 line
Denys
#10 lore raw
Quoted 4 lines · Denys Dmytriyenko

So, "gpu" flag specifically means HW-accelerated 3D graphics core, regardless of the model, generation or driver used. That covers SGX and Rogue now. You can still build Mesa and other graphics components w/o "gpu" flag for software rendering just fine.

Thanks for the history lesson, but this use of the GPU flag has changed over the years. We have overrides *for some reason* to drop functionality of certain packages when GPU is not present -- even though software rasterization could still be used here (take a look at gstreamer). This is in addition to a rickety dependency chain that seems to completely drop all graphics tooling when "gpu" is not present (talk to the guys working on am62a right now).

The issue I am trying to solve with the new machine feature is there is a mix of packages/pkgconfigs that should be tweaked for each of the following conditions:
- sgx grahpics
- rogue graphics
- swrast grahpics
- no graphics

Where the following should occur:
- SGX grahpics should conflict with ROGUE (different umlibs, km, and
mesa patches)
- Both SGX and ROGUE should pull in all the same packages as swrast,
only mesa should be configured differently (unless some userspace tools have their own swrast tooling which is rare but not impossible)
- No graphics should do what dropping the GPU feature currently does
-- completely remove all graphics libraries and swrast tools.

Now, if you believe "screen" should be used in place of the "gpu" machine feature in my current system; that's fine, I can update the configs accordingly but a new machine feature or something similar will be required to differentiate between SGX/RGX.

#11 lore raw
Quoted 33 lines · Randolph
Quoted 4 lines · Denys Dmytriyenko

So, "gpu" flag specifically means HW-accelerated 3D graphics core, regardless of the model, generation or driver used. That covers SGX and Rogue now. You can still build Mesa and other graphics components w/o "gpu" flag for software rendering just fine.

Thanks for the history lesson, but this use of the GPU flag has changed over the years. We have overrides *for some reason* to drop functionality of certain packages when GPU is not present -- even though software rasterization could still be used here (take a look at gstreamer). This is in addition to a rickety dependency chain that seems to completely drop all graphics tooling when "gpu" is not present (talk to the guys working on am62a right now).

The issue I am trying to solve with the new machine feature is there is a mix of packages/pkgconfigs that should be tweaked for each of the following conditions:
- sgx grahpics
- rogue graphics
- swrast grahpics
- no graphics

Where the following should occur:
- SGX grahpics should conflict with ROGUE (different umlibs, km,
and mesa patches)
- Both SGX and ROGUE should pull in all the same packages as
swrast, only mesa should be configured differently (unless some userspace tools have their own swrast tooling which is rare but not impossible)
- No graphics should do what dropping the GPU feature currently
does -- completely remove all graphics libraries and swrast tools.

Quoted 4 lines

Now, if you believe "screen" should be used in place of the "gpu" machine feature in my current system; that's fine, I can update the configs accordingly but a new machine feature or something similar will be required to differentiate between SGX/RGX.

Please list all the machine features you plan to add/rename/remove in order to support all these use cases. Thanks.

Signature · 1 line
Denys
#12 lore raw
Quoted 2 lines · Denys Dmytriyenko

Please list all the machine features you plan to add/rename/remove in order to support all these use cases. Thanks.

On further inspection I believe adding these as distro features may be a better idea than machine features.

I believe the best course of action would be to re-evaluate all recipes that utilize the "gpu" machine feature and either switch it to use distro features and PACKAGECONFIGS (my gstreamer-plugins example should actually be removed as it is a pointless override).

Either x11 or wayland distro features should be enough to pull in software rendering toolkits and graphics frameworks like Qt so any overrides we had to prevent that should be dropped. That seems to be the way upstream intends that to work.

The rgx-gpu / sgx-gpu features will be added to switch mesa configs, pull in according kernel modules, and tweak other packages as necessary. There will need to be a preliminary check though to make sure sgx-gpu and rgx-gpu features aren't both included as currently these will clash.

Please feel free to correct me though. Unfortunately Yocto gives us too much freedom here.

Regards,
Randolph Sapp

#13 lore raw
Quoted 4 lines · Randolph
Quoted 2 lines · Denys Dmytriyenko

Please list all the machine features you plan to add/rename/remove in order to support all these use cases. Thanks.

Quoted 8 lines

On further inspection I believe adding these as distro features may be a better idea than machine features.

I believe the best course of action would be to re-evaluate all recipes that utilize the "gpu" machine feature and either switch it to use distro features and PACKAGECONFIGS (my gstreamer-plugins example should actually be removed as it is a pointless override).

Either x11 or wayland distro features should be enough to pull in software rendering toolkits and graphics frameworks like Qt so any overrides we had to prevent that should be dropped. That seems to be the way upstream intends that to work.

The rgx-gpu / sgx-gpu features will be added to switch mesa configs, pull in according kernel modules, and tweak other packages as necessary. There will need to be a preliminary check though to make sure sgx-gpu and rgx-gpu features aren't both included as currently these will clash.

The SGX/RGX recipes have COMPATIBLE_MACHINE lists that do not have any device in both sets. That should be a good enough check that both(or wrong one) are not selected.

Andrew

Quoted 6 lines

Please feel free to correct me though. Unfortunately Yocto gives us too much freedom here.

Regards,
Randolph Sapp

#14 lore raw
In reply to Andrew Davis
Quoted 9 lines · Andrew Davis
Quoted 7 lines
meta-ti-bsp/recipes-graphics/libgles/ti-img-rogue-umlibs_1.18.6276027.bb new file +5 -0
+
+S = "${WORKDIR}/git"
+
+do_install () {
+    oe_runmake install DESTDIR=${D} 

TARGET_PRODUCT=${TARGET_PRODUCT} BUILD=${PVR_BUILD} WINDOW_SYSTEM=${PVR_WS}

Could we add these to EXTRA_OEMAKE instead of overriding do_install()?

Evidently not. Something in yocto clears out the destination directory before packaging if there is no do_install.