[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freedesktop-xorg-devel
Subject:    [PATCH xserver 1/2] xfree86: Add Option "Debug" to ServerFlags
From:       Adam Jackson <ajax () redhat ! com>
Date:       2018-03-28 16:46:00
Message-ID: 20180328164601.6777-1-ajax () redhat ! com
[Download RAW message or body]

This provides a generic way to control obscure runtime behavior knobs
without making interface promises.

Signed-off-by: Adam Jackson <ajax@redhat.com>
---
 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 05991d319d..2c1d335dcc 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 0842e1ebbd..21c2e1fe49 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 518d5bb78c..46ddd0ec9c 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
-- 
2.16.2

_______________________________________________
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic