[PATCH] glx: Fix fbconfigs with no corresponding visual
Adam Jackson
ajax at redhat.com
Mon Apr 11 08:29:48 PDT 2011
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.
Signed-off-by: Adam Jackson <ajax at redhat.com>
---
glx/glxscreens.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/glx/glxscreens.c b/glx/glxscreens.c
index 496cf9e..1969aa3 100644
--- a/glx/glxscreens.c
+++ b/glx/glxscreens.c
@@ -395,8 +395,13 @@ void __glXScreenInit(__GLXscreen *pGlxScreen, ScreenPtr pScreen)
if (depth == pScreen->visuals[i].nplanes)
break;
}
- if (i == pScreen->numVisuals)
+ /* If it can't, fix up the fbconfig to not advertise window support
+ * XXX should really do this when creating the fbconfig
+ */
+ if (i == pScreen->numVisuals) {
+ config->drawableType &= ~(GLX_WINDOW_BIT);
continue;
+ }
/* Create a new X visual for our FBconfig. */
visual = AddScreenVisuals(pScreen, 1, depth);
--
1.7.4.1
More information about the xorg-devel
mailing list