Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 86209523 authored by Bas Nieuwenhuizen's avatar Bas Nieuwenhuizen Committed by Alex Deucher
Browse files

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: default avatarBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 378e2d5b
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -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;