[PATCH] xserver: check modedebug option earlier

Zhenyu Wang zhenyu.z.wang at intel.com
Tue Mar 25 00:03:36 PDT 2008


This patch trys to validate "ModeDebug" option earlier after
crtc config has been initialized. As driver might do like
ddc probe before calling glory xf86InitialConfiguration(),
it could help driver debug, e.g LVDS edid probe in intel.

---
diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index 8c2b247..04096d8 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -49,6 +49,15 @@
 
 #include "xf86xv.h"
 
+enum {
+    OPTION_MODEDEBUG,
+};
+
+static OptionInfoRec xf86DeviceOptions[] = {
+    {OPTION_MODEDEBUG,	    "ModeDebug",	OPTV_STRING,  {0}, FALSE },
+    {-1,		    NULL,		OPTV_NONE,    {0}, FALSE },
+};
+
 /*
  * Initialize xf86CrtcConfig structure
  */
@@ -68,6 +77,15 @@ xf86CrtcConfigInit (ScrnInfoPtr scrn,
     config->funcs = funcs;
 
     scrn->privates[xf86CrtcConfigPrivateIndex].ptr = config;
+
+    /* Set up the device options */
+    config->options = xnfalloc (sizeof (xf86DeviceOptions));
+    memcpy (config->options, xf86DeviceOptions, sizeof (xf86DeviceOptions));
+    xf86ProcessOptions (scrn->scrnIndex,
+			scrn->options,
+			config->options);
+    config->debug_modes = xf86ReturnOptValBool (config->options,
+						OPTION_MODEDEBUG, FALSE);
 }
  
 _X_EXPORT void
@@ -408,14 +426,6 @@ static OptionInfoRec xf86OutputOptions[] = {
     {-1,		    NULL,		OPTV_NONE,    {0}, FALSE },
 };
 
-enum {
-    OPTION_MODEDEBUG,
-};
-
-static OptionInfoRec xf86DeviceOptions[] = {
-    {OPTION_MODEDEBUG,	    "ModeDebug",	OPTV_STRING,  {0}, FALSE },
-    {-1,		    NULL,		OPTV_NONE,    {0}, FALSE },
-};
 
 static void
 xf86OutputSetMonitor (xf86OutputPtr output)
@@ -1889,15 +1899,6 @@ xf86InitialConfiguration (ScrnInfoPtr scrn, Bool canGrow)
     int			width, height;
     int			i = scrn->scrnIndex;
 
-    /* Set up the device options */
-    config->options = xnfalloc (sizeof (xf86DeviceOptions));
-    memcpy (config->options, xf86DeviceOptions, sizeof (xf86DeviceOptions));
-    xf86ProcessOptions (scrn->scrnIndex,
-			scrn->options,
-			config->options);
-    config->debug_modes = xf86ReturnOptValBool (config->options,
-						OPTION_MODEDEBUG, FALSE);
-
     if (scrn->display->virtualX)
 	width = scrn->display->virtualX;
     else



More information about the xorg mailing list