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

Commit 104bd2ca authored by Emily Deng's avatar Emily Deng Committed by Alex Deucher
Browse files

drm/amdgpu: Correct the IB size of bo update mapping.



The amdgpu_vm_frag_ptes will call amdgpu_vm_update_ptes, and for buffer
object that has shadow buffer, need twice commands.

Signed-off-by: default avatarEmily Deng <Emily.Deng@amd.com>
Reviewed-by: default avatarChunming Zhou <david1.zhou@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent dc947770
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -1200,12 +1200,18 @@ static int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev,
         *
         * 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);

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

	/* one PDE write for each huge page */
	if (vm->root.base.bo->shadow)
		ndw += ((nptes >> adev->vm_manager.block_size) + 1) * 6 * 2;
	else
		ndw += ((nptes >> adev->vm_manager.block_size) + 1) * 6;

	if (pages_addr) {