Skip to content

Commit 99579c5

Browse files
committed
drm/amdgpu/mes: add compatibility checks for set_hw_resource_1
Seems some older MES firmware versions do not properly support this packet. Add back some the compatibility checks. v2: switch to fw version check (Shaoyun) Fixes: f81cd79 ("drm/amd/amdgpu: Fix MES init sequence") Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/4295 Cc: Shaoyun Liu <[email protected]> Reviewed-by: shaoyun.liu <[email protected]> Signed-off-by: Alex Deucher <[email protected]> (cherry picked from commit 0180e0a) Cc: [email protected]
1 parent 0043ec2 commit 99579c5

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1630,10 +1630,12 @@ static int mes_v11_0_hw_init(struct amdgpu_ip_block *ip_block)
16301630
if (r)
16311631
goto failure;
16321632

1633-
r = mes_v11_0_set_hw_resources_1(&adev->mes);
1634-
if (r) {
1635-
DRM_ERROR("failed mes_v11_0_set_hw_resources_1, r=%d\n", r);
1636-
goto failure;
1633+
if ((adev->mes.sched_version & AMDGPU_MES_VERSION_MASK) >= 0x50) {
1634+
r = mes_v11_0_set_hw_resources_1(&adev->mes);
1635+
if (r) {
1636+
DRM_ERROR("failed mes_v11_0_set_hw_resources_1, r=%d\n", r);
1637+
goto failure;
1638+
}
16371639
}
16381640

16391641
r = mes_v11_0_query_sched_status(&adev->mes);

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1742,7 +1742,8 @@ static int mes_v12_0_hw_init(struct amdgpu_ip_block *ip_block)
17421742
if (r)
17431743
goto failure;
17441744

1745-
mes_v12_0_set_hw_resources_1(&adev->mes, AMDGPU_MES_SCHED_PIPE);
1745+
if ((adev->mes.sched_version & AMDGPU_MES_VERSION_MASK) >= 0x4b)
1746+
mes_v12_0_set_hw_resources_1(&adev->mes, AMDGPU_MES_SCHED_PIPE);
17461747

17471748
mes_v12_0_init_aggregated_doorbell(&adev->mes);
17481749

0 commit comments

Comments
 (0)