Skip to contentSkip to conversation

drm/amdgpu: Fix Vega20 Average Power value

PATCH In review Russell, Kent 2 participants 3 messages Aug 22, 2019 2 messages not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: Fix Vega20 Average Power value

The SMU changed reading from CurrSocketPower to AverageSocketPower, so reflect this accordingly. This fixes the issue where Average Power Consumption was being reported as 0 from SMU 40.46-onward

Change-Id I471f93316820f1401cb497eefe29da68376a4bb9
---
 drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c | 2 +-
 drivers/gpu/drm/amd/powerplay/vega20_ppt.c         | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c +1 -1
index 0516c294b377..1820133f0ceb 100644
@@ -2101,7 +2101,7 @@ static int vega20_get_gpu_power(struct pp_hwmgr *hwmgr,
 	if (ret)
 		return ret;
 
-	*query = metrics_table.CurrSocketPower << 8;
+	*query = metrics_table.AverageSocketPower << 8;
 
 	return ret;
 }
drivers/gpu/drm/amd/powerplay/vega20_ppt.c +1 -1
index e14363182691..17af12ee9e78 100644
@@ -2927,7 +2927,7 @@ static int vega20_get_gpu_power(struct smu_context *smu, uint32_t *value)
 	if (ret)
 		return ret;
 
-	*value = metrics.CurrSocketPower << 8;
+	*value = metrics.AverageSocketPower << 8;
 
 	return 0;
 }
Signature · 6 lines
2.17.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw

Do we need an smu version check? Will AverageSocketPower report correctly on older versions of smu firmware? Assuming that is ok, patch is:

________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Russell, Kent <[email protected]>
Sent: Thursday, August 22, 2019 8:19 AM
To: [email protected] <[email protected]>
Cc: Russell, Kent <[email protected]>
Subject: [PATCH] drm/amdgpu: Fix Vega20 Average Power value

The SMU changed reading from CurrSocketPower to AverageSocketPower, so reflect this accordingly. This fixes the issue where Average Power Consumption was being reported as 0 from SMU 40.46-onward

Change-Id I471f93316820f1401cb497eefe29da68376a4bb9
---
 drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c | 2 +-
 drivers/gpu/drm/amd/powerplay/vega20_ppt.c         | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c +1 -1
index 0516c294b377..1820133f0ceb 100644
@@ -2101,7 +2101,7 @@ static int vega20_get_gpu_power(struct pp_hwmgr *hwmgr,
         if (ret)
                 return ret;
 
-       *query = metrics_table.CurrSocketPower << 8;
+       *query = metrics_table.AverageSocketPower << 8;
 
         return ret;
 }
drivers/gpu/drm/amd/powerplay/vega20_ppt.c +1 -1
index e14363182691..17af12ee9e78 100644
@@ -2927,7 +2927,7 @@ static int vega20_get_gpu_power(struct smu_context *smu, uint32_t *value)
         if (ret)
                 return ret;
 
-       *value = metrics.CurrSocketPower << 8;
+       *value = metrics.AverageSocketPower << 8;
 
         return 0;
 }

--
2.17.1

_______________________________________________
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

A message that is not in the archive (sent off-list or not yet received): BN6PR12MB1809FB98DA053EC712C6375CF7A50-/b2+HYfkarSEx6ez0IUAagdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org

author Acked-by Alex Deucher
#4 lore raw

Good point, I'll double-check that.

Kent

From: Deucher, Alexander <[email protected]>
Sent: Thursday, August 22, 2019 8:54 AM
To: Russell, Kent <[email protected]>; [email protected]
Subject: Re: [PATCH] drm/amdgpu: Fix Vega20 Average Power value

Do we need an smu version check? Will AverageSocketPower report correctly on older versions of smu firmware? Assuming that is ok, patch is:

________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org<mailto:[email protected]>> on behalf of Russell, Kent <[email protected]<mailto:[email protected]>>
Sent: Thursday, August 22, 2019 8:19 AM
To: [email protected]<mailto:[email protected]> <[email protected]<mailto:[email protected]>>
Cc: Russell, Kent <[email protected]<mailto:[email protected]>>
Subject: [PATCH] drm/amdgpu: Fix Vega20 Average Power value

The SMU changed reading from CurrSocketPower to AverageSocketPower, so reflect this accordingly. This fixes the issue where Average Power Consumption was being reported as 0 from SMU 40.46-onward

Change-Id I471f93316820f1401cb497eefe29da68376a4bb9
---
 drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c | 2 +-
 drivers/gpu/drm/amd/powerplay/vega20_ppt.c         | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c +1 -1
index 0516c294b377..1820133f0ceb 100644
@@ -2101,7 +2101,7 @@ static int vega20_get_gpu_power(struct pp_hwmgr *hwmgr,
         if (ret)
                 return ret;
 
-       *query = metrics_table.CurrSocketPower << 8;
+       *query = metrics_table.AverageSocketPower << 8;
 
         return ret;
 }
drivers/gpu/drm/amd/powerplay/vega20_ppt.c +1 -1
index e14363182691..17af12ee9e78 100644
@@ -2927,7 +2927,7 @@ static int vega20_get_gpu_power(struct smu_context *smu, uint32_t *value)
         if (ret)
                 return ret;
 
-       *value = metrics.CurrSocketPower << 8;
+       *value = metrics.AverageSocketPower << 8;
 
         return 0;
 }

--
2.17.1

_______________________________________________
amd-gfx mailing list [email protected]<mailto:[email protected]>
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx