RANDR: Validate entire mode list for interlace and doublescan

Otherwise drivers have to refuse interlace twice: once in the output
config, and once in ->valid_mode() to catch output and config modes.
If you can't do interlaced modes, asking nicely for it in the config
isn't going to suddenly make it work.
This commit is contained in:
Adam Jackson 2009-02-13 14:06:07 -05:00
parent a26c77ff43
commit bcafdfbed6
3 changed files with 13 additions and 11 deletions

View File

@ -1660,8 +1660,7 @@ xf86ProbeOutputModes (ScrnInfoPtr scrn, int maxX, int maxY)
} }
if (add_default_modes) if (add_default_modes)
default_modes = xf86GetDefaultModes (output->interlaceAllowed, default_modes = xf86GetDefaultModes ();
output->doubleScanAllowed);
/* /*
* If this is not an RB monitor, remove RB modes from the default * If this is not an RB monitor, remove RB modes from the default
@ -1698,11 +1697,17 @@ xf86ProbeOutputModes (ScrnInfoPtr scrn, int maxX, int maxY)
output->probed_modes = xf86ModesAdd (output->probed_modes, default_modes); output->probed_modes = xf86ModesAdd (output->probed_modes, default_modes);
/* /*
* Check all modes against max size * Check all modes against max size, interlace, and doublescan
*/ */
if (maxX && maxY) if (maxX && maxY)
xf86ValidateModesSize (scrn, output->probed_modes, xf86ValidateModesSize (scrn, output->probed_modes,
maxX, maxY, 0); maxX, maxY, 0);
{
int flags = (output->interlaceAllowed ? V_INTERLACE : 0) |
(output->doubleScanAllowed ? V_DBLSCAN : 0);
xf86ValidateModesFlags (scrn, output->probed_modes, flags);
}
/* /*
* Check all modes against output * Check all modes against output

View File

@ -351,6 +351,9 @@ xf86ValidateModesFlags(ScrnInfoPtr pScrn, DisplayModePtr modeList,
{ {
DisplayModePtr mode; DisplayModePtr mode;
if (flags == (V_INTERLACE | V_DBLSCAN))
return;
for (mode = modeList; mode != NULL; mode = mode->next) { for (mode = modeList; mode != NULL; mode = mode->next) {
if (mode->Flags & V_INTERLACE && !(flags & V_INTERLACE)) if (mode->Flags & V_INTERLACE && !(flags & V_INTERLACE))
mode->status = MODE_NO_INTERLACE; mode->status = MODE_NO_INTERLACE;
@ -691,7 +694,7 @@ xf86GetMonitorModes (ScrnInfoPtr pScrn, XF86ConfMonitorPtr conf_monitor)
* Build a mode list containing all of the default modes * Build a mode list containing all of the default modes
*/ */
DisplayModePtr DisplayModePtr
xf86GetDefaultModes (Bool interlaceAllowed, Bool doubleScanAllowed) xf86GetDefaultModes (void)
{ {
DisplayModePtr head = NULL, mode; DisplayModePtr head = NULL, mode;
int i; int i;
@ -700,13 +703,7 @@ xf86GetDefaultModes (Bool interlaceAllowed, Bool doubleScanAllowed)
{ {
const DisplayModeRec *defMode = &xf86DefaultModes[i]; const DisplayModeRec *defMode = &xf86DefaultModes[i];
if (!interlaceAllowed && (defMode->Flags & V_INTERLACE))
continue;
if (!doubleScanAllowed && (defMode->Flags & V_DBLSCAN))
continue;
mode = xf86DuplicateMode(defMode); mode = xf86DuplicateMode(defMode);
head = xf86ModesAdd(head, mode); head = xf86ModesAdd(head, mode);
} }
return head; return head;

View File

@ -106,7 +106,7 @@ extern _X_EXPORT DisplayModePtr
xf86GetMonitorModes (ScrnInfoPtr pScrn, XF86ConfMonitorPtr conf_monitor); xf86GetMonitorModes (ScrnInfoPtr pScrn, XF86ConfMonitorPtr conf_monitor);
extern _X_EXPORT DisplayModePtr extern _X_EXPORT DisplayModePtr
xf86GetDefaultModes (Bool interlaceAllowed, Bool doubleScanAllowed); xf86GetDefaultModes (void);
extern _X_EXPORT void extern _X_EXPORT void
xf86DDCApplyQuirks(int scrnIndex, xf86MonPtr DDC); xf86DDCApplyQuirks(int scrnIndex, xf86MonPtr DDC);