Mesa (10.2): nv50, nvc0: always pull out bufctx on context destruction
Ian Romanick
idr at kemper.freedesktop.org
Thu May 29 22:39:54 UTC 2014
Module: Mesa
Branch: 10.2
Commit: 4afbd9b0e29fa7d45f6d9168b52d9b207d5b61a8
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=4afbd9b0e29fa7d45f6d9168b52d9b207d5b61a8
Author: Christoph Bumiller <christoph.bumiller at speed.at>
Date: Sun May 12 15:41:29 2013 +0200
nv50,nvc0: always pull out bufctx on context destruction
Reviewed-by: Ilia Mirkin <imirkin at alum.mit.edu>
Cc: "10.2" <mesa-stable at lists.freedesktop.org>
(cherry picked from commit 7d11b761f248ebf5cc2c6732e67656f828afb110)
---
src/gallium/drivers/nouveau/nv50/nv50_context.c | 7 ++-----
src/gallium/drivers/nouveau/nvc0/nvc0_context.c | 9 +++++----
2 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/src/gallium/drivers/nouveau/nv50/nv50_context.c b/src/gallium/drivers/nouveau/nv50/nv50_context.c
index 52e14bf..f844592 100644
--- a/src/gallium/drivers/nouveau/nv50/nv50_context.c
+++ b/src/gallium/drivers/nouveau/nv50/nv50_context.c
@@ -122,12 +122,9 @@ nv50_destroy(struct pipe_context *pipe)
{
struct nv50_context *nv50 = nv50_context(pipe);
- if (nv50_context_screen(nv50)->cur_ctx == nv50) {
- nv50->base.pushbuf->kick_notify = NULL;
+ if (nv50_context_screen(nv50)->cur_ctx == nv50)
nv50_context_screen(nv50)->cur_ctx = NULL;
- nouveau_pushbuf_bufctx(nv50->base.pushbuf, NULL);
- }
- /* need to flush before destroying the bufctx */
+ nouveau_pushbuf_bufctx(nv50->base.pushbuf, NULL);
nouveau_pushbuf_kick(nv50->base.pushbuf, nv50->base.pushbuf->channel);
nv50_context_unreference_resources(nv50);
diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_context.c b/src/gallium/drivers/nouveau/nvc0/nvc0_context.c
index 0e13556..2e6e3fe 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_context.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_context.c
@@ -123,11 +123,12 @@ nvc0_destroy(struct pipe_context *pipe)
{
struct nvc0_context *nvc0 = nvc0_context(pipe);
- if (nvc0->screen->cur_ctx == nvc0) {
- nvc0->base.pushbuf->kick_notify = NULL;
+ if (nvc0->screen->cur_ctx == nvc0)
nvc0->screen->cur_ctx = NULL;
- nouveau_pushbuf_bufctx(nvc0->base.pushbuf, NULL);
- }
+ /* Unset bufctx, we don't want to revalidate any resources after the flush.
+ * Other contexts will always set their bufctx again on action calls.
+ */
+ nouveau_pushbuf_bufctx(nvc0->base.pushbuf, NULL);
nouveau_pushbuf_kick(nvc0->base.pushbuf, nvc0->base.pushbuf->channel);
nvc0_context_unreference_resources(nvc0);
More information about the mesa-commit
mailing list