diff options
author | Jinzhou Su <Jinzhou.Su@amd.com> | 2020-11-27 16:06:30 +0800 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2020-12-01 15:59:09 -0500 |
commit | 79c77ac60336ed25107099e222fe4381e7f3a42d (patch) | |
tree | 5c378c6c8939f7af521d7bd404280cb7e18befe1 /drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | |
parent | 3591ecd630ab46ed750216c6b8768aea5a75611e (diff) | |
download | lwn-79c77ac60336ed25107099e222fe4381e7f3a42d.tar.gz lwn-79c77ac60336ed25107099e222fe4381e7f3a42d.zip |
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: Jinzhou.Su <Jinzhou.Su@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c index ffbda6680a68..f33e54b01d3a 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c @@ -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); |