Move modes/ debugging output under Option "ModeDebug" in the Device section.

This commit is contained in:
Eric Anholt 2007-04-02 18:21:58 -07:00
parent e44f106ffc
commit 11797ffdcc
3 changed files with 49 additions and 20 deletions

View File

@ -958,6 +958,10 @@ the driver-specific documentation recommends it.
This optional entry specifies the pixel clock frequency that is used This optional entry specifies the pixel clock frequency that is used
for the regular text mode. The frequency is specified in MHz. This is for the regular text mode. The frequency is specified in MHz. This is
rarely used. rarely used.
.TP 7
.BI "Option \*qModeDebug\*q \*q" boolean \*q
Enable printing of additional debugging information about modesetting to
the server log.
.ig .ig
.TP 7 .TP 7
This optional entry allows an IRQ number to be specified. This optional entry allows an IRQ number to be specified.

View File

@ -377,6 +377,15 @@ static OptionInfoRec xf86OutputOptions[] = {
{-1, NULL, OPTV_NONE, {0}, FALSE }, {-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 static void
xf86OutputSetMonitor (xf86OutputPtr output) xf86OutputSetMonitor (xf86OutputPtr output)
{ {
@ -1160,8 +1169,6 @@ xf86SortModes (DisplayModePtr input)
return output; return output;
} }
#define DEBUG_REPROBE 1
void void
xf86ProbeOutputModes (ScrnInfoPtr scrn, int maxX, int maxY) xf86ProbeOutputModes (ScrnInfoPtr scrn, int maxX, int maxY)
{ {
@ -1330,7 +1337,8 @@ xf86ProbeOutputModes (ScrnInfoPtr scrn, int maxX, int maxY)
if (mode->status == MODE_OK) if (mode->status == MODE_OK)
mode->status = (*output->funcs->mode_valid)(output, mode); 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); output->probed_modes = xf86SortModes (output->probed_modes);
@ -1363,17 +1371,17 @@ xf86ProbeOutputModes (ScrnInfoPtr scrn, int maxX, int maxY)
output->initial_rotation = xf86OutputInitialRotation (output); output->initial_rotation = xf86OutputInitialRotation (output);
#ifdef DEBUG_REPROBE if (config->debug_modes) {
if (output->probed_modes != NULL) { if (output->probed_modes != NULL) {
xf86DrvMsg(scrn->scrnIndex, X_INFO, xf86DrvMsg(scrn->scrnIndex, X_INFO,
"Printing probed modes for output %s\n", "Printing probed modes for output %s\n",
output->name); output->name);
} else { } else {
xf86DrvMsg(scrn->scrnIndex, X_INFO, xf86DrvMsg(scrn->scrnIndex, X_INFO,
"No remaining probed modes for output %s\n", "No remaining probed modes for output %s\n",
output->name); output->name);
}
} }
#endif
for (mode = output->probed_modes; mode != NULL; mode = mode->next) for (mode = output->probed_modes; mode != NULL; mode = mode->next)
{ {
/* The code to choose the best mode per pipe later on will require /* 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); mode->VRefresh = xf86ModeVRefresh(mode);
xf86SetModeCrtc(mode, INTERLACE_HALVE_V); xf86SetModeCrtc(mode, INTERLACE_HALVE_V);
#ifdef DEBUG_REPROBE if (config->debug_modes)
xf86PrintModeline(scrn->scrnIndex, mode); xf86PrintModeline(scrn->scrnIndex, mode);
#endif
} }
} }
} }
@ -1479,6 +1486,15 @@ xf86InitialConfiguration (ScrnInfoPtr scrn, Bool canGrow)
int width; int width;
int height; 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) if (scrn->display->virtualX)
width = scrn->display->virtualX; width = scrn->display->virtualX;
else else
@ -1962,10 +1978,12 @@ xf86OutputSetEDID (xf86OutputPtr output, xf86MonPtr edid_mon)
output->MonInfo = edid_mon; output->MonInfo = edid_mon;
/* Debug info for now, at least */ if (config->debug_modes) {
xf86DrvMsg(scrn->scrnIndex, X_INFO, "EDID for output %s\n", output->name); xf86DrvMsg(scrn->scrnIndex, X_INFO, "EDID for output %s\n",
xf86PrintEDID(edid_mon); output->name);
xf86PrintEDID(edid_mon);
}
/* Set the DDC properties for the 'compat' output */ /* Set the DDC properties for the 'compat' output */
if (output == config->output[config->compat_output]) if (output == config->output[config->compat_output])
xf86SetDDCproperties(scrn, edid_mon); xf86SetDDCproperties(scrn, edid_mon);

View File

@ -552,6 +552,13 @@ typedef struct _xf86CrtcConfig {
CARD8 *cursor_image; CARD8 *cursor_image;
Bool cursor_on; Bool cursor_on;
CARD32 cursor_fg, cursor_bg; CARD32 cursor_fg, cursor_bg;
/**
* Options parsed from the related device section
*/
OptionInfoPtr options;
Bool debug_modes;
} xf86CrtcConfigRec, *xf86CrtcConfigPtr; } xf86CrtcConfigRec, *xf86CrtcConfigPtr;
extern int xf86CrtcConfigPrivateIndex; extern int xf86CrtcConfigPrivateIndex;