Merge remote-tracking branch 'daniels/master'

This commit is contained in:
Keith Packard 2012-11-27 15:14:26 -08:00
commit d50a94568e
10 changed files with 50 additions and 11 deletions

View File

@ -407,4 +407,6 @@ extern DevPrivateKeyRec dmxGlyphSetPrivateKeyRec;
#define dmxGlyphSetPrivateKey (&dmxGlyphSetPrivateKeyRec) /**< Private index for GlyphSets */ #define dmxGlyphSetPrivateKey (&dmxGlyphSetPrivateKeyRec) /**< Private index for GlyphSets */
void DMXExtensionInit(void);
#endif /* DMX_H */ #endif /* DMX_H */

View File

@ -68,10 +68,13 @@
#include <GL/glx.h> #include <GL/glx.h>
#include <GL/glxint.h> #include <GL/glxint.h>
#include "dmx_glxvisuals.h" #include "dmx_glxvisuals.h"
#include "glx_extinit.h"
#include <X11/extensions/Xext.h> #include <X11/extensions/Xext.h>
#include <X11/extensions/extutil.h> #include <X11/extensions/extutil.h>
#endif /* GLXEXT */ #endif /* GLXEXT */
#include <X11/extensions/dmxproto.h>
/* Global variables available to all Xserver/hw/dmx routines. */ /* Global variables available to all Xserver/hw/dmx routines. */
int dmxNumScreens; int dmxNumScreens;
DMXScreenInfo *dmxScreens; DMXScreenInfo *dmxScreens;
@ -586,6 +589,20 @@ dmxExecHost(void)
return buffer; 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(). */ /** This routine is called in Xserver/dix/main.c from \a main(). */
void void
InitOutput(ScreenInfo * pScreenInfo, int argc, char *argv[]) InitOutput(ScreenInfo * pScreenInfo, int argc, char *argv[])
@ -594,7 +611,7 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char *argv[])
static unsigned long dmxGeneration = 0; static unsigned long dmxGeneration = 0;
#ifdef GLXEXT #ifdef GLXEXT
Bool glxSupported = TRUE; static Bool glxSupported = TRUE;
#endif #endif
if (dmxGeneration != serverGeneration) { if (dmxGeneration != serverGeneration) {
@ -725,6 +742,9 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char *argv[])
glxSupported &= (dmxScreens[i].glxMajorOpcode > 0); glxSupported &= (dmxScreens[i].glxMajorOpcode > 0);
#endif #endif
if (serverGeneration == 1)
dmxAddExtensions(glxSupported);
/* Tell dix layer about the backend displays */ /* Tell dix layer about the backend displays */
for (i = 0; i < dmxNumScreens; i++) { for (i = 0; i < dmxNumScreens; i++) {

View File

@ -881,7 +881,9 @@ host_screen_from_window(Window w)
struct EphyrHostScreen *result = NULL; struct EphyrHostScreen *result = NULL;
for (index = 0; index < HostX.n_screens; index++) { for (index = 0; index < HostX.n_screens; index++) {
if (HostX.screens[index].win == w || HostX.screens[index].peer_win == w) { if (HostX.screens[index].win == w
|| HostX.screens[index].peer_win == w
|| HostX.screens[index].win_pre_existing == w) {
result = &HostX.screens[index]; result = &HostX.screens[index];
goto out; goto out;
} }

View File

@ -65,6 +65,7 @@ from The Open Group.
#endif /* HAS_SHM */ #endif /* HAS_SHM */
#include "dix.h" #include "dix.h"
#include "miline.h" #include "miline.h"
#include "glx_extinit.h"
#define VFB_DEFAULT_WIDTH 1280 #define VFB_DEFAULT_WIDTH 1280
#define VFB_DEFAULT_HEIGHT 1024 #define VFB_DEFAULT_HEIGHT 1024
@ -884,12 +885,30 @@ vfbScreenInit(ScreenPtr pScreen, int argc, char **argv)
} /* end vfbScreenInit */ } /* end vfbScreenInit */
static const ExtensionModule vfbExtensions[] = {
#ifdef GLXEXT
{ GlxExtensionInit, "GLX", &noGlxExtension },
#endif
};
static
void vfbExtensionInit(void)
{
int i;
for (i = 0; i < ARRAY_SIZE(vfbExtensions); i++)
LoadExtension(&vfbExtensions[i], TRUE);
}
void void
InitOutput(ScreenInfo * screenInfo, int argc, char **argv) InitOutput(ScreenInfo * screenInfo, int argc, char **argv)
{ {
int i; int i;
int NumFormats = 0; int NumFormats = 0;
if (serverGeneration == 1)
vfbExtensionInit();
/* initialize pixmap formats */ /* initialize pixmap formats */
/* must have a pixmap depth to match every screen depth */ /* must have a pixmap depth to match every screen depth */

View File

@ -53,7 +53,7 @@
/* /*
* DDX-specific extensions. * DDX-specific extensions.
*/ */
static ExtensionModule extensionModules[] = { static const ExtensionModule extensionModules[] = {
#ifdef XF86VIDMODE #ifdef XF86VIDMODE
{ {
XFree86VidModeExtensionInit, XFree86VidModeExtensionInit,

View File

@ -47,7 +47,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
static MODULESETUPPROTO(glxSetup); static MODULESETUPPROTO(glxSetup);
static ExtensionModule GLXExt = { static const ExtensionModule GLXExt = {
GlxExtensionInit, GlxExtensionInit,
"GLX", "GLX",
&noGlxExtension &noGlxExtension

View File

@ -145,7 +145,7 @@ QuartzSetupScreen(int index,
return TRUE; return TRUE;
} }
static ExtensionModule quartzExtensions[] = { static const ExtensionModule quartzExtensions[] = {
/* PseudoramiX needs to be done before RandR, so /* PseudoramiX needs to be done before RandR, so
* it is in miinitext.c until it can be reordered. * it is in miinitext.c until it can be reordered.
* { PseudoramiXExtensionInit, "PseudoramiX", &noPseudoramiXExtension }, * { PseudoramiXExtensionInit, "PseudoramiX", &noPseudoramiXExtension },

View File

@ -97,6 +97,6 @@ extern _X_EXPORT void InitExtensions(int argc, char **argv);
extern _X_EXPORT void CloseDownExtensions(void); extern _X_EXPORT void CloseDownExtensions(void);
extern _X_EXPORT void LoadExtension(ExtensionModule *ext, Bool external); extern _X_EXPORT void LoadExtension(const ExtensionModule *ext, Bool external);
#endif /* EXTENSION_H */ #endif /* EXTENSION_H */

View File

@ -68,10 +68,6 @@ extern _X_EXPORT Bool noDbeExtension;
extern void DbeExtensionInit(void); extern void DbeExtensionInit(void);
#endif #endif
#ifdef DMXEXT
extern void DMXExtensionInit(void);
#endif
#if defined(DPMSExtension) #if defined(DPMSExtension)
#include <X11/extensions/dpmsconst.h> #include <X11/extensions/dpmsconst.h>
extern _X_EXPORT Bool noDPMSExtension; extern _X_EXPORT Bool noDPMSExtension;

View File

@ -365,7 +365,7 @@ NewExtensionModule(void)
} }
void void
LoadExtension(ExtensionModule * e, Bool builtin) LoadExtension(const ExtensionModule * e, Bool builtin)
{ {
ExtensionModule *newext; ExtensionModule *newext;