summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuc Verhaegen <libv@skynet.be>2006-03-19 17:09:44 +0000
committerLuc Verhaegen <libv@skynet.be>2006-03-19 17:09:44 +0000
commitc7745b77b5f6150415b38a5ae6c120a650afeb6c (patch)
treee17bae9462de5ad6d5abdcffe96c6663056feffa
parent105281ceb47173f1a68b67a54c2d7623b63d6f57 (diff)
pATI->Adapter is always ATI_ADAPTER_MACH64. If not, PreInit fails. So cull
pATI->Adapter.
-rw-r--r--ChangeLog21
-rw-r--r--src/atiaccel.c13
-rw-r--r--src/atibus.c4
-rw-r--r--src/aticlock.c109
-rw-r--r--src/aticonfig.c15
-rw-r--r--src/aticonsole.c27
-rw-r--r--src/aticursor.c18
-rw-r--r--src/atii2c.c20
-rw-r--r--src/atimode.c18
-rw-r--r--src/atipreinit.c697
-rw-r--r--src/atiprint.c25
-rw-r--r--src/atistruct.h5
-rw-r--r--src/ativalid.c6
-rw-r--r--src/ativga.c10
-rw-r--r--src/atixv.c23
15 files changed, 217 insertions, 794 deletions
diff --git a/ChangeLog b/ChangeLog
index b3cc2bc..5588472 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,26 @@
2006-03-19 Luc Verhaegen <libv@skynet.be>
+ * src/atiaccel.c: (ATIInitializeAcceleration):
+ * src/atibus.c: (ATIClaimResources):
+ * src/aticlock.c: (ATIMatchClockLine), (ATIClockPreInit),
+ (ATIClockCalculate):
+ * src/aticonfig.c: (ATIProcessOptions):
+ * src/aticonsole.c: (ATISetDPMSMode):
+ * src/aticursor.c: (ATIInitializeCursor):
+ * src/atii2c.c: (ATII2CPreInit):
+ * src/atimode.c: (ATIModeSave):
+ * src/atipreinit.c: (ATIMach64Detect), (ATIPreInit):
+ * src/atiprint.c: (ATIPrintRegisters):
+ * src/atistruct.h:
+ * src/ativalid.c: (ATIValidMode):
+ * src/ativga.c: (ATIVGAPreInit):
+ * src/atixv.c: (ATIXVInitializeAdaptor), (ATICloseXVideo):
+
+ pATI->Adapter is always ATI_ADAPTER_MACH64. If not, PreInit fails.
+ So cull pATI->Adapter.
+
+2006-03-19 Luc Verhaegen <libv@skynet.be>
+
* src/atipreinit.c: (Mach64BiosPanel), (Mach64BiosClock),
(Mach64BIOSParse), (Mach64PreInitGetClockInfo), (ATIPreInit):
diff --git a/src/atiaccel.c b/src/atiaccel.c
index 050019d..d94b816 100644
--- a/src/atiaccel.c
+++ b/src/atiaccel.c
@@ -49,20 +49,11 @@ ATIInitializeAcceleration
{
int maxScanlines = 32767, maxPixelArea, PixelArea;
- if (pATI->OptionAccel)
- {
+ if (pATI->OptionAccel) {
if (!(pATI->pXAAInfo = XAACreateInfoRec()))
return FALSE;
- switch (pATI->Adapter)
- {
- case ATI_ADAPTER_MACH64:
- maxScanlines = ATIMach64AccelInit(pATI, pATI->pXAAInfo);
- break;
-
- default:
- break;
- }
+ maxScanlines = ATIMach64AccelInit(pATI, pATI->pXAAInfo);
}
#ifndef AVOID_CPIO
diff --git a/src/atibus.c b/src/atibus.c
index e2a436d..33e48b3 100644
--- a/src/atibus.c
+++ b/src/atibus.c
@@ -116,9 +116,7 @@ ATIClaimResources
pATI->iEntity);
/* Claim Mach64 sparse I/O resources */
- if ((pATI->Adapter == ATI_ADAPTER_MACH64) &&
- (pATI->CPIODecoding == SPARSE_IO))
- {
+ if (pATI->CPIODecoding == SPARSE_IO) {
if (pATI->SharedAccelerator)
Resources[0].type = ResShrIoSparse | ResBus;
else
diff --git a/src/aticlock.c b/src/aticlock.c
index 5acd3f8..c9c8948 100644
--- a/src/aticlock.c
+++ b/src/aticlock.c
@@ -450,17 +450,8 @@ ATIMatchClockLine
int MinimumGap = CLOCK_TOLERANCE + 1;
/* For ATI adapters, reject generic VGA clocks */
-
-#ifndef AVOID_CPIO
-
- if (pATI->Adapter != ATI_ADAPTER_VGA)
-
-#endif /* AVOID_CPIO */
-
- {
- if (ClockLine == SpecificationClockLine)
- ClockChipIndex++;
- }
+ if (ClockLine == SpecificationClockLine)
+ ClockChipIndex++;
/* If checking for XF86Config clock order, skip crystals */
if (ClockMap)
@@ -470,15 +461,6 @@ ATIMatchClockLine
{
int MaximumGap = 0, ClockCount = 0, ClockIndex = 0;
-#ifndef AVOID_CPIO
-
- /* Only Mach64's and later can have programmable clocks */
- if ((ClockChipIndex >= ATI_CLOCK_MACH64A) &&
- (pATI->Adapter < ATI_ADAPTER_MACH64))
- break;
-
-#endif /* AVOID_CPIO */
-
for (; ClockIndex < NumberOfClocks; ClockIndex++)
{
int Gap, XF86ConfigClock, SpecificationClock;
@@ -517,15 +499,6 @@ ATIMatchClockLine
break;
SkipThisClockGenerator:;
-
-#ifndef AVOID_CPIO
-
- /* For non-ATI adapters, only normalise standard VGA clocks */
- if (pATI->Adapter == ATI_ADAPTER_VGA)
- break;
-
-#endif /* AVOID_CPIO */
-
}
return ClockChip;
@@ -660,27 +633,12 @@ ATIClockPreInit
*/
ProbeClocks:
-#ifndef AVOID_CPIO
-
- if (pATI->Adapter == ATI_ADAPTER_VGA)
- {
- NumberOfDividers = 1;
- NumberOfUndividedClocks = 4;
- CalibrationClockNumber = 1;
- CalibrationClockValue = 28322;
- }
- else
-
-#endif /* AVOID_CPIO */
-
{
#ifndef AVOID_CPIO
NumberOfDividers = 4;
- if ((pATI->Chip <= ATI_CHIP_18800) ||
- (pATI->Adapter == ATI_ADAPTER_V4))
- {
+ if ((pATI->Chip <= ATI_CHIP_18800)) {
NumberOfUndividedClocks = 8;
/* Actually, any undivided clock will do */
CalibrationClockNumber = 1;
@@ -709,16 +667,7 @@ ProbeClocks:
NumberOfUndividedClocks = 4;
CalibrationClockNumber = 1;
CalibrationClockValue = 28322;
- }
- else
-
-#ifndef AVOID_CPIO
-
- if (pATI->Adapter >= ATI_ADAPTER_MACH64)
-
-#endif /* AVOID_CPIO */
-
- {
+ } else {
CalibrationClockNumber = 10 /* or 11 */;
CalibrationClockValue = 75000 /* or 65000 */;
}
@@ -836,29 +785,19 @@ ProbeClocks:
* their selection.
*/
if (((Index & 0x03U) == 0x02U) &&
- ((pATI->Chip <= ATI_CHIP_18800) ||
- (pATI->Adapter == ATI_ADAPTER_V4)))
+ ((pATI->Chip <= ATI_CHIP_18800)))
continue;
/* Start sequencer reset */
PutReg(SEQX, 0x00U, 0x00U);
/* Set high-order bits */
- if (pATI->Chip <= ATI_CHIP_18800)
- {
- ATIModifyExtReg(pATI, 0xB2U, -1, 0xBFU,
- Index << 4);
- }
- else
- {
- ATIModifyExtReg(pATI, 0xBEU, -1, 0xEFU,
- Index << 2);
- if (pATI->Adapter != ATI_ADAPTER_V4)
- {
- Index >>= 1;
- ATIModifyExtReg(pATI, 0xB9U, -1, 0xFDU,
- Index >> 1);
- }
+ if (pATI->Chip <= ATI_CHIP_18800) {
+ ATIModifyExtReg(pATI, 0xB2U, -1, 0xBFU, Index << 4);
+ } else {
+ ATIModifyExtReg(pATI, 0xBEU, -1, 0xEFU, Index << 2);
+ Index >>= 1;
+ ATIModifyExtReg(pATI, 0xB9U, -1, 0xFDU, Index >> 1);
}
/* Set clock divider bits */
@@ -1022,9 +961,7 @@ ProbeClocks:
#ifndef AVOID_CPIO
- if ((pATI->Chip <= ATI_CHIP_18800) ||
- (pATI->Adapter == ATI_ADAPTER_V4))
- {
+ if ((pATI->Chip <= ATI_CHIP_18800)) {
/* V3 and V4 adapters don't have clock chips */
if (pATI->Clock > ATI_CLOCK_CRYSTALS)
pATI->Clock = ATI_CLOCK_NONE;
@@ -1061,12 +998,6 @@ ProbeClocks:
pATI->Clock = ATIMatchClockLine(pScreenInfo, pATI,
SpecificationClockLine, NumberOfUndividedClocks, -1, 0);
-#ifndef AVOID_CPIO
-
- if (pATI->Adapter != ATI_ADAPTER_VGA)
-
-#endif /* AVOID_CPIO */
-
{
if (pATI->Clock == ATI_CLOCK_NONE)
{
@@ -1084,8 +1015,7 @@ ProbeClocks:
#ifndef AVOID_CPIO
- if ((pATI->Chip >= ATI_CHIP_18800) &&
- (pATI->Adapter != ATI_ADAPTER_V4))
+ if (pATI->Chip >= ATI_CHIP_18800)
#endif /* AVOID_CPIO */
@@ -1116,9 +1046,7 @@ ProbeClocks:
#ifndef AVOID_CPIO
- if ((pATI->Chip <= ATI_CHIP_18800) ||
- (pATI->Adapter == ATI_ADAPTER_V4))
- {
+ if (pATI->Chip <= ATI_CHIP_18800) {
if (pATI->Clock > ATI_CLOCK_CRYSTALS)
pATI->OptionProbeClocks = TRUE;
}
@@ -1435,12 +1363,9 @@ ATIClockCalculate
{
pATIHW->be = (pATIHW->be & 0xEFU) |
((ClockSelect << 2) & 0x10U);
- if (pATI->Adapter != ATI_ADAPTER_V4)
- {
- ClockSelect >>= 1;
- pATIHW->b9 = (pATIHW->b9 & 0xFDU) |
- ((ClockSelect >> 1) & 0x02U);
- }
+ ClockSelect >>= 1;
+ pATIHW->b9 = (pATIHW->b9 & 0xFDU) |
+ ((ClockSelect >> 1) & 0x02U);
}
/* Set clock divider bits */
diff --git a/src/aticonfig.c b/src/aticonfig.c
index 6a118a0..5ae03c7 100644
--- a/src/aticonfig.c
+++ b/src/aticonfig.c
@@ -160,28 +160,19 @@ ATIProcessOptions
xf86CollectOptions(pScreenInfo, NULL);
/* Set non-zero defaults */
+ Accel = CacheMMIO = HWCursor = TRUE;
#ifndef AVOID_CPIO
- if (pATI->Adapter >= ATI_ADAPTER_MACH64)
-
-#endif /* AVOID_CPIO */
-
- {
- Accel = CacheMMIO = HWCursor = TRUE;
-
-#ifndef AVOID_CPIO
-
- Linear = TRUE;
+ Linear = TRUE;
#endif /* AVOID_CPIO */
#ifdef TV_OUT
- TvStd = "None"; /* No tv standard change requested */
+ TvStd = "None"; /* No tv standard change requested */
#endif
- }
ReferenceClock = ((double)157500000.0) / ((double)11.0);
diff --git a/src/aticonsole.c b/src/aticonsole.c
index 53b1ed8..cb64a91 100644
--- a/src/aticonsole.c
+++ b/src/aticonsole.c
@@ -129,35 +129,10 @@ ATISetDPMSMode
int flags
)
{
- ATIPtr pATI;
-
if (!pScreenInfo || !pScreenInfo->vtSema)
return;
- pATI = ATIPTR(pScreenInfo);
-
- switch (pATI->Adapter)
- {
- case ATI_ADAPTER_MACH64:
- ATIMach64SetDPMSMode(pScreenInfo, pATI, DPMSMode);
- break;
-
- default:
-
-#ifndef AVOID_CPIO
-
- /* Assume EGA/VGA */
- ATIVGASetDPMSMode(pATI, DPMSMode);
- break;
-
- case ATI_ADAPTER_NONE:
- case ATI_ADAPTER_8514A:
- case ATI_ADAPTER_MACH8:
-
-#endif /* AVOID_CPIO */
-
- break;
- }
+ ATIMach64SetDPMSMode(pScreenInfo, ATIPTR(pScreenInfo), DPMSMode);
}
#ifdef TV_OUT
diff --git a/src/aticursor.c b/src/aticursor.c
index 0dfc9ac..cde2c69 100644
--- a/src/aticursor.c
+++ b/src/aticursor.c
@@ -54,21 +54,13 @@ ATIInitializeCursor
if (!(pATI->pCursorInfo = xf86CreateCursorInfoRec()))
return FALSE;
- switch (pATI->Adapter)
- {
- case ATI_ADAPTER_MACH64:
- if (ATIMach64CursorInit(pATI->pCursorInfo))
- break;
- /* Fall through */
-
- default:
- xf86DestroyCursorInfoRec(pATI->pCursorInfo);
- pATI->pCursorInfo = NULL;
- return FALSE;
+ if (!ATIMach64CursorInit(pATI->pCursorInfo)) {
+ xf86DestroyCursorInfoRec(pATI->pCursorInfo);
+ pATI->pCursorInfo = NULL;
+ return FALSE;
}
- if (xf86InitCursor(pScreen, pATI->pCursorInfo))
- {
+ if (xf86InitCursor(pScreen, pATI->pCursorInfo)) {
xf86SetSilkenMouse(pScreen);
return TRUE;
}
diff --git a/src/atii2c.c b/src/atii2c.c
index cb7bc04..3277b20 100644
--- a/src/atii2c.c
+++ b/src/atii2c.c
@@ -342,24 +342,10 @@ ATICreateI2CBusRec
* This is called by ATIPreInit() to create I2C bus record(s) for the adapter.
*/
void
-ATII2CPreInit
-(
- ScrnInfoPtr pScreenInfo,
- ATIPtr pATI
-)
+ATII2CPreInit(ScrnInfoPtr pScreenInfo, ATIPtr pATI)
{
- switch (pATI->Adapter)
- {
- case ATI_ADAPTER_MACH64:
- if (!ATILoadModule(pScreenInfo, "i2c", ATIi2cSymbols))
- return;
-
- ATIMach64I2CPreInit(pScreenInfo, pATI);
- break;
-
- default:
- break;
- }
+ if (ATILoadModule(pScreenInfo, "i2c", ATIi2cSymbols))
+ ATIMach64I2CPreInit(pScreenInfo, pATI);
}
/*
diff --git a/src/atimode.c b/src/atimode.c
index 0db4f45..896a5c6 100644
--- a/src/atimode.c
+++ b/src/atimode.c
@@ -505,27 +505,9 @@ ATIModeSave
ATIRGB514Save(pATI, pATIHW);
}
-#ifndef AVOID_CPIO
-
- /*
- * For some unknown reason, CLKDIV2 needs to be turned off to save the
- * DAC's LUT reliably on VGA Wonder VLB adapters.
- */
- if ((pATI->Adapter == ATI_ADAPTER_NONISA) && (pATIHW->seq[1] & 0x08U))
- PutReg(SEQX, 0x01U, pATIHW->seq[1] & ~0x08U);
-
-#endif /* AVOID_CPIO */
-
/* Save RAMDAC state */
ATIDACSave(pATI, pATIHW);
-#ifndef AVOID_CPIO
-
- if ((pATI->Adapter == ATI_ADAPTER_NONISA) && (pATIHW->seq[1] & 0x08U))
- PutReg(SEQX, 0x01U, pATIHW->seq[1]);
-
-#endif /* AVOID_CPIO */
-
/*
* The server has already saved video memory contents when switching out of
* its virtual console, so don't do it again.
diff --git a/src/atipreinit.c b/src/atipreinit.c
index d2a9b53..fd4d47e 100644
--- a/src/atipreinit.c
+++ b/src/atipreinit.c
@@ -52,250 +52,6 @@
#include "vbe.h"
#include "xf86RAC.h"
-#ifndef AVOID_CPIO
-
-typedef CARD16 Colour; /* The correct spelling should be OK :-) */
-
-/*
- * Bit patterns which are extremely unlikely to show up when reading from
- * nonexistant memory (which normally shows up as either all bits set or all
- * bits clear).
- */
-static const Colour Test_Pixel[] = {0x5AA5U, 0x55AAU, 0xA55AU, 0xCA53U};
-
-static const struct
-{
- int videoRamSize;
- int Miscellaneous_Options_Setting;
- struct
- {
- short int x, y;
- }
- Coordinates[NumberOf(Test_Pixel) + 1];
-}
-Test_Case[] =
-{
- /*
- * Given the engine settings used, only a 4M card will have enough memory
- * to back up the 1025th line of the display. Since the pixel coordinates
- * are zero-based, line 1024 will be the first one which is only backed on
- * 4M cards.
- *
- * <Mark_Weaver@brown.edu>:
- * In case memory is being wrapped, (0,0) and (0,1024) to make sure they
- * can each hold a unique value.
- */
- {4096, MEM_SIZE_4M, {{0,0}, {0,1024}, {-1,-1}}},
-
- /*
- * This card has 2M or less. On a 1M card, the first 2M of the card's
- * memory will have even doublewords backed by physical memory and odd
- * doublewords unbacked.
- *
- * Pixels 0 and 1 of a row will be in the zeroth doubleword, while pixels 2
- * and 3 will be in the first. Check both pixels 2 and 3 in case this is a
- * pseudo-1M card (one chip pulled to turn a 2M card into a 1M card).
- *
- * <Mark_Weaver@brown.edu>:
- * I don't have a 1M card, so I'm taking a stab in the dark. Maybe memory
- * wraps every 512 lines, or maybe odd doublewords are aliases of their
- * even doubleword counterparts. I try everything here.
- */
- {2048, MEM_SIZE_2M, {{0,0}, {0,512}, {2,0}, {3,0}, {-1,-1}}},
-
- /*
- * This is a either a 1M card or a 512k card. Test pixel 1, since it is an
- * odd word in an even doubleword.
- *
- * <Mark_Weaver@brown.edu>:
- * This is the same idea as the test above.
- */
- {1024, MEM_SIZE_1M, {{0,0}, {0,256}, {1,0}, {-1,-1}}},
-
- /*
- * Assume it is a 512k card by default, since that is the minimum
- * configuration.
- */
- {512, MEM_SIZE_512K, {{-1,-1}}}
-};
-
-/*
- * ATIMach32ReadPixel --
- *
- * Return the colour of the specified screen location. Called from
- * ATIMach32videoRam function below.
- */
-static Colour
-ATIMach32ReadPixel
-(
- const short int X,
- const short int Y
-)
-{
- Colour Pixel_Colour;
-
- /* Wait for idle engine */
- ProbeWaitIdleEmpty();
-
- /* Set up engine for pixel read */
- ATIWaitQueue(7);
- outw(RD_MASK, (CARD16)(~0));
- outw(DP_CONFIG, FG_COLOR_SRC_BLIT | DATA_WIDTH | DRAW | DATA_ORDER);
- outw(CUR_X, X);
- outw(CUR_Y, Y);
- outw(DEST_X_START, X);
- outw(DEST_X_END, X + 1);
- outw(DEST_Y_END, Y + 1);
-
- /* Wait for data to become ready */
- ATIWaitQueue(16);
- WaitDataReady();
-
- /* Read pixel colour */
- Pixel_Colour = inw(PIX_TRANS);
- ProbeWaitIdleEmpty();
- return Pixel_Colour;
-}
-
-/*
- * ATIMach32WritePixel --
- *
- * Set the colour of the specified screen location. Called from
- * ATIMach32videoRam function below.
- */
-static void
-ATIMach32WritePixel
-(
- const short int X,
- const short int Y,
- const Colour Pixel_Colour
-)
-{
- /* Set up engine for pixel write */
- ATIWaitQueue(9);
- outw(WRT_MASK, (CARD16)(~0));
- outw(DP_CONFIG, FG_COLOR_SRC_FG | DRAW | READ_WRITE);
- outw(ALU_FG_FN, MIX_FN_PAINT);
- outw(FRGD_COLOR, Pixel_Colour);
- outw(CUR_X, X);
- outw(CUR_Y, Y);
- outw(DEST_X_START, X);
- outw(DEST_X_END, X + 1);
- outw(DEST_Y_END, Y + 1);
-}
-
-/*
- * ATIMach32videoRam --
- *
- * Determine the amount of video memory installed on an 68800-6 based adapter.
- * This is done because these chips exhibit a bug that causes their
- * MISC_OPTIONS register to report 1M rather than the true amount of memory.
- *
- * This function is adapted from a similar function in mach32mem.c written by
- * Robert Wolff, David Dawes and Mark Weaver.
- */
-static int
-ATIMach32videoRam
-(
- void
-)
-{
- CARD16 clock_sel, mem_bndry, misc_options, ext_ge_config;
- Colour saved_Pixel[NumberOf(Test_Pixel)];
- unsigned int Case_Number, Pixel_Number;
- Bool AllPixelsOK;
-
- /* Save register values to be modified */
- clock_sel = inw(CLOCK_SEL);
- mem_bndry = inw(MEM_BNDRY);
- misc_options = inw(MISC_OPTIONS) & ~MEM_SIZE_ALIAS;
- ext_ge_config = inw(R_EXT_GE_CONFIG);
-
- /* Wait for enough FIFO entries */
- ATIWaitQueue(7);
-
- /* Enable accelerator */
- outw(CLOCK_SEL, clock_sel | DISABPASSTHRU);
-
- /* Make accelerator and VGA share video memory */
- outw(MEM_BNDRY, mem_bndry & ~(MEM_PAGE_BNDRY | MEM_BNDRY_ENA));
-
- /* Prevent video memory wrap */
- outw(MISC_OPTIONS, misc_options | MEM_SIZE_4M);
-
- /*
- * Set up the drawing engine for a pitch of 1024 at 16 bits per pixel. No
- * need to mess with the CRT because the results of this test are not
- * intended to be seen.
- */
- outw(EXT_GE_CONFIG, PIXEL_WIDTH_16 | ORDER_16BPP_565 | MONITOR_8514 |
- ALIAS_ENA);
- outw(GE_PITCH, 1024 >> 3);
- outw(GE_OFFSET_HI, 0);
- outw(GE_OFFSET_LO, 0);
-
- for (Case_Number = 0;
- Case_Number < (NumberOf(Test_Case) - 1);
- Case_Number++)
- {
- /* Reduce redundancy as per Mark_Weaver@brown.edu */
-# define TestPixel Test_Case[Case_Number].Coordinates[Pixel_Number]
-# define ForEachTestPixel \
- for (Pixel_Number = 0; TestPixel.x >= 0; Pixel_Number++)
-
- /* Save pixel colours that will be clobbered */
- ForEachTestPixel
- saved_Pixel[Pixel_Number] =
- ATIMach32ReadPixel(TestPixel.x, TestPixel.y);
-
- /* Write test patterns */
- ForEachTestPixel
- ATIMach32WritePixel(TestPixel.x, TestPixel.y,
- Test_Pixel[Pixel_Number]);
-
- /* Test for lost pixels */
- AllPixelsOK = TRUE;
- ForEachTestPixel
- {
- if (ATIMach32ReadPixel(TestPixel.x, TestPixel.y) !=
- Test_Pixel[Pixel_Number])
- {
- AllPixelsOK = FALSE;
- break;
- }
- }
-
- /* Restore clobbered pixels */
- ForEachTestPixel
- ATIMach32WritePixel(TestPixel.x, TestPixel.y,
- saved_Pixel[Pixel_Number]);
-
- /* End test on success */
- if (AllPixelsOK)
- break;
-
- /* Completeness */
-# undef ForEachTestPixel
-# undef TestPixel
- }
-
- /* Restore what was changed and correct MISC_OPTIONS register */
- ATIWaitQueue(4);
- outw(EXT_GE_CONFIG, ext_ge_config);
- misc_options |= Test_Case[Case_Number].Miscellaneous_Options_Setting;
- outw(MISC_OPTIONS, misc_options);
- outw(MEM_BNDRY, mem_bndry);
- outw(CLOCK_SEL, clock_sel);
-
- /* Wait for activity to die down */
- ProbeWaitIdleEmpty();
-
- /* Tell ATIPreInit the REAL story */
- return Test_Case[Case_Number].videoRamSize;
-}
-
-#endif /* AVOID_CPIO */
-
/*
*
*/
@@ -354,6 +110,7 @@ static Bool
ATIMach64Detect(ATIPtr pATI)
{
CARD32 IOValue, bus_cntl, gen_test_cntl;
+ Bool Found = FALSE;
(void)ATIMapApertures(-1, pATI); /* Ignore errors */
@@ -400,7 +157,7 @@ ATIMach64Detect(ATIPtr pATI)
*/
ATIMach64ChipID(pATI, pATI->PCIInfo->chipType);
if ((pATI->Chip != ATI_CHIP_Mach64) || (pATI->CPIODecoding == BLOCK_IO))
- pATI->Adapter = ATI_ADAPTER_MACH64;
+ Found = TRUE;
}
}
@@ -408,7 +165,7 @@ ATIMach64Detect(ATIPtr pATI)
outr(SCRATCH_REG0, IOValue);
/* If no Mach64 was detected, return now */
- if (pATI->Adapter != ATI_ADAPTER_MACH64) {
+ if (!Found) {
outr(GEN_TEST_CNTL, gen_test_cntl);
outr(BUS_CNTL, bus_cntl);
ATIUnmapApertures(-1, pATI);
@@ -1399,260 +1156,162 @@ ATIPreInit(ScrnInfoPtr pScreenInfo, int flags)
pATI->nFIFOEntries = 16; /* For now */
pATI->Audio = ATI_AUDIO_NONE;
- /* Finish probing the adapter */
- switch (pATI->Adapter)
- {
-
-#ifndef AVOID_CPIO
-
- case ATI_ADAPTER_NONE:
- case ATI_ADAPTER_EGA:
- case ATI_ADAPTER_EGA_PLUS:
- case ATI_ADAPTER_VGA:
- case ATI_ADAPTER_BASIC:
- pATI->NewHW.SetBank = (ATIBankProcPtr)NoopDDA;
- pATI->BankInfo.SetSourceBank =
- pATI->BankInfo.SetDestinationBank =
- pATI->BankInfo.SetSourceAndDestinationBanks =
- (miBankProcPtr)NoopDDA;
- break;
-
- case ATI_ADAPTER_V3:
- pATI->NewHW.SetBank = ATIV3SetBank;
- pATI->BankInfo.SetSourceBank = ATIV3SetRead;
- pATI->BankInfo.SetDestinationBank = ATIV3SetWrite;
- pATI->BankInfo.SetSourceAndDestinationBanks = ATIV3SetReadWrite;
- break;
-
- case ATI_ADAPTER_V4:
- case ATI_ADAPTER_V5:
- pATI->NewHW.SetBank = ATIV4V5SetBank;
- pATI->BankInfo.SetSourceBank = ATIV4V5SetRead;
- pATI->BankInfo.SetDestinationBank = ATIV4V5SetWrite;
- pATI->BankInfo.SetSourceAndDestinationBanks = ATIV4V5SetReadWrite;
- break;
-
- case ATI_ADAPTER_XL:
- pATI->DAC = ATI_DAC_SC11483;
- break;
-
- case ATI_ADAPTER_8514A:
- pATI->VideoRAM =
- videoRamSizes[GetBits(inw(SUBSYS_STAT), _8PLANE) + 2];
- break;
-
- case ATI_ADAPTER_MACH8:
- pATI->VideoRAM =
- videoRamSizes[GetBits(inw(CONFIG_STATUS_1), MEM_INSTALLED) + 2];
- break;
-
- case ATI_ADAPTER_MACH32:
- IOValue = inw(CONFIG_STATUS_1);
- pATI->DAC = ATI_DAC(GetBits(IOValue, DACTYPE), 0);
- pATI->MemoryType = GetBits(IOValue, MEM_TYPE);
-
- IOValue = inw(MISC_OPTIONS);
- pATI->VideoRAM =
- videoRamSizes[GetBits(IOValue, MEM_SIZE_ALIAS) + 2];
-
- /*
- * The 68800-6 doesn't necessarily report the correct video memory
- * size.
- */
- if ((pATI->Chip == ATI_CHIP_68800_6) && (pATI->VideoRAM == 1024))
- pATI->VideoRAM = ATIMach32videoRam();
-
- break;
-
-#endif /* AVOID_CPIO */
-
- case ATI_ADAPTER_MACH64:
- do
- {
- /*
- * Find and mmap() MMIO area. Allow only auxiliary aperture if
- * it exists.
- */
- if (!(Block0Base = pATI->Block0Base))
- {
- if (pVideo)
- {
- /* Check tail end of linear (8MB or 4MB) aperture */
- if ((pATI->Block0Base = pVideo->memBase[0]))
- {
- pATI->Block0Base += 0x007FFC00U;
- ATIMach64Map(pScreenInfo->scrnIndex, pATI);
- if (pATI->pBlock[0])
- break;
-
- pATI->Block0Base -= 0x00400000U;
- ATIMach64Map(pScreenInfo->scrnIndex, pATI);
- if (pATI->pBlock[0])
- break;
- }
- }
+ do {
+ /*
+ * Find and mmap() MMIO area. Allow only auxiliary aperture if
+ * it exists.
+ */
+ if (!(Block0Base = pATI->Block0Base)) {
+ if (pVideo) {
+ /* Check tail end of linear (8MB or 4MB) aperture */
+ if ((pATI->Block0Base = pVideo->memBase[0])) {
+ pATI->Block0Base += 0x007FFC00U;
+ ATIMach64Map(pScreenInfo->scrnIndex, pATI);
+ if (pATI->pBlock[0])
+ break;
- /* Check VGA MMIO aperture */
- pATI->Block0Base = 0x000BFC00U;
+ pATI->Block0Base -= 0x00400000U;
+ ATIMach64Map(pScreenInfo->scrnIndex, pATI);
+ if (pATI->pBlock[0])
+ break;
}
+ }
- ATIMach64Map(pScreenInfo->scrnIndex, pATI);
- } while (0);
- pATI->Block0Base = Block0Base;
+ /* Check VGA MMIO aperture */
+ pATI->Block0Base = 0x000BFC00U;
+ }
+
+ ATIMach64Map(pScreenInfo->scrnIndex, pATI);
+ } while (0);
+ pATI->Block0Base = Block0Base;
#ifdef AVOID_CPIO
- if (!pATI->pBlock[0])
- {
- xf86DrvMsg(pScreenInfo->scrnIndex, X_ERROR,
- "Unable to mmap() adapter registers.\n");
- return FALSE;
- }
+ if (!pATI->pBlock[0]) {
+ xf86DrvMsg(pScreenInfo->scrnIndex, X_ERROR,
+ "Unable to mmap() adapter registers.\n");
+ return FALSE;
+ }
#endif /* AVOID_CPIO */
- pATIHW->crtc_gen_cntl = inr(CRTC_GEN_CNTL);
- if (!(pATIHW->crtc_gen_cntl & CRTC_EN) &&
- (pATI->Chip >= ATI_CHIP_264CT))
- {
- xf86DrvMsg(pScreenInfo->scrnIndex, X_ERROR,
- "Adapter has not been initialised.\n");
- ATIPrintNoiseIfRequested(pATI, BIOS, BIOSSize);
- ATIUnmapApertures(pScreenInfo->scrnIndex, pATI);
- return FALSE;
- }
+ pATIHW->crtc_gen_cntl = inr(CRTC_GEN_CNTL);
+ if (!(pATIHW->crtc_gen_cntl & CRTC_EN) &&
+ (pATI->Chip >= ATI_CHIP_264CT)) {
+ xf86DrvMsg(pScreenInfo->scrnIndex, X_ERROR,
+ "Adapter has not been initialised.\n");
+ ATIPrintNoiseIfRequested(pATI, BIOS, BIOSSize);
+ ATIUnmapApertures(pScreenInfo->scrnIndex, pATI);
+ return FALSE;
+ }
#ifdef AVOID_CPIO
- if (!(pATIHW->crtc_gen_cntl & CRTC_EXT_DISP_EN))
- {
- xf86DrvMsg(pScreenInfo->scrnIndex, X_ERROR,
- "Adapters found to be in VGA mode on server entry are not"
- " supported by the MMIO-only version of this driver.\n");
- ATIPrintNoiseIfRequested(pATI, BIOS, BIOSSize);
- ATIUnmapApertures(pScreenInfo->scrnIndex, pATI);
- return FALSE;
- }
+ if (!(pATIHW->crtc_gen_cntl & CRTC_EXT_DISP_EN)) {
+ xf86DrvMsg(pScreenInfo->scrnIndex, X_ERROR,
+ "Adapters found to be in VGA mode on server entry are not"
+ " supported by the MMIO-only version of this driver.\n");
+ ATIPrintNoiseIfRequested(pATI, BIOS, BIOSSize);
+ ATIUnmapApertures(pScreenInfo->scrnIndex, pATI);
+ return FALSE;
+ }
#endif /* AVOID_CPIO */
- pATIHW->mem_cntl = inr(MEM_CNTL);
- if (pATI->Chip < ATI_CHIP_264VTB)
- {
- pATI->VideoRAM =
- videoRamSizes[GetBits(pATIHW->mem_cntl, CTL_MEM_SIZE) + 2];
- }
- else
- {
- pATI->nFIFOEntries = /* Don't care */
- (unsigned int)(-1) >> 1;
-
- IOValue = GetBits(pATIHW->mem_cntl, CTL_MEM_SIZEB);
- if (IOValue < 8)
- pATI->VideoRAM = (IOValue + 1) * 512;
- else if (IOValue < 12)
- pATI->VideoRAM = (IOValue - 3) * 1024;
+ pATIHW->mem_cntl = inr(MEM_CNTL);
+ if (pATI->Chip < ATI_CHIP_264VTB) {
+ pATI->VideoRAM = videoRamSizes[GetBits(pATIHW->mem_cntl,
+ CTL_MEM_SIZE) + 2];
+ } else {
+ pATI->nFIFOEntries = (unsigned int)(-1) >> 1; /* Don't care */
+
+ IOValue = GetBits(pATIHW->mem_cntl, CTL_MEM_SIZEB);
+ if (IOValue < 8)
+ pATI->VideoRAM = (IOValue + 1) * 512;
+ else if (IOValue < 12)
+ pATI->VideoRAM = (IOValue - 3) * 1024;
+ else
+ pATI->VideoRAM = (IOValue - 7) * 2048;
+ }
+
+ pATI->DAC = GetBits(inr(DAC_CNTL), DAC_TYPE);
+
+ IOValue = inr(CONFIG_STATUS64_0);
+ if (pATI->Chip >= ATI_CHIP_264CT) {
+ pATI->MemoryType = GetBits(IOValue, CFG_MEM_TYPE_T);
+
+ /* Get LCD panel id */
+ if (pATI->Chip == ATI_CHIP_264LT) {
+ pATI->LCDPanelID = GetBits(IOValue, CFG_PANEL_ID);
+
+ pATIHW->horz_stretching = inr(HORZ_STRETCHING);
+ pATIHW->vert_stretching = inr(VERT_STRETCHING);
+ pATIHW->lcd_gen_ctrl = inr(LCD_GEN_CTRL);
+ } else if ((pATI->Chip == ATI_CHIP_264LTPRO) ||
+ (pATI->Chip == ATI_CHIP_264XL) ||
+ (pATI->Chip == ATI_CHIP_MOBILITY)) {
+ pATI->LCDPanelID = GetBits(IOValue, CFG_PANEL_ID);
+
+ pATIHW->lcd_index = inr(LCD_INDEX);
+ pATIHW->horz_stretching = ATIMach64GetLCDReg(LCD_HORZ_STRETCHING);
+ pATI->LCDHorizontal = GetBits(pATIHW->horz_stretching,
+ HORZ_PANEL_SIZE);
+ if (pATI->LCDHorizontal) {
+ if (pATI->LCDHorizontal == MaxBits(HORZ_PANEL_SIZE))
+ pATI->LCDHorizontal = 0;
else
- pATI->VideoRAM = (IOValue - 7) * 2048;
- }
-
- pATI->DAC = GetBits(inr(DAC_CNTL), DAC_TYPE);
-
- IOValue = inr(CONFIG_STATUS64_0);
- if (pATI->Chip >= ATI_CHIP_264CT)
- {
- pATI->MemoryType = GetBits(IOValue, CFG_MEM_TYPE_T);
-
- /* Get LCD panel id */
- if (pATI->Chip == ATI_CHIP_264LT)
- {
- pATI->LCDPanelID = GetBits(IOValue, CFG_PANEL_ID);
-
- pATIHW->horz_stretching = inr(HORZ_STRETCHING);
- pATIHW->vert_stretching = inr(VERT_STRETCHING);
- pATIHW->lcd_gen_ctrl = inr(LCD_GEN_CTRL);
- }
- else if ((pATI->Chip == ATI_CHIP_264LTPRO) ||
- (pATI->Chip == ATI_CHIP_264XL) ||
- (pATI->Chip == ATI_CHIP_MOBILITY))
- {
- pATI->LCDPanelID = GetBits(IOValue, CFG_PANEL_ID);
-
- pATIHW->lcd_index = inr(LCD_INDEX);
- pATIHW->horz_stretching =
- ATIMach64GetLCDReg(LCD_HORZ_STRETCHING);
- pATI->LCDHorizontal =
- GetBits(pATIHW->horz_stretching, HORZ_PANEL_SIZE);
- if (pATI->LCDHorizontal)
- {
- if (pATI->LCDHorizontal == MaxBits(HORZ_PANEL_SIZE))
- pATI->LCDHorizontal = 0;
- else
- pATI->LCDHorizontal =
- (pATI->LCDHorizontal + 1) << 3;
- }
- pATIHW->ext_vert_stretch =
- ATIMach64GetLCDReg(LCD_EXT_VERT_STRETCH);
- pATI->LCDVertical =
- GetBits(pATIHW->ext_vert_stretch, VERT_PANEL_SIZE);
- if (pATI->LCDVertical)
- {
- if (pATI->LCDVertical == MaxBits(VERT_PANEL_SIZE))
- pATI->LCDVertical = 0;
- else
- pATI->LCDVertical++;
- }
- pATIHW->vert_stretching =
- ATIMach64GetLCDReg(LCD_VERT_STRETCHING);
- pATIHW->lcd_gen_ctrl = ATIMach64GetLCDReg(LCD_GEN_CNTL);
- outr(LCD_INDEX, pATIHW->lcd_index);
- }
-
- /*
- * Don't bother with panel support if it hasn't been previously
- * enabled.
- */
- if ((pATI->LCDPanelID >= 0) &&
- !(pATIHW->horz_stretching & HORZ_STRETCH_EN) &&
- !(pATIHW->vert_stretching & VERT_STRETCH_EN) &&
- !(pATIHW->lcd_gen_ctrl & LCD_ON))
- {
- /*
- * At this point, if an XL or Mobility BIOS hasn't set
- * panel dimensions, then there is no panel. Otherwise,
- * keep any panel disabled to allow for modes greater than
- * the panel's dimensions.
- */
- if ((pATI->Chip >= ATI_CHIP_264XL) &&
- (!pATI->LCDHorizontal || !pATI->LCDVertical))
- pATI->LCDPanelID = -1;
- else
- pATI->OptionPanelDisplay = FALSE;
- }
+ pATI->LCDHorizontal = (pATI->LCDHorizontal + 1) << 3;
}
- else
- {
- pATI->MemoryType = GetBits(IOValue, CFG_MEM_TYPE);
-
- /* Factor in what the BIOS says the DAC is */
- pATI->DAC = ATI_DAC(pATI->DAC,
- GetBits(inr(SCRATCH_REG1), BIOS_INIT_DAC_SUBTYPE));
+ pATIHW->ext_vert_stretch = ATIMach64GetLCDReg(LCD_EXT_VERT_STRETCH);
+ pATI->LCDVertical = GetBits(pATIHW->ext_vert_stretch,
+ VERT_PANEL_SIZE);
+ if (pATI->LCDVertical) {
+ if (pATI->LCDVertical == MaxBits(VERT_PANEL_SIZE))
+ pATI->LCDVertical = 0;
+ else
+ pATI->LCDVertical++;
}
+ pATIHW->vert_stretching = ATIMach64GetLCDReg(LCD_VERT_STRETCHING);
+ pATIHW->lcd_gen_ctrl = ATIMach64GetLCDReg(LCD_GEN_CNTL);
+ outr(LCD_INDEX, pATIHW->lcd_index);
+ }
+ /*
+ * Don't bother with panel support if it hasn't been previously
+ * enabled.
+ */
+ if ((pATI->LCDPanelID >= 0) &&
+ !(pATIHW->horz_stretching & HORZ_STRETCH_EN) &&
+ !(pATIHW->vert_stretching & VERT_STRETCH_EN) &&
+ !(pATIHW->lcd_gen_ctrl & LCD_ON)) {
/*
- * RAMDAC types 0 & 1 for Mach64's are different than those for
- * Mach32's.
+ * At this point, if an XL or Mobility BIOS hasn't set
+ * panel dimensions, then there is no panel. Otherwise,
+ * keep any panel disabled to allow for modes greater than
+ * the panel's dimensions.
*/
- if (pATI->DAC < ATI_DAC_ATI68875)
- pATI->DAC += ATI_DAC_INTERNAL;
-
- break;
+ if ((pATI->Chip >= ATI_CHIP_264XL) &&
+ (!pATI->LCDHorizontal || !pATI->LCDVertical))
+ pATI->LCDPanelID = -1;
+ else
+ pATI->OptionPanelDisplay = FALSE;
+ }
+ } else {
+ pATI->MemoryType = GetBits(IOValue, CFG_MEM_TYPE);
- default:
- break;
+ /* Factor in what the BIOS says the DAC is */
+ pATI->DAC = ATI_DAC(pATI->DAC,
+ GetBits(inr(SCRATCH_REG1), BIOS_INIT_DAC_SUBTYPE));
}
/*
+ * RAMDAC types 0 & 1 for Mach64's are different than those for
+ * Mach32's.
+ */
+ if (pATI->DAC < ATI_DAC_ATI68875)
+ pATI->DAC += ATI_DAC_INTERNAL;
+
+ /*
* For Mach64 adapters, pick up, from the BIOS, the type of programmable
* clock generator (if any), and various information about it.
*/
@@ -1720,30 +1379,19 @@ ATIPreInit(ScrnInfoPtr pScreenInfo, int flags)
Buffer, pATI->ChipClass, pATI->ChipRevision);
}
+ Message = Buffer + snprintf(Buffer, SizeOf(Buffer),
+ "%s bus interface detected",
+ ATIBusNames[pATI->BusType]);
#ifndef AVOID_CPIO
-
- if (pATI->Adapter >= ATI_ADAPTER_MACH8)
-
-#endif /* AVOID_CPIO */
-
- {
- Message = Buffer + snprintf(Buffer, SizeOf(Buffer),
- "%s bus interface detected", ATIBusNames[pATI->BusType]);
-
-#ifndef AVOID_CPIO
-
- if (pATI->Adapter >= ATI_ADAPTER_MACH64)
- {
- Message += snprintf(Message, Buffer + SizeOf(Buffer) - Message,
- "; %s I/O base is 0x%04lX",
- (pATI->CPIODecoding == SPARSE_IO) ? "sparse" : "block",
- pATI->CPIOBase);
- }
+
+ Message += snprintf(Message, Buffer + SizeOf(Buffer) - Message,
+ "; %s I/O base is 0x%04lX",
+ (pATI->CPIODecoding == SPARSE_IO) ? "sparse" : "block",
+ pATI->CPIOBase);
#endif /* AVOID_CPIO */
- xf86DrvMsg(pScreenInfo->scrnIndex, X_PROBED, "%s.\n", Buffer);
- }
+ xf86DrvMsg(pScreenInfo->scrnIndex, X_PROBED, "%s.\n", Buffer);
#ifndef AVOID_CPIO
@@ -1761,7 +1409,7 @@ ATIPreInit(ScrnInfoPtr pScreenInfo, int flags)
#endif /* AVOID_CPIO */
xf86DrvMsg(pScreenInfo->scrnIndex, X_PROBED,
- "%s adapter detected.\n", ATIAdapterNames[pATI->Adapter]);
+ "Mach64 adapter detected.\n");
if (pATI->Chip >= ATI_CHIP_264GT)
xf86DrvMsg(pScreenInfo->scrnIndex, X_NOTICE,
@@ -1970,14 +1618,9 @@ ATIPreInit(ScrnInfoPtr pScreenInfo, int flags)
return FALSE;
}
+ /* Accelerator and VGA cannot share memory */
if (pATI->Coprocessor != ATI_CHIP_NONE)
- {
- /* Ignore any 8514/A or Mach8 accelerator from this point on */
- pATI->Adapter = pATI->VGAAdapter;
-
- /* Accelerator and VGA cannot share memory */
pATI->VideoRAM = 0;
- }
}
#endif /* AVOID_CPIO */
@@ -3041,37 +2684,15 @@ ATIPreInit(ScrnInfoPtr pScreenInfo, int flags)
}
}
-#ifndef AVOID_CPIO
-
- if (pATI->Adapter >= ATI_ADAPTER_MACH32)
-
-#endif /* AVOID_CPIO */
-
- {
- if (pATI->Chip >= ATI_CHIP_264CT)
- ATIReportMemory(pScreenInfo, pATI,
- ATIMemoryTypeNames_264xT[pATI->MemoryType]);
- else if (pATI->Chip == ATI_CHIP_88800CX)
- ATIReportMemory(pScreenInfo, pATI,
- ATIMemoryTypeNames_88800CX[pATI->MemoryType]);
- else
- ATIReportMemory(pScreenInfo, pATI,
- ATIMemoryTypeNames_Mach[pATI->MemoryType]);
- }
-
-#ifndef AVOID_CPIO
-
- else if (pATI->Adapter >= ATI_ADAPTER_V3)
- {
+ if (pATI->Chip >= ATI_CHIP_264CT)
ATIReportMemory(pScreenInfo, pATI,
- (ATIGetExtReg(0xB7U) & 0x04U) ? "DRAM" : "VRAM");
- }
+ ATIMemoryTypeNames_264xT[pATI->MemoryType]);
+ else if (pATI->Chip == ATI_CHIP_88800CX)
+ ATIReportMemory(pScreenInfo, pATI,
+ ATIMemoryTypeNames_88800CX[pATI->MemoryType]);
else
- {
- ATIReportMemory(pScreenInfo, pATI, "video memory");
- }
-
-#endif /* AVOID_CPIO */
+ ATIReportMemory(pScreenInfo, pATI,
+ ATIMemoryTypeNames_Mach[pATI->MemoryType]);
/*
* Finish banking setup. This needs to be fixed to not assume the mode on
@@ -3458,12 +3079,6 @@ ATIPreInit(ScrnInfoPtr pScreenInfo, int flags)
#ifndef AVOID_CPIO
case ATI_CRTC_VGA:
- /*
- * IBM's VGA doesn't allow for interlaced modes.
- */
- if (pATI->Adapter <= ATI_ADAPTER_VGA)
- ATIClockRange.interlaceAllowed = FALSE;
-
pScreenInfo->maxHValue = (0xFFU + 1) << 3; /* max HTotal */
/*
@@ -3472,13 +3087,9 @@ ATIPreInit(ScrnInfoPtr pScreenInfo, int flags)
* Finer-grained checks are done in ATIValidateMode().
*/
pScreenInfo->maxVValue = 0x03FFU + 1;
- if (pATI->Adapter > ATI_ADAPTER_VGA)
- {
+ pScreenInfo->maxVValue <<= 1;
+ if (ATIClockRange.interlaceAllowed && (pATI->Chip < ATI_CHIP_264CT))
pScreenInfo->maxVValue <<= 1;
- if (ATIClockRange.interlaceAllowed &&
- (pATI->Chip < ATI_CHIP_264CT))
- pScreenInfo->maxVValue <<= 1;
- }
/*
* 18800-x and 28800-x do not support interlaced modes when the
diff --git a/src/atiprint.c b/src/atiprint.c
index f611e9a..8b81992 100644
--- a/src/atiprint.c
+++ b/src/atiprint.c
@@ -482,15 +482,11 @@ ATIPrintRegisters
xf86ErrorFVerb(4, " %04X", inw(Index));
}
- if (pATI->Adapter >= ATI_ADAPTER_MACH8)
- {
- xf86ErrorFVerb(4, "\n\n Mach8/Mach32 register values:");
- for (Index = 0x02EEU; Index <= 0x0FEEE; Index += 0x0400U)
- {
- if (!((Index - 0x02EEU) & 0x0C00U))
- xf86ErrorFVerb(4, "\n 0x%04X: ", Index);
- xf86ErrorFVerb(4, " %04X", inw(Index));
- }
+ xf86ErrorFVerb(4, "\n\n Mach8/Mach32 register values:");
+ for (Index = 0x02EEU; Index <= 0x0FEEE; Index += 0x0400U) {
+ if (!((Index - 0x02EEU) & 0x0C00U))
+ xf86ErrorFVerb(4, "\n 0x%04X: ", Index);
+ xf86ErrorFVerb(4, " %04X", inw(Index));
}
xf86ErrorFVerb(4, "\n");
@@ -632,14 +628,6 @@ ATIPrintRegisters
ATISetDACIOPorts(pATI, crtc);
- /* Temporarily turn off CLKDIV2 while reading DAC's LUT */
- if (pATI->Adapter == ATI_ADAPTER_NONISA)
- {
- seq1 = GetReg(SEQX, 0x01U);
- if (seq1 & 0x08U)
- PutReg(SEQX, 0x01U, seq1 & ~0x08U);
- }
-
dac_read = inb(pATI->CPIO_DAC_READ);
DACDelay;
dac_write = inb(pATI->CPIO_DAC_WRITE);
@@ -676,9 +664,6 @@ ATIPrintRegisters
outb(pATI->CPIO_DAC_READ, dac_read);
DACDelay;
- if ((pATI->Adapter == ATI_ADAPTER_NONISA) && (seq1 & 0x08U))
- PutReg(SEQX, 0x01U, seq1);
-
#endif /* AVOID_CPIO */
if ((pVideo = pATI->PCIInfo))
diff --git a/src/atistruct.h b/src/atistruct.h
index 339d6b5..1fddcd0 100644
--- a/src/atistruct.h
+++ b/src/atistruct.h
@@ -176,11 +176,6 @@ typedef struct _ATIHWRec
*/
typedef struct _ATIRec
{
- /*
- * Adapter-related definitions.
- */
- CARD8 Adapter;
-
#ifndef AVOID_CPIO
CARD8 VGAAdapter;
diff --git a/src/ativalid.c b/src/ativalid.c
index 224f761..15da531 100644
--- a/src/ativalid.c
+++ b/src/ativalid.c
@@ -215,12 +215,6 @@ ATIValidMode
if ((VDisplay > 2048) || (VTotal > 2050))
return MODE_BAD_VVALUE;
- if (pATI->Adapter != ATI_ADAPTER_VGA)
- break;
-
- if ((VDisplay > 1024) || (VTotal > 1025))
- return MODE_BAD_VVALUE;
-
break;
#endif /* AVOID_CPIO */
diff --git a/src/ativga.c b/src/ativga.c
index f9e57d1..649c7dd 100644
--- a/src/ativga.c
+++ b/src/ativga.c
@@ -64,8 +64,6 @@ ATIVGAPreInit
pATIHW->seq[2] = 0x0FU;
if (pATI->depth <= 4)
pATIHW->seq[4] = 0x06U;
- else if (pATI->Adapter == ATI_ADAPTER_VGA)
- pATIHW->seq[4] = 0x0EU;
else
pATIHW->seq[4] = 0x0AU;
@@ -78,10 +76,8 @@ ATIVGAPreInit
pATIHW->crt[19] = pATI->displayWidth >> 3;
else
pATIHW->crt[19] = pATI->displayWidth >> 4;
- if ((pATI->depth >= 8) && (pATI->Adapter == ATI_ADAPTER_VGA))
- pATIHW->crt[23] = 0xC3U;
- else
- pATIHW->crt[23] = 0xE3U;
+
+ pATIHW->crt[23] = 0xE3U;
pATIHW->crt[24] = 0xFFU;
/* Initialise attribute controller register values */
@@ -103,8 +99,6 @@ ATIVGAPreInit
pATIHW->attr[Index] = Index;
if (pATI->depth <= 4)
pATIHW->attr[16] = 0x81U;
- else if (pATI->Adapter == ATI_ADAPTER_VGA)
- pATIHW->attr[16] = 0x41U;
else
pATIHW->attr[16] = 0x01U;
pATIHW->attr[17] = 0xFFU;
diff --git a/src/atixv.c b/src/atixv.c
index 0c59dad..55a86d4 100644
--- a/src/atixv.c
+++ b/src/atixv.c
@@ -69,17 +69,8 @@ ATIXVInitializeAdaptor
XF86VideoAdaptorPtr *ppAdaptor = NULL;
int nAdaptor;
- switch (pATI->Adapter)
- {
- case ATI_ADAPTER_MACH64:
- nAdaptor = ATIMach64XVInitialiseAdaptor(pScreen, pScreenInfo, pATI,
- &ppAdaptor);
- break;
-
- default:
- nAdaptor = 0;
- break;
- }
+ nAdaptor = ATIMach64XVInitialiseAdaptor(pScreen, pScreenInfo, pATI,
+ &ppAdaptor);
if (pppAdaptor)
*pppAdaptor = ppAdaptor;
@@ -157,13 +148,5 @@ ATICloseXVideo
ATIPtr pATI
)
{
- switch (pATI->Adapter)
- {
- case ATI_ADAPTER_MACH64:
- ATIMach64CloseXVideo(pScreen, pScreenInfo, pATI);
- break;
-
- default:
- break;
- }
+ ATIMach64CloseXVideo(pScreen, pScreenInfo, pATI);
}