[Mesa-dev] [PATCH] DRI2: don't advertise GLX_INTEL_swap_event if it can't
Rob Clark
robdclark at gmail.com
Tue Mar 12 16:45:26 PDT 2013
If ddx does not support swap, don't advertise it. We might also be
able to get rid of the vmwgfx check (I'm not quite sure the purpose of
that check vs. just checking dri2Minor.
Signed-off-by: Rob Clark <robdclark at gmail.com>
---
src/glx/dri2_glx.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c
index c4f6996..b2d712c 100644
--- a/src/glx/dri2_glx.c
+++ b/src/glx/dri2_glx.c
@@ -1051,11 +1051,16 @@ static const struct glx_context_vtable dri2_context_vtable = {
};
static void
-dri2BindExtensions(struct dri2_screen *psc, const __DRIextension **extensions,
+dri2BindExtensions(struct dri2_screen *psc, struct glx_display * priv,
const char *driverName)
{
+ const struct dri2_display *const pdp = (struct dri2_display *)
+ priv->dri2Display;
+ const __DRIextension **extensions;
int i;
+ extensions = psc->core->getExtensions(psc->driScreen);
+
__glXEnableDirectExtension(&psc->base, "GLX_SGI_video_sync");
__glXEnableDirectExtension(&psc->base, "GLX_SGI_swap_control");
__glXEnableDirectExtension(&psc->base, "GLX_MESA_swap_control");
@@ -1069,7 +1074,7 @@ dri2BindExtensions(struct dri2_screen *psc, const __DRIextension **extensions,
* of disabling it uncondtionally, just disable it for drivers
* which are known to not support it.
*/
- if (strcmp(driverName, "vmwgfx") != 0) {
+ if (pdp->swapAvailable && strcmp(driverName, "vmwgfx") != 0) {
__glXEnableDirectExtension(&psc->base, "GLX_INTEL_swap_event");
}
@@ -1212,8 +1217,7 @@ dri2CreateScreen(int screen, struct glx_display * priv)
goto handle_error;
}
- extensions = psc->core->getExtensions(psc->driScreen);
- dri2BindExtensions(psc, extensions, driverName);
+ dri2BindExtensions(psc, priv, driverName);
configs = driConvertConfigs(psc->core, psc->base.configs, driver_configs);
visuals = driConvertConfigs(psc->core, psc->base.visuals, driver_configs);
--
1.8.1.4
More information about the mesa-dev
mailing list