Skip to content

Commit

Permalink
drm/amdgpu: Account for shadow PTs in mapping update IB size.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Bas Nieuwenhuizen authored and Alex Deucher committed Sep 12, 2017
1 parent 378e2d5 commit 8620952
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1536,10 +1536,12 @@ static int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev,
nptes = last - start + 1;

/*
* reserve space for one command every (1 << BLOCK_SIZE)
* 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;
ncmds = ((nptes >> min(adev->vm_manager.block_size, 11u)) + 1) * 2;

/* padding, etc. */
ndw = 64;
Expand Down

0 comments on commit 8620952

Please sign in to comment.