diff options
author | Jon TURNEY <jon.turney@dronecode.org.uk> | 2009-11-07 18:44:23 +0000 |
---|---|---|
committer | Jon TURNEY <jon.turney@dronecode.org.uk> | 2010-08-13 15:15:23 +0100 |
commit | aa74cf8a7459cc9305246bc650eef101533e2904 (patch) | |
tree | 7ba832af8b23882df09022ebfd5d184d23ca8aea | |
parent | 6925fa1ea6d434151cf803a84754421f3037dfac (diff) |
Add a DDX specific GLX provider push hook
This is needed to give DDX which are statically linked with extensions
a chance to install DDX specific GLX providers before the GLX extension
is initialized
The the swrast provider is installed just before GLX extension is
initialized. The GLX extension asks providers if they can support a
screen in the reverse of the provider installation order, so installing
a DDX-specific GLX provider earlier than this is not useful, as it will
always lose out to swrast. Installing the provider later than this is
not useful as the provider for each screen has already been selected
during GLX extension initialization.
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
-rw-r--r-- | hw/xwin/InitOutput.c | 1 | ||||
-rw-r--r-- | include/ddxhooks.h | 1 | ||||
-rw-r--r-- | mi/miinitext.c | 11 |
3 files changed, 12 insertions, 1 deletions
diff --git a/hw/xwin/InitOutput.c b/hw/xwin/InitOutput.c index a86e452e1..7b4c835ed 100644 --- a/hw/xwin/InitOutput.c +++ b/hw/xwin/InitOutput.c @@ -216,6 +216,7 @@ ddxMain(void) { /* Initialize DDX-specific hooks */ ddxHooks.ddxBeforeReset = ddxBeforeReset; + ddxHooks.ddxPushProviders = ddxPushProviders; } /* See Porting Layer Definition - p. 57 */ diff --git a/include/ddxhooks.h b/include/ddxhooks.h index 40c87fa70..c67f9e05b 100644 --- a/include/ddxhooks.h +++ b/include/ddxhooks.h @@ -27,6 +27,7 @@ struct _DdxHooks { void (*ddxBeforeReset)(void); + void (*ddxPushProviders)(void); }; typedef struct _DdxHooks DdxHooks; diff --git a/mi/miinitext.c b/mi/miinitext.c index a7441c9a8..20e18687f 100644 --- a/mi/miinitext.c +++ b/mi/miinitext.c @@ -93,6 +93,7 @@ SOFTWARE. #include "extension.h" #include "micmap.h" #include "globals.h" +#include "ddxhooks.h" extern Bool noTestExtensions; @@ -469,7 +470,15 @@ InitExtensions(int argc, char *argv[]) #ifdef GLXEXT if (serverGeneration == 1) - GlxPushProvider(&__glXDRISWRastProvider); + { + GlxPushProvider(&__glXDRISWRastProvider); + + if (ddxHooks.ddxPushProviders) + { + /* a chance for DDX to install providers better than swrast... */ + ddxHooks.ddxPushProviders(); + } + } if (!noGlxExtension) GlxExtensionInit(); #endif } |