From df13ea7da9174d2e1c732985d9b7a9a35a6916bc Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Wed, 28 Mar 2018 12:46:00 -0400 Subject: [PATCH] xfree86: Add Option "Debug" to ServerFlags This provides a generic way to control obscure runtime behavior knobs without making interface promises. Signed-off-by: Adam Jackson --- hw/xfree86/common/xf86Config.c | 5 +++++ hw/xfree86/common/xf86Privstr.h | 1 + hw/xfree86/man/xorg.conf.man | 4 ++++ 3 files changed, 10 insertions(+) diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c index 05991d319..2c1d335dc 100644 --- a/hw/xfree86/common/xf86Config.c +++ b/hw/xfree86/common/xf86Config.c @@ -645,6 +645,7 @@ typedef enum { FLAG_AUTO_ADD_GPU, FLAG_MAX_CLIENTS, FLAG_IGLX, + FLAG_DEBUG, } FlagValues; /** @@ -702,6 +703,8 @@ static OptionInfoRec FlagOptions[] = { {0}, FALSE }, {FLAG_IGLX, "IndirectGLX", OPTV_BOOLEAN, {0}, FALSE}, + {FLAG_DEBUG, "Debug", OPTV_STRING, + {0}, FALSE}, {-1, NULL, OPTV_NONE, {0}, FALSE}, }; @@ -850,6 +853,8 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts) } #endif + xf86Info.debug = xf86GetOptValString(FlagOptions, FLAG_DEBUG); + /* if we're not hotplugging, force some input devices to exist */ xf86Info.forceInputDevices = !(xf86Info.autoAddDevices && xf86Info.autoEnableDevices); diff --git a/hw/xfree86/common/xf86Privstr.h b/hw/xfree86/common/xf86Privstr.h index 0842e1ebb..21c2e1fe4 100644 --- a/hw/xfree86/common/xf86Privstr.h +++ b/hw/xfree86/common/xf86Privstr.h @@ -97,6 +97,7 @@ typedef struct { MessageType dri2From; Bool autoAddGPU; + const char *debug; } xf86InfoRec, *xf86InfoPtr; /* ISC's cc can't handle ~ of UL constants, so explicitly type cast them. */ diff --git a/hw/xfree86/man/xorg.conf.man b/hw/xfree86/man/xorg.conf.man index 518d5bb78..46ddd0ec9 100644 --- a/hw/xfree86/man/xorg.conf.man +++ b/hw/xfree86/man/xorg.conf.man @@ -495,6 +495,10 @@ Options with command line equivalents are overridden when their command line equivalent is used. The options recognised by this section are: .TP 7 +.BI "Option \*qDebug\*q \*q" string \*q +This comma-separated list provides a way to control various debugging switches +from the config file. +.TP 7 .BI "Option \*qDefaultServerLayout\*q \*q" layout\-id \*q This specifies the default .B ServerLayout