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 <[email protected]>
---
 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

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to