summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancisco Jerez <currojerez@riseup.net>2009-05-27 01:23:36 +0200
committerFrancisco Jerez <currojerez@riseup.net>2009-05-27 01:23:36 +0200
commit536e5df957698251206326edc5a13e833f7c72b1 (patch)
treee7382a1ff5914b19f5e91e3473b72b9d4e935430
parent6a370fa2b6b8fcbd556dd6f9bf92872e9bea23e8 (diff)
Program MCLK/MXCLK on startup for a secondary SM502.
This should allow using a SM502 as secondary display device (bug 21810).
-rw-r--r--src/smi_driver.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/smi_driver.c b/src/smi_driver.c
index b788ed6..985563b 100644
--- a/src/smi_driver.c
+++ b/src/smi_driver.c
@@ -1250,10 +1250,21 @@ SMI_DetectMCLK(ScrnInfoPtr pScrn)
/* The SM712 can be safely clocked up to 157MHz, according to
Silicon Motion engineers. */
pSmi->MCLK = 157000;
- }else
- pSmi->MCLK = 0;
- pSmi->MXCLK = 0;
+ } else if (IS_MSOC(pSmi)) {
+ /* Set some sane defaults for the clock settings if we are on a
+ SM502 and it's likely to be uninitialized. */
+
+ if (!xf86IsPrimaryPci(pSmi->PciInfo) &&
+ (READ_SCR(pSmi, DEVICE_ID) & 0xFF) >= 0xC0) {
+ pSmi->MCLK = 112000;
+ pSmi->MXCLK = 144000;
+ }
+
+ } else {
+ pSmi->MCLK = 0;
+ pSmi->MXCLK = 0;
+ }
/* MCLK from user settings */
if (xf86GetOptValFreq(pSmi->Options, OPTION_MCLK, OPTUNITS_MHZ, &real)) {