Commit 19dd120c authored by Daniel Vetter's avatar Daniel Vetter

drm/i915: Extract common cleanup into i915_ppgtt_release

Address space cleanup isn't really a job for the low-level cleanup
callbacks. Without this change we can't reuse the low-level cleanup
callback for the aliasing ppgtt cleanup.
Reviewed-by: default avatarMichel Thierry <michel.thierry@intel.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent d624d86e
...@@ -391,9 +391,6 @@ static void gen8_ppgtt_cleanup(struct i915_address_space *vm) ...@@ -391,9 +391,6 @@ static void gen8_ppgtt_cleanup(struct i915_address_space *vm)
struct i915_hw_ppgtt *ppgtt = struct i915_hw_ppgtt *ppgtt =
container_of(vm, struct i915_hw_ppgtt, base); container_of(vm, struct i915_hw_ppgtt, base);
list_del(&vm->global_link);
drm_mm_takedown(&vm->mm);
gen8_ppgtt_unmap_pages(ppgtt); gen8_ppgtt_unmap_pages(ppgtt);
gen8_ppgtt_free(ppgtt); gen8_ppgtt_free(ppgtt);
} }
...@@ -974,8 +971,6 @@ static void gen6_ppgtt_cleanup(struct i915_address_space *vm) ...@@ -974,8 +971,6 @@ static void gen6_ppgtt_cleanup(struct i915_address_space *vm)
struct i915_hw_ppgtt *ppgtt = struct i915_hw_ppgtt *ppgtt =
container_of(vm, struct i915_hw_ppgtt, base); container_of(vm, struct i915_hw_ppgtt, base);
list_del(&vm->global_link);
drm_mm_takedown(&ppgtt->base.mm);
drm_mm_remove_node(&ppgtt->node); drm_mm_remove_node(&ppgtt->node);
gen6_ppgtt_unmap_pages(ppgtt); gen6_ppgtt_unmap_pages(ppgtt);
...@@ -1226,6 +1221,9 @@ void i915_ppgtt_release(struct kref *kref) ...@@ -1226,6 +1221,9 @@ void i915_ppgtt_release(struct kref *kref)
WARN_ON(!list_empty(&ppgtt->base.active_list)); WARN_ON(!list_empty(&ppgtt->base.active_list));
WARN_ON(!list_empty(&ppgtt->base.inactive_list)); WARN_ON(!list_empty(&ppgtt->base.inactive_list));
list_del(&ppgtt->base.global_link);
drm_mm_takedown(&ppgtt->base.mm);
ppgtt->base.cleanup(&ppgtt->base); ppgtt->base.cleanup(&ppgtt->base);
kfree(ppgtt); kfree(ppgtt);
} }
......
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