Mesa (master): radeonsi: unreference framebuffer state with set_framebuffer_state
Marek Olšák
mareko at kemper.freedesktop.org
Wed Jun 29 18:12:16 UTC 2016
Module: Mesa
Branch: master
Commit: ebb9c7d7c48c78f3a50654ec6385d9065c1eb7b7
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=ebb9c7d7c48c78f3a50654ec6385d9065c1eb7b7
Author: Marek Olšák <marek.olsak at amd.com>
Date: Tue Jun 21 15:52:03 2016 +0200
radeonsi: unreference framebuffer state with set_framebuffer_state
Reviewed-by: Nicolai Hähnle <nicolai.haehnle at amd.com>
---
src/gallium/drivers/radeonsi/si_pipe.c | 7 +++++--
src/gallium/drivers/radeonsi/si_state.c | 2 +-
src/gallium/drivers/radeonsi/si_state.h | 1 -
3 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c
index 633d4bb..6c88fe3 100644
--- a/src/gallium/drivers/radeonsi/si_pipe.c
+++ b/src/gallium/drivers/radeonsi/si_pipe.c
@@ -43,7 +43,11 @@ static void si_destroy_context(struct pipe_context *context)
struct si_context *sctx = (struct si_context *)context;
int i;
- si_dec_framebuffer_counters(&sctx->framebuffer.state);
+ /* Unreference the framebuffer normally to disable related logic
+ * properly.
+ */
+ struct pipe_framebuffer_state fb = {};
+ context->set_framebuffer_state(context, &fb);
si_release_all_descriptors(sctx);
@@ -79,7 +83,6 @@ static void si_destroy_context(struct pipe_context *context)
sctx->b.b.delete_blend_state(&sctx->b.b, sctx->custom_blend_fastclear);
if (sctx->custom_blend_dcc_decompress)
sctx->b.b.delete_blend_state(&sctx->b.b, sctx->custom_blend_dcc_decompress);
- util_unreference_framebuffer_state(&sctx->framebuffer.state);
if (sctx->blitter)
util_blitter_destroy(sctx->blitter);
diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c
index cec5e84..6db65be 100644
--- a/src/gallium/drivers/radeonsi/si_state.c
+++ b/src/gallium/drivers/radeonsi/si_state.c
@@ -2209,7 +2209,7 @@ static void si_init_depth_surface(struct si_context *sctx,
surf->depth_initialized = true;
}
-void si_dec_framebuffer_counters(const struct pipe_framebuffer_state *state)
+static void si_dec_framebuffer_counters(const struct pipe_framebuffer_state *state)
{
for (int i = 0; i < state->nr_cbufs; ++i) {
struct r600_surface *surf = NULL;
diff --git a/src/gallium/drivers/radeonsi/si_state.h b/src/gallium/drivers/radeonsi/si_state.h
index 9361849..05654bb 100644
--- a/src/gallium/drivers/radeonsi/si_state.h
+++ b/src/gallium/drivers/radeonsi/si_state.h
@@ -332,7 +332,6 @@ si_create_sampler_view_custom(struct pipe_context *ctx,
const struct pipe_sampler_view *state,
unsigned width0, unsigned height0,
unsigned force_level);
-void si_dec_framebuffer_counters(const struct pipe_framebuffer_state *state);
/* si_state_shader.c */
bool si_update_shaders(struct si_context *sctx);
More information about the mesa-commit
mailing list