diff options
author | Eric Anholt <eric@anholt.net> | 2006-10-26 15:47:49 -0700 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2006-10-26 15:47:49 -0700 |
commit | 25e6e497824a23eb231fc6fd6e483f601d612cee (patch) | |
tree | 85f317aff96c3ac817932fc70313c1c8ac01f4ce /src/i915_3d.c | |
parent | 0bdcce2e4541c6e441c44aad49254ad3093cedb2 (diff) |
Major cleanup of 3D invariant state, fixing hangs with rotation and render.exa
Now, the generic invariant state is always set while the X Server is active,
and happens automatically when the X Server grabs the DRI lock. More 3D state
is moved to the generic code.
Then, the 3D consumers (video, rotation, render) set last_3d to their enum
entry, and can update their own invariant state when another consumer was
active.
Diffstat (limited to 'src/i915_3d.c')
-rw-r--r-- | src/i915_3d.c | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/src/i915_3d.c b/src/i915_3d.c index e70bb24a..ff591716 100644 --- a/src/i915_3d.c +++ b/src/i915_3d.c @@ -38,7 +38,7 @@ void I915EmitInvarientState( ScrnInfoPtr pScrn ) { I830Ptr pI830 = I830PTR(pScrn); - BEGIN_LP_RING(20); + BEGIN_LP_RING(24); OUT_RING(_3DSTATE_AA_CMD | AA_LINE_ECAAR_WIDTH_ENABLE | @@ -46,6 +46,13 @@ void I915EmitInvarientState( ScrnInfoPtr pScrn ) AA_LINE_REGION_WIDTH_ENABLE | AA_LINE_REGION_WIDTH_1_0); + /* Disable independent alpha blend */ + OUT_RING(_3DSTATE_INDEPENDENT_ALPHA_BLEND_CMD | + IAB_MODIFY_ENABLE | + IAB_MODIFY_FUNC | (BLENDFUNC_ADD << IAB_FUNC_SHIFT) | + IAB_MODIFY_SRC_FACTOR | (BLENDFACT_ONE << IAB_SRC_FACTOR_SHIFT) | + IAB_MODIFY_DST_FACTOR | (BLENDFACT_ZERO << IAB_DST_FACTOR_SHIFT)); + OUT_RING(_3DSTATE_DFLT_DIFFUSE_CMD); OUT_RING(0); @@ -76,15 +83,15 @@ void I915EmitInvarientState( ScrnInfoPtr pScrn ) ENABLE_TEXKILL_3D_4D | TEXKILL_4D); - /* Need to initialize this to zero. - */ + OUT_RING(_3DSTATE_MODES_4_CMD | + ENABLE_LOGIC_OP_FUNC | LOGIC_OP_FUNC(LOGICOP_COPY) | + ENABLE_STENCIL_WRITE_MASK | STENCIL_WRITE_MASK(0xff) | + ENABLE_STENCIL_TEST_MASK | STENCIL_TEST_MASK(0xff)); + OUT_RING(_3DSTATE_LOAD_STATE_IMMEDIATE_1 | I1_LOAD_S(3) | 0); - OUT_RING(0); - - /* XXX: Use this */ - OUT_RING(_3DSTATE_SCISSOR_ENABLE_CMD | - DISABLE_SCISSOR_RECT); + OUT_RING(0x00000000); /* Disable texture coordinate wrap-shortest */ + OUT_RING(_3DSTATE_SCISSOR_ENABLE_CMD | DISABLE_SCISSOR_RECT); OUT_RING(_3DSTATE_SCISSOR_RECT_0_CMD); OUT_RING(0); OUT_RING(0); @@ -94,12 +101,11 @@ void I915EmitInvarientState( ScrnInfoPtr pScrn ) OUT_RING(_3DSTATE_LOAD_INDIRECT | 0); /* disable indirect state */ OUT_RING(0); - /* Don't support twosided stencil yet */ - OUT_RING(_3DSTATE_BACKFACE_STENCIL_OPS | - BFO_ENABLE_STENCIL_TWO_SIDE | - 0 ); + OUT_RING(_3DSTATE_STIPPLE); + OUT_RING(0x00000000); + + OUT_RING(_3DSTATE_BACKFACE_STENCIL_OPS | BFO_ENABLE_STENCIL_TWO_SIDE | 0 ); + OUT_RING(MI_NOOP); - OUT_RING(0); - ADVANCE_LP_RING(); } |