diff options
author | Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> | 2008-10-03 16:30:23 -0300 |
---|---|---|
committer | Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> | 2008-10-03 16:30:23 -0300 |
commit | da789f720e2d772dff92adc10aa024a6a921fbbd (patch) | |
tree | 46a03bd06b8e299b35d42bf95791428e0f3ab8c8 /src/smi_driver.c | |
parent | bacddd1d31a5f3de14477914958f27b6f081c125 (diff) |
Simplify regsmi.h by removing most unused SMI501 defines.
The values that should be used, should also have a more meaningful name,
as something like:
doesn't help much, and the fact that these "ports" can be accessed from
several "bases" may be confusing also, as there is SCRBase, DCRBase,
FPRBase, DPRBase, CPRBase (and IOBase). The 501 code should probably be
changed to just use IOBase, as currently it uses SCRBase, that happens
to be at pSmi->MapBase + 0x0000.
This patch also completely transforms the WaitQueue macro in a noop
for the MSOC. In SMI sample code it is almost the current code, just
that the macro body is commented out. Hopefully this will be addressed
soon.
Diffstat (limited to 'src/smi_driver.c')
-rw-r--r-- | src/smi_driver.c | 36 |
1 files changed, 16 insertions, 20 deletions
diff --git a/src/smi_driver.c b/src/smi_driver.c index 5e1c37b..5730550 100644 --- a/src/smi_driver.c +++ b/src/smi_driver.c @@ -2427,19 +2427,17 @@ SMI_InternalScreenInit(int scrnIndex, ScreenPtr pScreen) pSmi->saveBufferSize = pSmi->ShadowWidthBytes * pSmi->ShadowHeight; pSmi->FBReserved -= pSmi->saveBufferSize; pSmi->FBReserved &= ~0x15; - WRITE_VPR(pSmi, IS_MSOC(pSmi) && pSmi->IsSecondary ? - DCR204 : DCR0C, (pSmi->FBOffset = pSmi->FBReserved) >> 3); - if (pSmi->Chipset == SMI_COUGAR3DR) { + if (!IS_MSOC(pSmi)) + WRITE_VPR(pSmi, 0x0c, (pSmi->FBOffset = pSmi->FBReserved) >> 3); + + if (pSmi->Chipset == SMI_COUGAR3DR) WRITE_FPR(pSmi, FPR0C, (pSmi->FBOffset = pSmi->FBReserved) >> 3); - } else if (IS_MSOC(pSmi)) { - if (pSmi->IsSecondary) { - WRITE_DCR(pSmi, DCR204, pSmi->FBOffset); - } - else { - WRITE_DCR(pSmi, DCR0C, pSmi->FBOffset); - } + if (pSmi->IsSecondary) + WRITE_DCR(pSmi, 0x0204, pSmi->FBOffset); + else + WRITE_DCR(pSmi, 0x000c, pSmi->FBOffset); } pScrn->fbOffset = pSmi->FBOffset + pSmi->fbMapOffset; @@ -2477,12 +2475,12 @@ SMI_InternalScreenInit(int scrnIndex, ScreenPtr pScreen) if (IS_MSOC(pSmi) && pScrn->bitsPerPixel == 8) { /* Initialize Palette entries 0 and 1, they don't seem to get hit */ if (pSmi->IsSecondary) { - WRITE_DCR (pSmi, DCR400 + 0, 0x00000000); /* CRT Palette */ - WRITE_DCR (pSmi, DCR400 + 4, 0x00FFFFFF); /* CRT Palette */ + WRITE_DCR(pSmi, 0x0400 + 0, 0x00000000); /* CRT Palette */ + WRITE_DCR(pSmi, 0x0400 + 4, 0x00FFFFFF); /* CRT Palette */ } else { - WRITE_DCR (pSmi, DCR800 + 0, 0x00000000); /* Panel Palette */ - WRITE_DCR (pSmi, DCR800 + 4, 0x00FFFFFF); /* Panel Palette */ + WRITE_DCR(pSmi, 0x0800 + 0, 0x00000000); /* Panel Palette */ + WRITE_DCR(pSmi, 0x0800 + 4, 0x00FFFFFF); /* Panel Palette */ } } @@ -3172,12 +3170,10 @@ SMI_AdjustFrame(int scrnIndex, int x, int y, int flags) #endif } else if (IS_MSOC(pSmi)) { - if (!pSmi->IsSecondary) { - WRITE_DCR(pSmi, DCR204, Base); - } - else { - WRITE_DCR(pSmi, DCR0C, 0); - } + if (!pSmi->IsSecondary) + WRITE_DCR(pSmi, 0x0204, Base); + else + WRITE_DCR(pSmi, 0x000C, 0); } else { Base = (Base + 7) & ~7; |