Commit 79c77ac6 authored by Jinzhou Su's avatar Jinzhou Su Committed by Alex Deucher
Browse files

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.

Signed-off-by: default avatarJinzhou.Su <Jinzhou.Su@amd.com>
Reviewed-by: default avatarHuang Rui <ray.huang@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 3591ecd6
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -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 */
	/*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);