drm/amdgpu/mes: add compatibility checks for set_hw_resource_1
Subsystems (2)
Alex Deucher
maintainerPATCH 1/1 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.
--- drivers/gpu/drm/amd/amdgpu/mes_v11_0.c | 11 +++++++---- drivers/gpu/drm/amd/amdgpu/mes_v12_0.c | 3 ++- 2 files changed, 9 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/amdgpu/mes_v11_0.c +7 -4
@@ -1630,10 +1630,13 @@ static int mes_v11_0_hw_init(struct amdgpu_ip_block *ip_block)if (r) goto failure; - r =mes_v11_0_set_hw_resources_1 (&adev->mes); -if (r) { -DRM_ERROR ("failed mes_v11_0_set_hw_resources_1, r=%d\n" , r); - goto failure; +if (amdgpu_sriov_is_mes_info_enable (adev) || + adev->gfx.enable_cleaner_shader) { + r =mes_v11_0_set_hw_resources_1 (&adev->mes); +if (r) { +DRM_ERROR ("failed mes_v11_0_set_hw_resources_1, r=%d\n" , r); + goto failure; + } } r =mes_v11_0_query_sched_status (&adev->mes);
drivers/gpu/drm/amd/amdgpu/mes_v12_0.c +2 -1
@@ -1736,7 +1736,8 @@ static int mes_v12_0_hw_init(struct amdgpu_ip_block *ip_block)if (r) goto failure; -mes_v12_0_set_hw_resources_1 (&adev->mes,AMDGPU_MES_SCHED_PIPE ); +if (adev->enable_uni_mes) +mes_v12_0_set_hw_resources_1 (&adev->mes,AMDGPU_MES_SCHED_PIPE );mes_v12_0_init_aggregated_doorbell (&adev->mes);
Signature · 1 line
2.49.0
[AMD Official Use Only - AMD Internal Distribution Only]
Maybe it's better to use the MES FW version . Here is what I got from the MES release. For nv3x : 0x50
For nv4x : 0x4b
Regards
Shaoyun.liu
-----Original Message-----
From: Deucher, Alexander <[email protected]>
Sent: Monday, June 9, 2025 11:34 AM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>; Liu, Shaoyun <[email protected]>
Subject: [PATCH] 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.
--- drivers/gpu/drm/amd/amdgpu/mes_v11_0.c | 11 +++++++---- drivers/gpu/drm/amd/amdgpu/mes_v12_0.c | 3 ++- 2 files changed, 9 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/amdgpu/mes_v11_0.c +7 -4
@@ -1630,10 +1630,13 @@ static int mes_v11_0_hw_init(struct amdgpu_ip_block *ip_block)if (r) goto failure; - r =mes_v11_0_set_hw_resources_1 (&adev->mes); -if (r) { -DRM_ERROR ("failed mes_v11_0_set_hw_resources_1, r=%d\n" , r); - goto failure; +if (amdgpu_sriov_is_mes_info_enable (adev) || + adev->gfx.enable_cleaner_shader) { + r =mes_v11_0_set_hw_resources_1 (&adev->mes); +if (r) { +DRM_ERROR ("failed mes_v11_0_set_hw_resources_1, r=%d\n" , r); + goto failure; + } } r =mes_v11_0_query_sched_status (&adev->mes);
drivers/gpu/drm/amd/amdgpu/mes_v12_0.c +2 -1
@@ -1736,7 +1736,8 @@ static int mes_v12_0_hw_init(struct amdgpu_ip_block *ip_block)if (r) goto failure; -mes_v12_0_set_hw_resources_1 (&adev->mes,AMDGPU_MES_SCHED_PIPE ); +if (adev->enable_uni_mes) +mes_v12_0_set_hw_resources_1 (&adev->mes,AMDGPU_MES_SCHED_PIPE );mes_v12_0_init_aggregated_doorbell (&adev->mes);
--
2.49.0