summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Jackson <ajax@benzedrine.nwnk.net>2006-09-14 18:41:15 -0400
committerAdam Jackson <ajax@benzedrine.nwnk.net>2006-09-14 18:41:15 -0400
commitd89fee68d0e49211871cd9eb3893ed55c1d478a6 (patch)
tree0f1605040ce08e06873c04f7895f8f5f847b4269
parentfa8ef7166839a7435e0017683f3e3c7f7904b285 (diff)
downloadxserver-d89fee68d0e49211871cd9eb3893ed55c1d478a6.tar.gz
Record the maximum dot clock of the monitor, and filter by it.
-rw-r--r--hw/xfree86/common/xf86Config.c1
-rw-r--r--hw/xfree86/common/xf86Mode.c3
-rw-r--r--hw/xfree86/common/xf86str.h1
-rw-r--r--hw/xfree86/ddc/ddcProperty.c6
4 files changed, 10 insertions, 1 deletions
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,