From db83830eef38a86a471378121213162da180537d Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Mon, 19 Nov 2012 15:28:07 +1100 Subject: [PATCH 1/5] Constify argument to LoadExtension Since we never modify it. Signed-off-by: Daniel Stone Reviewed-by: Peter Hutterer --- include/extension.h | 2 +- mi/miinitext.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/extension.h b/include/extension.h index 0f55d9038..acc6addb7 100644 --- a/include/extension.h +++ b/include/extension.h @@ -97,6 +97,6 @@ extern _X_EXPORT void InitExtensions(int argc, char **argv); 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 */ diff --git a/mi/miinitext.c b/mi/miinitext.c index d17544097..369da5ede 100644 --- a/mi/miinitext.c +++ b/mi/miinitext.c @@ -365,7 +365,7 @@ NewExtensionModule(void) } void -LoadExtension(ExtensionModule * e, Bool builtin) +LoadExtension(const ExtensionModule * e, Bool builtin) { ExtensionModule *newext; From 3556d43010f0a37bf30aa2e0ceee9a8bbcad311d Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Mon, 19 Nov 2012 15:29:34 +1100 Subject: [PATCH 2/5] Constify extensions in LoadExtension users Signed-off-by: Daniel Stone Reviewed-by: Peter Hutterer --- hw/xfree86/common/xf86Extensions.c | 2 +- hw/xfree86/dixmods/glxmodule.c | 2 +- hw/xquartz/quartz.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/xfree86/common/xf86Extensions.c b/hw/xfree86/common/xf86Extensions.c index d5309d558..f9e791607 100644 --- a/hw/xfree86/common/xf86Extensions.c +++ b/hw/xfree86/common/xf86Extensions.c @@ -53,7 +53,7 @@ /* * DDX-specific extensions. */ -static ExtensionModule extensionModules[] = { +static const ExtensionModule extensionModules[] = { #ifdef XF86VIDMODE { XFree86VidModeExtensionInit, diff --git a/hw/xfree86/dixmods/glxmodule.c b/hw/xfree86/dixmods/glxmodule.c index c0c611401..e6bb73673 100644 --- a/hw/xfree86/dixmods/glxmodule.c +++ b/hw/xfree86/dixmods/glxmodule.c @@ -47,7 +47,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. static MODULESETUPPROTO(glxSetup); -static ExtensionModule GLXExt = { +static const ExtensionModule GLXExt = { GlxExtensionInit, "GLX", &noGlxExtension diff --git a/hw/xquartz/quartz.c b/hw/xquartz/quartz.c index 31b0e619a..5b977c7f9 100644 --- a/hw/xquartz/quartz.c +++ b/hw/xquartz/quartz.c @@ -145,7 +145,7 @@ QuartzSetupScreen(int index, return TRUE; } -static ExtensionModule quartzExtensions[] = { +static const ExtensionModule quartzExtensions[] = { /* PseudoramiX needs to be done before RandR, so * it is in miinitext.c until it can be reordered. * { PseudoramiXExtensionInit, "PseudoramiX", &noPseudoramiXExtension }, From 353b14ea77324b3f7b3ea29d6f03618fd9916d5f Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Mon, 19 Nov 2012 15:00:22 +1100 Subject: [PATCH 3/5] 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 Reviewed-by: Peter Hutterer --- hw/dmx/dmx.h | 2 ++ hw/dmx/dmxinit.c | 22 +++++++++++++++++++++- 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 #include #include "dmx_glxvisuals.h" +#include "glx_extinit.h" #include #include #endif /* GLXEXT */ +#include + /* 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 extern _X_EXPORT Bool noDPMSExtension; From ac1a60e7b6f06fd075cc5bf55d6bc67206a01d29 Mon Sep 17 00:00:00 2001 From: Raphael Kubo da Costa Date: Fri, 16 Nov 2012 19:51:58 +0200 Subject: [PATCH 4/5] vfb: Initialize the GLX extension again. This should fix a regression in the 1.13.0 release: commit 5f5bbbe543f65c48ecbb5cce80116a86ca3fbe86 removed a code path used by Xvfb and made it use the default one when initializing extensions. However, this meant the GLX extension was not initialized anymore since it is not part of the `staticExtensions' array. Since it is not possible to just add it to that array after commit aad428b8e21c77397c623b78706eb64b1fea77c9, adopt an approach similar to xwin's and xquartz's and initialize the extension from vfb's `InitOutput'. Signed-off-by: Raphael Kubo da Costa Reviewed-by: Daniel Stone --- hw/vfb/InitOutput.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/hw/vfb/InitOutput.c b/hw/vfb/InitOutput.c index 07ea8ea93..97eccfd4e 100644 --- a/hw/vfb/InitOutput.c +++ b/hw/vfb/InitOutput.c @@ -65,6 +65,7 @@ from The Open Group. #endif /* HAS_SHM */ #include "dix.h" #include "miline.h" +#include "glx_extinit.h" #define VFB_DEFAULT_WIDTH 1280 #define VFB_DEFAULT_HEIGHT 1024 @@ -884,12 +885,30 @@ vfbScreenInit(ScreenPtr pScreen, int argc, char **argv) } /* 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 InitOutput(ScreenInfo * screenInfo, int argc, char **argv) { int i; int NumFormats = 0; + if (serverGeneration == 1) + vfbExtensionInit(); + /* initialize pixmap formats */ /* must have a pixmap depth to match every screen depth */ From cf05db8ddec948d907915e1c9569d743e8771def Mon Sep 17 00:00:00 2001 From: Sjoerd Simons Date: Tue, 30 Oct 2012 17:02:58 +0100 Subject: [PATCH 5/5] Ephyr: Find the right host screen when embedded When Xephyr is embedded into another application (e.g. in xoo), the input events may come from the parent Window instead of our own. So make sure we find the host screen in that case as well instead of crashing. Signed-off-by: Sjoerd Simons Reviewed-by: Daniel Stone --- hw/kdrive/ephyr/hostx.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/kdrive/ephyr/hostx.c b/hw/kdrive/ephyr/hostx.c index 02729d6f6..157ac36b2 100644 --- a/hw/kdrive/ephyr/hostx.c +++ b/hw/kdrive/ephyr/hostx.c @@ -881,7 +881,9 @@ host_screen_from_window(Window w) struct EphyrHostScreen *result = NULL; 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]; goto out; }