diff options
author | Felix Kuehling <Felix.Kuehling@amd.com> | 2018-02-06 20:32:38 -0500 |
---|---|---|
committer | Oded Gabbay <oded.gabbay@gmail.com> | 2018-02-06 20:32:38 -0500 |
commit | a46a2cd103a863724d668c86dca86bd0d93a19e4 (patch) | |
tree | 07286914cb6b5ed9ce10c290d4ed1fa892864ec0 /drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | |
parent | 3c728d3aa1fd5c7c2461835a93ac8fad57813db6 (diff) |
drm/amdgpu: Add GPUVM memory management functions for KFD
v2:
* Removed unused flags from struct kgd_mem
* Updated some comments
* Added a check to unmap_memory_from_gpu whether BO was mapped
v3: add mutex_destroy in relevant places
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Acked-by: Oded Gabbay <oded.gabbay@gmail.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_object.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c index 216799ccb545..9157745fce14 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | |||
@@ -36,6 +36,7 @@ | |||
36 | #include <drm/drm_cache.h> | 36 | #include <drm/drm_cache.h> |
37 | #include "amdgpu.h" | 37 | #include "amdgpu.h" |
38 | #include "amdgpu_trace.h" | 38 | #include "amdgpu_trace.h" |
39 | #include "amdgpu_amdkfd.h" | ||
39 | 40 | ||
40 | static bool amdgpu_need_backup(struct amdgpu_device *adev) | 41 | static bool amdgpu_need_backup(struct amdgpu_device *adev) |
41 | { | 42 | { |
@@ -54,6 +55,9 @@ static void amdgpu_ttm_bo_destroy(struct ttm_buffer_object *tbo) | |||
54 | struct amdgpu_device *adev = amdgpu_ttm_adev(tbo->bdev); | 55 | struct amdgpu_device *adev = amdgpu_ttm_adev(tbo->bdev); |
55 | struct amdgpu_bo *bo = ttm_to_amdgpu_bo(tbo); | 56 | struct amdgpu_bo *bo = ttm_to_amdgpu_bo(tbo); |
56 | 57 | ||
58 | if (bo->kfd_bo) | ||
59 | amdgpu_amdkfd_unreserve_system_memory_limit(bo); | ||
60 | |||
57 | amdgpu_bo_kunmap(bo); | 61 | amdgpu_bo_kunmap(bo); |
58 | 62 | ||
59 | drm_gem_object_release(&bo->gem_base); | 63 | drm_gem_object_release(&bo->gem_base); |