Add per-monitor config file option for maximum pixel clock.
This commit is contained in:
parent
161624a5a4
commit
e316fa59fe
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue