summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--src/smi.h3
-rw-r--r--src/smi_driver.c49
3 files changed, 18 insertions, 41 deletions
diff --git a/ChangeLog b/ChangeLog
index e6c8681..57b7c97 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2006-02-08 Luc Verhaegen <libv@skynet.be>
+
+ * src/smi.h:
+ * src/smi_driver.c: (SMI_PreInit), (SMI_ModeInit):
+
+ Clean up insane pScrn->clock usage.
+
2005-12-20 Kevin E. Martin <kem-at-freedesktop-dot-org>
* configure.ac:
diff --git a/src/smi.h b/src/smi.h
index 0e5b552..8779309 100644
--- a/src/smi.h
+++ b/src/smi.h
@@ -151,9 +151,6 @@ typedef struct
vgaHWMapMem was used
successfully for
this screen */
- int dacSpeedBpp; /* Clock value */
- int minClock; /* Mimimum clock */
- int maxClock; /* Maximum clock */
int MCLK; /* Memory Clock */
int GEResetCnt; /* Limit the number of errors
printed using a counter */
diff --git a/src/smi_driver.c b/src/smi_driver.c
index 169a736..8284207 100644
--- a/src/smi_driver.c
+++ b/src/smi_driver.c
@@ -1066,40 +1066,6 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags)
pSmi->videoRAMKBytes);
}
- /* Lynx built-in ramdac speeds */
- pScrn->numClocks = 4;
-
- if ((pScrn->clock[3] <= 0) && (pScrn->clock[2] > 0))
- {
- pScrn->clock[3] = pScrn->clock[2];
- }
-
- if ((pSmi->Chipset == SMI_LYNX3DM) || (pSmi->Chipset == SMI_COUGAR3DR))
- {
- if (pScrn->clock[0] <= 0) pScrn->clock[0] = 200000;
- if (pScrn->clock[1] <= 0) pScrn->clock[1] = 200000;
- if (pScrn->clock[2] <= 0) pScrn->clock[2] = 200000;
- if (pScrn->clock[3] <= 0) pScrn->clock[3] = 200000;
- }
- else
- {
- if (pScrn->clock[0] <= 0) pScrn->clock[0] = 135000;
- if (pScrn->clock[1] <= 0) pScrn->clock[1] = 135000;
- if (pScrn->clock[2] <= 0) pScrn->clock[2] = 135000;
- if (pScrn->clock[3] <= 0) pScrn->clock[3] = 135000;
- }
-
- /* Now set RAMDAC limits */
- switch (pSmi->Chipset)
- {
- default:
- pSmi->minClock = 20000;
- pSmi->maxClock = 135000;
- break;
- }
- xf86ErrorFVerb(VERBLEV, "\tSMI_PreInit minClock=%d, maxClock=%d\n",
- pSmi->minClock, pSmi->maxClock);
-
/* Detect current MCLK and print it for user */
m = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x6A);
n = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x6B);
@@ -1133,8 +1099,13 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags)
*/
clockRanges = xnfcalloc(sizeof(ClockRange),1);
clockRanges->next = NULL;
- clockRanges->minClock = pSmi->minClock;
- clockRanges->maxClock = pSmi->maxClock;
+ clockRanges->minClock = 20000;
+
+ if ((pSmi->Chipset == SMI_LYNX3DM) || (pSmi->Chipset == SMI_COUGAR3DR))
+ clockRanges->maxClock = 200000;
+ else
+ clockRanges->maxClock = 135000;
+
clockRanges->clockIndex = -1;
clockRanges->interlaceAllowed = FALSE;
clockRanges->doubleScanAllowed = FALSE;
@@ -2641,8 +2612,10 @@ SMI_ModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
if (pSmi->MCLK > 0)
{
SMI_CommonCalcClock(pScrn->scrnIndex, pSmi->MCLK,
- 1, 1, 31, 0, 2, pSmi->minClock,
- pSmi->maxClock, &new->SR6A, &new->SR6B);
+ 1, 1, 31, 0, 2,
+ pScrn->clockRanges->minClock,
+ pScrn->clockRanges->maxClock,
+ &new->SR6A, &new->SR6B);
}
else
{