No functional change.

Signed-off-by: Christian König <christian.koe...@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
index 44950f3b8801..69b0bee0661e 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -1804,13 +1804,12 @@ static int amdgpu_vm_bo_update_mapping(struct 
amdgpu_device *adev,
        /*
         * reserve space for two commands every (1 << BLOCK_SIZE)
         *  entries or 2k dwords (whatever is smaller)
-         *
-         * The second command is for the shadow pagetables.
         */
+       ncmds = ((nptes >> min(adev->vm_manager.block_size, 11u)) + 1);
+
+         /* The second command is for the shadow pagetables. */
        if (vm->root.base.bo->shadow)
-               ncmds = ((nptes >> min(adev->vm_manager.block_size, 11u)) + 1) 
* 2;
-       else
-               ncmds = ((nptes >> min(adev->vm_manager.block_size, 11u)) + 1);
+               ncmds *= 2;
 
        /* padding, etc. */
        ndw = 64;
@@ -1829,10 +1828,11 @@ static int amdgpu_vm_bo_update_mapping(struct 
amdgpu_device *adev,
                ndw += ncmds * 10;
 
                /* extra commands for begin/end fragments */
+               ncmds = 2 * adev->vm_manager.fragment_size;
                if (vm->root.base.bo->shadow)
-                       ndw += 2 * 10 * adev->vm_manager.fragment_size * 2;
-               else
-                       ndw += 2 * 10 * adev->vm_manager.fragment_size;
+                       ncmds *= 2;
+
+               ndw += 10 * ncmds;
 
                params.func = amdgpu_vm_do_set_ptes;
        }
-- 
2.17.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reply via email to