diff mbox series

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

Message ID 20241122110741.405941-1-vidya.srinivas@intel.com (mailing list archive)
State New
Headers show
Series drm/i915/dpt: Restrict shrinker to DPT objects not mapped | expand

Commit Message

Vidya Srinivas Nov. 22, 2024, 11:07 a.m. UTC
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@google.com>
Suggested-by: Ville Syrj_l_ <ville.syrjala@linux.intel.com>
Signed-off-by: Vidya Srinivas <vidya.srinivas@intel.com>
---
 drivers/gpu/drm/i915/gem/i915_gem_object.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

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