[PATCH 2/3] drm/i915: don't backup DONTNEED objects
Matthew Auld
matthew.auld at intel.com
Wed Jan 25 12:37:33 UTC 2023
We can simply discard the backing storage for these. If we try to backup
such an object the backing will anyway be nuked, but now the
bo->resource is also NULL, leading to explosions later.
Signed-off-by: Matthew Auld <matthew.auld at intel.com>
---
drivers/gpu/drm/i915/gem/i915_gem_ttm_pm.c | 3 +++
1 file changed, 3 insertions(+)
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 7e67742bc65e..09680e993b4b 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_ttm_pm.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_ttm_pm.c
@@ -66,6 +66,9 @@ 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
--
2.39.1
More information about the Intel-gfx-trybot
mailing list