Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/amd: Add per-ring reset for vcn v4.0.0 use

If there is a problem requiring a reset of the VCN engine, it is better to
reset the VCN engine rather than the entire GPU.

Add a reset callback for the ring which will stop and start VCN if an
issue happens.

Link: https://lore.kernel.org/r/20250506204948.12048-3-mario.limonciello@amd.com
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Mario Limonciello and committed by
Alex Deucher
b8b6e6f1 d1a46cdd

+16 -1
+16 -1
drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c
··· 239 239 adev->vcn.inst[i].pause_dpg_mode = vcn_v4_0_pause_dpg_mode; 240 240 } 241 241 242 - /* TODO: Add queue reset mask when FW fully supports it */ 243 242 adev->vcn.supported_reset = 244 243 amdgpu_get_soft_full_reset_mask(&adev->vcn.inst[0].ring_enc[0]); 244 + adev->vcn.supported_reset |= AMDGPU_RESET_TYPE_PER_QUEUE; 245 245 246 246 if (amdgpu_sriov_vf(adev)) { 247 247 r = amdgpu_virt_alloc_mm_table(adev); ··· 1947 1947 return 0; 1948 1948 } 1949 1949 1950 + static int vcn_v4_0_ring_reset(struct amdgpu_ring *ring, unsigned int vmid) 1951 + { 1952 + struct amdgpu_device *adev = ring->adev; 1953 + struct amdgpu_vcn_inst *vinst = &adev->vcn.inst[ring->me]; 1954 + 1955 + if (!(adev->vcn.supported_reset & AMDGPU_RESET_TYPE_PER_QUEUE)) 1956 + return -EOPNOTSUPP; 1957 + 1958 + vcn_v4_0_stop(vinst); 1959 + vcn_v4_0_start(vinst); 1960 + 1961 + return amdgpu_ring_test_helper(ring); 1962 + } 1963 + 1950 1964 static struct amdgpu_ring_funcs vcn_v4_0_unified_ring_vm_funcs = { 1951 1965 .type = AMDGPU_RING_TYPE_VCN_ENC, 1952 1966 .align_mask = 0x3f, ··· 1990 1976 .emit_wreg = vcn_v2_0_enc_ring_emit_wreg, 1991 1977 .emit_reg_wait = vcn_v2_0_enc_ring_emit_reg_wait, 1992 1978 .emit_reg_write_reg_wait = amdgpu_ring_emit_reg_write_reg_wait_helper, 1979 + .reset = vcn_v4_0_ring_reset, 1993 1980 }; 1994 1981 1995 1982 /**