[6/6] intel: Keep live buffers in the cache
diff mbox

Message ID 1430816040-25285-6-git-send-email-chris@chris-wilson.co.uk
State New
Headers show

Commit Message

Chris Wilson May 5, 2015, 8:54 a.m. UTC
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@chris-wilson.co.uk>
---
 intel/intel_bufmgr_gem.c | 3 +++
 1 file changed, 3 insertions(+)

Patch
diff mbox

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