diff options
author | Eric Anholt <eric@anholt.net> | 2007-04-02 18:21:58 -0700 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2007-04-02 18:21:58 -0700 |
commit | 11797ffdcc22160317a5ebbc9291472570a51c6d (patch) | |
tree | d6724c2585ab84b145b72021ecc1cf024d08088e /hw | |
parent | e44f106ffc796c025abdfb66717c06db8b12b4e4 (diff) |
Move modes/ debugging output under Option "ModeDebug" in the Device section.
Diffstat (limited to 'hw')
-rw-r--r-- | hw/xfree86/doc/man/xorg.conf.man.pre | 4 | ||||
-rw-r--r-- | hw/xfree86/modes/xf86Crtc.c | 58 | ||||
-rw-r--r-- | hw/xfree86/modes/xf86Crtc.h | 7 |
3 files changed, 49 insertions, 20 deletions
diff --git a/hw/xfree86/doc/man/xorg.conf.man.pre b/hw/xfree86/doc/man/xorg.conf.man.pre index cc60d0754..19315c024 100644 --- a/hw/xfree86/doc/man/xorg.conf.man.pre +++ b/hw/xfree86/doc/man/xorg.conf.man.pre @@ -958,6 +958,10 @@ the driver-specific documentation recommends it. This optional entry specifies the pixel clock frequency that is used for the regular text mode. The frequency is specified in MHz. This is rarely used. +.TP 7 +.BI "Option \*qModeDebug\*q \*q" boolean \*q +Enable printing of additional debugging information about modesetting to +the server log. .ig .TP 7 This optional entry allows an IRQ number to be specified. diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c index 7d86b6606..32bdcba11 100644 --- a/hw/xfree86/modes/xf86Crtc.c +++ b/hw/xfree86/modes/xf86Crtc.c @@ -377,6 +377,15 @@ 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) { @@ -1160,8 +1169,6 @@ xf86SortModes (DisplayModePtr input) return output; } -#define DEBUG_REPROBE 1 - void xf86ProbeOutputModes (ScrnInfoPtr scrn, int maxX, int maxY) { @@ -1330,7 +1337,8 @@ xf86ProbeOutputModes (ScrnInfoPtr scrn, int maxX, int maxY) if (mode->status == MODE_OK) mode->status = (*output->funcs->mode_valid)(output, mode); - xf86PruneInvalidModes(scrn, &output->probed_modes, TRUE); + xf86PruneInvalidModes(scrn, &output->probed_modes, + config->debug_modes); output->probed_modes = xf86SortModes (output->probed_modes); @@ -1363,17 +1371,17 @@ xf86ProbeOutputModes (ScrnInfoPtr scrn, int maxX, int maxY) output->initial_rotation = xf86OutputInitialRotation (output); -#ifdef DEBUG_REPROBE - if (output->probed_modes != NULL) { - xf86DrvMsg(scrn->scrnIndex, X_INFO, - "Printing probed modes for output %s\n", - output->name); - } else { - xf86DrvMsg(scrn->scrnIndex, X_INFO, - "No remaining probed modes for output %s\n", - output->name); + if (config->debug_modes) { + if (output->probed_modes != NULL) { + xf86DrvMsg(scrn->scrnIndex, X_INFO, + "Printing probed modes for output %s\n", + output->name); + } else { + xf86DrvMsg(scrn->scrnIndex, X_INFO, + "No remaining probed modes for output %s\n", + output->name); + } } -#endif for (mode = output->probed_modes; mode != NULL; mode = mode->next) { /* The code to choose the best mode per pipe later on will require @@ -1382,9 +1390,8 @@ xf86ProbeOutputModes (ScrnInfoPtr scrn, int maxX, int maxY) mode->VRefresh = xf86ModeVRefresh(mode); xf86SetModeCrtc(mode, INTERLACE_HALVE_V); -#ifdef DEBUG_REPROBE - xf86PrintModeline(scrn->scrnIndex, mode); -#endif + if (config->debug_modes) + xf86PrintModeline(scrn->scrnIndex, mode); } } } @@ -1479,6 +1486,15 @@ xf86InitialConfiguration (ScrnInfoPtr scrn, Bool canGrow) int width; int height; + /* 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 @@ -1962,10 +1978,12 @@ xf86OutputSetEDID (xf86OutputPtr output, xf86MonPtr edid_mon) output->MonInfo = edid_mon; - /* Debug info for now, at least */ - xf86DrvMsg(scrn->scrnIndex, X_INFO, "EDID for output %s\n", output->name); - xf86PrintEDID(edid_mon); - + if (config->debug_modes) { + xf86DrvMsg(scrn->scrnIndex, X_INFO, "EDID for output %s\n", + output->name); + xf86PrintEDID(edid_mon); + } + /* Set the DDC properties for the 'compat' output */ if (output == config->output[config->compat_output]) xf86SetDDCproperties(scrn, edid_mon); diff --git a/hw/xfree86/modes/xf86Crtc.h b/hw/xfree86/modes/xf86Crtc.h index 42daf6079..030f6bf3a 100644 --- a/hw/xfree86/modes/xf86Crtc.h +++ b/hw/xfree86/modes/xf86Crtc.h @@ -552,6 +552,13 @@ typedef struct _xf86CrtcConfig { CARD8 *cursor_image; Bool cursor_on; CARD32 cursor_fg, cursor_bg; + + /** + * Options parsed from the related device section + */ + OptionInfoPtr options; + + Bool debug_modes; } xf86CrtcConfigRec, *xf86CrtcConfigPtr; extern int xf86CrtcConfigPrivateIndex; |