Skip to contentSkip to conversation

drm/amd/powerplay: set max fan target temperature as 105C

PATCH In review Evan Quan 3 participants 3 messages Feb 25, 2019 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

Evan Quan

author
#0 lore raw

PATCH 1/1 drm/amd/powerplay: set max fan target temperature as 105C

A workaround to override the fan target temperature in SMC table.

Change-Id I67845c2fe5f51abde1ac483a979bde43ce2f26d3
---
 .../powerplay/hwmgr/vega20_processpptables.c    | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
drivers/gpu/drm/amd/powerplay/hwmgr/vega20_processpptables.c +17 -0
index 97f8a1a970c3..7a7f15d0c53a 100644
@@ -32,6 +32,8 @@
 #include "cgs_common.h"
 #include "vega20_pptable.h"
 
+#define VEGA20_FAN_TARGET_TEMPERATURE_OVERRIDE 105
+
 static void set_hw_cap(struct pp_hwmgr *hwmgr, bool enable,
 		enum phm_platform_caps cap)
 {
@@ -798,6 +800,17 @@ static int append_vbios_pptable(struct pp_hwmgr *hwmgr, PPTable_t *ppsmc_pptable
 	return 0;
 }
 
+static int override_powerplay_table_fantargettemperature(struct pp_hwmgr *hwmgr)
+{
+	struct phm_ppt_v3_information *pptable_information =
+		(struct phm_ppt_v3_information *)hwmgr->pptable;
+	PPTable_t *ppsmc_pptable = (PPTable_t *)(pptable_information->smc_pptable);
+
+	ppsmc_pptable->FanTargetTemperature = VEGA20_FAN_TARGET_TEMPERATURE_OVERRIDE;
+
+	return 0;
+}
+
 #define VEGA20_ENGINECLOCK_HARDMAX 198000
 static int init_powerplay_table_information(
 		struct pp_hwmgr *hwmgr,
@@ -887,6 +900,10 @@ static int init_powerplay_table_information(
 
 
 	result = append_vbios_pptable(hwmgr, (pptable_information->smc_pptable));
+	if (result)
+		return result;
+
+	result = override_powerplay_table_fantargettemperature(hwmgr);
 
 	return result;
 }
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 Kenneth Feng
#2 lore raw

-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Evan Quan
Sent: Monday, February 25, 2019 3:07 PM
To: [email protected]
Cc: Quan, Evan <[email protected]>
Subject: [PATCH] drm/amd/powerplay: set max fan target temperature as 105C

A workaround to override the fan target temperature in SMC table.

Change-Id I67845c2fe5f51abde1ac483a979bde43ce2f26d3
---
 .../powerplay/hwmgr/vega20_processpptables.c    | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
drivers/gpu/drm/amd/powerplay/hwmgr/vega20_processpptables.c +15 -0
index 97f8a1a970c3..7a7f15d0c53a 100644
@@ -32,6 +32,8 @@
 #include "cgs_common.h"
 #include "vega20_pptable.h"
 
+#define VEGA20_FAN_TARGET_TEMPERATURE_OVERRIDE 105
+
 static void set_hw_cap(struct pp_hwmgr *hwmgr, bool enable,
 		enum phm_platform_caps cap)
 {
@@ -798,6 +800,17 @@ static int append_vbios_pptable(struct pp_hwmgr *hwmgr, PPTable_t *ppsmc_pptable
 	return 0;
 }
 
+static int override_powerplay_table_fantargettemperature(struct 
+pp_hwmgr *hwmgr) {
+	struct phm_ppt_v3_information *pptable_information =
+		(struct phm_ppt_v3_information *)hwmgr->pptable;
+	PPTable_t *ppsmc_pptable = (PPTable_t 
+*)(pptable_information->smc_pptable);
+
+	ppsmc_pptable->FanTargetTemperature = 
+VEGA20_FAN_TARGET_TEMPERATURE_OVERRIDE;
+
+	return 0;
+}
+
 #define VEGA20_ENGINECLOCK_HARDMAX 198000  static int init_powerplay_table_information(

struct pp_hwmgr *hwmgr,
@@ -887,6 +900,10 @@ static int init_powerplay_table_information(

result = append_vbios_pptable(hwmgr, (pptable_information->smc_pptable));
+ if (result)
+ return result;
+
+ result = override_powerplay_table_fantargettemperature(hwmgr);

return result;
}
--
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

Acked-by Alex Deucher
#3 lore raw
In reply to a message not in the archive
Quoted 69 lines

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Evan Quan
Sent: Monday, February 25, 2019 2:07 AM
To: [email protected]
Cc: Quan, Evan <[email protected]>
Subject: [PATCH] drm/amd/powerplay: set max fan target temperature as 105C

A workaround to override the fan target temperature in SMC table.

Change-Id I67845c2fe5f51abde1ac483a979bde43ce2f26d3
---
 .../powerplay/hwmgr/vega20_processpptables.c    | 17
+++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega20_processpptables.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega20_processpptables.c index 97f8a1a970c3..7a7f15d0c53a 100644

drivers/gpu/drm/amd/powerplay/hwmgr/vega20_processpptables.c +15 -0
@@ -32,6 +32,8 @@
 #include "cgs_common.h"
 #include "vega20_pptable.h"
 
+#define VEGA20_FAN_TARGET_TEMPERATURE_OVERRIDE 105
+
 static void set_hw_cap(struct pp_hwmgr *hwmgr, bool enable,
 		enum phm_platform_caps cap)
 {
@@ -798,6 +800,17 @@ static int append_vbios_pptable(struct pp_hwmgr
 *hwmgr, PPTable_t *ppsmc_pptable
 	return 0;
 }
 
+static int override_powerplay_table_fantargettemperature(struct
+pp_hwmgr *hwmgr) {
+	struct phm_ppt_v3_information *pptable_information =
+		(struct phm_ppt_v3_information *)hwmgr->pptable;
+	PPTable_t *ppsmc_pptable = (PPTable_t
+*)(pptable_information->smc_pptable);
+
+	ppsmc_pptable->FanTargetTemperature =
+VEGA20_FAN_TARGET_TEMPERATURE_OVERRIDE;
+
+	return 0;
+}
+
 #define VEGA20_ENGINECLOCK_HARDMAX 198000  static int

init_powerplay_table_information(

drivers/gpu/drm/amd/powerplay/hwmgr/vega20_processpptables.c +4 -0
 		struct pp_hwmgr *hwmgr,
@@ -887,6 +900,10 @@ static int init_powerplay_table_information(
 
 
 	result = append_vbios_pptable(hwmgr, (pptable_information-
 >smc_pptable));
+	if (result)
+		return result;
+
+	result = override_powerplay_table_fantargettemperature(hwmgr);
 
 	return result;

}
--
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