From 6a9b7891de7f4b7510da9a59d76a4b8197fed6f2 Mon Sep 17 00:00:00 2001 From: Andrey Grodzovsky Date: Sun, 1 Jul 2018 23:02:59 -0400 Subject: drm/amdgpu: Verify root PD is mapped into kernel address space. When PD/PT update maode is by CPU root must be mapped. Signed-off-by: Andrey Grodzovsky --- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c index 8ec459e..7c99f92 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c @@ -2614,6 +2614,16 @@ int amdgpu_vm_init(struct amdgpu_device *adev, struct amdgpu_vm *vm, goto error_unreserve; amdgpu_vm_bo_base_init(&vm->root.base, vm, root); + + if (vm->use_cpu_for_update) { + r = amdgpu_bo_kmap(vm->root.base.bo, NULL); + if (r) { + amdgpu_bo_unref(&vm->root.base.bo->shadow); + amdgpu_bo_unref(&vm->root.base.bo); + return r; + } + } + amdgpu_bo_unreserve(vm->root.base.bo); if (pasid) { -- 2.7.4