Re: [PATCH v2] drm/amdgpu/powerplay: Apply avfs cks-off voltages on VI

2018-12-07 Thread Deucher, Alexander
Acked-by: Alex Deucher 


From: amd-gfx  on behalf of Kenneth Feng 

Sent: Friday, December 7, 2018 1:13:20 AM
To: amd-gfx@lists.freedesktop.org
Cc: Feng, Kenneth
Subject: [PATCH v2] drm/amdgpu/powerplay: Apply avfs cks-off voltages on VI

Instead of EVV cks-off voltages, avfs cks-off voltages can avoid
the overshoot voltages when switching sclk.

Signed-off-by: Kenneth Feng 
---
 drivers/gpu/drm/amd/powerplay/inc/smu7_ppsmc.h  | 2 ++
 drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c | 6 ++
 2 files changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/amd/powerplay/inc/smu7_ppsmc.h 
b/drivers/gpu/drm/amd/powerplay/inc/smu7_ppsmc.h
index 62f36ba..c1a99df 100644
--- a/drivers/gpu/drm/amd/powerplay/inc/smu7_ppsmc.h
+++ b/drivers/gpu/drm/amd/powerplay/inc/smu7_ppsmc.h
@@ -386,6 +386,8 @@ typedef uint16_t PPSMC_Result;
 #define PPSMC_MSG_AgmResetPsm ((uint16_t) 0x403)
 #define PPSMC_MSG_ReadVftCell ((uint16_t) 0x404)

+#define PPSMC_MSG_ApplyAvfsCksOffVoltage  ((uint16_t) 0x415)
+
 #define PPSMC_MSG_GFX_CU_PG_ENABLE((uint16_t) 0x280)
 #define PPSMC_MSG_GFX_CU_PG_DISABLE   ((uint16_t) 0x281)
 #define PPSMC_MSG_GetCurrPkgPwr   ((uint16_t) 0x282)
diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c 
b/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c
index 94898b2..d2b97aa 100644
--- a/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c
+++ b/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c
@@ -1997,6 +1997,12 @@ int polaris10_thermal_avfs_enable(struct pp_hwmgr *hwmgr)

 smum_send_msg_to_smc(hwmgr, PPSMC_MSG_EnableAvfs);

+   /* Apply avfs cks-off voltages to avoid the overshoot
+* when switching to the highest sclk frequency
+*/
+   if (data->apply_avfs_cks_off_voltage)
+   smum_send_msg_to_smc(hwmgr, PPSMC_MSG_ApplyAvfsCksOffVoltage);
+
 return 0;
 }

--
2.7.4

___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


[PATCH v2] drm/amdgpu/powerplay: Apply avfs cks-off voltages on VI

2018-12-06 Thread Kenneth Feng
Instead of EVV cks-off voltages, avfs cks-off voltages can avoid
the overshoot voltages when switching sclk.

Signed-off-by: Kenneth Feng 
---
 drivers/gpu/drm/amd/powerplay/inc/smu7_ppsmc.h  | 2 ++
 drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c | 6 ++
 2 files changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/amd/powerplay/inc/smu7_ppsmc.h 
b/drivers/gpu/drm/amd/powerplay/inc/smu7_ppsmc.h
index 62f36ba..c1a99df 100644
--- a/drivers/gpu/drm/amd/powerplay/inc/smu7_ppsmc.h
+++ b/drivers/gpu/drm/amd/powerplay/inc/smu7_ppsmc.h
@@ -386,6 +386,8 @@ typedef uint16_t PPSMC_Result;
 #define PPSMC_MSG_AgmResetPsm ((uint16_t) 0x403)
 #define PPSMC_MSG_ReadVftCell ((uint16_t) 0x404)
 
+#define PPSMC_MSG_ApplyAvfsCksOffVoltage  ((uint16_t) 0x415)
+
 #define PPSMC_MSG_GFX_CU_PG_ENABLE((uint16_t) 0x280)
 #define PPSMC_MSG_GFX_CU_PG_DISABLE   ((uint16_t) 0x281)
 #define PPSMC_MSG_GetCurrPkgPwr   ((uint16_t) 0x282)
diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c 
b/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c
index 94898b2..d2b97aa 100644
--- a/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c
+++ b/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c
@@ -1997,6 +1997,12 @@ int polaris10_thermal_avfs_enable(struct pp_hwmgr *hwmgr)
 
smum_send_msg_to_smc(hwmgr, PPSMC_MSG_EnableAvfs);
 
+   /* Apply avfs cks-off voltages to avoid the overshoot
+* when switching to the highest sclk frequency
+*/
+   if (data->apply_avfs_cks_off_voltage)
+   smum_send_msg_to_smc(hwmgr, PPSMC_MSG_ApplyAvfsCksOffVoltage);
+
return 0;
 }
 
-- 
2.7.4

___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx