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_ttm.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_ttm.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c index 5fcb3488a595..c2fae04d769a 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | |||
@@ -259,6 +259,13 @@ static int amdgpu_verify_access(struct ttm_buffer_object *bo, struct file *filp) | |||
259 | { | 259 | { |
260 | struct amdgpu_bo *abo = ttm_to_amdgpu_bo(bo); | 260 | struct amdgpu_bo *abo = ttm_to_amdgpu_bo(bo); |
261 | 261 | ||
262 | /* | ||
263 | * Don't verify access for KFD BOs. They don't have a GEM | ||
264 | * object associated with them. | ||
265 | */ | ||
266 | if (abo->kfd_bo) | ||
267 | return 0; | ||
268 | |||
262 | if (amdgpu_ttm_tt_get_usermm(bo->ttm)) | 269 | if (amdgpu_ttm_tt_get_usermm(bo->ttm)) |
263 | return -EPERM; | 270 | return -EPERM; |
264 | return drm_vma_node_verify_access(&abo->gem_base.vma_node, | 271 | return drm_vma_node_verify_access(&abo->gem_base.vma_node, |