aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Wilson2013-01-10 18:55:12 -0600
committerChris Wilson2013-01-13 04:29:44 -0600
commitfdda97007b1dbf95beb16a0e3510fd36c89e8c33 (patch)
treeb0f9cc592ceead7e2e6663d1f12d22e7a0699ca4
parent1dbd873700f281d9773e64931ff0c1cf96e13793 (diff)
downloadlibdrm-fdda97007b1dbf95beb16a0e3510fd36c89e8c33.tar.gz
libdrm-fdda97007b1dbf95beb16a0e3510fd36c89e8c33.tar.xz
libdrm-fdda97007b1dbf95beb16a0e3510fd36c89e8c33.zip
intel: Remove the fence count contributions when clearing relocs
As we clear the relocs from the bo, we also need to clear the contribution of the reloc_target_bo from the fence count. Otherwise they are leaked and prevent any further relocations being added to the bo.
-rw-r--r--intel/intel_bufmgr_gem.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c
index 512bc6ff..294e575e 100644
--- a/intel/intel_bufmgr_gem.c
+++ b/intel/intel_bufmgr_gem.c
@@ -1733,9 +1733,10 @@ drm_intel_gem_bo_clear_relocs(drm_intel_bo *bo, int start)
1733 assert(bo_gem->reloc_count >= start); 1733 assert(bo_gem->reloc_count >= start);
1734 /* Unreference the cleared target buffers */ 1734 /* Unreference the cleared target buffers */
1735 for (i = start; i < bo_gem->reloc_count; i++) { 1735 for (i = start; i < bo_gem->reloc_count; i++) {
1736 if (bo_gem->reloc_target_info[i].bo != bo) { 1736 drm_intel_bo_gem *target_bo_gem = (drm_intel_bo_gem *) bo_gem->reloc_target_info[i].bo;
1737 drm_intel_gem_bo_unreference_locked_timed(bo_gem-> 1737 if (&target_bo_gem->bo != bo) {
1738 reloc_target_info[i].bo, 1738 bo_gem->reloc_tree_fences -= target_bo_gem->reloc_tree_fences;
1739 drm_intel_gem_bo_unreference_locked_timed(&target_bo_gem->bo,
1739 time.tv_sec); 1740 time.tv_sec);
1740 } 1741 }
1741 } 1742 }