]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
drm/amd/powerplay: expose Vega12 current gpu activity
authorEvan Quan <evan.quan@amd.com>
Thu, 18 Apr 2019 07:37:49 +0000 (15:37 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 24 May 2019 17:20:47 +0000 (12:20 -0500)
Provide the real sensor information for current gpu activity.

Signed-off-by: Evan Quan <evan.quan@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c

index 1997df39b645a5d91d2ad9501771fc48b4ea5e0f..a9d29b4be72fa12294c97089b1db54edf85bcff9 100644 (file)
@@ -1310,23 +1310,14 @@ static int vega12_get_current_activity_percent(
                struct pp_hwmgr *hwmgr,
                uint32_t *activity_percent)
 {
+       SmuMetrics_t metrics_table;
        int ret = 0;
-       uint32_t current_activity = 50;
 
-#if 0
-       ret = smum_send_msg_to_smc_with_parameter(hwmgr, PPSMC_MSG_GetAverageGfxActivity, 0);
-       if (!ret) {
-               current_activity = smum_get_argument(hwmgr);
-               if (current_activity > 100) {
-                       PP_ASSERT(false,
-                                 "[GetCurrentActivityPercent] Activity Percentage Exceeds 100!");
-                       current_activity = 100;
-               }
-       } else
-               PP_ASSERT(false,
-                       "[GetCurrentActivityPercent] Attempt To Send Get Average Graphics Activity to SMU Failed!");
-#endif
-       *activity_percent = current_activity;
+       ret = vega12_get_metrics_table(hwmgr, &metrics_table);
+       if (ret)
+               return ret;
+
+       *activity_percent = metrics_table.AverageGfxActivity;
 
        return ret;
 }