[PATCH xserver 4/4] glx: Require depth > 12 for GLX visuals

Adam Jackson ajax at redhat.com
Mon Apr 23 20:19:15 UTC 2018


fb is happy to do TrueColor to 8bpp drawables, but mesa is not. Depth 12
is the biggest pseudocolor anyone ever really did, and 15 is the least
truecolor.

Without this Xvfb at depth 8 would "have" GLX, but no vendors
would actually back any of the screens. libGL will attempt to call
GLXQueryServerString to figure out the GLX version, and vnd will throw
an error because there's no vendor to dispatch that to, and then clients
crash.

Signed-off-by: Adam Jackson <ajax at redhat.com>
---
 glx/glxext.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/glx/glxext.c b/glx/glxext.c
index 46ff19236c..99f8661044 100644
--- a/glx/glxext.c
+++ b/glx/glxext.c
@@ -289,8 +289,9 @@ checkScreenVisuals(void)
     for (i = 0; i < screenInfo.numScreens; i++) {
         ScreenPtr screen = screenInfo.screens[i];
         for (j = 0; j < screen->numVisuals; j++) {
-            if (screen->visuals[j].class == TrueColor ||
-                screen->visuals[j].class == DirectColor)
+            if ((screen->visuals[j].class == TrueColor ||
+                 screen->visuals[j].class == DirectColor) &&
+                screen->visuals[j].nplanes > 12)
                 return TRUE;
         }
     }
-- 
2.17.0



More information about the xorg-devel mailing list