drm/amdgpu: update VM PDs after the PTs
authorChristian König <christian.koenig@amd.com>
Fri, 1 Sep 2017 18:37:57 +0000 (20:37 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 10 Jan 2018 20:44:53 +0000 (15:44 -0500)
Necessary for the next patch.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Acked-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c

index 5e539fc5b05f1b6e580f9d5d6d58a569d0066364..e80fc38141b57c5d00b0221fc2cd7c66dfe275dc 100644 (file)
@@ -778,10 +778,6 @@ static int amdgpu_bo_vm_update_pte(struct amdgpu_cs_parser *p)
        struct amdgpu_bo *bo;
        int i, r;
 
-       r = amdgpu_vm_update_directories(adev, vm);
-       if (r)
-               return r;
-
        r = amdgpu_vm_clear_freed(adev, vm, NULL);
        if (r)
                return r;
@@ -839,6 +835,10 @@ static int amdgpu_bo_vm_update_pte(struct amdgpu_cs_parser *p)
        if (r)
                return r;
 
+       r = amdgpu_vm_update_directories(adev, vm);
+       if (r)
+               return r;
+
        r = amdgpu_sync_fence(adev, &p->job->sync, vm->last_update, false);
        if (r)
                return r;
index 10805edcf96412889243ab7013a06b88b2b4e2ac..e48b4ec88c8c72b84599d8f85b38836c92c26523 100644 (file)
@@ -518,10 +518,6 @@ static void amdgpu_gem_va_update_vm(struct amdgpu_device *adev,
        if (!amdgpu_vm_ready(vm))
                return;
 
-       r = amdgpu_vm_update_directories(adev, vm);
-       if (r)
-               goto error;
-
        r = amdgpu_vm_clear_freed(adev, vm, NULL);
        if (r)
                goto error;
@@ -530,6 +526,10 @@ static void amdgpu_gem_va_update_vm(struct amdgpu_device *adev,
            operation == AMDGPU_VA_OP_REPLACE)
                r = amdgpu_vm_bo_update(adev, bo_va, false);
 
+       r = amdgpu_vm_update_directories(adev, vm);
+       if (r)
+               goto error;
+
 error:
        if (r && r != -ERESTARTSYS)
                DRM_ERROR("Couldn't update BO_VA (%d)\n", r);