Skip to contentSkip to conversation

drm/amd/powerplay: support Vega10 fan table V3

PATCH In review Evan Quan 2 participants 4 messages Jan 23, 2019 3 messages not in the archive

Subsystems (2)
lore
Share & tools
lore

Evan Quan

author
#0 lore raw

PATCH 1/2 drm/amd/powerplay: support Vega10 fan table V3

MGPU fan boost related parameter is added.

Change-Id Iaa6c570373d81199a07028f275b083f459952254
---
 .../drm/amd/powerplay/hwmgr/vega10_pptable.h  | 24 +++++++++
 .../powerplay/hwmgr/vega10_processpptables.c  | 50 ++++++++++++++++++-
 drivers/gpu/drm/amd/powerplay/inc/hwmgr.h     |  1 +
 3 files changed, 74 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_pptable.h +24 -0
index b3e63003a789..c934e9612c1b 100644
@@ -282,6 +282,30 @@ typedef struct _ATOM_Vega10_Fan_Table_V2 {
 	UCHAR   ucFanMaxRPM;
 } ATOM_Vega10_Fan_Table_V2;
 
+typedef struct _ATOM_Vega10_Fan_Table_V3 {
+	UCHAR   ucRevId;
+	USHORT  usFanOutputSensitivity;
+	USHORT  usFanAcousticLimitRpm;
+	USHORT  usThrottlingRPM;
+	USHORT  usTargetTemperature;
+	USHORT  usMinimumPWMLimit;
+	USHORT  usTargetGfxClk;
+	USHORT  usFanGainEdge;
+	USHORT  usFanGainHotspot;
+	USHORT  usFanGainLiquid;
+	USHORT  usFanGainVrVddc;
+	USHORT  usFanGainVrMvdd;
+	USHORT  usFanGainPlx;
+	USHORT  usFanGainHbm;
+	UCHAR   ucEnableZeroRPM;
+	USHORT  usFanStopTemperature;
+	USHORT  usFanStartTemperature;
+	UCHAR   ucFanParameters;
+	UCHAR   ucFanMinRPM;
+	UCHAR   ucFanMaxRPM;
+	USHORT  usMGpuThrottlingRPM;
+} ATOM_Vega10_Fan_Table_V3;
+
 typedef struct _ATOM_Vega10_Thermal_Controller {
 	UCHAR ucRevId;
 	UCHAR ucType;           /* one of ATOM_VEGA10_PP_THERMALCONTROLLER_*/
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_processpptables.c +49 -1

69 lines not on this page · raw message

drivers/gpu/drm/amd/powerplay/inc/hwmgr.h +1 -0
index b1cd70dcd6e7..bac3d85e3b82 100644
@@ -687,6 +687,7 @@ struct pp_advance_fan_control_parameters {
 	uint32_t  ulTargetGfxClk;
 	uint16_t  usZeroRPMStartTemperature;
 	uint16_t  usZeroRPMStopTemperature;
+	uint16_t  usMGpuThrottlingRPMLimit;
 };
 
 struct pp_thermal_controller_info {
Signature · 6 lines
2.20.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]

author
#2 lore raw

PATCH 2/2 drm/amd/powerplay: enable MGPU fan boost feature on Vega10

For those SKUs which support this feature only.

Change-Id I74de00204d93f951e04073e5c4c4ce9c0d34f662
---
 .../drm/amd/powerplay/hwmgr/vega10_hwmgr.c    |  1 +
 .../drm/amd/powerplay/hwmgr/vega10_thermal.c  | 37 +++++++++++++++++++
 .../drm/amd/powerplay/hwmgr/vega10_thermal.h  |  1 +
 3 files changed, 39 insertions(+)
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c +1 -0
index f0ba4254361b..1a4c6467a36d 100644
@@ -5168,6 +5168,7 @@ static const struct pp_hwmgr_func vega10_hwmgr_funcs = {
 	.set_asic_baco_state = vega10_baco_set_state,
 	.get_ppfeature_status = vega10_get_ppfeature_status,
 	.set_ppfeature_status = vega10_set_ppfeature_status,
+	.enable_mgpu_fan_boost = vega10_enable_mgpu_fan_boost,
 };
 
 int vega10_hwmgr_init(struct pp_hwmgr *hwmgr)
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_thermal.c +37 -0
index 3f807d6c95ce..ba8763daa380 100644
@@ -556,6 +556,43 @@ int vega10_thermal_setup_fan_table(struct pp_hwmgr *hwmgr)
 	return ret;
 }
 
+int vega10_enable_mgpu_fan_boost(struct pp_hwmgr *hwmgr)
+{
+	struct vega10_hwmgr *data = hwmgr->backend;
+	PPTable_t *table = &(data->smc_state_table.pp_table);
+	int ret;
+
+	if (!data->smu_features[GNLD_FAN_CONTROL].supported)
+		return 0;
+
+	if (!hwmgr->thermal_controller.advanceFanControlParameters.
+			usMGpuThrottlingRPMLimit)
+		return 0;
+
+	table->FanThrottlingRpm = hwmgr->thermal_controller.
+			advanceFanControlParameters.usMGpuThrottlingRPMLimit;
+
+	ret = smum_smc_table_manager(hwmgr,
+				(uint8_t *)(&(data->smc_state_table.pp_table)),
+				PPTABLE, false);
+	if (ret) {
+		pr_info("Failed to update fan control table in pptable!");
+		return ret;
+	}
+
+	ret = vega10_disable_fan_control_feature(hwmgr);
+	if (ret) {
+		pr_info("Attempt to disable SMC fan control feature failed!");
+		return ret;
+	}
+
+	ret = vega10_enable_fan_control_feature(hwmgr);
+	if (ret)
+		pr_info("Attempt to enable SMC fan control feature failed!");
+
+	return ret;
+}
+
 /**
 * Start the fan control on the SMC.
 * @param    hwmgr  the address of the powerplay hardware manager.
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_thermal.h +1 -0
index 21e7c4dfa2ca..4a0ede7c1f07 100644
@@ -73,6 +73,7 @@ extern int vega10_thermal_disable_alert(struct pp_hwmgr *hwmgr);
 extern int vega10_fan_ctrl_start_smc_fan_control(struct pp_hwmgr *hwmgr);
 extern int vega10_start_thermal_controller(struct pp_hwmgr *hwmgr,
 				struct PP_TemperatureRange *range);
+extern int vega10_enable_mgpu_fan_boost(struct pp_hwmgr *hwmgr);
 
 
 #endif
Signature · 6 lines
2.20.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]

Reviewed-by
#4 lore raw

Re: [PATCH 2/2] drm/amd/powerplay: enable MGPU fan boost feature on Vega10

Quoted 5 lines · Evan Quan

For those SKUs which support this feature only.

Change-Id I74de00204d93f951e04073e5c4c4ce9c0d34f662

Is there a minimum smu version number required to support this? Is it safe to setup the structures and enable it if the using older smu fw? With that clarified, the series is:

Alex

Quoted 81 lines
---
 .../drm/amd/powerplay/hwmgr/vega10_hwmgr.c    |  1 +
 .../drm/amd/powerplay/hwmgr/vega10_thermal.c  | 37 +++++++++++++++++++
 .../drm/amd/powerplay/hwmgr/vega10_thermal.h  |  1 +
 3 files changed, 39 insertions(+)
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c +1 -0
index f0ba4254361b..1a4c6467a36d 100644
@@ -5168,6 +5168,7 @@ static const struct pp_hwmgr_func vega10_hwmgr_funcs = {
        .set_asic_baco_state = vega10_baco_set_state,
        .get_ppfeature_status = vega10_get_ppfeature_status,
        .set_ppfeature_status = vega10_set_ppfeature_status,
+       .enable_mgpu_fan_boost = vega10_enable_mgpu_fan_boost,
 };
 
 int vega10_hwmgr_init(struct pp_hwmgr *hwmgr)
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_thermal.c +37 -0
index 3f807d6c95ce..ba8763daa380 100644
@@ -556,6 +556,43 @@ int vega10_thermal_setup_fan_table(struct pp_hwmgr *hwmgr)
        return ret;
 }
 
+int vega10_enable_mgpu_fan_boost(struct pp_hwmgr *hwmgr)
+{
+       struct vega10_hwmgr *data = hwmgr->backend;
+       PPTable_t *table = &(data->smc_state_table.pp_table);
+       int ret;
+
+       if (!data->smu_features[GNLD_FAN_CONTROL].supported)
+               return 0;
+
+       if (!hwmgr->thermal_controller.advanceFanControlParameters.
+                       usMGpuThrottlingRPMLimit)
+               return 0;
+
+       table->FanThrottlingRpm = hwmgr->thermal_controller.
+                       advanceFanControlParameters.usMGpuThrottlingRPMLimit;
+
+       ret = smum_smc_table_manager(hwmgr,
+                               (uint8_t *)(&(data->smc_state_table.pp_table)),
+                               PPTABLE, false);
+       if (ret) {
+               pr_info("Failed to update fan control table in pptable!");
+               return ret;
+       }
+
+       ret = vega10_disable_fan_control_feature(hwmgr);
+       if (ret) {
+               pr_info("Attempt to disable SMC fan control feature failed!");
+               return ret;
+       }
+
+       ret = vega10_enable_fan_control_feature(hwmgr);
+       if (ret)
+               pr_info("Attempt to enable SMC fan control feature failed!");
+
+       return ret;
+}
+
 /**
 * Start the fan control on the SMC.
 * @param    hwmgr  the address of the powerplay hardware manager.
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_thermal.h +1 -1
index 21e7c4dfa2ca..4a0ede7c1f07 100644
@@ -73,6 +73,7 @@ extern int vega10_thermal_disable_alert(struct pp_hwmgr *hwmgr);
 extern int vega10_fan_ctrl_start_smc_fan_control(struct pp_hwmgr *hwmgr);
 extern int vega10_start_thermal_controller(struct pp_hwmgr *hwmgr,
                                struct PP_TemperatureRange *range);
+extern int vega10_enable_mgpu_fan_boost(struct pp_hwmgr *hwmgr);
 
 
 #endif
--

2.20.1

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

A message that is not in the archive (sent off-list or not yet received): CADnq5_PBq2pQ=6wjuEMp6wGZT7QfybmHujL1VfWOt-NNjAfUTA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

author
#6 lore raw

RE: [PATCH 2/2] drm/amd/powerplay: enable MGPU fan boost feature on Vega10

This feature is only seen on the latest vbios. No requirement for SMU fw.

Regards,
Evan

Quoted 97 lines

-----Original Message-----
From: Alex Deucher <[email protected]>
Sent: 2019年1月23日 12:54
To: Quan, Evan <[email protected]>
Cc: amd-gfx list <[email protected]>
Subject: Re: [PATCH 2/2] drm/amd/powerplay: enable MGPU fan boost feature on Vega10

Quoted 5 lines · Evan Quan

For those SKUs which support this feature only.

Change-Id I74de00204d93f951e04073e5c4c4ce9c0d34f662

Is there a minimum smu version number required to support this? Is it safe to setup the structures and enable it if the using older smu fw? With that clarified, the series is:

Alex

Quoted 4 lines
---
 .../drm/amd/powerplay/hwmgr/vega10_hwmgr.c    |  1 +
 .../drm/amd/powerplay/hwmgr/vega10_thermal.c  | 37

+++++++++++++++++++ .../drm/amd/powerplay/hwmgr/vega10_thermal. h |

drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c static const struct pp_hwmgr_func

Quoted 9 lines

1 +

 3 files changed, 39 insertions(+)
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c +0 -0
index f0ba4254361b..1a4c6467a36d 100644
@@ -5168,6 +5168,7 @@ static const struct pp_hwmgr_func

vega10_hwmgr_funcs = {

drivers/gpu/drm/amd/powerplay/hwmgr/vega10_thermal.c int vega10_thermal_setup_fan_table(struct

Quoted 13 lines
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c +1 -0
        .set_asic_baco_state = vega10_baco_set_state,
        .get_ppfeature_status = vega10_get_ppfeature_status,
        .set_ppfeature_status = vega10_set_ppfeature_status,
+       .enable_mgpu_fan_boost = vega10_enable_mgpu_fan_boost,
 };
 
 int vega10_hwmgr_init(struct pp_hwmgr *hwmgr) diff --git

a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_thermal.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_thermal.c index 3f807d6c95ce..ba8763daa380 100644

drivers/gpu/drm/amd/powerplay/hwmgr/vega10_thermal.c +0 -0
@@ -556,6 +556,43 @@ int vega10_thermal_setup_fan_table(struct

pp_hwmgr *hwmgr)

Quoted 45 lines
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_thermal.c +38 -0
        return ret;
 }
 
+int vega10_enable_mgpu_fan_boost(struct pp_hwmgr *hwmgr) {
+       struct vega10_hwmgr *data = hwmgr->backend;
+       PPTable_t *table = &(data->smc_state_table.pp_table);
+       int ret;
+
+       if (!data->smu_features[GNLD_FAN_CONTROL].supported)
+               return 0;
+
+       if (!hwmgr->thermal_controller.advanceFanControlParameters.
+                       usMGpuThrottlingRPMLimit)
+               return 0;
+
+       table->FanThrottlingRpm = hwmgr->thermal_controller.
+
+ advanceFanControlParameters.usMGpuThrottlingRPMLimit;
+
+       ret = smum_smc_table_manager(hwmgr,
+                               (uint8_t *)(&(data->smc_state_table.pp_table)),
+                               PPTABLE, false);
+       if (ret) {
+               pr_info("Failed to update fan control table in pptable!");
+               return ret;
+       }
+
+       ret = vega10_disable_fan_control_feature(hwmgr);
+       if (ret) {
+               pr_info("Attempt to disable SMC fan control feature failed!");
+               return ret;
+       }
+
+       ret = vega10_enable_fan_control_feature(hwmgr);
+       if (ret)
+               pr_info("Attempt to enable SMC fan control feature
+ failed!");
+
+       return ret;
+}
+
 /**
 * Start the fan control on the SMC.
 * @param    hwmgr  the address of the powerplay hardware manager.
(quoted diff) +0 -0
Quoted 20 lines
Quoted 7 lines

b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_thermal.h index 21e7c4dfa2ca..4a0ede7c1f07 100644

drivers/gpu/drm/amd/powerplay/hwmgr/vega10_thermal.h +0 -0
@@ -73,6 +73,7 @@ extern int vega10_thermal_disable_alert(struct

pp_hwmgr *hwmgr); extern int vega10_fan_ctrl_start_smc_fan_control(struct pp_hwmgr *hwmgr);

extern int vega10_start_thermal_controller(struct pp_hwmgr *hwmgr,

Quoted 12 lines
                                struct PP_TemperatureRange *range);

+extern int vega10_enable_mgpu_fan_boost(struct pp_hwmgr *hwmgr);

#endif
--
2.20.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