diff options
author | Ilia Mirkin <imirkin@alum.mit.edu> | 2017-06-24 13:17:08 -0400 |
---|---|---|
committer | Ilia Mirkin <imirkin@alum.mit.edu> | 2017-06-26 20:23:04 -0400 |
commit | c12f8305a8ae4fd5d78a9ab8bbda790a711d5bed (patch) | |
tree | 20a14a243f8603729cbbf5ae6665e857e5f1bfc6 /src/gallium/drivers/nouveau/nvc0/nvc0_vbo.c | |
parent | 8c02ee4a8b0bea5dda3ced341dce81f340457c95 (diff) |
nv50,nvc0: remove IDX from bufctx immediately, to avoid conflicts with clear
The idxbuf could linger, and when a clear happened, which also uses the
3d bufctx, we could get an error trying to access it.
This fixes spurious crashes/errors in CTS tests.
Fixes: 61d8f3387d ("nv50,nvc0: clear index buffer bufctx bin unconditionally")
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Cc: mesa-stable@lists.freedesktop.org
Diffstat (limited to 'src/gallium/drivers/nouveau/nvc0/nvc0_vbo.c')
-rw-r--r-- | src/gallium/drivers/nouveau/nvc0/nvc0_vbo.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_vbo.c b/src/gallium/drivers/nouveau/nvc0/nvc0_vbo.c index 406a17e51d6..63dccedd3e3 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_vbo.c +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_vbo.c @@ -921,8 +921,6 @@ nvc0_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info) struct nvc0_screen *screen = nvc0->screen; int s; - nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_3D_IDX); - /* NOTE: caller must ensure that (min_index + index_bias) is >= 0 */ nvc0->vb_elt_first = info->min_index + info->index_bias; nvc0->vb_elt_limit = info->max_index - info->min_index; @@ -1029,9 +1027,7 @@ nvc0_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info) if (nvc0->state.vbo_mode) { nvc0_push_vbo(nvc0, info); - push->kick_notify = nvc0_default_kick_notify; - nouveau_pushbuf_bufctx(push, NULL); - return; + goto cleanup; } /* space for base instance, flush, and prim restart */ @@ -1078,9 +1074,13 @@ nvc0_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info) info->mode, info->start, info->count, info->instance_count); } + +cleanup: push->kick_notify = nvc0_default_kick_notify; nvc0_release_user_vbufs(nvc0); nouveau_pushbuf_bufctx(push, NULL); + + nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_3D_IDX); } |