diff options
author | Christian König <christian.koenig@amd.com> | 2014-03-07 21:52:51 +0100 |
---|---|---|
committer | Christian König <christian.koenig@amd.com> | 2014-03-08 16:08:15 +0100 |
commit | 58d2afa2232060b88f9c444ce7a0d6e63c841bb2 (patch) | |
tree | 287f79427e18851d22992fe81973fa66c5b40469 /src | |
parent | 1fa2acba6195230fc738d2854678bc28864ca5c0 (diff) | |
download | external_mesa3d-58d2afa2232060b88f9c444ce7a0d6e63c841bb2.zip external_mesa3d-58d2afa2232060b88f9c444ce7a0d6e63c841bb2.tar.gz external_mesa3d-58d2afa2232060b88f9c444ce7a0d6e63c841bb2.tar.bz2 |
radeonsi: fix leaking the bound state on destruction v2
v2: rebased on stale pointer fixes
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/drivers/radeonsi/si_pipe.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_pm4.c | 7 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_pm4.h | 1 |
3 files changed, 10 insertions, 0 deletions
diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c index ac9e49a..1a44492 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.c +++ b/src/gallium/drivers/radeonsi/si_pipe.c @@ -102,6 +102,8 @@ static void si_destroy_context(struct pipe_context *context) util_blitter_destroy(sctx->blitter); + si_pm4_cleanup(sctx); + r600_common_context_cleanup(&sctx->b); FREE(sctx); } diff --git a/src/gallium/drivers/radeonsi/si_pm4.c b/src/gallium/drivers/radeonsi/si_pm4.c index 51bf67e..0a5673b 100644 --- a/src/gallium/drivers/radeonsi/si_pm4.c +++ b/src/gallium/drivers/radeonsi/si_pm4.c @@ -251,3 +251,10 @@ void si_pm4_reset_emitted(struct si_context *sctx) { memset(&sctx->emitted, 0, sizeof(sctx->emitted)); } + +void si_pm4_cleanup(struct si_context *sctx) +{ + for (int i = 0; i < NUMBER_OF_STATES; ++i) { + si_pm4_free_state(sctx, sctx->queued.array[i], i); + } +} diff --git a/src/gallium/drivers/radeonsi/si_pm4.h b/src/gallium/drivers/radeonsi/si_pm4.h index c9bc091..e1d0cac 100644 --- a/src/gallium/drivers/radeonsi/si_pm4.h +++ b/src/gallium/drivers/radeonsi/si_pm4.h @@ -91,5 +91,6 @@ unsigned si_pm4_dirty_dw(struct si_context *sctx); void si_pm4_emit(struct si_context *sctx, struct si_pm4_state *state); void si_pm4_emit_dirty(struct si_context *sctx); void si_pm4_reset_emitted(struct si_context *sctx); +void si_pm4_cleanup(struct si_context *sctx); #endif |