Skip to contentSkip to conversation

GIT: [PATCH v2 0/2] package/gcnano-binaries: new package

Buildroot New Jens Kleintje 2 participants 6 messages Nov 14, 2019 – Nov 18, 2019

lore
Share & tools
lore
#0 lore raw

The package is tested with the following steps:
modprobe galcore
export QT_QPA_EGLFS_ALWAYS_SET_MODE=1

With QT_QPA_EGLFS_ALWAYS_SET_MODE=1 qt performs a video mode set on every application startup.

Changes:
- Add Signed-off-by line
- Add package/gcnano-binaries/Config.in file
- Add DEVELOPERS file
- Remove default extract commands from GCNANO_BINARIES_EXTRACT_HELPER
- factorize INSTALL commands
- keep wayland-egl.pc and libwayland-egl.so files from wayland package
- Add dependency arm
- cleaning check-package warnings

Changes v1 -> v2:
- use the "github" helper macro
- change hash for gcnano-binaries-c01642ed5e18cf09ecd905af193e935cb3be95ed.tar.gz

#1 lore raw

PATCH v2 1/2 package/gcnano-binaries: new package

New package which provides the driver and binary blob libraries for the STM32MP157 vivante gcnano gpu.
The precompiled libaries depends on wayland and libdrm.

---
 DEVELOPERS                                   |  3 +
 package/Config.in                            |  1 +
 package/gcnano-binaries/Config.in            | 24 +++++++
 package/gcnano-binaries/gcnano-binaries.hash |  2 +
 package/gcnano-binaries/gcnano-binaries.mk   | 74 ++++++++++++++++++++
 5 files changed, 104 insertions(+)
 create mode 100644 package/gcnano-binaries/Config.in
 create mode 100644 package/gcnano-binaries/gcnano-binaries.hash
 create mode 100644 package/gcnano-binaries/gcnano-binaries.mk
DEVELOPERS +3 -0
index cdd44be37c..9c39bbd41e 100644
@@ -2536,3 +2536,6 @@ F:	package/tinc/
 N:  Aussedat Louis <[email protected]>
 F:	board/friendlyarm/nanopi-neo-plus2/
 F:	configs/friendlyarm_nanopi_neo_plus2_defconfig
+
+N:	Jens Kleintje <[email protected]>
+F:	package/gcnano-binaries
package/Config.in +1 -0
index dc5ec56d6b..1a88da547d 100644
@@ -449,6 +449,7 @@ endmenu
 	source "package/freescale-imx/Config.in"
 	source "package/fxload/Config.in"
 	source "package/gadgetfs-test/Config.in"
+	source "package/gcnano-binaries/Config.in"
 	source "package/gpm/Config.in"
 	source "package/gpsd/Config.in"
 	source "package/gptfdisk/Config.in"
package/gcnano-binaries/Config.in new file +24 -0
new file mode 100644
index 0000000000..9cc9d149c0
@@ -0,0 +1,24 @@
+comment "gcnano binaries  needs a Linux kernel to be built"
+	depends on !BR2_LINUX_KERNEL
+
+config BR2_PACKAGE_GCNANO_BINARIES
+	bool "gcnano binaries"
+	depends on BR2_arm
+	depends on BR2_LINUX_KERNEL
+	select BR2_PACKAGE_HAS_LIBEGL
+	select BR2_PACKAGE_HAS_LIBGLES
+	select BR2_PACKAGE_LIBDRM
+	select BR2_PACKAGE_WAYLAND
+	help
+	  Driver and libaries for stm vivante gcnano gpu.
+	  https://github.com/STMicroelectronics/gcnano-binaries/
+
+if BR2_PACKAGE_GCNANO_BINARIES
+
+config BR2_PACKAGE_PROVIDES_LIBEGL
+	default "gcnano-binaries"
+
+config BR2_PACKAGE_PROVIDES_LIBGLES
+	default "gcnano-binaries"
+
+endif
package/gcnano-binaries/gcnano-binaries.hash new file +2 -0
new file mode 100644
index 0000000000..0e4faa988d
@@ -0,0 +1,2 @@
+sha256 255db9c58627f5f54fd15263647cc97a55927363fec42e7c8d7486170a65d84d  gcnano-binaries-c01642ed5e18cf09ecd905af193e935cb3be95ed.tar.gz
+sha256 7d209718473d18f69f75adb7caf9cb5d4b0a31da068756aa011bea617de3dc57  EULA
package/gcnano-binaries/gcnano-binaries.mk new file +74 -0

74 lines not on this page · raw message

--
2.17.1

#2 lore raw

PATCH v2 1/2 package/gcnano-binaries: new package

Hello Jens,

Quoted 5 lines · On Thu, 14 Nov 2019 09:55:28 +0100 Jens Kleintje <[email protected]> wrote:

New package which provides the driver and binary blob libraries for the STM32MP157 vivante gcnano gpu.
The precompiled libaries depends on wayland and libdrm.

Thanks for this new version, I have applied it to our next branch, but after doing a number of changes. See below.

DEVELOPERS F: package/tinc/ · line 2541

Quoted 11 lines
DEVELOPERS +3 -0
index cdd44be37c..9c39bbd41e 100644
@@ -2536,3 +2536,6 @@ F:	package/tinc/
 N:  Aussedat Louis <[email protected]>
 F:	board/friendlyarm/nanopi-neo-plus2/
 F:	configs/friendlyarm_nanopi_neo_plus2_defconfig
+
+N:	Jens Kleintje <[email protected]>
+F:	package/gcnano-binaries

Alphabetic ordering was not good. Yes, the entry of Aussedat Louis was also not at the right place, but it has been fixed in the mean time.

package/gcnano-binaries/Config.in line 1

Quoted 7 lines
package/gcnano-binaries/Config.in new file +1 -0
new file mode 100644
index 0000000000..9cc9d149c0
@@ -0,0 +1,24 @@
+comment "gcnano binaries  needs a Linux kernel to be built"

gcnano binaries -> gcnano-binaries. And there were two spaces before "needs"

package/gcnano-binaries/Config.in line 5

Quoted 4 lines
package/gcnano-binaries/Config.in new file +4 -0
+	depends on !BR2_LINUX_KERNEL
+
+config BR2_PACKAGE_GCNANO_BINARIES
+	bool "gcnano binaries"

bool "gcnano-binaries"

package/gcnano-binaries/Config.in line 7

Quoted 2 lines
package/gcnano-binaries/Config.in new file +2 -0
+	depends on BR2_arm
+	depends on BR2_LINUX_KERNEL

You forgot a number of dependencies here:

- glibc dependency, because the pre-built binary blobs will only work with glibc

- threads, which is a dependency of libdrm and wayland, so we have to replicate it

- dynamic libraries, because wayland has a !BR2_STATIC_LIBS dependency

package/gcnano-binaries/Config.in line 9

Quoted 2 lines
package/gcnano-binaries/Config.in new file +2 -0
+
+GCNANO_BINARIES_FILE_VERSION = 6.2.4.p4

I've improved this a bit with:

GCNANO_BINARIES_LIB_VERSION = 6.2.4 GCNANO_BINARIES_DRIVER_VERSION = $(GCNANO_BINARIES_LIB_VERSION).p4 GCNANO_BINARIES_USERLAND_VERSION = $(GCNANO_BINARIES_LIB_VERSION).p4-20190626

which I then use throughout the .mk file.

Quoted 11 lines
package/gcnano-binaries/Config.in new file +11 -0
+# The wayland-egl.pc and libwayland-egl.so are provided by the wayland package
+define GCNANO_BINARIES_INSTALL
+	rm -f $(@D)/gcnano-userland-multi-$(GCNANO_BINARIES_FILE_VERSION)-20190626/usr/lib/pkgconfig/wayland-egl.pc
+	rm -f $(@D)/gcnano-userland-multi-$(GCNANO_BINARIES_FILE_VERSION)-20190626/usr/lib/libwayland-egl.so.1
+	rm -f $(@D)/gcnano-userland-multi-$(GCNANO_BINARIES_FILE_VERSION)-20190626/usr/lib/libwayland-egl.so
+	cp -r $(@D)/gcnano-userland-multi-$(GCNANO_BINARIES_FILE_VERSION)-20190626/usr/lib/* $(1)/usr/lib/
+	cd $(1)/usr/lib; \
+	ln -sf gbm_viv.6.2.4.multi.release.so gbm_viv.so; \
+	ln -sf libEGL.6.2.4.multi.release.so libEGL.so; \
+	ln -sf libEGL.so libEGL.so.1; \
+	ln -sf libGAL.6.2.4.multi.release.so libGAL.so; \

package/gcnano-binaries/Config.in

Quoted 10 lines
package/gcnano-binaries/Config.in new file +10 -0
+	ln -sf libgbm.6.2.4.multi.release.so libgbm.so; \
+	ln -sf libgbm.so libgbm.so.1; \
+	ln -sf libGLESv1_CM.6.2.4.multi.release.so libGLESv1_CM.so; \
+	ln -sf libGLESv2.6.2.4.multi.release.so libGLESv2.so; \
+	ln -sf libGLESv2.so libGLESv2.so.2; \
+	ln -sf libGLSLC.6.2.4.multi.release.so libGLSLC.so; \
+	ln -sf libOpenVG.6.2.4.multi.release.so libOpenVG.so; \
+	ln -sf libVSC.6.2.4.multi.release.so libVSC.so;
+	cp -r $(@D)/gcnano-userland-multi-$(GCNANO_BINARIES_FILE_VERSION)-20190626/usr/include/* $(1)/usr/include/
+endef

This was over-complicated, and had a not great side effect: each library was installed in two copies: a "release" copy, and a "debug" copy. The symlinks point to the "release" copy, but the "debug" copy is just there taking up storage space for no reason. Also, creating the symlinks manually is not needed: they already exist in the package "source code".

So I changed this to:

GCNANO_BINARIES_LIBRARIES = \
gbm_viv libEGL libGAL libgbm libGLESv1_CM \
libGLESv2 libGLSLC libOpenVG libVSC

GCNANO_BINARIES_USERLAND_SUBDIR = gcnano-userland-multi-$(GCNANO_BINARIES_USERLAND_VERSION)

define GCNANO_BINARIES_INSTALL

        $(foreach lib,$(GCNANO_BINARIES_LIBRARIES), \
                $(INSTALL) -D -m 0755 $(@D)/$(GCNANO_BINARIES_USERLAND_SUBDIR)/usr/lib/$(lib).$(GCNANO_BINARIES_LIB_VERSION).multi.release.so \
                        $(1)/usr/lib/$(lib).$(GCNANO_BINARIES_LIB_VERSION).multi.release.so ; \
                cp -a $(@D)/$(GCNANO_BINARIES_USERLAND_SUBDIR)/usr/lib/$(lib).so* $(1)/usr/lib
        )
        cp -a $(@D)/$(GCNANO_BINARIES_USERLAND_SUBDIR)/usr/include/* $(1)/usr/include/

endef

which hopefully does the same thing, but in a slightly more compact way, and avoid the library duplication.

Could you test if what I have committed to the next branch continues to work for you ?

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#3 lore raw

PATCH v2 1/2 package/gcnano-binaries: new package

Hi Thomas,

I tested the patch.
Qt does not compile, because the package config files are missing.

I fixed it with adding the two lines below.

Should I send a new patch?

Quoted 116 lines

Gesendet: Freitag, 15. November 2019 um 23:26 Uhr
Von: "Thomas Petazzoni" <[email protected]>
An: "Jens Kleintje" <[email protected]>
Cc: buildroot at busybox.net
Betreff: Re: [Buildroot] [PATCH v2 1/2] package/gcnano-binaries: new package

Hello Jens,

Quoted 5 lines · On Thu, 14 Nov 2019 09:55:28 +0100 Jens Kleintje <[email protected]> wrote:

New package which provides the driver and binary blob libraries for the STM32MP157 vivante gcnano gpu.
The precompiled libaries depends on wayland and libdrm.

Thanks for this new version, I have applied it to our next branch, but after doing a number of changes. See below.

DEVELOPERS F: package/tinc/ · line 2541

Quoted 11 lines
DEVELOPERS +3 -0
index cdd44be37c..9c39bbd41e 100644
@@ -2536,3 +2536,6 @@ F:	package/tinc/
 N:  Aussedat Louis <[email protected]>
 F:	board/friendlyarm/nanopi-neo-plus2/
 F:	configs/friendlyarm_nanopi_neo_plus2_defconfig
+
+N:	Jens Kleintje <[email protected]>
+F:	package/gcnano-binaries

Alphabetic ordering was not good. Yes, the entry of Aussedat Louis was also not at the right place, but it has been fixed in the mean time.

package/gcnano-binaries/Config.in line 1

Quoted 7 lines
package/gcnano-binaries/Config.in new file +1 -0
new file mode 100644
index 0000000000..9cc9d149c0
@@ -0,0 +1,24 @@
+comment "gcnano binaries  needs a Linux kernel to be built"

gcnano binaries -> gcnano-binaries. And there were two spaces before "needs"

package/gcnano-binaries/Config.in line 5

Quoted 4 lines
package/gcnano-binaries/Config.in new file +4 -0
+	depends on !BR2_LINUX_KERNEL
+
+config BR2_PACKAGE_GCNANO_BINARIES
+	bool "gcnano binaries"

bool "gcnano-binaries"

package/gcnano-binaries/Config.in line 7

Quoted 2 lines
package/gcnano-binaries/Config.in new file +2 -0
+	depends on BR2_arm
+	depends on BR2_LINUX_KERNEL

You forgot a number of dependencies here:

- glibc dependency, because the pre-built binary blobs will only work with glibc

- threads, which is a dependency of libdrm and wayland, so we have to replicate it

- dynamic libraries, because wayland has a !BR2_STATIC_LIBS dependency

package/gcnano-binaries/Config.in line 9

Quoted 2 lines
package/gcnano-binaries/Config.in new file +2 -0
+
+GCNANO_BINARIES_FILE_VERSION = 6.2.4.p4

I've improved this a bit with:

GCNANO_BINARIES_LIB_VERSION = 6.2.4 GCNANO_BINARIES_DRIVER_VERSION = $(GCNANO_BINARIES_LIB_VERSION).p4 GCNANO_BINARIES_USERLAND_VERSION = $(GCNANO_BINARIES_LIB_VERSION).p4-20190626

which I then use throughout the .mk file.

Quoted 11 lines
package/gcnano-binaries/Config.in new file +11 -0
+# The wayland-egl.pc and libwayland-egl.so are provided by the wayland package
+define GCNANO_BINARIES_INSTALL
+	rm -f $(@D)/gcnano-userland-multi-$(GCNANO_BINARIES_FILE_VERSION)-20190626/usr/lib/pkgconfig/wayland-egl.pc
+	rm -f $(@D)/gcnano-userland-multi-$(GCNANO_BINARIES_FILE_VERSION)-20190626/usr/lib/libwayland-egl.so.1
+	rm -f $(@D)/gcnano-userland-multi-$(GCNANO_BINARIES_FILE_VERSION)-20190626/usr/lib/libwayland-egl.so
+	cp -r $(@D)/gcnano-userland-multi-$(GCNANO_BINARIES_FILE_VERSION)-20190626/usr/lib/* $(1)/usr/lib/
+	cd $(1)/usr/lib; \
+	ln -sf gbm_viv.6.2.4.multi.release.so gbm_viv.so; \
+	ln -sf libEGL.6.2.4.multi.release.so libEGL.so; \
+	ln -sf libEGL.so libEGL.so.1; \
+	ln -sf libGAL.6.2.4.multi.release.so libGAL.so; \

package/gcnano-binaries/Config.in

Quoted 10 lines
package/gcnano-binaries/Config.in new file +10 -0
+	ln -sf libgbm.6.2.4.multi.release.so libgbm.so; \
+	ln -sf libgbm.so libgbm.so.1; \
+	ln -sf libGLESv1_CM.6.2.4.multi.release.so libGLESv1_CM.so; \
+	ln -sf libGLESv2.6.2.4.multi.release.so libGLESv2.so; \
+	ln -sf libGLESv2.so libGLESv2.so.2; \
+	ln -sf libGLSLC.6.2.4.multi.release.so libGLSLC.so; \
+	ln -sf libOpenVG.6.2.4.multi.release.so libOpenVG.so; \
+	ln -sf libVSC.6.2.4.multi.release.so libVSC.so;
+	cp -r $(@D)/gcnano-userland-multi-$(GCNANO_BINARIES_FILE_VERSION)-20190626/usr/include/* $(1)/usr/include/
+endef

This was over-complicated, and had a not great side effect: each library was installed in two copies: a "release" copy, and a "debug" copy. The symlinks point to the "release" copy, but the "debug" copy is just there taking up storage space for no reason. Also, creating the symlinks manually is not needed: they already exist in the package "source code".

So I changed this to:

GCNANO_BINARIES_LIBRARIES = \
gbm_viv libEGL libGAL libgbm libGLESv1_CM \
libGLESv2 libGLSLC libOpenVG libVSC

GCNANO_BINARIES_USERLAND_SUBDIR = gcnano-userland-multi-$(GCNANO_BINARIES_USERLAND_VERSION)

Quoted 7 lines

define GCNANO_BINARIES_INSTALL

        $(foreach lib,$(GCNANO_BINARIES_LIBRARIES), \
                $(INSTALL) -D -m 0755 $(@D)/$(GCNANO_BINARIES_USERLAND_SUBDIR)/usr/lib/$(lib).$(GCNANO_BINARIES_LIB_VERSION).multi.release.so \
                        $(1)/usr/lib/$(lib).$(GCNANO_BINARIES_LIB_VERSION).multi.release.so ; \
                cp -a $(@D)/$(GCNANO_BINARIES_USERLAND_SUBDIR)/usr/lib/$(lib).so* $(1)/usr/lib
        )
        cp -a $(@D)/$(GCNANO_BINARIES_USERLAND_SUBDIR)/usr/include/* $(1)/usr/include/

Add here:
+ rm -rf $(@D)/$(GCNANO_BINARIES_USERLAND_SUBDIR)/usr/lib/pkgconfig/wayland-egl.pc
+ cp -a $(@D)/$(GCNANO_BINARIES_USERLAND_SUBDIR)/usr/lib/pkgconfig/* $(1)/usr/lib/pkgconfig/

Quoted 10 lines

endef

which hopefully does the same thing, but in a slightly more compact way, and avoid the library duplication.

Could you test if what I have committed to the next branch continues to work for you ?

Thanks!

Quoted 10 lines

Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

Regards

Jens Kleintje

#4 lore raw

PATCH v2 2/2 package/qt5/qt5base: add support for gcnano-binaries

In reply to Jens Kleintje
---
 package/qt5/qt5base/qt5base.mk | 6 ++++++
 1 file changed, 6 insertions(+)
package/qt5/qt5base/qt5base.mk +6 -0
index 15c9650391..1a152be94b 100644
@@ -78,6 +78,9 @@ endif
 ifeq ($(BR2_PACKAGE_MESA3D_OPENGL_EGL),y)
 QT5BASE_CONFIGURE_OPTS += -gbm
 QT5BASE_DEPENDENCIES += mesa3d
+else ifeq ($(BR2_PACKAGE_GCNANO_BINARIES),y)
+QT5BASE_CONFIGURE_OPTS += -gbm
+QT5BASE_DEPENDENCIES += gcnano-binaries
 else
 QT5BASE_CONFIGURE_OPTS += -no-gbm
 endif
@@ -289,6 +292,9 @@ QT5BASE_INSTALL_LIBS_$(BR2_PACKAGE_QT5BASE_EGLFS)      += Qt5EglFSDeviceIntegrat
 ifeq ($(BR2_PACKAGE_MESA3D_OPENGL_EGL),y)
 QT5BASE_INSTALL_LIBS_$(BR2_PACKAGE_QT5BASE_EGLFS)      += Qt5EglFsKmsSupport
 endif
+ifeq ($(BR2_PACKAGE_GCNANO_BINARIES),y)
+QT5BASE_INSTALL_LIBS_$(BR2_PACKAGE_QT5BASE_EGLFS)      += Qt5EglFsKmsSupport
+endif
 else
 QT5BASE_INSTALL_LIBS_$(BR2_PACKAGE_QT5BASE_EGLFS)      += Qt5EglDeviceIntegration
 endif

--
2.17.1

#5 lore raw

PATCH v2 2/2 package/qt5/qt5base: add support for gcnano-binaries

Quoted 4 lines · On Thu, 14 Nov 2019 09:55:29 +0100 Jens Kleintje <[email protected]> wrote:
---
 package/qt5/qt5base/qt5base.mk | 6 ++++++
 1 file changed, 6 insertions(+)

Applied to next, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com