diff options
author | Christian König <christian.koenig@amd.com> | 2019-01-30 08:44:36 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2019-02-27 22:24:12 -0500 |
commit | 1e2930374f565312e726f86150d9d1484f81c4d9 (patch) | |
tree | 7c2d163f16f067e2f00d4d1d5325d77f541a7976 /drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | |
parent | 672e78cab819ebe31e3b9b8abac367be8a110472 (diff) |
drm/amdgpu: clear PDs/PTs only after initializing them
Clear the VM PDs/PTs only after initializing all the structures.
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c index 942b5ebc6dc2..12d51d96491e 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | |||
@@ -945,10 +945,6 @@ int amdgpu_vm_alloc_pts(struct amdgpu_device *adev, | |||
945 | if (r) | 945 | if (r) |
946 | return r; | 946 | return r; |
947 | 947 | ||
948 | r = amdgpu_vm_clear_bo(adev, vm, pt, cursor.level, ats); | ||
949 | if (r) | ||
950 | goto error_free_pt; | ||
951 | |||
952 | if (vm->use_cpu_for_update) { | 948 | if (vm->use_cpu_for_update) { |
953 | r = amdgpu_bo_kmap(pt, NULL); | 949 | r = amdgpu_bo_kmap(pt, NULL); |
954 | if (r) | 950 | if (r) |
@@ -961,6 +957,10 @@ int amdgpu_vm_alloc_pts(struct amdgpu_device *adev, | |||
961 | pt->parent = amdgpu_bo_ref(cursor.parent->base.bo); | 957 | pt->parent = amdgpu_bo_ref(cursor.parent->base.bo); |
962 | 958 | ||
963 | amdgpu_vm_bo_base_init(&entry->base, vm, pt); | 959 | amdgpu_vm_bo_base_init(&entry->base, vm, pt); |
960 | |||
961 | r = amdgpu_vm_clear_bo(adev, vm, pt, cursor.level, ats); | ||
962 | if (r) | ||
963 | goto error_free_pt; | ||
964 | } | 964 | } |
965 | 965 | ||
966 | return 0; | 966 | return 0; |
@@ -3031,13 +3031,14 @@ int amdgpu_vm_init(struct amdgpu_device *adev, struct amdgpu_vm *vm, | |||
3031 | if (r) | 3031 | if (r) |
3032 | goto error_unreserve; | 3032 | goto error_unreserve; |
3033 | 3033 | ||
3034 | amdgpu_vm_bo_base_init(&vm->root.base, vm, root); | ||
3035 | |||
3034 | r = amdgpu_vm_clear_bo(adev, vm, root, | 3036 | r = amdgpu_vm_clear_bo(adev, vm, root, |
3035 | adev->vm_manager.root_level, | 3037 | adev->vm_manager.root_level, |
3036 | vm->pte_support_ats); | 3038 | vm->pte_support_ats); |
3037 | if (r) | 3039 | if (r) |
3038 | goto error_unreserve; | 3040 | goto error_unreserve; |
3039 | 3041 | ||
3040 | amdgpu_vm_bo_base_init(&vm->root.base, vm, root); | ||
3041 | amdgpu_bo_unreserve(vm->root.base.bo); | 3042 | amdgpu_bo_unreserve(vm->root.base.bo); |
3042 | 3043 | ||
3043 | if (pasid) { | 3044 | if (pasid) { |