From 356e18dcc60b4ba712681b23900e73849de5d126 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Thu, 2 May 2024 19:03:28 +0200 Subject: [PATCH] os: move out extension disable flags to corresponing extensions The OS abstraction isn't really the right place for those flags, they are're probably better off in their corresponding extensions. Signed-off-by: Enrico Weigelt, metux IT consult Part-of: --- Xext/dpms.c | 2 + Xext/geext.c | 2 + Xext/panoramiX.c | 3 ++ Xext/saver.c | 2 + Xext/security.c | 2 + Xext/shape.c | 2 + Xext/shm.c | 2 + Xext/xf86bigfont.c | 2 + Xext/xres.c | 2 + Xext/xtest.c | 2 + composite/compinit.c | 2 + damageext/damageext.c | 2 + dbe/dbe.c | 1 + glx/vndext.c | 2 + hw/xfree86/common/xf86Extensions.c | 5 +++ hw/xnest/Init.c | 4 ++ hw/xwayland/xwayland.c | 3 +- os/utils.c | 59 ------------------------------ randr/randr.c | 2 + render/render.c | 2 + xfixes/xfixes.c | 2 + 21 files changed, 45 insertions(+), 60 deletions(-) diff --git a/Xext/dpms.c b/Xext/dpms.c index c4194259d..af1869cb2 100644 --- a/Xext/dpms.c +++ b/Xext/dpms.c @@ -45,6 +45,8 @@ Equipment Corporation. #include "windowstr.h" #include "protocol-versions.h" +Bool noDPMSExtension = FALSE; + CARD16 DPMSPowerLevel = 0; Bool DPMSDisabledSwitch = FALSE; CARD32 DPMSStandbyTime = -1; diff --git a/Xext/geext.c b/Xext/geext.c index a1625a54a..0f4076a5f 100644 --- a/Xext/geext.c +++ b/Xext/geext.c @@ -32,6 +32,8 @@ #include "protocol-versions.h" #include "extinit_priv.h" +Bool noGEExtension = FALSE; + DevPrivateKeyRec GEClientPrivateKeyRec; GEExtension GEExtensions[MAXEXTENSIONS]; diff --git a/Xext/panoramiX.c b/Xext/panoramiX.c index f43ae2a95..75f9e37b2 100644 --- a/Xext/panoramiX.c +++ b/Xext/panoramiX.c @@ -63,6 +63,9 @@ extern VisualPtr glxMatchVisual(ScreenPtr pScreen, VisualPtr pVisual, ScreenPtr pMatchScreen); #endif +/* Xinerama is disabled by default unless enabled via +xinerama */ +Bool noPanoramiXExtension = TRUE; + /* * PanoramiX data declarations */ diff --git a/Xext/saver.c b/Xext/saver.c index ad39a57aa..60b250fdd 100644 --- a/Xext/saver.c +++ b/Xext/saver.c @@ -67,6 +67,8 @@ in this Software without prior written authorization from the X Consortium. // see: https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1355 #undef CreateWindow +Bool noScreenSaverExtension = FALSE; + static int ScreenSaverEventBase = 0; static Bool ScreenSaverHandle(ScreenPtr pScreen, int xstate, Bool force); diff --git a/Xext/security.c b/Xext/security.c index 733ae3c6e..df4fd922b 100644 --- a/Xext/security.c +++ b/Xext/security.c @@ -48,6 +48,8 @@ in this Software without prior written authorization from The Open Group. #include "extinit.h" #include "protocol-versions.h" +Bool noSecurityExtension = FALSE; + /* Extension stuff */ static int SecurityErrorBase; /* first Security error number */ static int SecurityEventBase; /* first Security event number */ diff --git a/Xext/shape.c b/Xext/shape.c index 65c55699f..7a0634ae2 100644 --- a/Xext/shape.c +++ b/Xext/shape.c @@ -48,6 +48,8 @@ in this Software without prior written authorization from The Open Group. #include "extinit_priv.h" #include "protocol-versions.h" +Bool noShapeExtension = FALSE; + typedef RegionPtr (*CreateDftPtr) (WindowPtr /* pWin */ ); diff --git a/Xext/shm.c b/Xext/shm.c index beb30040b..b066d05ea 100644 --- a/Xext/shm.c +++ b/Xext/shm.c @@ -100,6 +100,8 @@ typedef struct _ShmScrPrivateRec { DestroyPixmapProcPtr destroyPixmap; } ShmScrPrivateRec; +Bool noMITShmExtension = FALSE; + static PixmapPtr fbShmCreatePixmap(XSHM_CREATE_PIXMAP_ARGS); static int ShmDetachSegment(void *value, XID shmseg); static void ShmResetProc(ExtensionEntry *extEntry); diff --git a/Xext/xf86bigfont.c b/Xext/xf86bigfont.c index e7cc99fd9..6dfa811e6 100644 --- a/Xext/xf86bigfont.c +++ b/Xext/xf86bigfont.c @@ -69,6 +69,8 @@ #include "xf86bigfontsrv.h" +Bool noXFree86BigfontExtension = FALSE; + static void XF86BigfontResetProc(ExtensionEntry *extEntry ); #ifdef MITSHM diff --git a/Xext/xres.c b/Xext/xres.c index 403ab74bb..90f8bc285 100644 --- a/Xext/xres.c +++ b/Xext/xres.c @@ -34,6 +34,8 @@ #include "compint.h" #endif +Bool noResExtension = FALSE; + /** @brief Holds fragments of responses for ConstructClientIds. * * note: there is no consideration for data alignment */ diff --git a/Xext/xtest.c b/Xext/xtest.c index 230f0356c..bec191e49 100644 --- a/Xext/xtest.c +++ b/Xext/xtest.c @@ -60,6 +60,8 @@ #include "inpututils.h" #include "extinit_priv.h" +Bool noTestExtensions = FALSE; + /* XTest events are sent during request processing and may be interrupted by * a SIGIO. We need a separate event list to avoid events overwriting each * other's memory. diff --git a/composite/compinit.c b/composite/compinit.c index 88e69d37e..e0a565365 100644 --- a/composite/compinit.c +++ b/composite/compinit.c @@ -49,6 +49,8 @@ #include "compint.h" #include "compositeext.h" +Bool noCompositeExtension = FALSE; + DevPrivateKeyRec CompScreenPrivateKeyRec; DevPrivateKeyRec CompWindowPrivateKeyRec; DevPrivateKeyRec CompSubwindowsPrivateKeyRec; diff --git a/damageext/damageext.c b/damageext/damageext.c index c9b14b2ee..5c012bd11 100644 --- a/damageext/damageext.c +++ b/damageext/damageext.c @@ -53,6 +53,8 @@ static DevPrivateKeyRec DamageClientPrivateKeyRec; #define DamageClientPrivateKey (&DamageClientPrivateKeyRec) +Bool noDamageExtension = FALSE; + static void DamageNoteCritical(ClientPtr pClient) { diff --git a/dbe/dbe.c b/dbe/dbe.c index 94ba8ddb9..edd234db8 100644 --- a/dbe/dbe.c +++ b/dbe/dbe.c @@ -51,6 +51,7 @@ #include "xace.h" /* GLOBALS */ +Bool noDbeExtension = FALSE; /* These are globals for use by DDX */ DevPrivateKeyRec dbeScreenPrivKeyRec; diff --git a/glx/vndext.c b/glx/vndext.c index a0519ff65..b424dadb0 100644 --- a/glx/vndext.c +++ b/glx/vndext.c @@ -42,6 +42,8 @@ #include "dix/dix_priv.h" +Bool noGlxExtension = FALSE; + ExtensionEntry *GlxExtensionEntry; int GlxErrorBase = 0; static CallbackListRec vndInitCallbackList; diff --git a/hw/xfree86/common/xf86Extensions.c b/hw/xfree86/common/xf86Extensions.c index 1b8b78505..1e6ff7f65 100644 --- a/hw/xfree86/common/xf86Extensions.c +++ b/hw/xfree86/common/xf86Extensions.c @@ -51,6 +51,11 @@ #include "vidmodestr.h" #endif +Bool noXFree86VidModeExtension = FALSE; +Bool noXFree86DGAExtension = FALSE; +Bool noXFree86DRIExtension = FALSE; +Bool noDRI2Extension = FALSE; + /* * DDX-specific extensions. */ diff --git a/hw/xnest/Init.c b/hw/xnest/Init.c index fb30d7686..36e801f30 100644 --- a/hw/xnest/Init.c +++ b/hw/xnest/Init.c @@ -52,11 +52,15 @@ is" without express or implied warranty. Bool xnestDoFullGeneration = TRUE; +/* Xnest doesn't support GLX yet, so we don't link it, but still have + satisfy DIX's symbol requirements */ #ifdef GLXEXT void GlxExtensionInit(void) { } + +Bool noGlxExtension = FALSE; #endif void diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c index 29ce98c03..4cbe431c7 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c @@ -52,6 +52,7 @@ #include #include #include +#include "extinit.h" #include "os/auth.h" @@ -60,7 +61,7 @@ #ifdef XF86VIDMODE #include -extern _X_EXPORT Bool noXFree86VidModeExtension; +Bool noXFree86VidModeExtension; #endif void diff --git a/os/utils.c b/os/utils.c index 388ef4637..a2c6c85e8 100644 --- a/os/utils.c +++ b/os/utils.c @@ -117,66 +117,7 @@ __stdcall unsigned long GetTickCount(void); #include "miinitext.h" #include "present.h" #include "dixstruct_priv.h" - -Bool noTestExtensions; - -#ifdef COMPOSITE -Bool noCompositeExtension = FALSE; -#endif - -#ifdef DAMAGE -Bool noDamageExtension = FALSE; -#endif -#ifdef DBE -Bool noDbeExtension = FALSE; -#endif -#ifdef DPMSExtension #include "dpmsproc.h" -Bool noDPMSExtension = FALSE; -#endif -#ifdef GLXEXT -Bool noGlxExtension = FALSE; -#endif -#ifdef SCREENSAVER -Bool noScreenSaverExtension = FALSE; -#endif -#ifdef MITSHM -Bool noMITShmExtension = FALSE; -#endif -#ifdef RANDR -Bool noRRExtension = FALSE; -#endif -Bool noRenderExtension = FALSE; -Bool noShapeExtension = FALSE; - -#ifdef XCSECURITY -Bool noSecurityExtension = FALSE; -#endif -#ifdef RES -Bool noResExtension = FALSE; -#endif -#ifdef XF86BIGFONT -Bool noXFree86BigfontExtension = FALSE; -#endif -#ifdef XFreeXDGA -Bool noXFree86DGAExtension = FALSE; -#endif -#ifdef XF86DRI -Bool noXFree86DRIExtension = FALSE; -#endif -#ifdef XF86VIDMODE -Bool noXFree86VidModeExtension = FALSE; -#endif -Bool noXFixesExtension = FALSE; -#ifdef XINERAMA -/* Xinerama is disabled by default unless enabled via +xinerama */ -Bool noPanoramiXExtension = TRUE; -#endif /* XINERAMA */ -#ifdef DRI2 -Bool noDRI2Extension = FALSE; -#endif - -Bool noGEExtension = FALSE; #define X_INCLUDE_NETDB_H #include diff --git a/randr/randr.c b/randr/randr.c index 3459c4d76..59d101ba7 100644 --- a/randr/randr.c +++ b/randr/randr.c @@ -36,6 +36,8 @@ #define SubPixelUnknown 0 #endif +Bool noRRExtension = FALSE; + #define RR_VALIDATE static int RRNScreens; diff --git a/render/render.c b/render/render.c index c4d7f0160..27dfa38ad 100644 --- a/render/render.c +++ b/render/render.c @@ -57,6 +57,8 @@ #include "panoramiXsrv.h" #endif /* XINERAMA */ +Bool noRenderExtension = FALSE; + static int ProcRenderQueryVersion(ClientPtr pClient); static int ProcRenderQueryPictFormats(ClientPtr pClient); static int ProcRenderQueryPictIndexValues(ClientPtr pClient); diff --git a/xfixes/xfixes.c b/xfixes/xfixes.c index e9758b2f0..5fff4ce57 100644 --- a/xfixes/xfixes.c +++ b/xfixes/xfixes.c @@ -48,6 +48,8 @@ #include "protocol-versions.h" #include "extinit_priv.h" +Bool noXFixesExtension = FALSE; + static unsigned char XFixesReqCode; int XFixesEventBase; int XFixesErrorBase;