diff options
author | Adam Jackson <ajax@benzedrine.nwnk.net> | 2007-07-10 14:20:55 -0400 |
---|---|---|
committer | Adam Jackson <ajax@benzedrine.nwnk.net> | 2007-07-10 14:20:55 -0400 |
commit | e316fa59fea8b7b18cdf3a227890351a9567ec65 (patch) | |
tree | edbd161eeeb23e0e17507264caaaa1076eae0da6 | |
parent | 161624a5a45808fd56141dc2c64be729944f03ed (diff) |
Add per-monitor config file option for maximum pixel clock.
-rw-r--r-- | hw/xfree86/common/xf86Config.c | 11 | ||||
-rw-r--r-- | hw/xfree86/common/xf86Mode.c | 6 | ||||
-rw-r--r-- | hw/xfree86/modes/xf86EdidModes.c | 5 |
3 files changed, 15 insertions, 7 deletions
diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c index 4bd93b89f..b5b49272b 100644 --- a/hw/xfree86/common/xf86Config.c +++ b/hw/xfree86/common/xf86Config.c @@ -1,5 +1,3 @@ - - /* * Loosely based on code bearing the following copyright: * @@ -1947,12 +1945,15 @@ configScreen(confScreenPtr screenp, XF86ConfScreenPtr conf_screen, int scrnum, } typedef enum { - MON_REDUCEDBLANKING + MON_REDUCEDBLANKING, + MON_MAX_PIX_CLOCK, } MonitorValues; static OptionInfoRec MonitorOptions[] = { { MON_REDUCEDBLANKING, "ReducedBlanking", OPTV_BOOLEAN, {0}, FALSE }, + { MON_MAX_PIX_CLOCK, "MaxPixClock", OPTV_FREQ, + {0}, FALSE }, { -1, NULL, OPTV_NONE, {0}, FALSE }, }; @@ -2099,11 +2100,11 @@ configMonitor(MonPtr monitorp, XF86ConfMonitorPtr conf_monitor) return FALSE; } - /* Check wether this Monitor accepts Reduced Blanking modelines */ xf86ProcessOptions(-1, monitorp->options, MonitorOptions); - xf86GetOptValBool(MonitorOptions, MON_REDUCEDBLANKING, &monitorp->reducedblanking); + xf86GetOptValFreq(MonitorOptions, MON_MAX_PIX_CLOCK, OPTUNITS_KHZ, + &monitorp->maxPixClock); return TRUE; } diff --git a/hw/xfree86/common/xf86Mode.c b/hw/xfree86/common/xf86Mode.c index 0c25c96db..7fcce10b1 100644 --- a/hw/xfree86/common/xf86Mode.c +++ b/hw/xfree86/common/xf86Mode.c @@ -1472,6 +1472,12 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes, scrp->monitor->vrefresh[i].lo, scrp->monitor->vrefresh[i].hi); } + if (scrp->monitor->maxPixClock) { + xf86DrvMsg(scrp->scrnIndex, X_INFO, + "%s: Using maximum pixel clock of %.2f MHz\n", + scrp->monitor->id, + (float)scrp->monitor->maxPixClock / 1000.0); + } } /* diff --git a/hw/xfree86/modes/xf86EdidModes.c b/hw/xfree86/modes/xf86EdidModes.c index 22329922c..3f67ef3d7 100644 --- a/hw/xfree86/modes/xf86EdidModes.c +++ b/hw/xfree86/modes/xf86EdidModes.c @@ -427,7 +427,7 @@ xf86DDCMonitorSet(int scrnIndex, MonPtr Monitor, xf86MonPtr DDC) { DisplayModePtr Modes = NULL, Mode; int i, clock; - Bool have_hsync = FALSE, have_vrefresh = FALSE; + Bool have_hsync = FALSE, have_vrefresh = FALSE, have_maxpixclock = FALSE; if (!Monitor || !DDC) return; @@ -447,6 +447,7 @@ xf86DDCMonitorSet(int scrnIndex, MonPtr Monitor, xf86MonPtr DDC) /* Skip EDID ranges if they were specified in the config file */ have_hsync = (Monitor->nHsync != 0); have_vrefresh = (Monitor->nVrefresh != 0); + have_maxpixclock = (Monitor->maxPixClock != 0); /* Go through the detailed monitor sections */ for (i = 0; i < DET_TIMINGS; i++) { @@ -481,7 +482,7 @@ xf86DDCMonitorSet(int scrnIndex, MonPtr Monitor, xf86MonPtr DDC) } clock = DDC->det_mon[i].section.ranges.max_clock * 1000; - if (clock > Monitor->maxPixClock) + if (!have_maxpixclock && clock > Monitor->maxPixClock) Monitor->maxPixClock = clock; break; |