diff options
author | Jerome Glisse <jglisse@redhat.com> | 2012-09-05 15:18:24 -0400 |
---|---|---|
committer | Jerome Glisse <jglisse@redhat.com> | 2012-09-06 15:09:17 -0400 |
commit | 5ceb87286f2e1b5b8527ba18a844abf450903175 (patch) | |
tree | 920771a74e03a839d0cd81c8f6449d786842994e /src/gallium/drivers/r600/r600_hw_context.c | |
parent | 935a72944751e6bc0a5df779eef44766c7b52baa (diff) |
r600g: order atom emission v3
To avoid GPU lockup registers must be emited in a specific order
(no kidding ...). This patch rework atom emission so order in which
atom are emited in respect to each other is always the same. We
don't have any informations on what is the correct order so order
will need to be infered from fglrx command stream.
v2: add comment warning that atom order should not be taken lightly
v3: rebase on top of alphatest atom fix
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Diffstat (limited to 'src/gallium/drivers/r600/r600_hw_context.c')
-rw-r--r-- | src/gallium/drivers/r600/r600_hw_context.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/gallium/drivers/r600/r600_hw_context.c b/src/gallium/drivers/r600/r600_hw_context.c index 7b7b6b1ffac..0ec13e5bade 100644 --- a/src/gallium/drivers/r600/r600_hw_context.c +++ b/src/gallium/drivers/r600/r600_hw_context.c @@ -633,15 +633,17 @@ out_err: void r600_need_cs_space(struct r600_context *ctx, unsigned num_dw, boolean count_draw_in) { - struct r600_atom *state; - /* The number of dwords we already used in the CS so far. */ num_dw += ctx->cs->cdw; if (count_draw_in) { + unsigned i; + /* The number of dwords all the dirty states would take. */ - LIST_FOR_EACH_ENTRY(state, &ctx->dirty_states, head) { - num_dw += state->num_dw; + for (i = 0; i < R600_MAX_ATOM; i++) { + if (ctx->atoms[i] && ctx->atoms[i]->dirty) { + num_dw += ctx->atoms[i]->num_dw; + } } num_dw += ctx->pm4_dirty_cdwords; |