drm/amdgpu: Fix Vega20 Average Power value

Submitted by Russell, Kent on Aug. 22, 2019, 12:54 p.m.

Details

Message ID BN6PR12MB16183CDF13CBEEC00240CC9B85A50@BN6PR12MB1618.namprd12.prod.outlook.com
State New
Headers show
Series "drm/amdgpu: Fix Vega20 Average Power value" ( rev: 3 ) in AMD X.Org drivers

Not browsing as part of any series.

Commit Message

Russell, Kent Aug. 22, 2019, 12:54 p.m.
Good point, I'll double-check that.

Kent

From: Deucher, Alexander <Alexander.Deucher@amd.com>
Sent: Thursday, August 22, 2019 8:54 AM
To: Russell, Kent <Kent.Russell@amd.com>; amd-gfx@lists.freedesktop.org
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:
Acked-by: Alex Deucher <alexander.deucher@amd.com<mailto:alexander.deucher@amd.com>>

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c
index 0516c294b377..1820133f0ceb 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c
@@ -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;
 }
diff --git a/drivers/gpu/drm/amd/powerplay/vega20_ppt.c b/drivers/gpu/drm/amd/powerplay/vega20_ppt.c
index e14363182691..17af12ee9e78 100644
--- a/drivers/gpu/drm/amd/powerplay/vega20_ppt.c
+++ b/drivers/gpu/drm/amd/powerplay/vega20_ppt.c
@@ -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;
 }