[PATCH 3/6] Add a DDX specific GLX provider push hook

Jon TURNEY jon.turney at dronecode.org.uk
Mon Jan 17 06:20:38 PST 2011


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 at dronecode.org.uk>
---
 hw/xwin/InitOutput.c |    3 ++-
 include/dixmain.h    |    1 +
 mi/miinitext.c       |   11 ++++++++++-
 3 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/hw/xwin/InitOutput.c b/hw/xwin/InitOutput.c
index 7c8a9e6..a8ce86e 100644
--- a/hw/xwin/InitOutput.c
+++ b/hw/xwin/InitOutput.c
@@ -160,7 +160,7 @@ winClipboardShutdown (void)
 }
 #endif
 
-void
+static void
 ddxPushProviders(void)
 {
 #ifdef XWIN_GLX_WINDOWS
@@ -191,6 +191,7 @@ int main(int argc, char *argv[], char *envp[])
 {
   /* Initialize DDX-specific hooks */
   ddxHooks.ddxBeforeReset = ddxBeforeReset;
+  ddxHooks.ddxPushProviders = ddxPushProviders;
 
   return dix_main(argc, argv, envp);
 }
diff --git a/include/dixmain.h b/include/dixmain.h
index ab03756..20f5919 100644
--- a/include/dixmain.h
+++ b/include/dixmain.h
@@ -29,6 +29,7 @@ int dix_main(int argc, char *argv[], char *envp[]);
 struct _DdxHooks
 {
   void (*ddxBeforeReset)(void);
+  void (*ddxPushProviders)(void);
 };
 
 typedef struct _DdxHooks DdxHooks;
diff --git a/mi/miinitext.c b/mi/miinitext.c
index a7441c9..04bae64 100644
--- a/mi/miinitext.c
+++ b/mi/miinitext.c
@@ -93,6 +93,7 @@ SOFTWARE.
 #include "extension.h"
 #include "micmap.h"
 #include "globals.h"
+#include "dixmain.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
 }
-- 
1.7.3.3



More information about the xorg-devel mailing list