All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: Fix check for DPM when returning max clock
@ 2020-02-25 20:19 Kent Russell
  2020-02-25 20:35 ` Alex Deucher
  2020-02-26  4:00 ` Quan, Evan
  0 siblings, 2 replies; 3+ messages in thread
From: Kent Russell @ 2020-02-25 20:19 UTC (permalink / raw)
  To: amd-gfx; +Cc: Kent Russell

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.

Change-Id: I967988e936de5371c22bf92895bda22324d9631b
Signed-off-by: Kent Russell <kent.russell@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
index e1c2c182898f..7e8276651865 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
@@ -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

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/amdgpu: Fix check for DPM when returning max clock
  2020-02-25 20:19 [PATCH] drm/amdgpu: Fix check for DPM when returning max clock Kent Russell
@ 2020-02-25 20:35 ` Alex Deucher
  2020-02-26  4:00 ` Quan, Evan
  1 sibling, 0 replies; 3+ messages in thread
From: Alex Deucher @ 2020-02-25 20:35 UTC (permalink / raw)
  To: Kent Russell; +Cc: amd-gfx list

On Tue, Feb 25, 2020 at 3:20 PM Kent Russell <kent.russell@amd.com> wrote:
>
> 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.
>
> Change-Id: I967988e936de5371c22bf92895bda22324d9631b
> Signed-off-by: Kent Russell <kent.russell@amd.com>

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>

> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
> index e1c2c182898f..7e8276651865 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
> @@ -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
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH] drm/amdgpu: Fix check for DPM when returning max clock
  2020-02-25 20:19 [PATCH] drm/amdgpu: Fix check for DPM when returning max clock Kent Russell
  2020-02-25 20:35 ` Alex Deucher
@ 2020-02-26  4:00 ` Quan, Evan
  1 sibling, 0 replies; 3+ messages in thread
From: Quan, Evan @ 2020-02-26  4:00 UTC (permalink / raw)
  To: Russell, Kent, amd-gfx; +Cc: Russell, Kent

Reviewed-by: Evan Quan <evan.quan@amd.com>

-----Original Message-----
From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Kent Russell
Sent: Wednesday, February 26, 2020 4:20 AM
To: amd-gfx@lists.freedesktop.org
Cc: Russell, Kent <Kent.Russell@amd.com>
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.

Change-Id: I967988e936de5371c22bf92895bda22324d9631b
Signed-off-by: Kent Russell <kent.russell@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
index e1c2c182898f..7e8276651865 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
@@ -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

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=02%7C01%7Cevan.quan%40amd.com%7C663886c987544bc009dd08d7ba3018c1%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637182588127200343&amp;sdata=Eie%2BqVNC1%2FgC7G3Ry7PeFVjPNBrEy89IWrh53Bhy%2Bs8%3D&amp;reserved=0
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-02-26  4:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-25 20:19 [PATCH] drm/amdgpu: Fix check for DPM when returning max clock Kent Russell
2020-02-25 20:35 ` Alex Deucher
2020-02-26  4:00 ` Quan, Evan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.