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-28 01:24:20 +0200
commit9b126f45db27496c1ad16db65a61fe641a018983 (patch)
treeb2b1aa10abfb1ce153bea711a447b187eb85fd8e
parent0abcb2b2c84a50e64bb6aa9e94760659ecf33add (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/atipreinit.c89
-rw-r--r--src/ativalid.c44
8 files changed, 44 insertions, 371 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 033b1e7d..140f21d0 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/atipreinit.c b/src/atipreinit.c
index 66ac44cf..35ca0e90 100644
--- a/src/atipreinit.c
+++ b/src/atipreinit.c
@@ -1270,7 +1270,7 @@ ATIPreInit
#ifndef AVOID_CPIO
/* Complain if VGA is needed but not there */
- if ((pATI->NewHW.crtc == ATI_CRTC_VGA) || !pATI->OptionLinear)
+ if (!pATI->OptionLinear)
{
/* VGA is required at this point */
if (!pATI->VGAAdapter)
@@ -1920,8 +1920,7 @@ ATIPreInit
{
pScreenInfo->videoRam = pATI->VideoRAM = VGAVideoRAM;
}
- else if ((pATI->NewHW.crtc == ATI_CRTC_MACH64) ||
- (pATI->Chip >= ATI_CHIP_264CT))
+ else
#endif /* AVOID_CPIO */
@@ -2197,38 +2196,6 @@ ATIPreInit
#ifndef AVOID_CPIO
- else
- /*
- * After BIOS initialisation, the accelerator (if any) and the VGA won't
- * necessarily agree on the amount of video memory, depending on whether or
- * where the memory boundary is configured. Any discrepancy will be
- * resolved by ATIModePreInit().
- *
- * However, it's possible that there is more video memory than VGA Wonder
- * can architecturally handle.
- */
- if ((AcceleratorVideoRAM < pScreenInfo->videoRam))
- {
- if (pATI->OptionDevel)
- {
- if (pATI->depth == 1)
- AcceleratorVideoRAM /= 4;
-
- xf86DrvMsg(pScreenInfo->scrnIndex, X_NOTICE,
- "Virtual resolutions requiring more than %d kB\n of video"
- " memory might not function correctly.\n",
- AcceleratorVideoRAM);
- }
- else
- {
- xf86DrvMsg(pScreenInfo->scrnIndex, X_NOTICE,
- "VideoRAM reduced to %d kB due to hardware limitations.\n",
- AcceleratorVideoRAM);
-
- pScreenInfo->videoRam = AcceleratorVideoRAM;
- }
- }
-
if (pATI->OptionLinear)
{
if (!pATI->LinearBase)
@@ -2281,7 +2248,7 @@ ATIPreInit
#ifndef AVOID_CPIO
- if (!pATI->Block0Base || (pATI->NewHW.crtc == ATI_CRTC_VGA))
+ if (!pATI->Block0Base)
{
xf86DrvMsg(pScreenInfo->scrnIndex, X_WARNING,
"Acceleration not supported in this configuration.\n");
@@ -2462,13 +2429,6 @@ ATIPreInit
i = (6 - 2) - pATI->XCLKPostDivider;
-#ifndef AVOID_CPIO
-
- if (pATI->NewHW.crtc == ATI_CRTC_VGA)
- i--;
-
-#endif /* AVOID_CPIO */
-
i = (ATIDivide(Numerator, Denominator, i, -1) / 1000) * 1000;
if (i < ATIClockRange.maxClock)
ATIClockRange.maxClock = i;
@@ -2540,17 +2500,6 @@ ATIPreInit
case ATI_DAC_IBMRGB514:
pATI->maxClock = 220000;
-
-#ifndef AVOID_CPIO
-
- if (pATI->NewHW.crtc == ATI_CRTC_VGA)
- {
- DefaultmaxClock = 100000;
- }
- else
-
-#endif /* AVOID_CPIO */
-
{
DefaultmaxClock = 220000;
}
@@ -2615,34 +2564,7 @@ ATIPreInit
pATI->pitchInc *= pATI->bitsPerPixel;
}
- switch (pATI->NewHW.crtc)
{
-
-#ifndef AVOID_CPIO
-
- case ATI_CRTC_VGA:
- pScreenInfo->maxHValue = (0xFFU + 1) << 3; /* max HTotal */
-
- /*
- * The maximum VTotal value set here applies to all modes,
- * including interlaced, doublescanned or multiscanned modes.
- * Finer-grained checks are done in ATIValidateMode().
- */
- pScreenInfo->maxVValue = 0x03FFU + 1;
- {
- pScreenInfo->maxVValue <<= 1;
- if (ATIClockRange.interlaceAllowed &&
- (pATI->Chip < ATI_CHIP_264CT))
- pScreenInfo->maxVValue <<= 1;
- }
-
- Strategy |= LOOKUP_CLKDIV2;
-
- break;
-
-#endif /* AVOID_CPIO */
-
- case ATI_CRTC_MACH64:
pScreenInfo->maxHValue = (MaxBits(CRTC_H_TOTAL) + 1) << 3;
if (pATI->Chip < ATI_CHIP_264VT)
@@ -2662,11 +2584,6 @@ ATIPreInit
pScreenInfo->maxVValue = MaxBits(CRTC_V_TOTAL) + 1;
maxPitch = MaxBits(CRTC_PITCH);
-
- break;
-
- default:
- break;
}
maxPitch *= minPitch;
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;