diff options
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c index f50697df9799..f31fa351caba 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | |||
@@ -343,7 +343,10 @@ int amdgpu_vm_validate_pt_bos(struct amdgpu_device *adev, struct amdgpu_vm *vm, | |||
343 | list_move(&bo_base->vm_status, &vm->moved); | 343 | list_move(&bo_base->vm_status, &vm->moved); |
344 | spin_unlock(&vm->moved_lock); | 344 | spin_unlock(&vm->moved_lock); |
345 | } else { | 345 | } else { |
346 | r = amdgpu_ttm_alloc_gart(&bo->tbo); | 346 | if (vm->use_cpu_for_update) |
347 | r = amdgpu_bo_kmap(bo, NULL); | ||
348 | else | ||
349 | r = amdgpu_ttm_alloc_gart(&bo->tbo); | ||
347 | if (r) | 350 | if (r) |
348 | break; | 351 | break; |
349 | list_move(&bo_base->vm_status, &vm->relocated); | 352 | list_move(&bo_base->vm_status, &vm->relocated); |
@@ -1094,14 +1097,6 @@ restart: | |||
1094 | params.adev = adev; | 1097 | params.adev = adev; |
1095 | 1098 | ||
1096 | if (vm->use_cpu_for_update) { | 1099 | if (vm->use_cpu_for_update) { |
1097 | struct amdgpu_vm_bo_base *bo_base; | ||
1098 | |||
1099 | list_for_each_entry(bo_base, &vm->relocated, vm_status) { | ||
1100 | r = amdgpu_bo_kmap(bo_base->bo, NULL); | ||
1101 | if (unlikely(r)) | ||
1102 | return r; | ||
1103 | } | ||
1104 | |||
1105 | r = amdgpu_vm_wait_pd(adev, vm, AMDGPU_FENCE_OWNER_VM); | 1100 | r = amdgpu_vm_wait_pd(adev, vm, AMDGPU_FENCE_OWNER_VM); |
1106 | if (unlikely(r)) | 1101 | if (unlikely(r)) |
1107 | return r; | 1102 | return r; |