diff mbox

[2/3] intel: Remove the extra reference while validating the reloc tree

Message ID 1259754196-12694-3-git-send-email-chris@chris-wilson.co.uk (mailing list archive)
State Accepted
Headers show

Commit Message

Chris Wilson Dec. 2, 2009, 11:43 a.m. UTC
None
diff mbox

Patch

diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c
index e0585ca..21bd563 100644
--- a/intel/intel_bufmgr_gem.c
+++ b/intel/intel_bufmgr_gem.c
@@ -187,7 +187,6 @@  static int
 drm_intel_gem_bo_set_tiling(drm_intel_bo *bo, uint32_t * tiling_mode,
 			    uint32_t stride);
 
-static void drm_intel_gem_bo_unreference_locked(drm_intel_bo *bo);
 static void drm_intel_gem_bo_unreference_locked_timed(drm_intel_bo *bo,
 						      time_t time);
 
@@ -357,7 +356,6 @@  drm_intel_add_validate_buffer(drm_intel_bo *bo)
 	bufmgr_gem->exec_objects[index].alignment = 0;
 	bufmgr_gem->exec_objects[index].offset = 0;
 	bufmgr_gem->exec_bos[index] = bo;
-	drm_intel_gem_bo_reference(bo);
 	bufmgr_gem->exec_count++;
 }
 
@@ -793,19 +791,6 @@  drm_intel_gem_bo_unreference_final(drm_intel_bo *bo, time_t time)
 	}
 }
 
-static void drm_intel_gem_bo_unreference_locked(drm_intel_bo *bo)
-{
-	drm_intel_bo_gem *bo_gem = (drm_intel_bo_gem *) bo;
-
-	assert(atomic_read(&bo_gem->refcount) > 0);
-	if (atomic_dec_and_test(&bo_gem->refcount)) {
-		struct timespec time;
-
-		clock_gettime(CLOCK_MONOTONIC, &time);
-		drm_intel_gem_bo_unreference_final(bo, time.tv_sec);
-	}
-}
-
 static void drm_intel_gem_bo_unreference_locked_timed(drm_intel_bo *bo,
 						      time_t time)
 {
@@ -1302,7 +1287,6 @@  drm_intel_gem_bo_exec(drm_intel_bo *bo, int used,
 
 		/* Disconnect the buffer from the validate list */
 		bo_gem->validate_index = -1;
-		drm_intel_gem_bo_unreference_locked(bo);
 		bufmgr_gem->exec_bos[i] = NULL;
 	}
 	bufmgr_gem->exec_count = 0;