diff options
author | Alex Deucher <alexander.deucher@amd.com> | 2024-06-03 17:07:56 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2024-09-02 11:40:58 -0400 |
commit | 2480599890296b386839bc53367c10f19d97716d (patch) | |
tree | 53f76af567ea8067a5b23117ef2a1ee1ae0e5878 /drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c | |
parent | d1f214432110748603dd310fbe6099df875e6f04 (diff) | |
download | linux-2480599890296b386839bc53367c10f19d97716d.tar.gz linux-2480599890296b386839bc53367c10f19d97716d.tar.bz2 linux-2480599890296b386839bc53367c10f19d97716d.zip |
drm/amdgpu/gfx12: add ring reset callbacks
Add ring reset callbacks for gfx and compute.
Acked-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c index 6f700800f346..335b5f01c6e8 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c @@ -5158,6 +5158,22 @@ static void gfx_v12_ip_dump(void *handle) amdgpu_gfx_off_ctrl(adev, true); } +static int gfx_v12_0_reset_ring(struct amdgpu_ring *ring, unsigned int vmid) +{ + int r; + + r = amdgpu_mes_reset_legacy_queue(ring->adev, ring, vmid); + if (r) + return r; + + /* reset the ring */ + ring->wptr = 0; + *ring->wptr_cpu_addr = 0; + amdgpu_ring_clear_ring(ring); + + return amdgpu_ring_test_ring(ring); +} + static const struct amd_ip_funcs gfx_v12_0_ip_funcs = { .name = "gfx_v12_0", .early_init = gfx_v12_0_early_init, @@ -5220,6 +5236,7 @@ static const struct amdgpu_ring_funcs gfx_v12_0_ring_funcs_gfx = { .emit_reg_write_reg_wait = gfx_v12_0_ring_emit_reg_write_reg_wait, .soft_recovery = gfx_v12_0_ring_soft_recovery, .emit_mem_sync = gfx_v12_0_emit_mem_sync, + .reset = gfx_v12_0_reset_ring, }; static const struct amdgpu_ring_funcs gfx_v12_0_ring_funcs_compute = { @@ -5254,6 +5271,7 @@ static const struct amdgpu_ring_funcs gfx_v12_0_ring_funcs_compute = { .emit_reg_write_reg_wait = gfx_v12_0_ring_emit_reg_write_reg_wait, .soft_recovery = gfx_v12_0_ring_soft_recovery, .emit_mem_sync = gfx_v12_0_emit_mem_sync, + .reset = gfx_v12_0_reset_ring, }; static const struct amdgpu_ring_funcs gfx_v12_0_ring_funcs_kiq = { |