drm/amdgpu: validate the VM root PD from the VM code
authorChristian König <christian.koenig@amd.com>
Wed, 15 Aug 2018 17:10:40 +0000 (19:10 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 27 Aug 2018 16:11:17 +0000 (11:11 -0500)
Preparation for following changes. This validates the root PD twice,
but the overhead of that should be minimal.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c

index 995ad5e83611b99706345f7b062d7a4431dfffb6..7d7d7e5322466f3c1446b0eac58ab30d1cc29216 100644 (file)
@@ -291,11 +291,11 @@ int amdgpu_vm_validate_pt_bos(struct amdgpu_device *adev, struct amdgpu_vm *vm,
        list_for_each_entry_safe(bo_base, tmp, &vm->evicted, vm_status) {
                struct amdgpu_bo *bo = bo_base->bo;
 
-               if (bo->parent) {
-                       r = validate(param, bo);
-                       if (r)
-                               break;
+               r = validate(param, bo);
+               if (r)
+                       break;
 
+               if (bo->parent) {
                        spin_lock(&glob->lru_lock);
                        ttm_bo_move_to_lru_tail(&bo->tbo);
                        if (bo->shadow)