summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Sapountzis <gsap7@yahoo.gr>2006-11-20 20:38:59 +0200
committerGeorge Sapountzis <gsap7@yahoo.gr>2007-01-21 19:42:15 +0200
commit0a65e93d1a9c1ee5004bc98e8aa0c1e4cdc29293 (patch)
treed121eb6234491fc0839644f2c9874a219c1e23bd
parentdf42a7a27d916c3bf8618c1c467244d540d0d3df (diff)
We always use the accelerator CRTC within the xserver.
- cull (pATI->NewHW.crtc != ATI_CRTC_MACH64).
-rw-r--r--src/atiadjust.c59
-rw-r--r--src/aticlock.c58
-rw-r--r--src/aticonsole.c16
-rw-r--r--src/atidac.c111
-rw-r--r--src/atidsp.c23
-rw-r--r--src/atimach64cursor.c15
-rw-r--r--src/ativalid.c44
7 files changed, 41 insertions, 285 deletions
diff --git a/src/atiadjust.c b/src/atiadjust.c
index dfbd2102..f01fee69 100644
--- a/src/atiadjust.c
+++ b/src/atiadjust.c
@@ -27,7 +27,6 @@
#include "ati.h"
#include "atiadjust.h"
#include "atichip.h"
-#include "aticrtc.h"
#include "atilock.h"
#include "atimach64io.h"
#include "atiwonderio.h"
@@ -65,35 +64,8 @@ ATIAdjustPreInit
1);
}
- switch (pATI->NewHW.crtc)
{
-
-#ifndef AVOID_CPIO
-
- case ATI_CRTC_VGA:
- if (pATI->Chip >= ATI_CHIP_264CT)
- {
- pATI->AdjustMaxBase = MaxBits(CRTC_OFFSET_VGA) << 2;
- }
- else if (!pATI->CPIO_VGAWonder)
- {
- pATI->AdjustMaxBase = 0xFFFFU << 3;
- }
- else /* Mach32 & Mach64 */
- {
- pATI->AdjustMaxBase = 0x0FFFFFU << 3;
- }
- break;
-
-#endif /* AVOID_CPIO */
-
- case ATI_CRTC_MACH64:
pATI->AdjustMaxBase = MaxBits(CRTC_OFFSET) << 3;
- break;
-
- default:
- pATI->AdjustMaxBase = 0;
- break;
}
MaxBase = (pATI->AdjustMaxBase / (unsigned long)pATI->AdjustDepth) |
@@ -155,38 +127,7 @@ ATIAdjustFrame
/* Unlock registers */
ATIUnlock(pATI);
-#ifndef AVOID_CPIO
-
- if ((pATI->NewHW.crtc == ATI_CRTC_VGA) && (pATI->Chip < ATI_CHIP_264CT))
- {
- PutReg(CRTX(pATI->CPIO_VGABase), 0x0CU, GetByte(Base, 1));
- PutReg(CRTX(pATI->CPIO_VGABase), 0x0DU, GetByte(Base, 0));
-
- if (pATI->CPIO_VGAWonder)
- {
- ATIModifyExtReg(pATI, 0xB0U, -1, 0xBFU, Base >> 10);
- ATIModifyExtReg(pATI, 0xA3U, -1, 0xEFU, Base >> 13);
-
- /*
- * I don't know if this also applies to Mach64's, but give it a
- * shot...
- */
- ATIModifyExtReg(pATI, 0xADU, -1, 0xF3U, Base >> 16);
- }
- }
- else
-
-#endif /* AVOID_CPIO */
-
{
-
-#ifndef AVOID_CPIO
-
- if (pATI->NewHW.crtc == ATI_CRTC_VGA)
- Base <<= 1; /* LSBit must be zero */
-
-#endif /* AVOID_CPIO */
-
outr(CRTC_OFF_PITCH, SetBits(pATI->displayWidth >> 3, CRTC_PITCH) |
SetBits(Base, CRTC_OFFSET));
}
diff --git a/src/aticlock.c b/src/aticlock.c
index f5bfbbaa..05c3a6d5 100644
--- a/src/aticlock.c
+++ b/src/aticlock.c
@@ -564,18 +564,6 @@ ATIClockPreInit
pScreenInfo->progClock = TRUE;
/* Set internal clock ordering */
-
-#ifndef AVOID_CPIO
-
- if (pATI->NewHW.crtc == ATI_CRTC_VGA)
- {
- pATI->NewHW.ClockMap = ATIVGAProgrammableClockMap;
- pATI->NewHW.ClockUnmap = ATIVGAProgrammableClockUnmap;
- }
- else
-
-#endif /* AVOID_CPIO */
-
{
pATI->NewHW.ClockMap = ATIProgrammableClockMap;
pATI->NewHW.ClockUnmap = ATIProgrammableClockUnmap;
@@ -654,18 +642,6 @@ ProbeClocks:
* When selecting clocks, all ATI accelerators use a different
* clock ordering.
*/
-
-#ifndef AVOID_CPIO
-
- if (pATI->NewHW.crtc == ATI_CRTC_VGA)
- {
- pATI->NewHW.ClockMap = ATIMachVGAClockMap;
- pATI->NewHW.ClockUnmap = ATIMachVGAClockUnmap;
- }
- else
-
-#endif /* AVOID_CPIO */
-
{
pATI->NewHW.ClockMap = ATIAcceleratorClockMap;
pATI->NewHW.ClockUnmap = ATIAcceleratorClockUnmap;
@@ -1275,43 +1251,9 @@ ATIClockCalculate
pATIHW->clock = ClockSelect; /* Save pre-map clock number */
ClockSelect = MapClockIndex(pATIHW->ClockMap, ClockSelect);
- switch (pATIHW->crtc)
{
-
-#ifndef AVOID_CPIO
-
- case ATI_CRTC_VGA:
- pATIHW->genmo = (pATIHW->genmo & 0xF3U) |
- ((ClockSelect << 2) & 0x0CU);
-
- if (pATI->CPIO_VGAWonder)
- {
- /* Set ATI clock select bits */
- {
- pATIHW->be = (pATIHW->be & 0xEFU) |
- ((ClockSelect << 2) & 0x10U);
- {
- ClockSelect >>= 1;
- pATIHW->b9 = (pATIHW->b9 & 0xFDU) |
- ((ClockSelect >> 1) & 0x02U);
- }
- }
-
- /* Set clock divider bits */
- pATIHW->b8 = (pATIHW->b8 & 0x3FU) |
- ((ClockSelect << 3) & 0xC0U);
- }
- break;
-
-#endif /* AVOID_CPIO */
-
- case ATI_CRTC_MACH64:
pATIHW->clock_cntl = CLOCK_STROBE |
SetBits(ClockSelect, CLOCK_SELECT | CLOCK_DIVIDER);
- break;
-
- default:
- break;
}
return TRUE;
diff --git a/src/aticonsole.c b/src/aticonsole.c
index a264c253..6d0c662a 100644
--- a/src/aticonsole.c
+++ b/src/aticonsole.c
@@ -30,7 +30,6 @@
#include "ati.h"
#include "aticonsole.h"
-#include "aticrtc.h"
#include "atii2c.h"
#include "atilock.h"
#include "atimach64.h"
@@ -85,23 +84,8 @@ ATISaveScreen
return TRUE;
pATI = ATIPTR(pScreenInfo);
- switch (pATI->NewHW.crtc)
{
-
-#ifndef AVOID_CPIO
-
- case ATI_CRTC_VGA:
- ATIVGASaveScreen(pATI, Mode);
- break;
-
-#endif /* AVOID_CPIO */
-
- case ATI_CRTC_MACH64:
ATIMach64SaveScreen(pATI, Mode);
- break;
-
- default:
- break;
}
return TRUE;
diff --git a/src/atidac.c b/src/atidac.c
index 31533774..f94e8ad7 100644
--- a/src/atidac.c
+++ b/src/atidac.c
@@ -185,20 +185,6 @@ ATIDACPreInit
pATIHW->lut[Index2 + 1] = 0x00U;
pATIHW->lut[Index2 + 2] = maxColour;
}
-
-#ifndef AVOID_CPIO
-
- if (pATIHW->crtc == ATI_CRTC_VGA)
- {
- /* Initialise overscan to black */
- Index = pATIHW->attr[17] * 3;
- pATIHW->lut[Index + 0] =
- pATIHW->lut[Index + 1] =
- pATIHW->lut[Index + 2] = 0x00U;
- }
-
-#endif /* AVOID_CPIO */
-
}
}
@@ -334,6 +320,44 @@ ATIDACSet
}
/*
+ * ATISetLUTEntry --
+ *
+ * This function is called to set one of a DAC's LUT entries.
+ */
+static void
+ATISetLUTEntry
+(
+ ATIPtr pATI,
+ int Index,
+ CARD8 *LUTEntry
+)
+{
+#ifdef AVOID_CPIO
+
+ out8(M64_DAC_WRITE, Index);
+ DACDelay;
+ out8(M64_DAC_DATA, LUTEntry[0]);
+ DACDelay;
+ out8(M64_DAC_DATA, LUTEntry[1]);
+ DACDelay;
+ out8(M64_DAC_DATA, LUTEntry[2]);
+ DACDelay;
+
+#else /* AVOID_CPIO */
+
+ outb(pATI->CPIO_DAC_WRITE, Index);
+ DACDelay;
+ outb(pATI->CPIO_DAC_DATA, LUTEntry[0]);
+ DACDelay;
+ outb(pATI->CPIO_DAC_DATA, LUTEntry[1]);
+ DACDelay;
+ outb(pATI->CPIO_DAC_DATA, LUTEntry[2]);
+ DACDelay;
+
+#endif /* AVOID_CPIO */
+}
+
+/*
* ATILoadPalette --
*
* This function updates the RAMDAC's LUT and the in-memory copy of it in
@@ -414,35 +438,8 @@ ATILoadPalette
for (Index = 0;
Index < (SizeOf(pATI->NewHW.lut) / 3);
Index += i, LUTEntry += i * 3)
- {
- if (!fChanged[Index])
- continue;
-
-#ifdef AVOID_CPIO
-
- out8(M64_DAC_WRITE, Index);
- DACDelay;
- out8(M64_DAC_DATA, LUTEntry[0]);
- DACDelay;
- out8(M64_DAC_DATA, LUTEntry[1]);
- DACDelay;
- out8(M64_DAC_DATA, LUTEntry[2]);
- DACDelay;
-
-#else /* AVOID_CPIO */
-
- outb(pATI->CPIO_DAC_WRITE, Index);
- DACDelay;
- outb(pATI->CPIO_DAC_DATA, LUTEntry[0]);
- DACDelay;
- outb(pATI->CPIO_DAC_DATA, LUTEntry[1]);
- DACDelay;
- outb(pATI->CPIO_DAC_DATA, LUTEntry[2]);
- DACDelay;
-
-#endif /* AVOID_CPIO */
-
- }
+ if (fChanged[Index])
+ ATISetLUTEntry(pATI, Index, LUTEntry);
}
}
else
@@ -459,33 +456,7 @@ ATILoadPalette
LUTEntry[2] = Colours[Index].blue;
if (pScreenInfo->vtSema || pATI->currentMode)
- {
-
-#ifdef AVOID_CPIO
-
- out8(M64_DAC_WRITE, Index);
- DACDelay;
- out8(M64_DAC_DATA, LUTEntry[0]);
- DACDelay;
- out8(M64_DAC_DATA, LUTEntry[1]);
- DACDelay;
- out8(M64_DAC_DATA, LUTEntry[2]);
- DACDelay;
-
-#else /* AVOID_CPIO */
-
- outb(pATI->CPIO_DAC_WRITE, Index);
- DACDelay;
- outb(pATI->CPIO_DAC_DATA, LUTEntry[0]);
- DACDelay;
- outb(pATI->CPIO_DAC_DATA, LUTEntry[1]);
- DACDelay;
- outb(pATI->CPIO_DAC_DATA, LUTEntry[2]);
- DACDelay;
-
-#endif /* AVOID_CPIO */
-
- }
+ ATISetLUTEntry(pATI, Index, LUTEntry);
}
}
}
diff --git a/src/atidsp.c b/src/atidsp.c
index 8e8ddd96..adea2cdc 100644
--- a/src/atidsp.c
+++ b/src/atidsp.c
@@ -25,7 +25,6 @@
#endif
#include "ati.h"
#include "atichip.h"
-#include "aticrtc.h"
#include "atidsp.h"
#include "atimach64io.h"
#include "atividmem.h"
@@ -229,13 +228,6 @@ ATIDSPCalculate
/* Start by assuming a display FIFO width of 64 bits */
vshift = (6 - 2) - pATI->XCLKPostDivider;
-#ifndef AVOID_CPIO
-
- if (pATIHW->crtc == ATI_CRTC_VGA)
- vshift--; /* Nope, it's 32 bits wide */
-
-#endif /* AVOID_CPIO */
-
if (pATI->OptionPanelDisplay && (pATI->LCDPanelID >= 0))
{
/* Compensate for horizontal stretching */
@@ -263,21 +255,6 @@ ATIDSPCalculate
vshift, -1) - ATIDivide(1, 1, vshift - xshift, 1);
/* Next is dsp_on */
-
-#ifndef AVOID_CPIO
-
- if ((pATIHW->crtc == ATI_CRTC_VGA) /* && (dsp_precision < 3) */)
- {
- /*
- * TODO: I don't yet know why something like this appears necessary.
- * But I don't have time to explore this right now.
- */
- dsp_on = ATIDivide(Multiplier * 5, Divider, vshift + 2, 1);
- }
- else
-
-#endif /* AVOID_CPIO */
-
{
dsp_on = ATIDivide(Multiplier, Divider, vshift, 1);
tmp = ATIDivide(RASMultiplier, RASDivider, xshift, 1);
diff --git a/src/atimach64cursor.c b/src/atimach64cursor.c
index d1fb5fd0..be8ea111 100644
--- a/src/atimach64cursor.c
+++ b/src/atimach64cursor.c
@@ -25,7 +25,6 @@
#endif
#include "ati.h"
-#include "aticrtc.h"
#include "atimach64accel.h"
#include "atimach64cursor.h"
#include "atimach64io.h"
@@ -353,20 +352,6 @@ ATIMach64UseHWCursor
if (!pATI->CursorBase)
return FALSE;
-#ifndef AVOID_CPIO
-
- /*
- * For some reason, the hardware cursor isn't vertically scaled when a VGA
- * doublescanned or multiscanned mode is in effect.
- */
- if (pATI->NewHW.crtc == ATI_CRTC_MACH64)
- return TRUE;
- if ((pScreenInfo->currentMode->Flags & V_DBLSCAN) ||
- (pScreenInfo->currentMode->VScan > 1))
- return FALSE;
-
-#endif /* AVOID_CPIO */
-
return TRUE;
}
diff --git a/src/ativalid.c b/src/ativalid.c
index 74ffe059..8a92e82e 100644
--- a/src/ativalid.c
+++ b/src/ativalid.c
@@ -25,7 +25,6 @@
#endif
#include "atichip.h"
-#include "aticrtc.h"
#include "atistruct.h"
#include "ativalid.h"
@@ -49,12 +48,6 @@ ATIValidMode
ATIPtr pATI = ATIPTR(pScreenInfo);
int HBlankWidth, HAdjust, VScan, VInterlace;
-#ifndef AVOID_CPIO
-
- int VDisplay, VTotal;
-
-#endif /* AVOID_CPIO */
-
if (flags & MODECHECK_FINAL)
{
return MODE_OK;
@@ -159,46 +152,9 @@ ATIValidMode
if (!HBlankWidth)
return MODE_HBLANK_NARROW;
- switch (pATI->NewHW.crtc)
{
-
-#ifndef AVOID_CPIO
-
- case ATI_CRTC_VGA:
- /* Prevent overscans */
- if (HBlankWidth > 63)
- return MODE_HBLANK_WIDE;
-
- if (pMode->HDisplay > 2048)
- return MODE_BAD_HVALUE;
-
- if (VScan > 64)
- return MODE_BAD_VSCAN;
-
- VDisplay = pMode->VDisplay * VScan;
- VTotal = pMode->VTotal * VScan;
-
- if ((pMode->Flags & V_INTERLACE) && (pATI->Chip < ATI_CHIP_264CT))
- {
- VDisplay >>= 1;
- VTotal >>= 1;
- }
-
- if ((VDisplay > 2048) || (VTotal > 2050))
- return MODE_BAD_VVALUE;
-
- break;
-
-#endif /* AVOID_CPIO */
-
- case ATI_CRTC_MACH64:
if (VScan > 2)
return MODE_NO_VSCAN;
-
- break;
-
- default:
- break;
}
return MODE_OK;