From 46741589529809c17aa1e9719492a4b623de6ddf Mon Sep 17 00:00:00 2001 From: Francisco Jerez Date: Sat, 27 Dec 2008 00:52:05 +0100 Subject: Some more quirks for the SM712. * Program the MCLK to 157MHz on startup. * Adjust the requested pixel clock if it's near one of the known stable frequencies. * Prefer the clock alternative with post scalar turned on when the denominator is even. --- src/smi_dac.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/smi_dac.c') diff --git a/src/smi_dac.c b/src/smi_dac.c index f72c77e..de4d794 100644 --- a/src/smi_dac.c +++ b/src/smi_dac.c @@ -92,9 +92,20 @@ SMI_CommonCalcClock(int scrnIndex, long freq, int min_m, int min_n1, best_m, best_n1, best_n2); if (SMI_LYNX_SERIES(pSmi->Chipset)) { - *ndiv = best_n1 | (best_n2 << 6); + /* Prefer post scalar enabled for even denominators */ + if (freq < 70000 && max_n2 > 0 && + best_n2 == 0 && best_n1 % 2 == 0){ + best_n1 >>= 1; + best_n2 = 1; + } + + *ndiv = best_n1 | + (best_n2 & 0x1) << 7 | + (best_n2 & 0x2) >> 1 <<6; } else { *ndiv = best_n1 | (best_n2 << 7); + + /* Enable second VCO */ if (freq > 120000) *ndiv |= 1 << 6; } -- cgit v1.2.3