[packages/xorg-xserver-Xdmx: 2/2] - applied fix from https://lists.x.org/archives/xorg-devel/2017-June/053919.html

qboosh qboosh at pld-linux.org
Wed Nov 3 22:01:42 CET 2021


commit 4d53a4989264527b854becf239ebae11a3518b96
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Wed Nov 3 21:58:35 2021 +0100

    - applied fix from https://lists.x.org/archives/xorg-devel/2017-June/053919.html

 xorg-xserver-Xdmx-fix.patch | 67 +++++++++++++++++++++++++++++++++++++++++++++
 xorg-xserver-Xdmx.spec      |  2 ++
 2 files changed, 69 insertions(+)
---
diff --git a/xorg-xserver-Xdmx.spec b/xorg-xserver-Xdmx.spec
index 616bb5c..7740c3a 100644
--- a/xorg-xserver-Xdmx.spec
+++ b/xorg-xserver-Xdmx.spec
@@ -32,6 +32,7 @@ Source0:	https://xorg.freedesktop.org/releases/individual/xserver/xorg-server-%{
 # Source0-md5:	9acb2a51507e6056b09e3d3f19565419
 Patch0:		xorg-xserver-server-builtin-SHA1.patch
 Patch1:		110_nvidia_slowdow_fix.patch
+Patch2:		%{name}-fix.patch
 URL:		https://xorg.freedesktop.org/
 BuildRequires:	Mesa-dri-devel >= 7.8.1
 %{?with_dri2:BuildRequires:	Mesa-dri-devel >= 9.2.0}
@@ -134,6 +135,7 @@ Xdmx - rozproszony, wielomonitorowy serwer X.
 %setup -q -n xorg-server-%{version}
 %patch0 -p1
 %patch1 -p1
+%patch2 -p1
 
 # xserver uses pixman-1 API/ABI so put that explictly here
 sed -i -e 's#<pixman\.h#<pixman-1/pixman.h#g' ./fb/fb.h ./include/miscstruct.h ./render/picture.h
diff --git a/xorg-xserver-Xdmx-fix.patch b/xorg-xserver-Xdmx-fix.patch
new file mode 100644
index 0000000..1390b5f
--- /dev/null
+++ b/xorg-xserver-Xdmx-fix.patch
@@ -0,0 +1,67 @@
+[PATCH xserver 05/12] glxproxy: Fix __glXActiveScreens allocation
+
+Apparently this has been broken for about ten years, eesh. We were never
+allocating any storage for this array, so the first attempt at using GLX
+with Xdmx would crash the server.
+
+Promote it to an array and use __glXNumActiveScreens to detect whether
+GLX is actually enabled.
+
+Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34851
+Signed-off-by: Adam Jackson <ajax at redhat.com>
+---
+ hw/dmx/glxProxy/glxscreens.c | 2 +-
+ hw/dmx/glxProxy/glxserver.h  | 2 +-
+ hw/dmx/glxProxy/glxvisuals.c | 4 ++--
+ 3 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/hw/dmx/glxProxy/glxscreens.c b/hw/dmx/glxProxy/glxscreens.c
+index 508e67ed4..8c5f08beb 100644
+--- a/hw/dmx/glxProxy/glxscreens.c
++++ b/hw/dmx/glxProxy/glxscreens.c
+@@ -45,7 +45,7 @@
+ #include "panoramiXsrv.h"
+ #endif
+ 
+-__GLXscreenInfo *__glXActiveScreens;
++__GLXscreenInfo __glXActiveScreens[MAXSCREENS];
+ GLint __glXNumActiveScreens;
+ 
+ __GLXFBConfig **__glXFBConfigs;
+diff --git a/hw/dmx/glxProxy/glxserver.h b/hw/dmx/glxProxy/glxserver.h
+index 7aa5ad2f2..f708f86ee 100644
+--- a/hw/dmx/glxProxy/glxserver.h
++++ b/hw/dmx/glxProxy/glxserver.h
+@@ -73,7 +73,7 @@ typedef struct __GLXcontextRec *GLXContext;
+ */
+ typedef struct __GLXclientStateRec __GLXclientState;
+ 
+-extern __GLXscreenInfo *__glXActiveScreens;
++extern __GLXscreenInfo __glXActiveScreens[MAXSCREENS];
+ extern GLint __glXNumActiveScreens;
+ 
+ /************************************************************************/
+diff --git a/hw/dmx/glxProxy/glxvisuals.c b/hw/dmx/glxProxy/glxvisuals.c
+index 3fca04f0d..9bde29afd 100644
+--- a/hw/dmx/glxProxy/glxvisuals.c
++++ b/hw/dmx/glxProxy/glxvisuals.c
+@@ -105,7 +105,7 @@ glxMatchVisualInConfigList(ScreenPtr pScreen, VisualPtr pVisual,
+     int i;
+ 
+     /* check that the glx extension has been initialized */
+-    if (!__glXActiveScreens)
++    if (!__glXNumActiveScreens)
+         return 0;
+ 
+     pGlxScreen = &__glXActiveScreens[pScreen->myNum];
+@@ -135,7 +135,7 @@ glxMatchVisual(ScreenPtr pScreen, VisualPtr pVisual, ScreenPtr pMatchScreen)
+     VisualID vid;
+ 
+     /* check that the glx extension has been initialized */
+-    if (!__glXActiveScreens)
++    if (!__glXNumActiveScreens)
+         return NULL;
+ 
+     pGlxScreen2 = &__glXActiveScreens[pMatchScreen->myNum];
+-- 
+2.13.0
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/xorg-xserver-Xdmx.git/commitdiff/4d53a4989264527b854becf239ebae11a3518b96



More information about the pld-cvs-commit mailing list