diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c index 87b8a0b72..f89db67fc 100644 --- a/hw/xfree86/common/xf86Config.c +++ b/hw/xfree86/common/xf86Config.c @@ -2201,6 +2201,7 @@ configMonitor(MonPtr monitorp, XF86ConfMonitorPtr conf_monitor) monitorp->widthmm = conf_monitor->mon_width; monitorp->heightmm = conf_monitor->mon_height; monitorp->reducedblanking = FALSE; + monitorp->maxPixClock = 0; monitorp->options = conf_monitor->mon_option_lst; /* diff --git a/hw/xfree86/common/xf86Mode.c b/hw/xfree86/common/xf86Mode.c index ff045835a..c3b016f36 100644 --- a/hw/xfree86/common/xf86Mode.c +++ b/hw/xfree86/common/xf86Mode.c @@ -824,6 +824,9 @@ xf86CheckModeForMonitor(DisplayModePtr mode, MonPtr monitor) } } + if ((monitor->maxPixClock) && (mode->Clock > monitor->maxPixClock)) + return MODE_CLOCK_HIGH; + return MODE_OK; } diff --git a/hw/xfree86/common/xf86str.h b/hw/xfree86/common/xf86str.h index ae9d9aef4..6e62e52ff 100644 --- a/hw/xfree86/common/xf86str.h +++ b/hw/xfree86/common/xf86str.h @@ -213,6 +213,7 @@ typedef struct { pointer options; pointer DDC; Bool reducedblanking; /* Allow CVT reduced blanking modes? */ + int maxPixClock; /* in kHz, like mode->Clock */ } MonRec, *MonPtr; /* the list of clock ranges */ diff --git a/hw/xfree86/ddc/ddcProperty.c b/hw/xfree86/ddc/ddcProperty.c index a4f4f4ece..ba8aaf8b8 100644 --- a/hw/xfree86/ddc/ddcProperty.c +++ b/hw/xfree86/ddc/ddcProperty.c @@ -296,7 +296,7 @@ void xf86DDCMonitorSet(int scrnIndex, MonPtr Monitor, xf86MonPtr DDC) { DisplayModePtr Modes = NULL, Mode; - int i; + int i, clock; if (!Monitor || !DDC) return; @@ -339,6 +339,10 @@ xf86DDCMonitorSet(int scrnIndex, MonPtr Monitor, xf86MonPtr DDC) Monitor->vrefresh[0].lo = DDC->det_mon[i].section.ranges.min_v; Monitor->vrefresh[0].hi = DDC->det_mon[i].section.ranges.max_v; + clock = DDC->det_mon[i].section.ranges.max_clock * 1000; + if (clock > Monitor->maxPixClock) + Monitor->maxPixClock = clock; + break; case DT: Mode = DDCModeFromDetailedTiming(scrnIndex,