From 79a7137557d33d4e92713ae8cabe838c44fea488 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Mon, 23 Apr 2018 16:19:15 -0400 Subject: [PATCH] glx: Require depth > 12 for GLX visuals 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 --- glx/glxext.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/glx/glxext.c b/glx/glxext.c index 46ff19236..99f866104 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; } }