diff options
author | Michel Dänzer <[email protected]> | 2005-11-29 13:13:34 +0000 |
---|---|---|
committer | Michel Dänzer <[email protected]> | 2005-11-29 13:13:34 +0000 |
commit | 9790e641ef24859833c01a1fa7004a1c2b73ddd1 (patch) | |
tree | 61e97ca28db1dc16ae0cc164b93cc306bebfa3e6 /src/mesa/drivers/dri/r128/r128_screen.c | |
parent | 58f45fa44deeb0277154a2f193d33824bb4c1c85 (diff) |
If the DDX driver didn't reserve any video RAM for textures, fall back to
using only GART memory for textures instead of segfaulting in the texture
management code. (Bug 5115)
Diffstat (limited to 'src/mesa/drivers/dri/r128/r128_screen.c')
-rw-r--r-- | src/mesa/drivers/dri/r128/r128_screen.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/r128/r128_screen.c b/src/mesa/drivers/dri/r128/r128_screen.c index c91f9fdbf7a..4f1b20aadd7 100644 --- a/src/mesa/drivers/dri/r128/r128_screen.c +++ b/src/mesa/drivers/dri/r128/r128_screen.c @@ -198,11 +198,19 @@ r128CreateScreen( __DRIscreenPrivate *sPriv ) r128Screen->depthPitch = r128DRIPriv->depthPitch; r128Screen->spanOffset = r128DRIPriv->spanOffset; - r128Screen->texOffset[R128_LOCAL_TEX_HEAP] = r128DRIPriv->textureOffset; - r128Screen->texSize[R128_LOCAL_TEX_HEAP] = r128DRIPriv->textureSize; - r128Screen->logTexGranularity[R128_LOCAL_TEX_HEAP] = r128DRIPriv->log2TexGran; + if ( r128DRIPriv->textureSize == 0 ) { + r128Screen->texOffset[R128_LOCAL_TEX_HEAP] = + r128DRIPriv->agpTexOffset + R128_AGP_TEX_OFFSET; + r128Screen->texSize[R128_LOCAL_TEX_HEAP] = r128DRIPriv->agpTexMapSize; + r128Screen->logTexGranularity[R128_LOCAL_TEX_HEAP] = + r128DRIPriv->log2AGPTexGran; + } else { + r128Screen->texOffset[R128_LOCAL_TEX_HEAP] = r128DRIPriv->textureOffset; + r128Screen->texSize[R128_LOCAL_TEX_HEAP] = r128DRIPriv->textureSize; + r128Screen->logTexGranularity[R128_LOCAL_TEX_HEAP] = r128DRIPriv->log2TexGran; + } - if ( r128Screen->IsPCI ) { + if ( !r128Screen->agpTextures.map || r128DRIPriv->textureSize == 0 ) { r128Screen->numTexHeaps = R128_NR_TEX_HEAPS - 1; r128Screen->texOffset[R128_AGP_TEX_HEAP] = 0; r128Screen->texSize[R128_AGP_TEX_HEAP] = 0; |