Skip to contentSkip to conversation

package/mesa3d: always enable glx-direct if glx is enabled

Buildroot Arnout Vandecappelle (Essensium/Mind) 1 participant 1 message Jan 9, 2022

lore
Share & tools
lore
#0 lore raw

commit: https://git.buildroot.net/buildroot/commit/?id=6a51177af14a2ddaa6431bb7fc618fe138b59b72
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/master

Many applications that use GLX want to combine it with DRI3 to bypass the X server and send GL commands directly to the graphics driver. This is only available in mesa3d if glx-direct=true.

Up to now, we only enabled glx-direct when a DRI driver was enabled. Historically, this is either because only DRI drivers had DRI3, or because we didn't know better at the time. However, glx-direct is not related to DRI drivers at all. Setting it for a DRI driver when there is no GLX is effectively a NOP. Conversely, we also want to set it for Gallium drivers when GLX is enabled, otherwise GLX-direct applications don't work.

Note that glx-direct is only functional if glx=dri. If glx=xlib or glx=gallium-xlib, GLX always goes through the X server so direct is not possible (as far as we understand).

Set glx-direct=true unconditionally when GLX is selected. Remove it from DRI drivers.

---
 package/mesa3d/mesa3d.mk | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
package/mesa3d/mesa3d.mk +4 -2
index 28ff0669e0..cd3a33a38e 100644
@@ -73,7 +73,10 @@ ifeq ($(BR2_PACKAGE_MESA3D_OPENGL_GLX),y)
 #  dri          : dri based GLX requires at least one DRI driver || dri based GLX requires shared-glapi
 #  xlib         : xlib conflicts with any dri driver
 #  gallium-xlib : Gallium-xlib based GLX requires at least one gallium driver || Gallium-xlib based GLX requires softpipe or llvmpipe || gallium-xlib conflicts with any dri driver.
-MESA3D_CONF_OPTS += -Dglx=dri
+# Always enable glx-direct; without it, amy GLX applications don't work.
+MESA3D_CONF_OPTS += \
+	-Dglx=dri \
+	-Dglx-direct=true
 ifeq ($(BR2_PACKAGE_MESA3D_NEEDS_XA),y)
 MESA3D_CONF_OPTS += -Dgallium-xa=enabled
 else
@@ -136,7 +139,6 @@ MESA3D_CONF_OPTS += \
 else
 MESA3D_CONF_OPTS += \
 	-Dshared-glapi=enabled \
-	-Dglx-direct=true \
 	-Ddri-drivers=$(subst $(space),$(comma),$(MESA3D_DRI_DRIVERS-y))
 endif
 

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot