From dc498b433f36af5d2de3065e7c64cdb575385d81 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Mon, 8 Feb 2010 15:23:04 -0500 Subject: [PATCH] xfree86: If the driver found modes on an output, don't add more Inferring modes from sync ranges is only valid if the monitor says it's valid. If the monitor says it's valid, then we'll have already added those modes during EDID block parse. If it doesn't, then we should believe it. If there's no EDID for an output, but sync ranges from the config, we'll still add default modes as normal. Reviewed-by: Alex Deucher Signed-off-by: Adam Jackson --- hw/xfree86/modes/xf86Crtc.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c index b5e9dc26f..0ae63ba97 100644 --- a/hw/xfree86/modes/xf86Crtc.c +++ b/hw/xfree86/modes/xf86Crtc.c @@ -1595,7 +1595,7 @@ xf86ProbeOutputModes (ScrnInfoPtr scrn, int maxX, int maxY) int min_clock = 0; int max_clock = 0; double clock; - Bool add_default_modes = xf86ReturnOptValBool(output->options, OPTION_DEFAULT_MODES, TRUE); + Bool add_default_modes; Bool debug_modes = config->debug_modes || xf86Initialising; enum det_monrec_source sync_source = sync_default; @@ -1641,6 +1641,14 @@ xf86ProbeOutputModes (ScrnInfoPtr scrn, int maxX, int maxY) } output_modes = (*output->funcs->get_modes) (output); + + /* + * If the user has a preference, respect it. + * Otherwise, don't second-guess the driver. + */ + if (!xf86GetOptValBool(output->options, OPTION_DEFAULT_MODES, + &add_default_modes)) + add_default_modes = (output_modes == NULL); edid_monitor = output->MonInfo;