summaryrefslogtreecommitdiff
path: root/src/smi_dac.c
diff options
context:
space:
mode:
authorAlex Deucher <alex@botch2.com>2007-03-13 02:31:30 -0400
committerAlex Deucher <alex@botch2.com>2007-03-13 02:31:30 -0400
commitb53db3bc5ba7648d392dc630ef47e57fb8a0afb4 (patch)
tree77e1cb0eb96be9c5cdf4578fbd707576ed9c932b /src/smi_dac.c
parent7d1392be291e99fd3dde2292b82423b5f78d3a21 (diff)
fix clk calculation on older lynx chips
Diffstat (limited to 'src/smi_dac.c')
-rw-r--r--src/smi_dac.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/smi_dac.c b/src/smi_dac.c
index 9fda7fa..ac73323 100644
--- a/src/smi_dac.c
+++ b/src/smi_dac.c
@@ -41,6 +41,8 @@ SMI_CommonCalcClock(int scrnIndex, long freq, int min_m, int min_n1,
int max_n1, int min_n2, int max_n2, long freq_min,
long freq_max, unsigned char *mdiv, unsigned char *ndiv)
{
+ ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
+ SMIPtr pSmi = SMIPTR(pScrn);
double div, diff, best_diff;
unsigned int m;
unsigned char n1, n2;
@@ -90,7 +92,14 @@ SMI_CommonCalcClock(int scrnIndex, long freq, int min_m, int min_n1,
((double)(best_m) / (double)(best_n1) / (1 << best_n2)) * BASE_FREQ,
best_m, best_n1, best_n2));
- *ndiv = best_n1 | (best_n2 << 7);
+ if (SMI_LYNX_SERIES(pSmi->Chipset)) {
+ *ndiv = best_n1 | (best_n2 << 6);
+ } else {
+ *ndiv = best_n1 | (best_n2 << 7);
+ if (freq > 120000)
+ *ndiv |= 1 << 6;
+ }
+
*mdiv = best_m;
}