[PATCH] Update VM function point when VM state changed.

Gang Ba gaba at amd.com
Wed Aug 14 15:01:45 UTC 2019


Change-Id: Ibcfada560a00c9aeebfd922ae48de920e44a5866
Signed-off-by: Gang Ba <gaba at amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
index c1baf3d..72dd434 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -2862,6 +2862,12 @@ int amdgpu_vm_make_compute(struct amdgpu_device *adev, struct amdgpu_vm *vm, uns
 	WARN_ONCE((vm->use_cpu_for_update && !amdgpu_gmc_vram_full_visible(&adev->gmc)),
 		  "CPU update of VM recommended only for large BAR system\n");
 
+	if (vm->use_cpu_for_update)
+		vm->update_funcs = &amdgpu_vm_cpu_funcs;
+	else
+		vm->update_funcs = &amdgpu_vm_sdma_funcs;
+	vm->last_update = NULL;
+
 	if (vm->pasid) {
 		unsigned long flags;
 
-- 
2.7.4



More information about the amd-gfx mailing list