Skip to contentSkip to conversation

drm/amd/powerplay: retrieve correct minimum RPM speed by MinPWM

PATCH In review Evan Quan 2 participants 9 messages Oct 24, 2018 7 messages not in the archive

Subsystems (2)
lore
Share & tools
lore

Evan Quan

author
#0 lore raw

PATCH 1/3 drm/amd/powerplay: retrieve correct minimum RPM speed by MinPWM

Retrieve the correct minimum RPM speed for Vega20. And MinPWM is needed to recalculate the MinRPM on maximum RPM speed change.

Change-Id I552bd8ada74b0336257ea1a10c004b5211acc36f
---
 drivers/gpu/drm/amd/powerplay/hwmgr/vega20_processpptables.c | 4 +++-
 drivers/gpu/drm/amd/powerplay/inc/hwmgr.h                    | 1 +
 2 files changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/powerplay/hwmgr/vega20_processpptables.c +3 -1
index f7e8bbdc20b0..7170fb36b67a 100644
@@ -805,7 +805,9 @@ static int init_powerplay_table_information(
 
 	hwmgr->thermal_controller.ucType = powerplay_table->ucThermalControllerType;
 	pptable_information->uc_thermal_controller_type = powerplay_table->ucThermalControllerType;
-	hwmgr->thermal_controller.fanInfo.ulMinRPM = 0;
+	hwmgr->thermal_controller.fanInfo.ulMinPWM = powerplay_table->smcPPTable.FanPwmMin;
+	hwmgr->thermal_controller.fanInfo.ulMinRPM = (powerplay_table->smcPPTable.FanPwmMin *
+		powerplay_table->smcPPTable.FanMaximumRpm) / 255;
 	hwmgr->thermal_controller.fanInfo.ulMaxRPM = powerplay_table->smcPPTable.FanMaximumRpm;
 
 	set_hw_cap(hwmgr,
drivers/gpu/drm/amd/powerplay/inc/hwmgr.h +1 -0
index e5a60aa44b5d..687f73fe4cf5 100644
@@ -628,6 +628,7 @@ struct pp_fan_info {
 	uint8_t   ucTachometerPulsesPerRevolution;
 	uint32_t   ulMinRPM;
 	uint32_t   ulMaxRPM;
+	uint32_t   ulMinPWM;
 };
 
 struct pp_advance_fan_control_parameters {
Signature · 6 lines
2.19.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
author
#2 lore raw

PATCH 2/3 drm/amd/powerplay: added hwmon interfaces for setting max/min fan speed

In reply to a message not in the archive

New hwmon interfaces for maximum and minimum fan speed setting.

Change-Id Ic9ec9f2427c6d3425e1c7e7b765d7d01a92f9a26
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.h       |  6 ++
 drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c        | 56 ++++++++++++++++++-
 .../gpu/drm/amd/include/kgd_pp_interface.h    |  2 +
 drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 46 +++++++++++++++
 drivers/gpu/drm/amd/powerplay/inc/hwmgr.h     |  2 +
 5 files changed, 110 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.h +6 -0
index f972cd156795..12c4e461a7bc 100644
@@ -364,6 +364,12 @@ enum amdgpu_pcie_gen {
 		((adev)->powerplay.pp_funcs->enable_mgpu_fan_boost(\
 			(adev)->powerplay.pp_handle))
 
+#define amdgpu_dpm_set_fan_speed_max_rpm(adev, s) \
+		((adev)->powerplay.pp_funcs->set_fan_speed_max_rpm)((adev)->powerplay.pp_handle, (s))
+
+#define amdgpu_dpm_set_fan_speed_min_rpm(adev, s) \
+		((adev)->powerplay.pp_funcs->set_fan_speed_min_rpm)((adev)->powerplay.pp_handle, (s))
+
 struct amdgpu_dpm {
 	struct amdgpu_ps        *ps;
 	/* number of valid power states */
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +54 -2

74 lines not on this page · raw message

drivers/gpu/drm/amd/include/kgd_pp_interface.h +2 -0
index 980e696989b1..1af55997bdb9 100644
@@ -276,6 +276,8 @@ struct amd_pm_funcs {
 		struct amd_pp_simple_clock_info *clocks);
 	int (*notify_smu_enable_pwe)(void *handle);
 	int (*enable_mgpu_fan_boost)(void *handle);
+	int (*set_fan_speed_max_rpm)(void *handle, uint32_t rpm);
+	int (*set_fan_speed_min_rpm)(void *handle, uint32_t rpm);
 };
 
 #endif
drivers/gpu/drm/amd/powerplay/amd_powerplay.c +46 -0

58 lines not on this page · raw message

drivers/gpu/drm/amd/powerplay/inc/hwmgr.h +2 -0
index 687f73fe4cf5..0242bc039a48 100644
@@ -269,6 +269,8 @@ struct pp_hwmgr_func {
 	int (*get_fan_speed_percent)(struct pp_hwmgr *hwmgr, uint32_t *speed);
 	int (*set_fan_speed_rpm)(struct pp_hwmgr *hwmgr, uint32_t percent);
 	int (*get_fan_speed_rpm)(struct pp_hwmgr *hwmgr, uint32_t *speed);
+	int (*set_fan_speed_max_rpm)(struct pp_hwmgr *hwmgr, uint32_t max_rpm);
+	int (*set_fan_speed_min_rpm)(struct pp_hwmgr *hwmgr, uint32_t min_rpm);
 	int (*reset_fan_speed_to_default)(struct pp_hwmgr *hwmgr);
 	int (*uninitialize_thermal_controller)(struct pp_hwmgr *hwmgr);
 	int (*register_irq_handlers)(struct pp_hwmgr *hwmgr);
Signature · 6 lines
2.19.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
author
#11 lore raw

PATCH 3/3 drm/amd/powerplay: support hwmon max/min fan speed setting on Vega20

In reply to a message not in the archive

Added support for hwmon max/min fan speed setting on Vega20.

Change-Id Ieab42c744d6c54f8b85a71be80f7c6832ae7352b
---
 .../drm/amd/powerplay/hwmgr/vega20_hwmgr.c    |  4 ++
 .../drm/amd/powerplay/hwmgr/vega20_thermal.c  | 56 ++++++++++++++++++-
 .../drm/amd/powerplay/hwmgr/vega20_thermal.h  |  4 ++
 3 files changed, 62 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c +4 -0
index 57143d51e3ee..2513e6be3219 100644
@@ -3539,6 +3539,10 @@ static const struct pp_hwmgr_func vega20_hwmgr_funcs = {
 		vega20_get_fan_control_mode,
 	.set_fan_control_mode =
 		vega20_set_fan_control_mode,
+	.set_fan_speed_max_rpm =
+		vega20_fan_ctrl_set_fan_speed_max_rpm,
+	.set_fan_speed_min_rpm =
+		vega20_fan_ctrl_set_fan_speed_min_rpm,
 	/* smu memory related */
 	.notify_cac_buffer_info =
 		vega20_notify_cac_buffer_info,
drivers/gpu/drm/amd/powerplay/hwmgr/vega20_thermal.c +54 -2

74 lines not on this page · raw message

drivers/gpu/drm/amd/powerplay/hwmgr/vega20_thermal.h +4 -0
index 2d1769bbd24e..ddfc950e90ca 100644
@@ -56,6 +56,10 @@ extern int vega20_fan_ctrl_get_fan_speed_rpm(struct pp_hwmgr *hwmgr,
 		uint32_t *speed);
 extern int vega20_fan_ctrl_set_fan_speed_rpm(struct pp_hwmgr *hwmgr,
 		uint32_t speed);
+extern int vega20_fan_ctrl_set_fan_speed_max_rpm(struct pp_hwmgr *hwmgr,
+		uint32_t speed);
+extern int vega20_fan_ctrl_set_fan_speed_min_rpm(struct pp_hwmgr *hwmgr,
+		uint32_t speed);
 extern int vega20_fan_ctrl_get_fan_speed_percent(struct pp_hwmgr *hwmgr,
 		uint32_t *speed);
 extern int vega20_fan_ctrl_set_fan_speed_percent(struct pp_hwmgr *hwmgr,
Signature · 6 lines
2.19.1

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

Re: [PATCH 2/3] drm/amd/powerplay: added hwmon interfaces for setting max/min fan speed

In reply to a message not in the archive

One question: how to exit the max/min fan speed and return to auto mode?

Best Regards

Rex

________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Evan Quan <[email protected]>
Sent: Wednesday, October 24, 2018 4:11 PM
To: [email protected]
Cc: Quan, Evan
Subject: [PATCH 2/3] drm/amd/powerplay: added hwmon interfaces for setting max/min fan speed

New hwmon interfaces for maximum and minimum fan speed setting.

Change-Id Ic9ec9f2427c6d3425e1c7e7b765d7d01a92f9a26
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.h       |  6 ++
 drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c        | 56 ++++++++++++++++++-
 .../gpu/drm/amd/include/kgd_pp_interface.h    |  2 +
 drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 46 +++++++++++++++
 drivers/gpu/drm/amd/powerplay/inc/hwmgr.h     |  2 +
 5 files changed, 110 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.h +6 -0
index f972cd156795..12c4e461a7bc 100644
@@ -364,6 +364,12 @@ enum amdgpu_pcie_gen {
                 ((adev)->powerplay.pp_funcs->enable_mgpu_fan_boost(\
                         (adev)->powerplay.pp_handle))
 
+#define amdgpu_dpm_set_fan_speed_max_rpm(adev, s) \
+               ((adev)->powerplay.pp_funcs->set_fan_speed_max_rpm)((adev)->powerplay.pp_handle, (s))
+
+#define amdgpu_dpm_set_fan_speed_min_rpm(adev, s) \
+               ((adev)->powerplay.pp_funcs->set_fan_speed_min_rpm)((adev)->powerplay.pp_handle, (s))
+
 struct amdgpu_dpm {
         struct amdgpu_ps        *ps;
         /* number of valid power states */
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +54 -2

74 lines not on this page · raw message

drivers/gpu/drm/amd/include/kgd_pp_interface.h +2 -0
index 980e696989b1..1af55997bdb9 100644
@@ -276,6 +276,8 @@ struct amd_pm_funcs {
                 struct amd_pp_simple_clock_info *clocks);
         int (*notify_smu_enable_pwe)(void *handle);
         int (*enable_mgpu_fan_boost)(void *handle);
+       int (*set_fan_speed_max_rpm)(void *handle, uint32_t rpm);
+       int (*set_fan_speed_min_rpm)(void *handle, uint32_t rpm);
 };
 
 #endif
drivers/gpu/drm/amd/powerplay/amd_powerplay.c +46 -0

58 lines not on this page · raw message

drivers/gpu/drm/amd/powerplay/inc/hwmgr.h +2 -0
index 687f73fe4cf5..0242bc039a48 100644
@@ -269,6 +269,8 @@ struct pp_hwmgr_func {
         int (*get_fan_speed_percent)(struct pp_hwmgr *hwmgr, uint32_t *speed);
         int (*set_fan_speed_rpm)(struct pp_hwmgr *hwmgr, uint32_t percent);
         int (*get_fan_speed_rpm)(struct pp_hwmgr *hwmgr, uint32_t *speed);
+       int (*set_fan_speed_max_rpm)(struct pp_hwmgr *hwmgr, uint32_t max_rpm);
+       int (*set_fan_speed_min_rpm)(struct pp_hwmgr *hwmgr, uint32_t min_rpm);
         int (*reset_fan_speed_to_default)(struct pp_hwmgr *hwmgr);
         int (*uninitialize_thermal_controller)(struct pp_hwmgr *hwmgr);
         int (*register_irq_handlers)(struct pp_hwmgr *hwmgr);

--
2.19.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
amd-gfx Info Page - freedesktop.org<https://lists.freedesktop.org/mailman/listinfo/amd-gfx>
lists.freedesktop.org
To see the collection of prior postings to the list, visit the amd-gfx Archives.. Using amd-gfx: To post a message to all the list members, send email to [email protected] You can subscribe to the list, or change your existing subscription, in the sections below.

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

#13 lore raw

Re: [PATCH 3/3] drm/amd/powerplay: support hwmon max/min fan speed setting on Vega20

In reply to a message not in the archive

- percent = current_rpm * 100 / pp_table->FanMaximumRpm;
+ percent = (current_rpm * 100) /
+ hwmgr->thermal_controller.fanInfo.ulMaxRPM;

Better check hwmgr->thermal_controller.fanInfo.ulMaxRPM not equal to 0.

Best Regards

Rex

________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Evan Quan <[email protected]>
Sent: Wednesday, October 24, 2018 4:11 PM
To: [email protected]
Cc: Quan, Evan
Subject: [PATCH 3/3] drm/amd/powerplay: support hwmon max/min fan speed setting on Vega20

Added support for hwmon max/min fan speed setting on Vega20.

Change-Id Ieab42c744d6c54f8b85a71be80f7c6832ae7352b
---
 .../drm/amd/powerplay/hwmgr/vega20_hwmgr.c    |  4 ++
 .../drm/amd/powerplay/hwmgr/vega20_thermal.c  | 56 ++++++++++++++++++-
 .../drm/amd/powerplay/hwmgr/vega20_thermal.h  |  4 ++
 3 files changed, 62 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c +4 -0
index 57143d51e3ee..2513e6be3219 100644
@@ -3539,6 +3539,10 @@ static const struct pp_hwmgr_func vega20_hwmgr_funcs = {
                 vega20_get_fan_control_mode,
         .set_fan_control_mode =
                 vega20_set_fan_control_mode,
+       .set_fan_speed_max_rpm =
+               vega20_fan_ctrl_set_fan_speed_max_rpm,
+       .set_fan_speed_min_rpm =
+               vega20_fan_ctrl_set_fan_speed_min_rpm,
         /* smu memory related */
         .notify_cac_buffer_info =
                 vega20_notify_cac_buffer_info,
drivers/gpu/drm/amd/powerplay/hwmgr/vega20_thermal.c +54 -2

74 lines not on this page · raw message

drivers/gpu/drm/amd/powerplay/hwmgr/vega20_thermal.h +4 -0
index 2d1769bbd24e..ddfc950e90ca 100644
@@ -56,6 +56,10 @@ extern int vega20_fan_ctrl_get_fan_speed_rpm(struct pp_hwmgr *hwmgr,
                 uint32_t *speed);
 extern int vega20_fan_ctrl_set_fan_speed_rpm(struct pp_hwmgr *hwmgr,
                 uint32_t speed);
+extern int vega20_fan_ctrl_set_fan_speed_max_rpm(struct pp_hwmgr *hwmgr,
+               uint32_t speed);
+extern int vega20_fan_ctrl_set_fan_speed_min_rpm(struct pp_hwmgr *hwmgr,
+               uint32_t speed);
 extern int vega20_fan_ctrl_get_fan_speed_percent(struct pp_hwmgr *hwmgr,
                 uint32_t *speed);
 extern int vega20_fan_ctrl_set_fan_speed_percent(struct pp_hwmgr *hwmgr,

--
2.19.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
amd-gfx Info Page - freedesktop.org<https://lists.freedesktop.org/mailman/listinfo/amd-gfx>
lists.freedesktop.org
To see the collection of prior postings to the list, visit the amd-gfx Archives.. Using amd-gfx: To post a message to all the list members, send email to [email protected] You can subscribe to the list, or change your existing subscription, in the sections below.

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

author
#6 lore raw

RE: [PATCH 2/3] drm/amd/powerplay: added hwmon interfaces for setting max/min fan speed

In reply to a message not in the archive

This can be performed under auto mode.
The settings are always effective unless user resets them back.

Regards,
Evan
From: Zhu, Rex
Sent: 2018年10月24日 16:36
To: Quan, Evan <[email protected]>; [email protected]
Subject: Re: [PATCH 2/3] drm/amd/powerplay: added hwmon interfaces for setting max/min fan speed

One question: how to exit the max/min fan speed and return to auto mode?

Best Regards

Rex

________________________________
From: amd-gfx <[email protected]<mailto:[email protected]>> on behalf of Evan Quan <[email protected]<mailto:[email protected]>>
Sent: Wednesday, October 24, 2018 4:11 PM
To: [email protected]<mailto:[email protected]>
Cc: Quan, Evan
Subject: [PATCH 2/3] drm/amd/powerplay: added hwmon interfaces for setting max/min fan speed

New hwmon interfaces for maximum and minimum fan speed setting.

Change-Id Ic9ec9f2427c6d3425e1c7e7b765d7d01a92f9a26
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.h       |  6 ++
 drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c        | 56 ++++++++++++++++++-
 .../gpu/drm/amd/include/kgd_pp_interface.h    |  2 +
 drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 46 +++++++++++++++
 drivers/gpu/drm/amd/powerplay/inc/hwmgr.h     |  2 +
 5 files changed, 110 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.h +6 -0
index f972cd156795..12c4e461a7bc 100644
@@ -364,6 +364,12 @@ enum amdgpu_pcie_gen {
                 ((adev)->powerplay.pp_funcs->enable_mgpu_fan_boost(\
                         (adev)->powerplay.pp_handle))
 
+#define amdgpu_dpm_set_fan_speed_max_rpm(adev, s) \
+               ((adev)->powerplay.pp_funcs->set_fan_speed_max_rpm)((adev)->powerplay.pp_handle, (s))
+
+#define amdgpu_dpm_set_fan_speed_min_rpm(adev, s) \
+               ((adev)->powerplay.pp_funcs->set_fan_speed_min_rpm)((adev)->powerplay.pp_handle, (s))
+
 struct amdgpu_dpm {
         struct amdgpu_ps        *ps;
         /* number of valid power states */
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +54 -2

74 lines not on this page · raw message

drivers/gpu/drm/amd/include/kgd_pp_interface.h +2 -0
index 980e696989b1..1af55997bdb9 100644
@@ -276,6 +276,8 @@ struct amd_pm_funcs {
                 struct amd_pp_simple_clock_info *clocks);
         int (*notify_smu_enable_pwe)(void *handle);
         int (*enable_mgpu_fan_boost)(void *handle);
+       int (*set_fan_speed_max_rpm)(void *handle, uint32_t rpm);
+       int (*set_fan_speed_min_rpm)(void *handle, uint32_t rpm);
 };
 
 #endif
drivers/gpu/drm/amd/powerplay/amd_powerplay.c +46 -0

58 lines not on this page · raw message

drivers/gpu/drm/amd/powerplay/inc/hwmgr.h +2 -0
index 687f73fe4cf5..0242bc039a48 100644
@@ -269,6 +269,8 @@ struct pp_hwmgr_func {
         int (*get_fan_speed_percent)(struct pp_hwmgr *hwmgr, uint32_t *speed);
         int (*set_fan_speed_rpm)(struct pp_hwmgr *hwmgr, uint32_t percent);
         int (*get_fan_speed_rpm)(struct pp_hwmgr *hwmgr, uint32_t *speed);
+       int (*set_fan_speed_max_rpm)(struct pp_hwmgr *hwmgr, uint32_t max_rpm);
+       int (*set_fan_speed_min_rpm)(struct pp_hwmgr *hwmgr, uint32_t min_rpm);
         int (*reset_fan_speed_to_default)(struct pp_hwmgr *hwmgr);
         int (*uninitialize_thermal_controller)(struct pp_hwmgr *hwmgr);
         int (*register_irq_handlers)(struct pp_hwmgr *hwmgr);

--
2.19.1

_______________________________________________
amd-gfx mailing list
[email protected]<mailto:[email protected]>
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
amd-gfx Info Page - freedesktop.org<https://lists.freedesktop.org/mailman/listinfo/amd-gfx>
lists.freedesktop.org
To see the collection of prior postings to the list, visit the amd-gfx Archives.. Using amd-gfx: To post a message to all the list members, send email to [email protected]<mailto:[email protected]>. You can subscribe to the list, or change your existing subscription, in the sections below.

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

author
#15 lore raw

RE: [PATCH 3/3] drm/amd/powerplay: support hwmon max/min fan speed setting on Vega20

In reply to a message not in the archive

Sure

From: Zhu, Rex
Sent: 2018年10月24日 16:37
To: Quan, Evan <[email protected]>; [email protected]
Subject: Re: [PATCH 3/3] drm/amd/powerplay: support hwmon max/min fan speed setting on Vega20

- percent = current_rpm * 100 / pp_table->FanMaximumRpm;
+ percent = (current_rpm * 100) /
+ hwmgr->thermal_controller.fanInfo.ulMaxRPM;

Better check hwmgr->thermal_controller.fanInfo.ulMaxRPM not equal to 0.

Best Regards

Rex

________________________________
From: amd-gfx <[email protected]<mailto:[email protected]>> on behalf of Evan Quan <[email protected]<mailto:[email protected]>>
Sent: Wednesday, October 24, 2018 4:11 PM
To: [email protected]<mailto:[email protected]>
Cc: Quan, Evan
Subject: [PATCH 3/3] drm/amd/powerplay: support hwmon max/min fan speed setting on Vega20

Added support for hwmon max/min fan speed setting on Vega20.

Change-Id Ieab42c744d6c54f8b85a71be80f7c6832ae7352b
---
 .../drm/amd/powerplay/hwmgr/vega20_hwmgr.c    |  4 ++
 .../drm/amd/powerplay/hwmgr/vega20_thermal.c  | 56 ++++++++++++++++++-
 .../drm/amd/powerplay/hwmgr/vega20_thermal.h  |  4 ++
 3 files changed, 62 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c +4 -0
index 57143d51e3ee..2513e6be3219 100644
@@ -3539,6 +3539,10 @@ static const struct pp_hwmgr_func vega20_hwmgr_funcs = {
                 vega20_get_fan_control_mode,
         .set_fan_control_mode =
                 vega20_set_fan_control_mode,
+       .set_fan_speed_max_rpm =
+               vega20_fan_ctrl_set_fan_speed_max_rpm,
+       .set_fan_speed_min_rpm =
+               vega20_fan_ctrl_set_fan_speed_min_rpm,
         /* smu memory related */
         .notify_cac_buffer_info =
                 vega20_notify_cac_buffer_info,
drivers/gpu/drm/amd/powerplay/hwmgr/vega20_thermal.c +54 -2

74 lines not on this page · raw message

drivers/gpu/drm/amd/powerplay/hwmgr/vega20_thermal.h +4 -0
index 2d1769bbd24e..ddfc950e90ca 100644
@@ -56,6 +56,10 @@ extern int vega20_fan_ctrl_get_fan_speed_rpm(struct pp_hwmgr *hwmgr,
                 uint32_t *speed);
 extern int vega20_fan_ctrl_set_fan_speed_rpm(struct pp_hwmgr *hwmgr,
                 uint32_t speed);
+extern int vega20_fan_ctrl_set_fan_speed_max_rpm(struct pp_hwmgr *hwmgr,
+               uint32_t speed);
+extern int vega20_fan_ctrl_set_fan_speed_min_rpm(struct pp_hwmgr *hwmgr,
+               uint32_t speed);
 extern int vega20_fan_ctrl_get_fan_speed_percent(struct pp_hwmgr *hwmgr,
                 uint32_t *speed);
 extern int vega20_fan_ctrl_set_fan_speed_percent(struct pp_hwmgr *hwmgr,

--
2.19.1

_______________________________________________
amd-gfx mailing list
[email protected]<mailto:[email protected]>
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
amd-gfx Info Page - freedesktop.org<https://lists.freedesktop.org/mailman/listinfo/amd-gfx>
lists.freedesktop.org
To see the collection of prior postings to the list, visit the amd-gfx Archives.. Using amd-gfx: To post a message to all the list members, send email to [email protected]<mailto:[email protected]>. You can subscribe to the list, or change your existing subscription, in the sections below.

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

#8 lore raw

Re: [PATCH 2/3] drm/amd/powerplay: added hwmon interfaces for setting max/min fan speed

In reply to a message not in the archive

I think when user set max/min fan speed, the fan control mode will switch to

manual mode.

so if user need to exit the max/min fan speed, user need to reset to auto mode.

Do we need to let user enter manual mode first before set max/min fan speed?

Best Regards

Rex

________________________________
From: Quan, Evan
Sent: Wednesday, October 24, 2018 4:47 PM
To: Zhu, Rex; [email protected]
Subject: RE: [PATCH 2/3] drm/amd/powerplay: added hwmon interfaces for setting max/min fan speed

This can be performed under auto mode.

The settings are always effective unless user resets them back.

Regards,

Evan

From: Zhu, Rex
Sent: 2018年10月24日 16:36
To: Quan, Evan <[email protected]>; [email protected]
Subject: Re: [PATCH 2/3] drm/amd/powerplay: added hwmon interfaces for setting max/min fan speed

One question: how to exit the max/min fan speed and return to auto mode?

Best Regards

Rex

________________________________

From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org<mailto:[email protected]>> on behalf of Evan Quan <[email protected]<mailto:[email protected]>>
Sent: Wednesday, October 24, 2018 4:11 PM
To: [email protected]<mailto:[email protected]>
Cc: Quan, Evan
Subject: [PATCH 2/3] drm/amd/powerplay: added hwmon interfaces for setting max/min fan speed

New hwmon interfaces for maximum and minimum fan speed setting.

Change-Id Ic9ec9f2427c6d3425e1c7e7b765d7d01a92f9a26
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.h       |  6 ++
 drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c        | 56 ++++++++++++++++++-
 .../gpu/drm/amd/include/kgd_pp_interface.h    |  2 +
 drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 46 +++++++++++++++
 drivers/gpu/drm/amd/powerplay/inc/hwmgr.h     |  2 +
 5 files changed, 110 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.h +6 -0
index f972cd156795..12c4e461a7bc 100644
@@ -364,6 +364,12 @@ enum amdgpu_pcie_gen {
                 ((adev)->powerplay.pp_funcs->enable_mgpu_fan_boost(\
                         (adev)->powerplay.pp_handle))
 
+#define amdgpu_dpm_set_fan_speed_max_rpm(adev, s) \
+               ((adev)->powerplay.pp_funcs->set_fan_speed_max_rpm)((adev)->powerplay.pp_handle, (s))
+
+#define amdgpu_dpm_set_fan_speed_min_rpm(adev, s) \
+               ((adev)->powerplay.pp_funcs->set_fan_speed_min_rpm)((adev)->powerplay.pp_handle, (s))
+
 struct amdgpu_dpm {
         struct amdgpu_ps        *ps;
         /* number of valid power states */
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +54 -2

74 lines not on this page · raw message

drivers/gpu/drm/amd/include/kgd_pp_interface.h +2 -0
index 980e696989b1..1af55997bdb9 100644
@@ -276,6 +276,8 @@ struct amd_pm_funcs {
                 struct amd_pp_simple_clock_info *clocks);
         int (*notify_smu_enable_pwe)(void *handle);
         int (*enable_mgpu_fan_boost)(void *handle);
+       int (*set_fan_speed_max_rpm)(void *handle, uint32_t rpm);
+       int (*set_fan_speed_min_rpm)(void *handle, uint32_t rpm);
 };
 
 #endif
drivers/gpu/drm/amd/powerplay/amd_powerplay.c +46 -0

58 lines not on this page · raw message

drivers/gpu/drm/amd/powerplay/inc/hwmgr.h +2 -0
index 687f73fe4cf5..0242bc039a48 100644
@@ -269,6 +269,8 @@ struct pp_hwmgr_func {
         int (*get_fan_speed_percent)(struct pp_hwmgr *hwmgr, uint32_t *speed);
         int (*set_fan_speed_rpm)(struct pp_hwmgr *hwmgr, uint32_t percent);
         int (*get_fan_speed_rpm)(struct pp_hwmgr *hwmgr, uint32_t *speed);
+       int (*set_fan_speed_max_rpm)(struct pp_hwmgr *hwmgr, uint32_t max_rpm);
+       int (*set_fan_speed_min_rpm)(struct pp_hwmgr *hwmgr, uint32_t min_rpm);
         int (*reset_fan_speed_to_default)(struct pp_hwmgr *hwmgr);
         int (*uninitialize_thermal_controller)(struct pp_hwmgr *hwmgr);
         int (*register_irq_handlers)(struct pp_hwmgr *hwmgr);

--
2.19.1

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

amd-gfx Info Page - freedesktop.org<https://lists.freedesktop.org/mailman/listinfo/amd-gfx>

lists.freedesktop.org

To see the collection of prior postings to the list, visit the amd-gfx Archives.. Using amd-gfx: To post a message to all the list members, send email to [email protected]<mailto:[email protected]>. You can subscribe to the list, or change your existing subscription, in the sections below.

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

author
#10 lore raw

RE: [PATCH 2/3] drm/amd/powerplay: added hwmon interfaces for setting max/min fan speed

In reply to a message not in the archive

Not necessary per my understanding.
As the max/min fan speeds are kind of global settings regardless of the fan control mode. Also the SMU fw should be able to apply the settings at runtime(at least for Vega20, that’s the case). So, no need to switch to manual mode first.

Regards,
Evan
From: Zhu, Rex
Sent: 2018年10月24日 17:04
To: Quan, Evan <[email protected]>; [email protected]
Subject: Re: [PATCH 2/3] drm/amd/powerplay: added hwmon interfaces for setting max/min fan speed

I think when user set max/min fan speed, the fan control mode will switch to

manual mode.

so if user need to exit the max/min fan speed, user need to reset to auto mode.

Do we need to let user enter manual mode first before set max/min fan speed?

Best Regards

Rex

________________________________
From: Quan, Evan
Sent: Wednesday, October 24, 2018 4:47 PM
To: Zhu, Rex; [email protected]<mailto:[email protected]>
Subject: RE: [PATCH 2/3] drm/amd/powerplay: added hwmon interfaces for setting max/min fan speed

This can be performed under auto mode.

The settings are always effective unless user resets them back.

Regards,

Evan

From: Zhu, Rex
Sent: 2018年10月24日 16:36
To: Quan, Evan <[email protected]<mailto:[email protected]>>; [email protected]<mailto:[email protected]>
Subject: Re: [PATCH 2/3] drm/amd/powerplay: added hwmon interfaces for setting max/min fan speed

One question: how to exit the max/min fan speed and return to auto mode?

Best Regards

Rex

________________________________

From: amd-gfx <[email protected]<mailto:[email protected]>> on behalf of Evan Quan <[email protected]<mailto:[email protected]>>
Sent: Wednesday, October 24, 2018 4:11 PM
To: [email protected]<mailto:[email protected]>
Cc: Quan, Evan
Subject: [PATCH 2/3] drm/amd/powerplay: added hwmon interfaces for setting max/min fan speed

New hwmon interfaces for maximum and minimum fan speed setting.

Change-Id Ic9ec9f2427c6d3425e1c7e7b765d7d01a92f9a26
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.h       |  6 ++
 drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c        | 56 ++++++++++++++++++-
 .../gpu/drm/amd/include/kgd_pp_interface.h    |  2 +
 drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 46 +++++++++++++++
 drivers/gpu/drm/amd/powerplay/inc/hwmgr.h     |  2 +
 5 files changed, 110 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.h +6 -0
index f972cd156795..12c4e461a7bc 100644
@@ -364,6 +364,12 @@ enum amdgpu_pcie_gen {
                 ((adev)->powerplay.pp_funcs->enable_mgpu_fan_boost(\
                         (adev)->powerplay.pp_handle))
 
+#define amdgpu_dpm_set_fan_speed_max_rpm(adev, s) \
+               ((adev)->powerplay.pp_funcs->set_fan_speed_max_rpm)((adev)->powerplay.pp_handle, (s))
+
+#define amdgpu_dpm_set_fan_speed_min_rpm(adev, s) \
+               ((adev)->powerplay.pp_funcs->set_fan_speed_min_rpm)((adev)->powerplay.pp_handle, (s))
+
 struct amdgpu_dpm {
         struct amdgpu_ps        *ps;
         /* number of valid power states */
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +54 -2

74 lines not on this page · raw message

drivers/gpu/drm/amd/include/kgd_pp_interface.h +2 -0
index 980e696989b1..1af55997bdb9 100644
@@ -276,6 +276,8 @@ struct amd_pm_funcs {
                 struct amd_pp_simple_clock_info *clocks);
         int (*notify_smu_enable_pwe)(void *handle);
         int (*enable_mgpu_fan_boost)(void *handle);
+       int (*set_fan_speed_max_rpm)(void *handle, uint32_t rpm);
+       int (*set_fan_speed_min_rpm)(void *handle, uint32_t rpm);
 };
 
 #endif
drivers/gpu/drm/amd/powerplay/amd_powerplay.c +46 -0

58 lines not on this page · raw message

drivers/gpu/drm/amd/powerplay/inc/hwmgr.h +2 -0
index 687f73fe4cf5..0242bc039a48 100644
@@ -269,6 +269,8 @@ struct pp_hwmgr_func {
         int (*get_fan_speed_percent)(struct pp_hwmgr *hwmgr, uint32_t *speed);
         int (*set_fan_speed_rpm)(struct pp_hwmgr *hwmgr, uint32_t percent);
         int (*get_fan_speed_rpm)(struct pp_hwmgr *hwmgr, uint32_t *speed);
+       int (*set_fan_speed_max_rpm)(struct pp_hwmgr *hwmgr, uint32_t max_rpm);
+       int (*set_fan_speed_min_rpm)(struct pp_hwmgr *hwmgr, uint32_t min_rpm);
         int (*reset_fan_speed_to_default)(struct pp_hwmgr *hwmgr);
         int (*uninitialize_thermal_controller)(struct pp_hwmgr *hwmgr);
         int (*register_irq_handlers)(struct pp_hwmgr *hwmgr);

--
2.19.1

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

amd-gfx Info Page - freedesktop.org<https://lists.freedesktop.org/mailman/listinfo/amd-gfx>

lists.freedesktop.org

To see the collection of prior postings to the list, visit the amd-gfx Archives.. Using amd-gfx: To post a message to all the list members, send email to [email protected]<mailto:[email protected]>. You can subscribe to the list, or change your existing subscription, in the sections below.

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