xfree86: Use the TMDS maximum frequency to prune modes

Instead of only relying on the Range section, we can do better on
HDMI to find out what is the max dot clock the monitor supports. The
HDMI CEA vendor block adds a TMDS max freq we can use.

This makes X not prune 4k resolutions on HDMI.

v2: Replace X_INFO by X_PROBED in the message that prints the max
    TMDS frequency (Chris Wilson)

Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
This commit is contained in:
Damien Lespiau 2013-07-31 19:16:45 +01:00
parent 95c2287465
commit d6c8d75097

View File

@ -1676,6 +1676,7 @@ xf86ProbeOutputModes(ScrnInfoPtr scrn, int maxX, int maxY)
if (edid_monitor) {
struct det_monrec_parameter p;
struct disp_features *features = &edid_monitor->features;
struct cea_data_block *hdmi_db;
/* if display is not continuous-frequency, don't add default modes */
if (!GTF_SUPPORTED(features->msc))
@ -1688,6 +1689,16 @@ xf86ProbeOutputModes(ScrnInfoPtr scrn, int maxX, int maxY)
p.sync_source = &sync_source;
xf86ForEachDetailedBlock(edid_monitor, handle_detailed_monrec, &p);
/* Look at the CEA HDMI vendor block for the max TMDS freq */
hdmi_db = xf86MonitorFindHDMIBlock(edid_monitor);
if (hdmi_db && hdmi_db->len >= 7) {
int tmds_freq = hdmi_db->u.vendor.hdmi.max_tmds_clock * 5000;
xf86DrvMsg(scrn->scrnIndex, X_PROBED,
"HDMI max TMDS frequency %dKHz\n", tmds_freq);
if (tmds_freq > max_clock)
max_clock = tmds_freq;
}
}
if (xf86GetOptValFreq(output->options, OPTION_MIN_CLOCK,