aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
diff options
context:
space:
mode:
authorEmily Deng <Emily.Deng@amd.com>2017-12-29 00:13:08 -0500
committerAlex Deucher <alexander.deucher@amd.com>2017-12-30 22:24:20 -0500
commit104bd2ca1124dfd9aa904d5f5a96253ef2b580f6 (patch)
tree06d9f0e326f8952aec540e8c6e27dda9fa3c957d /drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
parentdc947770cf3400dd07ed2e2b7b9acb4f96d5137f (diff)
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 <Emily.Deng@amd.com> Reviewed-by: Chunming Zhou <david1.zhou@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.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
index e623109be202..d4510807a692 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,
1200 * 1200 *
1201 * The second command is for the shadow pagetables. 1201 * The second command is for the shadow pagetables.
1202 */ 1202 */
1203 ncmds = ((nptes >> min(adev->vm_manager.block_size, 11u)) + 1) * 2; 1203 if (vm->root.base.bo->shadow)
1204 ncmds = ((nptes >> min(adev->vm_manager.block_size, 11u)) + 1) * 2;
1205 else
1206 ncmds = ((nptes >> min(adev->vm_manager.block_size, 11u)) + 1);
1204 1207
1205 /* padding, etc. */ 1208 /* padding, etc. */
1206 ndw = 64; 1209 ndw = 64;
1207 1210
1208 /* one PDE write for each huge page */ 1211 /* one PDE write for each huge page */
1209 ndw += ((nptes >> adev->vm_manager.block_size) + 1) * 6; 1212 if (vm->root.base.bo->shadow)
1213 ndw += ((nptes >> adev->vm_manager.block_size) + 1) * 6 * 2;
1214 else
1215 ndw += ((nptes >> adev->vm_manager.block_size) + 1) * 6;
1210 1216
1211 if (pages_addr) { 1217 if (pages_addr) {
1212 /* copy commands needed */ 1218 /* copy commands needed */