diff options
author | Aaron Watry <awatry@gmail.com> | 2014-01-07 14:45:41 -0600 |
---|---|---|
committer | Carl Worth <cworth@cworth.org> | 2014-01-25 16:43:47 -0800 |
commit | 0ec1ae90ef78cbae2d964250996ac8f59adf58c1 (patch) | |
tree | 2db7d2024efb02efe4521ab04fcd8734932cc57f | |
parent | 0fd4cf4bf811f60363574e4baf9b992189003375 (diff) |
radeon: Move gfx/dma cs cleanup to r600_common_context_cleanup
The radeonsi code was not cleaning up either of these items leading to
leaked memory.
v2: Move cleanup to r600_common_context_cleanup instead of duplicating
the logic for SI
CC: "10.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
(cherry picked from commit 5ac3229f76f02453ae7e971d515b01fb56ad3fa5)
Conflicts:
src/gallium/drivers/radeon/r600_pipe_common.c
-rw-r--r-- | src/gallium/drivers/r600/r600_pipe.c | 7 | ||||
-rw-r--r-- | src/gallium/drivers/radeon/r600_pipe_common.c | 7 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/gallium/drivers/r600/r600_pipe.c b/src/gallium/drivers/r600/r600_pipe.c index dc5e3754aad..e5806919e68 100644 --- a/src/gallium/drivers/r600/r600_pipe.c +++ b/src/gallium/drivers/r600/r600_pipe.c @@ -192,13 +192,6 @@ static void r600_destroy_context(struct pipe_context *context) r600_release_command_buffer(&rctx->start_cs_cmd); - if (rctx->b.rings.gfx.cs) { - rctx->b.ws->cs_destroy(rctx->b.rings.gfx.cs); - } - if (rctx->b.rings.dma.cs) { - rctx->b.ws->cs_destroy(rctx->b.rings.dma.cs); - } - FREE(rctx->start_compute_cs_cmd.buf); r600_common_context_cleanup(&rctx->b); diff --git a/src/gallium/drivers/radeon/r600_pipe_common.c b/src/gallium/drivers/radeon/r600_pipe_common.c index 5674f819466..3772f6ff75c 100644 --- a/src/gallium/drivers/radeon/r600_pipe_common.c +++ b/src/gallium/drivers/radeon/r600_pipe_common.c @@ -234,6 +234,13 @@ bool r600_common_context_init(struct r600_common_context *rctx, void r600_common_context_cleanup(struct r600_common_context *rctx) { + if (rctx->rings.gfx.cs) { + rctx->ws->cs_destroy(rctx->rings.gfx.cs); + } + if (rctx->rings.dma.cs) { + rctx->ws->cs_destroy(rctx->rings.dma.cs); + } + if (rctx->allocator_so_filled_size) { u_suballocator_destroy(rctx->allocator_so_filled_size); } |