All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v1 1/3] package/opengl/libopenvx: new virtual package
@ 2020-02-09 13:44 Refik Tuzakli
  2020-02-09 13:44 ` [Buildroot] [PATCH v1 2/3] package/opengl/libvulkan: " Refik Tuzakli
  2020-02-09 13:44 ` [Buildroot] [PATCH v1 3/3] package/freescale-imx/imx-gpu-viv: add options for new feture Refik Tuzakli
  0 siblings, 2 replies; 6+ messages in thread
From: Refik Tuzakli @ 2020-02-09 13:44 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Refik Tuzakli <tuzakli.refik@gmail.com>
---
 DEVELOPERS                            | 1 +
 package/opengl/Config.in              | 1 +
 package/opengl/libopenvx/Config.in    | 6 ++++++
 package/opengl/libopenvx/libopenvx.mk | 7 +++++++
 4 files changed, 15 insertions(+)
 create mode 100644 package/opengl/libopenvx/Config.in
 create mode 100644 package/opengl/libopenvx/libopenvx.mk

diff --git a/DEVELOPERS b/DEVELOPERS
index cb13035bc4..fa9043b0c4 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -2076,6 +2076,7 @@ F:	package/uhttpd/
 F:	package/ustream-ssl/
 
 N:	Refik Tuzakli <tuzakli.refik@gmail.com>
+F:	package/opengl/libopenvx
 F:	package/paho-mqtt-cpp/
 
 N:	R??mi R??rolle <remi.rerolle@gmail.com>
diff --git a/package/opengl/Config.in b/package/opengl/Config.in
index cbc001427d..10bdefdb39 100644
--- a/package/opengl/Config.in
+++ b/package/opengl/Config.in
@@ -4,3 +4,4 @@ source "package/opengl/libgles/Config.in"
 source "package/opengl/libopencl/Config.in"
 source "package/opengl/libopenvg/Config.in"
 source "package/opengl/libopenmax/Config.in"
+source "package/opengl/libopenvx/Config.in"
diff --git a/package/opengl/libopenvx/Config.in b/package/opengl/libopenvx/Config.in
new file mode 100644
index 0000000000..58d497130e
--- /dev/null
+++ b/package/opengl/libopenvx/Config.in
@@ -0,0 +1,6 @@
+config BR2_PACKAGE_HAS_LIBOPENVX
+	bool
+
+config BR2_PACKAGE_PROVIDES_LIBOPENVX
+	string
+	depends on BR2_PACKAGE_HAS_LIBOPENVX
diff --git a/package/opengl/libopenvx/libopenvx.mk b/package/opengl/libopenvx/libopenvx.mk
new file mode 100644
index 0000000000..25ef639d3c
--- /dev/null
+++ b/package/opengl/libopenvx/libopenvx.mk
@@ -0,0 +1,7 @@
+################################################################################
+#
+# libopenvx
+#
+################################################################################
+
+$(eval $(virtual-package))
-- 
2.17.1

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

* [Buildroot] [PATCH v1 2/3] package/opengl/libvulkan: new virtual package
  2020-02-09 13:44 [Buildroot] [PATCH v1 1/3] package/opengl/libopenvx: new virtual package Refik Tuzakli
@ 2020-02-09 13:44 ` Refik Tuzakli
  2020-12-30 15:18   ` Peter Seiderer
  2020-02-09 13:44 ` [Buildroot] [PATCH v1 3/3] package/freescale-imx/imx-gpu-viv: add options for new feture Refik Tuzakli
  1 sibling, 1 reply; 6+ messages in thread
From: Refik Tuzakli @ 2020-02-09 13:44 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Refik Tuzakli <tuzakli.refik@gmail.com>
---
 DEVELOPERS                         | 1 +
 package/opengl/Config.in           | 1 +
 package/opengl/libvulkan/Config.in | 6 ++++++
 3 files changed, 8 insertions(+)
 create mode 100644 package/opengl/libvulkan/Config.in

diff --git a/DEVELOPERS b/DEVELOPERS
index fa9043b0c4..7703d5fa3e 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -2077,6 +2077,7 @@ F:	package/ustream-ssl/
 
 N:	Refik Tuzakli <tuzakli.refik@gmail.com>
 F:	package/opengl/libopenvx
+F:	package/opengl/libvulkan/
 F:	package/paho-mqtt-cpp/
 
 N:	R??mi R??rolle <remi.rerolle@gmail.com>
diff --git a/package/opengl/Config.in b/package/opengl/Config.in
index 10bdefdb39..af34fb6a46 100644
--- a/package/opengl/Config.in
+++ b/package/opengl/Config.in
@@ -5,3 +5,4 @@ source "package/opengl/libopencl/Config.in"
 source "package/opengl/libopenvg/Config.in"
 source "package/opengl/libopenmax/Config.in"
 source "package/opengl/libopenvx/Config.in"
+source "package/opengl/libvuulkan/Config.in"
diff --git a/package/opengl/libvulkan/Config.in b/package/opengl/libvulkan/Config.in
new file mode 100644
index 0000000000..c0cae4681b
--- /dev/null
+++ b/package/opengl/libvulkan/Config.in
@@ -0,0 +1,6 @@
+config BR2_PACKAGE_HAS_LIBVULKAN
+	bool
+
+config BR2_PACKAGE_PROVIDES_LIBVULKAN
+	string
+	depends on BR2_PACKAGE_HAS_LIBVULKAN
-- 
2.17.1

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

* [Buildroot] [PATCH v1 3/3] package/freescale-imx/imx-gpu-viv: add options for new feture
  2020-02-09 13:44 [Buildroot] [PATCH v1 1/3] package/opengl/libopenvx: new virtual package Refik Tuzakli
  2020-02-09 13:44 ` [Buildroot] [PATCH v1 2/3] package/opengl/libvulkan: " Refik Tuzakli
@ 2020-02-09 13:44 ` Refik Tuzakli
  2020-12-30 15:41   ` Peter Seiderer
  2021-08-05 21:36   ` Thomas Petazzoni
  1 sibling, 2 replies; 6+ messages in thread
From: Refik Tuzakli @ 2020-02-09 13:44 UTC (permalink / raw)
  To: buildroot

NXP supply new fetures with new gpu driver. This patch adds options to select
the library needed and saves space on target.

Signed-off-by: Refik Tuzakli <tuzakli.refik@gmail.com>
---
 package/freescale-imx/imx-gpu-viv/Config.in   |  54 +++++++++
 .../freescale-imx/imx-gpu-viv/imx-gpu-viv.mk  | 103 ++++++++++++++++--
 2 files changed, 145 insertions(+), 12 deletions(-)

diff --git a/package/freescale-imx/imx-gpu-viv/Config.in b/package/freescale-imx/imx-gpu-viv/Config.in
index a2deaf2e12..d206c04e6e 100644
--- a/package/freescale-imx/imx-gpu-viv/Config.in
+++ b/package/freescale-imx/imx-gpu-viv/Config.in
@@ -90,4 +90,58 @@ config BR2_PACKAGE_IMX_GPU_VIV_GMEM_INFO
 	  Copy the gmem_info tool to the target which provides
 	  information about GPU memory consumption.
 
+config BR2_PACKAGE_IMX_GPU_VIV_LIBOPENCL
+	bool "install libopencl"
+	select BR2_PACKAGE_HAS_LIBOPENCL
+	help
+	  OpenCL (Open Computing Language) is the open, royalty-free
+	  standard for cross-platform, parallel programming of diverse
+	  processors found in personal computers, servers, mobile
+	  devices and embedded platforms. OpenCL greatly improves the
+	  speed and responsiveness of a wide spectrum of applications in
+	  numerous market categories including gaming and entertainment
+	  titles, scientific and medical software, professional creative
+	  tools, vision processing, and neural network training and
+	  inferencing.
+
+config BR2_PACKAGE_PROVIDES_LIBOPENCL
+	depends on BR2_PACKAGE_IMX_GPU_VIV_LIBOPENCL
+	default "imx-gpu-viv"
+
+config BR2_PACKAGE_IMX_GPU_VIV_LIBOPENVX
+	bool "install libopenvx"
+	select BR2_PACKAGE_HAS_LIBOPENVX
+	help
+	  OpenVX is an open, royalty-free standard for cross platform
+	  acceleration of computer vision applications. OpenVX enables
+	  performance and power-optimized computer vision processing.
+
+config BR2_PACKAGE_PROVIDES_LIBOPENVX
+	depends on BR2_PACKAGE_IMX_GPU_VIV_LIBOPENVX
+	default "imx-gpu-viv"
+
+config BR2_PACKAGE_IMX_GPU_VIV_LIBVULKAN
+	bool "install libvulkan"
+	select BR2_PACKAGE_HAS_LIBVULKAN
+	help
+	  Vulkan is a new generation graphics and compute API that
+	  provides high-efficiency, cross-platform access to modern GPUs
+	  used in a wide variety of devices from PCs and consoles to
+	  mobile phones and embedded platforms.
+
+
+config BR2_PACKAGE_PROVIDES_LIBVULKAN
+	depends on BR2_PACKAGE_IMX_GPU_VIV_LIBVULKAN
+	default "imx-gpu-viv"
+
+config BR2_PACKAGE_IMX_GPU_VIV_LIBNN
+	bool "install libnn (experimental)"
+	depends on BR2_INSTALL_LIBSTDCPP
+	select BR2_PACKAGE_IMX_GPU_VIV_LIBOPENCL
+	select BR2_PACKAGE_IMX_GPU_VIV_LIBOPENVX
+	select BR2_PACKAGE_IMX_GPU_VIV_LIBVULKAN
+
+comment "libnn needs C++"
+	depends on !BR2_INSTALL_LIBSTDCPP
+
 endif
diff --git a/package/freescale-imx/imx-gpu-viv/imx-gpu-viv.mk b/package/freescale-imx/imx-gpu-viv/imx-gpu-viv.mk
index 646d4e3673..9e2e9f58e2 100644
--- a/package/freescale-imx/imx-gpu-viv/imx-gpu-viv.mk
+++ b/package/freescale-imx/imx-gpu-viv/imx-gpu-viv.mk
@@ -56,7 +56,62 @@ define IMX_GPU_VIV_BUILD_CMDS
 	ln -sf libGLESv2-$(IMX_GPU_VIV_LIB_TARGET).so $(@D)/gpu-core/usr/lib/libGLESv2.so.2.0.0
 	ln -sf libGAL-$(IMX_GPU_VIV_LIB_TARGET).so $(@D)/gpu-core/usr/lib/libGAL.so
 	ln -sf libVDK-$(IMX_GPU_VIV_LIB_TARGET).so $(@D)/gpu-core/usr/lib/libVDK.so
+	$(if $(BR2_PACKAGE_IMX_GPU_VIV_VULKAN),
+		ln -sf libvulkan-$(IMX_GPU_VIV_LIB_TARGET).so $(@D)/gpu-core/usr/lib/libvulkan.so
+	)
+endef
+
+ifeq ($(BR2_PACKAGE_IMX_GPU_VIV_LIBOPENCL),y)
+IMX_GPU_VIV_PROVIDES += libopencl
+define IMX_GPU_VIV_INSTALL_TARGET_LIBOPENCL
+	cp -dpfr $(@D)/gpu-core/usr/lib/libOpenCL* $(TARGET_DIR)/usr/lib
+	cp -dpfr $(@D)/gpu-core/usr/lib/libVivanteOpenCL* $(TARGET_DIR)/usr/lib
+endef
+define IMX_GPU_VIV_INSTALL_STAGING_LIBOPENCL
+	cp -dpfr $(@D)/gpu-core/usr/include/CL $(STAGING_DIR)/usr/include/
+endef
+endif
+
+ifeq ($(BR2_PACKAGE_IMX_GPU_VIV_LIBOPENVX),y)
+IMX_GPU_VIV_PROVIDES += libopenvx
+define IMX_GPU_VIV_INSTALL_TARGET_LIBOPENVX
+	for lib in ovxlib OpenVX OpenVXU Ovx12VXCBinary-evis Ovx12VXCBinary-evis2 CLC; do \
+		cp -dpfr $(@D)/gpu-core/usr/lib/lib$${lib}.so $(TARGET_DIR)/usr/lib ; \
+	done
+endef
+define IMX_GPU_VIV_INSTALL_STAGING_LIBOPENVX
+	cp -dpfr $(@D)/gpu-core/usr/include/VX $(STAGING_DIR)/usr/include/
+	cp -dpfr $(@D)/gpu-core/usr/include/OVXLIB $(STAGING_DIR)/usr/include/
+endef
+endif
+
+ifeq ($(BR2_PACKAGE_IMX_GPU_VIV_LIBVULKAN),y)
+IMX_GPU_VIV_PROVIDES += libvulkan
+define IMX_GPU_VIV_INSTALL_TARGET_LIBVULKAN
+	cp -dpfr $(@D)/gpu-core/usr/lib/libvulkan-$(IMX_GPU_VIV_LIB_TARGET).so $(TARGET_DIR)/usr/lib
+	cp -dpfr $(@D)/gpu-core/usr/lib/libGLSLC.so $(TARGET_DIR)/usr/lib
+	cp -dpfr $(@D)/gpu-core/usr/lib/libSPIRV_viv.so $(TARGET_DIR)/usr/lib
+endef
+define IMX_GPU_VIV_INSTALL_STAGING_LIBVULKAN
+	cp -dpfr $(@D)/gpu-core/usr/include/vulkan $(STAGING_DIR)/usr/include/
+endef
+endif
+
+ifeq ($(BR2_PACKAGE_IMX_GPU_VIV_LIBNN),y)
+IMX_GPU_VIV_PROVIDES += libnn
+define IMX_GPU_VIV_INSTALL_TARGET_LIBNN
+	cp -dpfr $(@D)/gpu-core/usr/lib/libnnrt.so $(TARGET_DIR)/usr/lib
+	cp -dpfr $(@D)/gpu-core/usr/lib/libneuralnetworks.so $(TARGET_DIR)/usr/lib
+	cp -dpfr $(@D)/gpu-core/usr/lib/libNNGPUBinary-lite.so $(TARGET_DIR)/usr/lib
+	cp -dpfr $(@D)/gpu-core/usr/lib/libNNGPUBinary-xsvx.so $(TARGET_DIR)/usr/lib
+	cp -dpfr $(@D)/gpu-core/usr/lib/libNNVXCBinary-evis.so $(TARGET_DIR)/usr/lib
+	cp -dpfr $(@D)/gpu-core/usr/lib/libNNGPUBinary-ulite.so $(TARGET_DIR)/usr/lib
+	cp -dpfr $(@D)/gpu-core/usr/lib/libNNVXCBinary-evis2.so $(TARGET_DIR)/usr/lib
 endef
+define IMX_GPU_VIV_INSTALL_STAGING_LIBVULKAN
+	cp -dpfr $(@D)/gpu-core/usr/include/nnrt $(STAGING_DIR)/usr/include/
+endef
+endif
 
 ifeq ($(IMX_GPU_VIV_LIB_TARGET),fb)
 define IMX_GPU_VIV_FIXUP_FB_HEADERS
@@ -88,7 +143,10 @@ endef
 endif
 
 define IMX_GPU_VIV_INSTALL_STAGING_CMDS
-	cp -r $(@D)/gpu-core/usr/* $(STAGING_DIR)/usr
+	cp -dpfr $(@D)/gpu-core/usr/lib $(STAGING_DIR)/usr
+	for lib in EGL GL GLES GLES2 GLES3 HAL KHR VG gbm.h gc_vdk.h gc_vdk_types.h vdk.h; do \
+		cp -dpfr $(@D)/gpu-core/usr/include/$${lib} $(STAGING_DIR)/usr/include/ ; \
+	done
 	$(IMX_GPU_VIV_FIXUP_FB_HEADERS)
 	$(IMX_GPU_VIV_FIXUP_PKGCONFIG)
 	for lib in egl gbm glesv1_cm glesv2 vg; do \
@@ -96,12 +154,21 @@ define IMX_GPU_VIV_INSTALL_STAGING_CMDS
 			$(@D)/gpu-core/usr/lib/pkgconfig/$${lib}.pc \
 			$(STAGING_DIR)/usr/lib/pkgconfig/$${lib}.pc; \
 	done
+	$(IMX_GPU_VIV_INSTALL_STAGING_LIBOPENCL)
+	$(IMX_GPU_VIV_INSTALL_STAGING_LIBOPENVX)
+	$(IMX_GPU_VIV_INSTALL_STAGING_LIBVULKAN)
+	$(IMX_GPU_VIV_INSTALL_STAGING_LIBNN)
 endef
 
 ifeq ($(BR2_PACKAGE_IMX_GPU_VIV_EXAMPLES),y)
 define IMX_GPU_VIV_INSTALL_EXAMPLES
-	mkdir -p $(TARGET_DIR)/usr/share/examples/
-	cp -r $(@D)/gpu-demos/opt/* $(TARGET_DIR)/usr/share/examples/
+	mkdir -p $(TARGET_DIR)/usr/share/examples/viv_samples
+	cp -dpfr $(@D)/gpu-demos/opt/es20 $(TARGET_DIR)/usr/share/examples/viv_samples/
+	cp -dpfr $(@D)/gpu-demos/opt/tiger $(TARGET_DIR)/usr/share/examples/viv_samples/
+	cp -dpfr $(@D)/gpu-demos/opt/vdk $(TARGET_DIR)/usr/share/examples/viv_samples/
+ifeq ($(BR2_PACKAGE_IMX_GPU_VIV_LIBOPENCL),y)
+	cp -dpfr $(@D)/gpu-demos/opt/cl11 $(TARGET_DIR)/usr/share/examples/viv_samples/
+endif
 endef
 endif
 
@@ -115,17 +182,29 @@ endif
 # Note that this is _required_, else ldconfig may create symlinks
 # to the wrong library
 define IMX_GPU_VIV_INSTALL_TARGET_CMDS
-	$(IMX_GPU_VIV_INSTALL_EXAMPLES)
-	$(IMX_GPU_VIV_INSTALL_GMEM_INFO)
-	cp -a $(@D)/gpu-core/usr/lib $(TARGET_DIR)/usr
+	cp -dpfr $(@D)/gpu-core/etc $(TARGET_DIR)/ 
+	for lib in dri pkgconfig libgbm.so libgbm_viv.so libVSC.so libOpenVG.so  libOpenVG.3d.so; do \
+		cp -dpfr $(@D)/gpu-core/usr/lib/$${lib} $(TARGET_DIR)/usr/lib ; \
+	done
 	for lib in EGL GAL GLESv2 VDK; do \
-		for f in $(TARGET_DIR)/usr/lib/lib$${lib}-*.so; do \
-			case $$f in \
-				*-$(IMX_GPU_VIV_LIB_TARGET).so) : ;; \
-				*) $(RM) $$f ;; \
-			esac; \
-		done; \
+		cp -dpfr $(@D)/gpu-core/usr/lib/lib$${lib}.so* $(TARGET_DIR)/usr/lib ; \
+		cp -dpfr $(@D)/gpu-core/usr/lib/lib$${lib}-$(IMX_GPU_VIV_LIB_TARGET).so $(TARGET_DIR)/usr/lib ; \
 	done
+	$(if $(BR2_PACKAGE_IMX_GPU_VIV_OUTPUT_X11)$(BR2_PACKAGE_IMX_GPU_VIV_OUTPUT_WL),
+		cp -dpfr $(@D)/gpu-core/usr/lib/libGL.so* $(TARGET_DIR)/usr/lib ; \
+		cp -dpfr $(@D)/gpu-core/usr/lib/libGL-$(IMX_GPU_VIV_LIB_TARGET).so $(TARGET_DIR)/usr/lib ; \
+	)
+	cp -dpfr $(@D)/gpu-core/usr/lib/libGLES_C* $(TARGET_DIR)/usr/lib
+	cp -dpfr $(@D)/gpu-core/usr/lib/libGLESv1_C* $(TARGET_DIR)/usr/lib
+	
+	$(IMX_GPU_VIV_INSTALL_EXAMPLES)
+	$(IMX_GPU_VIV_INSTALL_GMEM_INFO)
+	
+	$(IMX_GPU_VIV_INSTALL_TARGET_LIBOPENCL)
+	$(IMX_GPU_VIV_INSTALL_TARGET_LIBOPENVX)
+	$(IMX_GPU_VIV_INSTALL_TARGET_LIBVULKAN)
+	$(IMX_GPU_VIV_INSTALL_TARGET_LIBNN)
+
 endef
 
 $(eval $(generic-package))
-- 
2.17.1

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

* [Buildroot] [PATCH v1 2/3] package/opengl/libvulkan: new virtual package
  2020-02-09 13:44 ` [Buildroot] [PATCH v1 2/3] package/opengl/libvulkan: " Refik Tuzakli
@ 2020-12-30 15:18   ` Peter Seiderer
  0 siblings, 0 replies; 6+ messages in thread
From: Peter Seiderer @ 2020-12-30 15:18 UTC (permalink / raw)
  To: buildroot

Hello Refik,

On Sun,  9 Feb 2020 16:44:07 +0300, Refik Tuzakli <tuzakli.refik@gmail.com> wrote:

> Signed-off-by: Refik Tuzakli <tuzakli.refik@gmail.com>
> ---
>  DEVELOPERS                         | 1 +
>  package/opengl/Config.in           | 1 +
>  package/opengl/libvulkan/Config.in | 6 ++++++
>  3 files changed, 8 insertions(+)
>  create mode 100644 package/opengl/libvulkan/Config.in
> 
> diff --git a/DEVELOPERS b/DEVELOPERS
> index fa9043b0c4..7703d5fa3e 100644
> --- a/DEVELOPERS
> +++ b/DEVELOPERS
> @@ -2077,6 +2077,7 @@ F:	package/ustream-ssl/
>  
>  N:	Refik Tuzakli <tuzakli.refik@gmail.com>
>  F:	package/opengl/libopenvx
> +F:	package/opengl/libvulkan/
>  F:	package/paho-mqtt-cpp/
>  
>  N:	R?mi R?rolle <remi.rerolle@gmail.com>
> diff --git a/package/opengl/Config.in b/package/opengl/Config.in
> index 10bdefdb39..af34fb6a46 100644
> --- a/package/opengl/Config.in
> +++ b/package/opengl/Config.in
> @@ -5,3 +5,4 @@ source "package/opengl/libopencl/Config.in"
>  source "package/opengl/libopenvg/Config.in"
>  source "package/opengl/libopenmax/Config.in"
>  source "package/opengl/libopenvx/Config.in"
> +source "package/opengl/libvuulkan/Config.in"

s/libvuulkan/libvulkan/ ?

Regards,
Peter

> diff --git a/package/opengl/libvulkan/Config.in b/package/opengl/libvulkan/Config.in
> new file mode 100644
> index 0000000000..c0cae4681b
> --- /dev/null
> +++ b/package/opengl/libvulkan/Config.in
> @@ -0,0 +1,6 @@
> +config BR2_PACKAGE_HAS_LIBVULKAN
> +	bool
> +
> +config BR2_PACKAGE_PROVIDES_LIBVULKAN
> +	string
> +	depends on BR2_PACKAGE_HAS_LIBVULKAN

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

* [Buildroot] [PATCH v1 3/3] package/freescale-imx/imx-gpu-viv: add options for new feture
  2020-02-09 13:44 ` [Buildroot] [PATCH v1 3/3] package/freescale-imx/imx-gpu-viv: add options for new feture Refik Tuzakli
@ 2020-12-30 15:41   ` Peter Seiderer
  2021-08-05 21:36   ` Thomas Petazzoni
  1 sibling, 0 replies; 6+ messages in thread
From: Peter Seiderer @ 2020-12-30 15:41 UTC (permalink / raw)
  To: buildroot

Hello Refik,

On Sun,  9 Feb 2020 16:44:08 +0300, Refik Tuzakli <tuzakli.refik@gmail.com> wrote:

> NXP supply new fetures with new gpu driver. This patch adds options to select
> the library needed and saves space on target.
>
> Signed-off-by: Refik Tuzakli <tuzakli.refik@gmail.com>
> ---
>  package/freescale-imx/imx-gpu-viv/Config.in   |  54 +++++++++
>  .../freescale-imx/imx-gpu-viv/imx-gpu-viv.mk  | 103 ++++++++++++++++--
>  2 files changed, 145 insertions(+), 12 deletions(-)
>
> diff --git a/package/freescale-imx/imx-gpu-viv/Config.in b/package/freescale-imx/imx-gpu-viv/Config.in
> index a2deaf2e12..d206c04e6e 100644
> --- a/package/freescale-imx/imx-gpu-viv/Config.in
> +++ b/package/freescale-imx/imx-gpu-viv/Config.in
> @@ -90,4 +90,58 @@ config BR2_PACKAGE_IMX_GPU_VIV_GMEM_INFO
>  	  Copy the gmem_info tool to the target which provides
>  	  information about GPU memory consumption.
>
> +config BR2_PACKAGE_IMX_GPU_VIV_LIBOPENCL
> +	bool "install libopencl"
> +	select BR2_PACKAGE_HAS_LIBOPENCL
> +	help
> +	  OpenCL (Open Computing Language) is the open, royalty-free
> +	  standard for cross-platform, parallel programming of diverse
> +	  processors found in personal computers, servers, mobile
> +	  devices and embedded platforms. OpenCL greatly improves the
> +	  speed and responsiveness of a wide spectrum of applications in
> +	  numerous market categories including gaming and entertainment
> +	  titles, scientific and medical software, professional creative
> +	  tools, vision processing, and neural network training and
> +	  inferencing.
> +
> +config BR2_PACKAGE_PROVIDES_LIBOPENCL
> +	depends on BR2_PACKAGE_IMX_GPU_VIV_LIBOPENCL
> +	default "imx-gpu-viv"
> +
> +config BR2_PACKAGE_IMX_GPU_VIV_LIBOPENVX
> +	bool "install libopenvx"
> +	select BR2_PACKAGE_HAS_LIBOPENVX
> +	help
> +	  OpenVX is an open, royalty-free standard for cross platform
> +	  acceleration of computer vision applications. OpenVX enables
> +	  performance and power-optimized computer vision processing.
> +
> +config BR2_PACKAGE_PROVIDES_LIBOPENVX
> +	depends on BR2_PACKAGE_IMX_GPU_VIV_LIBOPENVX
> +	default "imx-gpu-viv"
> +
> +config BR2_PACKAGE_IMX_GPU_VIV_LIBVULKAN
> +	bool "install libvulkan"
> +	select BR2_PACKAGE_HAS_LIBVULKAN
> +	help
> +	  Vulkan is a new generation graphics and compute API that
> +	  provides high-efficiency, cross-platform access to modern GPUs
> +	  used in a wide variety of devices from PCs and consoles to
> +	  mobile phones and embedded platforms.
> +
> +
> +config BR2_PACKAGE_PROVIDES_LIBVULKAN
> +	depends on BR2_PACKAGE_IMX_GPU_VIV_LIBVULKAN
> +	default "imx-gpu-viv"
> +
> +config BR2_PACKAGE_IMX_GPU_VIV_LIBNN
> +	bool "install libnn (experimental)"
> +	depends on BR2_INSTALL_LIBSTDCPP
> +	select BR2_PACKAGE_IMX_GPU_VIV_LIBOPENCL
> +	select BR2_PACKAGE_IMX_GPU_VIV_LIBOPENVX
> +	select BR2_PACKAGE_IMX_GPU_VIV_LIBVULKAN
> +
> +comment "libnn needs C++"
> +	depends on !BR2_INSTALL_LIBSTDCPP
> +
>  endif
> diff --git a/package/freescale-imx/imx-gpu-viv/imx-gpu-viv.mk b/package/freescale-imx/imx-gpu-viv/imx-gpu-viv.mk
> index 646d4e3673..9e2e9f58e2 100644
> --- a/package/freescale-imx/imx-gpu-viv/imx-gpu-viv.mk
> +++ b/package/freescale-imx/imx-gpu-viv/imx-gpu-viv.mk
> @@ -56,7 +56,62 @@ define IMX_GPU_VIV_BUILD_CMDS
>  	ln -sf libGLESv2-$(IMX_GPU_VIV_LIB_TARGET).so $(@D)/gpu-core/usr/lib/libGLESv2.so.2.0.0
>  	ln -sf libGAL-$(IMX_GPU_VIV_LIB_TARGET).so $(@D)/gpu-core/usr/lib/libGAL.so
>  	ln -sf libVDK-$(IMX_GPU_VIV_LIB_TARGET).so $(@D)/gpu-core/usr/lib/libVDK.so
> +	$(if $(BR2_PACKAGE_IMX_GPU_VIV_VULKAN),
> +		ln -sf libvulkan-$(IMX_GPU_VIV_LIB_TARGET).so $(@D)/gpu-core/usr/lib/libvulkan.so
> +	)
> +endef
> +
> +ifeq ($(BR2_PACKAGE_IMX_GPU_VIV_LIBOPENCL),y)
> +IMX_GPU_VIV_PROVIDES += libopencl
> +define IMX_GPU_VIV_INSTALL_TARGET_LIBOPENCL
> +	cp -dpfr $(@D)/gpu-core/usr/lib/libOpenCL* $(TARGET_DIR)/usr/lib
> +	cp -dpfr $(@D)/gpu-core/usr/lib/libVivanteOpenCL* $(TARGET_DIR)/usr/lib
> +endef
> +define IMX_GPU_VIV_INSTALL_STAGING_LIBOPENCL
> +	cp -dpfr $(@D)/gpu-core/usr/include/CL $(STAGING_DIR)/usr/include/
> +endef
> +endif
> +
> +ifeq ($(BR2_PACKAGE_IMX_GPU_VIV_LIBOPENVX),y)
> +IMX_GPU_VIV_PROVIDES += libopenvx
> +define IMX_GPU_VIV_INSTALL_TARGET_LIBOPENVX
> +	for lib in ovxlib OpenVX OpenVXU Ovx12VXCBinary-evis Ovx12VXCBinary-evis2 CLC; do \
> +		cp -dpfr $(@D)/gpu-core/usr/lib/lib$${lib}.so $(TARGET_DIR)/usr/lib ; \
> +	done
> +endef
> +define IMX_GPU_VIV_INSTALL_STAGING_LIBOPENVX
> +	cp -dpfr $(@D)/gpu-core/usr/include/VX $(STAGING_DIR)/usr/include/
> +	cp -dpfr $(@D)/gpu-core/usr/include/OVXLIB $(STAGING_DIR)/usr/include/
> +endef
> +endif
> +
> +ifeq ($(BR2_PACKAGE_IMX_GPU_VIV_LIBVULKAN),y)
> +IMX_GPU_VIV_PROVIDES += libvulkan
> +define IMX_GPU_VIV_INSTALL_TARGET_LIBVULKAN
> +	cp -dpfr $(@D)/gpu-core/usr/lib/libvulkan-$(IMX_GPU_VIV_LIB_TARGET).so $(TARGET_DIR)/usr/lib
> +	cp -dpfr $(@D)/gpu-core/usr/lib/libGLSLC.so $(TARGET_DIR)/usr/lib
> +	cp -dpfr $(@D)/gpu-core/usr/lib/libSPIRV_viv.so $(TARGET_DIR)/usr/lib
> +endef
> +define IMX_GPU_VIV_INSTALL_STAGING_LIBVULKAN
> +	cp -dpfr $(@D)/gpu-core/usr/include/vulkan $(STAGING_DIR)/usr/include/

Did not look at the details of the package yet (and no access to hardware to
test at the moment), but some questions (started an RFC patch series for
testing out Raspberry Pi 4 Vulkan support[3] - not yet running):

- are the header files copies of the original provided by [1]?
- any consumer/user example of the libraries? How does they
  fit into the vulkan-loader framework [2] (if they do)?
- are the provided headers/libs enough to enable e.g.
  Qt vulkan support/examples?

Regards,
Peter


> +endef
> +endif
> +
> +ifeq ($(BR2_PACKAGE_IMX_GPU_VIV_LIBNN),y)
> +IMX_GPU_VIV_PROVIDES += libnn
> +define IMX_GPU_VIV_INSTALL_TARGET_LIBNN
> +	cp -dpfr $(@D)/gpu-core/usr/lib/libnnrt.so $(TARGET_DIR)/usr/lib
> +	cp -dpfr $(@D)/gpu-core/usr/lib/libneuralnetworks.so $(TARGET_DIR)/usr/lib
> +	cp -dpfr $(@D)/gpu-core/usr/lib/libNNGPUBinary-lite.so $(TARGET_DIR)/usr/lib
> +	cp -dpfr $(@D)/gpu-core/usr/lib/libNNGPUBinary-xsvx.so $(TARGET_DIR)/usr/lib
> +	cp -dpfr $(@D)/gpu-core/usr/lib/libNNVXCBinary-evis.so $(TARGET_DIR)/usr/lib
> +	cp -dpfr $(@D)/gpu-core/usr/lib/libNNGPUBinary-ulite.so $(TARGET_DIR)/usr/lib
> +	cp -dpfr $(@D)/gpu-core/usr/lib/libNNVXCBinary-evis2.so $(TARGET_DIR)/usr/lib
>  endef
> +define IMX_GPU_VIV_INSTALL_STAGING_LIBVULKAN
> +	cp -dpfr $(@D)/gpu-core/usr/include/nnrt $(STAGING_DIR)/usr/include/
> +endef

s/IMX_GPU_VIV_INSTALL_STAGING_LIBVULKAN/IMX_GPU_VIV_INSTALL_STAGING_LIBNN/?

Regards,
Peter

[1] https://github.com/KhronosGroup/Vulkan-Headers
[2] https://github.com/KhronosGroup/Vulkan-Loader
[3] https://patchwork.ozlabs.org/project/buildroot/list/?series=221906&state=*

> +endif
>
>  ifeq ($(IMX_GPU_VIV_LIB_TARGET),fb)
>  define IMX_GPU_VIV_FIXUP_FB_HEADERS
> @@ -88,7 +143,10 @@ endef
>  endif
>
>  define IMX_GPU_VIV_INSTALL_STAGING_CMDS
> -	cp -r $(@D)/gpu-core/usr/* $(STAGING_DIR)/usr
> +	cp -dpfr $(@D)/gpu-core/usr/lib $(STAGING_DIR)/usr
> +	for lib in EGL GL GLES GLES2 GLES3 HAL KHR VG gbm.h gc_vdk.h gc_vdk_types.h vdk.h; do \
> +		cp -dpfr $(@D)/gpu-core/usr/include/$${lib} $(STAGING_DIR)/usr/include/ ; \
> +	done
>  	$(IMX_GPU_VIV_FIXUP_FB_HEADERS)
>  	$(IMX_GPU_VIV_FIXUP_PKGCONFIG)
>  	for lib in egl gbm glesv1_cm glesv2 vg; do \
> @@ -96,12 +154,21 @@ define IMX_GPU_VIV_INSTALL_STAGING_CMDS
>  			$(@D)/gpu-core/usr/lib/pkgconfig/$${lib}.pc \
>  			$(STAGING_DIR)/usr/lib/pkgconfig/$${lib}.pc; \
>  	done
> +	$(IMX_GPU_VIV_INSTALL_STAGING_LIBOPENCL)
> +	$(IMX_GPU_VIV_INSTALL_STAGING_LIBOPENVX)
> +	$(IMX_GPU_VIV_INSTALL_STAGING_LIBVULKAN)
> +	$(IMX_GPU_VIV_INSTALL_STAGING_LIBNN)
>  endef
>
>  ifeq ($(BR2_PACKAGE_IMX_GPU_VIV_EXAMPLES),y)
>  define IMX_GPU_VIV_INSTALL_EXAMPLES
> -	mkdir -p $(TARGET_DIR)/usr/share/examples/
> -	cp -r $(@D)/gpu-demos/opt/* $(TARGET_DIR)/usr/share/examples/
> +	mkdir -p $(TARGET_DIR)/usr/share/examples/viv_samples
> +	cp -dpfr $(@D)/gpu-demos/opt/es20 $(TARGET_DIR)/usr/share/examples/viv_samples/
> +	cp -dpfr $(@D)/gpu-demos/opt/tiger $(TARGET_DIR)/usr/share/examples/viv_samples/
> +	cp -dpfr $(@D)/gpu-demos/opt/vdk $(TARGET_DIR)/usr/share/examples/viv_samples/
> +ifeq ($(BR2_PACKAGE_IMX_GPU_VIV_LIBOPENCL),y)
> +	cp -dpfr $(@D)/gpu-demos/opt/cl11 $(TARGET_DIR)/usr/share/examples/viv_samples/
> +endif
>  endef
>  endif
>
> @@ -115,17 +182,29 @@ endif
>  # Note that this is _required_, else ldconfig may create symlinks
>  # to the wrong library
>  define IMX_GPU_VIV_INSTALL_TARGET_CMDS
> -	$(IMX_GPU_VIV_INSTALL_EXAMPLES)
> -	$(IMX_GPU_VIV_INSTALL_GMEM_INFO)
> -	cp -a $(@D)/gpu-core/usr/lib $(TARGET_DIR)/usr
> +	cp -dpfr $(@D)/gpu-core/etc $(TARGET_DIR)/
> +	for lib in dri pkgconfig libgbm.so libgbm_viv.so libVSC.so libOpenVG.so  libOpenVG.3d.so; do \
> +		cp -dpfr $(@D)/gpu-core/usr/lib/$${lib} $(TARGET_DIR)/usr/lib ; \
> +	done
>  	for lib in EGL GAL GLESv2 VDK; do \
> -		for f in $(TARGET_DIR)/usr/lib/lib$${lib}-*.so; do \
> -			case $$f in \
> -				*-$(IMX_GPU_VIV_LIB_TARGET).so) : ;; \
> -				*) $(RM) $$f ;; \
> -			esac; \
> -		done; \
> +		cp -dpfr $(@D)/gpu-core/usr/lib/lib$${lib}.so* $(TARGET_DIR)/usr/lib ; \
> +		cp -dpfr $(@D)/gpu-core/usr/lib/lib$${lib}-$(IMX_GPU_VIV_LIB_TARGET).so $(TARGET_DIR)/usr/lib ; \
>  	done
> +	$(if $(BR2_PACKAGE_IMX_GPU_VIV_OUTPUT_X11)$(BR2_PACKAGE_IMX_GPU_VIV_OUTPUT_WL),
> +		cp -dpfr $(@D)/gpu-core/usr/lib/libGL.so* $(TARGET_DIR)/usr/lib ; \
> +		cp -dpfr $(@D)/gpu-core/usr/lib/libGL-$(IMX_GPU_VIV_LIB_TARGET).so $(TARGET_DIR)/usr/lib ; \
> +	)
> +	cp -dpfr $(@D)/gpu-core/usr/lib/libGLES_C* $(TARGET_DIR)/usr/lib
> +	cp -dpfr $(@D)/gpu-core/usr/lib/libGLESv1_C* $(TARGET_DIR)/usr/lib
> +
> +	$(IMX_GPU_VIV_INSTALL_EXAMPLES)
> +	$(IMX_GPU_VIV_INSTALL_GMEM_INFO)
> +
> +	$(IMX_GPU_VIV_INSTALL_TARGET_LIBOPENCL)
> +	$(IMX_GPU_VIV_INSTALL_TARGET_LIBOPENVX)
> +	$(IMX_GPU_VIV_INSTALL_TARGET_LIBVULKAN)
> +	$(IMX_GPU_VIV_INSTALL_TARGET_LIBNN)
> +
>  endef
>
>  $(eval $(generic-package))

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

* Re: [Buildroot] [PATCH v1 3/3] package/freescale-imx/imx-gpu-viv: add options for new feture
  2020-02-09 13:44 ` [Buildroot] [PATCH v1 3/3] package/freescale-imx/imx-gpu-viv: add options for new feture Refik Tuzakli
  2020-12-30 15:41   ` Peter Seiderer
@ 2021-08-05 21:36   ` Thomas Petazzoni
  1 sibling, 0 replies; 6+ messages in thread
From: Thomas Petazzoni @ 2021-08-05 21:36 UTC (permalink / raw)
  To: Refik Tuzakli; +Cc: Gary Bisson, Peter Seiderer, buildroot

Hello Refik,

On Sun,  9 Feb 2020 16:44:08 +0300
Refik Tuzakli <tuzakli.refik@gmail.com> wrote:

> NXP supply new fetures with new gpu driver. This patch adds options to select
> the library needed and saves space on target.
> 
> Signed-off-by: Refik Tuzakli <tuzakli.refik@gmail.com>

Thanks a lot for this patch. I started looking into it, and realized
that now due to the massive amount of libraries installed by
imx-gpu-viv, the TARGET_DIR/usr/lib folder weights a total of 190 MB!
This is really huge, and we definitely want to make this more
conditional as not everybody needs OpenVX, Vulkan, or the neural
network stuff.

However, I think we would need to do that step by step, in multiple
patches. First we should make conditional what the package already
supports. The package currently provides:

IMX_GPU_VIV_PROVIDES = libegl libgles libopencl libopenvg

I think libegl and libgles should remain unconditional. However, we
should make libopencl and libopenvg optional. When they are not
enabled, then the libraries and headers should not be installed to
STAGING_DIR. Indeed, we really want a hard build/link failure if
somebody tries to build an OpenCL or OpenVG application and the
corresponding options are not enabled. We cannot install "the whole
imx-gpu-viv" to STAGING_DIR and only conditionally install to
TARGET_DIR, because it means someone not enabling OpenCL would be able
to build/link the application and it would only fail at runtime which
is not great.

Then once we have this imx-gpu-viv package that has options for
libopencl and libopenvg, you can create additional patches adding
options for libvulkan, for libopenvx, for the neural network stuff.

Would you be willing to work on something like this ?

Also, one question is: are all these features available for all i.MX
platforms? Vulkan, neural network stuff is available even on the older
i.MX6 platforms that also use imx-gpu-viv ?


> +ifeq ($(BR2_PACKAGE_IMX_GPU_VIV_LIBNN),y)
> +IMX_GPU_VIV_PROVIDES += libnn
> +define IMX_GPU_VIV_INSTALL_TARGET_LIBNN
> +	cp -dpfr $(@D)/gpu-core/usr/lib/libnnrt.so $(TARGET_DIR)/usr/lib
> +	cp -dpfr $(@D)/gpu-core/usr/lib/libneuralnetworks.so $(TARGET_DIR)/usr/lib
> +	cp -dpfr $(@D)/gpu-core/usr/lib/libNNGPUBinary-lite.so $(TARGET_DIR)/usr/lib
> +	cp -dpfr $(@D)/gpu-core/usr/lib/libNNGPUBinary-xsvx.so $(TARGET_DIR)/usr/lib
> +	cp -dpfr $(@D)/gpu-core/usr/lib/libNNVXCBinary-evis.so $(TARGET_DIR)/usr/lib
> +	cp -dpfr $(@D)/gpu-core/usr/lib/libNNGPUBinary-ulite.so $(TARGET_DIR)/usr/lib
> +	cp -dpfr $(@D)/gpu-core/usr/lib/libNNVXCBinary-evis2.so $(TARGET_DIR)/usr/lib

Do we need *all* those libraries in the target? Several of them have
very similar names, they somehow look like alternatives of each other.

>  endef
> +define IMX_GPU_VIV_INSTALL_STAGING_LIBVULKAN

Should have been LIBNN I guess.

> +	cp -dpfr $(@D)/gpu-core/usr/include/nnrt $(STAGING_DIR)/usr/include/
> +endef
> +endif
>  
>  ifeq ($(IMX_GPU_VIV_LIB_TARGET),fb)
>  define IMX_GPU_VIV_FIXUP_FB_HEADERS
> @@ -88,7 +143,10 @@ endef
>  endif
>  
>  define IMX_GPU_VIV_INSTALL_STAGING_CMDS
> -	cp -r $(@D)/gpu-core/usr/* $(STAGING_DIR)/usr
> +	cp -dpfr $(@D)/gpu-core/usr/lib $(STAGING_DIR)/usr

See here? You are installing all libraries to $(STAGING_DIR), even the
ones that are not in TARGET_DIR. It means you won't get link failures,
but runtime failures (as I explained above).

Are you interested in improving your patch series along those lines ?

Also, Peter Seiderer comment on your patch in December, but you never
replied.

Best regards,

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

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

end of thread, other threads:[~2021-08-05 21:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-09 13:44 [Buildroot] [PATCH v1 1/3] package/opengl/libopenvx: new virtual package Refik Tuzakli
2020-02-09 13:44 ` [Buildroot] [PATCH v1 2/3] package/opengl/libvulkan: " Refik Tuzakli
2020-12-30 15:18   ` Peter Seiderer
2020-02-09 13:44 ` [Buildroot] [PATCH v1 3/3] package/freescale-imx/imx-gpu-viv: add options for new feture Refik Tuzakli
2020-12-30 15:41   ` Peter Seiderer
2021-08-05 21:36   ` 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.