Skip to content

Commit

Permalink
drm/i915: Extract common cleanup into i915_ppgtt_release
Browse files Browse the repository at this point in the history
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: Michel Thierry <michel.thierry@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
  • Loading branch information
Daniel Vetter committed Aug 13, 2014
1 parent d624d86 commit 19dd120
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions drivers/gpu/drm/i915/i915_gem_gtt.c
Original file line number Diff line number Diff line change
Expand Up @@ -391,9 +391,6 @@ static void gen8_ppgtt_cleanup(struct i915_address_space *vm)
struct i915_hw_ppgtt *ppgtt =
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_free(ppgtt);
}
Expand Down Expand Up @@ -974,8 +971,6 @@ static void gen6_ppgtt_cleanup(struct i915_address_space *vm)
struct i915_hw_ppgtt *ppgtt =
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);

gen6_ppgtt_unmap_pages(ppgtt);
Expand Down Expand Up @@ -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.inactive_list));

list_del(&ppgtt->base.global_link);
drm_mm_takedown(&ppgtt->base.mm);

ppgtt->base.cleanup(&ppgtt->base);
kfree(ppgtt);
}
Expand Down

0 comments on commit 19dd120

Please sign in to comment.