[Intel-gfx] [PATCH 4/6] intel: Keep the caches in loose active order

Chris Wilson chris at chris-wilson.co.uk
Tue May 5 01:53:58 PDT 2015


Though we don't have precise tracking for when buffers in the cache list
become idle (we don't have request tracking at this layer), we do have
some basic assumptions that the head is inactive and the tail active. So
when inserting buffers in the cache, it would be good not to completely
ignore those assumptions.

Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
---
 intel/intel_bufmgr_gem.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c
index 61a248f..2cbe973 100644
--- a/intel/intel_bufmgr_gem.c
+++ b/intel/intel_bufmgr_gem.c
@@ -1329,7 +1329,10 @@ drm_intel_gem_bo_unreference_final(drm_intel_bo *bo, time_t time)
 		bo_gem->name = NULL;
 		bo_gem->validate_index = -1;
 
-		DRMLISTADDTAIL(&bo_gem->head, &bucket->head);
+		if (drm_intel_gem_bo_busy(&bo_gem->bo))
+			DRMLISTADDTAIL(&bo_gem->head, &bucket->head);
+		else
+			DRMLISTADD(&bo_gem->head, &bucket->head);
 	} else {
 		drm_intel_gem_bo_free(bo);
 	}
-- 
2.1.4



More information about the Intel-gfx mailing list