From 383e963e275d351ea3631c352f5795340162d69f Mon Sep 17 00:00:00 2001 From: George Sapountzis Date: Sun, 28 Jan 2007 00:44:31 +0200 Subject: Always use the linear aperture. - drop (pATI->OptionLinear == FALSE) - AcceleratorVideoRAM is always set, i.e. VGAVideoRAM is not used - pATI->LinearBase is always set - xf86LinearVidMem() is now checked in atipreinit() for both CPIO and MMIO --- src/aticonfig.c | 31 --------- src/atimach64.c | 2 +- src/atioption.c | 12 ---- src/atioption.h | 6 -- src/atipreinit.c | 198 +++---------------------------------------------------- src/atistruct.h | 6 -- src/ativga.c | 3 +- src/atividmem.c | 38 ++--------- src/atixv.c | 13 +--- 9 files changed, 15 insertions(+), 294 deletions(-) diff --git a/src/aticonfig.c b/src/aticonfig.c index 46f3d873..6c3e1a61 100644 --- a/src/aticonfig.c +++ b/src/aticonfig.c @@ -121,12 +121,6 @@ ATIProcessOptions # define Devel PrivateOption[ATI_OPTION_DEVEL].value.bool # define HWCursor PublicOption[ATI_OPTION_HWCURSOR].value.bool -#ifndef AVOID_CPIO - -# define Linear PublicOption[ATI_OPTION_LINEAR].value.bool - -#endif /* AVOID_CPIO */ - #ifdef XF86DRI_DEVEL # define IsPCI PublicOption[ATI_OPTION_IS_PCI].value.bool @@ -165,12 +159,6 @@ ATIProcessOptions { Accel = CacheMMIO = HWCursor = TRUE; -#ifndef AVOID_CPIO - - Linear = TRUE; - -#endif /* AVOID_CPIO */ - #ifdef TV_OUT TvStd = "None"; /* No tv standard change requested */ @@ -200,19 +188,6 @@ ATIProcessOptions xf86ProcessOptions(pScreenInfo->scrnIndex, pScreenInfo->options, PrivateOption); -#ifndef AVOID_CPIO - - /* Disable linear apertures if the OS doesn't support them */ - if (!xf86LinearVidMem() && Linear) - { - if (PublicOption[ATI_OPTION_LINEAR].found) - xf86DrvMsg(pScreenInfo->scrnIndex, X_WARNING, - "OS does not support linear apertures.\n"); - Linear = FALSE; - } - -#endif /* AVOID_CPIO */ - /* Move option values into driver private structure */ pATI->OptionAccel = Accel; pATI->OptionBIOSDisplay = BIOSDisplay; @@ -221,12 +196,6 @@ ATIProcessOptions pATI->OptionCSync = CSync; pATI->OptionDevel = Devel; -#ifndef AVOID_CPIO - - pATI->OptionLinear = Linear; - -#endif /* AVOID_CPIO */ - #ifdef TV_OUT if (TvOut && pATI->Chip < ATI_CHIP_264GT) { diff --git a/src/atimach64.c b/src/atimach64.c index 8675bdfb..5aee170f 100644 --- a/src/atimach64.c +++ b/src/atimach64.c @@ -158,7 +158,7 @@ ATIMach64PreInit pATIHW->config_cntl &= ~CFG_MEM_VGA_AP_EN; } - if (pATI->LinearBase && (pATI->Chip < ATI_CHIP_264CT)) + if ((pATI->Chip < ATI_CHIP_264CT)) { /* Replace linear aperture size and address */ pATIHW->config_cntl &= ~(CFG_MEM_AP_LOC | CFG_MEM_AP_SIZE); diff --git a/src/atioption.c b/src/atioption.c index 5f2bd011..42fbd56e 100644 --- a/src/atioption.c +++ b/src/atioption.c @@ -89,18 +89,6 @@ const OptionInfoRec ATIPublicOptions[] = FALSE, }, -#ifndef AVOID_CPIO - - { - ATI_OPTION_LINEAR, - "linear", - OPTV_BOOLEAN, - {0, }, - FALSE - }, - -#endif /* AVOID_CPIO */ - #ifdef XF86DRI_DEVEL { diff --git a/src/atioption.h b/src/atioption.h index 23a9fcf3..4bdfb04a 100644 --- a/src/atioption.h +++ b/src/atioption.h @@ -38,12 +38,6 @@ typedef enum ATI_OPTION_CSYNC, ATI_OPTION_HWCURSOR, -#ifndef AVOID_CPIO - - ATI_OPTION_LINEAR, - -#endif /* AVOID_CPIO */ - #ifdef XF86DRI_DEVEL ATI_OPTION_IS_PCI, diff --git a/src/atipreinit.c b/src/atipreinit.c index 35ca0e90..7d77eecd 100644 --- a/src/atipreinit.c +++ b/src/atipreinit.c @@ -81,7 +81,7 @@ ATIReportMemory } static const int videoRamSizes[] = - {0, 256, 512, 1024, 2*1024, 4*1024, 6*1024, 8*1024, 12*1024, 16*1024, 0}; + {512, 1024, 2*1024, 4*1024, 6*1024, 8*1024, 12*1024, 16*1024}; static const rgb defaultWeight = {0, 0, 0}; static const Gamma defaultGamma = {0.0, 0.0, 0.0}; @@ -162,7 +162,7 @@ ATIPreInit DisplayModePtr pMode; unsigned long Block0Base; CARD32 IOValue; - int i, j, AcceleratorVideoRAM = 0, ServerVideoRAM; + int i, j; int Numerator, Denominator; int MinX, MinY; ClockRange ATIClockRange = {NULL, 0, 80000, 0, TRUE, TRUE, 1, 1, 0}; @@ -180,8 +180,6 @@ ATIPreInit xf86Int10InfoPtr pInt10Info = NULL; vbeInfoPtr pVBE; pointer pInt10Module, pDDCModule = NULL, pVBEModule = NULL; - int VGAVideoRAM = 0; - resRange Resources[2] = {{0, 0, 0}, _END}; #endif /* AVOID_CPIO */ @@ -562,8 +560,8 @@ ATIPreInit pATIHW->mem_cntl = inr(MEM_CNTL); if (pATI->Chip < ATI_CHIP_264VTB) { - pATI->VideoRAM = - videoRamSizes[GetBits(pATIHW->mem_cntl, CTL_MEM_SIZE) + 2]; + IOValue = GetBits(pATIHW->mem_cntl, CTL_MEM_SIZE); + pATI->VideoRAM = videoRamSizes[IOValue]; } else { @@ -1131,8 +1129,6 @@ ATIPreInit } } -#ifdef AVOID_CPIO - if (!xf86LinearVidMem()) { xf86DrvMsg(pScreenInfo->scrnIndex, X_ERROR, @@ -1143,8 +1139,6 @@ ATIPreInit return FALSE; } -#endif /* AVOID_CPIO */ - /* * Set colour weights. */ @@ -1267,25 +1261,6 @@ ATIPreInit } -#ifndef AVOID_CPIO - - /* Complain if VGA is needed but not there */ - if (!pATI->OptionLinear) - { - /* VGA is required at this point */ - if (!pATI->VGAAdapter) - { - xf86DrvMsg(pScreenInfo->scrnIndex, X_ERROR, - "VGA is not available through this adapter.\n"); - ATILock(pATI); - ATIPrintNoiseIfRequested(pATI, BIOS, BIOSSize); - ATIUnmapApertures(pScreenInfo->scrnIndex, pATI); - return FALSE; - } - } - -#endif /* AVOID_CPIO */ - /* * Decide between the CRT and the panel. */ @@ -1893,37 +1868,6 @@ ATIPreInit */ pScreenInfo->videoRam = pATI->VideoRAM; -#ifndef AVOID_CPIO - - AcceleratorVideoRAM = pScreenInfo->videoRam; - if (pATI->CPIO_VGAWonder) - { - /* - * XXX There's an assumption here that the values retrieved are those - * set by BIOS initialisation. - */ - { - IOValue = ATIGetExtReg(0xB0U); - if (IOValue & 0x08U) - VGAVideoRAM = 1024; - else if (IOValue & 0x10U) - VGAVideoRAM = 512; - else - VGAVideoRAM = 256; - if (AcceleratorVideoRAM > 1024) - AcceleratorVideoRAM = 1024; - } - } - - /* Check for hardware limitations */ - if (!AcceleratorVideoRAM) - { - pScreenInfo->videoRam = pATI->VideoRAM = VGAVideoRAM; - } - else - -#endif /* AVOID_CPIO */ - { { /* Get adapter's linear aperture configuration */ @@ -1949,63 +1893,11 @@ ATIPreInit } } -#ifndef AVOID_CPIO - - /* Except for PCI & AGP, allow for user override */ - if (!pVideo) - { - if (pATI->Chip == ATI_CHIP_88800CX) - IOValue = ~((CARD32)((1 << 23) - 1)); - else if (pATI->Chip >= ATI_CHIP_88800GXE) - IOValue = ~((CARD32)((1 << 24) - 1)); - else if (pATI->VideoRAM >= 4096) - IOValue = ~((CARD32)((1 << 23) - 1)); - else - IOValue = ~((CARD32)((1 << 22) - 1)); - - IOValue &= pGDev->MemBase; - if (IOValue && - (IOValue <= (CARD32)(MaxBits(CFG_MEM_AP_LOC) << 22))) - pATI->LinearBase = IOValue; - - if (!pATI->LinearBase) - { - xf86DrvMsg(pScreenInfo->scrnIndex, X_WARNING, - "Linear aperture not configured. Specify \"MemBase\"" - " override in XF86Config \"Device\" section.\n"); - } - else - { - if (!pATI->LinearSize) - { - if ((pATI->Chip <= ATI_CHIP_88800GXD) && - (pATI->VideoRAM < 4096)) - pATI->LinearSize = 4 * 1024 * 1024; - else - pATI->LinearSize = 8 * 1024 * 1024; - } - - Resources[0].type = ResExcMemBlock | ResBus; - Resources[0].rBegin = pATI->LinearBase; - Resources[0].rEnd = - pATI->LinearBase + pATI->LinearSize - 1; - if (xf86RegisterResources(pATI->iEntity, Resources, - ResNone)) - { - xf86DrvMsg(pScreenInfo->scrnIndex, X_WARNING, - "Unable to register %d MB linear aperture at" - " 0x%08lX.\n", pATI->LinearSize >> 10, - pATI->LinearBase); - - pATI->LinearSize = 0; - } - } - } - -#endif /* AVOID_CPIO */ - if (pATI->LinearBase && pATI->LinearSize) { + int AcceleratorVideoRAM = pATI->LinearSize >> 10; + int ServerVideoRAM = pATI->VideoRAM; + /* * Unless specified in PCI configuration space, set MMIO * address to tail end of linear aperture. @@ -2017,8 +1909,6 @@ ATIPreInit pATI->MMIOInLinear = TRUE; } - AcceleratorVideoRAM = pATI->LinearSize >> 10; - /* * Account for MMIO area at the tail end of the linear * aperture, if it is needed or if it cannot be disabled. @@ -2026,8 +1916,6 @@ ATIPreInit if (pATI->MMIOInLinear || (pATI->Chip < ATI_CHIP_264VTB)) AcceleratorVideoRAM -= 2; - ServerVideoRAM = pATI->VideoRAM; - if (pATI->Cursor > ATI_CURSOR_SOFTWARE) { /* @@ -2047,12 +1935,6 @@ ATIPreInit pATI->CursorBase); } -#ifndef AVOID_CPIO - - if (pATI->OptionLinear) - -#endif /* AVOID_CPIO */ - { CARD32 PageSize = getpagesize() >> 10; @@ -2132,50 +2014,18 @@ ATIPreInit pATI->BankInfo.SetSourceAndDestinationBanks = ATIMach64SetReadWritePacked; } - - /* - * Unless specified in PCI configuration space, or at the top of - * of a little-endian linear aperture, set MMIO address to the one - * just above the VGA aperture. This does not work on the CT - * (maybe others). - */ - if (!pATI->Block0Base && - ((pATI->Chip < ATI_CHIP_264CT) || - (pATI->Chip >= ATI_CHIP_264VT) || - pATI->OptionDevel)) - pATI->Block0Base = 0x000BFC00U; } - if (!pATI->OptionLinear) - pATI->LinearBase = 0; /* Not needed */ - #endif /* AVOID_CPIO */ if (!pATI->LinearBase || !pATI->LinearSize) { - -#ifndef AVOID_CPIO - - if (!pATI->VGAAdapter) - -#endif /* AVOID_CPIO */ - - { xf86DrvMsg(pScreenInfo->scrnIndex, X_ERROR, "Linear aperture not available.\n"); ATILock(pATI); ATIPrintNoiseIfRequested(pATI, BIOS, BIOSSize); ATIUnmapApertures(pScreenInfo->scrnIndex, pATI); return FALSE; - } - -#ifndef AVOID_CPIO - - /* Insurance */ - pATI->LinearBase = pATI->LinearSize = 0; - -#endif /* AVOID_CPIO */ - } if (pATI->Block0Base) @@ -2196,15 +2046,7 @@ ATIPreInit #ifndef AVOID_CPIO - if (pATI->OptionLinear) - { - if (!pATI->LinearBase) - { - xf86DrvMsg(pScreenInfo->scrnIndex, X_WARNING, - "Linear aperture not supported in this configuration.\n"); - pATI->OptionLinear = FALSE; - } - else if (pATI->VGAAdapter) + if (pATI->VGAAdapter) { /* * Free VGA memory aperture during operating state (but it is still @@ -2220,18 +2062,9 @@ ATIPreInit xf86FreeResList(pResources); } } - } #endif /* AVOID_CPIO */ - if ((pATI->Cursor > ATI_CURSOR_SOFTWARE) && !pATI->CursorBase) - { - xf86DrvMsg(pScreenInfo->scrnIndex, X_WARNING, - "Unable to store hardware cursor image. Reverting to software" - " cursor.\n"); - pATI->Cursor = ATI_CURSOR_SOFTWARE; - } - /* * Remap apertures. Must lock and re-unlock around this in case the * remapping fails. @@ -2245,24 +2078,9 @@ ATIPreInit if (pATI->OptionAccel) { - -#ifndef AVOID_CPIO - - if (!pATI->Block0Base) - { - xf86DrvMsg(pScreenInfo->scrnIndex, X_WARNING, - "Acceleration not supported in this configuration.\n"); - pATI->OptionAccel = FALSE; - } - else - -#endif /* AVOID_CPIO */ - - { xf86DrvMsg(pScreenInfo->scrnIndex, X_INFO, "MMIO write caching %sabled.\n", pATI->OptionMMIOCache ? "en" : "dis"); - } } { diff --git a/src/atistruct.h b/src/atistruct.h index ea9d08c9..0cf88bac 100644 --- a/src/atistruct.h +++ b/src/atistruct.h @@ -469,12 +469,6 @@ typedef struct _ATIRec unsigned int OptionCSync:1; /* Use composite sync */ unsigned int OptionDevel:1; /* Intentionally undocumented */ -#ifndef AVOID_CPIO - - unsigned int OptionLinear:1; /* Use linear aperture if available */ - -#endif /* AVOID_CPIO */ - #ifdef TV_OUT CARD8 OptionTvOut; /* Enable TV out if TV is connected */ diff --git a/src/ativga.c b/src/ativga.c index 905df98e..391ea72c 100644 --- a/src/ativga.c +++ b/src/ativga.c @@ -74,8 +74,7 @@ ATIVGAPreInit /* Initialise graphics controller register values */ if (pATI->Chip >= ATI_CHIP_264CT) pATIHW->gra[5] = 0x40U; - if (pATI->UseSmallApertures && (pATI->Chip >= ATI_CHIP_264CT) && - ((pATI->Chip >= ATI_CHIP_264VT) || !pATI->LinearBase)) + if (pATI->UseSmallApertures && (pATI->Chip >= ATI_CHIP_264VT)) pATIHW->gra[6] = 0x01U; /* 128kB aperture */ else pATIHW->gra[6] = 0x05U; /* 64kB aperture */ diff --git a/src/atividmem.c b/src/atividmem.c index e7c44ccd..89e164d3 100644 --- a/src/atividmem.c +++ b/src/atividmem.c @@ -103,18 +103,7 @@ ATIUnmapLinear ATIPtr pATI ) { - -#ifdef AVOID_CPIO - - if (!pATI->pMemory) - return; - -#else /* AVOID_CPIO */ - - if (pATI->pMemory != pATI->pBank) - -#endif /* AVOID_CPIO */ - + if (pATI->pMemory) { xf86UnMapVidMem(iScreen, pATI->pMemory, pATI->LinearSize); @@ -178,31 +167,13 @@ ATIMapApertures ATIPtr pATI ) { - pciVideoPtr pVideo; - PCITAG Tag; - unsigned long PageSize; + pciVideoPtr pVideo = pATI->PCIInfo; + PCITAG Tag = ((pciConfigPtr)(pVideo->thisCard))->tag; + unsigned long PageSize = getpagesize(); if (pATI->Mapped) return TRUE; -#ifndef AVOID_CPIO - - if (!pATI->VGAAdapter) - -#endif /* AVOID_CPIO */ - - { - if (!pATI->LinearBase && !pATI->Block0Base) - return FALSE; - } - - PageSize = getpagesize(); - - if ((pVideo = pATI->PCIInfo)) - Tag = ((pciConfigPtr)(pVideo->thisCard))->tag; - else - Tag = 0; - #ifndef AVOID_CPIO /* Map VGA aperture */ @@ -222,7 +193,6 @@ ATIMapApertures if (!pATI->pBank) return FALSE; - pATI->pMemory = pATI->BankInfo.pBankA = pATI->BankInfo.pBankB = pATI->pBank; diff --git a/src/atixv.c b/src/atixv.c index a3c04800..ef86ec3d 100644 --- a/src/atixv.c +++ b/src/atixv.c @@ -92,15 +92,6 @@ ATIXVPreInit ATIPtr pATI ) { - -#ifndef AVOID_CPIO - - /* Currently a linear aperture is needed ... */ - if (!pATI->LinearBase) - return; - -#endif /* AVOID_CPIO */ - (void)xf86XVRegisterGenericAdaptorDriver(ATIXVInitializeAdaptor); } @@ -121,9 +112,7 @@ ATIInitializeXVideo int nAdaptor; Bool result; - if (!(pScreenInfo->memPhysBase = pATI->LinearBase)) - return FALSE; - + pScreenInfo->memPhysBase = pATI->LinearBase; pScreenInfo->fbOffset = 0; nAdaptor = xf86XVListGenericAdaptors(pScreenInfo, &ppAdaptor); -- cgit v1.2.3