drm/amd/amdgpu: Update VM function pointer

Submitted by Gang Ba on Aug. 14, 2019, 5:35 p.m.

Details

Message ID 1565804106-21037-1-git-send-email-gaba@amd.com
State New
Headers show
Series "drm/amd/amdgpu: Update VM function pointer" ( rev: 1 ) in AMD X.Org drivers

Not browsing as part of any series.

Commit Message

Gang Ba Aug. 14, 2019, 5:35 p.m.
When VM state changed and system in large bar mode,
  make sure to use CPU update function, otherwise use
  SDMA function.

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

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
index c1baf3d..7ddca3e 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -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;
 

Comments

Am 14.08.19 um 19:35 schrieb Gang Ba:
>    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 <christian.koenig@amd.com>

Regards,
Christian.

>
> Change-Id: Ibcfada560a00c9aeebfd922ae48de920e44a5866
> Signed-off-by: Gang Ba <gaba@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 7 +++++++
>   1 file changed, 7 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> index c1baf3d..7ddca3e 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> @@ -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;
>