[Mesa-dev] [PATCH] DRI2: Don't disable GLX_INTEL_swap_event unconditionally
Brian Paul
brianp at vmware.com
Fri Feb 15 08:23:26 PST 2013
On 02/14/2013 09:39 PM, Zack Rusin wrote:
> GLX_INTEL_swap_event is broken on the server side, where it's
> currently unconditionally enabled. This completely breaks
> systems running on drivers which don't support that extension.
> There's no way to test for its presence on this side, so instead
> of disabling it uncondtionally, just disable it for drivers
> which are known to not support it. It makes sense because
> most drivers do support it right now.
> We'll be able to remove this once Xserver properly advertises
> GLX_INTEL_swap_event.
>
> Note: This is a candidate for the 9.0 branch.
>
> Signed-off-by: Zack Rusin<zackr at vmware.com>
> ---
> src/glx/dri2_glx.c | 15 ++++++++++++---
> 1 file changed, 12 insertions(+), 3 deletions(-)
>
> diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c
> index 46a92fd..05808d4 100644
> --- a/src/glx/dri2_glx.c
> +++ b/src/glx/dri2_glx.c
> @@ -1051,7 +1051,8 @@ static const struct glx_context_vtable dri2_context_vtable = {
> };
>
> static void
> -dri2BindExtensions(struct dri2_screen *psc, const __DRIextension **extensions)
> +dri2BindExtensions(struct dri2_screen *psc, const __DRIextension **extensions,
> + const char *driverName)
> {
> int i;
>
> @@ -1060,7 +1061,15 @@ dri2BindExtensions(struct dri2_screen *psc, const __DRIextension **extensions)
> __glXEnableDirectExtension(&psc->base, "GLX_MESA_swap_control");
> __glXEnableDirectExtension(&psc->base, "GLX_SGI_make_current_read");
>
> - if (psc->dri2->base.version>= 4) {
> + /*
> + * GLX_INTEL_swap_event is broken on the server side, where it's
> + * currently unconditionally enabled. This completely breaks
> + * systems running on drivers which don't support that extension.
> + * There's no way to test for its presence on this side, so instead
> + * of disabling it uncondtionally, just disable it for drivers
> + * which are known to not support it.
> + */
> + if (strcmp(driverName, "vmwgfx") != 0) {
> __glXEnableDirectExtension(&psc->base, "GLX_INTEL_swap_event");
> }
Should we also test for the swrast driver?
Otherwise, looks good.
Reviewed-by: Brian Paul <brianp at vmware.com>
>
> @@ -1204,7 +1213,7 @@ dri2CreateScreen(int screen, struct glx_display * priv)
> }
>
> extensions = psc->core->getExtensions(psc->driScreen);
> - dri2BindExtensions(psc, extensions);
> + dri2BindExtensions(psc, extensions, driverName);
>
> configs = driConvertConfigs(psc->core, psc->base.configs, driver_configs);
> visuals = driConvertConfigs(psc->core, psc->base.visuals, driver_configs);
More information about the mesa-dev
mailing list