drm/amd/powerplay: expose Vega12 current power
Subsystems (2)
PATCH 1/2 drm/amd/powerplay: expose Vega12 current power
Provide the real sensor information for current power.
--- .../drm/amd/powerplay/hwmgr/vega12_hwmgr.c | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c +10 -11
@@ -1260,19 +1260,16 @@ static int vega12_get_metrics_table(struct pp_hwmgr *hwmgr, SmuMetrics_t *metricstatic int vega12_get_gpu_power (struct pp_hwmgr *hwmgr,uint32_t *query) { -#if 0 -uint32_t value; +SmuMetrics_t metrics_table; +int ret =0 ; -PP_ASSERT_WITH_CODE (!smum_send_msg_to_smc (hwmgr, - PPSMC_MSG_GetCurrPkgPwr), -"Failed to get current package power!" , - return -EINVAL ); + ret =vega12_get_metrics_table (hwmgr, &metrics_table); +if (ret) +return ret; - value =smum_get_argument (hwmgr); -/* power value is an integer */ - *query = value <<8 ; -#endif -return 0 ; + *query = metrics_table.CurrSocketPower <<8 ; + +return ret; }static int vega12_get_current_gfx_clk_freq (struct pp_hwmgr *hwmgr,uint32_t *gfx_freq)
@@ -1389,6 +1386,8 @@ static int vega12_read_sensor(struct pp_hwmgr *hwmgr, int idx,break ;case AMDGPU_PP_SENSOR_GPU_POWER : ret =vega12_get_gpu_power (hwmgr, (uint32_t *)value); +if (!ret) + *size =4 ;break ;case AMDGPU_PP_SENSOR_ENABLED_SMC_FEATURES_MASK : ret =vega12_get_enabled_smc_features (hwmgr, (uint64_t *)value);
Signature · 6 lines
2.21.0 _______________________________________________ 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]
PATCH 2/2 drm/amd/powerplay: expose Vega12 current gpu activity
Provide the real sensor information for current gpu activity.
--- .../drm/amd/powerplay/hwmgr/vega12_hwmgr.c | 21 ++++++------------- 1 file changed, 6 insertions(+), 15 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c +6 -15
@@ -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; }
Signature · 6 lines
2.21.0 _______________________________________________ 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]
Alex Deucher
Reviewed-byRe: [PATCH 2/2] drm/amd/powerplay: expose Vega12 current gpu activity
Quoted 5 lines · Evan Quan
Provide the real sensor information for current gpu activity.
Change-Id I8449672a6fdabb4287e12e36a4f95e08e2d65e47Signed-off-by Evan Quan <[email protected]>
Series is:
Quoted 41 lines
--- .../drm/amd/powerplay/hwmgr/vega12_hwmgr.c | 21 ++++++------------- 1 file changed, 6 insertions(+), 15 deletions(-)drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c +6
-16@@ -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; } --2.21.0
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