diff options
author | Jakob Bornecrantz <jakob@vmware.com> | 2009-07-04 07:43:01 +0200 |
---|---|---|
committer | Jakob Bornecrantz <jakob@vmware.com> | 2009-07-04 07:43:01 +0200 |
commit | 28471cfa970702128d822c2ecbb1703eedbca245 (patch) | |
tree | fa91f0d366ba857e228946ac88966e1717dc879f /src/glx | |
parent | 9982821cdaf2205443c6297368eaab4115bf92f6 (diff) | |
parent | 71633abafc935c25da9731bab48c228ceb9b4097 (diff) |
Merge branch 'mesa_7_5_branch'
Diffstat (limited to 'src/glx')
-rw-r--r-- | src/glx/x11/dri_glx.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/glx/x11/dri_glx.c b/src/glx/x11/dri_glx.c index 3ce410d9be..ac2eb05341 100644 --- a/src/glx/x11/dri_glx.c +++ b/src/glx/x11/dri_glx.c @@ -305,6 +305,7 @@ CallCreateNewScreen(Display *dpy, int scrn, __GLXscreenConfigs *psc, drm_handle_t hFB; int junk; const __DRIconfig **driver_configs; + __GLcontextModes *visual; /* DRI protocol version. */ dri_version.major = driDpy->driMajor; @@ -417,6 +418,28 @@ CallCreateNewScreen(Display *dpy, int scrn, __GLXscreenConfigs *psc, psc->configs = driConvertConfigs(psc->core, psc->configs, driver_configs); psc->visuals = driConvertConfigs(psc->core, psc->visuals, driver_configs); + /* Visuals with depth != screen depth are subject to automatic compositing + * in the X server, so DRI1 can't render to them properly. Mark them as + * non-conformant to prevent apps from picking them up accidentally. + */ + for (visual = psc->visuals; visual; visual = visual->next) { + XVisualInfo template; + XVisualInfo *visuals; + int num_visuals; + long mask; + + template.visualid = visual->visualID; + mask = VisualIDMask; + visuals = XGetVisualInfo(dpy, mask, &template, &num_visuals); + + if (visuals) { + if (num_visuals > 0 && visuals->depth != DefaultDepth(dpy, scrn)) + visual->visualRating = GLX_NON_CONFORMANT_CONFIG; + + XFree(visuals); + } + } + return psp; handle_error: |