Browse Source

drm/amdgpu: Correct the ndw of bo update mapping.

For buffer object that has shadow buffer, need twice commands.

Signed-off-by: Emily Deng <Emily.Deng@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Emily Deng 7 years ago
parent
commit
11528640c7
1 changed files with 4 additions and 1 deletions
  1. 4 1
      drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c

+ 4 - 1
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c

@@ -1324,7 +1324,10 @@ static int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev,
 		ndw += ncmds * 10;
 
 		/* extra commands for begin/end fragments */
-		ndw += 2 * 10 * adev->vm_manager.fragment_size;
+		if (vm->root.base.bo->shadow)
+		        ndw += 2 * 10 * adev->vm_manager.fragment_size * 2;
+		else
+		        ndw += 2 * 10 * adev->vm_manager.fragment_size;
 
 		params.func = amdgpu_vm_do_set_ptes;
 	}