Mesa (master): r600g: deref old driver states for set entry points.

Dave Airlie airlied at kemper.freedesktop.org
Fri Sep 3 02:02:45 UTC 2010


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

Author: Dave Airlie <airlied at redhat.com>
Date:   Fri Sep  3 12:01:59 2010 +1000

r600g: deref old driver states for set entry points.

---

 src/gallium/drivers/r600/r600_state.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/src/gallium/drivers/r600/r600_state.c b/src/gallium/drivers/r600/r600_state.c
index 9d7d7b6..190d1c8 100644
--- a/src/gallium/drivers/r600/r600_state.c
+++ b/src/gallium/drivers/r600/r600_state.c
@@ -380,6 +380,8 @@ static void r600_set_clip_state(struct pipe_context *ctx,
 	struct r600_context *rctx = r600_context(ctx);
 	struct r600_context_state *rstate;
 
+	r600_context_state_decref(rctx->clip);
+
 	rstate = r600_new_context_state(pipe_clip_type);
 	rstate->state.clip = *state;
 	r600_ucp(rctx, &rstate->rstate[0], &rstate->state.clip);
@@ -439,6 +441,8 @@ static void r600_set_framebuffer_state(struct pipe_context *ctx,
 	struct r600_context_state *rstate;
 	int i;
 
+	r600_context_state_decref(rctx->framebuffer);
+
 	rstate = r600_new_context_state(pipe_framebuffer_type);
 	rstate->state.framebuffer = *state;
 	for (i = 0; i < rstate->state.framebuffer.nr_cbufs; i++) {
@@ -472,6 +476,8 @@ static void r600_set_scissor_state(struct pipe_context *ctx,
 	struct r600_context *rctx = r600_context(ctx);
 	struct r600_context_state *rstate;
 
+	r600_context_state_decref(rctx->scissor);
+
 	rstate = r600_new_context_state(pipe_scissor_type);
 	rstate->state.scissor = *state;
 	rctx->scissor = rstate;
@@ -483,6 +489,8 @@ static void r600_set_stencil_ref(struct pipe_context *ctx,
 	struct r600_context *rctx = r600_context(ctx);
 	struct r600_context_state *rstate;
 
+	r600_context_state_decref(rctx->stencil_ref);
+
 	rstate = r600_new_context_state(pipe_stencil_ref_type);
 	rstate->state.stencil_ref = *state;
 	rctx->stencil_ref = rstate;
@@ -528,6 +536,8 @@ static void r600_set_viewport_state(struct pipe_context *ctx,
 	struct r600_context *rctx = r600_context(ctx);
 	struct r600_context_state *rstate;
 
+	r600_context_state_decref(rctx->viewport);
+
 	rstate = r600_new_context_state(pipe_viewport_type);
 	rstate->state.viewport = *state;
 	r600_viewport(rctx, &rstate->rstate[0], &rstate->state.viewport);




More information about the mesa-commit mailing list