summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri
diff options
context:
space:
mode:
authorFelix Kuehling <[email protected]>2005-01-05 23:56:16 +0000
committerFelix Kuehling <[email protected]>2005-01-05 23:56:16 +0000
commit3e4d4aca77479f7c9cef8fdc218c20d1f2876433 (patch)
treea05120785e2742612ca6099d586a3f5ea5448223 /src/mesa/drivers/dri
parent1e21673ea14ad1368fcebbc4d5dde8746497d782 (diff)
* Fixed handling of scissors
* Only set scissor regs directly if drmMinor < 1 * Don't set texaddr to 0 when a texture unit is disabled. That would trigger the tightened texture state check in the DRM if the texaddr and texdesc registers were not emitted atomically.
Diffstat (limited to 'src/mesa/drivers/dri')
-rw-r--r--src/mesa/drivers/dri/savage/savagestate.c41
-rw-r--r--src/mesa/drivers/dri/savage/savagetex.c4
-rw-r--r--src/mesa/drivers/dri/savage/savagetris.c6
3 files changed, 8 insertions, 43 deletions
diff --git a/src/mesa/drivers/dri/savage/savagestate.c b/src/mesa/drivers/dri/savage/savagestate.c
index ec3b5c4adc0..107344c703b 100644
--- a/src/mesa/drivers/dri/savage/savagestate.c
+++ b/src/mesa/drivers/dri/savage/savagestate.c
@@ -1202,6 +1202,8 @@ static void savageDDEnable_s4(GLcontext *ctx, GLenum cap, GLboolean state)
case GL_SCISSOR_TEST:
imesa->scissor = state;
imesa->dirty |= SAVAGE_UPLOAD_CLIPRECTS;
+ savageDDScissor(ctx, ctx->Scissor.X, ctx->Scissor.Y,
+ ctx->Scissor.Width, ctx->Scissor.Height);
break;
case GL_STENCIL_TEST:
if (!imesa->hw_stencil)
@@ -1292,6 +1294,8 @@ static void savageDDEnable_s3d(GLcontext *ctx, GLenum cap, GLboolean state)
case GL_SCISSOR_TEST:
imesa->scissor = state;
imesa->dirty |= SAVAGE_UPLOAD_CLIPRECTS;
+ savageDDScissor(ctx, ctx->Scissor.X, ctx->Scissor.Y,
+ ctx->Scissor.Width, ctx->Scissor.Height);
break;
case GL_STENCIL_TEST:
FALLBACK (ctx, SAVAGE_FALLBACK_STENCIL, state);
@@ -1505,7 +1509,7 @@ static void savageUpdateRegister_s4(savageContextPtr imesa)
/*
* Scissors updates drawctrl0 and drawctrl 1
*/
- if (imesa->scissorChanged)
+ if (imesa->scissorChanged && imesa->savageScreen->driScrnPriv->drmMinor < 1)
{
if(imesa->scissor)
{
@@ -1521,6 +1525,7 @@ static void savageUpdateRegister_s4(savageContextPtr imesa)
imesa->regs.s4.drawCtrl1.ni.scissorXEnd = imesa->draw_rect.x2-1;
imesa->regs.s4.drawCtrl1.ni.scissorYEnd = imesa->draw_rect.y2-1;
}
+ imesa->scissorChanged = GL_FALSE;
}
/* the savage4 uses the contiguous range of BCI registers 0x1e-0x39
@@ -1531,7 +1536,7 @@ static void savageUpdateRegister_s4(savageContextPtr imesa)
}
static void savageUpdateRegister_s3d(savageContextPtr imesa)
{
- if (imesa->scissorChanged)
+ if (imesa->scissorChanged && imesa->savageScreen->driScrnPriv->drmMinor < 1)
{
if(imesa->scissor)
{
@@ -1555,6 +1560,7 @@ static void savageUpdateRegister_s3d(savageContextPtr imesa)
imesa->regs.s3d.scissorsEnd.ni.scissorYEnd =
imesa->draw_rect.y2-1;
}
+ imesa->scissorChanged = GL_FALSE;
}
/* Some temporary hacks to workaround lockups. Not sure if they are
@@ -1845,37 +1851,6 @@ void savageDDInitState( savageContextPtr imesa ) {
NEW_TEXTURE_MATRIX|\
NEW_USER_CLIP|NEW_CLIENT_STATE))
-void savageDDRenderStart(GLcontext *ctx)
-{
- savageContextPtr imesa = SAVAGE_CONTEXT( ctx );
- __DRIdrawablePrivate *dPriv = imesa->driDrawable;
- drm_clip_rect_t *pbox;
- GLint nbox;
-
- /* if the screen is overrided by other application. set the scissor.
- * In MulitPass, re-render the screen.
- */
- pbox = dPriv->pClipRects;
- nbox = dPriv->numClipRects;
- if (nbox)
- {
- imesa->currentClip = nbox;
- /* set scissor to the first clip box*/
- savageDDScissor(ctx,pbox->x1,pbox->y1,pbox->x2,pbox->y2);
-
- /*savageDDUpdateHwState(ctx);*/ /* update to hardware register*/
- }
- else /* need not render at all*/
- {
- /*ctx->VB->CopyStart = ctx->VB->Count;*/
- }
-}
-
-
-void savageDDRenderEnd(GLcontext *ctx)
-{
-}
-
static void savageDDInvalidateState( GLcontext *ctx, GLuint new_state )
{
_swrast_InvalidateState( ctx, new_state );
diff --git a/src/mesa/drivers/dri/savage/savagetex.c b/src/mesa/drivers/dri/savage/savagetex.c
index 924f06187b4..2650f66e462 100644
--- a/src/mesa/drivers/dri/savage/savagetex.c
+++ b/src/mesa/drivers/dri/savage/savagetex.c
@@ -837,7 +837,6 @@ static void savageUpdateTex0State_s4( GLcontext *ctx )
imesa->regs.s4.texDescr.ni.tex0En = GL_FALSE;
imesa->regs.s4.texBlendCtrl[0].ui = TBC_NoTexMap;
imesa->regs.s4.texCtrl[0].ui = 0x20f040;
- imesa->regs.s4.texAddr[0].ui = 0;
return;
}
@@ -1007,7 +1006,6 @@ static void savageUpdateTex0State_s4( GLcontext *ctx )
GL_ADD
*/
case GL_ADD:
- printf("Add\n");
imesa->regs.s4.texCtrl[0].ni.clrArg1Invert = GL_FALSE;
imesa->regs.s4.texBlendCtrl[0].ui = TBC_AddAlpha;
__HWEnvCombineSingleUnitScale(imesa, 0, 0,
@@ -1105,7 +1103,6 @@ static void savageUpdateTex1State_s4( GLcontext *ctx )
imesa->regs.s4.texDescr.ni.tex1En = GL_FALSE;
imesa->regs.s4.texBlendCtrl[1].ui = TBC_NoTexMap1;
imesa->regs.s4.texCtrl[1].ui = 0x20f040;
- imesa->regs.s4.texAddr[1].ui = 0;
imesa->regs.s4.texDescr.ni.texBLoopEn = GL_FALSE;
return;
}
@@ -1300,7 +1297,6 @@ static void savageUpdateTexState_s3d( GLcontext *ctx )
imesa->regs.s3d.texCtrl.ni.texEn = GL_FALSE;
imesa->regs.s3d.texCtrl.ni.dBias = 0x08;
imesa->regs.s3d.texCtrl.ni.texXprEn = GL_TRUE;
- imesa->regs.s3d.texAddr.ui = 0;
return;
}
diff --git a/src/mesa/drivers/dri/savage/savagetris.c b/src/mesa/drivers/dri/savage/savagetris.c
index 2721a63edb4..26388d1149f 100644
--- a/src/mesa/drivers/dri/savage/savagetris.c
+++ b/src/mesa/drivers/dri/savage/savagetris.c
@@ -1069,16 +1069,10 @@ static void savageRenderStart( GLcontext *ctx )
imesa->HwVertexSize = hwVertexSize;
}
}
-
- /* Update hardware state and get the lock */
- savageDDRenderStart( ctx );
}
static void savageRenderFinish( GLcontext *ctx )
{
- /* Release the lock */
- savageDDRenderEnd( ctx );
-
/* Flush the last primitive now, before any state is changed.
* Alternatively state could be emitted in all state-changing
* functions in savagestate.c and when changing the vertex format