diff options
author | Christian König <christian.koenig@amd.com> | 2017-07-11 11:25:49 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-07-14 11:06:45 -0400 |
commit | 6375bbb4d259416ad867ab887333ee88d1b90323 (patch) | |
tree | 3438f4f2e835532f1c1c4f891583b94ab3628a7d /drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | |
parent | 68c62306b378451ddb1a14c08022d18df3848b4d (diff) |
drm/amdgpu: make sure BOs are always kunmapped
When a BO is moved or destroyed it shouldn't be kmapped any more.
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_object.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c index 6e24339ecc46..a019556a8e71 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) | |||
93 | 93 | ||
94 | bo = container_of(tbo, struct amdgpu_bo, tbo); | 94 | bo = container_of(tbo, struct amdgpu_bo, tbo); |
95 | 95 | ||
96 | amdgpu_bo_kunmap(bo); | ||
96 | amdgpu_update_memory_usage(adev, &bo->tbo.mem, NULL); | 97 | amdgpu_update_memory_usage(adev, &bo->tbo.mem, NULL); |
97 | 98 | ||
98 | drm_gem_object_release(&bo->gem_base); | 99 | drm_gem_object_release(&bo->gem_base); |
@@ -931,6 +932,8 @@ void amdgpu_bo_move_notify(struct ttm_buffer_object *bo, | |||
931 | abo = container_of(bo, struct amdgpu_bo, tbo); | 932 | abo = container_of(bo, struct amdgpu_bo, tbo); |
932 | amdgpu_vm_bo_invalidate(adev, abo); | 933 | amdgpu_vm_bo_invalidate(adev, abo); |
933 | 934 | ||
935 | amdgpu_bo_kunmap(abo); | ||
936 | |||
934 | /* remember the eviction */ | 937 | /* remember the eviction */ |
935 | if (evict) | 938 | if (evict) |
936 | atomic64_inc(&adev->num_evictions); | 939 | atomic64_inc(&adev->num_evictions); |