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 <ajax@redhat.com>
This commit is contained in:
Adam Jackson 2018-04-23 16:19:15 -04:00
parent 818885e619
commit 79a7137557
1 changed files with 3 additions and 2 deletions

View File

@ -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;
}
}