Skip to contentSkip to conversation

drm/amd/powerplay: correct the hwmon interface ppt limit output

PATCH New Evan Quan 1 participant 1 message Sep 20, 2018

Subsystems (2)
lore
Share & tools
lore

Evan Quan

author
#0 lore raw

PATCH 1/1 drm/amd/powerplay: correct the hwmon interface ppt limit output

The ppt limit read out by hwmon interface is always 0. Correct this hwmon interface output.

Change-Id I2c537cacda04034201120b9c1ea82d113d99ced8
---
 drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c  | 8 ++++++++
 drivers/gpu/drm/amd/powerplay/inc/smu11_driver_if.h | 6 ++++++
 2 files changed, 14 insertions(+)
drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c +8 -0
index d45cbfe8e184..ac64ca423b73 100644
@@ -1544,6 +1544,14 @@ static int vega20_enable_dpm_tasks(struct pp_hwmgr *hwmgr)
 			"[EnableDPMTasks] Failed to populate umdpstate clocks!",
 			return result);
 
+	result = smum_send_msg_to_smc_with_parameter(hwmgr, PPSMC_MSG_GetPptLimit,
+			POWER_SOURCE_AC << 16);
+	PP_ASSERT_WITH_CODE(!result,
+			"[GetPptLimit] get default PPT limit failed!",
+			return result);
+	vega20_read_arg_from_smc(hwmgr, &hwmgr->default_power_limit);
+	hwmgr->power_limit = hwmgr->default_power_limit;
+
 	return 0;
 }
 
drivers/gpu/drm/amd/powerplay/inc/smu11_driver_if.h +6 -0
index 71191deb4e76..a002021414ff 100644
@@ -268,6 +268,12 @@ typedef enum {
   PPCLK_COUNT,
 } PPCLK_e;
 
+typedef enum {
+  POWER_SOURCE_AC,
+  POWER_SOURCE_DC,
+  POWER_SOURCE_COUNT,
+} POWER_SOURCE_e;
+
 typedef enum {
   VOLTAGE_MODE_AVFS = 0,
   VOLTAGE_MODE_AVFS_SS,
Signature · 6 lines
2.19.0

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