Skip to contentSkip to conversation

package/mesa3d: radeonSI: specify drm platform

PATCH New Romain Naour 2 participants 7 messages Apr 28, 2018 – May 1, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/4 package/mesa3d: radeonSI: specify drm platform

When BR2_PACKAGE_MESA3D_OPENGL_EGL is selected with RadeonSI drvier, mesa platform must be specified with drm.

Fixes:
hecking for RADEON... yes
checking for AMDGPU... yes
configure: error: radeonsi requires one of these:
1) --with-platforms=drm (X, Wayland, offscreen rendering based on DRM)
2) --with-platforms=surfaceless (offscreen only)
3) --with-platforms=android (Android only)
Recommended options: drm,x11

---
 package/mesa3d/mesa3d.mk | 2 ++
 1 file changed, 2 insertions(+)
package/mesa3d/mesa3d.mk +2 -0
index 9857b597cf..7534bc0833 100644
@@ -167,6 +167,8 @@ else ifeq ($(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_ETNAVIV),y)
 MESA3D_PLATFORMS = drm
 else ifeq ($(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_VIRGL),y)
 MESA3D_PLATFORMS = drm
+else ifeq ($(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_RADEONSI),y)
+MESA3D_PLATFORMS = drm
 endif
 ifeq ($(BR2_PACKAGE_WAYLAND),y)
 MESA3D_DEPENDENCIES += wayland wayland-protocols
Signature · 1 line
2.14.3
#1 lore raw

PATCH 2/4 package/mesa3d: RadeonSI needs libdrm-radeon and libdrm-amdgpu

Fixes:
checking for EXPAT... yes
checking for RADEON... no
configure: error: Package requirements (libdrm >= 2.4.71 libdrm_radeon >= 2.4.71)

Cc Micha? Kalbarczyk <[email protected]>
---
 package/mesa3d/Config.in | 1 +
 1 file changed, 1 insertion(+)
package/mesa3d/Config.in +1 -0
index 1984e4f11c..32337a36a4 100644
@@ -122,6 +122,7 @@ config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_RADEONSI
 			BR2_TOOLCHAIN_USES_GLIBC)) # elfutils
 	select BR2_PACKAGE_MESA3D_GALLIUM_DRIVER
 	select BR2_PACKAGE_LIBDRM_AMDGPU
+	select BR2_PACKAGE_LIBDRM_RADEON
 	select BR2_PACKAGE_LLVM_AMDGPU if BR2_PACKAGE_MESA3D_LLVM
 	select BR2_PACKAGE_ELFUTILS if BR2_PACKAGE_MESA3D_LLVM
 	select BR2_PACKAGE_MESA3D_NEEDS_XA
Signature · 1 line
2.14.3
#2 lore raw

PATCH 2/4 package/mesa3d: RadeonSI needs libdrm-radeon and libdrm-amdgpu

Hello,

Quoted 16 lines · Romain Naour

Fixes:
checking for EXPAT... yes
checking for RADEON... no
configure: error: Package requirements (libdrm >= 2.4.71 libdrm_radeon >= 2.4.71)

Cc Micha? Kalbarczyk <[email protected]>
---
 package/mesa3d/Config.in | 1 +
 1 file changed, 1 insertion(+)
package/mesa3d/Config.in +0 -0
index 1984e4f11c..32337a36a4 100644

package/mesa3d/Config.in config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_RADEONSI · line 125

Quoted 4 lines
package/mesa3d/Config.in +1 -0
@@ -122,6 +122,7 @@ config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_RADEONSI
 			BR2_TOOLCHAIN_USES_GLIBC)) # elfutils
 	select BR2_PACKAGE_MESA3D_GALLIUM_DRIVER
 	select BR2_PACKAGE_LIBDRM_AMDGPU
+	select BR2_PACKAGE_LIBDRM_RADEON

So it needs both libdrm_radeon and libdrm_amdgpu ?

Thomas

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

PATCH 2/4 package/mesa3d: RadeonSI needs libdrm-radeon and libdrm-amdgpu

Hi Thomas,

Le 28/04/2018 ? 22:04, Thomas Petazzoni a ?crit?:

Quoted 14 lines

Hello,

Quoted 11 lines · Romain Naour

Fixes:
checking for EXPAT... yes
checking for RADEON... no
configure: error: Package requirements (libdrm >= 2.4.71 libdrm_radeon >= 2.4.71)

Cc Micha? Kalbarczyk <[email protected]>
---
 package/mesa3d/Config.in | 1 +
 1 file changed, 1 insertion(+)
Quoted 11 lines

package/mesa3d/Config.in config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_RADEONSI · line 125

Quoted 9 lines
package/mesa3d/Config.in +1 -0
index 1984e4f11c..32337a36a4 100644
@@ -122,6 +122,7 @@ config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_RADEONSI
 			BR2_TOOLCHAIN_USES_GLIBC)) # elfutils
 	select BR2_PACKAGE_MESA3D_GALLIUM_DRIVER
 	select BR2_PACKAGE_LIBDRM_AMDGPU
+	select BR2_PACKAGE_LIBDRM_RADEON

So it needs both libdrm_radeon and libdrm_amdgpu ?

Indeed, see [1]

xradeonsi)
HAVE_GALLIUM_RADEONSI=yes
PKG_CHECK_MODULES([RADEON], [libdrm >= $LIBDRM_RADEON_REQUIRED libdrm_radeon

Quoted 1 line

= $LIBDRM_RADEON_REQUIRED])

PKG_CHECK_MODULES([AMDGPU], [libdrm >= $LIBDRM_AMDGPU_REQUIRED libdrm_amdgpu

Quoted 1 line

= $LIBDRM_AMDGPU_REQUIRED])

require_libdrm "radeonsi"
radeon_llvm_check $LLVM_REQUIRED_RADEONSI "radeonsi" if test "x$enable_egl" = xyes; then require_basic_egl "radeonsi"
fi
;;

[1] https://github.com/mesa3d/mesa/blob/master/configure.ac#L2618

Best regards,
Romain

Quoted 3 lines

Thomas

#4 lore raw

PATCH 3/4 package/mesa3d: RadeonSI needs llvm support

In reply to Romain Naour

Fixes:
checking for AMDGPU... yes
configure: error: --enable-llvm is required when building radeonsi

Cc Micha? Kalbarczyk <[email protected]>
---
 package/mesa3d/Config.in | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)
package/mesa3d/Config.in +6 -7
index 32337a36a4..d620c0ab52 100644
@@ -117,21 +117,20 @@ comment "R600 driver needs a uClibc or glibc toolchain when llvm is enabled"
 config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_RADEONSI
 	bool "Gallium Radeon SI driver"
 	depends on BR2_i386 || BR2_x86_64
-	depends on !BR2_PACKAGE_MESA3D_LLVM || \
-		(BR2_PACKAGE_MESA3D_LLVM && (BR2_TOOLCHAIN_USES_UCLIBC || \
-			BR2_TOOLCHAIN_USES_GLIBC)) # elfutils
+	depends on BR2_PACKAGE_MESA3D_LLVM
+	depends on BR2_TOOLCHAIN_USES_UCLIBC || BR2_TOOLCHAIN_USES_GLIBC # elfutils
 	select BR2_PACKAGE_MESA3D_GALLIUM_DRIVER
 	select BR2_PACKAGE_LIBDRM_AMDGPU
 	select BR2_PACKAGE_LIBDRM_RADEON
-	select BR2_PACKAGE_LLVM_AMDGPU if BR2_PACKAGE_MESA3D_LLVM
-	select BR2_PACKAGE_ELFUTILS if BR2_PACKAGE_MESA3D_LLVM
+	select BR2_PACKAGE_LLVM_AMDGPU
+	select BR2_PACKAGE_ELFUTILS
 	select BR2_PACKAGE_MESA3D_NEEDS_XA
 	help
 	  Driver for ATI/AMD Radeon HD7000/HD8000/Rx200 GPUs.
 
-# Radeon SI needs libelf when Mesa3D is built with LLVM support
+# Radeon SI needs libelf
 # musl is not currently compatible with elfutils
-comment "Radeon SI driver needs a uClibc or glibc toolchain when llvm is enabled"
+comment "Radeon SI driver needs a uClibc or glibc toolchain"
 	depends on BR2_PACKAGE_MESA3D_LLVM
 	depends on !(BR2_TOOLCHAIN_USES_UCLIBC || BR2_TOOLCHAIN_USES_GLIBC)
 
Signature · 1 line
2.14.3
#5 lore raw

PATCH 4/4 package/mesa3d: add missing elfutils dependency with R600 and RadeonSI driver

In reply to Romain Naour

Commit "add dependency on elfutils for R600 with LLVM" [1] select elfutils package at Kconfig level without adding it the make dependency.

Enabling r600 support lead to a build issue when building from scratch with "make mesa3d".

Fixes:
checking for RADEON... yes
configure: error: r600 requires libelf when using llvm

elfutils dependency is needed by r600 with llvm support and radeonSI.

Fixes:
checking for RADEON... yes
checking for AMDGPU... yes
configure: error: radeonsi requires libelf when using llvm

Add a new BR2_PACKAGE_MESA3D_NEEDS_ELFUTILS hidden Config.in boolean selected by R600 and RadeonSI at Kconfig level.
When selected, BR2_PACKAGE_MESA3D_NEEDS_ELFUTILS add elfutils dependency at make level.

[1] 92fda8761aa8024be53a8edb8c102d1ba6401bce

Cc Micha? Kalbarczyk <[email protected]>

---
v2: Add BR2_PACKAGE_MESA3D_NEEDS_ELFUTILS option

---
 package/mesa3d/Config.in | 6 ++++++
 package/mesa3d/mesa3d.mk | 4 ++++
 2 files changed, 10 insertions(+)
package/mesa3d/Config.in +6 -0
index d620c0ab52..8c1877fbc1 100644
@@ -25,6 +25,10 @@ menuconfig BR2_PACKAGE_MESA3D
 
 if BR2_PACKAGE_MESA3D
 
+# Some Gallium driver needs libelf when built with LLVM support
+config BR2_PACKAGE_MESA3D_NEEDS_ELFUTILS
+	bool
+
 config BR2_PACKAGE_MESA3D_LLVM
 	bool "llvm support"
 	depends on BR2_PACKAGE_LLVM_ARCH_SUPPORTS
@@ -104,6 +108,7 @@ config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_R600
 	select BR2_PACKAGE_LIBDRM_RADEON
 	select BR2_PACKAGE_LLVM_AMDGPU if BR2_PACKAGE_MESA3D_LLVM
 	select BR2_PACKAGE_ELFUTILS if BR2_PACKAGE_MESA3D_LLVM
+	select BR2_PACKAGE_MESA3D_NEEDS_ELFUTILS if BR2_PACKAGE_MESA3D_LLVM
 	select BR2_PACKAGE_MESA3D_NEEDS_XA
 	help
 	  Driver for ATI/AMD Radeon R600/R700/HD5000/HD6000 GPUs.
@@ -124,6 +129,7 @@ config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_RADEONSI
 	select BR2_PACKAGE_LIBDRM_RADEON
 	select BR2_PACKAGE_LLVM_AMDGPU
 	select BR2_PACKAGE_ELFUTILS
+	select BR2_PACKAGE_MESA3D_NEEDS_ELFUTILS
 	select BR2_PACKAGE_MESA3D_NEEDS_XA
 	help
 	  Driver for ATI/AMD Radeon HD7000/HD8000/Rx200 GPUs.
package/mesa3d/mesa3d.mk +4 -0
index 7534bc0833..ea26a7a4b2 100644
@@ -43,6 +43,10 @@ else
 MESA3D_CONF_OPTS += --disable-llvm
 endif
 
+ifeq ($(BR2_PACKAGE_MESA3D_NEEDS_ELFUTILS),y)
+MESA3D_DEPENDENCIES += elfutils
+endif
+
 # The Sourcery MIPS toolchain has a special (non-upstream) feature to
 # have "compact exception handling", which unfortunately breaks with
 # mesa3d, so we disable it here by passing -mno-compact-eh.
Signature · 1 line
2.14.3
#6 lore raw

PATCH 1/4 package/mesa3d: radeonSI: specify drm platform

In reply to Romain Naour

Hello,

Quoted 12 lines · Romain Naour

When BR2_PACKAGE_MESA3D_OPENGL_EGL is selected with RadeonSI drvier, mesa platform must be specified with drm.

Fixes:
hecking for RADEON... yes
checking for AMDGPU... yes
configure: error: radeonsi requires one of these:
1) --with-platforms=drm (X, Wayland, offscreen rendering based on DRM)
2) --with-platforms=surfaceless (offscreen only)
3) --with-platforms=android (Android only)
Recommended options: drm,x11

Quoted 4 lines
---
 package/mesa3d/mesa3d.mk | 2 ++
 1 file changed, 2 insertions(+)

Entire series applied. Thanks!

Thomas

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