aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
diff options
context:
space:
mode:
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>2017-09-07 07:23:21 -0400
committerAlex Deucher <alexander.deucher@amd.com>2017-09-12 14:23:52 -0400
commit862095237c392887819e98018d6dc187d8c78726 (patch)
tree49231f545cbdf988e61bcba673037799d47643e5 /drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
parent378e2d5b504fe0231c557751e58b80fcf717cc20 (diff)
drm/amdgpu: Account for shadow PTs in mapping update IB size.
When amdgpu_vm_frag_ptes calls amdgpu_vm_update_ptes and the pt has a shadow PT we mirror all the write to the shadow PT too, which results in twice the commands. Signed-off-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Reviewed-by: Christian König <christian.koenig@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.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
index c9223a5184de..545531db66db 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -1536,10 +1536,12 @@ static int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev,
1536 nptes = last - start + 1; 1536 nptes = last - start + 1;
1537 1537
1538 /* 1538 /*
1539 * reserve space for one command every (1 << BLOCK_SIZE) 1539 * reserve space for two commands every (1 << BLOCK_SIZE)
1540 * entries or 2k dwords (whatever is smaller) 1540 * entries or 2k dwords (whatever is smaller)
1541 *
1542 * The second command is for the shadow pagetables.
1541 */ 1543 */
1542 ncmds = (nptes >> min(adev->vm_manager.block_size, 11u)) + 1; 1544 ncmds = ((nptes >> min(adev->vm_manager.block_size, 11u)) + 1) * 2;
1543 1545
1544 /* padding, etc. */ 1546 /* padding, etc. */
1545 ndw = 64; 1547 ndw = 64;