diff options
author | Christian König <christian.koenig@amd.com> | 2018-08-16 06:01:03 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-08-27 12:09:39 -0400 |
commit | 1cadf2b36809dca78ea9bbee7789a30727c1b5b3 (patch) | |
tree | e6824e56a53614cd7f9096d9405c00a42600fa0f /drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | |
parent | 5b394b2ddf0347bef56e50c69a58773c94343ff3 (diff) |
drm/amdgpu: fix VM clearing for the root PD
We need to figure out the address after validating the BO, not before.
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com>
Reviewed-by: Huang Rui <ray.huang@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 | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c index ece0ac703e27..e40ca8676418 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | |||
@@ -369,7 +369,6 @@ static int amdgpu_vm_clear_bo(struct amdgpu_device *adev, | |||
369 | uint64_t addr; | 369 | uint64_t addr; |
370 | int r; | 370 | int r; |
371 | 371 | ||
372 | addr = amdgpu_bo_gpu_offset(bo); | ||
373 | entries = amdgpu_bo_size(bo) / 8; | 372 | entries = amdgpu_bo_size(bo) / 8; |
374 | 373 | ||
375 | if (pte_support_ats) { | 374 | if (pte_support_ats) { |
@@ -401,6 +400,7 @@ static int amdgpu_vm_clear_bo(struct amdgpu_device *adev, | |||
401 | if (r) | 400 | if (r) |
402 | goto error; | 401 | goto error; |
403 | 402 | ||
403 | addr = amdgpu_bo_gpu_offset(bo); | ||
404 | if (ats_entries) { | 404 | if (ats_entries) { |
405 | uint64_t ats_value; | 405 | uint64_t ats_value; |
406 | 406 | ||