summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Sapountzis <gsap7@yahoo.gr>2008-02-07 18:02:17 +0200
committerGeorge Sapountzis <gsap7@yahoo.gr>2008-02-07 18:02:17 +0200
commitdce4cc26a8e2bf53805ec63763243f3ff6b4a6d3 (patch)
treedf5e6c8d389572e1dff9939e9ce0234988540a69
parentf7ed807f0d82a7446ebc4acdd4e94df44a675f19 (diff)
mach64: consolidate refclk #1
-rw-r--r--src/aticonfig.c7
-rw-r--r--src/atipreinit.c7
-rw-r--r--src/atistruct.h1
3 files changed, 9 insertions, 6 deletions
diff --git a/src/aticonfig.c b/src/aticonfig.c
index 1e119e00..837720f0 100644
--- a/src/aticonfig.c
+++ b/src/aticonfig.c
@@ -471,10 +471,12 @@ ATIProcessOptions
pATI->Cursor = ATI_CURSOR_HARDWARE;
}
+ pATI->refclk = (int)ReferenceClock;
+
/* Only set the reference clock if it hasn't already been determined */
if (!pATI->ReferenceNumerator || !pATI->ReferenceDenominator)
{
- switch ((int)(ReferenceClock / ((double)100000.0)))
+ switch (pATI->refclk / 100000)
{
case 143:
pATI->ReferenceNumerator = 157500;
@@ -487,8 +489,7 @@ ATIProcessOptions
break;
default:
- pATI->ReferenceNumerator =
- (int)(ReferenceClock / ((double)1000.0));
+ pATI->ReferenceNumerator = pATI->refclk / 1000;
pATI->ReferenceDenominator = 1;
break;
}
diff --git a/src/atipreinit.c b/src/atipreinit.c
index 65c84eb5..f6b0ce48 100644
--- a/src/atipreinit.c
+++ b/src/atipreinit.c
@@ -148,7 +148,9 @@ ati_bios_clock
{
pATI->ProgrammableClock = BIOSByte(ClockTable);
pATI->ClockNumberToProgramme = BIOSByte(ClockTable + 0x06U);
- switch (BIOSWord(ClockTable + 0x08U) / 10)
+ pATI->refclk = BIOSWord(ClockTable + 0x08U);
+ pATI->refclk *= 10000;
+ switch (pATI->refclk / 100000)
{
case 143:
pATI->ReferenceNumerator = 157500;
@@ -161,8 +163,7 @@ ati_bios_clock
break;
default:
- pATI->ReferenceNumerator =
- BIOSWord(ClockTable + 0x08U) * 10;
+ pATI->ReferenceNumerator = pATI->refclk / 1000;
pATI->ReferenceDenominator = 1;
break;
}
diff --git a/src/atistruct.h b/src/atistruct.h
index 0db9486f..b9f4d08b 100644
--- a/src/atistruct.h
+++ b/src/atistruct.h
@@ -352,6 +352,7 @@ typedef struct _ATIRec
/*
* Clock-related definitions.
*/
+ int refclk;
int ClockNumberToProgramme, ReferenceNumerator, ReferenceDenominator;
int ProgrammableClock, maxClock;
ClockRec ClockDescriptor;