[PATCH 8/8] hmm

Matthew Auld matthew.auld at intel.com
Thu Jan 26 10:02:14 UTC 2023


---
 drivers/gpu/drm/i915/gem/i915_gem_ttm_pm.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_ttm_pm.c b/drivers/gpu/drm/i915/gem/i915_gem_ttm_pm.c
index 9356d5b36d2f..8b0dd9f9e824 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_ttm_pm.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_ttm_pm.c
@@ -66,8 +66,16 @@ static int i915_ttm_backup(struct i915_gem_apply_to_region *apply,
 	if (obj->flags & I915_BO_ALLOC_PM_VOLATILE)
 		return 0;
 
-	if (obj->mm.madv != I915_MADV_WILLNEED)
+	if (obj->mm.madv != I915_MADV_WILLNEED) {
+		err = dma_resv_wait_timeout(bo->base.resv,
+					    DMA_RESV_USAGE_BOOKKEEP,
+					    true, MAX_SCHEDULE_TIMEOUT);
+		if (err < 0)
+			return err;
+		if (err == 0)
+			return -EBUSY;
 		return i915_ttm_purge(obj);
+	}
 
 	/*
 	 * It seems that we might have some framebuffers still pinned at this
-- 
2.39.1



More information about the Intel-gfx-trybot mailing list