[PATCH 8/8] oops

Matthew Auld matthew.auld at intel.com
Fri Jan 27 17:16:25 UTC 2023


---
 drivers/gpu/drm/i915/gem/i915_gem_region.c | 4 +++-
 drivers/gpu/drm/i915/gem/i915_gem_ttm_pm.c | 8 ++++----
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_region.c b/drivers/gpu/drm/i915/gem/i915_gem_region.c
index a4fb577eceb4..3057eba8400b 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_region.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_region.c
@@ -191,8 +191,10 @@ int i915_gem_process_region(struct intel_memory_region *mr,
 			if (ret)
 				continue;
 
-			if (obj->mm.region == mr)
+			if (obj->mm.region == mr) {
 				ret = ops->process_obj(apply, obj);
+				pr_err("process_obj failed with %d\n", ret);
+			}
 			/* Implicit object unlock */
 		}
 
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..be44e7eed892 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_ttm_pm.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_ttm_pm.c
@@ -66,9 +66,6 @@ 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)
-		return i915_ttm_purge(obj);
-
 	/*
 	 * It seems that we might have some framebuffers still pinned at this
 	 * stage, but for such objects we might also need to deal with the CCS
@@ -190,7 +187,10 @@ static int i915_ttm_restore(struct i915_gem_apply_to_region *apply,
 		return err;
 
 	/* Content may have been swapped. */
-	err = ttm_tt_populate(backup_bo->bdev, backup_bo->ttm, &ctx);
+	if (!backup_bo->resource)
+		err = ttm_bo_validate(backup_bo, i915_ttm_sys_placement(), &ctx);
+	if (!err)
+		err = ttm_tt_populate(backup_bo->bdev, backup_bo->ttm, &ctx);
 	if (!err) {
 		err = i915_gem_obj_copy_ttm(obj, backup, pm_apply->allow_gpu,
 					    false);
-- 
2.39.1



More information about the Intel-gfx-trybot mailing list