[PATCH] drm/i915/dpt: Restrict shrinker to DPT objects not mapped

Vidya Srinivas vidya.srinivas at intel.com
Fri Nov 22 11:07:41 UTC 2024


Restricting all DPT objects as unshrinkable was causing
some chromebooks to run out of memory causing
DMA remap failures. Thanks to Brian Geffon for the
pointers on debug and suggesting usage of !obj->mm.mapping

Fixes: 43e2b37e2ab6 ("drm/i915/dpt: Make DPT object unshrinkable")

Credits-to: Brian Geffon <bgeffon at google.com>
Suggested-by: Ville Syrj_l_ <ville.syrjala at linux.intel.com>
Signed-off-by: Vidya Srinivas <vidya.srinivas at intel.com>
---
 drivers/gpu/drm/i915/gem/i915_gem_object.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_object.h b/drivers/gpu/drm/i915/gem/i915_gem_object.h
index 3dc61cbd2e11..b155f0139d4e 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_object.h
+++ b/drivers/gpu/drm/i915/gem/i915_gem_object.h
@@ -285,7 +285,7 @@ i915_gem_object_is_shrinkable(const struct drm_i915_gem_object *obj)
 {
 	/* TODO: make DPT shrinkable when it has no bound vmas */
 	return i915_gem_object_type_has(obj, I915_GEM_OBJECT_IS_SHRINKABLE) &&
-		!obj->is_dpt;
+		!(obj->is_dpt && obj->mm.mapping);
 }
 
 static inline bool
-- 
2.34.1



More information about the Intel-gfx mailing list