Skip to contentSkip to conversation

drm/amdgpu: Set doorbell range for gfx ring

PATCH In review Jinzhou Su 2 participants 2 messages Nov 27, 2020

Subsystems (2)
lore
Share & tools
lore

Jinzhou Su

author
#0 lore raw

PATCH 1/1 drm/amdgpu: Set doorbell range for gfx ring

If there are 2 gfx rings, the doorbell lower range of second ring will override the first ring.

---
 drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +5 -2
index ffbda6680a68..f33e54b01d3a 100644
@@ -6357,8 +6357,11 @@ static int gfx_v10_0_gfx_mqd_init(struct amdgpu_ring *ring)
 				    DOORBELL_EN, 0);
 	mqd->cp_rb_doorbell_control = tmp;
 
-	/* set doorbell range */
-	gfx_v10_0_cp_gfx_set_doorbell(adev, ring);
+	/*if there are 2 gfx rings, set the lower doorbell range of the first ring,
+	 *otherwise the range of the second ring will override the first ring */
+	if (ring->doorbell_index == adev->doorbell_index.gfx_ring0 << 1)
+		gfx_v10_0_cp_gfx_set_doorbell(adev, ring);
+
 	/* reset read and write pointers, similar to CP_RB0_WPTR/_RPTR */
 	ring->wptr = 0;
 	mqd->cp_gfx_hqd_rptr = RREG32_SOC15(GC, 0, mmCP_GFX_HQD_RPTR);
Signature · 6 lines
2.17.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#1 lore raw
Quoted 13 lines · Jinzhou (Joe)

If there are 2 gfx rings, the doorbell lower range of second ring will override the first ring.

---
 drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +0 -0
index ffbda6680a68..f33e54b01d3a 100644

drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c static int gfx_v10_0_gfx_mqd_init(struct amdgpu_ring *ring) · line 6362

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +3 -2
@@ -6357,8 +6357,11 @@ static int gfx_v10_0_gfx_mqd_init(struct amdgpu_ring *ring)
 				    DOORBELL_EN, 0);
 	mqd->cp_rb_doorbell_control = tmp;
 
-	/* set doorbell range */
-	gfx_v10_0_cp_gfx_set_doorbell(adev, ring);
+	/*if there are 2 gfx rings, set the lower doorbell range of the first ring,
+	 *otherwise the range of the second ring will override the first ring */
+	if (ring->doorbell_index == adev->doorbell_index.gfx_ring0 << 1)

Maybe you can compare if ring->name is "gfx_0.0.0" here.

Anyway, patch is Reviewed-by: Huang Rui <[email protected]>

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +2 -0
+		gfx_v10_0_cp_gfx_set_doorbell(adev, ring);
+
 	/* reset read and write pointers, similar to CP_RB0_WPTR/_RPTR */
 	ring->wptr = 0;
 	mqd->cp_gfx_hqd_rptr = RREG32_SOC15(GC, 0, mmCP_GFX_HQD_RPTR);
Signature · 1 line
2.17.1

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