[PATCH 6/7] drm/amdgpu: make sure BOs are always kunmapped

Felix Kuehling felix.kuehling at amd.com
Wed Jul 12 20:32:56 UTC 2017


Reviewed-by: Felix Kuehling <Felix.Kuehling at amd.com>


On 17-07-12 04:31 AM, Christian König wrote:
> From: Christian König <christian.koenig at amd.com>
>
> When a BO is moved or destroyed it shouldn't be kmapped any more.
>
> Signed-off-by: Christian König <christian.koenig at amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> index 6e24339..a019556 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> @@ -93,6 +93,7 @@ static void amdgpu_ttm_bo_destroy(struct ttm_buffer_object *tbo)
>  
>  	bo = container_of(tbo, struct amdgpu_bo, tbo);
>  
> +	amdgpu_bo_kunmap(bo);
>  	amdgpu_update_memory_usage(adev, &bo->tbo.mem, NULL);
>  
>  	drm_gem_object_release(&bo->gem_base);
> @@ -931,6 +932,8 @@ void amdgpu_bo_move_notify(struct ttm_buffer_object *bo,
>  	abo = container_of(bo, struct amdgpu_bo, tbo);
>  	amdgpu_vm_bo_invalidate(adev, abo);
>  
> +	amdgpu_bo_kunmap(abo);
> +
>  	/* remember the eviction */
>  	if (evict)
>  		atomic64_inc(&adev->num_evictions);



More information about the amd-gfx mailing list