@@ -5158,6 +5158,22 @@ static void gfx_v12_ip_dump(void *handle)
51585158 amdgpu_gfx_off_ctrl (adev , true);
51595159}
51605160
5161+ static int gfx_v12_0_reset_ring (struct amdgpu_ring * ring , unsigned int vmid )
5162+ {
5163+ int r ;
5164+
5165+ r = amdgpu_mes_reset_legacy_queue (ring -> adev , ring , vmid );
5166+ if (r )
5167+ return r ;
5168+
5169+ /* reset the ring */
5170+ ring -> wptr = 0 ;
5171+ * ring -> wptr_cpu_addr = 0 ;
5172+ amdgpu_ring_clear_ring (ring );
5173+
5174+ return amdgpu_ring_test_ring (ring );
5175+ }
5176+
51615177static const struct amd_ip_funcs gfx_v12_0_ip_funcs = {
51625178 .name = "gfx_v12_0" ,
51635179 .early_init = gfx_v12_0_early_init ,
@@ -5220,6 +5236,7 @@ static const struct amdgpu_ring_funcs gfx_v12_0_ring_funcs_gfx = {
52205236 .emit_reg_write_reg_wait = gfx_v12_0_ring_emit_reg_write_reg_wait ,
52215237 .soft_recovery = gfx_v12_0_ring_soft_recovery ,
52225238 .emit_mem_sync = gfx_v12_0_emit_mem_sync ,
5239+ .reset = gfx_v12_0_reset_ring ,
52235240};
52245241
52255242static 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 = {
52545271 .emit_reg_write_reg_wait = gfx_v12_0_ring_emit_reg_write_reg_wait ,
52555272 .soft_recovery = gfx_v12_0_ring_soft_recovery ,
52565273 .emit_mem_sync = gfx_v12_0_emit_mem_sync ,
5274+ .reset = gfx_v12_0_reset_ring ,
52575275};
52585276
52595277static const struct amdgpu_ring_funcs gfx_v12_0_ring_funcs_kiq = {
0 commit comments