Skip to contentSkip to conversation

drm/amdgpu: modify packet size for pm4 flush tlbs

PATCH In review Alex Sierra 2 participants 2 messages Jan 14, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: modify packet size for pm4 flush tlbs

[Why]
PM4 packet size for flush message was oversized.

[How]
Packet size adjusted to allocate flush + fence packets.

Change-Id I9a577d2118398b3139011829de12789b2a577a19
---
 drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 2 +-
 drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c  | 2 +-
 drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c | 3 ++-
 drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c  | 3 ++-
 4 files changed, 6 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +1 -1
index d72b60f997c8..b15a01bf4b15 100644
@@ -369,7 +369,7 @@ static const struct kiq_pm4_funcs gfx_v10_0_kiq_pm4_funcs = {
 	.map_queues_size = 7,
 	.unmap_queues_size = 6,
 	.query_status_size = 7,
-	.invalidate_tlbs_size = 12,
+	.invalidate_tlbs_size = 2,
 };
 
 static void gfx_v10_0_set_kiq_pm4_funcs(struct amdgpu_device *adev)
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +1 -1
index 44cdb6fc92ff..e1956ebb09b9 100644
@@ -859,7 +859,7 @@ static const struct kiq_pm4_funcs gfx_v9_0_kiq_pm4_funcs = {
 	.map_queues_size = 7,
 	.unmap_queues_size = 6,
 	.query_status_size = 7,
-	.invalidate_tlbs_size = 12,
+	.invalidate_tlbs_size = 2,
 };
 
 static void gfx_v9_0_set_kiq_pm4_funcs(struct amdgpu_device *adev)
drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c +2 -1
index 8afd05834714..0c5bf3bd640f 100644
@@ -418,7 +418,8 @@ static int gmc_v10_0_flush_gpu_tlb_pasid(struct amdgpu_device *adev,
 
 	if (amdgpu_emu_mode == 0 && ring->sched.ready) {
 		spin_lock(&adev->gfx.kiq.ring_lock);
-		amdgpu_ring_alloc(ring, kiq->pmf->invalidate_tlbs_size);
+		/* 2 dwords flush + 8 dwords fence */
+		amdgpu_ring_alloc(ring, kiq->pmf->invalidate_tlbs_size + 8);
 		kiq->pmf->kiq_invalidate_tlbs(ring,
 					pasid, flush_type, all_hub);
 		amdgpu_fence_emit_polling(ring, &seq);
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +2 -1
index 40a496804356..54bdc1786ab1 100644
@@ -578,7 +578,8 @@ static int gmc_v9_0_flush_gpu_tlb_pasid(struct amdgpu_device *adev,
 
 	if (ring->sched.ready) {
 		spin_lock(&adev->gfx.kiq.ring_lock);
-		amdgpu_ring_alloc(ring, kiq->pmf->invalidate_tlbs_size);
+		/* 2 dwords flush + 8 dwords fence */
+		amdgpu_ring_alloc(ring, kiq->pmf->invalidate_tlbs_size + 8);
 		kiq->pmf->kiq_invalidate_tlbs(ring,
 					pasid, flush_type, all_hub);
 		amdgpu_fence_emit_polling(ring, &seq);
Signature · 6 lines
2.17.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Reviewed-by on v1 1/1
#1 lore raw

Am 14.01.20 um 04:43 schrieb Alex Sierra:

Quoted 8 lines

[Why]
PM4 packet size for flush message was oversized.

[How]
Packet size adjusted to allocate flush + fence packets.

Change-Id I9a577d2118398b3139011829de12789b2a577a19
Quoted 52 lines
---
  drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 2 +-
  drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c  | 2 +-
  drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c | 3 ++-
  drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c  | 3 ++-
  4 files changed, 6 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +1 -1
index d72b60f997c8..b15a01bf4b15 100644
@@ -369,7 +369,7 @@ static const struct kiq_pm4_funcs gfx_v10_0_kiq_pm4_funcs = {
  	.map_queues_size = 7,
  	.unmap_queues_size = 6,
  	.query_status_size = 7,
-	.invalidate_tlbs_size = 12,
+	.invalidate_tlbs_size = 2,
  };
 
  static void gfx_v10_0_set_kiq_pm4_funcs(struct amdgpu_device *adev)
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +1 -1
index 44cdb6fc92ff..e1956ebb09b9 100644
@@ -859,7 +859,7 @@ static const struct kiq_pm4_funcs gfx_v9_0_kiq_pm4_funcs = {
  	.map_queues_size = 7,
  	.unmap_queues_size = 6,
  	.query_status_size = 7,
-	.invalidate_tlbs_size = 12,
+	.invalidate_tlbs_size = 2,
  };
 
  static void gfx_v9_0_set_kiq_pm4_funcs(struct amdgpu_device *adev)
drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c +2 -1
index 8afd05834714..0c5bf3bd640f 100644
@@ -418,7 +418,8 @@ static int gmc_v10_0_flush_gpu_tlb_pasid(struct amdgpu_device *adev,
 
  	if (amdgpu_emu_mode == 0 && ring->sched.ready) {
  		spin_lock(&adev->gfx.kiq.ring_lock);
-		amdgpu_ring_alloc(ring, kiq->pmf->invalidate_tlbs_size);
+		/* 2 dwords flush + 8 dwords fence */
+		amdgpu_ring_alloc(ring, kiq->pmf->invalidate_tlbs_size + 8);
  		kiq->pmf->kiq_invalidate_tlbs(ring,
  					pasid, flush_type, all_hub);
  		amdgpu_fence_emit_polling(ring, &seq);
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +0 -0
index 40a496804356..54bdc1786ab1 100644

drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c static int gmc_v9_0_flush_gpu_tlb_pasid(struct amdgpu_device *adev, · line 585

Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +2 -1
@@ -578,7 +578,8 @@ static int gmc_v9_0_flush_gpu_tlb_pasid(struct amdgpu_device *adev,
 
  	if (ring->sched.ready) {
  		spin_lock(&adev->gfx.kiq.ring_lock);
-		amdgpu_ring_alloc(ring, kiq->pmf->invalidate_tlbs_size);
+		/* 2 dwords flush + 8 dwords fence */
+		amdgpu_ring_alloc(ring, kiq->pmf->invalidate_tlbs_size + 8);
  		kiq->pmf->kiq_invalidate_tlbs(ring,
  					pasid, flush_type, all_hub);
  		amdgpu_fence_emit_polling(ring, &seq);

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