From: Emily Deng Date: Fri, 29 Dec 2017 05:13:08 +0000 (+0800) Subject: drm/amdgpu: Correct the IB size of bo update mapping. X-Git-Tag: v4.19~1610^2~15^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=104bd2ca1124dfd9aa904d5f5a96253ef2b580f6;p=platform%2Fkernel%2Flinux-rpi3.git 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: Emily Deng Reviewed-by: Chunming Zhou Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c index e623109..d451080 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c @@ -1200,13 +1200,19 @@ static int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev, * * The second command is for the shadow pagetables. */ - ncmds = ((nptes >> min(adev->vm_manager.block_size, 11u)) + 1) * 2; + 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 */ - ndw += ((nptes >> adev->vm_manager.block_size) + 1) * 6; + 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) { /* copy commands needed */