summaryrefslogtreecommitdiff
path: root/src/smi_driver.c
diff options
context:
space:
mode:
authorPaulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>2008-10-14 14:48:42 -0300
committerPaulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>2008-10-14 14:48:42 -0300
commit5adb3b502ef79827b89fb11926b6198c3a57d2e6 (patch)
tree024233a276e8f1f91762259c4a7fc3768478e4e8 /src/smi_driver.c
parent6e0837305533f940adb7a09f9b013077c0888f2d (diff)
Minor corrections for smi501 for the randr1.2 integration.
Also correct printing information about MCLK in the smi501/502, it should print M2CLK (aka M1CLK o the 502) as it is the clock that controls video engine/memory.
Diffstat (limited to 'src/smi_driver.c')
-rw-r--r--src/smi_driver.c26
1 files changed, 22 insertions, 4 deletions
diff --git a/src/smi_driver.c b/src/smi_driver.c
index 61077c7..321a8ab 100644
--- a/src/smi_driver.c
+++ b/src/smi_driver.c
@@ -839,7 +839,25 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags)
pSmi->Dualhead = FALSE;
- if (!IS_MSOC(pSmi)){
+ if (IS_MSOC(pSmi)) {
+ pSmi->pEnt = xf86GetEntityInfo(pScrn->entityList[pScrn->numEntities - 1]);
+
+ /* FIXME this assumes the first head is always lcd and second
+ * always crt */
+ pSmi->IsSecondary = FALSE;
+ pSmi->lcd = TRUE;
+
+ if (xf86IsEntityShared(pSmi->pEnt->index)) {
+ pSmi->Dualhead = TRUE;
+ if (xf86IsPrimInitDone(pSmi->pEnt->index)) {
+ pSmi->IsSecondary = TRUE;
+ pSmi->lcd = FALSE;
+ }
+ else
+ xf86SetPrimInitDone(pSmi->pEnt->index);
+ }
+ }
+ else {
if (SMI_LYNXM_SERIES(pSmi->Chipset) &&
xf86ReturnOptValBool(pSmi->Options, OPTION_DUALHEAD, FALSE))
pSmi->Dualhead = TRUE;
@@ -1243,9 +1261,9 @@ SMI_DetectMCLK(ScrnInfoPtr pScrn)
/* FIXME this should just read smi_501.h's bitfields... */
clock = READ_SCR(pSmi, CURRENT_CLOCK);
- shift = (clock >> 8) & ((1 << 3) - 1);
- divider = (clock >> 11) & 1 ? 3 : 1;
- clock = clock & (1 << 12) ? 336 : 288;
+ shift = clock & ((1 << 3) - 1);
+ divider = (clock >> 3) & 1 ? 3 : 1;
+ clock = clock & (1 << 4) ? 336 : 288;
mclk = (clock / (divider << shift)) * 1000;
}
else {