aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2019-01-30 08:09:29 -0500
committerAlex Deucher <alexander.deucher@amd.com>2019-02-05 21:16:22 -0500
commit1b52f2d5679db90166ea71382211f3c7319aab51 (patch)
treec4f5eee39b6e41c00d601b06fe37af54c5b4c4c5 /drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
parent90d647222a8f004bf1430ecea3099ebcc54bfc21 (diff)
drm/amdgpu: cleanup VM dw estimation a bit
No functional change. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Felix Kuehling <Felix.Kuehling@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.c16
1 files 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 93b936f7de4b..1e3a36c90d38 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -1806,13 +1806,12 @@ static int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev,
1806 /* 1806 /*
1807 * reserve space for two commands every (1 << BLOCK_SIZE) 1807 * reserve space for two commands every (1 << BLOCK_SIZE)
1808 * entries or 2k dwords (whatever is smaller) 1808 * entries or 2k dwords (whatever is smaller)
1809 *
1810 * The second command is for the shadow pagetables.
1811 */ 1809 */
1810 ncmds = ((nptes >> min(adev->vm_manager.block_size, 11u)) + 1);
1811
1812 /* The second command is for the shadow pagetables. */
1812 if (vm->root.base.bo->shadow) 1813 if (vm->root.base.bo->shadow)
1813 ncmds = ((nptes >> min(adev->vm_manager.block_size, 11u)) + 1) * 2; 1814 ncmds *= 2;
1814 else
1815 ncmds = ((nptes >> min(adev->vm_manager.block_size, 11u)) + 1);
1816 1815
1817 /* padding, etc. */ 1816 /* padding, etc. */
1818 ndw = 64; 1817 ndw = 64;
@@ -1831,10 +1830,11 @@ static int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev,
1831 ndw += ncmds * 10; 1830 ndw += ncmds * 10;
1832 1831
1833 /* extra commands for begin/end fragments */ 1832 /* extra commands for begin/end fragments */
1833 ncmds = 2 * adev->vm_manager.fragment_size;
1834 if (vm->root.base.bo->shadow) 1834 if (vm->root.base.bo->shadow)
1835 ndw += 2 * 10 * adev->vm_manager.fragment_size * 2; 1835 ncmds *= 2;
1836 else 1836
1837 ndw += 2 * 10 * adev->vm_manager.fragment_size; 1837 ndw += 10 * ncmds;
1838 1838
1839 params.func = amdgpu_vm_do_set_ptes; 1839 params.func = amdgpu_vm_do_set_ptes;
1840 } 1840 }