summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/regsmi.h139
-rw-r--r--src/smi_accel.c6
-rw-r--r--src/smi_driver.c36
-rw-r--r--src/smi_hwcurs.c50
-rw-r--r--src/smi_video.c51
5 files changed, 77 insertions, 205 deletions
diff --git a/src/regsmi.h b/src/regsmi.h
index e359de9..bdf4035 100644
--- a/src/regsmi.h
+++ b/src/regsmi.h
@@ -198,11 +198,11 @@ VGAOUT8(SMIPtr pSmi, int port, CARD8 data)
#define ENGINE_IDLE() \
(IS_MSOC(pSmi) ? \
- (READ_SCR(pSmi, SCR00) & 0x00080000) == 0 : \
+ (READ_SCR(pSmi, 0x0000) & 0x00080000) == 0 : \
(VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x16) & 0x08) == 0)
#define FIFO_EMPTY() \
(IS_MSOC(pSmi) ? \
- READ_SCR(pSmi, SCR00) & 0x00100000 : \
+ READ_SCR(pSmi, 0x0000) & 0x00100000 : \
VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x16) & 0x10)
/* Wait until "v" queue entries are free */
@@ -211,14 +211,17 @@ VGAOUT8(SMIPtr pSmi, int port, CARD8 data)
**** pSmi->PCIRetry defaults to false (but on smi sources this
**** macro is a noop and will get stuck on engine reset timeouts if enabled...)
***/
-#define WaitQueue(v) \
- do { \
- if (!IS_MSOC(pSmi) && !pSmi->PCIRetry) { \
- int loop = MAXLOOP; mem_barrier(); \
- while (!FIFO_EMPTY()) \
- if (loop-- == 0) break; \
- if (loop <= 0) SMI_GEReset(pScrn, 1, __LINE__, __FILE__); \
- } \
+#define WaitQueue(v) \
+ do { \
+ if (!IS_MSOC(pSmi)) { \
+ int loop = MAXLOOP; \
+ \
+ mem_barrier(); \
+ while (!FIFO_EMPTY()) \
+ if (loop-- <= 0) \
+ break; \
+ if (loop <= 0) SMI_GEReset(pScrn, 1, __LINE__, __FILE__); \
+ } \
} while (0)
/* Wait until GP is idle */
@@ -293,122 +296,6 @@ VGAOUT8(SMIPtr pSmi, int port, CARD8 data)
#define FPR15C_MASK_HWCADDREN 0xFFFF0000
#define FPR15C_MASK_HWCENABLE 0x80000000
-/* SM501 System Configuration Registers */
-#define SCR00 0x0000
-#define SCR04 0x0004
-#define SCR08 0x0008
-#define SCR0C 0x000C
-#define SCR10 0x0010
-#define SCR10_LOCAL_MEM_SIZE 0x0000E000
-#define SCR10_LOCAL_MEM_SIZE_SHIFT 13
-#define SCR14 0x0014
-#define SCR18 0x0018
-#define SCR1C 0x001C
-#define SCR20 0x0020
-#define SCR24 0x0024
-#define SCR28 0x0028
-#define SCR2C 0x002C
-#define SCR30 0x0030
-#define SCR34 0x0034
-#define SCR38 0x0038
-#define SCR3C 0x003C
-#define SCR40 0x0040
-#define SCR44 0x0044
-#define SCR48 0x0048
-#define SCR4C 0x004C
-#define SCR50 0x0050
-#define SCR54 0x0054
-#define SCR58 0x0058
-#define SCR5C 0x005C
-#define SCR60 0x0060
-#define SCR64 0x0064
-#define SCR68 0x0068
-#define SCR6C 0x006C
-
-/* SM501 Panel Graphics Control */
-#define DCR00 0x0000
-#define DCR04 0x0004
-#define DCR08 0x0008
-#define DCR0C 0x000C
-#define DCR10 0x0010
-#define DCR14 0x0014
-#define DCR18 0x0018
-#define DCR1C 0x001C
-#define DCR20 0x0020
-#define DCR24 0x0024
-#define DCR28 0x0028
-#define DCR2c 0x002c
-#define DCR30 0x0030
-#define DCR34 0x0034
-
-/* SM 501 Video Control */
-#define DCR40 0x0040
-#define DCR44 0x0044
-#define DCR48 0x0048
-#define DCR4C 0x004C
-#define DCR50 0x0050
-#define DCR54 0x0054
-#define DCR58 0x0058
-#define DCR5C 0x005C
-#define DCR60 0x0060
-#define DCR64 0x0064
-#define DCR68 0x0068
-
-/* SM501 Video Alpha Control */
-#define DCR80 0x0080
-#define DCR84 0x0084
-#define DCR88 0x0088
-#define DCR8C 0x008C
-#define DCR90 0x0090
-#define DCR94 0x0094
-#define DCR98 0x0098
-#define DCR9C 0x009C
-#define DCRA0 0x00A0
-#define DCRA4 0x00A4
-
-/* SM501 Panel Cursor Control */
-#define DCRF0 0x00F0
-#define DCRF4 0x00F4
-#define DCRF8 0x00F8
-#define DCRFC 0x00FC
-
-/* SM 501 Alpha Control */
-#define DCR100 0x0100
-#define DCR104 0x0104
-#define DCR108 0x0108
-#define DCR10C 0x010C
-#define DCR110 0x0110
-#define DCR114 0x0114
-#define DCR118 0x0118
-
-/* SM 501 CRT Graphics Control */
-#define DCR200 0x0200
-#define DCR200_CRT_BLANK 0x00000400
-#define DCR200_CRT_GRAPHICS_PLN_FMT 0x00000003
-#define CRT_GRAPHICS_PLN_FMT_8 0x00
-#define CRT_GRAPHICS_PLN_FMT_16 0x01
-#define CRT_GRAPHICS_PLN_FMT_32 0x10
-#define DCR204 0x0204
-#define DCR208 0x0208
-#define DCR20C 0x020C
-#define DCR210 0x0210
-#define DCR214 0x0214
-#define DCR218 0x0218
-#define DCR21C 0x021C
-#define DCR220 0x0220
-#define DCR224 0x0224
-
-/* SM 501 CRT Cursor Control */
-#define DCR230 0x0230
-#define DCR234 0x0234
-#define DCR238 0x0238
-#define DCR23C 0x023C
-
-/* SM 501 Palette Ram */
-#define DCR400 0x0400 /* Panel */
-#define DCR800 0x0800 /* Video */
-#define DCRC00 0x0C00 /* CRT */
-
/* HWCursor definitons for Panel AND CRT */
#define SMI501_MASK_HWCENABLE 0x80000000
#define SMI501_MASK_MAXBITS 0x000007FF
diff --git a/src/smi_accel.c b/src/smi_accel.c
index 0862692..7395afa 100644
--- a/src/smi_accel.c
+++ b/src/smi_accel.c
@@ -52,9 +52,9 @@ SMI_GEReset(ScrnInfoPtr pScrn, int from_timeout, int line, char *file)
}
if (IS_MSOC(pSmi)) {
- iTempVal = READ_SCR(pSmi, SCR00) & ~0x00003000;
- WRITE_SCR (pSmi, SCR00, iTempVal | 0x00003000);
- WRITE_SCR (pSmi, SCR00, iTempVal);
+ iTempVal = READ_SCR(pSmi, 0x0000) & ~0x00003000;
+ WRITE_SCR(pSmi, 0x0000, iTempVal | 0x00003000);
+ WRITE_SCR(pSmi, 0x0000, iTempVal);
}
else {
tmp = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x15);
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;
diff --git a/src/smi_hwcurs.c b/src/smi_hwcurs.c
index 290f47a..a2213bb 100644
--- a/src/smi_hwcurs.c
+++ b/src/smi_hwcurs.c
@@ -341,14 +341,14 @@ SMI_LoadCursorImage(ScrnInfoPtr pScrn, unsigned char *src)
/* Write address, disabling the HW cursor */
if (!pSmi->IsSecondary) {
/* Panel HWC Addr */
- WRITE_DCR(pSmi, DCRF0, pSmi->FBCursorOffset);
+ WRITE_DCR(pSmi, 0x00f0, pSmi->FBCursorOffset);
xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, VERBLEV,
"Primary FBCursorOffset at 0x%08X\n",
(unsigned int)pSmi->FBCursorOffset);
}
else {
/* CRT HWC Addr */
- WRITE_DCR(pSmi, DCR230, pSmi->videoRAMBytes + pSmi->FBCursorOffset);
+ WRITE_DCR(pSmi, 0x0230, pSmi->videoRAMBytes + pSmi->FBCursorOffset);
xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, VERBLEV,
"Secondary FBCursorOffset at 0x%08X\n",
(unsigned int)pSmi->FBCursorOffset);
@@ -393,14 +393,14 @@ SMI_ShowCursor(ScrnInfoPtr pScrn)
CARD32 uiCrtTmp;
if (!pSmi->IsSecondary) {
- uiPanelTmp = READ_DCR(pSmi, DCRF0);
+ uiPanelTmp = READ_DCR(pSmi, 0x00f0);
uiPanelTmp |= SMI501_MASK_HWCENABLE;
- WRITE_DCR(pSmi, DCRF0, uiPanelTmp);
+ WRITE_DCR(pSmi, 0x00f0, uiPanelTmp);
}
else {
- uiCrtTmp = READ_DCR(pSmi, DCR230);
+ uiCrtTmp = READ_DCR(pSmi, 0x0230);
uiCrtTmp |= SMI501_MASK_HWCENABLE;
- WRITE_DCR(pSmi, DCR230, uiCrtTmp);
+ WRITE_DCR(pSmi, 0x0230, uiCrtTmp);
}
}
else {
@@ -436,14 +436,14 @@ SMI_HideCursor(ScrnInfoPtr pScrn)
CARD32 uiCrtTmp;
if (!pSmi->IsSecondary) {
- uiPanelTmp = READ_DCR (pSmi, DCRF0);
+ uiPanelTmp = READ_DCR(pSmi, 0x00f0);
uiPanelTmp &= ~SMI501_MASK_HWCENABLE;
- WRITE_DCR(pSmi, DCRF0, uiPanelTmp);
+ WRITE_DCR(pSmi, 0x00f0, uiPanelTmp);
}
else {
- uiCrtTmp = READ_DCR (pSmi, DCR230);
+ uiCrtTmp = READ_DCR(pSmi, 0x0230);
uiCrtTmp &= ~SMI501_MASK_HWCENABLE;
- WRITE_DCR(pSmi, DCR230, uiCrtTmp);
+ WRITE_DCR(pSmi, 0x0230, uiCrtTmp);
}
}
else {
@@ -507,12 +507,10 @@ SMI_SetCursorPosition(ScrnInfoPtr pScrn, int x, int y)
SMI501_MASK_BOUNDARY) << 16;
/* Program combined coordinates */
- if (!pSmi->IsSecondary) {
- WRITE_DCR (pSmi, DCRF4, hwcLocVal); /* Panel HWC Location */
- }
- else {
- WRITE_DCR (pSmi, DCR234, hwcLocVal); /* CRT HWC Location */
- }
+ if (!pSmi->IsSecondary)
+ WRITE_DCR(pSmi, 0x00f4, hwcLocVal); /* Panel HWC Location */
+ else
+ WRITE_DCR(pSmi, 0x0234, hwcLocVal); /* CRT HWC Location */
}
else {
if (xoff >= 0) {
@@ -591,22 +589,18 @@ SMI_SetCursorColors(ScrnInfoPtr pScrn, int bg, int fg)
packedFGBG |= (bg & 0xF80000) << 8
| (bg & 0x00FC00) << 11 | (bg & 0x0000F8) << 13;
- if (!pSmi->IsSecondary) {
- WRITE_DCR(pSmi, DCRF8, packedFGBG); /* Panel HWC Color 1,2 */
- }
- else {
- WRITE_DCR(pSmi, DCR238, packedFGBG); /* CRT HWC Color 1,2 */
- }
+ if (!pSmi->IsSecondary)
+ WRITE_DCR(pSmi, 0x00f8, packedFGBG); /* Panel HWC Color 1,2 */
+ else
+ WRITE_DCR(pSmi, 0x0238, packedFGBG); /* CRT HWC Color 1,2 */
packedFGBG = (fg & 0xF80000) >> 8
| (fg & 0x00FC00) >> 5 | (fg & 0x0000F8) >> 3;
- if (!pSmi->IsSecondary) {
- WRITE_DCR(pSmi, DCRFC, packedFGBG); /* Panel HWC Color 3 */
- }
- else {
- WRITE_DCR(pSmi, DCR23C, packedFGBG); /* CRT HWC Color 3 */
- }
+ if (!pSmi->IsSecondary)
+ WRITE_DCR(pSmi, 0x00fc, packedFGBG); /* Panel HWC Color 3 */
+ else
+ WRITE_DCR(pSmi, 0x023c, packedFGBG); /* CRT HWC Color 3 */
}
else {
/* Pack the true color into 8 bit */
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 */