Mesa (master): nv50,nvc0: fix stream output target buffer leak

Marcin Åšlusarz mslusarz at kemper.freedesktop.org
Thu Jun 14 21:45:23 UTC 2012


Module: Mesa
Branch: master
Commit: fc782bcbf04f036990f69b14e01304e1e6dc8fd1
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=fc782bcbf04f036990f69b14e01304e1e6dc8fd1

Author: Marcin Slusarz <marcin.slusarz at gmail.com>
Date:   Thu Jun 14 21:48:46 2012 +0200

nv50,nvc0: fix stream output target buffer leak

It manifests at exit as:
"WARNING: destroying GPU memory cache with some buffers still in use"

---

 src/gallium/drivers/nv50/nv50_state.c |    1 +
 src/gallium/drivers/nvc0/nvc0_state.c |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/gallium/drivers/nv50/nv50_state.c b/src/gallium/drivers/nv50/nv50_state.c
index 81c3fa2..2052f91 100644
--- a/src/gallium/drivers/nv50/nv50_state.c
+++ b/src/gallium/drivers/nv50/nv50_state.c
@@ -983,6 +983,7 @@ nv50_so_target_destroy(struct pipe_context *pipe,
    struct nv50_so_target *targ = nv50_so_target(ptarg);
    if (targ->pq)
       pipe->destroy_query(pipe, targ->pq);
+   pipe_resource_reference(&targ->pipe.buffer, NULL);
    FREE(targ);
 }
 
diff --git a/src/gallium/drivers/nvc0/nvc0_state.c b/src/gallium/drivers/nvc0/nvc0_state.c
index cce2a48..1bd5434 100644
--- a/src/gallium/drivers/nvc0/nvc0_state.c
+++ b/src/gallium/drivers/nvc0/nvc0_state.c
@@ -899,6 +899,7 @@ nvc0_so_target_destroy(struct pipe_context *pipe,
 {
    struct nvc0_so_target *targ = nvc0_so_target(ptarg);
    pipe->destroy_query(pipe, targ->pq);
+   pipe_resource_reference(&targ->pipe.buffer, NULL);
    FREE(targ);
 }
 




More information about the mesa-commit mailing list