]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
drm/amdgpu: Correct the ndw of bo update mapping.
authorEmily Deng <Emily.Deng@amd.com>
Fri, 8 Jun 2018 08:36:22 +0000 (16:36 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 15 Jun 2018 17:20:40 +0000 (12:20 -0500)
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>
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c

index b0eb2f537392d192d84d3884bd685f7084e9e220..d88687b617e2f2b6ff3c9b48899e9fa13db1fe0a 100644 (file)
@@ -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;
        }