summaryrefslogtreecommitdiff
path: root/GL/glx/glxscreens.c
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@sasori.boston.redhat.com>2008-02-04 13:13:35 -0500
committerKristian Høgsberg <krh@redhat.com>2008-02-14 19:53:49 -0500
commit879515b1399f87a47010532af70f34b9b09e2a9b (patch)
tree85ca2b9b7fb73e248b2c43dc22e9b7d7ab2dfad8 /GL/glx/glxscreens.c
parentb71dc54352bc56a889823040ec19c1d8e118a1f3 (diff)
Add GLX provider for DRI2.
Diffstat (limited to 'GL/glx/glxscreens.c')
-rw-r--r--GL/glx/glxscreens.c26
1 files changed, 26 insertions, 0 deletions
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);