Mesa (master): r600g: Cleanup the fenced_bo list in r600_context_fini().

Henri Verbeet hverbeet at kemper.freedesktop.org
Mon Nov 15 13:20:54 PST 2010


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

Author: Henri Verbeet <hverbeet at gmail.com>
Date:   Mon Nov 15 22:18:12 2010 +0100

r600g: Cleanup the fenced_bo list in r600_context_fini().

---

 src/gallium/winsys/r600/drm/r600_hw_context.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/src/gallium/winsys/r600/drm/r600_hw_context.c b/src/gallium/winsys/r600/drm/r600_hw_context.c
index 37e5baf..b2a1125 100644
--- a/src/gallium/winsys/r600/drm/r600_hw_context.c
+++ b/src/gallium/winsys/r600/drm/r600_hw_context.c
@@ -593,6 +593,17 @@ static int r600_loop_const_init(struct r600_context *ctx, u32 offset)
 	return r600_context_add_block(ctx, r600_loop_consts, nreg);
 }
 
+static void r600_context_clear_fenced_bo(struct r600_context *ctx)
+{
+	struct radeon_bo *bo, *tmp;
+
+	LIST_FOR_EACH_ENTRY_SAFE(bo, tmp, &ctx->fenced_bo, fencedlist) {
+		LIST_DELINIT(&bo->fencedlist);
+		bo->fence = 0;
+		bo->ctx = NULL;
+	}
+}
+
 /* initialize */
 void r600_context_fini(struct r600_context *ctx)
 {
@@ -616,6 +627,8 @@ void r600_context_fini(struct r600_context *ctx)
 	free(ctx->reloc);
 	free(ctx->bo);
 	free(ctx->pm4);
+
+	r600_context_clear_fenced_bo(ctx);
 	if (ctx->fence_bo) {
 		r600_bo_reference(ctx->radeon, &ctx->fence_bo, NULL);
 	}



More information about the mesa-commit mailing list