Commit be7612fd authored by Maarten Lankhorst's avatar Maarten Lankhorst

drm/i915: Require object lock when freeing pages during destruction

TTM already requires this, and we require it for delayed destroy.
Signed-off-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: default avatarMatthew Auld <matthew.auld@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20211216142749.1966107-11-maarten.lankhorst@linux.intel.com
parent 2c3849ba
...@@ -262,6 +262,8 @@ static void __i915_gem_object_free_mmaps(struct drm_i915_gem_object *obj) ...@@ -262,6 +262,8 @@ static void __i915_gem_object_free_mmaps(struct drm_i915_gem_object *obj)
*/ */
void __i915_gem_object_pages_fini(struct drm_i915_gem_object *obj) void __i915_gem_object_pages_fini(struct drm_i915_gem_object *obj)
{ {
assert_object_held(obj);
if (!list_empty(&obj->vma.list)) { if (!list_empty(&obj->vma.list)) {
struct i915_vma *vma; struct i915_vma *vma;
...@@ -328,7 +330,10 @@ static void __i915_gem_free_objects(struct drm_i915_private *i915, ...@@ -328,7 +330,10 @@ static void __i915_gem_free_objects(struct drm_i915_private *i915,
obj->ops->delayed_free(obj); obj->ops->delayed_free(obj);
continue; continue;
} }
i915_gem_object_lock(obj, NULL);
__i915_gem_object_pages_fini(obj); __i915_gem_object_pages_fini(obj);
i915_gem_object_unlock(obj);
__i915_gem_free_object(obj); __i915_gem_free_object(obj);
/* But keep the pointer alive for RCU-protected lookups */ /* But keep the pointer alive for RCU-protected lookups */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment