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_video.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_video.c')
-rw-r--r-- | src/smi_video.c | 51 |
1 files changed, 23 insertions, 28 deletions
diff --git a/src/smi_video.c b/src/smi_video.c index a811086..a2ce2bc 100644 --- a/src/smi_video.c +++ b/src/smi_video.c @@ -1376,14 +1376,12 @@ SMI_StopVideo( if (shutdown) { if (pPort->videoStatus & CLIENT_VIDEO_ON) { - if (pSmi->Chipset == SMI_COUGAR3DR) { + if (pSmi->Chipset == SMI_COUGAR3DR) WRITE_FPR(pSmi, FPR00, READ_FPR(pSmi, 0x00) & ~(FPR00_VWIENABLE)); - } - else if (IS_MSOC(pSmi)) { - WRITE_DCR(pSmi, DCR40, READ_DCR (pSmi, DCR40) & ~0x00000004); - } else { + else if (IS_MSOC(pSmi)) + WRITE_DCR(pSmi, 0x0040, READ_DCR(pSmi, 0x0040) & ~0x00000004); + else WRITE_VPR(pSmi, 0x00, READ_VPR(pSmi, 0x00) & ~0x01000008); - } #if SMI_USE_CAPTURE if (!IS_MSOC(pSmi) && pSmi->Chipset != SMI_COUGAR3DR) { WRITE_CPR(pSmi, 0x00, READ_CPR(pSmi, 0x00) & ~0x00000001); @@ -1997,7 +1995,7 @@ SMI_DisplayVideo0501(ScrnInfoPtr pScrn, ENTER(); - dcr40 = READ_DCR(pSmi, DCR40) & ~0x00003FFF; + dcr40 = READ_DCR(pSmi, 0x0040) & ~0x00003FFF; switch (id) { case FOURCC_YV12: @@ -2041,18 +2039,18 @@ SMI_DisplayVideo0501(ScrnInfoPtr pScrn, /* Set Color Key Enable bit */ - WRITE_DCR(pSmi, DCR00, READ_DCR(pSmi, DCR00) | (1 << 9)); - WRITE_DCR(pSmi, DCR50, dstBox->x1 | (dstBox->y1 << 16)); - WRITE_DCR(pSmi, DCR54, dstBox->x2 | (dstBox->y2 << 16)); - WRITE_DCR(pSmi, DCR44, offset); + WRITE_DCR(pSmi, 0x0000, READ_DCR(pSmi, 0x0000) | (1 << 9)); + WRITE_DCR(pSmi, 0x0050, dstBox->x1 | (dstBox->y1 << 16)); + WRITE_DCR(pSmi, 0x0054, dstBox->x2 | (dstBox->y2 << 16)); + WRITE_DCR(pSmi, 0x0044, offset); - WRITE_DCR(pSmi, DCR48, pitch | (pitch << 16)); - WRITE_DCR(pSmi, DCR4C, offset + (pitch * height)); - WRITE_DCR(pSmi, DCR58, (vstretch << 16) | hstretch); - WRITE_DCR(pSmi, DCR5C, 0x00000000); - WRITE_DCR(pSmi, DCR60, 0x00EDEDED); + WRITE_DCR(pSmi, 0x0048, pitch | (pitch << 16)); + WRITE_DCR(pSmi, 0x004C, offset + (pitch * height)); + WRITE_DCR(pSmi, 0x0058, (vstretch << 16) | hstretch); + WRITE_DCR(pSmi, 0x005C, 0x00000000); + WRITE_DCR(pSmi, 0x0060, 0x00EDEDED); - WRITE_DCR(pSmi, DCR40, dcr40 | (1 << 2)); + WRITE_DCR(pSmi, 0x0040, dcr40 | (1 << 2)); LEAVE(); } @@ -2153,11 +2151,10 @@ SMI_BlockHandler( if (pSmi->Chipset == SMI_COUGAR3DR) { WRITE_FPR(pSmi, FPR00, READ_FPR(pSmi, 0x00) & ~(FPR00_VWIENABLE)); } - else if (IS_MSOC(pSmi)) { - WRITE_DCR(pSmi, DCR40, READ_DCR(pSmi, DCR40) & ~0x00000004); - } else { + else if (IS_MSOC(pSmi)) + WRITE_DCR(pSmi, 0x0040, READ_DCR(pSmi, 0x0040) & ~0x00000004); + else WRITE_VPR(pSmi, 0x00, READ_VPR(pSmi, 0x00) & ~0x00000008); - } pPort->videoStatus = FREE_TIMER; pPort->freeTime = currentTime.milliseconds + FREE_DELAY; } @@ -2591,19 +2588,17 @@ SMI_SetSurfaceAttribute( static void SetKeyReg(SMIPtr pSmi, int reg, int value) { - if (pSmi->Chipset == SMI_COUGAR3DR) { + if (pSmi->Chipset == SMI_COUGAR3DR) WRITE_FPR(pSmi, reg, value); - } else if (IS_MSOC(pSmi)) { /* We don't change the color mask, and we don't do brightness. IF * they write to the colorkey register, we'll write the value to the * 501 colorkey register */ - if (FPR04 == reg) { /* Only act on colorkey value writes */ - WRITE_DCR (pSmi, DCR08, value); /* ColorKey register is DCR08 */ - } - } else { - WRITE_VPR(pSmi, reg, value); + if (FPR04 == reg) /* Only act on colorkey value writes */ + WRITE_DCR(pSmi, 0x0008, value);/* ColorKey register is DCR08 */ } + else + WRITE_VPR(pSmi, reg, value); } #else /* SMI_USE_VIDEO */ |