[Buildroot] [PATCH v9 10/11] package/ti-rogue-um: new package

Andreas Dannenberg dannenberg at ti.com
Tue Jun 27 22:48:33 UTC 2023


Hi François,

On Fri, Jun 23, 2023 at 09:59:45AM -0500, Andreas Dannenberg via buildroot wrote:
> Hi François,
> 
> On Fri, Jun 23, 2023 at 09:30:39AM +0200, François Perrad wrote:
> > Le jeu. 22 juin 2023 à 18:07, Andreas Dannenberg via buildroot <
> > buildroot at buildroot.org> a écrit :
> > 
> > > This package adds the userspace libraries for the Rogue graphics
> > > accelerator of the following Texas Instruments SoCs: AM62, J721E,
> > > J721S2, and J784S4.
> > >
> > > Signed-off-by: Andreas Dannenberg <dannenberg at ti.com>
> > > ---
> > >  package/Config.in                             |   1 +
> > >  .../0001-all-drop-the-init-script.patch       | 832 ++++++++++++++++++
> > >  package/ti-rogue-um/Config.in                 |  52 ++
> > >  package/ti-rogue-um/ti-rogue-um.hash          |   3 +
> > >  package/ti-rogue-um/ti-rogue-um.mk            |  38 +
> > >  5 files changed, 926 insertions(+)
> > >  create mode 100644 package/ti-rogue-um/0001-all-drop-the-init-script.patch
> > >  create mode 100644 package/ti-rogue-um/Config.in
> > >  create mode 100644 package/ti-rogue-um/ti-rogue-um.hash
> > >  create mode 100644 package/ti-rogue-um/ti-rogue-um.mk
> > >
> > > diff --git a/package/Config.in b/package/Config.in
> > > index 96ef0d72de..0bff1135aa 100644
> > > --- a/package/Config.in
> > > +++ b/package/Config.in
> > > @@ -614,6 +614,7 @@ endmenu
> > >         source "package/targetcli-fb/Config.in"
> > >         source "package/ti-gfx/Config.in"
> > >         source "package/ti-rogue-km/Config.in"
> > > +       source "package/ti-rogue-um/Config.in"
> > >         source "package/ti-sgx-demos/Config.in"
> > >         source "package/ti-sgx-km/Config.in"
> > >         source "package/ti-sgx-um/Config.in"
> > > diff --git a/package/ti-rogue-um/0001-all-drop-the-init-script.patch
> > > b/package/ti-rogue-um/0001-all-drop-the-init-script.patch
> > > new file mode 100644
> > > index 0000000000..4f3dd1cbb1
> > > --- /dev/null
> > > +++ b/package/ti-rogue-um/0001-all-drop-the-init-script.patch
> > > @@ -0,0 +1,832 @@
> > > +From 99e0da8a1c08818c59680f726e11a84b26daf29f Mon Sep 17 00:00:00 2001
> > > +From: Randolph Sapp <rs at ti.com>
> > > +Date: Thu, 25 May 2023 18:59:26 -0500
> > > +Subject: [PATCH] all: drop the init script
> > > +
> > > +Nobody should be using this anymore. It's sysVinit and it's just a fancy
> > > +wrapper around modprobe anyway. We'll be dropping it from our build
> > > +tools soon.
> > > +
> > > +Signed-off-by: Randolph Sapp <rs at ti.com>
> > > +---
> > > + .../wayland/release/etc/init.d/rc.pvr         | 196 ------------------
> > > + .../wayland/release/etc/init.d/rc.pvr         | 196 ------------------
> > > + .../wayland/release/etc/init.d/rc.pvr         | 196 ------------------
> > > + .../wayland/release/etc/init.d/rc.pvr         | 196 ------------------
> > > + 4 files changed, 784 deletions(-)
> > > + delete mode 100755 targetfs/am62_linux/wayland/release/etc/init.d/rc.pvr
> > > + delete mode 100755 targetfs/j721e_linux/wayland/release/etc/init.d/rc.pvr
> > > + delete mode 100755
> > > targetfs/j721s2_linux/wayland/release/etc/init.d/rc.pvr
> > > + delete mode 100755
> > > targetfs/j784s4_linux/wayland/release/etc/init.d/rc.pvr
> > > +
> > > +diff --git a/targetfs/am62_linux/wayland/release/etc/init.d/rc.pvr
> > > b/targetfs/am62_linux/wayland/release/etc/init.d/rc.pvr
> > > +deleted file mode 100755
> > > +index 428cd86..0000000
> > > +--- a/targetfs/am62_linux/wayland/release/etc/init.d/rc.pvr
> > > ++++ /dev/null
> > > +2.34.1
> > > +
> > > diff --git a/package/ti-rogue-um/Config.in b/package/ti-rogue-um/Config.in
> > > new file mode 100644
> > > index 0000000000..15257858c2
> > > --- /dev/null
> > > +++ b/package/ti-rogue-um/Config.in
> > > @@ -0,0 +1,52 @@
> > > +comment "ti-rogue-um needs udev and a glibc toolchain w/ threads"
> > > +       depends on BR2_aarch64
> > > +       depends on !BR2_PACKAGE_HAS_UDEV || !BR2_TOOLCHAIN_USES_GLIBC \
> > > +               || !BR2_TOOLCHAIN_HAS_THREADS
> > > +
> > > +config BR2_PACKAGE_TI_ROGUE_UM
> > > +       bool "ti-rogue-um"
> > > +       depends on BR2_TOOLCHAIN_HAS_THREADS # libdrm
> > > +       depends on BR2_PACKAGE_HAS_UDEV
> > > +       # pre-built binaries
> > > +       depends on BR2_TOOLCHAIN_USES_GLIBC
> > > +       depends on BR2_aarch64
> > > +       select BR2_PACKAGE_LIBDRM
> > > +       select BR2_PACKAGE_HAS_LIBEGL
> > > +       select BR2_PACKAGE_HAS_LIBGBM
> > > +       select BR2_PACKAGE_LIBGBM_HAS_FEATURE_DMA_BUF
> > > +       select BR2_PACKAGE_HAS_LIBGLES
> > > +       select BR2_PACKAGE_HAS_POWERVR
> > > +       select BR2_PACKAGE_LIBFFI
> > > +       select BR2_PACKAGE_WAYLAND
> > > +       select BR2_PACKAGE_HAS_LIBEGL_WAYLAND
> > > +       select BR2_PACKAGE_TI_ROGUE_KM if BR2_LINUX_KERNEL
> > > +       help
> > > +         Graphics libraries for TI SoCs with Rogue GPU.
> > > +         This package supports AM62, J721E, J721S2, and J784S4
> > > +         SoCs only.
> > > +
> > > +         https://git.ti.com/cgit/graphics/ti-img-rogue-umlibs
> > > +
> > > +if BR2_PACKAGE_TI_ROGUE_UM
> > > +
> > > +config BR2_PACKAGE_PROVIDES_LIBEGL
> > > +       default "ti-rogue-um"
> > > +
> > > +config BR2_PACKAGE_PROVIDES_LIBGBM
> > > +       default "ti-rogue-um"
> > > +
> > > +config BR2_PACKAGE_PROVIDES_LIBGLES
> > > +       default "ti-rogue-um"
> > > +
> > > +config BR2_PACKAGE_PROVIDES_POWERVR
> > > +       default "ti-rogue-um"
> > > +
> > > +config BR2_TARGET_TI_ROGUE_UM_TARGET_PRODUCT
> > > +       string "UM driver target product"
> > > +       default "am62_linux"
> > > +       help
> > > +         Select target product to be used for UM libraries. This needs to
> > > +         match one of the SoC-specific folders within the root/targetfs
> > > +         folder of the ti-img-rogue-umlibs Git repository.
> > > +
> > > +endif
> > > diff --git a/package/ti-rogue-um/ti-rogue-um.hash
> > > b/package/ti-rogue-um/ti-rogue-um.hash
> > > new file mode 100644
> > > index 0000000000..a41bf33145
> > > --- /dev/null
> > > +++ b/package/ti-rogue-um/ti-rogue-um.hash
> > > @@ -0,0 +1,3 @@
> > > +# Locally calculated
> > > +sha256  2e1bd1a5ab0ad2db1b9164d028a94f8f9d20743131f337a817fd1c8f9ddd4cbe
> > > ti-rogue-um-5977e82b96028f783d39c7219f016c1faf8dc5f5-br1.tar.gz
> > > +sha256  37507b462edf97b59717d2d144daaac85fbca6080c3602b5128e446e97f9ad47
> > > LICENSE
> > > diff --git a/package/ti-rogue-um/ti-rogue-um.mk b/package/ti-rogue-um/
> > > ti-rogue-um.mk
> > > new file mode 100644
> > > index 0000000000..fa29638fa7
> > > --- /dev/null
> > > +++ b/package/ti-rogue-um/ti-rogue-um.mk
> > > @@ -0,0 +1,38 @@
> > >
> > > +################################################################################
> > > +#
> > > +# ti-rogue-um
> > > +#
> > >
> > > +################################################################################
> > > +
> > > +# This corresponds to SDK 08.06.00
> > > +TI_ROGUE_UM_VERSION = 5977e82b96028f783d39c7219f016c1faf8dc5f5
> > > +TI_ROGUE_UM_SITE =
> > > https://git.ti.com/git/graphics/ti-img-rogue-umlibs.git
> > > +TI_ROGUE_UM_SITE_METHOD = git
> > > +TI_ROGUE_UM_LICENSE = TI TSPA License
> > > +TI_ROGUE_UM_LICENSE_FILES = LICENSE
> > > +TI_ROGUE_UM_INSTALL_STAGING = YES
> > > +TI_ROGUE_UM_PROVIDES = libegl libgbm libgles powervr
> > > +
> > > +# ti-rogue-um is a egl/gles provider only if libdrm is installed
> > > +TI_ROGUE_UM_DEPENDENCIES = libdrm wayland
> > >
> > 
> > useless built dependencies (nothing is built, blobs are copied), runtime
> > dependencies in Config.in are enough.
> 
> Understood, will fix it. Btw this was a carry-over from
> package/ti-sgx-um/ti-sgx-um.mk which I used to model this new package
> after, so opportunity for improvement there as well...

I experimented with this today, and removing either libdrm _or_ wayland
from TI_ROGUE_UM_DEPENDENCIES causes the build to fail in two different
ways. Note that I'm using my "test defconfig" that turns on the
following extras in configs/am62x_sk_defconfig...

+BR2_TOOLCHAIN_BUILDROOT_CXX=y
+BR2_PACKAGE_PULSEAUDIO=y
+BR2_PACKAGE_CHOCOLATE_DOOM=y
+BR2_PACKAGE_DOOM_WAD=y
+BR2_PACKAGE_SDL2_KMSDRM=y
+BR2_PACKAGE_SDL2_OPENGLES=y
+BR2_PACKAGE_WESTON=y
+BR2_PACKAGE_ALSA_LIB=y

===Test 1: Removing libdrm===
<snip>
In file included from /home/a0797059/git/buildroot/output/host/aarch64-buildroot-linux-gnu/sysroot/usr/include/EGL/egl.h:39,
                 from cairo-gl.h:130,
                 from cairo-gl-private.h:51,
                 from cairo-gl-traps-compositor.c:44:
/home/a0797059/git/buildroot/output/host/aarch64-buildroot-linux-gnu/sysroot/usr/include/EGL/eglplatform.h:134:10: fatal error: X11/Xlib.h: No such file or directory
  134 | #include <X11/Xlib.h>
      |          ^~~~~~~~~~~~
compilation terminated.
make[5]: *** [Makefile:2358: cairo-gl-shaders.lo] Error 1
make[5]: *** [Makefile:2358: cairo-gl-traps-compositor.lo] Error 1
make[4]: *** [Makefile:1955: all] Error 2
make[3]: *** [Makefile:910: all-recursive] Error 1
make[2]: *** [Makefile:761: all] Error 2
make[1]: *** [package/pkg-generic.mk:293: /home/a0797059/git/buildroot/output/build/cairo-1.16.0/.stamp_built] Error 2
make: *** [Makefile:82: _all] Error 2

===Test 2: Removing wayland===
<snip>
/home/a0797059/git/buildroot/output/host/lib/gcc/aarch64-buildroot-linux-gnu/11.4.0/../../../../aarch64-buildroot-linux-gnu/bin/ld: /home/a0797059/git/buildroot/output/host/bin/../aarch64-buildroot-linux-gnu/sysroot/usr/lib/libEGL.so: undefined reference to `wl_display_roundtrip_queue'
/home/a0797059/git/buildroot/output/host/lib/gcc/aarch64-buildroot-linux-gnu/11.4.0/../../../../aarch64-buildroot-linux-gnu/bin/ld: /home/a0797059/git/buildroot/output/host/bin/../aarch64-buildroot-linux-gnu/sysroot/usr/lib/libEGL.so: undefined reference to `wl_proxy_marshal_constructor_versioned'
/home/a0797059/git/buildroot/output/host/lib/gcc/aarch64-buildroot-linux-gnu/11.4.0/../../../../aarch64-buildroot-linux-gnu/bin/ld: /home/a0797059/git/buildroot/output/host/bin/../aarch64-buildroot-linux-gnu/sysroot/usr/lib/libEGL.so: undefined reference to `wl_display_create_queue'
collect2: error: ld returned 1 exit status
make[6]: *** [Makefile:1795: cairo-test-suite] Error 1
make[5]: *** [Makefile:8375: all-recursive] Error 1
make[4]: *** [Makefile:1736: all] Error 2
make[3]: *** [Makefile:910: all-recursive] Error 1
make[2]: *** [Makefile:761: all] Error 2
make[1]: *** [package/pkg-generic.mk:293: /home/a0797059/git/buildroot/output/build/cairo-1.16.0/.stamp_built] Error 2
make: *** [Makefile:82: _all] Error 2

Note that for the tests I did a full build, starting out with a completely
clean state (rm -rf output/* before the build).

With this finding, I'm inclined to leave TI_ROGUE_UM_DEPENDENCIES as I
had it, unless there's a better way to deal with this build dependency?

Thanks, Andreas


--
Andreas Dannenberg
Texas Instruments Inc

>  
> > +
> > > +PVR_BUILD = "release"
> > > +PVR_WS = "wayland"
> > > +
> > >
> > 
> > TI_ROGUE_UM_MAKE_OPTS = \
> >       TARGET_PRODUCT=$(BR2_TARGET_TI_ROGUE_UM_TARGET_PRODUCT) \
> >       BUILD=release \
> >       WINDOW_SYSTEM=wayland
> > 
> > define TI_ROGUE_UM_INSTALL_STAGING_CMDS
> >      $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) \
> >           $(TI_ROGUE_UM_MAKE_OPTS) \
> >           DESTDIR=$(STAGING_DIR) \
> >           install
> > endef
> > by this way, all variables are prefixed by TI_ROGUE_UM_.
> 
> Good idea, will factor-out the make options. Thanks for taking the time
> to review & improve this patch.
> 
> --
> Andreas Dannenberg
> Texas Instruments Inc
> 
> 
> 
> > 
> > François
> > 
> > 
> > > +define TI_ROGUE_UM_INSTALL_STAGING_CMDS
> > > +       $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) \
> > > +               DESTDIR=$(STAGING_DIR) \
> > > +               TARGET_PRODUCT=$(BR2_TARGET_TI_ROGUE_UM_TARGET_PRODUCT) \
> > > +               BUILD=$(PVR_BUILD) WINDOW_SYSTEM=$(PVR_WS) \
> > > +               install
> > > +endef
> > > +
> > > +define TI_ROGUE_UM_INSTALL_TARGET_CMDS
> > > +       $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) \
> > > +               DESTDIR=$(TARGET_DIR) \
> > > +               TARGET_PRODUCT=$(BR2_TARGET_TI_ROGUE_UM_TARGET_PRODUCT) \
> > > +               BUILD=$(PVR_BUILD) WINDOW_SYSTEM=$(PVR_WS) \
> > > +               install
> > > +endef
> > > +
> > > +$(eval $(generic-package))
> > > --
> > > 2.34.1
> > >
> > > _______________________________________________
> > > buildroot mailing list
> > > buildroot at buildroot.org
> > > https://lists.buildroot.org/mailman/listinfo/buildroot
> > >
> _______________________________________________
> buildroot mailing list
> buildroot at buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot



More information about the buildroot mailing list