diff options
author | Alex Deucher <alexander.deucher@amd.com> | 2018-01-05 10:25:57 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-02-19 14:17:14 -0500 |
commit | b1d128689f9c602a3dbea37b47a27a568d55754d (patch) | |
tree | 6e7f5703c0ed9a28b140017fc3fc3bd0504a9cc4 | |
parent | 73c732405fddfe16b122c77de83397289463b557 (diff) |
drm/amdgpu: adjust HDP write queue flushing for tlb invalidation
Separate tlb invalidation and hdp flushing and move the HDP
flush to the caller.
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c | 3 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c | 3 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 3 |
6 files changed, 4 insertions, 11 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c index 0a4f34afaaaa..d0617f1c252f 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c | |||
@@ -247,6 +247,7 @@ int amdgpu_gart_unbind(struct amdgpu_device *adev, uint64_t offset, | |||
247 | } | 247 | } |
248 | } | 248 | } |
249 | mb(); | 249 | mb(); |
250 | amdgpu_asic_flush_hdp(adev); | ||
250 | amdgpu_gart_flush_gpu_tlb(adev, 0); | 251 | amdgpu_gart_flush_gpu_tlb(adev, 0); |
251 | return 0; | 252 | return 0; |
252 | } | 253 | } |
@@ -329,6 +330,7 @@ int amdgpu_gart_bind(struct amdgpu_device *adev, uint64_t offset, | |||
329 | return r; | 330 | return r; |
330 | 331 | ||
331 | mb(); | 332 | mb(); |
333 | amdgpu_asic_flush_hdp(adev); | ||
332 | amdgpu_gart_flush_gpu_tlb(adev, 0); | 334 | amdgpu_gart_flush_gpu_tlb(adev, 0); |
333 | return 0; | 335 | return 0; |
334 | } | 336 | } |
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c index 5afbc5e714d0..df0f99741b73 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | |||
@@ -856,6 +856,7 @@ restart: | |||
856 | if (vm->use_cpu_for_update) { | 856 | if (vm->use_cpu_for_update) { |
857 | /* Flush HDP */ | 857 | /* Flush HDP */ |
858 | mb(); | 858 | mb(); |
859 | amdgpu_asic_flush_hdp(adev); | ||
859 | amdgpu_gart_flush_gpu_tlb(adev, 0); | 860 | amdgpu_gart_flush_gpu_tlb(adev, 0); |
860 | } else if (params.ib->length_dw == 0) { | 861 | } else if (params.ib->length_dw == 0) { |
861 | amdgpu_job_free(job); | 862 | amdgpu_job_free(job); |
@@ -1457,6 +1458,7 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev, | |||
1457 | if (vm->use_cpu_for_update) { | 1458 | if (vm->use_cpu_for_update) { |
1458 | /* Flush HDP */ | 1459 | /* Flush HDP */ |
1459 | mb(); | 1460 | mb(); |
1461 | amdgpu_asic_flush_hdp(adev); | ||
1460 | amdgpu_gart_flush_gpu_tlb(adev, 0); | 1462 | amdgpu_gart_flush_gpu_tlb(adev, 0); |
1461 | } | 1463 | } |
1462 | 1464 | ||
diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c index 5f5eb15ccf4a..aa06e7232d29 100644 --- a/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c | |||
@@ -360,8 +360,6 @@ static int gmc_v6_0_mc_init(struct amdgpu_device *adev) | |||
360 | static void gmc_v6_0_gart_flush_gpu_tlb(struct amdgpu_device *adev, | 360 | static void gmc_v6_0_gart_flush_gpu_tlb(struct amdgpu_device *adev, |
361 | uint32_t vmid) | 361 | uint32_t vmid) |
362 | { | 362 | { |
363 | WREG32(mmHDP_MEM_COHERENCY_FLUSH_CNTL, 0); | ||
364 | |||
365 | WREG32(mmVM_INVALIDATE_REQUEST, 1 << vmid); | 363 | WREG32(mmVM_INVALIDATE_REQUEST, 1 << vmid); |
366 | } | 364 | } |
367 | 365 | ||
diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c index 12e49bd8fd2d..550abff5cb12 100644 --- a/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c | |||
@@ -432,9 +432,6 @@ static int gmc_v7_0_mc_init(struct amdgpu_device *adev) | |||
432 | static void gmc_v7_0_gart_flush_gpu_tlb(struct amdgpu_device *adev, | 432 | static void gmc_v7_0_gart_flush_gpu_tlb(struct amdgpu_device *adev, |
433 | uint32_t vmid) | 433 | uint32_t vmid) |
434 | { | 434 | { |
435 | /* flush hdp cache */ | ||
436 | WREG32(mmHDP_MEM_COHERENCY_FLUSH_CNTL, 0); | ||
437 | |||
438 | /* bits 0-15 are the VM contexts0-15 */ | 435 | /* bits 0-15 are the VM contexts0-15 */ |
439 | WREG32(mmVM_INVALIDATE_REQUEST, 1 << vmid); | 436 | WREG32(mmVM_INVALIDATE_REQUEST, 1 << vmid); |
440 | } | 437 | } |
diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c index 9a170e37fbe7..c0ddd0f35b3b 100644 --- a/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c | |||
@@ -607,9 +607,6 @@ static int gmc_v8_0_mc_init(struct amdgpu_device *adev) | |||
607 | static void gmc_v8_0_gart_flush_gpu_tlb(struct amdgpu_device *adev, | 607 | static void gmc_v8_0_gart_flush_gpu_tlb(struct amdgpu_device *adev, |
608 | uint32_t vmid) | 608 | uint32_t vmid) |
609 | { | 609 | { |
610 | /* flush hdp cache */ | ||
611 | WREG32(mmHDP_MEM_COHERENCY_FLUSH_CNTL, 0); | ||
612 | |||
613 | /* bits 0-15 are the VM contexts0-15 */ | 610 | /* bits 0-15 are the VM contexts0-15 */ |
614 | WREG32(mmVM_INVALIDATE_REQUEST, 1 << vmid); | 611 | WREG32(mmVM_INVALIDATE_REQUEST, 1 << vmid); |
615 | } | 612 | } |
diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c index 100ec69f020a..2a565a48bd4f 100644 --- a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | |||
@@ -330,9 +330,6 @@ static void gmc_v9_0_gart_flush_gpu_tlb(struct amdgpu_device *adev, | |||
330 | const unsigned eng = 17; | 330 | const unsigned eng = 17; |
331 | unsigned i, j; | 331 | unsigned i, j; |
332 | 332 | ||
333 | /* flush hdp cache */ | ||
334 | adev->nbio_funcs->hdp_flush(adev); | ||
335 | |||
336 | spin_lock(&adev->mc.invalidate_lock); | 333 | spin_lock(&adev->mc.invalidate_lock); |
337 | 334 | ||
338 | for (i = 0; i < AMDGPU_MAX_VMHUBS; ++i) { | 335 | for (i = 0; i < AMDGPU_MAX_VMHUBS; ++i) { |