[PATCH 3/5] Do not create visuals for fbConfigs which don't support window drawables.

Jon TURNEY jon.turney at dronecode.org.uk
Wed Apr 7 09:18:18 PDT 2010


It is implicit that visuals are suitable for use with a window.

Glean (for e.g.) assumes all visuals support window drawables.

glXChooseVisual() documentation also appears to perhaps mean that we should only create
visuals for fbConfigs which have drawableType containing GLX_PIXMAP_BIT if GLX_BUFFER_SIZE
is one of the Pixmap depths supported by the X server.

Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
---
 glx/glxscreens.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/glx/glxscreens.c b/glx/glxscreens.c
index 58d8ee0..6eef9fc 100644
--- a/glx/glxscreens.c
+++ b/glx/glxscreens.c
@@ -450,6 +450,10 @@ void __glXScreenInit(__GLXscreen *pGlxScreen, ScreenPtr pScreen)
 	if (i == pScreen->numVisuals)
 	    continue;
 
+        /* Make sure the FBconfig supports window drawables */
+        if (!(config->drawableType & GLX_WINDOW_BIT))
+          continue;
+
 	/* Create a new X visual for our FBconfig. */
 	visual = AddScreenVisuals(pScreen, 1, depth);
 	if (visual == NULL)
-- 
1.7.0.4



More information about the xorg-devel mailing list