diff options
author | Felix Kuehling <[email protected]> | 2004-12-15 16:50:57 +0000 |
---|---|---|
committer | Felix Kuehling <[email protected]> | 2004-12-15 16:50:57 +0000 |
commit | 91fd299b6b781f0e62723ceba050e005a794710c (patch) | |
tree | f568e21e117ea6561da7c3155014f4c4d39d3aca | |
parent | 9fb668c57641d68f4b47b8335ea62f21f9773bba (diff) |
Moved some code from savageCreateContext to savageInitDriver, where it
belongs. Removed some obviously useless code. Fixed computation of
MaxTextureLevels.
-rw-r--r-- | src/mesa/drivers/dri/savage/savage_xmesa.c | 112 |
1 files changed, 43 insertions, 69 deletions
diff --git a/src/mesa/drivers/dri/savage/savage_xmesa.c b/src/mesa/drivers/dri/savage/savage_xmesa.c index 3f78b1f13a6..c8eb69160f8 100644 --- a/src/mesa/drivers/dri/savage/savage_xmesa.c +++ b/src/mesa/drivers/dri/savage/savage_xmesa.c @@ -162,6 +162,46 @@ savageInitDriver(__DRIscreenPrivate *sPriv) savageScreen->texVirtual[SAVAGE_CARD_HEAP] = (drmAddress)(((unsigned int)sPriv->pFB)+gDRIPriv->textureOffset); + + if (drmMap(sPriv->fd, + gDRIPriv->registers.handle, + gDRIPriv->registers.size, + (drmAddress *)&(gDRIPriv->registers.map)) != 0) + { + Xfree(savageScreen); + sPriv->private = NULL; + return GL_FALSE; + } + + if (drmMap(sPriv->fd, + gDRIPriv->agpTextures.handle, + gDRIPriv->agpTextures.size, + (drmAddress *)&(gDRIPriv->agpTextures.map)) != 0) + { + Xfree(savageScreen); + sPriv->private = NULL; + return GL_FALSE; + } + +/* agp texture*/ + savageScreen->texVirtual[SAVAGE_AGP_HEAP] = + (drmAddress)(gDRIPriv->agpTextures.map); + + gDRIPriv->BCIcmdBuf.map = (drmAddress *) + ((unsigned int)gDRIPriv->registers.map+0x00010000); + + savageScreen->aperture.handle = gDRIPriv->aperture.handle; + savageScreen->aperture.size = gDRIPriv->aperture.size; + if (drmMap(sPriv->fd, + savageScreen->aperture.handle, + savageScreen->aperture.size, + (drmAddress *)&savageScreen->aperture.map) != 0) + { + Xfree(savageScreen); + sPriv->private = NULL; + return GL_FALSE; + } + #if 0 savageDDFastPathInit(); savageDDTrifuncInit(); @@ -278,9 +318,9 @@ savageCreateContext( const __GLcontextModes *mesaVis, } for (maxTextureLevels = 1; maxTextureLevels <= 11; ++maxTextureLevels) { GLuint size = 1 << maxTextureLevels; - size *= size * 4; /* 4 bytes per texel */ - size *= 2; /* all mipmap levels together take roughly twice the size of - the biggest level */ + size *= size * 4; /* 4 bytes per texel */ + size = size * 4/3; /* all mipmap levels together take roughly + 4/3 the size of the biggest level */ if (size > maxTextureSize) break; } @@ -317,78 +357,12 @@ savageCreateContext( const __GLcontextModes *mesaVis, imesa->shadowCounter = MAX_SHADOWCOUNTER; imesa->shadowStatus = GL_TRUE;/*Will judge by 2d message */ - if (drmMap(sPriv->fd, - gDRIPriv->registers.handle, - gDRIPriv->registers.size, - (drmAddress *)&(gDRIPriv->registers.map)) != 0) - { - Xfree(savageScreen); - sPriv->private = NULL; - return GL_FALSE; - } - - if (drmMap(sPriv->fd, - gDRIPriv->agpTextures.handle, - gDRIPriv->agpTextures.size, - (drmAddress *)&(gDRIPriv->agpTextures.map)) != 0) - { - Xfree(savageScreen); - sPriv->private = NULL; - return GL_FALSE; - } - -/* agp texture*/ - savageScreen->texVirtual[SAVAGE_AGP_HEAP] = - (drmAddress)(gDRIPriv->agpTextures.map); - - - - gDRIPriv->BCIcmdBuf.map = (drmAddress *) - ((unsigned int)gDRIPriv->registers.map+0x00010000); - imesa->MMIO_BASE = (GLuint)gDRIPriv->registers.map; imesa->BCIBase= (GLuint)gDRIPriv->BCIcmdBuf.map; - - savageScreen->aperture.handle = gDRIPriv->aperture.handle; - savageScreen->aperture.size = gDRIPriv->aperture.size; - if (drmMap(sPriv->fd, - savageScreen->aperture.handle, - savageScreen->aperture.size, - (drmAddress *)&savageScreen->aperture.map) != 0) - { - Xfree(savageScreen); - sPriv->private = NULL; - return GL_FALSE; - } - - - - - for(i=0;i<5;i++) { imesa->apertureBase[i] = ((GLuint)savageScreen->aperture.map + 0x01000000 * i ); - - - } - - { - volatile unsigned int * tmp; - - tmp=(volatile unsigned int *)(imesa->MMIO_BASE + 0x850C); - - - tmp=(volatile unsigned int *)(imesa->MMIO_BASE + 0x48C40); - - - tmp=(volatile unsigned int *)(imesa->MMIO_BASE + 0x48C44); - - - tmp=(volatile unsigned int *)(imesa->MMIO_BASE + 0x48C48); - - - } imesa->aperturePitch = gDRIPriv->aperturePitch; |