diff options
author | Christian König <christian.koenig@amd.com> | 2017-07-11 11:23:29 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-07-14 11:06:44 -0400 |
commit | 68c62306b378451ddb1a14c08022d18df3848b4d (patch) | |
tree | 18b6fedb8cffbfd3a431c428ab8efcf59cb68b1c | |
parent | 03918b36f6602df298b5ce7925ef77f7ecf0756a (diff) |
drm/amdgpu: flush the HDP only once for CPU based VM updates
No need to do this after every single update.
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c index 5638c16887d8..24879cf3da9b 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | |||
@@ -992,10 +992,6 @@ static void amdgpu_vm_cpu_set_ptes(struct amdgpu_pte_update_params *params, | |||
992 | i, value, flags); | 992 | i, value, flags); |
993 | addr += incr; | 993 | addr += incr; |
994 | } | 994 | } |
995 | |||
996 | /* Flush HDP */ | ||
997 | mb(); | ||
998 | amdgpu_gart_flush_gpu_tlb(params->adev, 0); | ||
999 | } | 995 | } |
1000 | 996 | ||
1001 | static int amdgpu_vm_wait_pd(struct amdgpu_device *adev, struct amdgpu_vm *vm, | 997 | static int amdgpu_vm_wait_pd(struct amdgpu_device *adev, struct amdgpu_vm *vm, |
@@ -1238,6 +1234,12 @@ int amdgpu_vm_update_directories(struct amdgpu_device *adev, | |||
1238 | if (r) | 1234 | if (r) |
1239 | amdgpu_vm_invalidate_level(&vm->root); | 1235 | amdgpu_vm_invalidate_level(&vm->root); |
1240 | 1236 | ||
1237 | if (vm->use_cpu_for_update) { | ||
1238 | /* Flush HDP */ | ||
1239 | mb(); | ||
1240 | amdgpu_gart_flush_gpu_tlb(adev, 0); | ||
1241 | } | ||
1242 | |||
1241 | return r; | 1243 | return r; |
1242 | } | 1244 | } |
1243 | 1245 | ||
@@ -1745,6 +1747,12 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev, | |||
1745 | list_add(&bo_va->vm_status, &vm->cleared); | 1747 | list_add(&bo_va->vm_status, &vm->cleared); |
1746 | spin_unlock(&vm->status_lock); | 1748 | spin_unlock(&vm->status_lock); |
1747 | 1749 | ||
1750 | if (vm->use_cpu_for_update) { | ||
1751 | /* Flush HDP */ | ||
1752 | mb(); | ||
1753 | amdgpu_gart_flush_gpu_tlb(adev, 0); | ||
1754 | } | ||
1755 | |||
1748 | return 0; | 1756 | return 0; |
1749 | } | 1757 | } |
1750 | 1758 | ||