1 [PATCH xserver 05/12] glxproxy: Fix __glXActiveScreens allocation
3 Apparently this has been broken for about ten years, eesh. We were never
4 allocating any storage for this array, so the first attempt at using GLX
5 with Xdmx would crash the server.
7 Promote it to an array and use __glXNumActiveScreens to detect whether
8 GLX is actually enabled.
10 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34851
11 Signed-off-by: Adam Jackson <ajax at redhat.com>
13 hw/dmx/glxProxy/glxscreens.c | 2 +-
14 hw/dmx/glxProxy/glxserver.h | 2 +-
15 hw/dmx/glxProxy/glxvisuals.c | 4 ++--
16 3 files changed, 4 insertions(+), 4 deletions(-)
18 diff --git a/hw/dmx/glxProxy/glxscreens.c b/hw/dmx/glxProxy/glxscreens.c
19 index 508e67ed4..8c5f08beb 100644
20 --- a/hw/dmx/glxProxy/glxscreens.c
21 +++ b/hw/dmx/glxProxy/glxscreens.c
23 #include "panoramiXsrv.h"
26 -__GLXscreenInfo *__glXActiveScreens;
27 +__GLXscreenInfo __glXActiveScreens[MAXSCREENS];
28 GLint __glXNumActiveScreens;
30 __GLXFBConfig **__glXFBConfigs;
31 diff --git a/hw/dmx/glxProxy/glxserver.h b/hw/dmx/glxProxy/glxserver.h
32 index 7aa5ad2f2..f708f86ee 100644
33 --- a/hw/dmx/glxProxy/glxserver.h
34 +++ b/hw/dmx/glxProxy/glxserver.h
35 @@ -73,7 +73,7 @@ typedef struct __GLXcontextRec *GLXContext;
37 typedef struct __GLXclientStateRec __GLXclientState;
39 -extern __GLXscreenInfo *__glXActiveScreens;
40 +extern __GLXscreenInfo __glXActiveScreens[MAXSCREENS];
41 extern GLint __glXNumActiveScreens;
43 /************************************************************************/
44 diff --git a/hw/dmx/glxProxy/glxvisuals.c b/hw/dmx/glxProxy/glxvisuals.c
45 index 3fca04f0d..9bde29afd 100644
46 --- a/hw/dmx/glxProxy/glxvisuals.c
47 +++ b/hw/dmx/glxProxy/glxvisuals.c
48 @@ -105,7 +105,7 @@ glxMatchVisualInConfigList(ScreenPtr pScreen, VisualPtr pVisual,
51 /* check that the glx extension has been initialized */
52 - if (!__glXActiveScreens)
53 + if (!__glXNumActiveScreens)
56 pGlxScreen = &__glXActiveScreens[pScreen->myNum];
57 @@ -135,7 +135,7 @@ glxMatchVisual(ScreenPtr pScreen, VisualPtr pVisual, ScreenPtr pMatchScreen)
60 /* check that the glx extension has been initialized */
61 - if (!__glXActiveScreens)
62 + if (!__glXNumActiveScreens)
65 pGlxScreen2 = &__glXActiveScreens[pMatchScreen->myNum];