[Intel-gfx] [PATCH 12/15] drm/i915: Extract common cleanup into i915_ppgtt_release

Thierry, Michel michel.thierry at intel.com
Fri Aug 8 15:07:25 CEST 2014



> -----Original Message-----
> From: Intel-gfx [mailto:intel-gfx-bounces at lists.freedesktop.org] On Behalf
> Of Daniel Vetter
> Sent: Wednesday, August 06, 2014 2:05 PM
> To: Intel Graphics Development
> Cc: Daniel Vetter
> Subject: [Intel-gfx] [PATCH 12/15] 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.
> 
> Signed-off-by: Daniel Vetter <daniel.vetter at ffwll.ch>
> ---
>  drivers/gpu/drm/i915/i915_gem_gtt.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c
> b/drivers/gpu/drm/i915/i915_gem_gtt.c
> index a4c1740d79be..bbf113ed7339 100644
> --- a/drivers/gpu/drm/i915/i915_gem_gtt.c
> +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
> @@ -403,9 +403,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);
>  }
> @@ -1029,8 +1026,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);
> @@ -1255,6 +1250,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);
>  }
> --
> 1.9.3

Reviewed-by: Michel Thierry <michel.thierry at intel.com>
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 6656 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/intel-gfx/attachments/20140808/f76b280f/attachment.bin>


More information about the Intel-gfx mailing list