Add per-monitor config file option for maximum pixel clock.

This commit is contained in:
Adam Jackson 2007-07-10 14:20:55 -04:00
parent 161624a5a4
commit e316fa59fe
3 changed files with 15 additions and 7 deletions

View File

@ -1,5 +1,3 @@
/* /*
* Loosely based on code bearing the following copyright: * Loosely based on code bearing the following copyright:
* *
@ -1947,12 +1945,15 @@ configScreen(confScreenPtr screenp, XF86ConfScreenPtr conf_screen, int scrnum,
} }
typedef enum { typedef enum {
MON_REDUCEDBLANKING MON_REDUCEDBLANKING,
MON_MAX_PIX_CLOCK,
} MonitorValues; } MonitorValues;
static OptionInfoRec MonitorOptions[] = { static OptionInfoRec MonitorOptions[] = {
{ MON_REDUCEDBLANKING, "ReducedBlanking", OPTV_BOOLEAN, { MON_REDUCEDBLANKING, "ReducedBlanking", OPTV_BOOLEAN,
{0}, FALSE }, {0}, FALSE },
{ MON_MAX_PIX_CLOCK, "MaxPixClock", OPTV_FREQ,
{0}, FALSE },
{ -1, NULL, OPTV_NONE, { -1, NULL, OPTV_NONE,
{0}, FALSE }, {0}, FALSE },
}; };
@ -2099,11 +2100,11 @@ configMonitor(MonPtr monitorp, XF86ConfMonitorPtr conf_monitor)
return FALSE; return FALSE;
} }
/* Check wether this Monitor accepts Reduced Blanking modelines */
xf86ProcessOptions(-1, monitorp->options, MonitorOptions); xf86ProcessOptions(-1, monitorp->options, MonitorOptions);
xf86GetOptValBool(MonitorOptions, MON_REDUCEDBLANKING, xf86GetOptValBool(MonitorOptions, MON_REDUCEDBLANKING,
&monitorp->reducedblanking); &monitorp->reducedblanking);
xf86GetOptValFreq(MonitorOptions, MON_MAX_PIX_CLOCK, OPTUNITS_KHZ,
&monitorp->maxPixClock);
return TRUE; return TRUE;
} }

View File

@ -1472,6 +1472,12 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes,
scrp->monitor->vrefresh[i].lo, scrp->monitor->vrefresh[i].lo,
scrp->monitor->vrefresh[i].hi); 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);
}
} }
/* /*

View File

@ -427,7 +427,7 @@ xf86DDCMonitorSet(int scrnIndex, MonPtr Monitor, xf86MonPtr DDC)
{ {
DisplayModePtr Modes = NULL, Mode; DisplayModePtr Modes = NULL, Mode;
int i, clock; int i, clock;
Bool have_hsync = FALSE, have_vrefresh = FALSE; Bool have_hsync = FALSE, have_vrefresh = FALSE, have_maxpixclock = FALSE;
if (!Monitor || !DDC) if (!Monitor || !DDC)
return; return;
@ -447,6 +447,7 @@ xf86DDCMonitorSet(int scrnIndex, MonPtr Monitor, xf86MonPtr DDC)
/* Skip EDID ranges if they were specified in the config file */ /* Skip EDID ranges if they were specified in the config file */
have_hsync = (Monitor->nHsync != 0); have_hsync = (Monitor->nHsync != 0);
have_vrefresh = (Monitor->nVrefresh != 0); have_vrefresh = (Monitor->nVrefresh != 0);
have_maxpixclock = (Monitor->maxPixClock != 0);
/* Go through the detailed monitor sections */ /* Go through the detailed monitor sections */
for (i = 0; i < DET_TIMINGS; i++) { 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; clock = DDC->det_mon[i].section.ranges.max_clock * 1000;
if (clock > Monitor->maxPixClock) if (!have_maxpixclock && clock > Monitor->maxPixClock)
Monitor->maxPixClock = clock; Monitor->maxPixClock = clock;
break; break;