Commit 1b52f2d5 authored by Christian König's avatar Christian König Committed by Alex Deucher

drm/amdgpu: cleanup VM dw estimation a bit

No functional change.
Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
Reviewed-by: default avatarFelix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 90d64722
...@@ -1806,14 +1806,13 @@ static int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev, ...@@ -1806,14 +1806,13 @@ static int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev,
/* /*
* reserve space for two commands every (1 << BLOCK_SIZE) * reserve space for two commands every (1 << BLOCK_SIZE)
* entries or 2k dwords (whatever is smaller) * entries or 2k dwords (whatever is smaller)
*
* 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 = ((nptes >> min(adev->vm_manager.block_size, 11u)) + 1);
/* The second command is for the shadow pagetables. */
if (vm->root.base.bo->shadow)
ncmds *= 2;
/* padding, etc. */ /* padding, etc. */
ndw = 64; ndw = 64;
...@@ -1831,10 +1830,11 @@ static int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev, ...@@ -1831,10 +1830,11 @@ static int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev,
ndw += ncmds * 10; ndw += ncmds * 10;
/* extra commands for begin/end fragments */ /* extra commands for begin/end fragments */
ncmds = 2 * adev->vm_manager.fragment_size;
if (vm->root.base.bo->shadow) if (vm->root.base.bo->shadow)
ndw += 2 * 10 * adev->vm_manager.fragment_size * 2; ncmds *= 2;
else
ndw += 2 * 10 * adev->vm_manager.fragment_size; ndw += 10 * ncmds;
params.func = amdgpu_vm_do_set_ptes; params.func = amdgpu_vm_do_set_ptes;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment