Skip to content

Commit 5886090

Browse files
Jie1zhangalexdeucher
authored andcommitted
drm/amdgpu: Move VCN reset mask setup to late_init for VCN 5.0.1
This patch moves the initialization of the VCN supported_reset mask from sw_init to a new late_init function for VCN 5.0.1. The change ensures that all necessary hardware and firmware initialization is complete before determining the supported reset types. Key changes: - Added vcn_v5_0_1_late_init() function to handle late initialization - Moved supported_reset mask setup from sw_init to late_init - Added check for per-queue reset support via amdgpu_dpm_reset_vcn_is_supported() - Updated ip_funcs to use the new late_init function This change helps ensure proper reset behavior by waiting until all dependencies are initialized before determining available reset types. Reviewed-by: Sonny Jiang <sonny.jiang@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>
1 parent dc70445 commit 5886090

1 file changed

Lines changed: 20 additions & 5 deletions

File tree

drivers/gpu/drm/amd/amdgpu/vcn_v5_0_1.c

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,25 @@ static int vcn_v5_0_1_early_init(struct amdgpu_ip_block *ip_block)
113113
return 0;
114114
}
115115

116+
static int vcn_v5_0_1_late_init(struct amdgpu_ip_block *ip_block)
117+
{
118+
struct amdgpu_device *adev = ip_block->adev;
119+
120+
adev->vcn.supported_reset =
121+
amdgpu_get_soft_full_reset_mask(&adev->vcn.inst[0].ring_enc[0]);
122+
123+
switch (amdgpu_ip_version(adev, MP0_HWIP, 0)) {
124+
case IP_VERSION(13, 0, 12):
125+
if ((adev->psp.sos.fw_version >= 0x00450025) && amdgpu_dpm_reset_vcn_is_supported(adev))
126+
adev->vcn.supported_reset |= AMDGPU_RESET_TYPE_PER_QUEUE;
127+
break;
128+
default:
129+
break;
130+
}
131+
132+
return 0;
133+
}
134+
116135
static void vcn_v5_0_1_fw_shared_init(struct amdgpu_device *adev, int inst_idx)
117136
{
118137
struct amdgpu_vcn5_fw_shared *fw_shared;
@@ -187,10 +206,6 @@ static int vcn_v5_0_1_sw_init(struct amdgpu_ip_block *ip_block)
187206
vcn_v5_0_1_fw_shared_init(adev, i);
188207
}
189208

190-
/* TODO: Add queue reset mask when FW fully supports it */
191-
adev->vcn.supported_reset =
192-
amdgpu_get_soft_full_reset_mask(&adev->vcn.inst[0].ring_enc[0]);
193-
194209
if (amdgpu_sriov_vf(adev)) {
195210
r = amdgpu_virt_alloc_mm_table(adev);
196211
if (r)
@@ -1541,7 +1556,7 @@ static void vcn_v5_0_1_set_irq_funcs(struct amdgpu_device *adev)
15411556
static const struct amd_ip_funcs vcn_v5_0_1_ip_funcs = {
15421557
.name = "vcn_v5_0_1",
15431558
.early_init = vcn_v5_0_1_early_init,
1544-
.late_init = NULL,
1559+
.late_init = vcn_v5_0_1_late_init,
15451560
.sw_init = vcn_v5_0_1_sw_init,
15461561
.sw_fini = vcn_v5_0_1_sw_fini,
15471562
.hw_init = vcn_v5_0_1_hw_init,

0 commit comments

Comments
 (0)