All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 0/2] package/gcnano-binaries: new package
@ 2019-11-06 15:56 Jens Kleintje
  2019-11-06 15:56 ` [Buildroot] [PATCH 1/2] " Jens Kleintje
  2019-11-06 15:56 ` [Buildroot] [PATCH 2/2] package/qt5/qt5base: add support for gcnano-binaries Jens Kleintje
  0 siblings, 2 replies; 10+ messages in thread
From: Jens Kleintje @ 2019-11-06 15:56 UTC (permalink / raw)
  To: buildroot

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.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Buildroot] [PATCH 1/2] package/gcnano-binaries: new package
  2019-11-06 15:56 [Buildroot] [PATCH 0/2] package/gcnano-binaries: new package Jens Kleintje
@ 2019-11-06 15:56 ` Jens Kleintje
  2019-11-06 22:08   ` Thomas Petazzoni
  2019-11-06 15:56 ` [Buildroot] [PATCH 2/2] package/qt5/qt5base: add support for gcnano-binaries Jens Kleintje
  1 sibling, 1 reply; 10+ messages in thread
From: Jens Kleintje @ 2019-11-06 15:56 UTC (permalink / raw)
  To: buildroot

New package which provides the driver and binary blob libraries for the
STM32MP157 vivante gcnano gpu.
The precompiled libaries depends on wayland and libdrm.
Since the github repo has no releases/tags we use the standard git method
with explicit SHA.
---
 package/Config.in                            |  1 +
 package/gcnano-binaries/gcnano-binaries.hash |  2 +
 package/gcnano-binaries/gcnano-binaries.mk   | 87 ++++++++++++++++++++
 3 files changed, 90 insertions(+)
 create mode 100644 package/gcnano-binaries/gcnano-binaries.hash
 create mode 100644 package/gcnano-binaries/gcnano-binaries.mk

diff --git a/package/Config.in b/package/Config.in
index dc5ec56d6b..1a88da547d 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -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"
diff --git a/package/gcnano-binaries/gcnano-binaries.hash b/package/gcnano-binaries/gcnano-binaries.hash
new file mode 100644
index 0000000000..fae7e56deb
--- /dev/null
+++ b/package/gcnano-binaries/gcnano-binaries.hash
@@ -0,0 +1,2 @@
+sha256 19f3fe4e83ec95fd2ecb70d5cb03c7b00a13357966a9b6e56b59e5788c550c88  gcnano-binaries-c01642ed5e18cf09ecd905af193e935cb3be95ed.tar.gz
+sha256 7d209718473d18f69f75adb7caf9cb5d4b0a31da068756aa011bea617de3dc57  EULA
diff --git a/package/gcnano-binaries/gcnano-binaries.mk b/package/gcnano-binaries/gcnano-binaries.mk
new file mode 100644
index 0000000000..806abd7840
--- /dev/null
+++ b/package/gcnano-binaries/gcnano-binaries.mk
@@ -0,0 +1,87 @@
+################################################################################
+#
+# VIVANTE GCNANO BINARIES
+#
+################################################################################
+
+
+GCNANO_BINARIES_FILE_VERSION = 6.2.4.p4
+GCNANO_BINARIES_VERSION = c01642ed5e18cf09ecd905af193e935cb3be95ed
+GCNANO_BINARIES_SITE = https://github.com/STMicroelectronics/gcnano-binaries.git
+GCNANO_BINARIES_SITE_METHOD = git
+
+GCNANO_BINARIES_LICENSE = MIT, Vivante End User Software License Terms
+GCNANO_BINARIES_LICENSE_FILES = EULA
+GCNANO_BINARIES_REDISTRIBUTE = NO
+
+GCNANO_BINARIES_DEPENDENCIES = linux wayland libdrm
+
+GCNANO_BINARIES_INSTALL_STAGING = YES
+
+GCNANO_BINARIES_PROVIDES = libegl libgles
+
+define GCNANO_BINARIES_EXTRACT_HELPER
+        awk 'BEGIN      { start = 0; } \
+             /^EOEULA/  { start = 0; } \
+                        { if (start) print; } \
+             /<<EOEULA/ { start = 1; }' \
+            $(1) > $(@D)/EULA
+        cd $(@D) && sh $(1) --auto-accept
+        find $(@D)/$(basename $(notdir $(1))) -mindepth 1 -maxdepth 1 -exec mv {} $(@D) \;
+        rmdir $(@D)/$(basename $(notdir $(1)))
+endef
+
+
+define GCNANO_BINARIES_EXTRACT_CMDS
+gzip -d -c $(GCNANO_BINARIES_DL_DIR)/gcnano-binaries-$(GCNANO_BINARIES_VERSION).tar.gz | tar --strip-components=1 -C $(@D) -xf -
+tar --strip-components=1 -xJf $(@D)/gcnano-driver-$(GCNANO_BINARIES_FILE_VERSION).tar.xz -C $(@D)
+$(call GCNANO_BINARIES_EXTRACT_HELPER,$(@D)/gcnano-userland-multi-$(GCNANO_BINARIES_FILE_VERSION)-20190626.bin)
+endef
+
+GCNANO_BINARIES_MODULE_MAKE_OPTS = \
+	KERNEL_DIR=$(LINUX_DIR) \
+	SOC_PLATFORM=st-st\
+	AQROOT=$(@D)\
+	DEBUG=0
+
+define GCNANO_BINARIES_INSTALL_STAGING_CMDS
+	cp $(@D)/usr/lib/pkgconfig/* $(STAGING_DIR)/usr/lib/pkgconfig/
+	cp -r $(@D)/usr/lib/* $(STAGING_DIR)/usr/lib/
+	cd $(STAGING_DIR)/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; \
+	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
+	rm -f $(STAGING_DIR)/usr/lib/pkgconfig/wayland-egl.pc
+	cp -r $(@D)/usr/include/* $(STAGING_DIR)/usr/include/
+endef
+
+GCNANO_BINARIES_POST_INSTALL_TARGET_HOOKS += GCNANO_BINARIES_COPY_LIBS
+
+define GCNANO_BINARIES_COPY_LIBS
+	cp -r $(@D)/usr/lib/* $(TARGET_DIR)/usr/lib/
+	cd $(TARGET_DIR)/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; \
+	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;
+endef
+
+$(eval $(kernel-module))
+$(eval $(generic-package))
--
2.17.1

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [Buildroot] [PATCH 2/2] package/qt5/qt5base: add support for gcnano-binaries
  2019-11-06 15:56 [Buildroot] [PATCH 0/2] package/gcnano-binaries: new package Jens Kleintje
  2019-11-06 15:56 ` [Buildroot] [PATCH 1/2] " Jens Kleintje
@ 2019-11-06 15:56 ` Jens Kleintje
  2019-11-06 22:18   ` Thomas Petazzoni
  1 sibling, 1 reply; 10+ messages in thread
From: Jens Kleintje @ 2019-11-06 15:56 UTC (permalink / raw)
  To: buildroot

---
 package/qt5/qt5base/qt5base.mk | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/package/qt5/qt5base/qt5base.mk b/package/qt5/qt5base/qt5base.mk
index 15c9650391..1a152be94b 100644
--- a/package/qt5/qt5base/qt5base.mk
+++ b/package/qt5/qt5base/qt5base.mk
@@ -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

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [Buildroot] [PATCH 1/2] package/gcnano-binaries: new package
  2019-11-06 15:56 ` [Buildroot] [PATCH 1/2] " Jens Kleintje
@ 2019-11-06 22:08   ` Thomas Petazzoni
       [not found]     ` <trinity-e5303488-a97e-46bb-8738-520846b1c6db-1573110060239@3c-app-webde-bap18>
  0 siblings, 1 reply; 10+ messages in thread
From: Thomas Petazzoni @ 2019-11-06 22:08 UTC (permalink / raw)
  To: buildroot

Hello Jens,

Thanks for your contribution! I suppose you're the person I met last
week during the Embedded Linux Conference Europe in Lyon, who asked me
about submitting this gcnano-binaries package ?

In any case, glad to see this package being contributed.

On Wed,  6 Nov 2019 16:56:10 +0100
Jens Kleintje <scooby22@web.de> 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.
> Since the github repo has no releases/tags we use the standard git method
> with explicit SHA.

We need your Signed-off-by line here.

> ---
>  package/Config.in                            |  1 +
>  package/gcnano-binaries/gcnano-binaries.hash |  2 +
>  package/gcnano-binaries/gcnano-binaries.mk   | 87 ++++++++++++++++++++

You forgot to include the package/gcnano-binaries/Config.in file in
your patch, so we cannot review the full package.

Also, please add an entry in the DEVELOPERS file for this new package.

> diff --git a/package/gcnano-binaries/gcnano-binaries.hash b/package/gcnano-binaries/gcnano-binaries.hash
> new file mode 100644
> index 0000000000..fae7e56deb
> --- /dev/null
> +++ b/package/gcnano-binaries/gcnano-binaries.hash
> @@ -0,0 +1,2 @@
> +sha256 19f3fe4e83ec95fd2ecb70d5cb03c7b00a13357966a9b6e56b59e5788c550c88  gcnano-binaries-c01642ed5e18cf09ecd905af193e935cb3be95ed.tar.gz
> +sha256 7d209718473d18f69f75adb7caf9cb5d4b0a31da068756aa011bea617de3dc57  EULA
> diff --git a/package/gcnano-binaries/gcnano-binaries.mk b/package/gcnano-binaries/gcnano-binaries.mk
> new file mode 100644
> index 0000000000..806abd7840
> --- /dev/null
> +++ b/package/gcnano-binaries/gcnano-binaries.mk
> @@ -0,0 +1,87 @@
> +################################################################################
> +#
> +# VIVANTE GCNANO BINARIES
> +#
> +################################################################################
> +
> +
> +GCNANO_BINARIES_FILE_VERSION = 6.2.4.p4
> +GCNANO_BINARIES_VERSION = c01642ed5e18cf09ecd905af193e935cb3be95ed
> +GCNANO_BINARIES_SITE = https://github.com/STMicroelectronics/gcnano-binaries.git
> +GCNANO_BINARIES_SITE_METHOD = git

Please use the "github" helper macro:

GCNANO_BINARIES_VERSION = c01642ed5e18cf09ecd905af193e935cb3be95ed
GCNANO_BINARIES_SITE = $(call github,STMicroelectronics,gcnano-binaries,$(GCNANO_BINARIES_VERSION))

and remove the _SITE_METHOD variable.

> +
> +GCNANO_BINARIES_LICENSE = MIT, Vivante End User Software License Terms
> +GCNANO_BINARIES_LICENSE_FILES = EULA
> +GCNANO_BINARIES_REDISTRIBUTE = NO
> +
> +GCNANO_BINARIES_DEPENDENCIES = linux wayland libdrm
> +
> +GCNANO_BINARIES_INSTALL_STAGING = YES
> +
> +GCNANO_BINARIES_PROVIDES = libegl libgles
> +
> +define GCNANO_BINARIES_EXTRACT_HELPER
> +        awk 'BEGIN      { start = 0; } \
> +             /^EOEULA/  { start = 0; } \
> +                        { if (start) print; } \
> +             /<<EOEULA/ { start = 1; }' \
> +            $(1) > $(@D)/EULA
> +        cd $(@D) && sh $(1) --auto-accept
> +        find $(@D)/$(basename $(notdir $(1))) -mindepth 1 -maxdepth 1 -exec mv {} $(@D) \;
> +        rmdir $(@D)/$(basename $(notdir $(1)))
> +endef
> +
> +
> +define GCNANO_BINARIES_EXTRACT_CMDS
> +gzip -d -c $(GCNANO_BINARIES_DL_DIR)/gcnano-binaries-$(GCNANO_BINARIES_VERSION).tar.gz | tar --strip-components=1 -C $(@D) -xf -
> +tar --strip-components=1 -xJf $(@D)/gcnano-driver-$(GCNANO_BINARIES_FILE_VERSION).tar.xz -C $(@D)

These two lines look like the default extract commands, so why are you
doing this ? Just because you need to call the
GCNANO_BINARIES_EXTRACT_HELPER ?

If so, then you don't need that, simply do:

GCNANO_BINARIES_POST_EXTRACT_HOOKS += GCNANO_BINARIES_EXTRACT_HELPER

and in GCNANO_BINARIES_EXTRACT_HELPER, instead of using $(1), just use
$(@D)/gcnano-userland-multi-$(GCNANO_BINARIES_FILE_VERSION)-20190626.bin
directly.

Also, could you add a comment on top of GCNANO_BINARIES_EXTRACT_HELPER
to explain what it does, because it is not obvious.

> +$(call GCNANO_BINARIES_EXTRACT_HELPER,$(@D)/gcnano-userland-multi-$(GCNANO_BINARIES_FILE_VERSION)-20190626.bin)
> +endef
> +
> +GCNANO_BINARIES_MODULE_MAKE_OPTS = \
> +	KERNEL_DIR=$(LINUX_DIR) \
> +	SOC_PLATFORM=st-st\

Space before \

> +	AQROOT=$(@D)\

Ditto.

> +	DEBUG=0
> +
> +define GCNANO_BINARIES_INSTALL_STAGING_CMDS
> +	cp $(@D)/usr/lib/pkgconfig/* $(STAGING_DIR)/usr/lib/pkgconfig/
> +	cp -r $(@D)/usr/lib/* $(STAGING_DIR)/usr/lib/
> +	cd $(STAGING_DIR)/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; \
> +	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
> +	rm -f $(STAGING_DIR)/usr/lib/pkgconfig/wayland-egl.pc

Why are you removing this .pc file ?

> +	cp -r $(@D)/usr/include/* $(STAGING_DIR)/usr/include/
> +endef
> +
> +GCNANO_BINARIES_POST_INSTALL_TARGET_HOOKS += GCNANO_BINARIES_COPY_LIBS

I am not sure why you are using a
GCNANO_BINARIES_POST_INSTALL_TARGET_HOOKS. Why not simply rename
GCNANO_BINARIES_COPY_LIBS to GCNANO_BINARIES_INSTALL_TARGET_CMDS.

> +define GCNANO_BINARIES_COPY_LIBS
> +	cp -r $(@D)/usr/lib/* $(TARGET_DIR)/usr/lib/
> +	cd $(TARGET_DIR)/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; \
> +	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;
> +endef

The long list of symlinks to be created is not nice, but I don't really
see a nicer solution to achieve the same. Perhaps one thing that could
be done is to factorize stuff a bit:

define GCNANO_BINARIES_INSTALL
	cp $(@D)/usr/lib/pkgconfig/* $(1)/usr/lib/pkgconfig/
	cp -r $(@D)/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; \
	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
	rm -f $(1)/usr/lib/pkgconfig/wayland-egl.pc
	cp -r $(@D)/usr/include/* $(1)/usr/include/
endef

And then:

define GCNANO_BINARIES_INSTALL_STAGING_CMDS
	$(call GCNANO_BINARIES_INSTALL,$(STAGING_DIR))
endef

define GCNANO_BINARIES_INSTALL_TARGET_CMDS
	$(call GCNANO_BINARIES_INSTALL,$(TARGET_DIR))
endef

Note: it is perfectly fine to install header files and .pc files to
$(TARGET_DIR), they anyway get cleaned up later in the build.

Could you rework your patch to take into account those comments ?

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Buildroot] [PATCH 2/2] package/qt5/qt5base: add support for gcnano-binaries
  2019-11-06 15:56 ` [Buildroot] [PATCH 2/2] package/qt5/qt5base: add support for gcnano-binaries Jens Kleintje
@ 2019-11-06 22:18   ` Thomas Petazzoni
  0 siblings, 0 replies; 10+ messages in thread
From: Thomas Petazzoni @ 2019-11-06 22:18 UTC (permalink / raw)
  To: buildroot

Hello Jens,

On Wed,  6 Nov 2019 16:56:11 +0100
Jens Kleintje <scooby22@web.de> wrote:

We need your Signed-off-by line in the commit log.

> ---
>  package/qt5/qt5base/qt5base.mk | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/package/qt5/qt5base/qt5base.mk b/package/qt5/qt5base/qt5base.mk
> index 15c9650391..1a152be94b 100644
> --- a/package/qt5/qt5base/qt5base.mk
> +++ b/package/qt5/qt5base/qt5base.mk
> @@ -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

I think at some point, we will have to get rid of this, using a libgbm
virtual package. I tried at
https://github.com/tpetazzoni/buildroot/commits/gbm, but it was not
very convincing as the existing gbm implementation we have were not
really compatible with each other. But perhaps this will make more
sense now.

Anyway, don't worry about this: we won't make this a requirement to
merge the gcnano-binaries support. We can for now do it like you're
proposing.

But we do need your Signed-off-by line in the commit log.

Thanks,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Buildroot] [PATCH 1/2] package/gcnano-binaries: new package
       [not found]     ` <trinity-e5303488-a97e-46bb-8738-520846b1c6db-1573110060239@3c-app-webde-bap18>
@ 2019-11-11 10:19       ` Jens Kleintje
  2019-11-11 13:16         ` Thomas Petazzoni
  0 siblings, 1 reply; 10+ messages in thread
From: Jens Kleintje @ 2019-11-11 10:19 UTC (permalink / raw)
  To: buildroot

> Gesendet:?Mittwoch, 06. November 2019 um 23:08 Uhr
> Von:?"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>
> An:?"Jens Kleintje" <scooby22@web.de>
> Cc:?buildroot at busybox.net
> Betreff:?Re: [Buildroot] [PATCH 1/2] package/gcnano-binaries: new package
> Hello Jens,

> Thanks for your contribution! I suppose you're the person I met last
> week during the Embedded Linux Conference Europe in Lyon, who asked me
> about submitting this gcnano-binaries package ?
You are right.

> > In any case, glad to see this package being contributed.

> > On Wed, 6 Nov 2019 16:56:10 +0100
> > Jens Kleintje <scooby22@web.de> 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.
> > Since the github repo has no releases/tags we use the standard git method
> > with explicit SHA.

> We need your Signed-off-by line here.
OK

> > ---
> > package/Config.in | 1 +
> > package/gcnano-binaries/gcnano-binaries.hash | 2 +
> > package/gcnano-binaries/gcnano-binaries.mk | 87 ++++++++++++++++++++

> You forgot to include the package/gcnano-binaries/Config.in file in
> your patch, so we cannot review the full package.
Sorry

> Also, please add an entry in the DEVELOPERS file for this new package.
OK

> > diff --git a/package/gcnano-binaries/gcnano-binaries.hash b/package/gcnano-binaries/gcnano-binaries.hash
> > new file mode 100644
> > index 0000000000..fae7e56deb
> > --- /dev/null
> > +++ b/package/gcnano-binaries/gcnano-binaries.hash
> > @@ -0,0 +1,2 @@
> > +sha256 19f3fe4e83ec95fd2ecb70d5cb03c7b00a13357966a9b6e56b59e5788c550c88 gcnano-binaries-c01642ed5e18cf09ecd905af193e935cb3be95ed.tar.gz
> > +sha256 7d209718473d18f69f75adb7caf9cb5d4b0a31da068756aa011bea617de3dc57 EULA
> > diff --git a/package/gcnano-binaries/gcnano-binaries.mk b/package/gcnano-binaries/gcnano-binaries.mk
> > new file mode 100644
> > index 0000000000..806abd7840
> > --- /dev/null
> > +++ b/package/gcnano-binaries/gcnano-binaries.mk
> > @@ -0,0 +1,87 @@
> > +################################################################################
> > +#
> > +# VIVANTE GCNANO BINARIES
> > +#
> > +################################################################################
> > +
> > +
> > +GCNANO_BINARIES_FILE_VERSION = 6.2.4.p4
> > +GCNANO_BINARIES_VERSION = c01642ed5e18cf09ecd905af193e935cb3be95ed
> > +GCNANO_BINARIES_SITE = https://github.com/STMicroelectronics/gcnano-binaries.git
> > +GCNANO_BINARIES_SITE_METHOD = git

> Please use the "github" helper macro:

> GCNANO_BINARIES_VERSION = c01642ed5e18cf09ecd905af193e935cb3be95ed
> GCNANO_BINARIES_SITE = $(call github,STMicroelectronics,gcnano-binaries,$(GCNANO_BINARIES_VERSION))

> and remove the _SITE_METHOD variable.
The page (https://github.com/STMicroelectronics/gcnano-binaries)
has no release and no tag. So I think there is no archive directory.

> > +
> > +GCNANO_BINARIES_LICENSE = MIT, Vivante End User Software License Terms
> > +GCNANO_BINARIES_LICENSE_FILES = EULA
> > +GCNANO_BINARIES_REDISTRIBUTE = NO
> > +
> > +GCNANO_BINARIES_DEPENDENCIES = linux wayland libdrm
> > +
> > +GCNANO_BINARIES_INSTALL_STAGING = YES
> > +
> > +GCNANO_BINARIES_PROVIDES = libegl libgles
> > +
> > +define GCNANO_BINARIES_EXTRACT_HELPER
> > + awk 'BEGIN { start = 0; } \
> > + /^EOEULA/ { start = 0; } \
> > + { if (start) print; } \
> > + /<<EOEULA/ { start = 1; }' \
> > + $(1) > $(@D)/EULA
> > + cd $(@D) && sh $(1) --auto-accept
> > + find $(@D)/$(basename $(notdir $(1))) -mindepth 1 -maxdepth 1 -exec mv {} $(@D) \;
> > + rmdir $(@D)/$(basename $(notdir $(1)))
> > +endef
> > +
> > +
> > +define GCNANO_BINARIES_EXTRACT_CMDS
> > +gzip -d -c $(GCNANO_BINARIES_DL_DIR)/gcnano-binaries-$(GCNANO_BINARIES_VERSION).tar.gz | tar --strip-components=1 -C $(@D) -xf -
> > +tar --strip-components=1 -xJf $(@D)/gcnano-driver-$(GCNANO_BINARIES_FILE_VERSION).tar.xz -C $(@D)

> These two lines look like the default extract commands, so why are you
> doing this ? Just because you need to call the
> GCNANO_BINARIES_EXTRACT_HELPER ?

> If so, then you don't need that, simply do:

> GCNANO_BINARIES_POST_EXTRACT_HOOKS += GCNANO_BINARIES_EXTRACT_HELPER

> and in GCNANO_BINARIES_EXTRACT_HELPER, instead of using $(1), just use
> $(@D)/gcnano-userland-multi-$(GCNANO_BINARIES_FILE_VERSION)-20190626.bin
> directly.

> Also, could you add a comment on top of GCNANO_BINARIES_EXTRACT_HELPER
> to explain what it does, because it is not obvious.
OK

> > +$(call GCNANO_BINARIES_EXTRACT_HELPER,$(@D)/gcnano-userland-multi-$(GCNANO_BINARIES_FILE_VERSION)-20190626.bin)
> > +endef
> > +
> > +GCNANO_BINARIES_MODULE_MAKE_OPTS = \
> > + KERNEL_DIR=$(LINUX_DIR) \
> > + SOC_PLATFORM=st-st\

> Space before \

> > + AQROOT=$(@D)\

> Ditto.

> > + DEBUG=0
> > +
> > +define GCNANO_BINARIES_INSTALL_STAGING_CMDS
> > + cp $(@D)/usr/lib/pkgconfig/* $(STAGING_DIR)/usr/lib/pkgconfig/
> > + cp -r $(@D)/usr/lib/* $(STAGING_DIR)/usr/lib/
> > + cd $(STAGING_DIR)/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; \
> > + 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
> > + rm -f $(STAGING_DIR)/usr/lib/pkgconfig/wayland-egl.pc

> Why are you removing this .pc file ?
The file is already provided by wayland package.
I saw it from in the yocto package  
https://github.com/STMicroelectronics/meta-st-stm32mp/blob/thud/recipes-graphics/gcnano-userland/gcnano-userland-binary.inc

> > + cp -r $(@D)/usr/include/* $(STAGING_DIR)/usr/include/
> > +endef
> > +
> > +GCNANO_BINARIES_POST_INSTALL_TARGET_HOOKS += GCNANO_BINARIES_COPY_LIBS

> I am not sure why you are using a
> GCNANO_BINARIES_POST_INSTALL_TARGET_HOOKS. Why not simply rename
> GCNANO_BINARIES_COPY_LIBS to GCNANO_BINARIES_INSTALL_TARGET_CMDS.
I need to accept the EULA. But some parts I will move.

> > +define GCNANO_BINARIES_COPY_LIBS
> > + cp -r $(@D)/usr/lib/* $(TARGET_DIR)/usr/lib/
> > + cd $(TARGET_DIR)/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; \
> > + 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;
> > +endef

> The long list of symlinks to be created is not nice, but I don't really
> see a nicer solution to achieve the same. Perhaps one thing that could
> be done is to factorize stuff a bit:

> define GCNANO_BINARIES_INSTALL
> cp $(@D)/usr/lib/pkgconfig/* $(1)/usr/lib/pkgconfig/
> cp -r $(@D)/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; \
> 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
> rm -f $(1)/usr/lib/pkgconfig/wayland-egl.pc
> cp -r $(@D)/usr/include/* $(1)/usr/include/
> endef

> And then:

> define GCNANO_BINARIES_INSTALL_STAGING_CMDS
> $(call GCNANO_BINARIES_INSTALL,$(STAGING_DIR))
> endef

> define GCNANO_BINARIES_INSTALL_TARGET_CMDS
> $(call GCNANO_BINARIES_INSTALL,$(TARGET_DIR))
> endef

> Note: it is perfectly fine to install header files and .pc files to
> $(TARGET_DIR), they anyway get cleaned up later in the build.
OK

> Could you rework your patch to take into account those comments ?
Will come soon.
> Thanks!

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

Jens Kleintje

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Buildroot] [PATCH 1/2] package/gcnano-binaries: new package
  2019-11-11 10:19       ` Jens Kleintje
@ 2019-11-11 13:16         ` Thomas Petazzoni
  2019-11-11 13:48           ` Jens Kleintje
  0 siblings, 1 reply; 10+ messages in thread
From: Thomas Petazzoni @ 2019-11-11 13:16 UTC (permalink / raw)
  To: buildroot

Hello Jens,

On Mon, 11 Nov 2019 11:19:31 +0100
"Jens Kleintje" <Scooby22@web.de> wrote:

> > Please use the "github" helper macro:  
> 
> > GCNANO_BINARIES_VERSION = c01642ed5e18cf09ecd905af193e935cb3be95ed
> > GCNANO_BINARIES_SITE = $(call github,STMicroelectronics,gcnano-binaries,$(GCNANO_BINARIES_VERSION))  
> 
> > and remove the _SITE_METHOD variable.  
> The page (https://github.com/STMicroelectronics/gcnano-binaries)
> has no release and no tag. So I think there is no archive directory.

Not a problem, the github macro works with any arbitrary commit.

> > > + rm -f $(STAGING_DIR)/usr/lib/pkgconfig/wayland-egl.pc  
> 
> > Why are you removing this .pc file ?  
> The file is already provided by wayland package.
> I saw it from in the yocto package  
> https://github.com/STMicroelectronics/meta-st-stm32mp/blob/thud/recipes-graphics/gcnano-userland/gcnano-userland-binary.inc

Then, if you could add a comment in the .mk file about this, it would
be good.

> > Could you rework your patch to take into account those comments ?  
> Will come soon.

Great, thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Buildroot] [PATCH 1/2] package/gcnano-binaries: new package
  2019-11-11 13:16         ` Thomas Petazzoni
@ 2019-11-11 13:48           ` Jens Kleintje
  2019-11-11 13:55             ` Thomas Petazzoni
  0 siblings, 1 reply; 10+ messages in thread
From: Jens Kleintje @ 2019-11-11 13:48 UTC (permalink / raw)
  To: buildroot



> Gesendet: Montag, 11. November 2019 um 14:16 Uhr
> Von: "Thomas Petazzoni" <thomas.petazzoni@bootlin.com>
> An: "Jens Kleintje" <Scooby22@web.de>
> Cc: buildroot at busybox.net
> Betreff: Re: [Buildroot] [PATCH 1/2] package/gcnano-binaries: new package
>
> Hello Jens,
>
> On Mon, 11 Nov 2019 11:19:31 +0100
> "Jens Kleintje" <Scooby22@web.de> wrote:
>
> > > Please use the "github" helper macro:
> >
> > > GCNANO_BINARIES_VERSION = c01642ed5e18cf09ecd905af193e935cb3be95ed
> > > GCNANO_BINARIES_SITE = $(call github,STMicroelectronics,gcnano-binaries,$(GCNANO_BINARIES_VERSION))
> >
> > > and remove the _SITE_METHOD variable.
> > The page (https://github.com/STMicroelectronics/gcnano-binaries)
> > has no release and no tag. So I think there is no archive directory.
>
> Not a problem, the github macro works with any arbitrary commit.
The problem is, that I get everytime the HEAD and not the commit with SHA c01642ed5e18cf09ecd905af193e935cb3be95ed.
Today I got the commit with SHA 271f87d816a957bf196f6328c34110cab1224d4d.
Did I miss something?
>
> > > > + rm -f $(STAGING_DIR)/usr/lib/pkgconfig/wayland-egl.pc
> >
> > > Why are you removing this .pc file ?
> > The file is already provided by wayland package.
> > I saw it from in the yocto package
> > https://github.com/STMicroelectronics/meta-st-stm32mp/blob/thud/recipes-graphics/gcnano-userland/gcnano-userland-binary.inc
>
> Then, if you could add a comment in the .mk file about this, it would
> be good.
>
> > > Could you rework your patch to take into account those comments ?
> > Will come soon.
>
> Great, thanks!
>
> 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
>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Buildroot] [PATCH 1/2] package/gcnano-binaries: new package
  2019-11-11 13:48           ` Jens Kleintje
@ 2019-11-11 13:55             ` Thomas Petazzoni
  2019-11-11 13:58               ` Jens Kleintje
  0 siblings, 1 reply; 10+ messages in thread
From: Thomas Petazzoni @ 2019-11-11 13:55 UTC (permalink / raw)
  To: buildroot

On Mon, 11 Nov 2019 14:48:08 +0100
"Jens Kleintje" <Scooby22@web.de> wrote:

> > Not a problem, the github macro works with any arbitrary commit.  
> The problem is, that I get everytime the HEAD and not the commit with SHA c01642ed5e18cf09ecd905af193e935cb3be95ed.
> Today I got the commit with SHA 271f87d816a957bf196f6328c34110cab1224d4d.
> Did I miss something?

Depends on how you did it I guess. Did you do it like this:

V4L2GRAB_VERSION = f8d8844d52387b3db7b8736f5e86156d9374f781
V4L2GRAB_SITE = $(call github,twam,v4l2grab,$(V4L2GRAB_VERSION))

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Buildroot] [PATCH 1/2] package/gcnano-binaries: new package
  2019-11-11 13:55             ` Thomas Petazzoni
@ 2019-11-11 13:58               ` Jens Kleintje
  0 siblings, 0 replies; 10+ messages in thread
From: Jens Kleintje @ 2019-11-11 13:58 UTC (permalink / raw)
  To: buildroot



> Gesendet: Montag, 11. November 2019 um 14:55 Uhr
> Von: "Thomas Petazzoni" <thomas.petazzoni@bootlin.com>
> An: "Jens Kleintje" <Scooby22@web.de>
> Cc: buildroot at busybox.net
> Betreff: Re: [Buildroot] [PATCH 1/2] package/gcnano-binaries: new package
>
> On Mon, 11 Nov 2019 14:48:08 +0100
> "Jens Kleintje" <Scooby22@web.de> wrote:
>
> > > Not a problem, the github macro works with any arbitrary commit.
> > The problem is, that I get everytime the HEAD and not the commit with SHA c01642ed5e18cf09ecd905af193e935cb3be95ed.
> > Today I got the commit with SHA 271f87d816a957bf196f6328c34110cab1224d4d.
> > Did I miss something?
>
> Depends on how you did it I guess. Did you do it like this:
>
> V4L2GRAB_VERSION = f8d8844d52387b3db7b8736f5e86156d9374f781
> V4L2GRAB_SITE = $(call github,twam,v4l2grab,$(V4L2GRAB_VERSION))
>
GCNANO_BINARIES_FILE_VERSION = 6.2.4.p4
GCNANO_BINARIES_VERSION = c01642ed5e18cf09ecd905af193e935cb3be95ed
GCNANO_BINARIES_SITE = $(call github,STMicroelectronics,gcnano-binaries,$(GCNANO_BINARIES_VERSION))
> Thomas
> --
> Thomas Petazzoni, CTO, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com
>

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-11-11 13:58 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-06 15:56 [Buildroot] [PATCH 0/2] package/gcnano-binaries: new package Jens Kleintje
2019-11-06 15:56 ` [Buildroot] [PATCH 1/2] " Jens Kleintje
2019-11-06 22:08   ` Thomas Petazzoni
     [not found]     ` <trinity-e5303488-a97e-46bb-8738-520846b1c6db-1573110060239@3c-app-webde-bap18>
2019-11-11 10:19       ` Jens Kleintje
2019-11-11 13:16         ` Thomas Petazzoni
2019-11-11 13:48           ` Jens Kleintje
2019-11-11 13:55             ` Thomas Petazzoni
2019-11-11 13:58               ` Jens Kleintje
2019-11-06 15:56 ` [Buildroot] [PATCH 2/2] package/qt5/qt5base: add support for gcnano-binaries Jens Kleintje
2019-11-06 22:18   ` Thomas Petazzoni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.