[Buildroot] [git commit] package/mesa3d: always enable glx-direct if glx is enabled

Arnout Vandecappelle (Essensium/Mind) arnout at mind.be
Sun Jan 9 15:46:20 UTC 2022


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.

Reported-by: Howard Mitchell <hm at hmbedded.co.uk>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout at mind.be>
---
 package/mesa3d/mesa3d.mk | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/package/mesa3d/mesa3d.mk b/package/mesa3d/mesa3d.mk
index 28ff0669e0..cd3a33a38e 100644
--- a/package/mesa3d/mesa3d.mk
+++ b/package/mesa3d/mesa3d.mk
@@ -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
 



More information about the buildroot mailing list