[PATCH 3/3] Restore GLX extension to XWin

Jon TURNEY jon.turney at dronecode.org.uk
Mon Aug 6 06:44:57 PDT 2012


On 12/07/2012 13:30, Jon TURNEY wrote:
> - Add an XwinExtensionInit(), similar in spirit to QuartzExtensionInit()
> and xf86ExtensionInit()
> - Load the GLX extension (I'm guessing XQuartz needs this adding somewhere
> as well)
> - Also, since we now have an proper place to install the native GL provider
> where it will take priority over the the swrast provider, do so
> ---
>  hw/xwin/InitOutput.c |   23 ++++++++++++++++++++---
>  1 files changed, 20 insertions(+), 3 deletions(-)
> 
> diff --git a/hw/xwin/InitOutput.c b/hw/xwin/InitOutput.c
> index 4d0df11..538b2e1 100644
> --- a/hw/xwin/InitOutput.c
> +++ b/hw/xwin/InitOutput.c
> @@ -147,15 +147,30 @@ winClipboardShutdown(void)
>  }
>  #endif
>  
> -void
> -ddxPushProviders(void)
> +static const ExtensionModule xwinExtensions[] = {
> +#ifdef GLXEXT
> +  { GlxExtensionInit, "GLX", &noGlxExtension },
> +#endif
> +};
> +
> +/*
> + * XwinExtensionInit
> + * Initialises Xwin-specific extensions.
> + */
> +static
> +void XwinExtensionInit(void)
>  {
> +    int i;
> +
>  #ifdef XWIN_GLX_WINDOWS
> -    if (g_fNativeGl) {
> +    if ((g_fNativeGl) && (serverGeneration == 1)) {
>          /* install the native GL provider */
>          glxWinPushNativeProvider();
>      }
>  #endif
> +
> +    for (i = 0; i < ARRAY_SIZE(xwinExtensions); i++)
> +        LoadExtension(&xwinExtensions[i], TRUE);
>  }

Actually, it seems this is not quite right, as this use of LoadExtension()
adds GLX onto to the end of the list of extensions on every server
regeneration, leading to hilarious consequences after the first regeneration :-)

So, it seems all the users of LoadExtension() should have an idempotency
guard, and glxSetup() and AddStaticExtensions() do, but I can't find one for
xf86ExtensionInit(), QuartzExtensionInit() or XwinExtensionInit().



More information about the xorg-devel mailing list