summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nouveau/nv50
diff options
context:
space:
mode:
authorIlia Mirkin <[email protected]>2017-06-24 13:17:08 -0400
committerIlia Mirkin <[email protected]>2017-06-26 20:23:04 -0400
commitc12f8305a8ae4fd5d78a9ab8bbda790a711d5bed (patch)
tree20a14a243f8603729cbbf5ae6665e857e5f1bfc6 /src/gallium/drivers/nouveau/nv50
parent8c02ee4a8b0bea5dda3ced341dce81f340457c95 (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 <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]> Cc: [email protected]
Diffstat (limited to 'src/gallium/drivers/nouveau/nv50')
-rw-r--r--src/gallium/drivers/nouveau/nv50/nv50_vbo.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/gallium/drivers/nouveau/nv50/nv50_vbo.c b/src/gallium/drivers/nouveau/nv50/nv50_vbo.c
index ac7d8267861..ed041121a26 100644
--- a/src/gallium/drivers/nouveau/nv50/nv50_vbo.c
+++ b/src/gallium/drivers/nouveau/nv50/nv50_vbo.c
@@ -770,7 +770,6 @@ nv50_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info)
bool tex_dirty = false;
int s;
- nouveau_bufctx_reset(nv50->bufctx_3d, NV50_BIND_3D_INDEX);
if (info->index_size && !info->has_user_indices)
BCTX_REFN(nv50->bufctx_3d, 3D_INDEX, nv04_resource(info->index.resource), RD);
@@ -838,9 +837,7 @@ nv50_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info)
if (nv50->vbo_fifo) {
nv50_push_vbo(nv50, info);
- push->kick_notify = nv50_default_kick_notify;
- nouveau_pushbuf_bufctx(push, NULL);
- return;
+ goto cleanup;
}
if (nv50->state.instance_base != info->start_instance) {
@@ -894,9 +891,13 @@ nv50_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 = nv50_default_kick_notify;
nv50_release_user_vbufs(nv50);
nouveau_pushbuf_bufctx(push, NULL);
+
+ nouveau_bufctx_reset(nv50->bufctx_3d, NV50_BIND_3D_INDEX);
}