summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/savage/savage_xmesa.c
diff options
context:
space:
mode:
authorFelix Kuehling <[email protected]>2005-01-10 22:49:00 +0000
committerFelix Kuehling <[email protected]>2005-01-10 22:49:00 +0000
commit86f1439f82e499f1d8de965510a503404426ad9e (patch)
treeca861e87486f3bf2f7cd622b6d7201b1c2c4421d /src/mesa/drivers/dri/savage/savage_xmesa.c
parent9db66a3f9f745267d7ed20f1d6fde0272bd37949 (diff)
Fixes to cope with the lack of AGP textures. This is all that's needed
to support PCI Savages on the Mesa side. Bumped driver date.
Diffstat (limited to 'src/mesa/drivers/dri/savage/savage_xmesa.c')
-rw-r--r--src/mesa/drivers/dri/savage/savage_xmesa.c31
1 files changed, 19 insertions, 12 deletions
diff --git a/src/mesa/drivers/dri/savage/savage_xmesa.c b/src/mesa/drivers/dri/savage/savage_xmesa.c
index a4000b2a75a..b3cf3a9982e 100644
--- a/src/mesa/drivers/dri/savage/savage_xmesa.c
+++ b/src/mesa/drivers/dri/savage/savage_xmesa.c
@@ -176,15 +176,17 @@ savageInitDriver(__DRIscreenPrivate *sPriv)
savageScreen->agpTextures.handle = gDRIPriv->agpTextureHandle;
savageScreen->agpTextures.size = gDRIPriv->agpTextureSize;
- if (drmMap(sPriv->fd,
- savageScreen->agpTextures.handle,
- savageScreen->agpTextures.size,
- (drmAddress *)&(savageScreen->agpTextures.map)) != 0)
- {
- Xfree(savageScreen);
- sPriv->private = NULL;
- return GL_FALSE;
- }
+ if (gDRIPriv->agpTextureSize) {
+ if (drmMap(sPriv->fd,
+ savageScreen->agpTextures.handle,
+ savageScreen->agpTextures.size,
+ (drmAddress *)&(savageScreen->agpTextures.map)) != 0) {
+ Xfree(savageScreen);
+ sPriv->private = NULL;
+ return GL_FALSE;
+ }
+ } else
+ savageScreen->agpTextures.map = NULL;
savageScreen->texVirtual[SAVAGE_CARD_HEAP] =
(drmAddress)(((unsigned int)sPriv->pFB)+gDRIPriv->textureOffset);
@@ -361,7 +363,12 @@ savageCreateContext( const __GLcontextModes *mesaVis,
break;
}
ctx->Const.MaxTextureLevels = maxTextureLevels;
- assert (ctx->Const.MaxTextureLevels > 6); /*spec requires at least 64x64*/
+ if (ctx->Const.MaxTextureLevels <= 6) { /*spec requires at least 64x64*/
+ __driUtilMessage("Not enough texture memory. "
+ "Falling back to indirect rendering.");
+ Xfree(imesa);
+ return GL_FALSE;
+ }
#if 0
ctx->Const.MinLineWidth = 1.0;
@@ -401,7 +408,7 @@ savageCreateContext( const __GLcontextModes *mesaVis,
{
int i;
- for(i=0;i<SAVAGE_NR_TEX_HEAPS;i++)
+ for(i=0;i<imesa->lastTexHeap;i++)
{
imesa->texHeap[i] = mmInit( 0, savageScreen->textureSize[i] );
make_empty_list(&imesa->TexObjList[i]);
@@ -503,7 +510,7 @@ savageDestroyContext(__DRIcontextPrivate *driContextPriv)
/* update for multi-tex*/
{
int i;
- for(i=0;i<SAVAGE_NR_TEX_HEAPS;i++)
+ for(i=0;i<imesa->lastTexHeap;i++)
foreach_s (t, next_t, &(imesa->TexObjList[i]))
savageDestroyTexObj(imesa, t);
}