[Intel-gfx] [PATCH 6/6] intel: Keep live buffers in the cache

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


If the GPU is still processing the buffers, then keep them alive as the
pages are still pinned and hot - ripe for reuse.

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

diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c
index 22f7501..53457cd 100644
--- a/intel/intel_bufmgr_gem.c
+++ b/intel/intel_bufmgr_gem.c
@@ -1187,6 +1187,9 @@ drm_intel_gem_cleanup_bo_cache(drm_intel_bufmgr_gem *bufmgr_gem, time_t time)
 			if (time - bo_gem->free_time < 2*(1+bo_gem->dontneed))
 				break;
 
+			if (drm_intel_gem_bo_busy(&bo_gem->bo))
+				break;
+
 			DRMLISTDEL(&bo_gem->head);
 			if (bo_gem->dontneed) {
 				drm_intel_gem_bo_free(&bo_gem->bo);
-- 
2.1.4



More information about the Intel-gfx mailing list