From b666f4151ab934d3083fa8b5f14ce19bbf999b15 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Mon, 30 Nov 2009 23:07:19 +0000 Subject: intel: Clear bo->used_as_reloc_target flag on destroy This allows us to keep the assert added in the previous commit that we do not modify the tree_reloc_size after inserting the buffer into a relocation tree, which was being hit here: #0 0xb78c2424 in __kernel_vsyscall () #1 0xb74f6401 in raise () from /lib/libc.so.6 #2 0xb74f7b42 in abort () from /lib/libc.so.6 #3 0xb74ef5a8 in __assert_fail () from /lib/libc.so.6 #4 0xb737e78b in drm_intel_bo_gem_set_in_aperture_size (bufmgr_gem=, bo_gem=0x6) at intel_bufmgr_gem.c:373 #5 0xb737f519 in drm_intel_gem_bo_set_tiling (bo=0xa1030a0, tiling_mode=0xbff6c85c, stride=0) at intel_bufmgr_gem.c:1386 #6 0xb737f67f in drm_intel_gem_bo_unreference_final (bo=0xa1030a0, time=) at intel_bufmgr_gem.c:768 #7 0xb737f5e3 in drm_intel_gem_bo_unreference_locked_timed (bo=0xa1e50d0, time=) at intel_bufmgr_gem.c:805 #8 drm_intel_gem_bo_unreference_final (bo=0xa1e50d0, time=) at intel_bufmgr_gem.c:756 #9 0xb737fcbb in drm_intel_gem_bo_unreference (bo=0xa1e50d0) at intel_bufmgr_gem.c:821 #10 0xb737b4e6 in drm_intel_bo_unreference (bo=0x0) at intel_bufmgr.c:80 #11 0xb7325625 in intel_batch_flush (scrn=0x9d91f78, flush=1) at i830_batchbuffer.c:200 Signed-off-by: Chris Wilson --- intel/intel_bufmgr_gem.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c index fc08fe55..6a113a61 100644 --- a/intel/intel_bufmgr_gem.c +++ b/intel/intel_bufmgr_gem.c @@ -757,6 +757,8 @@ drm_intel_gem_bo_unreference_final(drm_intel_bo *bo, time_t time) reloc_target_bo[i], time); } + bo_gem->reloc_count = 0; + bo_gem->used_as_reloc_target = 0; DBG("bo_unreference final: %d (%s)\n", bo_gem->gem_handle, bo_gem->name); @@ -772,7 +774,6 @@ drm_intel_gem_bo_unreference_final(drm_intel_bo *bo, time_t time) bo_gem->name = NULL; bo_gem->validate_index = -1; - bo_gem->reloc_count = 0; DRMLISTADDTAIL(&bo_gem->head, &bucket->head); -- cgit v1.2.3