diff options
author | Alan Hourihane <[email protected]> | 2003-12-04 18:17:32 +0000 |
---|---|---|
committer | Alan Hourihane <[email protected]> | 2003-12-04 18:17:32 +0000 |
commit | e78dd78e4af644fbad6cd8f3135ec7364bd54a5f (patch) | |
tree | c66c1344f2d5f77d452c2bb86ca3a1006eca1aad /src/mesa/drivers/dri/sis | |
parent | ecb1a5f7f98b9e42965318db99b6996f12b87e59 (diff) |
merge latest DRI sis driver changes from the DRI trunk
Diffstat (limited to 'src/mesa/drivers/dri/sis')
30 files changed, 283 insertions, 413 deletions
diff --git a/src/mesa/drivers/dri/sis/sis_alloc.c b/src/mesa/drivers/dri/sis/sis_alloc.c index aa71f269d14..1789fbb5ffe 100644 --- a/src/mesa/drivers/dri/sis/sis_alloc.c +++ b/src/mesa/drivers/dri/sis/sis_alloc.c @@ -18,7 +18,7 @@ Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL -ATI, PRECISION INSIGHT AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, +ERIC ANHOLT OR SILICON INTEGRATED SYSTEMS CORP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. @@ -32,13 +32,13 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. * Eric Anholt <[email protected]> */ -#include <assert.h> - #include "sis_context.h" #include "sis_alloc.h" #include "sis_common.h" +#include <unistd.h> + #define Z_BUFFER_HW_ALIGNMENT 16 #define Z_BUFFER_HW_PLUS (16 + 4) @@ -46,15 +46,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #define DRAW_BUFFER_HW_ALIGNMENT 16 #define DRAW_BUFFER_HW_PLUS (16 + 4) -#ifdef ROUNDUP -#undef ROUNDUP -#endif -#define ROUNDUP(nbytes, pad) (((nbytes)+(pad-1))/(pad)) - -#ifdef ALIGNMENT -#undef ALIGNMENT -#endif -#define ALIGNMENT(value, align) (ROUNDUP((value),(align))*(align)) +#define ALIGNMENT(value, align) (((value) + (align) - 1) / (align) * (align)) static int _total_video_memory_used = 0; static int _total_video_memory_count = 0; @@ -172,6 +164,7 @@ sisAllocZStencilBuffer( sisContextPtr smesa ) smesa->depthbuffer = (void *) addr; smesa->depthPitch = width2; + smesa->depthOffset = (unsigned long)addr - (unsigned long)smesa->FbBase; /* set pZClearPacket */ memset( &smesa->zClearPacket, 0, sizeof(ENGPACKET) ); diff --git a/src/mesa/drivers/dri/sis/sis_alloc.h b/src/mesa/drivers/dri/sis/sis_alloc.h index 30f5f3ab36d..e76fc53fe23 100644 --- a/src/mesa/drivers/dri/sis/sis_alloc.h +++ b/src/mesa/drivers/dri/sis/sis_alloc.h @@ -17,10 +17,9 @@ Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL -ATI, PRECISION INSIGHT AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, -DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -USE OR OTHER DEALINGS IN THE SOFTWARE. +ERIC ANHOLT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************/ /* $XFree86$ */ diff --git a/src/mesa/drivers/dri/sis/sis_clear.c b/src/mesa/drivers/dri/sis/sis_clear.c index 2506cd5a37b..f71c4c4334b 100644 --- a/src/mesa/drivers/dri/sis/sis_clear.c +++ b/src/mesa/drivers/dri/sis/sis_clear.c @@ -18,7 +18,7 @@ Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL -ATI, PRECISION INSIGHT AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, +ERIC ANHOLT OR SILICON INTEGRATED SYSTEMS CORP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. @@ -35,14 +35,13 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "sis_context.h" #include "sis_state.h" #include "sis_lock.h" -#include "macros.h" + #include "swrast/swrast.h" +#include "macros.h" -#if 0 static GLbitfield sis_3D_Clear( GLcontext * ctx, GLbitfield mask, GLint x, GLint y, GLint width, GLint height ); -#endif static void sis_clear_color_buffer( GLcontext *ctx, GLenum mask, GLint x, GLint y, GLint width, GLint height ); static void sis_clear_z_stencil_buffer( GLcontext * ctx, @@ -55,7 +54,7 @@ set_color_pattern( sisContextPtr smesa, GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha ) { /* XXX only RGB565 and ARGB8888 */ - switch (GET_ColorFormat(smesa)) + switch (smesa->colorFormat) { case DST_FORMAT_ARGB_8888: smesa->clearColorPattern = (alpha << 24) + @@ -76,24 +75,18 @@ sisUpdateZStencilPattern( sisContextPtr smesa, GLclampd z, GLint stencil ) { GLuint zPattern; - if (z <= 0.0f) - zPattern = 0x0; - else if (z >= 1.0f) - zPattern = 0xFFFFFFFF; - else - zPattern = doFPtoFixedNoRound( z, 32 ); - switch (smesa->zFormat) { case SiS_ZFORMAT_Z16: - zPattern = zPattern >> 16; + zPattern = FLOAT_TO_USHORT(z); zPattern |= zPattern << 16; break; case SiS_ZFORMAT_S8Z24: - zPattern = zPattern >> 8; + zPattern = FLOAT_TO_UINT(z) >> 8; zPattern |= stencil << 24; break; case SiS_ZFORMAT_Z32: + zPattern = FLOAT_TO_UINT(z); break; default: assert(0); @@ -122,20 +115,26 @@ sisDDClear( GLcontext * ctx, GLbitfield mask, GLboolean all, width1 = width; height1 = height; } + /* XXX: Scissoring */ LOCK_HARDWARE(); -#if 0 - /* The 3d clear code is disabled because it appears to be slower, even - * in the case of being requested to clear Z and color buffers at the - * same time. + /* Mask out any non-existent buffers */ + if (ctx->Visual.depthBits == 0 || !ctx->Depth.Mask) + mask &= ~DD_DEPTH_BIT; + if (ctx->Visual.stencilBits == 0) + mask &= ~DD_STENCIL_BIT; + + /* The 3d clear code is use for masked clears because I don't know how to do + * masked clears with the 2d functions. 3d isn't used in general because + * it's slower, even in the case of clearing multiple buffers */ - if (mask & (DD_BACK_LEFT_BIT | DD_DEPTH_BIT | DD_STENCIL_BIT)) + if ((smesa->current.hwDstMask != 0xffffffff && + (mask & (DD_BACK_LEFT_BIT | DD_FRONT_LEFT_BIT)) != 0) || + (ctx->Stencil.WriteMask[0] < 0xff && (mask & DD_STENCIL_BIT) != 0) ) { - /* only Clear either depth or stencil buffer */ mask = sis_3D_Clear( ctx, mask, x1, y1, width1, height1 ); } -#endif if ( mask & DD_FRONT_LEFT_BIT || mask & DD_BACK_LEFT_BIT) { sis_clear_color_buffer( ctx, mask, x1, y1, width1, height1 ); @@ -185,7 +184,6 @@ sisDDClearStencil( GLcontext * ctx, GLint s ) sisUpdateZStencilPattern( smesa, ctx->Depth.Clear, s ); } -#if 0 static GLbitfield sis_3D_Clear( GLcontext * ctx, GLbitfield mask, GLint x, GLint y, GLint width, GLint height ) @@ -197,23 +195,20 @@ sis_3D_Clear( GLcontext * ctx, GLbitfield mask, float left, top, right, bottom, zClearVal; GLboolean bClrColor, bClrDepth, bClrStencil; GLint dwPrimitiveSet; - GLint dwEnable1 = 0, dwEnable2 = 0, dwDepthMask = 0, dwSten1 = 0, dwSten2 = 0; + GLint dwEnable1 = 0, dwEnable2 = MASK_ColorMaskWriteEnable; + GLint dwDepthMask = 0, dwSten1 = 0, dwSten2 = 0; GLint dirtyflags = GFLAG_ENABLESETTING | GFLAG_ENABLESETTING2 | GFLAG_CLIPPING | GFLAG_DESTSETTING; - int count; XF86DRIClipRectPtr pExtents; - bClrColor = ((mask & DD_BACK_LEFT_BIT) != 0); - bClrDepth = ((mask & DD_DEPTH_BIT) != 0) && (ctx->Visual.depthBits != 0); - bClrStencil = ((mask & DD_STENCIL_BIT) != 0) && (ctx->Visual.stencilBits != 0); + bClrColor = (mask & (DD_BACK_LEFT_BIT | DD_FRONT_LEFT_BIT)) != 0; + bClrDepth = (mask & DD_DEPTH_BIT) != 0; + bClrStencil = (mask & DD_STENCIL_BIT) != 0; if (smesa->GlobalFlag & GFLAG_RENDER_STATES) sis_update_render_state( smesa ); - if (!bClrColor) - dwEnable2 |= MASK_ColorMaskWriteEnable; - if (bClrStencil) { dwSten1 = STENCIL_FORMAT_8 | SiS_STENCIL_ALWAYS | (ctx->Stencil.Clear << 8) | 0xff; @@ -319,15 +314,19 @@ sis_3D_Clear( GLcontext * ctx, GLbitfield mask, MMIO(REG_3D_TSXb, *(GLint *) &right); MMIO(REG_3D_TSYb, *(GLint *) &bottom); MMIO(REG_3D_TSARGBb, smesa->clearColorPattern); - } + } mEndPrimitive(); + /* If DD_FRONT_LEFT_BIT is set, we've only cleared the front buffer so far */ + if ((mask & DD_FRONT_LEFT_BIT) != 0 && (mask & DD_BACK_LEFT_BIT) != 0) + sis_3D_Clear( ctx, DD_BACK_LEFT_BIT, x, y, width, height ); + smesa->GlobalFlag |= dirtyflags; - return (mask & ~(DD_BACK_LEFT_BIT | DD_DEPTH_BIT | DD_STENCIL_BIT)); + return mask & ~(DD_DEPTH_BIT | DD_STENCIL_BIT | DD_BACK_LEFT_BIT | + DD_FRONT_LEFT_BIT); } -#endif static void sis_bitblt_clear_cmd( sisContextPtr smesa, ENGPACKET * pkt ) @@ -348,7 +347,7 @@ sis_bitblt_clear_cmd( sisContextPtr smesa, ENGPACKET * pkt ) } MMIO(REG_CMD0, *(GLint *) & pkt->stdwCmd); - MMIO(REG_QueueLen, -1); + MMIO(REG_CommandQueue, -1); } static void @@ -358,7 +357,7 @@ sis_clear_color_buffer( GLcontext *ctx, GLenum mask, GLint x, GLint y, sisContextPtr smesa = SIS_CONTEXT(ctx); int count; - GLuint depth = GET_DEPTH (smesa); + GLuint depth = smesa->bytesPerPixel; XF86DRIClipRectPtr pExtents = NULL; GLint xx, yy; GLint x0, y0, width0, height0; @@ -437,11 +436,6 @@ sis_clear_z_stencil_buffer( GLcontext * ctx, GLbitfield mask, { sisContextPtr smesa = SIS_CONTEXT(ctx); - /* TODO: check write mask */ - - if ( smesa->depthbuffer == NULL ) - return; - /* TODO: consider alignment of width, height? */ smesa->zClearPacket.stdwDestPos.wY = y; smesa->zClearPacket.stdwDestPos.wX = x; diff --git a/src/mesa/drivers/dri/sis/sis_common2.h b/src/mesa/drivers/dri/sis/sis_common2.h index 109078e3a9c..40ae451be58 100644 --- a/src/mesa/drivers/dri/sis/sis_common2.h +++ b/src/mesa/drivers/dri/sis/sis_common2.h @@ -18,7 +18,7 @@ of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. -IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR +IN NO EVENT SHALL SILICON INTEGRATED SYSTEMS CORP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. @@ -46,7 +46,6 @@ extern void *sis_debug_malloc(int x); #ifdef GLX_DIRECT_RENDERING # include <stdio.h> -# include <unistd.h> # include <stdlib.h> # include <string.h> typedef struct _Box diff --git a/src/mesa/drivers/dri/sis/sis_context.c b/src/mesa/drivers/dri/sis/sis_context.c index a58cb2963bd..0830e5676f1 100644 --- a/src/mesa/drivers/dri/sis/sis_context.c +++ b/src/mesa/drivers/dri/sis/sis_context.c @@ -18,7 +18,7 @@ Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL -ATI, PRECISION INSIGHT AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, +ERIC ANHOLT OR SILICON INTEGRATED SYSTEMS CORP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. @@ -59,6 +59,21 @@ int GlobalCurrentHwcx = -1; int GlobalHwcxCountBase = 1; int GlobalCmdQueueLen = 0; +#include "xmlpool.h" + +const char __driConfigOptions[] = +DRI_CONF_BEGIN + DRI_CONF_SECTION_DEBUG + DRI_CONF_OPT_BEGIN(agp_disable,bool,false) + DRI_CONF_DESC(en,"Disable AGP vertex dispatch") + DRI_CONF_OPT_END + DRI_CONF_OPT_BEGIN(fallback_force,bool,false) + DRI_CONF_DESC(en,"Force software fallback") + DRI_CONF_OPT_END + DRI_CONF_SECTION_END +DRI_CONF_END; +const GLuint __driNConfigOptions = 2; + static const char * const card_extensions[] = { "GL_ARB_multitexture", @@ -69,28 +84,21 @@ static const char * const card_extensions[] = void WaitEngIdle (sisContextPtr smesa) { - GLubyte *IOBase = GET_IOBase (smesa); - GLbyte cEngineState; + GLuint cEngineState; - cEngineState = *((GLbyte volatile *) (IOBase + 0x8243)); - while (((cEngineState & 0x80) == 0) || - ((cEngineState & 0x40) == 0) || ((cEngineState & 0x20) == 0)) - { - cEngineState = *((GLbyte volatile *) (IOBase + 0x8243)); - } + do { + cEngineState = MMIO_READ(REG_CommandQueue); + } while ((cEngineState & SiS_EngIdle) != SiS_EngIdle); } void Wait2DEngIdle (sisContextPtr smesa) { - GLubyte *IOBase = GET_IOBase (smesa); - GLbyte cEngineState; + GLuint cEngineState; - cEngineState = *((GLbyte volatile *) (IOBase + 0x8243)); - while (!(cEngineState & 0x80)) - { - cEngineState = *((GLbyte volatile *) (IOBase + 0x8243)); - } + do { + cEngineState = MMIO_READ(REG_CommandQueue); + } while ((cEngineState & SiS_EngIdle2d) != SiS_EngIdle2d); } /* To be called from mWait3DCmdQueue. Separate function for profiling @@ -101,9 +109,9 @@ Wait2DEngIdle (sisContextPtr smesa) void WaitingFor3dIdle(sisContextPtr smesa, int wLen) { - while ( *(smesa->CurrentQueueLenPtr) < wLen) { + while (*(smesa->CurrentQueueLenPtr) < wLen) { *(smesa->CurrentQueueLenPtr) = - (*(GLint *)(GET_IOBase(smesa) + REG_QueueLen) & MASK_QueueLen) - 20; + (MMIO_READ(REG_CommandQueue) & MASK_QueueLen) - 20; } } @@ -184,6 +192,10 @@ sisCreateContext( const __GLcontextModes *glVisual, assert (0); } + /* Parse configuration files */ + driParseConfigFiles (&smesa->optionCache, &sisScreen->optionCache, + sisScreen->driScreen->myNum, "sis"); + /* TODO: index mode */ smesa->CurrentQueueLenPtr = &(smesa->sarea->QueueLength); @@ -195,16 +207,17 @@ sisCreateContext( const __GLcontextModes *glVisual, smesa->AGPAddr = sisScreen->agp.handle; /* set AGP command buffer */ - smesa->AGPCmdModeEnabled = GL_FALSE; - if (smesa->AGPSize != 0 && getenv("SIS_NO_AGP") == NULL) { - if (sisScreen->AGPCmdBufSize != 0) { - smesa->AGPCmdBufBase = smesa->AGPBase + sisScreen->AGPCmdBufOffset; - smesa->AGPCmdBufAddr = smesa->AGPAddr + sisScreen->AGPCmdBufOffset; - smesa->AGPCmdBufSize = sisScreen->AGPCmdBufSize; - - smesa->pAGPCmdBufNext = (GLint *)&(smesa->sarea->AGPCmdBufNext); - smesa->AGPCmdModeEnabled = GL_TRUE; - } + if (smesa->AGPSize != 0 && sisScreen->AGPCmdBufSize != 0 && + !driQueryOptionb(&smesa->optionCache, "agp_disable")) + { + smesa->AGPCmdBufBase = smesa->AGPBase + sisScreen->AGPCmdBufOffset; + smesa->AGPCmdBufAddr = smesa->AGPAddr + sisScreen->AGPCmdBufOffset; + smesa->AGPCmdBufSize = sisScreen->AGPCmdBufSize; + + smesa->pAGPCmdBufNext = (GLint *)&(smesa->sarea->AGPCmdBufNext); + smesa->AGPCmdModeEnabled = GL_TRUE; + } else { + smesa->AGPCmdModeEnabled = GL_FALSE; } smesa->GlobalFlag = 0L; @@ -218,6 +231,9 @@ sisCreateContext( const __GLcontextModes *glVisual, _tnl_CreateContext( ctx ); _swsetup_CreateContext( ctx ); + _swrast_allow_pixel_fog( ctx, GL_TRUE ); + _swrast_allow_vertex_fog( ctx, GL_FALSE ); + sisDDInitStateFuncs( ctx ); sisDDInitState( smesa ); /* Initializes smesa->zFormat, important */ sisInitVB( ctx ); @@ -486,12 +502,12 @@ sis_update_texture_state (sisContextPtr smesa) /* texture environment */ if (smesa->GlobalFlag & GFLAG_TEXTUREENV) { MMIO(REG_3D_TextureBlendFactor, prev->hwTexEnvColor); - MMIO(REG_3D_TextureColorBlendSet0, prev->hwTexBlendClr0); + MMIO(REG_3D_TextureColorBlendSet0, prev->hwTexBlendColor0); MMIO(REG_3D_TextureAlphaBlendSet0, prev->hwTexBlendAlpha0); } if (smesa->GlobalFlag & GFLAG_TEXTUREENV_1) { MMIO(REG_3D_TextureBlendFactor, prev->hwTexEnvColor); - MMIO(REG_3D_TextureColorBlendSet1, prev->hwTexBlendClr1); + MMIO(REG_3D_TextureColorBlendSet1, prev->hwTexBlendColor1); MMIO(REG_3D_TextureAlphaBlendSet1, prev->hwTexBlendAlpha1); } diff --git a/src/mesa/drivers/dri/sis/sis_context.h b/src/mesa/drivers/dri/sis/sis_context.h index c4248e5420b..fb4191a6ef2 100644 --- a/src/mesa/drivers/dri/sis/sis_context.h +++ b/src/mesa/drivers/dri/sis/sis_context.h @@ -18,7 +18,7 @@ Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL -ATI, PRECISION INSIGHT AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, +ERIC ANHOLT OR SILICON INTEGRATED SYSTEMS CORP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. @@ -37,6 +37,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "context.h" #include "dri_util.h" +#include "xmlconfig.h" #include "sis_screen.h" #include "sis_common2.h" @@ -198,8 +199,8 @@ typedef struct __GLSiSHardwareRec GLint hwTexEnvColor; /* Texture Blending Setting */ - GLint hwTexBlendClr0; - GLint hwTexBlendClr1; + GLint hwTexBlendColor0; + GLint hwTexBlendColor1; GLint hwTexBlendAlpha0; GLint hwTexBlendAlpha1; @@ -339,6 +340,7 @@ struct sis_context unsigned int backOffset; unsigned int backPitch; GLvoid *depthbuffer; + unsigned int depthOffset; unsigned int depthPitch; void *zbFree, *bbFree; /* Cookies for freeing buffers */ ENGPACKET zClearPacket, cbClearPacket; @@ -361,25 +363,16 @@ struct sis_context sisScreenPtr sisScreen; /* Screen private DRI data */ SISSAREAPrivPtr sarea; /* Private SAREA data */ + + /* Configuration cache */ + driOptionCache optionCache; }; #define SIS_CONTEXT(ctx) ((sisContextPtr)(ctx->DriverCtx)) /* Macros */ #define GET_IOBase(x) ((x)->IOBase) -#define GET_FbBase(x) ((x)->FbBase) -#define GET_AGPBase(x) ((x)->AGPBase) -#define GET_DEPTH(x) ((x)->bytesPerPixel) -#define GET_WIDTH(x) ((x)->displayWidth) -#define GET_FbPos(smesa,x,y) (GET_FbBase(smesa)+(x)*GET_DEPTH(smesa)\ - +(y)*smesa->frontPitch) - -#define GET_ColorFormat(x) ((x)->colorFormat) - -#define GET_RMASK(x) ((x)->redMask) -#define GET_GMASK(x) ((x)->greenMask) -#define GET_BMASK(x) ((x)->blueMask) -#define GET_AMASK(x) ((x)->alphaMask) + #define Y_FLIP(Y) (smesa->bottom - (Y)) #define SISPACKCOLOR565( r, g, b ) \ @@ -410,7 +403,7 @@ struct sis_context /* Update the mirrored queue pointer if it doesn't indicate enough space */ \ if (*(smesa->CurrentQueueLenPtr) < (wLen)) { \ *(smesa->CurrentQueueLenPtr) = \ - (*(GLint *)(GET_IOBase(smesa) + REG_QueueLen) & MASK_QueueLen) - 20; \ + (*(GLint *)(GET_IOBase(smesa) + REG_CommandQueue) & MASK_QueueLen) - 20; \ /* Spin and wait if the queue is actually too full */ \ if (*(smesa->CurrentQueueLenPtr) < (wLen)) \ WaitingFor3dIdle(smesa, wLen); \ diff --git a/src/mesa/drivers/dri/sis/sis_dd.c b/src/mesa/drivers/dri/sis/sis_dd.c index 9dc3688b07f..aecc20e53db 100644 --- a/src/mesa/drivers/dri/sis/sis_dd.c +++ b/src/mesa/drivers/dri/sis/sis_dd.c @@ -18,7 +18,7 @@ Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL -ATI, PRECISION INSIGHT AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, +ERIC ANHOLT OR SILICON INTEGRATED SYSTEMS CORP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. @@ -151,8 +151,7 @@ sisUpdateBufferSize( sisContextPtr smesa ) current->hwZ &= ~MASK_ZBufferPitch; current->hwZ |= smesa->width * z_depth >> 2; - current->hwOffsetZ = ( (GLint)smesa->depthbuffer - - (GLint)GET_FbBase(smesa) ) >> 2; + current->hwOffsetZ = smesa->depthOffset >> 2; if ((current->hwOffsetZ != prev->hwOffsetZ) || (current->hwZ != prev->hwZ)) { prev->hwOffsetZ = current->hwOffsetZ; diff --git a/src/mesa/drivers/dri/sis/sis_dd.h b/src/mesa/drivers/dri/sis/sis_dd.h index 00a94cee564..9ff5f5b00d0 100644 --- a/src/mesa/drivers/dri/sis/sis_dd.h +++ b/src/mesa/drivers/dri/sis/sis_dd.h @@ -17,10 +17,9 @@ Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL -ATI, PRECISION INSIGHT AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, -DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -USE OR OTHER DEALINGS IN THE SOFTWARE. +ERIC ANHOLT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************/ /* $XFree86$ */ diff --git a/src/mesa/drivers/dri/sis/sis_debug.c b/src/mesa/drivers/dri/sis/sis_debug.c index e950bcee015..99cb09c255e 100644 --- a/src/mesa/drivers/dri/sis/sis_debug.c +++ b/src/mesa/drivers/dri/sis/sis_debug.c @@ -18,7 +18,7 @@ of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. -IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR +IN NO EVENT SHALL SILICON INTEGRATED SYSTEMS CORP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. @@ -76,7 +76,6 @@ dump_agp (void *addr, int dword_count) } } -#ifndef _SOLO void d2f_once (GLcontext * ctx) { @@ -155,4 +154,3 @@ dvidmem (unsigned char *addr, int size) close (fh); } } -#endif diff --git a/src/mesa/drivers/dri/sis/sis_debug.h b/src/mesa/drivers/dri/sis/sis_debug.h index 6b7c79698e9..5e2b30912ac 100644 --- a/src/mesa/drivers/dri/sis/sis_debug.h +++ b/src/mesa/drivers/dri/sis/sis_debug.h @@ -18,7 +18,7 @@ of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. -IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR +IN NO EVENT SILICON INTEGRATED SYSTEMS CORP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/src/mesa/drivers/dri/sis/sis_fog.c b/src/mesa/drivers/dri/sis/sis_fog.c index 8daa9a0f5e3..e1230f6b403 100644 --- a/src/mesa/drivers/dri/sis/sis_fog.c +++ b/src/mesa/drivers/dri/sis/sis_fog.c @@ -18,7 +18,7 @@ Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL -ATI, PRECISION INSIGHT AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, +ERIC ANHOLT OR SILICON INTEGRATED SYSTEMS CORP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. @@ -35,6 +35,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "sis_context.h" #include "sis_state.h" #include "swrast/swrast.h" + #include "macros.h" static GLint convertFtToFogFt( GLfloat dwInValue ); @@ -43,6 +44,7 @@ void sisDDFogfv( GLcontext *ctx, GLenum pname, const GLfloat *params ) { sisContextPtr smesa = SIS_CONTEXT(ctx); + __GLSiSHardware *prev = &smesa->prev; __GLSiSHardware *current = &smesa->current; float fArg; @@ -56,29 +58,25 @@ sisDDFogfv( GLcontext *ctx, GLenum pname, const GLfloat *params ) { case GL_LINEAR: current->hwFog |= FOGMODE_LINEAR; - _swrast_allow_pixel_fog( ctx, GL_TRUE ); - _swrast_allow_vertex_fog( ctx, GL_FALSE ); break; case GL_EXP: - if (ctx->Hint.Fog == GL_NICEST || smesa->AGPCmdModeEnabled) { - current->hwFog |= FOGMODE_EXP; - _swrast_allow_pixel_fog( ctx, GL_TRUE ); - _swrast_allow_vertex_fog( ctx, GL_FALSE ); - } else { /* GL_DONTCARE or GL_FASTEST */ - current->hwFog |= FOGMODE_CHEAP; - _swrast_allow_pixel_fog( ctx, GL_FALSE ); - _swrast_allow_vertex_fog( ctx, GL_TRUE ); - } + current->hwFog |= FOGMODE_EXP; break; case GL_EXP2: current->hwFog |= FOGMODE_EXP2; - _swrast_allow_pixel_fog( ctx, GL_TRUE ); - _swrast_allow_vertex_fog( ctx, GL_FALSE ); break; } + if (current->hwFog != prev->hwFog) { + prev->hwFog = current->hwFog; + smesa->GlobalFlag |= GFLAG_FOGSETTING; + } break; case GL_FOG_DENSITY: current->hwFogDensity = convertFtToFogFt( ctx->Fog.Density ); + if (current->hwFogDensity != prev->hwFogDensity) { + prev->hwFogDensity = current->hwFogDensity; + smesa->GlobalFlag |= GFLAG_FOGSETTING; + } break; case GL_FOG_START: case GL_FOG_END: @@ -91,6 +89,13 @@ sisDDFogfv( GLcontext *ctx, GLenum pname, const GLfloat *params ) else current->hwFogFar = doFPtoFixedNoRound( ctx->Fog.End, 6 ); } + if (current->hwFogFar != prev->hwFogFar || + current->hwFogInverse != prev->hwFogInverse) + { + prev->hwFogFar = current->hwFogFar; + prev->hwFogInverse = current->hwFogInverse; + smesa->GlobalFlag |= GFLAG_FOGSETTING; + } break; case GL_FOG_INDEX: /* TODO */ @@ -101,6 +106,10 @@ sisDDFogfv( GLcontext *ctx, GLenum pname, const GLfloat *params ) fogColor |= FLOAT_TO_UBYTE( ctx->Fog.Color[2] ); current->hwFog &= 0xff000000; current->hwFog |= fogColor; + if (current->hwFog != prev->hwFog) { + prev->hwFog = current->hwFog; + smesa->GlobalFlag |= GFLAG_FOGSETTING; + } break; } } diff --git a/src/mesa/drivers/dri/sis/sis_lock.c b/src/mesa/drivers/dri/sis/sis_lock.c index 1972ff4c16f..5e6a0d468d8 100644 --- a/src/mesa/drivers/dri/sis/sis_lock.c +++ b/src/mesa/drivers/dri/sis/sis_lock.c @@ -18,10 +18,9 @@ Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL -ATI, PRECISION INSIGHT AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, -DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -USE OR OTHER DEALINGS IN THE SOFTWARE. +ERIC ANHOLT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************/ diff --git a/src/mesa/drivers/dri/sis/sis_lock.h b/src/mesa/drivers/dri/sis/sis_lock.h index 1c43d8cc34c..fef99319638 100644 --- a/src/mesa/drivers/dri/sis/sis_lock.h +++ b/src/mesa/drivers/dri/sis/sis_lock.h @@ -18,7 +18,7 @@ Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL -ATI, PRECISION INSIGHT AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, +ERIC ANHOLT OR SILICON INTEGRATED SYSTEMS CORP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/src/mesa/drivers/dri/sis/sis_reg.h b/src/mesa/drivers/dri/sis/sis_reg.h index 41d7e74da8d..378692fc1d2 100644 --- a/src/mesa/drivers/dri/sis/sis_reg.h +++ b/src/mesa/drivers/dri/sis/sis_reg.h @@ -1,6 +1,7 @@ /************************************************************************** Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan. +Copyright 2003 Eric Anholt All Rights Reserved. Permission is hereby granted, free of charge, to any person obtaining a @@ -15,13 +16,13 @@ The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. -IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR -ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL +ERIC ANHOLT OR SILICON INTEGRATED SYSTEMS CORP BE LIABLE FOR ANY CLAIM, +DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************/ /* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_reg.h,v 1.3 2000/09/26 15:56:48 tsi Exp $ */ @@ -39,7 +40,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * Define All the Register Address of 6327 */ -#define REG_QueueLen 0x8240 +#define REG_CommandQueue 0x8240 #define REG_3D_TSFSa 0x8800 #define REG_3D_TSZa 0x8804 @@ -217,7 +218,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define REG_3D_TexturePalette 0x8C00 /* - * REG_QueueLen -- (8240h-8243h) + * REG_CommandQueue -- (8240h-8243h) */ #define MASK_QueueLen 0x0000ffff #define SiS_EngIdle2d 0x80000000 @@ -528,17 +529,17 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define FOGMODE_EXP2 0x07000000 /* - * REG_3D_FogStartEnd -- Define Fog Start End Setting (8A34h-8A37h) + * REG_3D_FogStartEnd -- Define Fog Start End Setting (0x8A34 - 0x8A37) */ #define MASK_FogFarDistance 0x0007FFFF /* - * REG_3D_FogStartEnd -- Define Fog End Setting (8A38h-8A3Bh) + * REG_3D_FogStartEnd -- Define Fog End Setting (0x8A38 - 0x8A3B) */ #define MASK_FogInvFarDistance 0x0007FFFF /* - * REG_3D_FogStartEnd -- Define Fog End Setting (0x8A3C - 0x8A3F) + * REG_3D_FogFactorDensity (0x8A3C - 0x8A3F) */ #define MASK_FogDensity 0x0003FFFF #define MASK_FogFactor 0xFF000000 @@ -804,97 +805,27 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * REG_3D_TextureAlphaBlendSet0 (0x8B40 - 0x8B43) * REG_3D_TextureAlphaBlendSet1 (0x8B44 - 0x8B46) */ - -#define A_REPLACE_RGB_STAGE0 0xa1485000 -#define A_REPLACE_A_STAGE0 0xc3230000 -#define L_REPLACE__RGB_STAGE0 0xc1485000 -#define L_REPLACE__A_STAGE0 0x63230000 -#define LA_REPLACE__RGB_STAGE0 0xc1485000 -#define LA_REPLACE__A_STAGE0 0xc3230000 -#define I_REPLACE__RGB_STAGE0 0xc1485000 -#define I_REPLACE__A_STAGE0 0xc3230000 -#define RGB_REPLACE__RGB_STAGE0 0xc1485000 -#define RGB_REPLACE__A_STAGE0 0x63230000 -#define RGBA_REPLACE__RGB_STAGE0 0xc1485000 -#define RGBA_REPLACE__A_STAGE0 0xc3230000 - -#define A_MODULATE_RGB_STAGE0 0xa1485000 -#define A_MODULATE_A_STAGE0 0x63c30000 -#define L_MODULATE__RGB_STAGE0 0xa1705000 -#define L_MODULATE__A_STAGE0 0x63230000 -#define LA_MODULATE__RGB_STAGE0 0xa1705000 -#define LA_MODULATE__A_STAGE0 0x63c30000 -#define I_MODULATE__RGB_STAGE0 0xa1705000 -#define I_MODULATE__A_STAGE0 0x63c30000 -#define RGB_MODULATE__RGB_STAGE0 0xa1705000 -#define RGB_MODULATE__A_STAGE0 0x63230000 -#define RGBA_MODULATE__RGB_STAGE0 0xa1705000 -#define RGBA_MODULATE__A_STAGE0 0x63c30000 - -#define RGB_DECAL__RGB_STAGE0 0xc1485000 -#define RGB_DECAL__A_STAGE0 0x63230000 -#define RGBA_DECAL__RGB_STAGE0 0xc534c001 -#define RGBA_DECAL__A_STAGE0 0x63230000 - -#define A_BLEND_RGB_STAGE0 0xa1485000 -#define A_BLEND_A_STAGE0 0x63c30000 -#define L_BLEND__RGB_STAGE0 0x4530c001 -#define L_BLEND__A_STAGE0 0x63230000 -#define LA_BLEND__RGB_STAGE0 0x4530c001 -#define LA_BLEND__A_STAGE0 0x63c30000 -#define I_BLEND__RGB_STAGE0 0x4530c001 -#define I_BLEND__A_STAGE0 0x46c60001 -#define RGB_BLEND__RGB_STAGE0 0x4530c001 -#define RGB_BLEND__A_STAGE0 0x63230000 -#define RGBA_BLEND__RGB_STAGE0 0x4530c001 -#define RGBA_BLEND__A_STAGE0 0x63c30000 - -#define RGB_STAGE1 0xa1485000 -#define A_STAGE1 0xa3230000 - -#define A_REPLACE_RGB_STAGE1 0xa1485000 -#define A_REPLACE_A_STAGE1 0xe3230000 -#define L_REPLACE__RGB_STAGE1 0xe1485000 -#define L_REPLACE__A_STAGE1 0xa3230000 -#define LA_REPLACE__RGB_STAGE1 0xe1485000 -#define LA_REPLACE__A_STAGE1 0xe3230000 -#define I_REPLACE__RGB_STAGE1 0xe1485000 -#define I_REPLACE__A_STAGE1 0xe3230000 -#define RGB_REPLACE__RGB_STAGE1 0xe1485000 -#define RGB_REPLACE__A_STAGE1 0xa3230000 -#define RGBA_REPLACE__RGB_STAGE1 0xe1485000 -#define RGBA_REPLACE__A_STAGE1 0xe3230000 - -#define A_MODULATE_RGB_STAGE1 0xa1485000 -#define A_MODULATE_A_STAGE1 0xa3e30000 -#define L_MODULATE__RGB_STAGE1 0xa1785000 -#define L_MODULATE__A_STAGE1 0xa3230000 -#define LA_MODULATE__RGB_STAGE1 0xa1785000 -#define LA_MODULATE__A_STAGE1 0xa3e30000 -#define I_MODULATE__RGB_STAGE1 0xa1785000 -#define I_MODULATE__A_STAGE1 0xa3e30000 -#define RGB_MODULATE__RGB_STAGE1 0xa1785000 -#define RGB_MODULATE__A_STAGE1 0xa3230000 -#define RGBA_MODULATE__RGB_STAGE1 0xa1785000 -#define RGBA_MODULATE__A_STAGE1 0xa3e30000 - -#define RGB_DECAL__RGB_STAGE1 0xe1485000 -#define RGB_DECAL__A_STAGE1 0xa3230000 -#define RGBA_DECAL__RGB_STAGE1 0xe5394001 -#define RGBA_DECAL__A_STAGE1 0xa3230000 - -#define A_BLEND_RGB_STAGE1 0xa1485000 -#define A_BLEND_A_STAGE1 0xa3e30000 -#define L_BLEND__RGB_STAGE1 0x45394001 -#define L_BLEND__A_STAGE1 0xa3230000 -#define LA_BLEND__RGB_STAGE1 0x45394001 -#define LA_BLEND__A_STAGE1 0xa3e30000 -#define I_BLEND__RGB_STAGE1 0x45394001 -#define I_BLEND__A_STAGE1 0x4aea0001 -#define RGB_BLEND__RGB_STAGE1 0x45394001 -#define RGB_BLEND__A_STAGE1 0xa3230000 -#define RGBA_BLEND__RGB_STAGE1 0x45394001 -#define RGBA_BLEND__A_STAGE1 0xa3e30000 +#define STAGE0_C_CF 0xa1485000 +#define STAGE0_C_CS 0xc1485000 +#define STAGE0_C_CFCS 0xa1705000 +#define STAGE0_C_CFOMAS_CSAS 0xc534c001 +#define STAGE0_C_CFOMCS_CCCS 0x4530c001 + +#define STAGE0_A_AF 0x63230000 +#define STAGE0_A_AS 0xc3230000 +#define STAGE0_A_AFAS 0x63c30000 +#define STAGE0_A_AFOMAS_ACAS 0x46c60001 + +#define STAGE1_C_CF 0xa1485000 +#define STAGE1_C_CS 0xe1485000 +#define STAGE1_C_CFCS 0xa1785000 +#define STAGE1_C_CFOMAS_CSAS 0xe5394001 +#define STAGE1_C_CFOMCS_CCCS 0x45394001 + +#define STAGE1_A_AF 0xa3230000 +#define STAGE1_A_AS 0xe3230000 +#define STAGE1_A_AFAS 0xa3e30000 +#define STAGE1_A_AFOMAS_ACAS 0x4aea0001 /* What registers are these associated with? */ #define MASK_BMMemoryInSystem 0x00000080 diff --git a/src/mesa/drivers/dri/sis/sis_screen.c b/src/mesa/drivers/dri/sis/sis_screen.c index 1de992e18b5..a43f2be8c0e 100644 --- a/src/mesa/drivers/dri/sis/sis_screen.c +++ b/src/mesa/drivers/dri/sis/sis_screen.c @@ -18,10 +18,9 @@ Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL -ATI, PRECISION INSIGHT AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, -DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -USE OR OTHER DEALINGS IN THE SOFTWARE. +ERIC ANHOLT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************/ @@ -86,6 +85,9 @@ sisCreateScreen( __DRIscreenPrivate *sPriv ) sisScreen->driScreen = sPriv; + /* parse information in __driConfigOptions */ + driParseOptionInfo(&sisScreen->optionCache); + return sisScreen; } @@ -150,7 +152,7 @@ sis_bitblt_copy_cmd (sisContextPtr smesa, ENGPACKET * pkt) *lpdwDest++ = *lpdwSrc++; MMIO(REG_CMD0, *(GLint *)&pkt->stdwCmd); - MMIO(REG_QueueLen, -1); + MMIO(REG_CommandQueue, -1); } static void sisCopyBuffer( __DRIdrawablePrivate *dPriv ) @@ -266,7 +268,6 @@ static struct __DriverAPIRec sisAPI = { * The __driCreateScreen name is the symbol that libGL.so fetches. * Return: pointer to a __DRIscreenPrivate. */ -#ifndef _SOLO void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc, int numConfigs, __GLXvisualConfig *config) { @@ -274,12 +275,3 @@ void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc, psp = __driUtilCreateScreen( dpy, scrn, psc, numConfigs, config, &sisAPI ); return (void *)psp; } -#else -void *__driCreateScreen(struct DRIDriverRec *driver, - struct DRIDriverContextRec *driverContext) -{ - __DRIscreenPrivate *psp; - psp = __driUtilCreateScreen(driver, driverContext, &sisAPI); - return (void *) psp; -} -#endif diff --git a/src/mesa/drivers/dri/sis/sis_screen.h b/src/mesa/drivers/dri/sis/sis_screen.h index e2c67c16f2f..452278264f1 100644 --- a/src/mesa/drivers/dri/sis/sis_screen.h +++ b/src/mesa/drivers/dri/sis/sis_screen.h @@ -17,10 +17,9 @@ Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL -ATI, PRECISION INSIGHT AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, -DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -USE OR OTHER DEALINGS IN THE SOFTWARE. +ERIC ANHOLT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************/ /* $XFree86$ */ @@ -55,6 +54,9 @@ typedef struct { __DRIscreenPrivate *driScreen; unsigned int sarea_priv_offset; + /* Configuration cache with default values for all contexts */ + driOptionCache optionCache; + } sisScreenRec, *sisScreenPtr; #endif diff --git a/src/mesa/drivers/dri/sis/sis_span.c b/src/mesa/drivers/dri/sis/sis_span.c index 202454a06af..05e1777891c 100644 --- a/src/mesa/drivers/dri/sis/sis_span.c +++ b/src/mesa/drivers/dri/sis/sis_span.c @@ -18,7 +18,7 @@ Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL -ATI, PRECISION INSIGHT AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, +ERIC ANHOLT OR SILICON INTEGRATED SYSTEMS CORP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/src/mesa/drivers/dri/sis/sis_span.h b/src/mesa/drivers/dri/sis/sis_span.h index cfc19606c72..f0d64df19c4 100644 --- a/src/mesa/drivers/dri/sis/sis_span.h +++ b/src/mesa/drivers/dri/sis/sis_span.h @@ -17,10 +17,9 @@ Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL -ATI, PRECISION INSIGHT AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, -DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -USE OR OTHER DEALINGS IN THE SOFTWARE. +ERIC ANHOLT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************/ /* $XFree86$ */ diff --git a/src/mesa/drivers/dri/sis/sis_state.c b/src/mesa/drivers/dri/sis/sis_state.c index 9d093595a1c..8ff067f56d7 100644 --- a/src/mesa/drivers/dri/sis/sis_state.c +++ b/src/mesa/drivers/dri/sis/sis_state.c @@ -18,7 +18,7 @@ Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL -ATI, PRECISION INSIGHT AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, +ERIC ANHOLT OR SILICON INTEGRATED SYSTEMS CORP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. @@ -366,10 +366,10 @@ static void sisDDColorMask( GLcontext *ctx, current->hwCapEnable2 |= (MASK_AlphaMaskWriteEnable | MASK_ColorMaskWriteEnable); - current->hwDstMask = (r) ? GET_RMASK(smesa) : 0 | - (g) ? GET_GMASK(smesa) : 0 | - (b) ? GET_BMASK(smesa) : 0 | - (a) ? GET_AMASK(smesa) : 0; + current->hwDstMask = (r) ? smesa->redMask : 0 | + (g) ? smesa->greenMask : 0 | + (b) ? smesa->blueMask : 0 | + (a) ? smesa->alphaMask : 0; } if (current->hwDstMask != prev->hwDstMask) { @@ -542,19 +542,6 @@ void sisDDDrawBuffer( GLcontext *ctx, GLenum mode ) } } -static void -sisDDHint( GLcontext *ctx, GLenum target, GLenum mode ) -{ - - switch (target) { - case GL_FOG_HINT: - /* Update fog mode setting */ - sisDDFogfv(ctx, GL_FOG_MODE, NULL); - break; - } - -} - /* ============================================================= * Polygon stipple */ @@ -713,27 +700,6 @@ sisUpdateHWState( GLcontext *ctx ) smesa->GlobalFlag |= GFLAG_ENABLESETTING2; } - /* TODO: if fog disable, don't check */ - if (current->hwCapEnable & MASK_FogEnable) { - /* fog setting */ - if (current->hwFog != prev->hwFog) { - prev->hwFog = current->hwFog; - smesa->GlobalFlag |= GFLAG_FOGSETTING; - } - if (current->hwFogFar != prev->hwFogFar) { - prev->hwFogFar = current->hwFogFar; - smesa->GlobalFlag |= GFLAG_FOGSETTING; - } - if (current->hwFogInverse != prev->hwFogInverse) { - prev->hwFogInverse = current->hwFogInverse; - smesa->GlobalFlag |= GFLAG_FOGSETTING; - } - if (current->hwFogDensity != prev->hwFogDensity) { - prev->hwFogDensity = current->hwFogDensity; - smesa->GlobalFlag |= GFLAG_FOGSETTING; - } - } - if (smesa->GlobalFlag & GFLAG_RENDER_STATES) sis_update_render_state( smesa ); @@ -808,11 +774,11 @@ void sisDDInitState( sisContextPtr smesa ) prev->texture[0].hwTextureMip = 0; #endif - /* Texture Blending seeting */ - prev->hwTexBlendClr0 = L_REPLACE__RGB_STAGE0; - prev->hwTexBlendClr1 = 0x294B4000; - prev->hwTexBlendAlpha0 = 0x333A0000; - prev->hwTexBlendAlpha1 = 0x333A0000; + /* Texture Blending setting -- use fragment color/alpha*/ + prev->hwTexBlendColor0 = STAGE0_C_CF; + prev->hwTexBlendColor1 = STAGE1_C_CF; + prev->hwTexBlendAlpha0 = STAGE0_A_AF; + prev->hwTexBlendAlpha1 = STAGE1_A_AF; switch (smesa->bytesPerPixel) { @@ -892,7 +858,7 @@ void sisDDInitStateFuncs( GLcontext *ctx ) ctx->Driver.Enable = sisDDEnable; ctx->Driver.FrontFace = sisDDFrontFace; ctx->Driver.Fogfv = sisDDFogfv; - ctx->Driver.Hint = sisDDHint; + ctx->Driver.Hint = NULL; ctx->Driver.Lightfv = NULL; ctx->Driver.LogicOpcode = sisDDLogicOpCode; ctx->Driver.PolygonMode = NULL; diff --git a/src/mesa/drivers/dri/sis/sis_state.h b/src/mesa/drivers/dri/sis/sis_state.h index 49ecdfa1bae..b7251157fbe 100644 --- a/src/mesa/drivers/dri/sis/sis_state.h +++ b/src/mesa/drivers/dri/sis/sis_state.h @@ -17,10 +17,9 @@ Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL -ATI, PRECISION INSIGHT AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, -DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -USE OR OTHER DEALINGS IN THE SOFTWARE. +ERIC ANHOLT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************/ /* $XFree86$ */ diff --git a/src/mesa/drivers/dri/sis/sis_stencil.c b/src/mesa/drivers/dri/sis/sis_stencil.c index 3d7a1d5e6aa..a31d49ca270 100644 --- a/src/mesa/drivers/dri/sis/sis_stencil.c +++ b/src/mesa/drivers/dri/sis/sis_stencil.c @@ -18,7 +18,7 @@ Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL -ATI, PRECISION INSIGHT AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, +ERIC ANHOLT OR SILICON INTEGRATED SYSTEMS CORP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/src/mesa/drivers/dri/sis/sis_stencil.h b/src/mesa/drivers/dri/sis/sis_stencil.h index 01d4cb6ef27..db6098ff049 100644 --- a/src/mesa/drivers/dri/sis/sis_stencil.h +++ b/src/mesa/drivers/dri/sis/sis_stencil.h @@ -17,10 +17,9 @@ Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL -ATI, PRECISION INSIGHT AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, -DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -USE OR OTHER DEALINGS IN THE SOFTWARE. +ERIC ANHOLT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************/ /* $XFree86$ */ diff --git a/src/mesa/drivers/dri/sis/sis_tex.c b/src/mesa/drivers/dri/sis/sis_tex.c index 52080b7037e..6056e9293cc 100644 --- a/src/mesa/drivers/dri/sis/sis_tex.c +++ b/src/mesa/drivers/dri/sis/sis_tex.c @@ -17,10 +17,9 @@ Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL -ATI, PRECISION INSIGHT AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, -DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -USE OR OTHER DEALINGS IN THE SOFTWARE. +ERIC ANHOLT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************/ /* $XFree86$ */ diff --git a/src/mesa/drivers/dri/sis/sis_tex.h b/src/mesa/drivers/dri/sis/sis_tex.h index 188cce5a50f..b2f2ba0cbd6 100644 --- a/src/mesa/drivers/dri/sis/sis_tex.h +++ b/src/mesa/drivers/dri/sis/sis_tex.h @@ -17,10 +17,9 @@ Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL -ATI, PRECISION INSIGHT AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, -DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -USE OR OTHER DEALINGS IN THE SOFTWARE. +ERIC ANHOLT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************/ /* $XFree86$ */ diff --git a/src/mesa/drivers/dri/sis/sis_texstate.c b/src/mesa/drivers/dri/sis/sis_texstate.c index 23f72589a7e..001eb18a140 100644 --- a/src/mesa/drivers/dri/sis/sis_texstate.c +++ b/src/mesa/drivers/dri/sis/sis_texstate.c @@ -18,7 +18,7 @@ Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL -ATI, PRECISION INSIGHT AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, +ERIC ANHOLT OR SILICON INTEGRATED SYSTEMS CORP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. @@ -60,11 +60,6 @@ sis_set_texture_env0( GLcontext *ctx, struct gl_texture_object *texObj, sisTexObjPtr t = texObj->DriverData; - /* - current->hwTexBlendClr0 = RGB_STAGE1; - current->hwTexBlendAlpha0 = A_STAGE1; - */ - switch (texture_unit->EnvMode) { case GL_REPLACE: @@ -72,19 +67,19 @@ sis_set_texture_env0( GLcontext *ctx, struct gl_texture_object *texObj, switch (t->format) { case GL_ALPHA: - current->hwTexBlendClr0 = A_REPLACE_RGB_STAGE0; - current->hwTexBlendAlpha0 = A_REPLACE_A_STAGE0; + current->hwTexBlendColor0 = STAGE0_C_CF; + current->hwTexBlendAlpha0 = STAGE0_A_AS; break; case GL_LUMINANCE: case GL_RGB: - current->hwTexBlendClr0 = RGB_REPLACE__RGB_STAGE0; - current->hwTexBlendAlpha0 = RGB_REPLACE__A_STAGE0; + current->hwTexBlendColor0 = STAGE0_C_CS; + current->hwTexBlendAlpha0 = STAGE0_A_AF; break; case GL_INTENSITY: case GL_LUMINANCE_ALPHA: case GL_RGBA: - current->hwTexBlendClr0 = RGBA_REPLACE__RGB_STAGE0; - current->hwTexBlendAlpha0 = RGBA_REPLACE__A_STAGE0; + current->hwTexBlendColor0 = STAGE0_C_CS; + current->hwTexBlendAlpha0 = STAGE0_A_AS; break; } break; @@ -94,19 +89,19 @@ sis_set_texture_env0( GLcontext *ctx, struct gl_texture_object *texObj, switch (t->format) { case GL_ALPHA: - current->hwTexBlendClr0 = A_MODULATE_RGB_STAGE0; - current->hwTexBlendAlpha0 = A_MODULATE_A_STAGE0; + current->hwTexBlendColor0 = STAGE0_C_CF; + current->hwTexBlendAlpha0 = STAGE0_A_AFAS; break; case GL_LUMINANCE: case GL_RGB: - current->hwTexBlendClr0 = RGB_MODULATE__RGB_STAGE0; - current->hwTexBlendAlpha0 = RGB_MODULATE__A_STAGE0; + current->hwTexBlendColor0 = STAGE0_C_CFCS; + current->hwTexBlendAlpha0 = STAGE0_A_AF; break; case GL_INTENSITY: case GL_LUMINANCE_ALPHA: case GL_RGBA: - current->hwTexBlendClr0 = RGBA_MODULATE__RGB_STAGE0; - current->hwTexBlendAlpha0 = RGBA_MODULATE__A_STAGE0; + current->hwTexBlendColor0 = STAGE0_C_CFCS; + current->hwTexBlendAlpha0 = STAGE0_A_AFAS; break; } break; @@ -116,12 +111,12 @@ sis_set_texture_env0( GLcontext *ctx, struct gl_texture_object *texObj, switch (t->format) { case GL_RGB: - current->hwTexBlendClr0 = RGB_DECAL__RGB_STAGE0; - current->hwTexBlendAlpha0 = RGB_DECAL__A_STAGE0; + current->hwTexBlendColor0 = STAGE0_C_CS; + current->hwTexBlendAlpha0 = STAGE0_A_AF; break; case GL_RGBA: - current->hwTexBlendClr0 = RGBA_DECAL__RGB_STAGE0; - current->hwTexBlendAlpha0 = RGBA_DECAL__A_STAGE0; + current->hwTexBlendColor0 = STAGE0_C_CFOMAS_CSAS; + current->hwTexBlendAlpha0 = STAGE0_A_AF; break; } break; @@ -137,34 +132,34 @@ sis_set_texture_env0( GLcontext *ctx, struct gl_texture_object *texObj, switch (t->format) { case GL_ALPHA: - current->hwTexBlendClr0 = A_BLEND_RGB_STAGE0; - current->hwTexBlendAlpha0 = A_BLEND_A_STAGE0; + current->hwTexBlendColor0 = STAGE0_C_CF; + current->hwTexBlendAlpha0 = STAGE0_A_AFAS; break; case GL_LUMINANCE: case GL_RGB: - current->hwTexBlendClr0 = RGB_BLEND__RGB_STAGE0; - current->hwTexBlendAlpha0 = RGB_BLEND__A_STAGE0; + current->hwTexBlendColor0 = STAGE0_C_CFOMCS_CCCS; + current->hwTexBlendAlpha0 = STAGE0_A_AF; break; case GL_INTENSITY: - current->hwTexBlendClr0 = I_BLEND__RGB_STAGE0; - current->hwTexBlendAlpha0 = I_BLEND__A_STAGE0; + current->hwTexBlendColor0 = STAGE0_C_CFOMCS_CCCS; + current->hwTexBlendAlpha0 = STAGE0_A_AFOMAS_ACAS; break; case GL_LUMINANCE_ALPHA: case GL_RGBA: - current->hwTexBlendClr0 = RGBA_BLEND__RGB_STAGE0; - current->hwTexBlendAlpha0 = RGBA_BLEND__A_STAGE0; + current->hwTexBlendColor0 = STAGE0_C_CFOMCS_CCCS; + current->hwTexBlendAlpha0 = STAGE0_A_AFAS; break; } break; #endif } - if ((current->hwTexBlendClr0 != prev->hwTexBlendClr0) || + if ((current->hwTexBlendColor0 != prev->hwTexBlendColor0) || (current->hwTexBlendAlpha0 != prev->hwTexBlendAlpha0) || (current->hwTexEnvColor != prev->hwTexEnvColor)) { prev->hwTexEnvColor = current->hwTexEnvColor; - prev->hwTexBlendClr0 = current->hwTexBlendClr0; + prev->hwTexBlendColor0 = current->hwTexBlendColor0; prev->hwTexBlendAlpha0 = current->hwTexBlendAlpha0; smesa->GlobalFlag |= GFLAG_TEXTUREENV; } @@ -184,11 +179,6 @@ sis_set_texture_env1( GLcontext *ctx, struct gl_texture_object *texObj, sisTexObjPtr t = texObj->DriverData; - /* - current->hwTexBlendClr1 = RGB_STAGE1; current->hwTexBlendAlpha1 = - A_STAGE1; - */ - switch (texture_unit->EnvMode) { case GL_REPLACE: @@ -196,19 +186,19 @@ sis_set_texture_env1( GLcontext *ctx, struct gl_texture_object *texObj, switch (t->format) { case GL_ALPHA: - current->hwTexBlendClr1 = A_REPLACE_RGB_STAGE1; - current->hwTexBlendAlpha1 = A_REPLACE_A_STAGE1; + current->hwTexBlendColor1 = STAGE1_C_CF; + current->hwTexBlendAlpha1 = STAGE1_A_AS; break; case GL_LUMINANCE: case GL_RGB: - current->hwTexBlendClr1 = RGB_REPLACE__RGB_STAGE1; - current->hwTexBlendAlpha1 = RGB_REPLACE__A_STAGE1; + current->hwTexBlendColor1 = STAGE1_C_CS; + current->hwTexBlendAlpha1 = STAGE1_A_AF; break; case GL_INTENSITY: case GL_LUMINANCE_ALPHA: case GL_RGBA: - current->hwTexBlendClr1 = RGBA_REPLACE__RGB_STAGE1; - current->hwTexBlendAlpha1 = RGBA_REPLACE__A_STAGE1; + current->hwTexBlendColor1 = STAGE1_C_CS; + current->hwTexBlendAlpha1 = STAGE1_A_AS; break; } break; @@ -218,19 +208,19 @@ sis_set_texture_env1( GLcontext *ctx, struct gl_texture_object *texObj, switch (t->format) { case GL_ALPHA: - current->hwTexBlendClr1 = A_MODULATE_RGB_STAGE1; - current->hwTexBlendAlpha1 = A_MODULATE_A_STAGE1; + current->hwTexBlendColor1 = STAGE1_C_CF; + current->hwTexBlendAlpha1 = STAGE1_A_AFAS; break; case GL_LUMINANCE: case GL_RGB: - current->hwTexBlendClr1 = RGB_MODULATE__RGB_STAGE1; - current->hwTexBlendAlpha1 = RGB_MODULATE__A_STAGE1; + current->hwTexBlendColor1 = STAGE1_C_CFCS; + current->hwTexBlendAlpha1 = STAGE1_A_AF; break; case GL_INTENSITY: case GL_LUMINANCE_ALPHA: case GL_RGBA: - current->hwTexBlendClr1 = RGBA_MODULATE__RGB_STAGE1; - current->hwTexBlendAlpha1 = RGBA_MODULATE__A_STAGE1; + current->hwTexBlendColor1 = STAGE1_C_CFCS; + current->hwTexBlendAlpha1 = STAGE1_A_AFAS; break; } break; @@ -240,12 +230,12 @@ sis_set_texture_env1( GLcontext *ctx, struct gl_texture_object *texObj, switch (t->format) { case GL_RGB: - current->hwTexBlendClr1 = RGB_DECAL__RGB_STAGE1; - current->hwTexBlendAlpha1 = RGB_DECAL__A_STAGE1; + current->hwTexBlendColor1 = STAGE1_C_CS; + current->hwTexBlendAlpha1 = STAGE1_A_AF; break; case GL_RGBA: - current->hwTexBlendClr1 = RGBA_DECAL__RGB_STAGE1; - current->hwTexBlendAlpha1 = RGBA_DECAL__A_STAGE1; + current->hwTexBlendColor1 = STAGE1_C_CFOMAS_CSAS; + current->hwTexBlendAlpha1 = STAGE1_A_AF; break; } break; @@ -261,33 +251,33 @@ sis_set_texture_env1( GLcontext *ctx, struct gl_texture_object *texObj, switch (t->format) { case GL_ALPHA: - current->hwTexBlendClr1 = A_BLEND_RGB_STAGE1; - current->hwTexBlendAlpha1 = A_BLEND_A_STAGE1; + current->hwTexBlendColor1 = STAGE1_C_CF; + current->hwTexBlendAlpha1 = STAGE1_A_AFAS; break; case GL_LUMINANCE: case GL_RGB: - current->hwTexBlendClr1 = RGB_BLEND__RGB_STAGE1; - current->hwTexBlendAlpha1 = RGB_BLEND__A_STAGE1; + current->hwTexBlendColor1 = STAGE1_C_CFOMCS_CCCS; + current->hwTexBlendAlpha1 = STAGE1_A_AF; break; case GL_INTENSITY: - current->hwTexBlendClr1 = I_BLEND__RGB_STAGE1; - current->hwTexBlendAlpha1 = I_BLEND__A_STAGE1; + current->hwTexBlendColor1 = STAGE1_C_CFOMCS_CCCS; + current->hwTexBlendAlpha1 = STAGE1_A_AFOMAS_ACAS; break; case GL_LUMINANCE_ALPHA: case GL_RGBA: - current->hwTexBlendClr1 = RGBA_BLEND__RGB_STAGE1; - current->hwTexBlendAlpha1 = RGBA_BLEND__A_STAGE1; + current->hwTexBlendColor1 = STAGE1_C_CFOMCS_CCCS; + current->hwTexBlendAlpha1 = STAGE1_A_AFAS; break; } break; #endif } - if ((current->hwTexBlendClr1 != prev->hwTexBlendClr1) || + if ((current->hwTexBlendColor1 != prev->hwTexBlendColor1) || (current->hwTexBlendAlpha1 != prev->hwTexBlendAlpha1) || (current->hwTexEnvColor != prev->hwTexEnvColor)) { - prev->hwTexBlendClr1 = current->hwTexBlendClr1; + prev->hwTexBlendColor1 = current->hwTexBlendColor1; prev->hwTexBlendAlpha1 = current->hwTexBlendAlpha1; prev->hwTexEnvColor = current->hwTexEnvColor; smesa->GlobalFlag |= GFLAG_TEXTUREENV_1; @@ -562,27 +552,27 @@ sis_reset_texture_env (GLcontext *ctx, int hw_unit) if (hw_unit == 1) { - current->hwTexBlendClr1 = RGB_STAGE1; - current->hwTexBlendAlpha1 = A_STAGE1; + current->hwTexBlendColor1 = STAGE1_C_CF; + current->hwTexBlendAlpha1 = STAGE1_A_AF; - if ((current->hwTexBlendClr1 != prev->hwTexBlendClr1) || + if ((current->hwTexBlendColor1 != prev->hwTexBlendColor1) || (current->hwTexBlendAlpha1 != prev->hwTexBlendAlpha1) || (current->hwTexEnvColor != prev->hwTexEnvColor)) { - prev->hwTexBlendClr1 = current->hwTexBlendClr1; + prev->hwTexBlendColor1 = current->hwTexBlendColor1; prev->hwTexBlendAlpha1 = current->hwTexBlendAlpha1; prev->hwTexEnvColor = current->hwTexEnvColor; smesa->GlobalFlag |= GFLAG_TEXTUREENV_1; } } else { - current->hwTexBlendClr0 = RGB_STAGE1; - current->hwTexBlendAlpha0 = A_STAGE1; + current->hwTexBlendColor0 = STAGE0_C_CF; + current->hwTexBlendAlpha0 = STAGE0_A_AF; - if ((current->hwTexBlendClr0 != prev->hwTexBlendClr0) || + if ((current->hwTexBlendColor0 != prev->hwTexBlendColor0) || (current->hwTexBlendAlpha0 != prev->hwTexBlendAlpha0) || (current->hwTexEnvColor != prev->hwTexEnvColor)) { - prev->hwTexBlendClr0 = current->hwTexBlendClr0; + prev->hwTexBlendColor0 = current->hwTexBlendColor0; prev->hwTexBlendAlpha0 = current->hwTexBlendAlpha0; prev->hwTexEnvColor = current->hwTexEnvColor; smesa->GlobalFlag |= GFLAG_TEXTUREENV; diff --git a/src/mesa/drivers/dri/sis/sis_tris.c b/src/mesa/drivers/dri/sis/sis_tris.c index d76431f41d2..4877e346503 100644 --- a/src/mesa/drivers/dri/sis/sis_tris.c +++ b/src/mesa/drivers/dri/sis/sis_tris.c @@ -19,7 +19,7 @@ Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL -ATI, PRECISION INSIGHT AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, +ERIC ANHOLT OR SILICON INTEGRATED SYSTEMS CORP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. @@ -943,7 +943,7 @@ void sisInitTriFuncs( GLcontext *ctx ) tnl->Driver.Render.BuildVertices = sisBuildVertices; tnl->Driver.Render.Multipass = NULL; - if (getenv("SIS_FORCE_FALLBACK") != NULL) + if (driQueryOptionb(&smesa->optionCache, "fallback_force")) sisFallback(ctx, SIS_FALLBACK_FORCE, 1); else sisFallback(ctx, SIS_FALLBACK_FORCE, 0); diff --git a/src/mesa/drivers/dri/sis/sis_tris.h b/src/mesa/drivers/dri/sis/sis_tris.h index 775c1072a77..d0ca7c12c0e 100644 --- a/src/mesa/drivers/dri/sis/sis_tris.h +++ b/src/mesa/drivers/dri/sis/sis_tris.h @@ -18,10 +18,9 @@ Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL -ATI, PRECISION INSIGHT AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, -DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -USE OR OTHER DEALINGS IN THE SOFTWARE. +ERIC ANHOLT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************/ diff --git a/src/mesa/drivers/dri/sis/sis_tritmp.h b/src/mesa/drivers/dri/sis/sis_tritmp.h index 50564412a0a..77596585430 100644 --- a/src/mesa/drivers/dri/sis/sis_tritmp.h +++ b/src/mesa/drivers/dri/sis/sis_tritmp.h @@ -18,10 +18,9 @@ Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL -ATI, PRECISION INSIGHT AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, -DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -USE OR OTHER DEALINGS IN THE SOFTWARE. +ERIC ANHOLT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************/ diff --git a/src/mesa/drivers/dri/sis/sis_vb.c b/src/mesa/drivers/dri/sis/sis_vb.c index 5c17bd3801a..620c1d6f105 100644 --- a/src/mesa/drivers/dri/sis/sis_vb.c +++ b/src/mesa/drivers/dri/sis/sis_vb.c @@ -18,10 +18,9 @@ Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL -ATI, PRECISION INSIGHT AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, -DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -USE OR OTHER DEALINGS IN THE SOFTWARE. +ERIC ANHOLT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************/ diff --git a/src/mesa/drivers/dri/sis/sis_vb.h b/src/mesa/drivers/dri/sis/sis_vb.h index 8efdcf26b6d..68965298876 100644 --- a/src/mesa/drivers/dri/sis/sis_vb.h +++ b/src/mesa/drivers/dri/sis/sis_vb.h @@ -18,10 +18,9 @@ Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL -ATI, PRECISION INSIGHT AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, -DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -USE OR OTHER DEALINGS IN THE SOFTWARE. +ERIC ANHOLT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************/ |