diff options
author | Luc Verhaegen <libv@skynet.be> | 2006-04-21 06:18:31 +0200 |
---|---|---|
committer | Luc Verhaegen <libv@skynet.be> | 2006-04-21 06:18:31 +0200 |
commit | 56adbacdaf24c6c1ce8c5e77a90f535167cad676 (patch) | |
tree | d5a3802b6ff70ed2815078d433b30297ada03f79 | |
parent | 4d6dfcc3707d0f8a2056c4e19842a4e0cdf686fc (diff) |
Cull OptionLinear mindlessly.
Less than ideal currently, but end point is proper failure when first BAR
isn't useful.
-rw-r--r-- | src/aticonfig.c | 6 | ||||
-rw-r--r-- | src/atipreinit.c | 138 | ||||
-rw-r--r-- | src/atistruct.h | 6 |
3 files changed, 56 insertions, 94 deletions
diff --git a/src/aticonfig.c b/src/aticonfig.c index 9fa59aa..00f9036 100644 --- a/src/aticonfig.c +++ b/src/aticonfig.c @@ -288,12 +288,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/atipreinit.c b/src/atipreinit.c index bc9aeec..e460188 100644 --- a/src/atipreinit.c +++ b/src/atipreinit.c @@ -2083,19 +2083,6 @@ ATIPreInit(ScrnInfoPtr pScreenInfo, int flags) } } - /* Complain if VGA is needed but not there */ - if (!pATI->OptionLinear) { - /* VGA is required at this point */ - if (!pATI->IsVGA) { - xf86DrvMsg(pScreenInfo->scrnIndex, X_ERROR, - "VGA is not available through this adapter.\n"); - ATILock(pATI); - ATIPrintNoiseIfRequested(pATI, BIOS, BIOSSize); - Mach64AperturesUnmap(pATI); - return FALSE; - } - } - #endif /* AVOID_CPIO */ if (pATI->LCDPanelID >= 0) { @@ -2171,6 +2158,8 @@ ATIPreInit(ScrnInfoPtr pScreenInfo, int flags) } if (pATI->LinearBase && pATI->LinearSize) { + CARD32 PageSize = getpagesize() >> 10; + AcceleratorVideoRAM = pATI->LinearSize >> 10; /* @@ -2200,63 +2189,53 @@ ATIPreInit(ScrnInfoPtr pScreenInfo, int flags) pATI->CursorBase); } -#ifndef AVOID_CPIO - - if (pATI->OptionLinear) - -#endif /* AVOID_CPIO */ - - { - CARD32 PageSize = getpagesize() >> 10; - #if X_BYTE_ORDER == X_LITTLE_ENDIAN - /* - * MMIO areas must be mmap()'ed separately to avoid write - * combining them. Thus, they might not end up still - * adjacent with the little-endian linear aperture after - * mmap()'ing. So, round down the linear aperture size to - * avoid an overlap. Any hardware cursor image area might - * not end up being write combined, but this seems - * preferable to further reducing the video memory size - * advertised to the server. - * - * XXX Ideally this should be dealt with in the os-support - * layer, i.e., it should be possible to reset a - * subarea's write combining after it has been - * mmap()'ed, but doing so currently causes the removal - * of write combining for the entire aperture. - */ - if (pATI->MMIOInLinear) - AcceleratorVideoRAM -= AcceleratorVideoRAM % PageSize; + /* + * MMIO areas must be mmap()'ed separately to avoid write + * combining them. Thus, they might not end up still + * adjacent with the little-endian linear aperture after + * mmap()'ing. So, round down the linear aperture size to + * avoid an overlap. Any hardware cursor image area might + * not end up being write combined, but this seems + * preferable to further reducing the video memory size + * advertised to the server. + * + * XXX Ideally this should be dealt with in the os-support + * layer, i.e., it should be possible to reset a + * subarea's write combining after it has been + * mmap()'ed, but doing so currently causes the removal + * of write combining for the entire aperture. + */ + if (pATI->MMIOInLinear) + AcceleratorVideoRAM -= AcceleratorVideoRAM % PageSize; #else /* if X_BYTE_ORDER != X_LITTLE_ENDIAN */ - /* - * Big-endian apertures are 8 MB higher and don't contain - * an MMIO area. - */ - pATI->LinearBase += 0x00800000U; - AcceleratorVideoRAM = pATI->LinearSize >> 10; + /* + * Big-endian apertures are 8 MB higher and don't contain + * an MMIO area. + */ + pATI->LinearBase += 0x00800000U; + AcceleratorVideoRAM = pATI->LinearSize >> 10; #endif /* X_BYTE_ORDER */ - if (ServerVideoRAM > AcceleratorVideoRAM) - ServerVideoRAM = AcceleratorVideoRAM; - else if (AcceleratorVideoRAM > pATI->VideoRAM) - AcceleratorVideoRAM = pATI->VideoRAM; + if (ServerVideoRAM > AcceleratorVideoRAM) + ServerVideoRAM = AcceleratorVideoRAM; + else if (AcceleratorVideoRAM > pATI->VideoRAM) + AcceleratorVideoRAM = pATI->VideoRAM; - PageSize--; - AcceleratorVideoRAM = - (AcceleratorVideoRAM + PageSize) & ~PageSize; + PageSize--; + AcceleratorVideoRAM = + (AcceleratorVideoRAM + PageSize) & ~PageSize; - xf86DrvMsg(pScreenInfo->scrnIndex, X_INFO, - "Using %d MB linear aperture at 0x%08lX.\n", - pATI->LinearSize >> 20, pATI->LinearBase); + xf86DrvMsg(pScreenInfo->scrnIndex, X_INFO, + "Using %d MB linear aperture at 0x%08lX.\n", + pATI->LinearSize >> 20, pATI->LinearBase); - /* Only mmap what is needed */ - ApertureSize = pATI->LinearSize = AcceleratorVideoRAM << 10; - } + /* Only mmap what is needed */ + ApertureSize = pATI->LinearSize = AcceleratorVideoRAM << 10; if (ServerVideoRAM < pATI->VideoRAM) { pScreenInfo->videoRam = ServerVideoRAM; @@ -2281,9 +2260,6 @@ ATIPreInit(ScrnInfoPtr pScreenInfo, int flags) ATIMach64SetReadWritePacked; } - if (!pATI->OptionLinear) - pATI->LinearBase = 0; /* Not needed */ - #endif /* AVOID_CPIO */ if (!pATI->LinearBase || !pATI->LinearSize) { @@ -2314,27 +2290,25 @@ ATIPreInit(ScrnInfoPtr pScreenInfo, int flags) #ifndef AVOID_CPIO - if (pATI->OptionLinear) - { - if (!pATI->LinearBase) - { + if (!pATI->LinearBase) { + xf86DrvMsg(pScreenInfo->scrnIndex, X_WARNING, + "Linear aperture not supported in this configuration.\n"); + ATILock(pATI); + ATIPrintNoiseIfRequested(pATI, BIOS, BIOSSize); + Mach64AperturesUnmap(pATI); + return FALSE; + } else if (pATI->IsVGA) { + /* + * Free VGA memory aperture during operating state (but it is still + * decoded). + */ + pResources = xf86SetOperatingState(resVgaMem, pATI->iEntity, + ResUnusedOpr); + if (pResources) { xf86DrvMsg(pScreenInfo->scrnIndex, X_WARNING, - "Linear aperture not supported in this configuration.\n"); - pATI->OptionLinear = FALSE; - } else if (pATI->IsVGA) { - /* - * Free VGA memory aperture during operating state (but it is still - * decoded). - */ - pResources = xf86SetOperatingState(resVgaMem, pATI->iEntity, - ResUnusedOpr); - if (pResources) - { - xf86DrvMsg(pScreenInfo->scrnIndex, X_WARNING, - "Logic error setting operating state for VGA memory" - " aperture.\n"); - xf86FreeResList(pResources); - } + "Logic error setting operating state for VGA memory" + " aperture.\n"); + xf86FreeResList(pResources); } } diff --git a/src/atistruct.h b/src/atistruct.h index b4a3c6d..e07754f 100644 --- a/src/atistruct.h +++ b/src/atistruct.h @@ -424,12 +424,6 @@ typedef struct _ATIRec Bool OptionCSync; /* Use composite sync */ Bool OptionDevel; /* Intentionally undocumented */ -#ifndef AVOID_CPIO - - Bool OptionLinear; /* Use linear fb aperture when available */ - -#endif /* AVOID_CPIO */ - #ifdef TV_OUT CARD8 OptionTvOut; /* Enable TV out if TV is connected */ |