Skip to contentSkip to conversation

Raspberry Pi 4 - mesa3d support

PATCH New Peter Seiderer 2 participants 11 messages Feb 4, 2020 – Feb 5, 2020 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

cover Raspberry Pi 4 - mesa3d support

Add Raspberry Pi 4 - mesa3d support, enables hardware supported graphic output for RPi4 64bit using mesa3d.

Tested by adding DTB overlay 'dtoverlay=vc4-fkms-v3d' to config.txt and running the following commands:

	$ QT_LOGGING_RULES="qt.qpa.*=true" /usr/lib/qt/examples/gui/analogclock/analogclock
	$ QT_LOGGING_RULES="qt.qpa.*=true" /usr/lib/qt/examples/quickcontrols/controls/gallery/gallery

Used defconfig:

BR2_aarch64=y
BR2_cortex_a72=y
BR2_ARM_FPU_VFPV4=y
BR2_TOOLCHAIN_BUILDROOT_GLIBC=y
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_19=y
BR2_TOOLCHAIN_BUILDROOT_CXX=y
BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y
BR2_ROOTFS_MERGED_USR=y
BR2_SYSTEM_DHCP="eth0"
BR2_ROOTFS_POST_BUILD_SCRIPT="board/raspberrypi4-64/post-build.sh"
BR2_ROOTFS_POST_IMAGE_SCRIPT="board/raspberrypi4-64/post-image.sh"
BR2_ROOTFS_POST_SCRIPT_ARGS="--add-miniuart-bt-overlay --aarch64"
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_TARBALL=y
BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,raspberrypi,linux,64d0a9870ac14d5eb5253f67d984ae348eec1393)/linux-64d0a9870ac14d5eb5253f67d984ae348eec1393.tar.gz" BR2_LINUX_KERNEL_DEFCONFIG="bcm2711"
BR2_LINUX_KERNEL_DTS_SUPPORT=y
BR2_LINUX_KERNEL_INTREE_DTS_NAME="broadcom/bcm2711-rpi-4-b"
BR2_LINUX_KERNEL_DTB_OVERLAY_SUPPORT=y
BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y
BR2_PACKAGE_STRACE=y
BR2_PACKAGE_DEJAVU=y
BR2_PACKAGE_KMSCUBE=y
BR2_PACKAGE_MESA3D=y
BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_KMSRO=y
BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_V3D=y
BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_VC4=y
BR2_PACKAGE_MESA3D_OPENGL_ES=y
BR2_PACKAGE_QT5=y
BR2_PACKAGE_QT5BASE_EXAMPLES=y
BR2_PACKAGE_QT5BASE_OPENGL_LIB=y
BR2_PACKAGE_QT5BASE_EGLFS=y
BR2_PACKAGE_QT5BASE_DEFAULT_QPA="eglfs"
BR2_PACKAGE_QT5BASE_FONTCONFIG=y
BR2_PACKAGE_QT5BASE_HARFBUZZ=y
BR2_PACKAGE_QT5BASE_GIF=y
BR2_PACKAGE_QT5BASE_JPEG=y
BR2_PACKAGE_QT5BASE_PNG=y
BR2_PACKAGE_QT5QUICKCONTROLS=y
BR2_PACKAGE_QT5QUICKCONTROLS2=y
BR2_PACKAGE_RPI_FIRMWARE=y
BR2_PACKAGE_RPI_FIRMWARE_VARIANT_PI4=y
BR2_TARGET_ROOTFS_EXT2=y
BR2_TARGET_ROOTFS_EXT2_4=y
BR2_TARGET_ROOTFS_EXT2_SIZE="384M"
# BR2_TARGET_ROOTFS_TAR is not set
BR2_PACKAGE_HOST_DOSFSTOOLS=y
BR2_PACKAGE_HOST_GENIMAGE=y
BR2_PACKAGE_HOST_MTOOLS=y

Peter Seiderer (2):
package/mesa3d: add v3d driver support
package/mesa3d: update vc4 help text

 package/mesa3d/Config.in | 18 ++++++++++++++++--
 package/mesa3d/mesa3d.mk |  3 +++
 2 files changed, 19 insertions(+), 2 deletions(-)
Signature · 1 line
2.25.0
#1 lore raw

PATCH 1/2 package/mesa3d: add v3d driver support

---
 package/mesa3d/Config.in | 12 ++++++++++++
 package/mesa3d/mesa3d.mk |  3 +++
 2 files changed, 15 insertions(+)
package/mesa3d/Config.in +12 -0
index 5929e15442..1351d1cd97 100644
@@ -224,6 +224,18 @@ config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_TEGRA
 	help
 	  Adds support for Nvidia Tegra GPUs, requires nouveau.
 
+config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_V3D
+	bool "Gallium v3d driver"
+	depends on BR2_arm || BR2_aarch64
+	select BR2_PACKAGE_MESA3D_GALLIUM_DRIVER
+	select BR2_PACKAGE_MESA3D_GALLIUM_KMSRO
+	select BR2_PACKAGE_LIBDRM_VC4
+	select BR2_PACKAGE_MESA3D_OPENGL_EGL
+	help
+	  Driver for Broadcom VC6 (rpi4) GPUs (needs kmsro and vc4).
+	  It requires a recent enough mainline/raspberrypi kernel with
+	  drm v3d (CONFIG_DRM_V3D, CONFIG_DRM_VC4) support enabled.
+
 config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_VC4
 	bool "Gallium vc4 driver"
 	depends on BR2_arm || BR2_aarch64
package/mesa3d/mesa3d.mk +3 -0
index c7e5be55a0..1a18cf3c58 100644
@@ -84,6 +84,7 @@ MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_RADEONSI) += radeonsi
 MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_SVGA)     += svga
 MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_SWRAST)   += swrast
 MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_TEGRA)    += tegra
+MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_V3D)      += v3d
 MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_VC4)      += vc4
 MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_VIRGL)    += virgl
 # DRI Drivers
@@ -162,6 +163,8 @@ endif
 MESA3D_PLATFORMS = surfaceless
 ifeq ($(BR2_PACKAGE_MESA3D_DRI_DRIVER),y)
 MESA3D_PLATFORMS += drm
+else ifeq ($(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_V3D),y)
+MESA3D_PLATFORMS += drm
 else ifeq ($(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_VC4),y)
 MESA3D_PLATFORMS += drm
 else ifeq ($(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_ETNAVIV),y)
Signature · 1 line
2.25.0
#2 lore raw

PATCH 1/2 package/mesa3d: add v3d driver support

Peter, All,

On 2020-02-04 15:44 +0100, Peter Seiderer spake thusly:

Quoted 1 line

Applied to master, thanks. I did a few tweaks to the help text,though, see below...

Quoted 12 lines
---
 package/mesa3d/Config.in | 12 ++++++++++++
 package/mesa3d/mesa3d.mk |  3 +++
 2 files changed, 15 insertions(+)
package/mesa3d/Config.in +0 -0
index 5929e15442..1351d1cd97 100644
@@ -224,6 +224,18 @@ config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_TEGRA
 	help
 	  Adds support for Nvidia Tegra GPUs, requires nouveau.

package/mesa3d/Config.in config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_TEGRA · line 235

Quoted 10 lines
package/mesa3d/Config.in +9 -0
 
+config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_V3D
+	bool "Gallium v3d driver"
+	depends on BR2_arm || BR2_aarch64
+	select BR2_PACKAGE_MESA3D_GALLIUM_DRIVER
+	select BR2_PACKAGE_MESA3D_GALLIUM_KMSRO
+	select BR2_PACKAGE_LIBDRM_VC4
+	select BR2_PACKAGE_MESA3D_OPENGL_EGL
+	help
+	  Driver for Broadcom VC6 (rpi4) GPUs (needs kmsro and vc4).

I don't understand why you added that '(needs kmsro and vc4)': the corresponding config entries are properly selected above, and thus this part of the help text is of no use for the user, and tend to in fact be very confusing. But since this is the same mess with the other options around, I left it. It would be nice to clean them away, though.

package/mesa3d/Config.in config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_TEGRA · line 237

Quoted 2 lines
package/mesa3d/Config.in +2 -0
+	  It requires a recent enough mainline/raspberrypi kernel with
+	  drm v3d (CONFIG_DRM_V3D, CONFIG_DRM_VC4) support enabled.

"recent enough" is of no use to the user: some woudl consider 4.0 to be recent, some would consider 5.0 to be old. Sol I replaced that with the exact version v3d was merged in mainline linux, that is 4.18.

Regards,
Yann E. MORIN.

Quoted 32 lines
package/mesa3d/Config.in +1 -0
+
 config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_VC4
 	bool "Gallium vc4 driver"
 	depends on BR2_arm || BR2_aarch64
package/mesa3d/mesa3d.mk +3 -0
index c7e5be55a0..1a18cf3c58 100644
@@ -84,6 +84,7 @@ MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_RADEONSI) += radeonsi
 MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_SVGA)     += svga
 MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_SWRAST)   += swrast
 MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_TEGRA)    += tegra
+MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_V3D)      += v3d
 MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_VC4)      += vc4
 MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_VIRGL)    += virgl
 # DRI Drivers
@@ -162,6 +163,8 @@ endif
 MESA3D_PLATFORMS = surfaceless
 ifeq ($(BR2_PACKAGE_MESA3D_DRI_DRIVER),y)
 MESA3D_PLATFORMS += drm
+else ifeq ($(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_V3D),y)
+MESA3D_PLATFORMS += drm
 else ifeq ($(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_VC4),y)
 MESA3D_PLATFORMS += drm
 else ifeq ($(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_ETNAVIV),y)
Signature · 6 lines
2.25.0

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw

PATCH 1/2 package/mesa3d: add v3d driver support

...hit the wrong button, so re-add CC: buildroot at busybox.net, Bernd Kuhls <[email protected]>, Romain Naour <[email protected]>

Quoted 106 lines · Peter Seiderer

Hello Yann,

Quoted 21 lines · Yann E. MORIN

Peter, All,

On 2020-02-04 15:44 +0100, Peter Seiderer spake thusly:

Quoted 1 line

Applied to master, thanks. I did a few tweaks to the help text,though, see below...

Quoted 13 lines
---
 package/mesa3d/Config.in | 12 ++++++++++++
 package/mesa3d/mesa3d.mk |  3 +++
 2 files changed, 15 insertions(+)
package/mesa3d/Config.in +0 -0
index 5929e15442..1351d1cd97 100644
@@ -224,6 +224,18 @@ config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_TEGRA
 	help
 	  Adds support for Nvidia Tegra GPUs, requires nouveau.
 
Quoted 13 lines

package/mesa3d/Config.in config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_TEGRA · line 235

Quoted 9 lines
package/mesa3d/Config.in +9 -0
+config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_V3D
+	bool "Gallium v3d driver"
+	depends on BR2_arm || BR2_aarch64
+	select BR2_PACKAGE_MESA3D_GALLIUM_DRIVER
+	select BR2_PACKAGE_MESA3D_GALLIUM_KMSRO
+	select )
+	select BR2_PACKAGE_MESA3D_OPENGL_EGL
+	help
+	  Driver for Broadcom VC6 (rpi4) GPUs (needs kmsro and vc4).

I don't understand why you added that '(needs kmsro and vc4)': the corresponding config entries are properly selected above, and thus this part of the help text is of no use for the user, and tend to in

kmsro/vc4 would mean BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_KMSRO (not mixed up with the selected BR2_PACKAGE_MESA3D_GALLIUM_KMSRO) and BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_VC4 (not mixed up with the selected BR2_PACKAGE_LIBDRM_VC4)...and all three mesa3d options (v3d, vc4, kmsro) are needed to get a functional RPi4-64bit graphic output (see e.g. [1]:
The VC4 interface is via /dev/drm/card1. The V3D interface is via /dev/drm/card0. All drawing commands go to V3D (aka card0). All screen resolution and configuration commands go to VC4 (aka card1))...

Quoted 9 lines

fact be very confusing. But since this is the same mess with the other options around, I left it. It would be nice to clean them away, though.

package/mesa3d/Config.in config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_TEGRA · line 237

Quoted 2 lines
package/mesa3d/Config.in +2 -0
+	  It requires a recent enough mainline/raspberrypi kernel with
+	  drm v3d (CONFIG_DRM_V3D, CONFIG_DRM_VC4) support enabled.

"recent enough" is of no use to the user: some woudl consider 4.0 to be recent, some would consider 5.0 to be old. Sol I replaced that with the exact version v3d was merged in mainline linux, that is 4.18.

Thanks for looking up at which kernel version CONFIG_DRM_V3D was added..., wanted to emphasize that both mainline and raspberrypi linux kernel are supported (some years ago only the mainline kernel supported DRM_VC4 and/or 64-bit Rpi)...

Regards,
Peter

[1] https://forum.qt.io/topic/107764/drm-kms-configuration-for-raspberry-pi-4

Quoted 37 lines

Regards,
Yann E. MORIN.

Quoted 32 lines
package/mesa3d/Config.in +1 -0
+
 config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_VC4
 	bool "Gallium vc4 driver"
 	depends on BR2_arm || BR2_aarch64
package/mesa3d/mesa3d.mk +3 -1
index c7e5be55a0..1a18cf3c58 100644
@@ -84,6 +84,7 @@ MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_RADEONSI) += radeonsi
 MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_SVGA)     += svga
 MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_SWRAST)   += swrast
 MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_TEGRA)    += tegra
+MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_V3D)      += v3d
 MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_VC4)      += vc4
 MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_VIRGL)    += virgl
 # DRI Drivers
@@ -162,6 +163,8 @@ endif
 MESA3D_PLATFORMS = surfaceless
 ifeq ($(BR2_PACKAGE_MESA3D_DRI_DRIVER),y)
 MESA3D_PLATFORMS += drm
+else ifeq ($(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_V3D),y)
+MESA3D_PLATFORMS += drm
 else ifeq ($(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_VC4),y)
 MESA3D_PLATFORMS += drm
 else ifeq ($(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_ETNAVIV),y)
--

2.25.0

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

#5 lore raw

PATCH 1/2 package/mesa3d: add v3d driver support

Peter, All,

On 2020-02-04 23:00 +0100, Peter Seiderer spake thusly:

Quoted 4 lines · Peter Seiderer
Quoted 3 lines · Yann E. MORIN
Quoted 2 lines

On 2020-02-04 15:44 +0100, Peter Seiderer spake thusly:

Quoted 1 line

[--SNIP--]

Quoted 14 lines
Quoted 14 lines
Quoted 13 lines

package/mesa3d/Config.in config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_TEGRA · line 235

Quoted 9 lines
package/mesa3d/Config.in +9 -0
+config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_V3D
+	bool "Gallium v3d driver"
+	depends on BR2_arm || BR2_aarch64
+	select BR2_PACKAGE_MESA3D_GALLIUM_DRIVER
+	select BR2_PACKAGE_MESA3D_GALLIUM_KMSRO
+	select )
+	select BR2_PACKAGE_MESA3D_OPENGL_EGL
+	help
+	  Driver for Broadcom VC6 (rpi4) GPUs (needs kmsro and vc4).

I don't understand why you added that '(needs kmsro and vc4)': the corresponding config entries are properly selected above, and thus this part of the help text is of no use for the user, and tend to in

Quoted 8 lines
Quoted 8 lines

kmsro/vc4 would mean BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_KMSRO (not mixed up with the selected BR2_PACKAGE_MESA3D_GALLIUM_KMSRO) and BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_VC4 (not mixed up with the selected BR2_PACKAGE_LIBDRM_VC4)...and all three mesa3d options (v3d, vc4, kmsro) are needed to get a functional RPi4-64bit graphic output (see e.g. [1]:
The VC4 interface is via /dev/drm/card1. The V3D interface is via /dev/drm/card0. All drawing commands go to V3D (aka card0). All screen resolution and configuration commands go to VC4 (aka card1))...

Slo it means the code you provided is not complete! Why do you not select the requried options?

select BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_KMSRO select BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_VC4

We don't want to let the user resolve the dependencies manually. This is what the config options are for.

Currently, with the code you provided, this means that the following defconfig would not generate a mesa3d that provperly supports the rpi4 (if I understood things correctly):

BR2_arm=y
BR2_cortex_a7=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_INIT_NONE=y
BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y
BR2_SYSTEM_BIN_SH_NONE=y
# BR2_PACKAGE_BUSYBOX is not set
BR2_PACKAGE_MESA3D=y
BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_V3D=y
# BR2_PACKAGE_EUDEV_ENABLE_HWDB is not set
# BR2_PACKAGE_IFUPDOWN_SCRIPTS is not set
# BR2_TARGET_ROOTFS_TAR is not set

This is definitely not nice at all... :-(

Could you please fix that up?

Regards,
Yann E. MORIN.

Quoted 59 lines
Quoted 58 lines
Quoted 9 lines

fact be very confusing. But since this is the same mess with the other options around, I left it. It would be nice to clean them away, though.

package/mesa3d/Config.in config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_TEGRA · line 237

Quoted 2 lines
package/mesa3d/Config.in +2 -0
+	  It requires a recent enough mainline/raspberrypi kernel with
+	  drm v3d (CONFIG_DRM_V3D, CONFIG_DRM_VC4) support enabled.

"recent enough" is of no use to the user: some woudl consider 4.0 to be recent, some would consider 5.0 to be old. Sol I replaced that with the exact version v3d was merged in mainline linux, that is 4.18.

Thanks for looking up at which kernel version CONFIG_DRM_V3D was added..., wanted to emphasize that both mainline and raspberrypi linux kernel are supported (some years ago only the mainline kernel supported DRM_VC4 and/or 64-bit Rpi)...

Regards,
Peter

[1] https://forum.qt.io/topic/107764/drm-kms-configuration-for-raspberry-pi-4

Quoted 37 lines

Regards,
Yann E. MORIN.

Quoted 32 lines
package/mesa3d/Config.in +1 -0
+
 config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_VC4
 	bool "Gallium vc4 driver"
 	depends on BR2_arm || BR2_aarch64
package/mesa3d/mesa3d.mk +3 -1
index c7e5be55a0..1a18cf3c58 100644
@@ -84,6 +84,7 @@ MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_RADEONSI) += radeonsi
 MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_SVGA)     += svga
 MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_SWRAST)   += swrast
 MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_TEGRA)    += tegra
+MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_V3D)      += v3d
 MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_VC4)      += vc4
 MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_VIRGL)    += virgl
 # DRI Drivers
@@ -162,6 +163,8 @@ endif
 MESA3D_PLATFORMS = surfaceless
 ifeq ($(BR2_PACKAGE_MESA3D_DRI_DRIVER),y)
 MESA3D_PLATFORMS += drm
+else ifeq ($(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_V3D),y)
+MESA3D_PLATFORMS += drm
 else ifeq ($(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_VC4),y)
 MESA3D_PLATFORMS += drm
 else ifeq ($(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_ETNAVIV),y)
--

2.25.0

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#6 lore raw

PATCH 1/2 package/mesa3d: add v3d driver support

Hello Yann,

Quoted 31 lines · Yann E. MORIN

Peter, All,

On 2020-02-04 23:00 +0100, Peter Seiderer spake thusly:

Quoted 4 lines · Peter Seiderer
Quoted 3 lines · Yann E. MORIN
Quoted 2 lines

On 2020-02-04 15:44 +0100, Peter Seiderer spake thusly:

Quoted 1 line

[--SNIP--]

Quoted 14 lines
Quoted 14 lines
Quoted 13 lines

package/mesa3d/Config.in config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_TEGRA · line 235

Quoted 9 lines
package/mesa3d/Config.in +9 -0
+config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_V3D
+	bool "Gallium v3d driver"
+	depends on BR2_arm || BR2_aarch64
+	select BR2_PACKAGE_MESA3D_GALLIUM_DRIVER
+	select BR2_PACKAGE_MESA3D_GALLIUM_KMSRO
+	select )
+	select BR2_PACKAGE_MESA3D_OPENGL_EGL
+	help
+	  Driver for Broadcom VC6 (rpi4) GPUs (needs kmsro and vc4).

I don't understand why you added that '(needs kmsro and vc4)': the corresponding config entries are properly selected above, and thus this part of the help text is of no use for the user, and tend to in

Quoted 8 lines
Quoted 8 lines

kmsro/vc4 would mean BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_KMSRO (not mixed up with the selected BR2_PACKAGE_MESA3D_GALLIUM_KMSRO) and BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_VC4 (not mixed up with the selected BR2_PACKAGE_LIBDRM_VC4)...and all three mesa3d options (v3d, vc4, kmsro) are needed to get a functional RPi4-64bit graphic output (see e.g. [1]:
The VC4 interface is via /dev/drm/card1. The V3D interface is via /dev/drm/card0. All drawing commands go to V3D (aka card0). All screen resolution and configuration commands go to VC4 (aka card1))...

Quoted 4 lines

Slo it means the code you provided is not complete! Why do you not select the requried options?

select BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_KMSRO

Because none of the other drivers does so...

Quoted 1 line

select BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_VC4

Because I do not know if all use-cases need a mesa3d-vc4 driver (my use case definitely ;-) )...

Quoted 3 lines

We don't want to let the user resolve the dependencies manually. This is what the config options are for.

All freedom for the empowered users ;-)

Quoted 5 lines

Currently, with the code you provided, this means that the following defconfig would not generate a mesa3d that provperly supports the rpi4 (if I understood things correctly):

Quoted 12 lines

BR2_arm=y
BR2_cortex_a7=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_INIT_NONE=y
BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y
BR2_SYSTEM_BIN_SH_NONE=y
# BR2_PACKAGE_BUSYBOX is not set
BR2_PACKAGE_MESA3D=y
BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_V3D=y
# BR2_PACKAGE_EUDEV_ENABLE_HWDB is not set
# BR2_PACKAGE_IFUPDOWN_SCRIPTS is not set
# BR2_TARGET_ROOTFS_TAR is not set

Yes...

Quoted 2 lines

This is definitely not nice at all... :-(

Yes, not all possible buildroot configs lead to an usable system... My reasoning was that the help text hint should be enough...

Regards,
Peter

Quoted 66 lines

Could you please fix that up?

Regards,
Yann E. MORIN.

Quoted 59 lines
Quoted 58 lines
Quoted 9 lines

fact be very confusing. But since this is the same mess with the other options around, I left it. It would be nice to clean them away, though.

package/mesa3d/Config.in config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_TEGRA · line 237

Quoted 2 lines
package/mesa3d/Config.in +2 -0
+	  It requires a recent enough mainline/raspberrypi kernel with
+	  drm v3d (CONFIG_DRM_V3D, CONFIG_DRM_VC4) support enabled.

"recent enough" is of no use to the user: some woudl consider 4.0 to be recent, some would consider 5.0 to be old. Sol I replaced that with the exact version v3d was merged in mainline linux, that is 4.18.

Thanks for looking up at which kernel version CONFIG_DRM_V3D was added..., wanted to emphasize that both mainline and raspberrypi linux kernel are supported (some years ago only the mainline kernel supported DRM_VC4 and/or 64-bit Rpi)...

Regards,
Peter

[1] https://forum.qt.io/topic/107764/drm-kms-configuration-for-raspberry-pi-4

Quoted 37 lines

Regards,
Yann E. MORIN.

Quoted 32 lines
package/mesa3d/Config.in +1 -0
+
 config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_VC4
 	bool "Gallium vc4 driver"
 	depends on BR2_arm || BR2_aarch64
package/mesa3d/mesa3d.mk +3 -1
index c7e5be55a0..1a18cf3c58 100644
@@ -84,6 +84,7 @@ MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_RADEONSI) += radeonsi
 MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_SVGA)     += svga
 MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_SWRAST)   += swrast
 MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_TEGRA)    += tegra
+MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_V3D)      += v3d
 MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_VC4)      += vc4
 MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_VIRGL)    += virgl
 # DRI Drivers
@@ -162,6 +163,8 @@ endif
 MESA3D_PLATFORMS = surfaceless
 ifeq ($(BR2_PACKAGE_MESA3D_DRI_DRIVER),y)
 MESA3D_PLATFORMS += drm
+else ifeq ($(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_V3D),y)
+MESA3D_PLATFORMS += drm
 else ifeq ($(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_VC4),y)
 MESA3D_PLATFORMS += drm
 else ifeq ($(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_ETNAVIV),y)
--

2.25.0

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

#7 lore raw

PATCH 1/2 package/mesa3d: add v3d driver support

Peter, All,

On 2020-02-04 23:40 +0100, Peter Seiderer spake thusly:

Quoted 5 lines · Yann E. MORIN
Quoted 3 lines

Slo it means the code you provided is not complete! Why do you not select the requried options?
select BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_KMSRO

Because none of the other drivers does so...

So they too are broken? That is still not good at all.. :-(

Quoted 3 lines
Quoted 1 line

select BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_VC4

Because I do not know if all use-cases need a mesa3d-vc4 driver (my use case definitely ;-) )...

So, if all you could test is that situation, then just catter for it. Users that would be interested for a more fine-grained choice and are able to test it will send further patches.

Quoted 3 lines
Quoted 2 lines

We don't want to let the user resolve the dependencies manually. This is what the config options are for.

All freedom for the empowered users ;-)

But we do not even have a way to know whtehr this is a valid situation or not. We do not want to generate broken configuration when we know that they are broken.

And if it is indeed not needed, then there is no reason to say so in the help text either.

Either something is needed, and we select it via config symbols, and it is not needed to say so in the help text, or they are not needed, and then we don;t need to say so in the help text.

The current situation is very confusing.

[--SNIP--]

Quoted 3 lines
Quoted 1 line

This is definitely not nice at all... :-(

Yes, not all possible buildroot configs lead to an usable system... My reasoning was that the help text hint should be enough...

I disagree.

Could you please send further patches that drop the '(need stuff)' from the help text and replace them with 'select' to the appropriate options, please?

Overall, we also discussed that mesa3d package during the deve-days in Brussels, and we really find that this is a bit of a mess currently... This package has evolved organically over the years, so the current situation is not totally unexpected, but still, it may benefit from a new round of refactoring... (hint, hint)

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#8 lore raw

PATCH 2/2 package/mesa3d: update vc4 help text

In reply to Peter Seiderer
---
 package/mesa3d/Config.in | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
package/mesa3d/Config.in +4 -2
index 1351d1cd97..9389a6132e 100644
@@ -244,8 +244,10 @@ config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_VC4
 	select BR2_PACKAGE_LIBDRM_VC4
 	select BR2_PACKAGE_MESA3D_OPENGL_EGL
 	help
-	  Driver for Broadcom VC4 (rpi2/3) GPUs.
-	  It requires a vanilla 4.5+ kernel with drm vc4 (open) support.
+	  Driver for Broadcom VC4 (rpi2/3/4) GPUs (needs kmsro).
+	  It requires a recent enough mainline/raspberrypi kernel with
+	  drm vc4 (CONFIG_DRM_VC4) support enabled, for rpi4 additional
+	  v3d support is required.
 
 config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_VIRGL
 	bool "Gallium virgl driver"
Signature · 1 line
2.25.0
#9 lore raw

PATCH 2/2 package/mesa3d: update vc4 help text

Peter, All,

On 2020-02-04 15:44 +0100, Peter Seiderer spake thusly:

Quoted 10 lines
---
 package/mesa3d/Config.in | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
package/mesa3d/Config.in +0 -0
index 1351d1cd97..9389a6132e 100644

package/mesa3d/Config.in config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_VC4 · line 250

Quoted 9 lines
package/mesa3d/Config.in +4 -2
@@ -244,8 +244,10 @@ config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_VC4
 	select BR2_PACKAGE_LIBDRM_VC4
 	select BR2_PACKAGE_MESA3D_OPENGL_EGL
 	help
-	  Driver for Broadcom VC4 (rpi2/3) GPUs.
-	  It requires a vanilla 4.5+ kernel with drm vc4 (open) support.
+	  Driver for Broadcom VC4 (rpi2/3/4) GPUs (needs kmsro).
+	  It requires a recent enough mainline/raspberrypi kernel with
+	  drm vc4 (CONFIG_DRM_VC4) support enabled, for rpi4 additional
+	  v3d support is required.

This is all very confusing...

First, you add rpi4 as supported by the vc4 driver, but the v3d driver is also supposed to cover the rpi4. Are both needed? Is the v3d driver a supperset, a subset, a complement to vc4? If so, why doesn't the v3d driver select the vc4 driver (although it selects the vc4 drm backend)? Or is it possible to use just the vc4 driver on rpi4?

Then, you drop the 4.5+ version with this hazy "recent enough" categorisation. For the same reason as I explained in the previous patch, this is not nice.

So, please explain in the commit log what is going on here...

In the meantime, I marked the patch as rejected in patchwork.

Regards,
Yann E. MORIN.

Quoted 9 lines
package/mesa3d/Config.in +0 -0
 config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_VIRGL
 	bool "Gallium virgl driver"
Signature · 6 lines
2.25.0

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#10 lore raw

PATCH 2/2 package/mesa3d: update vc4 help text

Hello Yann,

Quoted 8 lines · Yann E. MORIN

Peter, All,

On 2020-02-04 15:44 +0100, Peter Seiderer spake thusly:

Quoted 5 lines
---
 package/mesa3d/Config.in | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
Quoted 16 lines
Quoted 5 lines
package/mesa3d/Config.in +0 -0
index 1351d1cd97..9389a6132e 100644

package/mesa3d/Config.in config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_VC4 · line 250

Quoted 9 lines
package/mesa3d/Config.in +4 -2
@@ -244,8 +244,10 @@ config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_VC4
 	select BR2_PACKAGE_LIBDRM_VC4
 	select BR2_PACKAGE_MESA3D_OPENGL_EGL
 	help
-	  Driver for Broadcom VC4 (rpi2/3) GPUs.
-	  It requires a vanilla 4.5+ kernel with drm vc4 (open) support.
+	  Driver for Broadcom VC4 (rpi2/3/4) GPUs (needs kmsro).
+	  It requires a recent enough mainline/raspberrypi kernel with
+	  drm vc4 (CONFIG_DRM_VC4) support enabled, for rpi4 additional
+	  v3d support is required.

This is all very confusing...

I wanted to emphasize that no longer a vanilla/mainlain kernel is needed as the official raspberry provided one gained the DRM VC4 support...

Quoted 2 lines

First, you add rpi4 as supported by the vc4 driver, but the v3d driver

Not exactly supported, but needed for the rpi4 case...

Quoted 3 lines

is also supposed to cover the rpi4. Are both needed? Is the v3d driver a supperset, a subset, a complement to vc4? If so, why doesn't the v3d driver select the vc4 driver (although it selects the vc4 drm backend)?

Because no one of the selecting BR2_PACKAGE_MESA3D_GALLIUM_KMSRO drivers selects BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_KMSRO...

Quoted 1 line

Or is it possible to use just the vc4 driver on rpi4?

For the RPi3 the vc4 (and kmsro) is sufficient, for the RPi4 all three (v3d, vc4, kmsro) are needed...

Did not test if mesa3d-v3d compiles without libdrm vc4 (but checked it links the same way against libdrm as mesa3d-vc4)...

Quoted 8 lines

Then, you drop the 4.5+ version with this hazy "recent enough" categorisation. For the same reason as I explained in the previous patch, this is not nice.

So, please explain in the commit log what is going on here...

In the meantime, I marked the patch as rejected in patchwork.

Will try to come up with an better commit log...

Regards,
Peter

Quoted 14 lines

Regards,
Yann E. MORIN.

Quoted 9 lines
package/mesa3d/Config.in +0 -1
 config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_VIRGL
 	bool "Gallium virgl driver"
--

2.25.0

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

#11 lore raw

PATCH 2/2 package/mesa3d: update vc4 help text

Peter, All,

On 2020-02-04 22:55 +0100, Peter Seiderer spake thusly:

Quoted 24 lines · Yann E. MORIN
Quoted 7 lines

On 2020-02-04 15:44 +0100, Peter Seiderer spake thusly:

Quoted 5 lines
---
 package/mesa3d/Config.in | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
Quoted 16 lines
Quoted 5 lines
package/mesa3d/Config.in +0 -0
index 1351d1cd97..9389a6132e 100644

package/mesa3d/Config.in config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_VC4 · line 250

Quoted 9 lines
package/mesa3d/Config.in +4 -2
@@ -244,8 +244,10 @@ config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_VC4
 	select BR2_PACKAGE_LIBDRM_VC4
 	select BR2_PACKAGE_MESA3D_OPENGL_EGL
 	help
-	  Driver for Broadcom VC4 (rpi2/3) GPUs.
-	  It requires a vanilla 4.5+ kernel with drm vc4 (open) support.
+	  Driver for Broadcom VC4 (rpi2/3/4) GPUs (needs kmsro).
+	  It requires a recent enough mainline/raspberrypi kernel with
+	  drm vc4 (CONFIG_DRM_VC4) support enabled, for rpi4 additional
+	  v3d support is required.

This is all very confusing...

Quoted 2 lines

I wanted to emphasize that no longer a vanilla/mainlain kernel is needed as the official raspberry provided one gained the DRM VC4 support...

The problem is not about the mainline vs. fork distinction, but about dropping the exact version for a hazy definition.

Quoted 2 lines
Quoted 1 line

First, you add rpi4 as supported by the vc4 driver, but the v3d driver

Not exactly supported, but needed for the rpi4 case...

See my other reply, this goes along the same lines.

Quoted 5 lines
Quoted 3 lines

is also supposed to cover the rpi4. Are both needed? Is the v3d driver a supperset, a subset, a complement to vc4? If so, why doesn't the v3d driver select the vc4 driver (although it selects the vc4 drm backend)?

Because no one of the selecting BR2_PACKAGE_MESA3D_GALLIUM_KMSRO drivers selects BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_KMSRO...

s I already said:: if you say 'need foo', then you must select foo instead. Otherwise, it means 'foo' is not really needed.

Quoted 3 lines
Quoted 1 line

Or is it possible to use just the vc4 driver on rpi4?

For the RPi3 the vc4 (and kmsro) is sufficient, for the RPi4 all three (v3d, vc4, kmsro) are needed...

Then select everything that is needed.

Quoted 2 lines

Did not test if mesa3d-v3d compiles without libdrm vc4 (but checked it links the same way against libdrm as mesa3d-vc4)...

Note that, as you said, there are two symbols about vc4: the libdrm option (which you correctly select from the mesa3d v3d driver (yes, v3d)), and the mesa3d v4c driver, which you say is needed, but not selected.

Quoted 1 line

Will try to come up with an better commit log...

Thanks.

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'