summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2011-04-12 15:30:25 -0400
committerJon TURNEY <jon.turney@dronecode.org.uk>2011-06-29 18:22:18 +0100
commit3e8270b869ebf788778d5d56107f6d47c7c050d0 (patch)
tree69441c6682e855e84d8ff20ab80ff72b03e1da37
parent9d568450b1319e9057319ebb37e76003bcba447d (diff)
glx: Fix fbconfigs with no corresponding visual
There are, in general, more fbconfig depths than visual depths. fbconfigs need not support Window rendering, however any that do must have an associated visual ID (which we got right), and any that do not must not claim GLX_WINDOW_BIT in GLX_DRAWABLE_TYPE (which we got wrong). Fixes piglit/glx-fbconfig-sanity, assuming you have a sufficiently recent piglit, as that test formerly wrongly required pixmap-capable fbconfigs to have a visual. v2: Additional check for fbconfigs that didn't have GLX_WINDOW_BIT in the first place, from previous patch by Jon TURNEY; also, also clear ->visualID. Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk> Signed-off-by: Adam Jackson <ajax@redhat.com>
-rw-r--r--glx/glxscreens.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/glx/glxscreens.c b/glx/glxscreens.c
index 496cf9e14..c4ad42648 100644
--- a/glx/glxscreens.c
+++ b/glx/glxscreens.c
@@ -395,8 +395,15 @@ void __glXScreenInit(__GLXscreen *pGlxScreen, ScreenPtr pScreen)
if (depth == pScreen->visuals[i].nplanes)
break;
}
+ /* if it can't, fix up the fbconfig to not advertise window support */
if (i == pScreen->numVisuals)
+ config->drawableType &= ~(GLX_WINDOW_BIT);
+
+ /* fbconfig must support window drawables */
+ if (!(config->drawableType & GLX_WINDOW_BIT)) {
+ config->visualID = 0;
continue;
+ }
/* Create a new X visual for our FBconfig. */
visual = AddScreenVisuals(pScreen, 1, depth);