diff options
author | Jerome Glisse <[email protected]> | 2012-11-01 16:09:40 -0400 |
---|---|---|
committer | Jerome Glisse <[email protected]> | 2012-12-20 18:23:31 -0500 |
commit | 24b1206ab2dcd506aaac3ef656aebc8bc20cd27a (patch) | |
tree | 33102906acd5f0f9c749db048aa261271dc12e3b /src/gallium/drivers/r600/r600_state.c | |
parent | cf5632094ba0c19d570ea47025cf6da75ef8457a (diff) |
r600g: rework flusing and synchronization pattern v7
This bring r600g allmost inline with closed source driver when
it comes to flushing and synchronization pattern.
v2-v4: history lost somewhere in outer space
v5: Fix compute size of flushing, use define for flags, update
worst case cs size requirement for flush, treat rs780 and
newer as r7xx when it comes to streamout.
v6: Fix num dw computation for framebuffer state, remove dead
code, use define instead of hardcoded value.
v7: Remove dead code
Signed-off-by: Jerome Glisse <[email protected]>
Diffstat (limited to 'src/gallium/drivers/r600/r600_state.c')
-rw-r--r-- | src/gallium/drivers/r600/r600_state.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/gallium/drivers/r600/r600_state.c b/src/gallium/drivers/r600/r600_state.c index 9bfae4f2299..f969808603b 100644 --- a/src/gallium/drivers/r600/r600_state.c +++ b/src/gallium/drivers/r600/r600_state.c @@ -1452,7 +1452,7 @@ static void r600_set_framebuffer_state(struct pipe_context *ctx, unsigned i; if (rctx->framebuffer.state.nr_cbufs) { - rctx->flags |= R600_CONTEXT_CB_FLUSH; + rctx->flags |= R600_CONTEXT_WAIT_IDLE | R600_CONTEXT_FLUSH_AND_INV; if (rctx->chip_class >= R700 && rctx->framebuffer.state.cbufs[0]->texture->nr_samples > 1) { @@ -1460,11 +1460,7 @@ static void r600_set_framebuffer_state(struct pipe_context *ctx, } } if (rctx->framebuffer.state.zsbuf) { - rctx->flags |= R600_CONTEXT_DB_FLUSH; - } - /* R6xx errata */ - if (rctx->chip_class == R600) { - rctx->flags |= R600_CONTEXT_FLUSH_AND_INV; + rctx->flags |= R600_CONTEXT_WAIT_IDLE | R600_CONTEXT_FLUSH_AND_INV; } /* Set the new state. */ @@ -1558,7 +1554,7 @@ static void r600_set_framebuffer_state(struct pipe_context *ctx, } if (rctx->framebuffer.state.zsbuf) { - rctx->framebuffer.atom.num_dw += 16; + rctx->framebuffer.atom.num_dw += 18; } else if (rctx->screen->info.drm_minor >= 18) { rctx->framebuffer.atom.num_dw += 3; } @@ -1742,6 +1738,13 @@ static void r600_emit_framebuffer_state(struct r600_context *rctx, struct r600_a sbu |= SURFACE_BASE_UPDATE_COLOR_NUM(nr_cbufs); } + /* SURFACE_BASE_UPDATE */ + if (rctx->family > CHIP_R600 && rctx->family < CHIP_RV770 && sbu) { + r600_write_value(cs, PKT3(PKT3_SURFACE_BASE_UPDATE, 0, 0)); + r600_write_value(cs, sbu); + sbu = 0; + } + /* Zbuffer. */ if (state->zsbuf) { struct r600_surface *surf = (struct r600_surface*)state->zsbuf; @@ -1775,6 +1778,7 @@ static void r600_emit_framebuffer_state(struct r600_context *rctx, struct r600_a if (rctx->family > CHIP_R600 && rctx->family < CHIP_RV770 && sbu) { r600_write_value(cs, PKT3(PKT3_SURFACE_BASE_UPDATE, 0, 0)); r600_write_value(cs, sbu); + sbu = 0; } /* Framebuffer dimensions. */ @@ -2243,7 +2247,7 @@ bool r600_adjust_gprs(struct r600_context *rctx) if (rctx->config_state.sq_gpr_resource_mgmt_1 != tmp) { rctx->config_state.sq_gpr_resource_mgmt_1 = tmp; rctx->config_state.atom.dirty = true; - rctx->flags |= R600_CONTEXT_PS_PARTIAL_FLUSH; + rctx->flags |= R600_CONTEXT_WAIT_IDLE; } return true; } |