diff options
author | Daniel Stone <daniel@fooishbar.org> | 2012-11-19 15:00:22 +1100 |
---|---|---|
committer | Daniel Stone <daniel@fooishbar.org> | 2012-11-21 11:13:55 +1100 |
commit | 353b14ea77324b3f7b3ea29d6f03618fd9916d5f (patch) | |
tree | 9b35d632ee5cf6a27bf32a1f4552944012cff957 | |
parent | 3556d43010f0a37bf30aa2e0ceee9a8bbcad311d (diff) |
DMX: Add DMX and GLX extensions
Unfortunately this also got lost in the extmod fallout, leaving the DMX
server not exposing the DMX or GLX extensions.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r-- | hw/dmx/dmx.h | 2 | ||||
-rw-r--r-- | hw/dmx/dmxinit.c | 22 | ||||
-rw-r--r-- | include/extinit.h | 4 |
3 files changed, 23 insertions, 5 deletions
diff --git a/hw/dmx/dmx.h b/hw/dmx/dmx.h index d7c620467..f0cb04459 100644 --- a/hw/dmx/dmx.h +++ b/hw/dmx/dmx.h @@ -407,4 +407,6 @@ extern DevPrivateKeyRec dmxGlyphSetPrivateKeyRec; #define dmxGlyphSetPrivateKey (&dmxGlyphSetPrivateKeyRec) /**< Private index for GlyphSets */ +void DMXExtensionInit(void); + #endif /* DMX_H */ diff --git a/hw/dmx/dmxinit.c b/hw/dmx/dmxinit.c index 5804353fb..7a50aebc3 100644 --- a/hw/dmx/dmxinit.c +++ b/hw/dmx/dmxinit.c @@ -68,10 +68,13 @@ #include <GL/glx.h> #include <GL/glxint.h> #include "dmx_glxvisuals.h" +#include "glx_extinit.h" #include <X11/extensions/Xext.h> #include <X11/extensions/extutil.h> #endif /* GLXEXT */ +#include <X11/extensions/dmxproto.h> + /* Global variables available to all Xserver/hw/dmx routines. */ int dmxNumScreens; DMXScreenInfo *dmxScreens; @@ -586,6 +589,20 @@ dmxExecHost(void) return buffer; } +static void dmxAddExtensions(Bool glxSupported) +{ + const ExtensionModule dmxExtensions[] = { + { DMXExtensionInit, DMX_EXTENSION_NAME, NULL }, +#ifdef GLXEXT + { GlxExtensionInit, "GLX", &glxSupported }, +#endif + }; + int i; + + for (i = 0; i < ARRAY_SIZE(dmxExtensions); i++) + LoadExtension(&dmxExtensions[i], TRUE); +} + /** This routine is called in Xserver/dix/main.c from \a main(). */ void InitOutput(ScreenInfo * pScreenInfo, int argc, char *argv[]) @@ -594,7 +611,7 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char *argv[]) static unsigned long dmxGeneration = 0; #ifdef GLXEXT - Bool glxSupported = TRUE; + static Bool glxSupported = TRUE; #endif if (dmxGeneration != serverGeneration) { @@ -725,6 +742,9 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char *argv[]) glxSupported &= (dmxScreens[i].glxMajorOpcode > 0); #endif + if (serverGeneration == 1) + dmxAddExtensions(glxSupported); + /* Tell dix layer about the backend displays */ for (i = 0; i < dmxNumScreens; i++) { diff --git a/include/extinit.h b/include/extinit.h index 7f4718f2f..5690d7b01 100644 --- a/include/extinit.h +++ b/include/extinit.h @@ -68,10 +68,6 @@ extern _X_EXPORT Bool noDbeExtension; extern void DbeExtensionInit(void); #endif -#ifdef DMXEXT -extern void DMXExtensionInit(void); -#endif - #if defined(DPMSExtension) #include <X11/extensions/dpmsconst.h> extern _X_EXPORT Bool noDPMSExtension; |