drm/amdgpu: Fix check for DPM when returning max clock
Subsystems (3)
PATCH 1/1 drm/amdgpu: Fix check for DPM when returning max clock
pp_funcs may not exist, while dpm may be enabled. This change ensures that KFD topology will report the same as pp_dpm_sclk, as the conditions for reporting them will be the same.
Otherwise, we may see the issue where KFD reports "100MHz" in topology as the max speed, while DPM is working correctly.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c +2 -2
@@ -402,7 +402,7 @@ void amdgpu_amdkfd_get_local_mem_info(struct kgd_dev *kgd,if (amdgpu_sriov_vf (adev)) mem_info->mem_clk_max = adev->clock.default_mclk /100 ; -else if (adev->powerplay.pp_funcs) { +else if (adev->pm.dpm_enabled) {if (amdgpu_emu_mode ==1 ) mem_info->mem_clk_max =0 ;else
@@ -427,7 +427,7 @@ uint32_t amdgpu_amdkfd_get_max_engine_clock_in_mhz(struct kgd_dev *kgd)/* the sclk is in quantas of 10kHz */ if (amdgpu_sriov_vf (adev))return adev->clock.default_sclk /100 ; -else if (adev->powerplay.pp_funcs) +else if (adev->pm.dpm_enabled)return amdgpu_dpm_get_sclk (adev, false) /100 ;else return 100 ;
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Quoted 10 lines · Kent Russell
pp_funcsmay not exist, while dpm may be enabled. This change ensures that KFD topology will report the same aspp_dpm_sclk, as the conditions for reporting them will be the same.Otherwise, we may see the issue where KFD reports "100MHz" in topology as the max speed, while DPM is working correctly.
Change-Id I967988e936de5371c22bf92895bda22324d9631bSigned-off-by Kent Russell <[email protected]>
Quoted 29 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c +2
-3@@ -402,7 +402,7 @@ void amdgpu_amdkfd_get_local_mem_info(struct kgd_dev *kgd,if (amdgpu_sriov_vf (adev)) mem_info->mem_clk_max = adev->clock.default_mclk /100 ; -else if (adev->powerplay.pp_funcs) { +else if (adev->pm.dpm_enabled) {if (amdgpu_emu_mode ==1 ) mem_info->mem_clk_max =0 ;else @@ -427,7 +427,7 @@ uint32_t amdgpu_amdkfd_get_max_engine_clock_in_mhz(struct kgd_dev *kgd)/* the sclk is in quantas of 10kHz */ if (amdgpu_sriov_vf (adev))return adev->clock.default_sclk /100 ; -else if (adev->powerplay.pp_funcs) +else if (adev->pm.dpm_enabled)return amdgpu_dpm_get_sclk (adev, false) /100 ;else return 100 ; --2.17.1
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Kent Russell
Sent: Wednesday, February 26, 2020 4:20 AM
To: [email protected]
Cc: Russell, Kent <[email protected]>
Subject: [PATCH] drm/amdgpu: Fix check for DPM when returning max clock
pp_funcs may not exist, while dpm may be enabled. This change ensures that KFD topology will report the same as pp_dpm_sclk, as the conditions for reporting them will be the same.
Otherwise, we may see the issue where KFD reports "100MHz" in topology as the max speed, while DPM is working correctly.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c +2 -2
@@ -402,7 +402,7 @@ void amdgpu_amdkfd_get_local_mem_info(struct kgd_dev *kgd,if (amdgpu_sriov_vf (adev)) mem_info->mem_clk_max = adev->clock.default_mclk /100 ; -else if (adev->powerplay.pp_funcs) { +else if (adev->pm.dpm_enabled) {if (amdgpu_emu_mode ==1 ) mem_info->mem_clk_max =0 ;else
@@ -427,7 +427,7 @@ uint32_t amdgpu_amdkfd_get_max_engine_clock_in_mhz(struct kgd_dev *kgd)/* the sclk is in quantas of 10kHz */ if (amdgpu_sriov_vf (adev))return adev->clock.default_sclk /100 ; -else if (adev->powerplay.pp_funcs) +else if (adev->pm.dpm_enabled)return amdgpu_dpm_get_sclk (adev, false) /100 ;else return 100 ;
Signature · 10 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=02%7C01%7Cevan.quan%40amd.com%7C663886c987544bc009dd08d7ba3018c1%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637182588127200343&sdata=Eie%2BqVNC1%2FgC7G3Ry7PeFVjPNBrEy89IWrh53Bhy%2Bs8%3D&reserved=0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx