]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
drm/amdgpu/gfx9.4.3: implement wave kill for compute queues
authorAlex Deucher <alexander.deucher@amd.com>
Fri, 12 Jul 2024 22:27:37 +0000 (18:27 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 23 Jul 2024 21:42:45 +0000 (17:42 -0400)
Based on gfx9.0 implementation.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c

index 20ea6cb01edfda9e716ff560378c2855d9381ed7..2ac398184e1251e5c956ea20ab29a507704e404f 100644 (file)
@@ -2833,6 +2833,19 @@ static void gfx_v9_4_3_ring_emit_reg_write_reg_wait(struct amdgpu_ring *ring,
                                                   ref, mask);
 }
 
+static void gfx_v9_4_3_ring_soft_recovery(struct amdgpu_ring *ring,
+                                         unsigned vmid)
+{
+       struct amdgpu_device *adev = ring->adev;
+       uint32_t value = 0;
+
+       value = REG_SET_FIELD(value, SQ_CMD, CMD, 0x03);
+       value = REG_SET_FIELD(value, SQ_CMD, MODE, 0x01);
+       value = REG_SET_FIELD(value, SQ_CMD, CHECK_VMID, 1);
+       value = REG_SET_FIELD(value, SQ_CMD, VM_ID, vmid);
+       WREG32_SOC15(GC, GET_INST(GC, ring->xcc_id), regSQ_CMD, value);
+}
+
 static void gfx_v9_4_3_xcc_set_compute_eop_interrupt_state(
        struct amdgpu_device *adev, int me, int pipe,
        enum amdgpu_interrupt_state state, int xcc_id)
@@ -4116,6 +4129,7 @@ static const struct amdgpu_ring_funcs gfx_v9_4_3_ring_funcs_compute = {
        .emit_wreg = gfx_v9_4_3_ring_emit_wreg,
        .emit_reg_wait = gfx_v9_4_3_ring_emit_reg_wait,
        .emit_reg_write_reg_wait = gfx_v9_4_3_ring_emit_reg_write_reg_wait,
+       .soft_recovery = gfx_v9_4_3_ring_soft_recovery,
        .emit_mem_sync = gfx_v9_4_3_emit_mem_sync,
        .emit_wave_limit = gfx_v9_4_3_emit_wave_limit,
 };