All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 0/7] Rockchip Mali Bifrost GPU support
@ 2020-03-06  7:14 Miquel Raynal
  2020-03-06  7:14 ` [Buildroot] [PATCH 1/7] package/sunxi-mali-utgard: rename from sunxi-mali-mainline Miquel Raynal
                   ` (7 more replies)
  0 siblings, 8 replies; 18+ messages in thread
From: Miquel Raynal @ 2020-03-06  7:14 UTC (permalink / raw)
  To: buildroot

Hello,

As part of a wider work targeting a Rockchip SoC, here is an
attempt to ease the use of Mali Bifrost GPUs (at least on Rockchip
platforms) by providing the necessary packages to build and install
the necessary userspace and kernel components.

This series first renames the existing Mali-related packages targeting
Allwinner SoCs to clarify what they provide, then brings support for
Rockchip userspace (closed-source) libraries and (open-source) driver,
and finally updates the Qt5 make file to support this hardware.

Hope this will be useful!

Cheers,
Miqu?l

Maxime Chevallier (2):
  package/rockchip-mali-bifrost: new package with binary blobs
  package/qt5: allows using rockchip-mali-bifrost as OpenGL/KMS provider

Miquel Raynal (4):
  package/sunxi-mali-utgard: rename from sunxi-mali-mainline
  package/sunxi-mali-utgard-driver: rename from
    sunxi-mali-mainline-driver
  package/mali-bifrost-driver: new package
  package/qt5: generalize the condition on which EGLFS KMS gets
    supported

Thomas Petazzoni (1):
  package/qt5: make it possible to use rockchip-mali-bifrost as GBM
    provider

 Config.in.legacy                              |  30 ++++
 DEVELOPERS                                    |   4 +-
 configs/olimex_a20_olinuxino_lime2_defconfig  |   4 +-
 configs/olimex_a20_olinuxino_lime_defconfig   |   4 +-
 docs/manual/adding-packages-virtual.txt       |   2 +-
 linux/linux.mk                                |   2 +-
 package/Config.in                             |   6 +-
 package/glslsandbox-player/Config.in          |   4 +-
 .../glslsandbox-player/glslsandbox-player.mk  |   2 +-
 package/mali-bifrost-driver/Config.in         |  17 ++
 .../mali-bifrost-driver.hash                  |   3 +
 .../mali-bifrost-driver.mk                    |  15 ++
 package/qt5/qt5base/qt5base.mk                |  10 +-
 ...4-binaries-and-only-install-the-bifr.patch | 169 ++++++++++++++++++
 package/rockchip-mali-bifrost/Config.in       |  20 +++
 .../rockchip-mali-bifrost.hash                |   2 +
 .../rockchip-mali-bifrost.mk                  |  85 +++++++++
 package/sunxi-mali-mainline-driver/Config.in  |  25 ---
 .../sunxi-mali-mainline-driver.mk             |  35 ----
 package/sunxi-mali-mainline/Config.in         |  42 -----
 .../sunxi-mali-mainline.mk                    |  49 -----
 package/sunxi-mali-utgard-driver/Config.in    |  25 +++
 .../sunxi-mali-utgard-driver.hash}            |   2 +-
 .../sunxi-mali-utgard-driver.mk               |  35 ++++
 package/sunxi-mali-utgard/Config.in           |  43 +++++
 .../egl.pc                                    |   0
 .../glesv2.pc                                 |   0
 .../sunxi-mali-utgard.hash}                   |   2 +-
 .../sunxi-mali-utgard/sunxi-mali-utgard.mk    |  49 +++++
 29 files changed, 518 insertions(+), 168 deletions(-)
 create mode 100644 package/mali-bifrost-driver/Config.in
 create mode 100644 package/mali-bifrost-driver/mali-bifrost-driver.hash
 create mode 100644 package/mali-bifrost-driver/mali-bifrost-driver.mk
 create mode 100644 package/rockchip-mali-bifrost/0001-cmake-Use-AArch64-binaries-and-only-install-the-bifr.patch
 create mode 100644 package/rockchip-mali-bifrost/Config.in
 create mode 100644 package/rockchip-mali-bifrost/rockchip-mali-bifrost.hash
 create mode 100644 package/rockchip-mali-bifrost/rockchip-mali-bifrost.mk
 delete mode 100644 package/sunxi-mali-mainline-driver/Config.in
 delete mode 100644 package/sunxi-mali-mainline-driver/sunxi-mali-mainline-driver.mk
 delete mode 100644 package/sunxi-mali-mainline/Config.in
 delete mode 100644 package/sunxi-mali-mainline/sunxi-mali-mainline.mk
 create mode 100644 package/sunxi-mali-utgard-driver/Config.in
 rename package/{sunxi-mali-mainline-driver/sunxi-mali-mainline-driver.hash => sunxi-mali-utgard-driver/sunxi-mali-utgard-driver.hash} (66%)
 create mode 100644 package/sunxi-mali-utgard-driver/sunxi-mali-utgard-driver.mk
 create mode 100644 package/sunxi-mali-utgard/Config.in
 rename package/{sunxi-mali-mainline => sunxi-mali-utgard}/egl.pc (100%)
 rename package/{sunxi-mali-mainline => sunxi-mali-utgard}/glesv2.pc (100%)
 rename package/{sunxi-mali-mainline/sunxi-mali-mainline.hash => sunxi-mali-utgard/sunxi-mali-utgard.hash} (70%)
 create mode 100644 package/sunxi-mali-utgard/sunxi-mali-utgard.mk

-- 
2.20.1

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

* [Buildroot] [PATCH 1/7] package/sunxi-mali-utgard: rename from sunxi-mali-mainline
  2020-03-06  7:14 [Buildroot] [PATCH 0/7] Rockchip Mali Bifrost GPU support Miquel Raynal
@ 2020-03-06  7:14 ` Miquel Raynal
  2020-03-06  7:14 ` [Buildroot] [PATCH 2/7] package/sunxi-mali-utgard-driver: rename from sunxi-mali-mainline-driver Miquel Raynal
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 18+ messages in thread
From: Miquel Raynal @ 2020-03-06  7:14 UTC (permalink / raw)
  To: buildroot

This package provides Mali libraries for Sunxi Mali Utgard GPUs. The
trailing -mainline is historical and was used at a time when there was
two packages providing these libraries. The "non-upstream" package has
been removed some time ago so before adding new packages bringing
support for other ARM Mali GPU versions or implementations, rename
sunxi-mali-mainline into sunxi-mali-utgard.

Add a legacy entry.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 Config.in.legacy                              | 30 ++++++++++++
 DEVELOPERS                                    |  2 +-
 configs/olimex_a20_olinuxino_lime2_defconfig  |  2 +-
 configs/olimex_a20_olinuxino_lime_defconfig   |  2 +-
 docs/manual/adding-packages-virtual.txt       |  2 +-
 package/Config.in                             |  2 +-
 package/glslsandbox-player/Config.in          |  4 +-
 .../glslsandbox-player/glslsandbox-player.mk  |  2 +-
 package/qt5/qt5base/qt5base.mk                |  2 +-
 package/sunxi-mali-mainline/Config.in         | 42 ----------------
 .../sunxi-mali-mainline.mk                    | 49 -------------------
 package/sunxi-mali-utgard/Config.in           | 43 ++++++++++++++++
 .../egl.pc                                    |  0
 .../glesv2.pc                                 |  0
 .../sunxi-mali-utgard.hash}                   |  2 +-
 .../sunxi-mali-utgard/sunxi-mali-utgard.mk    | 49 +++++++++++++++++++
 16 files changed, 132 insertions(+), 101 deletions(-)
 delete mode 100644 package/sunxi-mali-mainline/Config.in
 delete mode 100644 package/sunxi-mali-mainline/sunxi-mali-mainline.mk
 create mode 100644 package/sunxi-mali-utgard/Config.in
 rename package/{sunxi-mali-mainline => sunxi-mali-utgard}/egl.pc (100%)
 rename package/{sunxi-mali-mainline => sunxi-mali-utgard}/glesv2.pc (100%)
 rename package/{sunxi-mali-mainline/sunxi-mali-mainline.hash => sunxi-mali-utgard/sunxi-mali-utgard.hash} (70%)
 create mode 100644 package/sunxi-mali-utgard/sunxi-mali-utgard.mk

diff --git a/Config.in.legacy b/Config.in.legacy
index 6a33ce9e1c..295b1c6003 100644
--- a/Config.in.legacy
+++ b/Config.in.legacy
@@ -144,6 +144,36 @@ endif
 
 ###############################################################################
 
+config BR2_PACKAGE_SUNXI_MALI_MAINLINE
+	bool "sunxi-mali-mainline package was renamed"
+	select BR2_LEGACY
+	select BR2_PACKAGE_SUNXI_MALI_UTGARD
+	help
+	  Since the removal of the sunxi-mali package, the
+	  sunxi-mali-mainline package that coexisted became the only
+	  package to provide Mali blobs. The "-mainline" suffix being
+	  undescriptive nowadays and before adding new packages bringing
+	  Mali support for other SoCs/GPU flavors, it is clearer to
+	  rename it SUNXI_MALI_UTGARD.
+
+config BR2_PACKAGE_SUNXI_MALI_MAINLINE_R6P2
+	bool "sunxi-mali-mainline-r6p2 was renamed"
+	select BR2_LEGACY
+	select BR2_PACKAGE_SUNXI_MALI_UTGARD_R6P2
+	help
+	  The sunxi-mali-mainline package has been renamed
+	  sunxi-mali-utgard, the suboptions of this package have also
+	  been renamed accordingly.
+
+config BR2_PACKAGE_SUNXI_MALI_MAINLINE_R8P1
+	bool "sunxi-mali-mainline-r8p1 was renamed"
+	select BR2_LEGACY
+	select BR2_PACKAGE_SUNXI_MALI_UTGARD_R8P1
+	help
+	  The sunxi-mali-mainline package has been renamed
+	  sunxi-mali-utgard, the suboptions of this package have also
+	  been renamed accordingly.
+
 comment "Legacy options removed in 2020.02"
 
 config BR2_PACKAGE_QT5_VERSION_5_6
diff --git a/DEVELOPERS b/DEVELOPERS
index dd44331b85..289fa9077d 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -1013,7 +1013,7 @@ F:	package/libnspr/
 F:	package/libnss/
 F:	package/minicom/
 F:	package/nfs-utils/
-F:	package/sunxi-mali-mainline/
+F:	package/sunxi-mali-utgard/
 F:	package/sunxi-mali-mainline-driver/
 
 N:	Gregory Dymarek <gregd72002@gmail.com>
diff --git a/configs/olimex_a20_olinuxino_lime2_defconfig b/configs/olimex_a20_olinuxino_lime2_defconfig
index 21b681a1fb..02865d3c8c 100644
--- a/configs/olimex_a20_olinuxino_lime2_defconfig
+++ b/configs/olimex_a20_olinuxino_lime2_defconfig
@@ -27,7 +27,7 @@ BR2_LINUX_KERNEL_INSTALL_TARGET=y
 
 # sunxi packages
 BR2_PACKAGE_SUNXI_TOOLS=y
-BR2_PACKAGE_SUNXI_MALI_MAINLINE=y
+BR2_PACKAGE_SUNXI_MALI_UTGARD=y
 BR2_PACKAGE_SUNXI_MALI_MAINLINE_DRIVER=y
 
 # Filesystem
diff --git a/configs/olimex_a20_olinuxino_lime_defconfig b/configs/olimex_a20_olinuxino_lime_defconfig
index 029f9ebad3..58a468aabf 100644
--- a/configs/olimex_a20_olinuxino_lime_defconfig
+++ b/configs/olimex_a20_olinuxino_lime_defconfig
@@ -27,7 +27,7 @@ BR2_LINUX_KERNEL_INSTALL_TARGET=y
 
 # sunxi packages
 BR2_PACKAGE_SUNXI_TOOLS=y
-BR2_PACKAGE_SUNXI_MALI_MAINLINE=y
+BR2_PACKAGE_SUNXI_MALI_UTGARD=y
 BR2_PACKAGE_SUNXI_MALI_MAINLINE_DRIVER=y
 
 # Filesystem
diff --git a/docs/manual/adding-packages-virtual.txt b/docs/manual/adding-packages-virtual.txt
index 6326bb5455..722e6e3771 100644
--- a/docs/manual/adding-packages-virtual.txt
+++ b/docs/manual/adding-packages-virtual.txt
@@ -13,7 +13,7 @@ the provider used in the rootfs.
 For example, 'OpenGL ES' is an API for 2D and 3D graphics on embedded systems.
 The implementation of this API is different for the 'Allwinner Tech Sunxi' and
 the 'Texas Instruments OMAP35xx' platforms. So +libgles+ will be a virtual
-package and +sunxi-mali+ and +ti-gfx+ will be the providers.
+package and +sunxi-mali-utgard+ and +ti-gfx+ will be the providers.
 
 ==== +virtual-package+ tutorial
 
diff --git a/package/Config.in b/package/Config.in
index dfa3f34b9d..aa57d34f96 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -538,8 +538,8 @@ endmenu
 	source "package/statserial/Config.in"
 	source "package/stm32flash/Config.in"
 	source "package/sunxi-cedarx/Config.in"
-	source "package/sunxi-mali-mainline/Config.in"
 	source "package/sunxi-mali-mainline-driver/Config.in"
+	source "package/sunxi-mali-utgard/Config.in"
 	source "package/sysstat/Config.in"
 	source "package/targetcli-fb/Config.in"
 	source "package/ti-gfx/Config.in"
diff --git a/package/glslsandbox-player/Config.in b/package/glslsandbox-player/Config.in
index dc0d2c07f1..ebd59521fc 100644
--- a/package/glslsandbox-player/Config.in
+++ b/package/glslsandbox-player/Config.in
@@ -55,7 +55,7 @@ config BR2_PACKAGE_GLSLSANDBOX_PLAYER_SCRIPTS
 
 choice
 	prompt "Native windowing system"
-	default BR2_PACKAGE_GLSLSANDBOX_PLAYER_MALI  if BR2_PACKAGE_SUNXI_MALI_MAINLINE
+	default BR2_PACKAGE_GLSLSANDBOX_PLAYER_MALI  if BR2_PACKAGE_SUNXI_MALI_UTGARD
 	default BR2_PACKAGE_GLSLSANDBOX_PLAYER_RPI   if BR2_PACKAGE_RPI_USERLAND
 	default BR2_PACKAGE_GLSLSANDBOX_PLAYER_SDL2  if BR2_PACKAGE_SDL2_OPENGLES
 	default BR2_PACKAGE_GLSLSANDBOX_PLAYER_TISGX if BR2_PACKAGE_TI_SGX_UM
@@ -71,7 +71,7 @@ config BR2_PACKAGE_GLSLSANDBOX_PLAYER_KMS
 
 config BR2_PACKAGE_GLSLSANDBOX_PLAYER_MALI
 	bool "Allwinner ARM/Mali Frame Buffer"
-	depends on BR2_PACKAGE_SUNXI_MALI_MAINLINE
+	depends on BR2_PACKAGE_SUNXI_MALI_UTGARD
 
 config BR2_PACKAGE_GLSLSANDBOX_PLAYER_RPI
 	bool "RaspberryPI Frame Buffer"
diff --git a/package/glslsandbox-player/glslsandbox-player.mk b/package/glslsandbox-player/glslsandbox-player.mk
index 5ace69d7dd..9b06ee4f05 100644
--- a/package/glslsandbox-player/glslsandbox-player.mk
+++ b/package/glslsandbox-player/glslsandbox-player.mk
@@ -42,7 +42,7 @@ ifeq ($(BR2_PACKAGE_GLSLSANDBOX_PLAYER_KMS),y)
 GLSLSANDBOX_PLAYER_DEPENDENCIES += libdrm
 GLSLSANDBOX_PLAYER_CONF_OPTS += --with-native-gfx=kms
 else ifeq ($(BR2_PACKAGE_GLSLSANDBOX_PLAYER_MALI),y)
-GLSLSANDBOX_PLAYER_DEPENDENCIES += sunxi-mali-mainline
+GLSLSANDBOX_PLAYER_DEPENDENCIES += sunxi-mali-utgard
 GLSLSANDBOX_PLAYER_CONF_OPTS += --with-native-gfx=mali
 else ifeq ($(BR2_PACKAGE_GLSLSANDBOX_PLAYER_RPI),y)
 GLSLSANDBOX_PLAYER_DEPENDENCIES += rpi-userland
diff --git a/package/qt5/qt5base/qt5base.mk b/package/qt5/qt5base/qt5base.mk
index 774c771bc9..72d18b87da 100644
--- a/package/qt5/qt5base/qt5base.mk
+++ b/package/qt5/qt5base/qt5base.mk
@@ -312,7 +312,7 @@ ifeq ($(BR2_PACKAGE_QT5_VERSION_LATEST),y)
 ifeq ($(BR2_PACKAGE_IMX_GPU_VIV),y)
 # use vivante backend
 QT5BASE_EGLFS_DEVICE = EGLFS_DEVICE_INTEGRATION = eglfs_viv
-else ifeq ($(BR2_PACKAGE_SUNXI_MALI_MAINLINE),y)
+else ifeq ($(BR2_PACKAGE_SUNXI_MALI_UTGARD),y)
 # use mali backend
 QT5BASE_EGLFS_DEVICE = EGLFS_DEVICE_INTEGRATION = eglfs_mali
 endif
diff --git a/package/sunxi-mali-mainline/Config.in b/package/sunxi-mali-mainline/Config.in
deleted file mode 100644
index a2fb95bd79..0000000000
--- a/package/sunxi-mali-mainline/Config.in
+++ /dev/null
@@ -1,42 +0,0 @@
-config BR2_PACKAGE_SUNXI_MALI_MAINLINE
-	bool "sunxi-mali-mainline"
-	depends on BR2_aarch64 || (BR2_ARM_EABIHF && BR2_arm)
-	depends on BR2_TOOLCHAIN_USES_GLIBC
-	select BR2_PACKAGE_HAS_LIBEGL
-	select BR2_PACKAGE_HAS_LIBGLES
-	help
-	  Install userspace Allwinner OpenGL libraries.
-
-	  https://github.com/bootlin/mali-blobs
-
-if BR2_PACKAGE_SUNXI_MALI_MAINLINE
-
-config BR2_PACKAGE_PROVIDES_LIBEGL
-	default "sunxi-mali-mainline"
-
-config BR2_PACKAGE_PROVIDES_LIBGLES
-	default "sunxi-mali-mainline"
-
-choice
-	prompt "Version"
-	default BR2_PACKAGE_SUNXI_MALI_MAINLINE_R6P2
-	help
-	  Select the version of the userspace module.
-
-config BR2_PACKAGE_SUNXI_MALI_MAINLINE_R6P2
-	bool "r6p2"
-config BR2_PACKAGE_SUNXI_MALI_MAINLINE_R8P1
-	bool "r8p1"
-
-endchoice
-
-config BR2_PACKAGE_SUNXI_MALI_MAINLINE_REVISION
-	string
-	default "r6p2"	if BR2_PACKAGE_SUNXI_MALI_MAINLINE_R6P2
-	default "r8p1"	if BR2_PACKAGE_SUNXI_MALI_MAINLINE_R8P1
-
-endif
-
-comment "sunxi-mali needs an EABIhf glibc toolchain"
-	depends on BR2_arm
-	depends on !BR2_TOOLCHAIN_USES_GLIBC || !BR2_ARM_EABIHF
diff --git a/package/sunxi-mali-mainline/sunxi-mali-mainline.mk b/package/sunxi-mali-mainline/sunxi-mali-mainline.mk
deleted file mode 100644
index 701a1fbbb4..0000000000
--- a/package/sunxi-mali-mainline/sunxi-mali-mainline.mk
+++ /dev/null
@@ -1,49 +0,0 @@
-################################################################################
-#
-# sunxi-mali-mainline
-#
-################################################################################
-
-SUNXI_MALI_MAINLINE_VERSION = d691cb93884ca8ac67860502117bbec283dc19aa
-SUNXI_MALI_MAINLINE_SITE = $(call github,bootlin,mali-blobs,$(SUNXI_MALI_MAINLINE_VERSION))
-SUNXI_MALI_MAINLINE_INSTALL_STAGING = YES
-SUNXI_MALI_MAINLINE_PROVIDES = libegl libgles
-SUNXI_MALI_MAINLINE_LICENSE = Allwinner End User Licence Agreement
-SUNXI_MALI_MAINLINE_EULA_ORIGINAL = EULA\ for\ Mali\ 400MP\ _AW.pdf
-SUNXI_MALI_MAINLINE_EULA_NO_SPACES = EULA_for_Mali_400MP_AW.pdf
-SUNXI_MALI_MAINLINE_LICENSE_FILES = $(SUNXI_MALI_MAINLINE_EULA_NO_SPACES)
-
-SUNXI_MALI_MAINLINE_REV = $(call qstrip,$(BR2_PACKAGE_SUNXI_MALI_MAINLINE_REVISION))
-
-ifeq ($(BR2_arm),y)
-SUNXI_MALI_MAINLINE_ARCH=arm
-else ifeq ($(BR2_aarch64),y)
-SUNXI_MALI_MAINLINE_ARCH=arm64
-endif
-
-define SUNXI_MALI_MAINLINE_INSTALL_STAGING_CMDS
-	mkdir -p $(STAGING_DIR)/usr/lib $(STAGING_DIR)/usr/include
-
-	cp -rf $(@D)/$(SUNXI_MALI_MAINLINE_REV)/$(SUNXI_MALI_MAINLINE_ARCH)/fbdev/*.so* \
-		$(STAGING_DIR)/usr/lib/
-	cp -rf $(@D)/include/fbdev/* $(STAGING_DIR)/usr/include/
-
-	$(INSTALL) -D -m 0644 package/sunxi-mali-mainline/egl.pc \
-		$(STAGING_DIR)/usr/lib/pkgconfig/egl.pc
-	$(INSTALL) -D -m 0644 package/sunxi-mali-mainline/glesv2.pc \
-		$(STAGING_DIR)/usr/lib/pkgconfig/glesv2.pc
-endef
-
-define SUNXI_MALI_MAINLINE_INSTALL_TARGET_CMDS
-	mkdir -p $(TARGET_DIR)/usr/lib
-	cp -rf $(@D)/$(SUNXI_MALI_MAINLINE_REV)/$(SUNXI_MALI_MAINLINE_ARCH)/fbdev/*.so* \
-		$(TARGET_DIR)/usr/lib/
-endef
-
-define SUNXI_MALI_MAINLINE_FIXUP_LICENSE_FILE
-	mv $(@D)/$(SUNXI_MALI_MAINLINE_EULA_ORIGINAL) $(@D)/$(SUNXI_MALI_MAINLINE_EULA_NO_SPACES)
-endef
-
-SUNXI_MALI_MAINLINE_POST_PATCH_HOOKS += SUNXI_MALI_MAINLINE_FIXUP_LICENSE_FILE
-
-$(eval $(generic-package))
diff --git a/package/sunxi-mali-utgard/Config.in b/package/sunxi-mali-utgard/Config.in
new file mode 100644
index 0000000000..ff49ea03f1
--- /dev/null
+++ b/package/sunxi-mali-utgard/Config.in
@@ -0,0 +1,43 @@
+config BR2_PACKAGE_SUNXI_MALI_UTGARD
+	bool "sunxi-mali-utgard"
+	depends on BR2_aarch64 || (BR2_ARM_EABIHF && BR2_arm)
+	depends on BR2_TOOLCHAIN_USES_GLIBC
+	select BR2_PACKAGE_HAS_LIBEGL
+	select BR2_PACKAGE_HAS_LIBGLES
+	help
+	  Install userspace Allwinner OpenGL libraries for Mali
+	  Utgard GPUs.
+
+	  https://github.com/bootlin/mali-blobs
+
+if BR2_PACKAGE_SUNXI_MALI_UTGARD
+
+config BR2_PACKAGE_PROVIDES_LIBEGL
+	default "sunxi-mali-utgard"
+
+config BR2_PACKAGE_PROVIDES_LIBGLES
+	default "sunxi-mali-utgard"
+
+choice
+	prompt "Version"
+	default BR2_PACKAGE_SUNXI_MALI_UTGARD_R6P2
+	help
+	  Select the version of the userspace module.
+
+config BR2_PACKAGE_SUNXI_MALI_UTGARD_R6P2
+	bool "r6p2"
+config BR2_PACKAGE_SUNXI_MALI_UTGARD_R8P1
+	bool "r8p1"
+
+endchoice
+
+config BR2_PACKAGE_SUNXI_MALI_UTGARD_REVISION
+	string
+	default "r6p2"	if BR2_PACKAGE_SUNXI_MALI_UTGARD_R6P2
+	default "r8p1"	if BR2_PACKAGE_SUNXI_MALI_UTGARD_R8P1
+
+endif
+
+comment "sunxi-mali-utgard needs an EABIhf glibc toolchain"
+	depends on BR2_arm
+	depends on !BR2_TOOLCHAIN_USES_GLIBC || !BR2_ARM_EABIHF
diff --git a/package/sunxi-mali-mainline/egl.pc b/package/sunxi-mali-utgard/egl.pc
similarity index 100%
rename from package/sunxi-mali-mainline/egl.pc
rename to package/sunxi-mali-utgard/egl.pc
diff --git a/package/sunxi-mali-mainline/glesv2.pc b/package/sunxi-mali-utgard/glesv2.pc
similarity index 100%
rename from package/sunxi-mali-mainline/glesv2.pc
rename to package/sunxi-mali-utgard/glesv2.pc
diff --git a/package/sunxi-mali-mainline/sunxi-mali-mainline.hash b/package/sunxi-mali-utgard/sunxi-mali-utgard.hash
similarity index 70%
rename from package/sunxi-mali-mainline/sunxi-mali-mainline.hash
rename to package/sunxi-mali-utgard/sunxi-mali-utgard.hash
index 978be01024..528699126e 100644
--- a/package/sunxi-mali-mainline/sunxi-mali-mainline.hash
+++ b/package/sunxi-mali-utgard/sunxi-mali-utgard.hash
@@ -1,3 +1,3 @@
 # Locally calculated
-sha256 72969ecf470b9e5ce787c2f8f36242926e1e892af0891924ee59a2cd206de39f  sunxi-mali-mainline-d691cb93884ca8ac67860502117bbec283dc19aa.tar.gz
+sha256 72969ecf470b9e5ce787c2f8f36242926e1e892af0891924ee59a2cd206de39f  sunxi-mali-utgard-d691cb93884ca8ac67860502117bbec283dc19aa.tar.gz
 sha256 8a06bcae44a41a886f339b4338422415a786787f113e9ed6456ae117104a0b6a  EULA_for_Mali_400MP_AW.pdf
diff --git a/package/sunxi-mali-utgard/sunxi-mali-utgard.mk b/package/sunxi-mali-utgard/sunxi-mali-utgard.mk
new file mode 100644
index 0000000000..edbe81e62c
--- /dev/null
+++ b/package/sunxi-mali-utgard/sunxi-mali-utgard.mk
@@ -0,0 +1,49 @@
+################################################################################
+#
+# sunxi-mali-utgard
+#
+################################################################################
+
+SUNXI_MALI_UTGARD_VERSION = d691cb93884ca8ac67860502117bbec283dc19aa
+SUNXI_MALI_UTGARD_SITE = $(call github,bootlin,mali-blobs,$(SUNXI_MALI_UTGARD_VERSION))
+SUNXI_MALI_UTGARD_INSTALL_STAGING = YES
+SUNXI_MALI_UTGARD_PROVIDES = libegl libgles
+SUNXI_MALI_UTGARD_LICENSE = Allwinner End User Licence Agreement
+SUNXI_MALI_UTGARD_EULA_ORIGINAL = EULA\ for\ Mali\ 400MP\ _AW.pdf
+SUNXI_MALI_UTGARD_EULA_NO_SPACES = EULA_for_Mali_400MP_AW.pdf
+SUNXI_MALI_UTGARD_LICENSE_FILES = $(SUNXI_MALI_UTGARD_EULA_NO_SPACES)
+
+SUNXI_MALI_UTGARD_REV = $(call qstrip,$(BR2_PACKAGE_SUNXI_MALI_UTGARD_REVISION))
+
+ifeq ($(BR2_arm),y)
+SUNXI_MALI_UTGARD_ARCH=arm
+else ifeq ($(BR2_aarch64),y)
+SUNXI_MALI_UTGARD_ARCH=arm64
+endif
+
+define SUNXI_MALI_UTGARD_INSTALL_STAGING_CMDS
+	mkdir -p $(STAGING_DIR)/usr/lib $(STAGING_DIR)/usr/include
+
+	cp -rf $(@D)/$(SUNXI_MALI_UTGARD_REV)/$(SUNXI_MALI_UTGARD_ARCH)/fbdev/*.so* \
+		$(STAGING_DIR)/usr/lib/
+	cp -rf $(@D)/include/fbdev/* $(STAGING_DIR)/usr/include/
+
+	$(INSTALL) -D -m 0644 package/sunxi-mali-utgard/egl.pc \
+		$(STAGING_DIR)/usr/lib/pkgconfig/egl.pc
+	$(INSTALL) -D -m 0644 package/sunxi-mali-utgard/glesv2.pc \
+		$(STAGING_DIR)/usr/lib/pkgconfig/glesv2.pc
+endef
+
+define SUNXI_MALI_UTGARD_INSTALL_TARGET_CMDS
+	mkdir -p $(TARGET_DIR)/usr/lib
+	cp -rf $(@D)/$(SUNXI_MALI_UTGARD_REV)/$(SUNXI_MALI_UTGARD_ARCH)/fbdev/*.so* \
+		$(TARGET_DIR)/usr/lib/
+endef
+
+define SUNXI_MALI_UTGARD_FIXUP_LICENSE_FILE
+	mv $(@D)/$(SUNXI_MALI_UTGARD_EULA_ORIGINAL) $(@D)/$(SUNXI_MALI_UTGARD_EULA_NO_SPACES)
+endef
+
+SUNXI_MALI_UTGARD_POST_PATCH_HOOKS += SUNXI_MALI_UTGARD_FIXUP_LICENSE_FILE
+
+$(eval $(generic-package))
-- 
2.20.1

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

* [Buildroot] [PATCH 2/7] package/sunxi-mali-utgard-driver: rename from sunxi-mali-mainline-driver
  2020-03-06  7:14 [Buildroot] [PATCH 0/7] Rockchip Mali Bifrost GPU support Miquel Raynal
  2020-03-06  7:14 ` [Buildroot] [PATCH 1/7] package/sunxi-mali-utgard: rename from sunxi-mali-mainline Miquel Raynal
@ 2020-03-06  7:14 ` Miquel Raynal
  2020-03-06  7:14 ` [Buildroot] [PATCH 3/7] package/rockchip-mali-bifrost: new package with binary blobs Miquel Raynal
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 18+ messages in thread
From: Miquel Raynal @ 2020-03-06  7:14 UTC (permalink / raw)
  To: buildroot

This package provides a Mali kernel driver for Sunxi Mali Utgard GPUs. The
trailing -mainline is historical and was used at a time when there was
two packages providing this driver. The "non-upstream" package has
been removed some time ago so before adding new packages bringing
support for other ARM Mali GPU versions or implementations, rename
sunxi-mali-mainline-driver into sunxi-mali-utgard-driver.

Add a legacy entry.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 Config.in.legacy                              | 18 +++++-----
 DEVELOPERS                                    |  2 +-
 configs/olimex_a20_olinuxino_lime2_defconfig  |  2 +-
 configs/olimex_a20_olinuxino_lime_defconfig   |  2 +-
 linux/linux.mk                                |  2 +-
 package/Config.in                             |  2 +-
 package/sunxi-mali-mainline-driver/Config.in  | 25 -------------
 .../sunxi-mali-mainline-driver.mk             | 35 -------------------
 package/sunxi-mali-utgard-driver/Config.in    | 25 +++++++++++++
 .../sunxi-mali-utgard-driver.hash}            |  2 +-
 .../sunxi-mali-utgard-driver.mk               | 35 +++++++++++++++++++
 11 files changed, 75 insertions(+), 75 deletions(-)
 delete mode 100644 package/sunxi-mali-mainline-driver/Config.in
 delete mode 100644 package/sunxi-mali-mainline-driver/sunxi-mali-mainline-driver.mk
 create mode 100644 package/sunxi-mali-utgard-driver/Config.in
 rename package/{sunxi-mali-mainline-driver/sunxi-mali-mainline-driver.hash => sunxi-mali-utgard-driver/sunxi-mali-utgard-driver.hash} (66%)
 create mode 100644 package/sunxi-mali-utgard-driver/sunxi-mali-utgard-driver.mk

diff --git a/Config.in.legacy b/Config.in.legacy
index 295b1c6003..c9a044c68b 100644
--- a/Config.in.legacy
+++ b/Config.in.legacy
@@ -144,17 +144,17 @@ endif
 
 ###############################################################################
 
-config BR2_PACKAGE_SUNXI_MALI_MAINLINE
-	bool "sunxi-mali-mainline package was renamed"
+config BR2_PACKAGE_SUNXI_MALI_MAINLINE_DRIVER
+	bool "sunxi-mali-mainline-driver package was renamed"
 	select BR2_LEGACY
-	select BR2_PACKAGE_SUNXI_MALI_UTGARD
+	select BR2_PACKAGE_SUNXI_MALI_UTGARD_DRIVER
 	help
-	  Since the removal of the sunxi-mali package, the
-	  sunxi-mali-mainline package that coexisted became the only
-	  package to provide Mali blobs. The "-mainline" suffix being
-	  undescriptive nowadays and before adding new packages bringing
-	  Mali support for other SoCs/GPU flavors, it is clearer to
-	  rename it SUNXI_MALI_UTGARD.
+	  Since the removal of the sunxi-mali-driver package, the
+	  sunxi-mali-mainline-driver package that coexisted became the
+	  only package to provide the Suxy Mali driver. The "-mainline"
+	  suffix being undescriptive nowadays and before adding new
+	  packages bringing Mali support for other SoCs/GPU flavors, it
+	  is clearer to rename it SUNXI_MALI_UTGARD_DRIVER.
 
 config BR2_PACKAGE_SUNXI_MALI_MAINLINE_R6P2
 	bool "sunxi-mali-mainline-r6p2 was renamed"
diff --git a/DEVELOPERS b/DEVELOPERS
index 289fa9077d..f8d8bb360d 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -1014,7 +1014,7 @@ F:	package/libnss/
 F:	package/minicom/
 F:	package/nfs-utils/
 F:	package/sunxi-mali-utgard/
-F:	package/sunxi-mali-mainline-driver/
+F:	package/sunxi-mali-utgard-driver/
 
 N:	Gregory Dymarek <gregd72002@gmail.com>
 F:	package/ding-libs/
diff --git a/configs/olimex_a20_olinuxino_lime2_defconfig b/configs/olimex_a20_olinuxino_lime2_defconfig
index 02865d3c8c..9a840c7803 100644
--- a/configs/olimex_a20_olinuxino_lime2_defconfig
+++ b/configs/olimex_a20_olinuxino_lime2_defconfig
@@ -28,7 +28,7 @@ BR2_LINUX_KERNEL_INSTALL_TARGET=y
 # sunxi packages
 BR2_PACKAGE_SUNXI_TOOLS=y
 BR2_PACKAGE_SUNXI_MALI_UTGARD=y
-BR2_PACKAGE_SUNXI_MALI_MAINLINE_DRIVER=y
+BR2_PACKAGE_SUNXI_MALI_UTGARD_DRIVER=y
 
 # Filesystem
 BR2_TARGET_ROOTFS_EXT2=y
diff --git a/configs/olimex_a20_olinuxino_lime_defconfig b/configs/olimex_a20_olinuxino_lime_defconfig
index 58a468aabf..974fb99d7d 100644
--- a/configs/olimex_a20_olinuxino_lime_defconfig
+++ b/configs/olimex_a20_olinuxino_lime_defconfig
@@ -28,7 +28,7 @@ BR2_LINUX_KERNEL_INSTALL_TARGET=y
 # sunxi packages
 BR2_PACKAGE_SUNXI_TOOLS=y
 BR2_PACKAGE_SUNXI_MALI_UTGARD=y
-BR2_PACKAGE_SUNXI_MALI_MAINLINE_DRIVER=y
+BR2_PACKAGE_SUNXI_MALI_UTGARD_DRIVER=y
 
 # Filesystem
 BR2_TARGET_ROOTFS_EXT2=y
diff --git a/linux/linux.mk b/linux/linux.mk
index 4b60f33ff3..e6346b7274 100644
--- a/linux/linux.mk
+++ b/linux/linux.mk
@@ -379,7 +379,7 @@ define LINUX_KCONFIG_FIXUP_CMDS
 		$(call KCONFIG_ENABLE_OPT,CONFIG_SECURITY,$(@D)/.config)
 		$(call KCONFIG_ENABLE_OPT,CONFIG_SECURITY_SMACK,$(@D)/.config)
 		$(call KCONFIG_ENABLE_OPT,CONFIG_SECURITY_NETWORK,$(@D)/.config))
-	$(if $(BR2_PACKAGE_SUNXI_MALI_MAINLINE_DRIVER),
+	$(if $(BR2_PACKAGE_SUNXI_MALI_UTGARD_DRIVER),
 		$(call KCONFIG_ENABLE_OPT,CONFIG_CMA,$(@D)/.config)
 		$(call KCONFIG_ENABLE_OPT,CONFIG_DMA_CMA,$(@D)/.config))
 	$(if $(BR2_PACKAGE_IPTABLES),
diff --git a/package/Config.in b/package/Config.in
index aa57d34f96..2137aa88ed 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -538,8 +538,8 @@ endmenu
 	source "package/statserial/Config.in"
 	source "package/stm32flash/Config.in"
 	source "package/sunxi-cedarx/Config.in"
-	source "package/sunxi-mali-mainline-driver/Config.in"
 	source "package/sunxi-mali-utgard/Config.in"
+	source "package/sunxi-mali-utgard-driver/Config.in"
 	source "package/sysstat/Config.in"
 	source "package/targetcli-fb/Config.in"
 	source "package/ti-gfx/Config.in"
diff --git a/package/sunxi-mali-mainline-driver/Config.in b/package/sunxi-mali-mainline-driver/Config.in
deleted file mode 100644
index 057f20db66..0000000000
--- a/package/sunxi-mali-mainline-driver/Config.in
+++ /dev/null
@@ -1,25 +0,0 @@
-comment "sunxi-mali-mainline-driver needs a Linux kernel to be built"
-	depends on BR2_PACKAGE_SUNXI_MALI_MAINLINE
-	depends on !BR2_LINUX_KERNEL
-
-config BR2_PACKAGE_SUNXI_MALI_MAINLINE_DRIVER
-	bool "sunxi-mali-mainline-driver"
-	default y
-	depends on BR2_PACKAGE_SUNXI_MALI_MAINLINE # runtime
-	depends on BR2_LINUX_KERNEL
-	select BR2_LINUX_NEEDS_MODULES # not using kernel-module infra
-	help
-	  This package builds and installs the Linux kernel driver for
-	  the Mali GPU on Allwinner platforms, compatible with recent
-	  Linux kernels (>= 4.4). Note that it should be installed
-	  together with the corresponding userspace OpenGL libraries,
-	  which are provided as binaries only at:
-	  https://github.com/bootlin/mali-blobs
-
-	  sunxi-mali-mainline-driver requires a Linux kernel >= 4.4
-	  with the following options enabled:
-
-	  - CONFIG_CMA
-	  - CONFIG_DMA_CMA
-
-	  https://github.com/mripard/sunxi-mali/blob/master/README.md
diff --git a/package/sunxi-mali-mainline-driver/sunxi-mali-mainline-driver.mk b/package/sunxi-mali-mainline-driver/sunxi-mali-mainline-driver.mk
deleted file mode 100644
index 0edcdee4d6..0000000000
--- a/package/sunxi-mali-mainline-driver/sunxi-mali-mainline-driver.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-################################################################################
-#
-# sunxi-mali-mainline-driver
-#
-################################################################################
-
-SUNXI_MALI_MAINLINE_DRIVER_VERSION = ec654ee9caeb0c4348caacd0cf5eb2730d1d70e2
-SUNXI_MALI_MAINLINE_DRIVER_SITE = $(call github,mripard,sunxi-mali,$(SUNXI_MALI_MAINLINE_DRIVER_VERSION))
-SUNXI_MALI_MAINLINE_DRIVER_DEPENDENCIES = linux
-SUNXI_MALI_MAINLINE_DRIVER_LICENSE = GPL-2.0
-SUNXI_MALI_MAINLINE_DRIVER_LICENSE_FILES = LICENSE
-
-SUNXI_MALI_MAINLINE_DRIVER_MAKE_OPTS = \
-	$(LINUX_MAKE_FLAGS) \
-	KDIR=$(LINUX_DIR)
-
-define SUNXI_MALI_MAINLINE_DRIVER_USE_APPLY_PATCHES
-	ln -sf $(SUNXI_MALI_MAINLINE_REV)/series $(@D)/patches
-	$(SED) 's|quilt push -a|$(TOPDIR)/support/scripts/apply-patches.sh . ../patches|' \
-		$(@D)/build.sh
-endef
-
-SUNXI_MALI_MAINLINE_DRIVER_POST_PATCH_HOOKS += SUNXI_MALI_MAINLINE_DRIVER_USE_APPLY_PATCHES
-
-define SUNXI_MALI_MAINLINE_DRIVER_BUILD_CMDS
-	cd $(@D) && $(SUNXI_MALI_MAINLINE_DRIVER_MAKE_OPTS) \
-		$(SHELL) ./build.sh -r $(SUNXI_MALI_MAINLINE_REV) -j $(PARALLEL_JOBS) -b
-endef
-
-define SUNXI_MALI_MAINLINE_DRIVER_INSTALL_TARGET_CMDS
-	cd $(@D) && $(SUNXI_MALI_MAINLINE_DRIVER_MAKE_OPTS) \
-		$(SHELL) ./build.sh -r $(SUNXI_MALI_MAINLINE_REV) -j $(PARALLEL_JOBS) -i
-endef
-
-$(eval $(generic-package))
diff --git a/package/sunxi-mali-utgard-driver/Config.in b/package/sunxi-mali-utgard-driver/Config.in
new file mode 100644
index 0000000000..d27fc4e755
--- /dev/null
+++ b/package/sunxi-mali-utgard-driver/Config.in
@@ -0,0 +1,25 @@
+comment "sunxi-mali-utgard-driver needs a Linux kernel to be built"
+	depends on BR2_PACKAGE_SUNXI_MALI_UTGARD
+	depends on !BR2_LINUX_KERNEL
+
+config BR2_PACKAGE_SUNXI_MALI_UTGARD_DRIVER
+	bool "sunxi-mali-utgard-driver"
+	default y
+	depends on BR2_PACKAGE_SUNXI_MALI_UTGARD # runtime
+	depends on BR2_LINUX_KERNEL
+	select BR2_LINUX_NEEDS_MODULES # not using kernel-module infra
+	help
+	  This package builds and installs the Linux kernel driver for
+	  the Mali Utgard GPU on Allwinner platforms, compatible with
+	  recent Linux kernels (>= 4.4). Note that it should be
+	  installed together with the corresponding userspace OpenGL
+	  libraries, which are provided as binaries only at:
+	  https://github.com/bootlin/mali-blobs
+
+	  sunxi-mali-utgard-driver requires a Linux kernel >= 4.4
+	  with the following options enabled:
+
+	  - CONFIG_CMA
+	  - CONFIG_DMA_CMA
+
+	  https://github.com/mripard/sunxi-mali/blob/master/README.md
diff --git a/package/sunxi-mali-mainline-driver/sunxi-mali-mainline-driver.hash b/package/sunxi-mali-utgard-driver/sunxi-mali-utgard-driver.hash
similarity index 66%
rename from package/sunxi-mali-mainline-driver/sunxi-mali-mainline-driver.hash
rename to package/sunxi-mali-utgard-driver/sunxi-mali-utgard-driver.hash
index 7c01d07d20..1d259987ea 100644
--- a/package/sunxi-mali-mainline-driver/sunxi-mali-mainline-driver.hash
+++ b/package/sunxi-mali-utgard-driver/sunxi-mali-utgard-driver.hash
@@ -1,3 +1,3 @@
 # Locally calculated
-sha256 98abeb8ff2e7e824ec89c7be9984ff298db1f35e48d79092238799ff5a239e91  sunxi-mali-mainline-driver-ec654ee9caeb0c4348caacd0cf5eb2730d1d70e2.tar.gz
+sha256 98abeb8ff2e7e824ec89c7be9984ff298db1f35e48d79092238799ff5a239e91  sunxi-mali-utgard-driver-ec654ee9caeb0c4348caacd0cf5eb2730d1d70e2.tar.gz
 sha256 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643  LICENSE
diff --git a/package/sunxi-mali-utgard-driver/sunxi-mali-utgard-driver.mk b/package/sunxi-mali-utgard-driver/sunxi-mali-utgard-driver.mk
new file mode 100644
index 0000000000..e61a1f86ff
--- /dev/null
+++ b/package/sunxi-mali-utgard-driver/sunxi-mali-utgard-driver.mk
@@ -0,0 +1,35 @@
+################################################################################
+#
+# sunxi-mali-utgard-driver
+#
+################################################################################
+
+SUNXI_MALI_UTGARD_DRIVER_VERSION = ec654ee9caeb0c4348caacd0cf5eb2730d1d70e2
+SUNXI_MALI_UTGARD_DRIVER_SITE = $(call github,mripard,sunxi-mali,$(SUNXI_MALI_UTGARD_DRIVER_VERSION))
+SUNXI_MALI_UTGARD_DRIVER_DEPENDENCIES = linux
+SUNXI_MALI_UTGARD_DRIVER_LICENSE = GPL-2.0
+SUNXI_MALI_UTGARD_DRIVER_LICENSE_FILES = LICENSE
+
+SUNXI_MALI_UTGARD_DRIVER_MAKE_OPTS = \
+	$(LINUX_MAKE_FLAGS) \
+	KDIR=$(LINUX_DIR)
+
+define SUNXI_MALI_UTGARD_DRIVER_USE_APPLY_PATCHES
+	ln -sf $(SUNXI_MALI_UTGARD_REV)/series $(@D)/patches
+	$(SED) 's|quilt push -a|$(TOPDIR)/support/scripts/apply-patches.sh . ../patches|' \
+		$(@D)/build.sh
+endef
+
+SUNXI_MALI_UTGARD_DRIVER_POST_PATCH_HOOKS += SUNXI_MALI_UTGARD_DRIVER_USE_APPLY_PATCHES
+
+define SUNXI_MALI_UTGARD_DRIVER_BUILD_CMDS
+	cd $(@D) && $(SUNXI_MALI_UTGARD_DRIVER_MAKE_OPTS) \
+		$(SHELL) ./build.sh -r $(SUNXI_MALI_UTGARD_REV) -j $(PARALLEL_JOBS) -b
+endef
+
+define SUNXI_MALI_UTGARD_DRIVER_INSTALL_TARGET_CMDS
+	cd $(@D) && $(SUNXI_MALI_UTGARD_DRIVER_MAKE_OPTS) \
+		$(SHELL) ./build.sh -r $(SUNXI_MALI_UTGARD_REV) -j $(PARALLEL_JOBS) -i
+endef
+
+$(eval $(generic-package))
-- 
2.20.1

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

* [Buildroot] [PATCH 3/7] package/rockchip-mali-bifrost: new package with binary blobs
  2020-03-06  7:14 [Buildroot] [PATCH 0/7] Rockchip Mali Bifrost GPU support Miquel Raynal
  2020-03-06  7:14 ` [Buildroot] [PATCH 1/7] package/sunxi-mali-utgard: rename from sunxi-mali-mainline Miquel Raynal
  2020-03-06  7:14 ` [Buildroot] [PATCH 2/7] package/sunxi-mali-utgard-driver: rename from sunxi-mali-mainline-driver Miquel Raynal
@ 2020-03-06  7:14 ` Miquel Raynal
  2022-01-08 16:20   ` Thomas Petazzoni
  2020-03-06  7:14 ` [Buildroot] [PATCH 4/7] package/mali-bifrost-driver: new package Miquel Raynal
                   ` (4 subsequent siblings)
  7 siblings, 1 reply; 18+ messages in thread
From: Miquel Raynal @ 2020-03-06  7:14 UTC (permalink / raw)
  To: buildroot

From: Maxime Chevallier <maxime.chevallier@bootlin.com>

There is already a package adding Mali blobs for Sunxi Mali Utgard
GPUs. Many Rockchip SoCs feature a Mali Bifrost GPU and need specific
libraries provided under binary form with a non-GPL compliant license
by Rockchip. Package these libraries.

Define a common *_INSTALL_CMDS macro, which takes as argument the base
destination path, and use it to implement *_INSTALL_TARGET_CMDS and
*_INSTALL_STAGING_CMDS.

Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 package/Config.in                             |   1 +
 ...4-binaries-and-only-install-the-bifr.patch | 169 ++++++++++++++++++
 package/rockchip-mali-bifrost/Config.in       |  20 +++
 .../rockchip-mali-bifrost.hash                |   2 +
 .../rockchip-mali-bifrost.mk                  |  85 +++++++++
 5 files changed, 277 insertions(+)
 create mode 100644 package/rockchip-mali-bifrost/0001-cmake-Use-AArch64-binaries-and-only-install-the-bifr.patch
 create mode 100644 package/rockchip-mali-bifrost/Config.in
 create mode 100644 package/rockchip-mali-bifrost/rockchip-mali-bifrost.hash
 create mode 100644 package/rockchip-mali-bifrost/rockchip-mali-bifrost.mk

diff --git a/package/Config.in b/package/Config.in
index 2137aa88ed..f2217ee1d5 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -516,6 +516,7 @@ endmenu
 	source "package/raspi-gpio/Config.in"
 	source "package/read-edid/Config.in"
 	source "package/rng-tools/Config.in"
+	source "package/rockchip-mali-bifrost/Config.in"
 	source "package/rpi-userland/Config.in"
 	source "package/rs485conf/Config.in"
 	source "package/rtc-tools/Config.in"
diff --git a/package/rockchip-mali-bifrost/0001-cmake-Use-AArch64-binaries-and-only-install-the-bifr.patch b/package/rockchip-mali-bifrost/0001-cmake-Use-AArch64-binaries-and-only-install-the-bifr.patch
new file mode 100644
index 0000000000..c5cddea414
--- /dev/null
+++ b/package/rockchip-mali-bifrost/0001-cmake-Use-AArch64-binaries-and-only-install-the-bifr.patch
@@ -0,0 +1,169 @@
+From 8e076bbbd17f05e248e7cb139e437b0a75481983 Mon Sep 17 00:00:00 2001
+From: Maxime Chevallier <maxime.chevallier@bootlin.com>
+Date: Mon, 23 Dec 2019 09:20:22 +0100
+Subject: [PATCH] cmake: Use AArch64 binaries, and only install the bifrost
+ libraries
+
+Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
+---
+ CMakeLists.txt           | 24 ++----------------------
+ pkgconfig/OpenCL.pc      | 11 +++++++++++
+ pkgconfig/egl.pc         | 12 ++++++++++++
+ pkgconfig/gbm.pc         | 12 ++++++++++++
+ pkgconfig/glesv2.pc      | 12 ++++++++++++
+ pkgconfig/mali.pc        | 10 ++++++++++
+ pkgconfig/wayland-egl.pc | 12 ++++++++++++
+ 7 files changed, 71 insertions(+), 22 deletions(-)
+ create mode 100644 pkgconfig/OpenCL.pc
+ create mode 100644 pkgconfig/egl.pc
+ create mode 100644 pkgconfig/gbm.pc
+ create mode 100644 pkgconfig/glesv2.pc
+ create mode 100644 pkgconfig/mali.pc
+ create mode 100644 pkgconfig/wayland-egl.pc
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index b0affff..363da33 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -21,31 +21,11 @@ INSTALL(FILES "${CMAKE_CURRENT_SOURCE_DIR}/include/mali.icd"
+ DESTINATION "${CMAKE_INSTALL_SYSCONFDIR}/OpenCL/vendors/")
+ 
+ INSTALL(FILES
+-"${CMAKE_CURRENT_SOURCE_DIR}/lib/arm-linux-gnueabihf/libmali-midgard-t86x-r14p0.so"
++"${CMAKE_CURRENT_SOURCE_DIR}/lib/aarch64-linux-gnu/libmali-bifrost-g31-rxp0-wayland-gbm.so"
+ DESTINATION "${CMAKE_INSTALL_LIBDIR}")
+ 
+ INSTALL(FILES
+-"${CMAKE_CURRENT_SOURCE_DIR}/lib/arm-linux-gnueabihf/libmali-midgard-t76x-r14p0-r1p0.so"
+-DESTINATION "${CMAKE_INSTALL_LIBDIR}")
+-
+-INSTALL(FILES
+-"${CMAKE_CURRENT_SOURCE_DIR}/lib/arm-linux-gnueabihf/libmali-midgard-t76x-r14p0-r0p0.so"
+-DESTINATION "${CMAKE_INSTALL_LIBDIR}")
+-
+-INSTALL(FILES
+-"${CMAKE_CURRENT_SOURCE_DIR}/lib/arm-linux-gnueabihf/libmali-midgard-t76x-r14p0-r0p0-wayland.so"
+-DESTINATION "${CMAKE_INSTALL_LIBDIR}")
+-
+-INSTALL(FILES
+-"${CMAKE_CURRENT_SOURCE_DIR}/lib/arm-linux-gnueabihf/libmali-utgard-450-r7p0.so"
+-DESTINATION "${CMAKE_INSTALL_LIBDIR}")
+-
+-INSTALL(FILES
+-"${CMAKE_CURRENT_SOURCE_DIR}/lib/arm-linux-gnueabihf/libmali-utgard-400-r7p0.so"
+-DESTINATION "${CMAKE_INSTALL_LIBDIR}")
+-
+-INSTALL(FILES
+-"${CMAKE_CURRENT_SOURCE_DIR}/lib/arm-linux-gnueabihf/libmali-bifrost-g31-rxp0-wayland-gbm.so"
++"${CMAKE_CURRENT_SOURCE_DIR}/lib/aarch64-linux-gnu/libmali-bifrost-g31-rxp0-gbm.so"
+ DESTINATION "${CMAKE_INSTALL_LIBDIR}")
+ 
+ INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/egl.pc"
+diff --git a/pkgconfig/OpenCL.pc b/pkgconfig/OpenCL.pc
+new file mode 100644
+index 0000000..218d0ff
+--- /dev/null
++++ b/pkgconfig/OpenCL.pc
+@@ -0,0 +1,11 @@
++prefix=/usr
++exec_prefix=${prefix}
++libdir=${prefix}/lib
++includedir=${prefix}/include
++
++Name: OpenCL
++Description: Mali OpenCL library
++Requires.private:
++Version: 1.2
++Libs: -L${libdir} -lMaliOpenCL
++Cflags: -I${includedir} 
+diff --git a/pkgconfig/egl.pc b/pkgconfig/egl.pc
+new file mode 100644
+index 0000000..fe9e23a
+--- /dev/null
++++ b/pkgconfig/egl.pc
+@@ -0,0 +1,12 @@
++prefix=/usr
++exec_prefix=${prefix}
++libdir=${prefix}/lib
++includedir=${prefix}/include
++
++Name: egl
++Description: Mali EGL library
++Requires.private: 
++Version: 7.10
++Libs: -L${libdir} -lEGL
++Libs.private: -lm -lpthread
++Cflags: -I${includedir} 
+diff --git a/pkgconfig/gbm.pc b/pkgconfig/gbm.pc
+new file mode 100644
+index 0000000..e06a1e5
+--- /dev/null
++++ b/pkgconfig/gbm.pc
+@@ -0,0 +1,12 @@
++prefix=/usr
++exec_prefix=${prefix}
++libdir=${prefix}/lib
++includedir=${prefix}/include
++
++Name: gbm
++Description: Mali GBM library
++Requires.private: 
++Version: 10.4.0
++Libs: -L${libdir} -lgbm
++Libs.private: 
++Cflags: -I${includedir} 
+diff --git a/pkgconfig/glesv2.pc b/pkgconfig/glesv2.pc
+new file mode 100644
+index 0000000..51b4fca
+--- /dev/null
++++ b/pkgconfig/glesv2.pc
+@@ -0,0 +1,12 @@
++prefix=/usr
++exec_prefix=${prefix}
++libdir=${prefix}/lib
++includedir=${prefix}/include
++
++Name: glesv2
++Description: Mali GLESV2 library
++Requires.private:
++Version:
++Libs: -L${libdir} -lGLESv2
++Libs.private: -lm -lpthread
++Cflags: -I${includedir} 
+diff --git a/pkgconfig/mali.pc b/pkgconfig/mali.pc
+new file mode 100644
+index 0000000..b9aa626
+--- /dev/null
++++ b/pkgconfig/mali.pc
+@@ -0,0 +1,10 @@
++prefix=/usr
++exec_prefix=${prefix}
++libdir=${prefix}/lib
++includedir=${prefix}/include
++
++Name: mali
++Description: Mali EGL library
++Requires.private: 
++Libs: -L${libdir} -lMali
++Cflags: -I${includedir} 
+diff --git a/pkgconfig/wayland-egl.pc b/pkgconfig/wayland-egl.pc
+new file mode 100644
+index 0000000..7539f8c
+--- /dev/null
++++ b/pkgconfig/wayland-egl.pc
+@@ -0,0 +1,12 @@
++prefix=/usr
++exec_prefix=${prefix}
++libdir=${prefix}/lib
++includedir=${prefix}/include
++
++Name: wayland-egl
++Description: Mali EGL library
++Requires.private: 
++Version: 7.10
++Libs: -L${libdir} -lMali
++Libs.private: -lm -lpthread
++Cflags: -I${includedir} 
+-- 
+2.24.1
+
diff --git a/package/rockchip-mali-bifrost/Config.in b/package/rockchip-mali-bifrost/Config.in
new file mode 100644
index 0000000000..499cf0d8a9
--- /dev/null
+++ b/package/rockchip-mali-bifrost/Config.in
@@ -0,0 +1,20 @@
+config BR2_PACKAGE_ROCKCHIP_MALI_BIFROST
+	bool "rockchip-mali-bifrost"
+	depends on BR2_TOOLCHAIN_USES_GLIBC
+	depends on BR2_arm || BR2_aarch64
+	select BR2_PACKAGE_HAS_LIBEGL
+	select BR2_PACKAGE_HAS_LIBGLES
+	help
+	  Install the binary user-space libraries for the ARM Mali GPU.
+	  This package requires a kernel with the ARM Mali GPU Kernel
+	  Drivers enabled.
+
+if BR2_PACKAGE_ROCKCHIP_MALI_BIFROST
+
+config BR2_PACKAGE_PROVIDES_LIBEGL
+	default "rockchip-mali-bifrost"
+
+config BR2_PACKAGE_PROVIDES_LIBGLES
+	default "rockchip-mali-bifrost"
+
+endif
diff --git a/package/rockchip-mali-bifrost/rockchip-mali-bifrost.hash b/package/rockchip-mali-bifrost/rockchip-mali-bifrost.hash
new file mode 100644
index 0000000000..68f0d3dce0
--- /dev/null
+++ b/package/rockchip-mali-bifrost/rockchip-mali-bifrost.hash
@@ -0,0 +1,2 @@
+sha256 ee440d859e9d7dfdf29b9a00c7a633337913c407be567d3651c29c12eb75fd9c  rockchip-mali-bifrost-721653b5b3b525a4f80d15aa7e2f9df7b7e60427.tar.gz
+sha256 a78acc73de9909efb879800d4daa4640c4aaa55cd751238a133954aba15e4285  END_USER_LICENCE_AGREEMENT.txt
diff --git a/package/rockchip-mali-bifrost/rockchip-mali-bifrost.mk b/package/rockchip-mali-bifrost/rockchip-mali-bifrost.mk
new file mode 100644
index 0000000000..aefcd5057f
--- /dev/null
+++ b/package/rockchip-mali-bifrost/rockchip-mali-bifrost.mk
@@ -0,0 +1,85 @@
+################################################################################
+#
+# rockchip_mali_bifrost For Linux
+#
+################################################################################
+
+ROCKCHIP_MALI_BIFROST_VERSION = 721653b5b3b525a4f80d15aa7e2f9df7b7e60427
+ROCKCHIP_MALI_BIFROST_SITE = $(call github,rockchip-linux,libmali,$(ROCKCHIP_MALI_BIFROST_VERSION))
+ROCKCHIP_MALI_BIFROST_LICENSE = END_USER_LICENCE_AGREEMENT.txt
+
+ROCKCHIP_MALI_BIFROST_INSTALL_STAGING = YES
+
+ROCKCHIP_MALI_BIFROST_DEPENDENCIES = host-patchelf libdrm
+
+ROCKCHIP_MALI_BIFROST_PROVIDES = libegl libgles
+
+#ifeq ($(BR2_PACKAGE_WAYLAND),y)
+#ROCKCHIP_MALI_BIFROST_SUFFIX = -wayland
+#else
+#ifeq ($(BR2_PACKAGE_XORG7)),y)
+#ROCKCHIP_MALI_BIFROST_SUFFIX =
+#else
+ROCKCHIP_MALI_BIFROST_SUFFIX = -gbm
+#endif
+#endif
+
+ROCKCHIP_MALI_BIFROST_LIBS = libmali-bifrost-g31-rxp0$(ROCKCHIP_MALI_BIFROST_SUFFIX).so
+
+ROCKCHIP_MALI_BIFROST_ARCH_DIR = $(if $(BR2_arm),arm-linux-gnueabihf,aarch64-linux-gnu)
+
+ifeq ($(BR2_PACKAGE_WAYLAND),y)
+define ROCKCHIP_MALI_BIFROST_CREATE_WAYLAND_LINKS
+	rm -f $(1)/usr/lib/libwayland-egl.so*
+
+	ln -sf libmali.so $(1)/usr/lib/libwayland-egl.so.1
+	ln -sf libwayland-egl.so.1 $(1)/usr/lib/libwayland-egl.so
+endef
+endif
+
+ROCKCHIP_MALI_BIFROST_HEADERS_DIRS = CL EGL FBDEV GLES GLES2 GLES3 KHR
+
+define ROCKCHIP_MALI_BIFROST_INSTALL_CMDS
+	mkdir -p $(1)/usr/lib
+	cp -dpfr $(@D)/lib/$(ROCKCHIP_MALI_BIFROST_ARCH_DIR)/$(ROCKCHIP_MALI_BIFROST_LIBS) $(1)/usr/lib
+
+	$(foreach l,$(ROCKCHIP_MALI_BIFROST_LIBS),
+		$(HOST_DIR)/bin/patchelf --set-soname libmali.so.1 $(1)/usr/lib/$(l)
+	)
+
+	ln -sf $(firstword $(ROCKCHIP_MALI_BIFROST_LIBS)) $(1)/usr/lib/libmali.so.1
+
+	$(foreach d,$(ROCKCHIP_MALI_BIFROST_HEADERS_DIRS),\
+		cp -dpfr $(@D)/include/$(d) $(1)/usr/include/
+	)
+	cp -dpfr $(@D)/include/gbm.h $(1)/usr/include/
+	mkdir -p $(1)/usr/lib/pkgconfig/
+	cp -dpfr $(@D)/pkgconfig/*.pc $(1)/usr/lib/pkgconfig/
+	ln -sf libmali.so.1 $(1)/usr/lib/libmali.so
+	ln -sf libmali.so $(1)/usr/lib/libMali.so.1
+	ln -sf libMali.so.1 $(1)/usr/lib/libMali.so
+
+	ln -sf libmali.so $(1)/usr/lib/libEGL.so.1
+	ln -sf libEGL.so.1 $(1)/usr/lib/libEGL.so
+
+	ln -sf libmali.so $(1)/usr/lib/libgbm.so.1
+	ln -sf libgbm.so.1 $(1)/usr/lib/libgbm.so
+	ln -sf libgbm.so.1 $(1)/usr/lib/libgbm.so.1.0.0
+
+	ln -sf libmali.so $(1)/usr/lib/libGLESv1_CM.so.1
+	ln -sf libGLESv1_CM.so.1 $(1)/usr/lib/libGLESv1_CM.so
+
+	ln -sf libmali.so $(1)/usr/lib/libGLESv2.so.2
+	ln -sf libGLESv2.so.2 $(1)/usr/lib/libGLESv2.so
+	$(call ROCKCHIP_MALI_BIFROST_CREATE_WAYLAND_LINKS,$(1))
+endef
+
+define ROCKCHIP_MALI_BIFROST_INSTALL_TARGET_CMDS
+	$(call ROCKCHIP_MALI_BIFROST_INSTALL_CMDS,$(TARGET_DIR))
+endef
+
+define ROCKCHIP_MALI_BIFROST_INSTALL_STAGING_CMDS
+	$(call ROCKCHIP_MALI_BIFROST_INSTALL_CMDS,$(STAGING_DIR))
+endef
+
+$(eval $(generic-package))
-- 
2.20.1

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

* [Buildroot] [PATCH 4/7] package/mali-bifrost-driver: new package
  2020-03-06  7:14 [Buildroot] [PATCH 0/7] Rockchip Mali Bifrost GPU support Miquel Raynal
                   ` (2 preceding siblings ...)
  2020-03-06  7:14 ` [Buildroot] [PATCH 3/7] package/rockchip-mali-bifrost: new package with binary blobs Miquel Raynal
@ 2020-03-06  7:14 ` Miquel Raynal
  2021-12-30 14:14   ` Thomas Petazzoni
  2022-01-08 18:07   ` Thomas Petazzoni
  2020-03-06  7:14 ` [Buildroot] [PATCH 5/7] package/qt5: make it possible to use rockchip-mali-bifrost as GBM provider Miquel Raynal
                   ` (3 subsequent siblings)
  7 siblings, 2 replies; 18+ messages in thread
From: Miquel Raynal @ 2020-03-06  7:14 UTC (permalink / raw)
  To: buildroot

Add a new package to build and install a generic ARM Mali Bifrost GPU
Linux kernel module.

This module is compliant with the standard kernel-module
infrastructure.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 package/Config.in                               |  1 +
 package/mali-bifrost-driver/Config.in           | 17 +++++++++++++++++
 .../mali-bifrost-driver.hash                    |  3 +++
 .../mali-bifrost-driver/mali-bifrost-driver.mk  | 15 +++++++++++++++
 4 files changed, 36 insertions(+)
 create mode 100644 package/mali-bifrost-driver/Config.in
 create mode 100644 package/mali-bifrost-driver/mali-bifrost-driver.hash
 create mode 100644 package/mali-bifrost-driver/mali-bifrost-driver.mk

diff --git a/package/Config.in b/package/Config.in
index f2217ee1d5..f9f71fc9eb 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -483,6 +483,7 @@ endmenu
 	source "package/lsuio/Config.in"
 	source "package/luksmeta/Config.in"
 	source "package/lvm2/Config.in"
+	source "package/mali-bifrost-driver/Config.in"
 	source "package/mali-t76x/Config.in"
 	source "package/mdadm/Config.in"
 	source "package/mdevd/Config.in"
diff --git a/package/mali-bifrost-driver/Config.in b/package/mali-bifrost-driver/Config.in
new file mode 100644
index 0000000000..c278048b98
--- /dev/null
+++ b/package/mali-bifrost-driver/Config.in
@@ -0,0 +1,17 @@
+comment "Mali Bifrost driver needs a Linux kernel to be built"
+	depends on BR2_PACKAGE_MALI_BIFROST_DRIVER
+	depends on !BR2_LINUX_KERNEL
+
+config BR2_PACKAGE_MALI_BIFROST_DRIVER
+	bool "mali-bifrost-driver"
+	default n
+	depends on BR2_PACKAGE_ROCKCHIP_MALI_BIFROST # runtime
+	depends on BR2_LINUX_KERNEL
+	help
+	  This package builds and installs the Linux kernel driver for
+	  the Mali Bifrost GPU, compatible with recent Linux kernels
+	  (>= 5.4). Note that it should be installed together with the
+	  corresponding userspace OpenGL libraries, which are usually
+	  provided as binaries only by hardware vendors.
+
+	  mali-bifrost-driver requires a Linux kernel >= 5.4.
diff --git a/package/mali-bifrost-driver/mali-bifrost-driver.hash b/package/mali-bifrost-driver/mali-bifrost-driver.hash
new file mode 100644
index 0000000000..40d3b749bf
--- /dev/null
+++ b/package/mali-bifrost-driver/mali-bifrost-driver.hash
@@ -0,0 +1,3 @@
+# Locally calculated
+sha256 915873382580ba86518ee0552980ce9726d51a819c90548e31dc4a528d532b1a  mali-bifrost-driver-v0.1.tar.gz
+sha256 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643  LICENSE
diff --git a/package/mali-bifrost-driver/mali-bifrost-driver.mk b/package/mali-bifrost-driver/mali-bifrost-driver.mk
new file mode 100644
index 0000000000..5d1990676e
--- /dev/null
+++ b/package/mali-bifrost-driver/mali-bifrost-driver.mk
@@ -0,0 +1,15 @@
+################################################################################
+#
+# mali-bifrost-driver
+#
+################################################################################
+
+MALI_BIFROST_DRIVER_VERSION = v0.1
+MALI_BIFROST_DRIVER_SITE = $(call github,bootlin,mali-bifrost,$(MALI_BIFROST_DRIVER_VERSION))
+MALI_BIFROST_DRIVER_DEPENDENCIES = linux
+MALI_BIFROST_DRIVER_LICENSE = GPL-2.0
+MALI_BIFROST_DRIVER_LICENSE_FILE = LICENSE
+MALI_BIFROST_DRIVER_MODULE_SUBDIRS = r8p0/drivers/gpu/arm/midgard
+
+$(eval $(kernel-module))
+$(eval $(generic-package))
-- 
2.20.1

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

* [Buildroot] [PATCH 5/7] package/qt5: make it possible to use rockchip-mali-bifrost as GBM provider
  2020-03-06  7:14 [Buildroot] [PATCH 0/7] Rockchip Mali Bifrost GPU support Miquel Raynal
                   ` (3 preceding siblings ...)
  2020-03-06  7:14 ` [Buildroot] [PATCH 4/7] package/mali-bifrost-driver: new package Miquel Raynal
@ 2020-03-06  7:14 ` Miquel Raynal
  2022-01-08 18:08   ` Thomas Petazzoni
  2020-03-06  7:14 ` [Buildroot] [PATCH 6/7] package/qt5: generalize the condition on which EGLFS KMS gets supported Miquel Raynal
                   ` (2 subsequent siblings)
  7 siblings, 1 reply; 18+ messages in thread
From: Miquel Raynal @ 2020-03-06  7:14 UTC (permalink / raw)
  To: buildroot

From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 package/qt5/qt5base/qt5base.mk | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/package/qt5/qt5base/qt5base.mk b/package/qt5/qt5base/qt5base.mk
index 72d18b87da..8803a4821e 100644
--- a/package/qt5/qt5base/qt5base.mk
+++ b/package/qt5/qt5base/qt5base.mk
@@ -84,6 +84,9 @@ QT5BASE_DEPENDENCIES += gcnano-binaries
 else ifeq ($(BR2_PACKAGE_TI_SGX_LIBGBM),y)
 QT5BASE_CONFIGURE_OPTS += -gbm
 QT5BASE_DEPENDENCIES += ti-sgx-libgbm
+else ifeq ($(BR2_PACKAGE_ROCKCHIP_MALI_BIFROST),y)
+QT5BASE_CONFIGURE_OPTS += -gbm
+QT5BASE_DEPENDENCIES += rockchip-mali-bifrost
 else
 QT5BASE_CONFIGURE_OPTS += -no-gbm
 endif
-- 
2.20.1

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

* [Buildroot] [PATCH 6/7] package/qt5: generalize the condition on which EGLFS KMS gets supported
  2020-03-06  7:14 [Buildroot] [PATCH 0/7] Rockchip Mali Bifrost GPU support Miquel Raynal
                   ` (4 preceding siblings ...)
  2020-03-06  7:14 ` [Buildroot] [PATCH 5/7] package/qt5: make it possible to use rockchip-mali-bifrost as GBM provider Miquel Raynal
@ 2020-03-06  7:14 ` Miquel Raynal
  2022-01-08 18:12   ` Thomas Petazzoni
  2020-03-06  7:14 ` [Buildroot] [PATCH 7/7] package/qt5: allows using rockchip-mali-bifrost as OpenGL/KMS provider Miquel Raynal
  2021-09-21 21:24 ` [Buildroot] [PATCH 0/7] Rockchip Mali Bifrost GPU support Giulio Benetti
  7 siblings, 1 reply; 18+ messages in thread
From: Miquel Raynal @ 2020-03-06  7:14 UTC (permalink / raw)
  To: buildroot

BR2_PACKAGE_HAS_LIBEGL indicates that the virtual libegl packet is
enabled. This packet may be provided by mesa3d (this is actually what
happens when selecting BR2_PACKAGE_MESA3D_OPENGL_EGL) but
other providers may exist.

Generalize the condition on which EGLFS KMS support is added to Qt5 to
allow rockchip-mali-bifrost (and potentially other) to use the KMS
back-end.

Suggested-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 package/qt5/qt5base/qt5base.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/qt5/qt5base/qt5base.mk b/package/qt5/qt5base/qt5base.mk
index 8803a4821e..ad01c7c843 100644
--- a/package/qt5/qt5base/qt5base.mk
+++ b/package/qt5/qt5base/qt5base.mk
@@ -295,7 +295,7 @@ QT5BASE_INSTALL_LIBS_$(BR2_PACKAGE_QT5BASE_XML)        += Qt5Xml
 QT5BASE_INSTALL_LIBS_$(BR2_PACKAGE_QT5BASE_OPENGL_LIB) += Qt5OpenGL
 ifeq ($(BR2_PACKAGE_QT5_VERSION_LATEST),y)
 QT5BASE_INSTALL_LIBS_$(BR2_PACKAGE_QT5BASE_EGLFS)      += Qt5EglFSDeviceIntegration
-ifeq ($(BR2_PACKAGE_MESA3D_OPENGL_EGL),y)
+ifeq ($(BR2_PACKAGE_HAS_LIBEGL),y)
 QT5BASE_INSTALL_LIBS_$(BR2_PACKAGE_QT5BASE_EGLFS)      += Qt5EglFsKmsSupport
 endif
 ifeq ($(BR2_PACKAGE_GCNANO_BINARIES),y)
-- 
2.20.1

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

* [Buildroot] [PATCH 7/7] package/qt5: allows using rockchip-mali-bifrost as OpenGL/KMS provider
  2020-03-06  7:14 [Buildroot] [PATCH 0/7] Rockchip Mali Bifrost GPU support Miquel Raynal
                   ` (5 preceding siblings ...)
  2020-03-06  7:14 ` [Buildroot] [PATCH 6/7] package/qt5: generalize the condition on which EGLFS KMS gets supported Miquel Raynal
@ 2020-03-06  7:14 ` Miquel Raynal
  2022-01-08 18:28   ` Thomas Petazzoni
  2021-09-21 21:24 ` [Buildroot] [PATCH 0/7] Rockchip Mali Bifrost GPU support Giulio Benetti
  7 siblings, 1 reply; 18+ messages in thread
From: Miquel Raynal @ 2020-03-06  7:14 UTC (permalink / raw)
  To: buildroot

From: Maxime Chevallier <maxime.chevallier@bootlin.com>

In order to be able to use OpenGL with QT5 with a Rockchip Mali
Bifrost GPU, a device integration provider has to be selected. We are
interested in the KMS integration that works well with Mali Bifrost,
make sure it gets build when using rockchip-mali-bifrost as OpenGL
provider.

Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 package/qt5/qt5base/qt5base.mk | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/package/qt5/qt5base/qt5base.mk b/package/qt5/qt5base/qt5base.mk
index ad01c7c843..2053988778 100644
--- a/package/qt5/qt5base/qt5base.mk
+++ b/package/qt5/qt5base/qt5base.mk
@@ -318,6 +318,9 @@ QT5BASE_EGLFS_DEVICE = EGLFS_DEVICE_INTEGRATION = eglfs_viv
 else ifeq ($(BR2_PACKAGE_SUNXI_MALI_UTGARD),y)
 # use mali backend
 QT5BASE_EGLFS_DEVICE = EGLFS_DEVICE_INTEGRATION = eglfs_mali
+else ifeq ($(BR2_PACKAGE_ROCKCHIP_MALI_BIFROST),y)
+# use kms backend
+QT5BASE_EGLFS_DEVICE = EGLFS_DEVICE_INTEGRATION = eglfs_kms
 endif
 endif
 
-- 
2.20.1

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

* Re: [Buildroot] [PATCH 0/7] Rockchip Mali Bifrost GPU support
  2020-03-06  7:14 [Buildroot] [PATCH 0/7] Rockchip Mali Bifrost GPU support Miquel Raynal
                   ` (6 preceding siblings ...)
  2020-03-06  7:14 ` [Buildroot] [PATCH 7/7] package/qt5: allows using rockchip-mali-bifrost as OpenGL/KMS provider Miquel Raynal
@ 2021-09-21 21:24 ` Giulio Benetti
  7 siblings, 0 replies; 18+ messages in thread
From: Giulio Benetti @ 2021-09-21 21:24 UTC (permalink / raw)
  To: Miquel Raynal, buildroot
  Cc: Maxime Chevallier, Paul Kocialkowski, Julien Olivain,
	Julien Corjon, Thomas Petazzoni, Luca Ceresoli, Peter Seiderer,
	Thomas De Schampheleire

Hello All,

I would like to take over this patchset and re-spin. I only need to know 
if it still makes sense since Lima and Panfrost are available and 
specifically Lima is suggested[1] in place of proprietary sunxi-mali.

If you agree I can rebase, verify and test it on both sunxi and rockchip 
boards.

[1]: 
https://github.com/mripard/sunxi-mali/commit/d798e7eec6f654a685981e41433aef17a40d9443

Thanks in advance and
Best regards
-- 
Giulio Benetti
Benetti Engineering sas

On 3/6/20 8:14 AM, Miquel Raynal wrote:
> Hello,
> 
> As part of a wider work targeting a Rockchip SoC, here is an
> attempt to ease the use of Mali Bifrost GPUs (at least on Rockchip
> platforms) by providing the necessary packages to build and install
> the necessary userspace and kernel components.
> 
> This series first renames the existing Mali-related packages targeting
> Allwinner SoCs to clarify what they provide, then brings support for
> Rockchip userspace (closed-source) libraries and (open-source) driver,
> and finally updates the Qt5 make file to support this hardware.
> 
> Hope this will be useful!
> 
> Cheers,
> Miquèl
> 
> Maxime Chevallier (2):
>    package/rockchip-mali-bifrost: new package with binary blobs
>    package/qt5: allows using rockchip-mali-bifrost as OpenGL/KMS provider
> 
> Miquel Raynal (4):
>    package/sunxi-mali-utgard: rename from sunxi-mali-mainline
>    package/sunxi-mali-utgard-driver: rename from
>      sunxi-mali-mainline-driver
>    package/mali-bifrost-driver: new package
>    package/qt5: generalize the condition on which EGLFS KMS gets
>      supported
> 
> Thomas Petazzoni (1):
>    package/qt5: make it possible to use rockchip-mali-bifrost as GBM
>      provider
> 
>   Config.in.legacy                              |  30 ++++
>   DEVELOPERS                                    |   4 +-
>   configs/olimex_a20_olinuxino_lime2_defconfig  |   4 +-
>   configs/olimex_a20_olinuxino_lime_defconfig   |   4 +-
>   docs/manual/adding-packages-virtual.txt       |   2 +-
>   linux/linux.mk                                |   2 +-
>   package/Config.in                             |   6 +-
>   package/glslsandbox-player/Config.in          |   4 +-
>   .../glslsandbox-player/glslsandbox-player.mk  |   2 +-
>   package/mali-bifrost-driver/Config.in         |  17 ++
>   .../mali-bifrost-driver.hash                  |   3 +
>   .../mali-bifrost-driver.mk                    |  15 ++
>   package/qt5/qt5base/qt5base.mk                |  10 +-
>   ...4-binaries-and-only-install-the-bifr.patch | 169 ++++++++++++++++++
>   package/rockchip-mali-bifrost/Config.in       |  20 +++
>   .../rockchip-mali-bifrost.hash                |   2 +
>   .../rockchip-mali-bifrost.mk                  |  85 +++++++++
>   package/sunxi-mali-mainline-driver/Config.in  |  25 ---
>   .../sunxi-mali-mainline-driver.mk             |  35 ----
>   package/sunxi-mali-mainline/Config.in         |  42 -----
>   .../sunxi-mali-mainline.mk                    |  49 -----
>   package/sunxi-mali-utgard-driver/Config.in    |  25 +++
>   .../sunxi-mali-utgard-driver.hash}            |   2 +-
>   .../sunxi-mali-utgard-driver.mk               |  35 ++++
>   package/sunxi-mali-utgard/Config.in           |  43 +++++
>   .../egl.pc                                    |   0
>   .../glesv2.pc                                 |   0
>   .../sunxi-mali-utgard.hash}                   |   2 +-
>   .../sunxi-mali-utgard/sunxi-mali-utgard.mk    |  49 +++++
>   29 files changed, 518 insertions(+), 168 deletions(-)
>   create mode 100644 package/mali-bifrost-driver/Config.in
>   create mode 100644 package/mali-bifrost-driver/mali-bifrost-driver.hash
>   create mode 100644 package/mali-bifrost-driver/mali-bifrost-driver.mk
>   create mode 100644 package/rockchip-mali-bifrost/0001-cmake-Use-AArch64-binaries-and-only-install-the-bifr.patch
>   create mode 100644 package/rockchip-mali-bifrost/Config.in
>   create mode 100644 package/rockchip-mali-bifrost/rockchip-mali-bifrost.hash
>   create mode 100644 package/rockchip-mali-bifrost/rockchip-mali-bifrost.mk
>   delete mode 100644 package/sunxi-mali-mainline-driver/Config.in
>   delete mode 100644 package/sunxi-mali-mainline-driver/sunxi-mali-mainline-driver.mk
>   delete mode 100644 package/sunxi-mali-mainline/Config.in
>   delete mode 100644 package/sunxi-mali-mainline/sunxi-mali-mainline.mk
>   create mode 100644 package/sunxi-mali-utgard-driver/Config.in
>   rename package/{sunxi-mali-mainline-driver/sunxi-mali-mainline-driver.hash => sunxi-mali-utgard-driver/sunxi-mali-utgard-driver.hash} (66%)
>   create mode 100644 package/sunxi-mali-utgard-driver/sunxi-mali-utgard-driver.mk
>   create mode 100644 package/sunxi-mali-utgard/Config.in
>   rename package/{sunxi-mali-mainline => sunxi-mali-utgard}/egl.pc (100%)
>   rename package/{sunxi-mali-mainline => sunxi-mali-utgard}/glesv2.pc (100%)
>   rename package/{sunxi-mali-mainline/sunxi-mali-mainline.hash => sunxi-mali-utgard/sunxi-mali-utgard.hash} (70%)
>   create mode 100644 package/sunxi-mali-utgard/sunxi-mali-utgard.mk
> 

_______________________________________________
buildroot mailing list
buildroot@lists.buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH 4/7] package/mali-bifrost-driver: new package
  2020-03-06  7:14 ` [Buildroot] [PATCH 4/7] package/mali-bifrost-driver: new package Miquel Raynal
@ 2021-12-30 14:14   ` Thomas Petazzoni
  2021-12-30 15:28     ` Giulio Benetti
  2022-01-08 18:07   ` Thomas Petazzoni
  1 sibling, 1 reply; 18+ messages in thread
From: Thomas Petazzoni @ 2021-12-30 14:14 UTC (permalink / raw)
  To: Miquel Raynal
  Cc: Maxime Chevallier, Paul Kocialkowski, Peter Seiderer,
	Julien Corjon, buildroot, Luca Ceresoli, Giulio Benetti,
	Thomas De Schampheleire

Hello Miquèl,

On Fri,  6 Mar 2020 08:14:37 +0100
Miquel Raynal <miquel.raynal@bootlin.com> wrote:

> +MALI_BIFROST_DRIVER_VERSION = v0.1
> +MALI_BIFROST_DRIVER_SITE = $(call github,bootlin,mali-bifrost,$(MALI_BIFROST_DRIVER_VERSION))
> +MALI_BIFROST_DRIVER_DEPENDENCIES = linux
> +MALI_BIFROST_DRIVER_LICENSE = GPL-2.0
> +MALI_BIFROST_DRIVER_LICENSE_FILE = LICENSE
> +MALI_BIFROST_DRIVER_MODULE_SUBDIRS = r8p0/drivers/gpu/arm/midgard

There is something really odd here: why is this package named
mali-bitfrost-driver if the subdirectory you're building is
r8p0/drivers/gpu/arm/midgard ? bitfrost and midgard are two different
generations of the ARM Mali GPU, at least according to
https://en.wikipedia.org/wiki/Mali_(GPU).

Could you clarify (you or somebody else, for that matter) ?

Thanks!

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

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

* Re: [Buildroot] [PATCH 4/7] package/mali-bifrost-driver: new package
  2021-12-30 14:14   ` Thomas Petazzoni
@ 2021-12-30 15:28     ` Giulio Benetti
  2021-12-30 16:08       ` Thomas Petazzoni
  0 siblings, 1 reply; 18+ messages in thread
From: Giulio Benetti @ 2021-12-30 15:28 UTC (permalink / raw)
  To: Thomas Petazzoni, Miquel Raynal
  Cc: Maxime Chevallier, Paul Kocialkowski, Peter Seiderer,
	Julien Corjon, buildroot, Luca Ceresoli, Thomas De Schampheleire

Hi Thomas, Miquèl,

On 30/12/21 15:14, Thomas Petazzoni wrote:
> Hello Miquèl,
> 
> On Fri,  6 Mar 2020 08:14:37 +0100
> Miquel Raynal <miquel.raynal@bootlin.com> wrote:
> 
>> +MALI_BIFROST_DRIVER_VERSION = v0.1
>> +MALI_BIFROST_DRIVER_SITE = $(call github,bootlin,mali-bifrost,$(MALI_BIFROST_DRIVER_VERSION))
>> +MALI_BIFROST_DRIVER_DEPENDENCIES = linux
>> +MALI_BIFROST_DRIVER_LICENSE = GPL-2.0
>> +MALI_BIFROST_DRIVER_LICENSE_FILE = LICENSE
>> +MALI_BIFROST_DRIVER_MODULE_SUBDIRS = r8p0/drivers/gpu/arm/midgard
> 
> There is something really odd here: why is this package named
> mali-bitfrost-driver if the subdirectory you're building is
> r8p0/drivers/gpu/arm/midgard ? bitfrost and midgard are two different
> generations of the ARM Mali GPU, at least according to
> https://en.wikipedia.org/wiki/Mali_(GPU).
> 
> Could you clarify (you or somebody else, for that matter) ?

I'm interested too to this ^^^

I had no chance to test it on real hardware for lack of time :-/ so I 
don't know if it works, and it should not be expected to work. I've 
compared r8 version of midgard against bifrost and they are pretty 
different.

I'm working on this patchset in spare time[1] with the goal to create a 
single mali-driver package to deal with Utgard, Midgard and Bifrost.
I've already requested to change repository name from 
mali-bifrost-driver to mali-driver and it's been done plus merging 
patches to allow building with up to Linux 5.15[2].

Thomas, do you want me to send the v2 patchset in[1] to Buildroot 
mailing list? It's not complete at all, but it's some step forward.

[1]: https://github.com/giuliobenetti/buildroot/commits/dev/mali-rebase
[2]: https://github.com/bootlin/mali-driver

Best regards
-- 
Giulio Benetti
Benetti Engineering sas
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH 4/7] package/mali-bifrost-driver: new package
  2021-12-30 15:28     ` Giulio Benetti
@ 2021-12-30 16:08       ` Thomas Petazzoni
  2021-12-30 16:45         ` Giulio Benetti
  0 siblings, 1 reply; 18+ messages in thread
From: Thomas Petazzoni @ 2021-12-30 16:08 UTC (permalink / raw)
  To: Giulio Benetti
  Cc: Miquel Raynal, Maxime Chevallier, Paul Kocialkowski,
	Peter Seiderer, Julien Corjon, buildroot, Luca Ceresoli,
	Thomas De Schampheleire

Hello,

On Thu, 30 Dec 2021 16:28:57 +0100
Giulio Benetti <giulio.benetti@benettiengineering.com> wrote:

> I had no chance to test it on real hardware for lack of time :-/ so I 
> don't know if it works, and it should not be expected to work. I've 
> compared r8 version of midgard against bifrost and they are pretty 
> different.

I'm pretty sure it works, since I've seen myself the patches from
Miquèl allowing to run Qt5/OpenGL on a Rockchip PX30 platform. I'm
questioning the terminology/choice of naming.

> I'm working on this patchset in spare time[1] with the goal to create a 
> single mali-driver package to deal with Utgard, Midgard and Bifrost.
> I've already requested to change repository name from 
> mali-bifrost-driver to mali-driver and it's been done plus merging 
> patches to allow building with up to Linux 5.15[2].

Ah, we did this rename?

> Thomas, do you want me to send the v2 patchset in[1] to Buildroot 
> mailing list? It's not complete at all, but it's some step forward.

I'm a bit lost with all these renames. We already have
sunxi-mali-mainline-driver in the tree, which points to
https://github.com/mripard/sunxi-mali. I'm not sure which kernel driver
handles which GPU variant.

Best regards,

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

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

* Re: [Buildroot] [PATCH 4/7] package/mali-bifrost-driver: new package
  2021-12-30 16:08       ` Thomas Petazzoni
@ 2021-12-30 16:45         ` Giulio Benetti
  0 siblings, 0 replies; 18+ messages in thread
From: Giulio Benetti @ 2021-12-30 16:45 UTC (permalink / raw)
  To: Thomas Petazzoni
  Cc: Miquel Raynal, Maxime Chevallier, Paul Kocialkowski,
	Peter Seiderer, Julien Corjon, buildroot, Luca Ceresoli,
	Thomas De Schampheleire

On 30/12/21 17:08, Thomas Petazzoni wrote:
> Hello,
> 
> On Thu, 30 Dec 2021 16:28:57 +0100
> Giulio Benetti <giulio.benetti@benettiengineering.com> wrote:
> 
>> I had no chance to test it on real hardware for lack of time :-/ so I
>> don't know if it works, and it should not be expected to work. I've
>> compared r8 version of midgard against bifrost and they are pretty
>> different.
> 
> I'm pretty sure it works, since I've seen myself the patches from
> Miquèl allowing to run Qt5/OpenGL on a Rockchip PX30 platform. I'm
> questioning the terminology/choice of naming.

Ok. Probably Midgard and Bifrost have lot in common on driver side and 
that's why it works. PX30 has a G31-2EE which is a Bifrost:
https://developer.arm.com/ip-products/graphics-and-multimedia/mali-gpus/mali-g31-gpu

So ok, it works but it should be changed. What I can do is providing the 
bifrost driver with the patches for Midgard ported against Bifrost and 
ask the PR. But I don't have time to test and I don't have a working 
PX30 BR defconfig for PX30-Mini-Evb or Engicam PX30 board that I wanted 
to provide.

>> I'm working on this patchset in spare time[1] with the goal to create a
>> single mali-driver package to deal with Utgard, Midgard and Bifrost.
>> I've already requested to change repository name from
>> mali-bifrost-driver to mali-driver and it's been done plus merging
>> patches to allow building with up to Linux 5.15[2].
> 
> Ah, we did this rename?

Yes:
https://github.com/bootlin/mali-driver

> 
>> Thomas, do you want me to send the v2 patchset in[1] to Buildroot
>> mailing list? It's not complete at all, but it's some step forward.
> 
> I'm a bit lost with all these renames. We already have
> sunxi-mali-mainline-driver in the tree, which points to
> https://github.com/mripard/sunxi-mali. I'm not sure which kernel driver
> handles which GPU variant.

mripard/sunxi-mali[1] only deals with Mali Utgard for Sunxi.
The problem is that the mripard/sunxi-mali has a specific platform 
implementation for sunxi:
https://github.com/mripard/sunxi-mali/blob/master/patches/0005-mali-Add-sunxi-platform.patch

While bootlin/mali-driver[2] doesn't have any platform-specific 
implementation. As you've pointed you've tested PX30(Bifrost G31) and it 
works, so that means that G31 doesn't need any specific 
platform-specific implementations. BUT there is 
CONFIG_MALI_PLATFORM_NAME that can be used to point to platform-specific 
implementation(i.e. sunxi):
https://github.com/bootlin/mali-driver/blob/master/r8p0/drivers/gpu/arm/midgard/Kconfig#L72-L79

So what we can do is to add that Sunxi implementation to r6p2 and r8p1 
while adding them to bootlin/mali-driver[2] and remove the actual 
sunxi-mali-mainline-driver BR package.

That way we will end up(for the moment) with these packages:
A1) mali-driver => with all Utgard(Sunxi platform included), Midgard, 
Bifrost versions.
A2) sunxi-mali-mainline => that should change into sunxi-mali-utgard, 
check pending patches[3] for this. And as a second step I would call it 
mali-blobs-sunxi and try to have access from Allwinner to other Blobs 
with license(because I have access to G31 Sunxi blobs but I can't 
publish them) collecting there all Sunxi mali blobs(Utgard, Midgard, 
Bifrost)
A3) mali-blobs-rockchip => with all Rockchip blobs(Utgard, Midgard, 
Bifrost) that we can easily take from rockchip-linux/libmali

This way it becomes easy to add other SoCs drivers and blobs. Steps 
would be:
B1) add platform specific implementation to bootlin/mali-driver(if any)
B2) waiting for PR to be merged
B3) add Buildroot package for the blobs with dependencies on mali-driver 
like mali-blobs-newSoc

Said this, the problem is time for me.

Hope everything is clear.

[1]: https://github.com/mripard/sunxi-mali
[2]: https://github.com/bootlin/mali-driver
[3]: https://patchwork.ozlabs.org/project/buildroot/list/?series=270656

Best regards
-- 
Giulio Benetti
Benetti Engineering sas
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH 3/7] package/rockchip-mali-bifrost: new package with binary blobs
  2020-03-06  7:14 ` [Buildroot] [PATCH 3/7] package/rockchip-mali-bifrost: new package with binary blobs Miquel Raynal
@ 2022-01-08 16:20   ` Thomas Petazzoni
  0 siblings, 0 replies; 18+ messages in thread
From: Thomas Petazzoni @ 2022-01-08 16:20 UTC (permalink / raw)
  To: Miquel Raynal
  Cc: Maxime Chevallier, Paul Kocialkowski, Peter Seiderer,
	Julien Corjon, buildroot, Luca Ceresoli, Giulio Benetti,
	Thomas De Schampheleire

On Fri,  6 Mar 2020 08:14:36 +0100
Miquel Raynal <miquel.raynal@bootlin.com> wrote:

> From: Maxime Chevallier <maxime.chevallier@bootlin.com>
> 
> There is already a package adding Mali blobs for Sunxi Mali Utgard
> GPUs. Many Rockchip SoCs feature a Mali Bifrost GPU and need specific
> libraries provided under binary form with a non-GPL compliant license
> by Rockchip. Package these libraries.
> 
> Define a common *_INSTALL_CMDS macro, which takes as argument the base
> destination path, and use it to implement *_INSTALL_TARGET_CMDS and
> *_INSTALL_STAGING_CMDS.
> 
> Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> ---
>  package/Config.in                             |   1 +
>  ...4-binaries-and-only-install-the-bifr.patch | 169 ++++++++++++++++++
>  package/rockchip-mali-bifrost/Config.in       |  20 +++
>  .../rockchip-mali-bifrost.hash                |   2 +
>  .../rockchip-mali-bifrost.mk                  |  85 +++++++++
>  5 files changed, 277 insertions(+)
>  create mode 100644 package/rockchip-mali-bifrost/0001-cmake-Use-AArch64-binaries-and-only-install-the-bifr.patch
>  create mode 100644 package/rockchip-mali-bifrost/Config.in
>  create mode 100644 package/rockchip-mali-bifrost/rockchip-mali-bifrost.hash
>  create mode 100644 package/rockchip-mali-bifrost/rockchip-mali-bifrost.mk

Thanks for this patch, which we have finally applied! I did a large
number of changes, almost rewriting it entirely:

    [Thomas:
    - Rename to rockchip-mali, because it contains other blobs than
      Bifrost ones
    - Add missing entry in DEVELOPERS file
    - Change BR2_arm to BR2_ARM_EABIHF as only EABIhf blobs are provided
      for arm32
    - Add BR2_TOOLCHAIN_HAS_THREADS inherited from libdrm.
    - Expose as a libgbm provider.
    - Drop the patch, which was not necessary.
    - Rework the entire installation logic, to be much simpler.]

Thanks!

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

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

* Re: [Buildroot] [PATCH 4/7] package/mali-bifrost-driver: new package
  2020-03-06  7:14 ` [Buildroot] [PATCH 4/7] package/mali-bifrost-driver: new package Miquel Raynal
  2021-12-30 14:14   ` Thomas Petazzoni
@ 2022-01-08 18:07   ` Thomas Petazzoni
  1 sibling, 0 replies; 18+ messages in thread
From: Thomas Petazzoni @ 2022-01-08 18:07 UTC (permalink / raw)
  To: Miquel Raynal
  Cc: Maxime Chevallier, Paul Kocialkowski, Peter Seiderer,
	Julien Corjon, buildroot, Luca Ceresoli, Giulio Benetti,
	Thomas De Schampheleire

On Fri,  6 Mar 2020 08:14:37 +0100
Miquel Raynal <miquel.raynal@bootlin.com> wrote:

> Add a new package to build and install a generic ARM Mali Bifrost GPU
> Linux kernel module.
> 
> This module is compliant with the standard kernel-module
> infrastructure.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> ---
>  package/Config.in                               |  1 +
>  package/mali-bifrost-driver/Config.in           | 17 +++++++++++++++++
>  .../mali-bifrost-driver.hash                    |  3 +++
>  .../mali-bifrost-driver/mali-bifrost-driver.mk  | 15 +++++++++++++++
>  4 files changed, 36 insertions(+)
>  create mode 100644 package/mali-bifrost-driver/Config.in
>  create mode 100644 package/mali-bifrost-driver/mali-bifrost-driver.hash
>  create mode 100644 package/mali-bifrost-driver/mali-bifrost-driver.mk

I finally applied, after renaming to "mali-driver", updating to the
latest version, and doing a few small changes.

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

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

* Re: [Buildroot] [PATCH 5/7] package/qt5: make it possible to use rockchip-mali-bifrost as GBM provider
  2020-03-06  7:14 ` [Buildroot] [PATCH 5/7] package/qt5: make it possible to use rockchip-mali-bifrost as GBM provider Miquel Raynal
@ 2022-01-08 18:08   ` Thomas Petazzoni
  0 siblings, 0 replies; 18+ messages in thread
From: Thomas Petazzoni @ 2022-01-08 18:08 UTC (permalink / raw)
  To: Miquel Raynal
  Cc: Maxime Chevallier, Paul Kocialkowski, Peter Seiderer,
	Julien Corjon, buildroot, Luca Ceresoli, Giulio Benetti,
	Thomas De Schampheleire

On Fri,  6 Mar 2020 08:14:38 +0100
Miquel Raynal <miquel.raynal@bootlin.com> wrote:

> From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>

I did not apply this patch. Instead, I reworked qt5base.mk to use the
libgbm virtual package. And since the rockhip-mali package is a
provider of libgbm, qt5base is able to use it.

Best regards,

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

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

* Re: [Buildroot] [PATCH 6/7] package/qt5: generalize the condition on which EGLFS KMS gets supported
  2020-03-06  7:14 ` [Buildroot] [PATCH 6/7] package/qt5: generalize the condition on which EGLFS KMS gets supported Miquel Raynal
@ 2022-01-08 18:12   ` Thomas Petazzoni
  0 siblings, 0 replies; 18+ messages in thread
From: Thomas Petazzoni @ 2022-01-08 18:12 UTC (permalink / raw)
  To: Miquel Raynal
  Cc: Maxime Chevallier, Paul Kocialkowski, Peter Seiderer,
	Julien Corjon, buildroot, Luca Ceresoli, Giulio Benetti,
	Thomas De Schampheleire

On Fri,  6 Mar 2020 08:14:39 +0100
Miquel Raynal <miquel.raynal@bootlin.com> wrote:

> BR2_PACKAGE_HAS_LIBEGL indicates that the virtual libegl packet is
> enabled. This packet may be provided by mesa3d (this is actually what
> happens when selecting BR2_PACKAGE_MESA3D_OPENGL_EGL) but
> other providers may exist.
> 
> Generalize the condition on which EGLFS KMS support is added to Qt5 to
> allow rockchip-mali-bifrost (and potentially other) to use the KMS
> back-end.
> 
> Suggested-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> ---
>  package/qt5/qt5base/qt5base.mk | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

This is no longer needed since commit
469829d9c55b7f5461e29f3f6436417836504410. All that conditional logic to
determine which Qt libraries and plugins to install is gone, as we now
use the Qt "make install" logic.

So I'll mark this patch as Superseded.

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

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

* Re: [Buildroot] [PATCH 7/7] package/qt5: allows using rockchip-mali-bifrost as OpenGL/KMS provider
  2020-03-06  7:14 ` [Buildroot] [PATCH 7/7] package/qt5: allows using rockchip-mali-bifrost as OpenGL/KMS provider Miquel Raynal
@ 2022-01-08 18:28   ` Thomas Petazzoni
  0 siblings, 0 replies; 18+ messages in thread
From: Thomas Petazzoni @ 2022-01-08 18:28 UTC (permalink / raw)
  To: Miquel Raynal
  Cc: Maxime Chevallier, Paul Kocialkowski, Peter Seiderer,
	Julien Corjon, buildroot, Luca Ceresoli, Giulio Benetti,
	Thomas De Schampheleire

On Fri,  6 Mar 2020 08:14:40 +0100
Miquel Raynal <miquel.raynal@bootlin.com> wrote:

> From: Maxime Chevallier <maxime.chevallier@bootlin.com>
> 
> In order to be able to use OpenGL with QT5 with a Rockchip Mali
> Bifrost GPU, a device integration provider has to be selected. We are
> interested in the KMS integration that works well with Mali Bifrost,
> make sure it gets build when using rockchip-mali-bifrost as OpenGL
> provider.
> 
> Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> ---
>  package/qt5/qt5base/qt5base.mk | 3 +++
>  1 file changed, 3 insertions(+)

Applied to master, thanks. Ideally, I would like to understand better
when this eglfs_kms device integration plugin can be used. If you (or
Paul) have more insights about this, it would be very useful.

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

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

end of thread, other threads:[~2022-01-08 18:28 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-06  7:14 [Buildroot] [PATCH 0/7] Rockchip Mali Bifrost GPU support Miquel Raynal
2020-03-06  7:14 ` [Buildroot] [PATCH 1/7] package/sunxi-mali-utgard: rename from sunxi-mali-mainline Miquel Raynal
2020-03-06  7:14 ` [Buildroot] [PATCH 2/7] package/sunxi-mali-utgard-driver: rename from sunxi-mali-mainline-driver Miquel Raynal
2020-03-06  7:14 ` [Buildroot] [PATCH 3/7] package/rockchip-mali-bifrost: new package with binary blobs Miquel Raynal
2022-01-08 16:20   ` Thomas Petazzoni
2020-03-06  7:14 ` [Buildroot] [PATCH 4/7] package/mali-bifrost-driver: new package Miquel Raynal
2021-12-30 14:14   ` Thomas Petazzoni
2021-12-30 15:28     ` Giulio Benetti
2021-12-30 16:08       ` Thomas Petazzoni
2021-12-30 16:45         ` Giulio Benetti
2022-01-08 18:07   ` Thomas Petazzoni
2020-03-06  7:14 ` [Buildroot] [PATCH 5/7] package/qt5: make it possible to use rockchip-mali-bifrost as GBM provider Miquel Raynal
2022-01-08 18:08   ` Thomas Petazzoni
2020-03-06  7:14 ` [Buildroot] [PATCH 6/7] package/qt5: generalize the condition on which EGLFS KMS gets supported Miquel Raynal
2022-01-08 18:12   ` Thomas Petazzoni
2020-03-06  7:14 ` [Buildroot] [PATCH 7/7] package/qt5: allows using rockchip-mali-bifrost as OpenGL/KMS provider Miquel Raynal
2022-01-08 18:28   ` Thomas Petazzoni
2021-09-21 21:24 ` [Buildroot] [PATCH 0/7] Rockchip Mali Bifrost GPU support Giulio Benetti

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.