From: Christian König Date: Thu, 30 Aug 2018 07:45:07 +0000 (+0200) Subject: drm/amdgpu: Revert "kmap PDs/PTs in amdgpu_vm_update_directories" X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=17cc525206d6dba36d0fde12fd512c77dcfa1954;p=openwrt%2Fstaging%2Fblogic.git drm/amdgpu: Revert "kmap PDs/PTs in amdgpu_vm_update_directories" This reverts commit a7f91061c60ad9cac2e6a03b642be6a4f88b3662. Felix pointed out that we need to have the BOs mapped even before amdgpu_vm_update_directories is called. Signed-off-by: Christian König Acked-by: Junwei Zhang Signed-off-by: Alex Deucher --- 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, list_move(&bo_base->vm_status, &vm->moved); spin_unlock(&vm->moved_lock); } else { - r = amdgpu_ttm_alloc_gart(&bo->tbo); + if (vm->use_cpu_for_update) + r = amdgpu_bo_kmap(bo, NULL); + else + r = amdgpu_ttm_alloc_gart(&bo->tbo); if (r) break; list_move(&bo_base->vm_status, &vm->relocated); @@ -1094,14 +1097,6 @@ restart: params.adev = adev; if (vm->use_cpu_for_update) { - struct amdgpu_vm_bo_base *bo_base; - - list_for_each_entry(bo_base, &vm->relocated, vm_status) { - r = amdgpu_bo_kmap(bo_base->bo, NULL); - if (unlikely(r)) - return r; - } - r = amdgpu_vm_wait_pd(adev, vm, AMDGPU_FENCE_OWNER_VM); if (unlikely(r)) return r;