From 879515b1399f87a47010532af70f34b9b09e2a9b Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Mon, 4 Feb 2008 13:13:35 -0500 Subject: Add GLX provider for DRI2. --- GL/glx/glxscreens.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'GL/glx/glxscreens.c') diff --git a/GL/glx/glxscreens.c b/GL/glx/glxscreens.c index 88773a785..6575b271d 100644 --- a/GL/glx/glxscreens.c +++ b/GL/glx/glxscreens.c @@ -280,6 +280,30 @@ void GlxSetVisualConfigs(int nconfigs, * call it. */ } +static void +filterOutNativeConfigs(__GLXscreen *pGlxScreen) +{ + __GLcontextModes *m, *next, *native_modes, **last; + ScreenPtr pScreen = pGlxScreen->pScreen; + int i, depth; + + last = &pGlxScreen->fbconfigs; + for (m = pGlxScreen->fbconfigs; m != NULL; m = next) { + next = m->next; + depth = m->redBits + m->blueBits + m->greenBits; + + for (i = 0; i < pScreen->numVisuals; i++) { + if (pScreen->visuals[i].nplanes == depth) { + *last = m; + last = &m->next; + break; + } + } + } + + *last = NULL; +} + static XID findVisualForConfig(ScreenPtr pScreen, __GLcontextModes *m) { @@ -513,6 +537,8 @@ void __glXScreenInit(__GLXscreen *pGlxScreen, ScreenPtr pScreen) pGlxScreen->CloseScreen = pScreen->CloseScreen; pScreen->CloseScreen = glxCloseScreen; + filterOutNativeConfigs(pGlxScreen); + i = 0; for (m = pGlxScreen->fbconfigs; m != NULL; m = m->next) { m->fbconfigID = FakeClientID(0); -- cgit v1.2.3