]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/amdgpu: Add ring reset support for VCN v5.0.1
authorJesse.Zhang <Jesse.Zhang@amd.com>
Wed, 6 Aug 2025 08:20:28 +0000 (16:20 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 23 Sep 2025 14:41:27 +0000 (10:41 -0400)
commitdc704458dd31ba45bf9cac3fe3e3ab546dabed20
tree64e6c9e410f73fc793514a535b9654b88aece7f2
parenteb6910cdaa8a1b5af11df6fd2e9a0b2b9f72a028
drm/amdgpu: Add ring reset support for VCN v5.0.1

Implement the ring reset callback for VCN v5.0.1 to properly handle
hardware recovery when encountering GPU hangs. The new functionality:

1. Adds vcn_v5_0_1_ring_reset() function that:
   - Prepares for reset using amdgpu_ring_reset_helper_begin()
   - Performs VCN instance reset via amdgpu_dpm_reset_vcn()
   - Re-initializes hardware through vcn_v5_0_1_hw_init_inst()
   - Restarts DPG mode with vcn_v5_0_1_start_dpg_mode()
   - Completes reset with amdgpu_ring_reset_helper_end()

2. Hooks the reset function into the unified ring functions via:
   - Adding .reset = vcn_v5_0_1_ring_reset to vcn_v5_0_1_unified_ring_vm_funcs

3. Maintains existing behavior for SR-IOV VF cases by checking RRMT status

This provides proper hardware recovery capabilities for VCN 5.0.1 IP block
during fault conditions, matching functionality available in other VCN versions.

v2: Remove the RRMT_ENABLED cap setting in the reset function
    and replace adev->vcn.inst[ring->me].indirect_sram with vinst->indirect_sram (Lijo)

Reviewed-by: Sonny Jiang <sonny.jiang@amd.com>
Suggested-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Jesse Zhang <Jesse.Zhang@amd.com>
Signed-off-by: Ruili Ji <ruiliji2@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/vcn_v5_0_1.c