Skip to contentSkip to conversation

drm/amd/amdgpu: Update VM function pointer

PATCH In review Gang Ba 2 participants 2 messages Aug 14, 2019 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

Gang Ba

author
#0 lore raw

PATCH 1/1 drm/amd/amdgpu: Update VM function pointer

When VM state changed and system in large bar mode, make sure to use CPU update function, otherwise use SDMA function.

Change-Id Ibcfada560a00c9aeebfd922ae48de920e44a5866
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +7 -0
index c1baf3d..7ddca3e 100644
@@ -2862,6 +2862,13 @@ 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;
+	dma_fence_put(vm->last_update);
+	vm->last_update = NULL;
+
 	if (vm->pasid) {
 		unsigned long flags;
 
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 1565804106-21037-1-git-send-email-gaba-5C7GfCeVMHo@public.gmane.org

#2 lore raw

Am 14.08.19 um 19:35 schrieb Gang Ba:

Quoted 3 lines

When VM state changed and system in large bar mode, make sure to use CPU update function, otherwise use SDMA function.

Looks like you have some extra spaces in front of the commit message.

Apart from that looks good to me now and fix the commit message fixed it is Reviewed-by: Christian König <[email protected]>

Regards,
Christian.

Quoted 15 lines
Change-Id Ibcfada560a00c9aeebfd922ae48de920e44a5866
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 7 +++++++
  1 file changed, 7 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +0 -0
index c1baf3d..7ddca3e 100644
@@ -2862,6 +2862,13 @@ 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");
 

drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c int amdgpu_vm_make_compute(struct amdgpu_device *adev, struct amdgpu_vm *vm, uns · line 2874

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +7 -0
+	if (vm->use_cpu_for_update)
+		vm->update_funcs = &amdgpu_vm_cpu_funcs;
+	else
+		vm->update_funcs = &amdgpu_vm_sdma_funcs;
+	dma_fence_put(vm->last_update);
+	vm->last_update = NULL;
+
  	if (vm->pasid) {
  		unsigned long flags;
 

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx