]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
drm/i915/dpt: Make DPT object unshrinkable
authorVidya Srinivas <vidya.srinivas@intel.com>
Mon, 20 May 2024 16:56:34 +0000 (22:26 +0530)
committerJani Nikula <jani.nikula@intel.com>
Wed, 29 May 2024 08:35:43 +0000 (11:35 +0300)
In some scenarios, the DPT object gets shrunk but
the actual framebuffer did not and thus its still
there on the DPT's vm->bound_list. Then it tries to
rewrite the PTEs via a stale CPU mapping. This causes panic.

Cc: stable@vger.kernel.org
Reported-by: Shawn Lee <shawn.c.lee@intel.com>
Fixes: 0dc987b699ce ("drm/i915/display: Add smem fallback allocation for dpt")
Signed-off-by: Vidya Srinivas <vidya.srinivas@intel.com>
[vsyrjala: Add TODO comment]
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240520165634.1162470-1-vidya.srinivas@intel.com
(cherry picked from commit 51064d471c53dcc8eddd2333c3f1c1d9131ba36c)
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
drivers/gpu/drm/i915/gem/i915_gem_object.h

index 3560a062d2872fb5d09edc5cabd78f95a590a3fa..5d7446a48ae790d75c8540d0e28957f78e9ecd30 100644 (file)
@@ -284,7 +284,9 @@ bool i915_gem_object_has_iomem(const struct drm_i915_gem_object *obj);
 static inline bool
 i915_gem_object_is_shrinkable(const struct drm_i915_gem_object *obj)
 {
-       return i915_gem_object_type_has(obj, I915_GEM_OBJECT_IS_SHRINKABLE);
+       /* 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;
 }
 
 static inline bool