[Intel-gfx] [PATCH 2/3] intel: Remove the extra reference while validating the reloc tree

Chris Wilson chris at chris-wilson.co.uk
Wed Dec 2 12:43:15 CET 2009


Buffers on the relocation tree are guarded by the reference to the batch
object and so do not need an extra reference whilst constructing the
list of execution buffer objects.

Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
---
 intel/intel_bufmgr_gem.c |   16 ----------------
 1 files changed, 0 insertions(+), 16 deletions(-)

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;
-- 
1.6.5.3




More information about the Intel-gfx mailing list