summaryrefslogtreecommitdiff
path: root/src/smi_dac.c
diff options
context:
space:
mode:
authorFrancisco Jerez <currojerez@gmail.com>2008-12-27 00:52:05 +0100
committerPaulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>2008-12-29 13:52:26 -0200
commit46741589529809c17aa1e9719492a4b623de6ddf (patch)
treea86bf8f79f0d83935e31534cb1eec3317ff3a29d /src/smi_dac.c
parent439adf4455c651926040eeeec52a092f14f3196b (diff)
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.
Diffstat (limited to 'src/smi_dac.c')
-rw-r--r--src/smi_dac.c13
1 files changed, 12 insertions, 1 deletions
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;
}