Skip to contentSkip to conversation

package/mesa3d: Fix dri checks

PATCH New Bernd Kuhls 3 participants 3 messages Sep 26, 2015 – Oct 13, 2015

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 package/mesa3d: Fix dri checks

"MESA3D_EGL_PLATFORMS = drm" is only needed when dri drivers are enabled:
http://cgit.freedesktop.org/mesa/mesa/tree/configure.ac?h=10.6#n1653

Unconditionally enable dri support, also for gallium drivers, quoting
http://cgit.freedesktop.org/mesa/mesa/tree/configure.ac?h=10.6#n1382

# Strictly speaking libgbm does not require --enable-dri, although

 # both of its backends do. Thus one can build libgbm without any
 # backends if --disable-dri is set.
 # To avoid unnecessary complexity of checking if at least one backend
 # is available when building, just mandate --enable-dri.
   AC_MSG_ERROR([gbm requires --enable-dri])

Fixes
http://autobuild.buildroot.net/results/799/799f505594f668154af38cb2c2a1ed8a90337e9f/
http://autobuild.buildroot.net/results/d00/d00fe349e8710a1ad557507cf04b006216806868/
http://autobuild.buildroot.net/results/c7b/c7ba08c8cf54b2e7cf28c5e3454e92a408e724db/
http://autobuild.buildroot.net/results/cd7/cd717c9a3a1b0080192e7e765d990cce55513005/

---
v2: Shortened too long lines in commit message (Vicente)

 package/mesa3d/mesa3d.mk | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
package/mesa3d/mesa3d.mk +4 -3
index 0244523..c5f4c82 100644
@@ -88,7 +88,7 @@ endef
 
 ifeq ($(BR2_PACKAGE_MESA3D_DRI_DRIVER),)
 MESA3D_CONF_OPTS += \
-	--without-dri-drivers --disable-dri --disable-dri3
+	--without-dri-drivers --disable-dri3
 MESA3D_POST_INSTALL_STAGING_HOOKS += MESA3D_REMOVE_OPENGL_PC
 else
 ifeq ($(BR2_PACKAGE_XPROTO_DRI3PROTO),y)
@@ -102,7 +102,6 @@ MESA3D_DEPENDENCIES += xlib_libXxf86vm
 endif
 MESA3D_PROVIDES += libgl
 MESA3D_CONF_OPTS += \
-	--enable-dri \
 	--enable-shared-glapi \
 	--enable-driglx-direct \
 	--with-dri-drivers=$(subst $(space),$(comma),$(MESA3D_DRI_DRIVERS-y))
@@ -114,7 +113,7 @@ endif
 #   - it is needed for GLES (mesa3d's ./configure is a bit weird)
 #   - but if no DRI driver is enabled, then libgl is not built,
 #     remove dri.pc and gl.pc in this case (MESA3D_REMOVE_OPENGL_PC)
-MESA3D_CONF_OPTS += --enable-opengl
+MESA3D_CONF_OPTS += --enable-opengl --enable-dri
 
 # libva and mesa3d have a circular dependency
 # we do not need libva support in mesa3d, therefore disable this option
@@ -122,7 +121,9 @@ MESA3D_CONF_OPTS += --disable-va
 
 ifeq ($(BR2_PACKAGE_MESA3D_OPENGL_EGL),y)
 MESA3D_PROVIDES += libegl
+ifeq ($(BR2_PACKAGE_MESA3D_DRI_DRIVER),y)
 MESA3D_EGL_PLATFORMS = drm
+endif
 ifeq ($(BR2_PACKAGE_WAYLAND),y)
 MESA3D_DEPENDENCIES += wayland
 MESA3D_EGL_PLATFORMS += wayland
Signature · 1 line
2.5.3
#1 lore raw

PATCH v2 1/1 package/mesa3d: Fix dri checks

Hello Bernd,

Quoted 58 lines · Bernd Kuhls

"MESA3D_EGL_PLATFORMS = drm" is only needed when dri drivers are enabled:
http://cgit.freedesktop.org/mesa/mesa/tree/configure.ac?h=10.6#n1653

Unconditionally enable dri support, also for gallium drivers, quoting
http://cgit.freedesktop.org/mesa/mesa/tree/configure.ac?h=10.6#n1382

# Strictly speaking libgbm does not require --enable-dri, although

 # both of its backends do. Thus one can build libgbm without any
 # backends if --disable-dri is set.
 # To avoid unnecessary complexity of checking if at least one backend
 # is available when building, just mandate --enable-dri.
   AC_MSG_ERROR([gbm requires --enable-dri])

Fixes
http://autobuild.buildroot.net/results/799/799f505594f668154af38cb2c2a1ed8a90337e9f/
http://autobuild.buildroot.net/results/d00/d00fe349e8710a1ad557507cf04b006216806868/
http://autobuild.buildroot.net/results/c7b/c7ba08c8cf54b2e7cf28c5e3454e92a408e724db/
http://autobuild.buildroot.net/results/cd7/cd717c9a3a1b0080192e7e765d990cce55513005/

---
v2: Shortened too long lines in commit message (Vicente)

 package/mesa3d/mesa3d.mk | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
package/mesa3d/mesa3d.mk +2 -3
index 0244523..c5f4c82 100644
@@ -88,7 +88,7 @@ endef
 
 ifeq ($(BR2_PACKAGE_MESA3D_DRI_DRIVER),)
 MESA3D_CONF_OPTS += \
-	--without-dri-drivers --disable-dri --disable-dri3
+	--without-dri-drivers --disable-dri3
 MESA3D_POST_INSTALL_STAGING_HOOKS += MESA3D_REMOVE_OPENGL_PC
 else
 ifeq ($(BR2_PACKAGE_XPROTO_DRI3PROTO),y)
@@ -102,7 +102,6 @@ MESA3D_DEPENDENCIES += xlib_libXxf86vm
 endif
 MESA3D_PROVIDES += libgl
 MESA3D_CONF_OPTS += \
-	--enable-dri \
 	--enable-shared-glapi \
 	--enable-driglx-direct \
 	--with-dri-drivers=$(subst $(space),$(comma),$(MESA3D_DRI_DRIVERS-y))
@@ -114,7 +113,7 @@ endif
 #   - it is needed for GLES (mesa3d's ./configure is a bit weird)
 #   - but if no DRI driver is enabled, then libgl is not built,
 #     remove dri.pc and gl.pc in this case (MESA3D_REMOVE_OPENGL_PC)
-MESA3D_CONF_OPTS += --enable-opengl
+MESA3D_CONF_OPTS += --enable-opengl --enable-dri
 
 # libva and mesa3d have a circular dependency
 # we do not need libva support in mesa3d, therefore disable this option

package/mesa3d/mesa3d.mk MESA3D_CONF_OPTS += --disable-va · line 129

Quoted 9 lines
package/mesa3d/mesa3d.mk +2 -0
@@ -122,7 +121,9 @@ MESA3D_CONF_OPTS += --disable-va
 
 ifeq ($(BR2_PACKAGE_MESA3D_OPENGL_EGL),y)
 MESA3D_PROVIDES += libegl
+ifeq ($(BR2_PACKAGE_MESA3D_DRI_DRIVER),y)
 MESA3D_EGL_PLATFORMS = drm
+endif
 ifeq ($(BR2_PACKAGE_WAYLAND),y)
 MESA3D_DEPENDENCIES += wayland
 MESA3D_EGL_PLATFORMS += wayland

Fixes compile failure from http://autobuild.buildroot.net/results/f06/f068a90d89a3ef820c9e43cc30dee2b9d6476d8e/

Regards,
Peter

#2 lore raw

PATCH v2 1/1 package/mesa3d: Fix dri checks

In reply to Bernd Kuhls

Dear Bernd Kuhls,

Quoted 20 lines · Bernd Kuhls

"MESA3D_EGL_PLATFORMS = drm" is only needed when dri drivers are enabled:
http://cgit.freedesktop.org/mesa/mesa/tree/configure.ac?h=10.6#n1653

Unconditionally enable dri support, also for gallium drivers, quoting
http://cgit.freedesktop.org/mesa/mesa/tree/configure.ac?h=10.6#n1382

# Strictly speaking libgbm does not require --enable-dri, although

 # both of its backends do. Thus one can build libgbm without any
 # backends if --disable-dri is set.
 # To avoid unnecessary complexity of checking if at least one backend
 # is available when building, just mandate --enable-dri.
   AC_MSG_ERROR([gbm requires --enable-dri])

Fixes
http://autobuild.buildroot.net/results/799/799f505594f668154af38cb2c2a1ed8a90337e9f/
http://autobuild.buildroot.net/results/d00/d00fe349e8710a1ad557507cf04b006216806868/
http://autobuild.buildroot.net/results/c7b/c7ba08c8cf54b2e7cf28c5e3454e92a408e724db/
http://autobuild.buildroot.net/results/cd7/cd717c9a3a1b0080192e7e765d990cce55513005/

Quoted 3 lines

---
v2: Shortened too long lines in commit message (Vicente)

I've applied your patch. However, I really would like to see more comments/explanations in mesa3d.mk to explain what's going on, because it's really tricky to understand all the possible combinations.

Also, could you address the comment made by Paul Cercueil on your patch? He said:

"""
From what I can read from the link you pasted, your assumption is wrong. the DRM backend of EGL can be enabled without any DRI drivers.

Besides, there is actually a usecase for using the DRM backend of EGL without DRI drivers: when your target platform has a DRM driver (instead of fbdev) and does not use X11.
"""

Please send a follow-up patch to address this if applicable.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com