From bcbf95b1bafa6ffe724768b9309295e2fdb4b860 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Thu, 12 Jul 2012 00:36:10 +0100 Subject: [PATCH 1/3] Revert bogus GlxPushProvider() in commit a1d41e3 a1d41e3 "Move extension initialisation prototypes into extinit.h" also includes a change to GlxExtensionInit to install the swrast GLX provider. Since b86aa74 "GLX: Insert swrast provider from GlxExtensionInit" already does this (correctly, by installing the swrast provider at the end of the chain, rather than at the beginning), and since this would seem to have the effect of making the swrast provider the most preferred provider, I'm guessing this wasn't intended. Signed-off-by: Jon TURNEY Reviewed-by: Daniel Stone Reviewed-by: Colin Harrison --- glx/glxext.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/glx/glxext.c b/glx/glxext.c index a1f9d42e9..70f0df892 100644 --- a/glx/glxext.c +++ b/glx/glxext.c @@ -339,9 +339,6 @@ GlxExtensionInit(void) if (!__glXContextRes || !__glXDrawableRes) return; - if (serverGeneration == 1) - GlxPushProvider(&__glXDRISWRastProvider); - if (!dixRegisterPrivateKey (&glxClientPrivateKeyRec, PRIVATE_CLIENT, sizeof(__GLXclientState))) return; From 06ac7937fc37cdf073b77386bed47e14cff23628 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Thu, 12 Jul 2012 12:37:05 +0100 Subject: [PATCH 2/3] Restore extern to the declaration of __glXDRISWRastProvider b86aa74 dropped the 'extern' from the declaration of __glXDRISWRastProvider This turns out to be important to me, as without it, the final link only gets the tentative definition of __glXDRISWRastProvider implied by the declaration, and not the proper one from glxdriswrast.c, presumably because nothing else references anything in the object that file generates. Signed-off-by: Jon TURNEY Reviewed-by: Daniel Stone Reviewed-by: Colin Harrison --- glx/glxserver.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glx/glxserver.h b/glx/glxserver.h index d9b106b82..1021aec80 100644 --- a/glx/glxserver.h +++ b/glx/glxserver.h @@ -97,7 +97,7 @@ struct __GLXprovider { const char *name; __GLXprovider *next; }; -__GLXprovider __glXDRISWRastProvider; +extern __GLXprovider __glXDRISWRastProvider; void GlxPushProvider(__GLXprovider * provider); From 2b74949ad02bd916c3ac502db3f28057f12a8117 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Thu, 12 Jul 2012 00:36:43 +0100 Subject: [PATCH 3/3] Restore GLX extension to XWin - 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 a proper place to install the native GL provider where it will take priority over the the swrast provider, do so Signed-off-by: Jon TURNEY Reviewed-by: Daniel Stone Reviewed-by: Colin Harrison --- hw/xwin/InitOutput.c | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/hw/xwin/InitOutput.c b/hw/xwin/InitOutput.c index 4d0df110f..538b2e101 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); } #if defined(DDXBEFORERESET) @@ -885,6 +900,8 @@ InitOutput(ScreenInfo * screenInfo, int argc, char *argv[]) { int i; + XwinExtensionInit(); + /* Log the command line */ winLogCommandLine(argc, argv);