aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorRex Zhu <Rex.Zhu@amd.com>2018-01-23 03:38:36 -0500
committerAlex Deucher <alexander.deucher@amd.com>2018-02-19 14:18:47 -0500
commit527d9427fa21814988bec378f9a8b2c2d441fcc1 (patch)
tree59b8feb5c6d0af40c1b41814f6460afbc83e0b67 /drivers
parentce91b71c9a0bcdf28bade5e5e3501f2a34af3d29 (diff)
drm/amd/pp: Delete dead code in powerplay
As not support per DPM level optimization, so delete activity_target array. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Rex Zhu <Rex.Zhu@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c4
-rw-r--r--drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.h2
-rw-r--r--drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.h2
-rw-r--r--drivers/gpu/drm/amd/powerplay/smumgr/ci_smumgr.c10
-rw-r--r--drivers/gpu/drm/amd/powerplay/smumgr/ci_smumgr.h2
-rw-r--r--drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c10
-rw-r--r--drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.h2
-rw-r--r--drivers/gpu/drm/amd/powerplay/smumgr/iceland_smumgr.c10
-rw-r--r--drivers/gpu/drm/amd/powerplay/smumgr/iceland_smumgr.h1
-rw-r--r--drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c4
-rw-r--r--drivers/gpu/drm/amd/powerplay/smumgr/tonga_smumgr.c10
-rw-r--r--drivers/gpu/drm/amd/powerplay/smumgr/tonga_smumgr.h3
12 files changed, 15 insertions, 45 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c
index f68dd084efae..dec8dd9d2c96 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c
@@ -173,16 +173,12 @@ static uint32_t cz_get_max_sclk_level(struct pp_hwmgr *hwmgr)
173static int cz_initialize_dpm_defaults(struct pp_hwmgr *hwmgr) 173static int cz_initialize_dpm_defaults(struct pp_hwmgr *hwmgr)
174{ 174{
175 struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend); 175 struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);
176 uint32_t i;
177 struct cgs_system_info sys_info = {0}; 176 struct cgs_system_info sys_info = {0};
178 int result; 177 int result;
179 178
180 cz_hwmgr->gfx_ramp_step = 256*25/100; 179 cz_hwmgr->gfx_ramp_step = 256*25/100;
181 cz_hwmgr->gfx_ramp_delay = 1; /* by default, we delay 1us */ 180 cz_hwmgr->gfx_ramp_delay = 1; /* by default, we delay 1us */
182 181
183 for (i = 0; i < CZ_MAX_HARDWARE_POWERLEVELS; i++)
184 cz_hwmgr->activity_target[i] = CZ_AT_DFLT;
185
186 cz_hwmgr->mgcg_cgtt_local0 = 0x00000000; 182 cz_hwmgr->mgcg_cgtt_local0 = 0x00000000;
187 cz_hwmgr->mgcg_cgtt_local1 = 0x00000000; 183 cz_hwmgr->mgcg_cgtt_local1 = 0x00000000;
188 cz_hwmgr->clock_slow_down_freq = 25000; 184 cz_hwmgr->clock_slow_down_freq = 25000;
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.h b/drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.h
index 508b422d6159..468c739a4299 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.h
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.h
@@ -30,7 +30,6 @@
30#define CZ_NUM_NBPSTATES 4 30#define CZ_NUM_NBPSTATES 4
31#define CZ_NUM_NBPMEMORYCLOCK 2 31#define CZ_NUM_NBPMEMORYCLOCK 2
32#define MAX_DISPLAY_CLOCK_LEVEL 8 32#define MAX_DISPLAY_CLOCK_LEVEL 8
33#define CZ_AT_DFLT 30
34#define CZ_MAX_HARDWARE_POWERLEVELS 8 33#define CZ_MAX_HARDWARE_POWERLEVELS 8
35#define PPCZ_VOTINGRIGHTSCLIENTS_DFLT0 0x3FFFC102 34#define PPCZ_VOTINGRIGHTSCLIENTS_DFLT0 0x3FFFC102
36#define CZ_MIN_DEEP_SLEEP_SCLK 800 35#define CZ_MIN_DEEP_SLEEP_SCLK 800
@@ -185,7 +184,6 @@ struct cc6_settings {
185}; 184};
186 185
187struct cz_hwmgr { 186struct cz_hwmgr {
188 uint32_t activity_target[CZ_MAX_HARDWARE_POWERLEVELS];
189 uint32_t dpm_interval; 187 uint32_t dpm_interval;
190 188
191 uint32_t voltage_drop_threshold; 189 uint32_t voltage_drop_threshold;
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.h b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.h
index a626a3eafc23..375fa10942f8 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.h
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.h
@@ -289,7 +289,7 @@ struct smu7_hwmgr {
289 struct smu7_pcie_perf_range pcie_lane_power_saving; 289 struct smu7_pcie_perf_range pcie_lane_power_saving;
290 bool use_pcie_performance_levels; 290 bool use_pcie_performance_levels;
291 bool use_pcie_power_saving_levels; 291 bool use_pcie_power_saving_levels;
292 uint32_t mclk_activity_target; 292 uint16_t mclk_activity_target;
293 uint16_t sclk_activity_target; 293 uint16_t sclk_activity_target;
294 uint32_t mclk_dpm0_activity_target; 294 uint32_t mclk_dpm0_activity_target;
295 uint32_t low_sclk_interrupt_threshold; 295 uint32_t low_sclk_interrupt_threshold;
diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/ci_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/ci_smumgr.c
index 98be1277ef21..01cf32ccab5e 100644
--- a/drivers/gpu/drm/amd/powerplay/smumgr/ci_smumgr.c
+++ b/drivers/gpu/drm/amd/powerplay/smumgr/ci_smumgr.c
@@ -492,7 +492,7 @@ static int ci_populate_all_graphic_levels(struct pp_hwmgr *hwmgr)
492 for (i = 0; i < dpm_table->sclk_table.count; i++) { 492 for (i = 0; i < dpm_table->sclk_table.count; i++) {
493 result = ci_populate_single_graphic_level(hwmgr, 493 result = ci_populate_single_graphic_level(hwmgr,
494 dpm_table->sclk_table.dpm_levels[i].value, 494 dpm_table->sclk_table.dpm_levels[i].value,
495 (uint16_t)smu_data->activity_target[i], 495 data->sclk_activity_target,
496 &levels[i]); 496 &levels[i]);
497 if (result) 497 if (result)
498 return result; 498 return result;
@@ -1231,7 +1231,7 @@ static int ci_populate_single_memory_level(
1231 memory_level->VoltageDownH = 0; 1231 memory_level->VoltageDownH = 0;
1232 1232
1233 /* Indicates maximum activity level for this performance level.*/ 1233 /* Indicates maximum activity level for this performance level.*/
1234 memory_level->ActivityLevel = (uint16_t)data->mclk_activity_target; 1234 memory_level->ActivityLevel = data->mclk_activity_target;
1235 memory_level->StutterEnable = 0; 1235 memory_level->StutterEnable = 0;
1236 memory_level->StrobeEnable = 0; 1236 memory_level->StrobeEnable = 0;
1237 memory_level->EdcReadEnable = 0; 1237 memory_level->EdcReadEnable = 0;
@@ -1515,7 +1515,7 @@ static int ci_populate_smc_acpi_level(struct pp_hwmgr *hwmgr,
1515 table->MemoryACPILevel.DownH = 100; 1515 table->MemoryACPILevel.DownH = 100;
1516 table->MemoryACPILevel.VoltageDownH = 0; 1516 table->MemoryACPILevel.VoltageDownH = 0;
1517 /* Indicates maximum activity level for this performance level.*/ 1517 /* Indicates maximum activity level for this performance level.*/
1518 table->MemoryACPILevel.ActivityLevel = PP_HOST_TO_SMC_US((uint16_t)data->mclk_activity_target); 1518 table->MemoryACPILevel.ActivityLevel = PP_HOST_TO_SMC_US(data->mclk_activity_target);
1519 1519
1520 table->MemoryACPILevel.StutterEnable = 0; 1520 table->MemoryACPILevel.StutterEnable = 0;
1521 table->MemoryACPILevel.StrobeEnable = 0; 1521 table->MemoryACPILevel.StrobeEnable = 0;
@@ -2802,7 +2802,6 @@ static int ci_populate_requested_graphic_levels(struct pp_hwmgr *hwmgr,
2802 2802
2803static int ci_smu_init(struct pp_hwmgr *hwmgr) 2803static int ci_smu_init(struct pp_hwmgr *hwmgr)
2804{ 2804{
2805 int i;
2806 struct ci_smumgr *ci_priv = NULL; 2805 struct ci_smumgr *ci_priv = NULL;
2807 2806
2808 ci_priv = kzalloc(sizeof(struct ci_smumgr), GFP_KERNEL); 2807 ci_priv = kzalloc(sizeof(struct ci_smumgr), GFP_KERNEL);
@@ -2810,9 +2809,6 @@ static int ci_smu_init(struct pp_hwmgr *hwmgr)
2810 if (ci_priv == NULL) 2809 if (ci_priv == NULL)
2811 return -ENOMEM; 2810 return -ENOMEM;
2812 2811
2813 for (i = 0; i < SMU7_MAX_LEVELS_GRAPHICS; i++)
2814 ci_priv->activity_target[i] = 30;
2815
2816 hwmgr->smu_backend = ci_priv; 2812 hwmgr->smu_backend = ci_priv;
2817 2813
2818 return 0; 2814 return 0;
diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/ci_smumgr.h b/drivers/gpu/drm/amd/powerplay/smumgr/ci_smumgr.h
index 8189cfa17c46..a8282705c569 100644
--- a/drivers/gpu/drm/amd/powerplay/smumgr/ci_smumgr.h
+++ b/drivers/gpu/drm/amd/powerplay/smumgr/ci_smumgr.h
@@ -70,8 +70,6 @@ struct ci_smumgr {
70 const struct ci_pt_defaults *power_tune_defaults; 70 const struct ci_pt_defaults *power_tune_defaults;
71 SMU7_Discrete_MCRegisters mc_regs; 71 SMU7_Discrete_MCRegisters mc_regs;
72 struct ci_mc_reg_table mc_reg_table; 72 struct ci_mc_reg_table mc_reg_table;
73 uint32_t activity_target[SMU7_MAX_LEVELS_GRAPHICS];
74
75}; 73};
76 74
77#endif 75#endif
diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c
index 73c6020bab76..e54038075886 100644
--- a/drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c
+++ b/drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c
@@ -368,7 +368,6 @@ static bool fiji_is_hw_avfs_present(struct pp_hwmgr *hwmgr)
368 368
369static int fiji_smu_init(struct pp_hwmgr *hwmgr) 369static int fiji_smu_init(struct pp_hwmgr *hwmgr)
370{ 370{
371 int i;
372 struct fiji_smumgr *fiji_priv = NULL; 371 struct fiji_smumgr *fiji_priv = NULL;
373 372
374 fiji_priv = kzalloc(sizeof(struct fiji_smumgr), GFP_KERNEL); 373 fiji_priv = kzalloc(sizeof(struct fiji_smumgr), GFP_KERNEL);
@@ -381,9 +380,6 @@ static int fiji_smu_init(struct pp_hwmgr *hwmgr)
381 if (smu7_init(hwmgr)) 380 if (smu7_init(hwmgr))
382 return -EINVAL; 381 return -EINVAL;
383 382
384 for (i = 0; i < SMU73_MAX_LEVELS_GRAPHICS; i++)
385 fiji_priv->activity_target[i] = 30;
386
387 return 0; 383 return 0;
388} 384}
389 385
@@ -1063,7 +1059,7 @@ static int fiji_populate_all_graphic_levels(struct pp_hwmgr *hwmgr)
1063 for (i = 0; i < dpm_table->sclk_table.count; i++) { 1059 for (i = 0; i < dpm_table->sclk_table.count; i++) {
1064 result = fiji_populate_single_graphic_level(hwmgr, 1060 result = fiji_populate_single_graphic_level(hwmgr,
1065 dpm_table->sclk_table.dpm_levels[i].value, 1061 dpm_table->sclk_table.dpm_levels[i].value,
1066 (uint16_t)smu_data->activity_target[i], 1062 data->sclk_activity_target,
1067 &levels[i]); 1063 &levels[i]);
1068 if (result) 1064 if (result)
1069 return result; 1065 return result;
@@ -1229,7 +1225,7 @@ static int fiji_populate_single_memory_level(struct pp_hwmgr *hwmgr,
1229 mem_level->UpHyst = 0; 1225 mem_level->UpHyst = 0;
1230 mem_level->DownHyst = 100; 1226 mem_level->DownHyst = 100;
1231 mem_level->VoltageDownHyst = 0; 1227 mem_level->VoltageDownHyst = 0;
1232 mem_level->ActivityLevel = (uint16_t)data->mclk_activity_target; 1228 mem_level->ActivityLevel = data->mclk_activity_target;
1233 mem_level->StutterEnable = false; 1229 mem_level->StutterEnable = false;
1234 1230
1235 mem_level->DisplayWatermark = PPSMC_DISPLAY_WATERMARK_LOW; 1231 mem_level->DisplayWatermark = PPSMC_DISPLAY_WATERMARK_LOW;
@@ -1447,7 +1443,7 @@ static int fiji_populate_smc_acpi_level(struct pp_hwmgr *hwmgr,
1447 table->MemoryACPILevel.DownHyst = 100; 1443 table->MemoryACPILevel.DownHyst = 100;
1448 table->MemoryACPILevel.VoltageDownHyst = 0; 1444 table->MemoryACPILevel.VoltageDownHyst = 0;
1449 table->MemoryACPILevel.ActivityLevel = 1445 table->MemoryACPILevel.ActivityLevel =
1450 PP_HOST_TO_SMC_US((uint16_t)data->mclk_activity_target); 1446 PP_HOST_TO_SMC_US(data->mclk_activity_target);
1451 1447
1452 table->MemoryACPILevel.StutterEnable = false; 1448 table->MemoryACPILevel.StutterEnable = false;
1453 CONVERT_FROM_HOST_TO_SMC_UL(table->MemoryACPILevel.MclkFrequency); 1449 CONVERT_FROM_HOST_TO_SMC_UL(table->MemoryACPILevel.MclkFrequency);
diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.h b/drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.h
index 279647772578..6d3746268ccf 100644
--- a/drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.h
+++ b/drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.h
@@ -43,8 +43,6 @@ struct fiji_smumgr {
43 struct SMU73_Discrete_Ulv ulv_setting; 43 struct SMU73_Discrete_Ulv ulv_setting;
44 struct SMU73_Discrete_PmFuses power_tune_table; 44 struct SMU73_Discrete_PmFuses power_tune_table;
45 const struct fiji_pt_defaults *power_tune_defaults; 45 const struct fiji_pt_defaults *power_tune_defaults;
46 uint32_t activity_target[SMU73_MAX_LEVELS_GRAPHICS];
47
48}; 46};
49 47
50#endif 48#endif
diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/iceland_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/iceland_smumgr.c
index 6400065a8710..5cf588d6660c 100644
--- a/drivers/gpu/drm/amd/powerplay/smumgr/iceland_smumgr.c
+++ b/drivers/gpu/drm/amd/powerplay/smumgr/iceland_smumgr.c
@@ -262,7 +262,6 @@ static int iceland_start_smu(struct pp_hwmgr *hwmgr)
262 262
263static int iceland_smu_init(struct pp_hwmgr *hwmgr) 263static int iceland_smu_init(struct pp_hwmgr *hwmgr)
264{ 264{
265 int i;
266 struct iceland_smumgr *iceland_priv = NULL; 265 struct iceland_smumgr *iceland_priv = NULL;
267 266
268 iceland_priv = kzalloc(sizeof(struct iceland_smumgr), GFP_KERNEL); 267 iceland_priv = kzalloc(sizeof(struct iceland_smumgr), GFP_KERNEL);
@@ -275,9 +274,6 @@ static int iceland_smu_init(struct pp_hwmgr *hwmgr)
275 if (smu7_init(hwmgr)) 274 if (smu7_init(hwmgr))
276 return -EINVAL; 275 return -EINVAL;
277 276
278 for (i = 0; i < SMU71_MAX_LEVELS_GRAPHICS; i++)
279 iceland_priv->activity_target[i] = 30;
280
281 return 0; 277 return 0;
282} 278}
283 279
@@ -989,7 +985,7 @@ static int iceland_populate_all_graphic_levels(struct pp_hwmgr *hwmgr)
989 for (i = 0; i < dpm_table->sclk_table.count; i++) { 985 for (i = 0; i < dpm_table->sclk_table.count; i++) {
990 result = iceland_populate_single_graphic_level(hwmgr, 986 result = iceland_populate_single_graphic_level(hwmgr,
991 dpm_table->sclk_table.dpm_levels[i].value, 987 dpm_table->sclk_table.dpm_levels[i].value,
992 (uint16_t)smu_data->activity_target[i], 988 data->sclk_activity_target,
993 &(smu_data->smc_state_table.GraphicsLevel[i])); 989 &(smu_data->smc_state_table.GraphicsLevel[i]));
994 if (result != 0) 990 if (result != 0)
995 return result; 991 return result;
@@ -1280,7 +1276,7 @@ static int iceland_populate_single_memory_level(
1280 memory_level->VoltageDownHyst = 0; 1276 memory_level->VoltageDownHyst = 0;
1281 1277
1282 /* Indicates maximum activity level for this performance level.*/ 1278 /* Indicates maximum activity level for this performance level.*/
1283 memory_level->ActivityLevel = (uint16_t)data->mclk_activity_target; 1279 memory_level->ActivityLevel = data->mclk_activity_target;
1284 memory_level->StutterEnable = 0; 1280 memory_level->StutterEnable = 0;
1285 memory_level->StrobeEnable = 0; 1281 memory_level->StrobeEnable = 0;
1286 memory_level->EdcReadEnable = 0; 1282 memory_level->EdcReadEnable = 0;
@@ -1561,7 +1557,7 @@ static int iceland_populate_smc_acpi_level(struct pp_hwmgr *hwmgr,
1561 table->MemoryACPILevel.DownHyst = 100; 1557 table->MemoryACPILevel.DownHyst = 100;
1562 table->MemoryACPILevel.VoltageDownHyst = 0; 1558 table->MemoryACPILevel.VoltageDownHyst = 0;
1563 /* Indicates maximum activity level for this performance level.*/ 1559 /* Indicates maximum activity level for this performance level.*/
1564 table->MemoryACPILevel.ActivityLevel = PP_HOST_TO_SMC_US((uint16_t)data->mclk_activity_target); 1560 table->MemoryACPILevel.ActivityLevel = PP_HOST_TO_SMC_US(data->mclk_activity_target);
1565 1561
1566 table->MemoryACPILevel.StutterEnable = 0; 1562 table->MemoryACPILevel.StutterEnable = 0;
1567 table->MemoryACPILevel.StrobeEnable = 0; 1563 table->MemoryACPILevel.StrobeEnable = 0;
diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/iceland_smumgr.h b/drivers/gpu/drm/amd/powerplay/smumgr/iceland_smumgr.h
index 802472530d34..f32c506779c9 100644
--- a/drivers/gpu/drm/amd/powerplay/smumgr/iceland_smumgr.h
+++ b/drivers/gpu/drm/amd/powerplay/smumgr/iceland_smumgr.h
@@ -65,7 +65,6 @@ struct iceland_smumgr {
65 const struct iceland_pt_defaults *power_tune_defaults; 65 const struct iceland_pt_defaults *power_tune_defaults;
66 SMU71_Discrete_MCRegisters mc_regs; 66 SMU71_Discrete_MCRegisters mc_regs;
67 struct iceland_mc_reg_table mc_reg_table; 67 struct iceland_mc_reg_table mc_reg_table;
68 uint32_t activity_target[SMU71_MAX_LEVELS_GRAPHICS];
69}; 68};
70 69
71#endif 70#endif
diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c
index 356f60ed28f4..f9856e1c89ff 100644
--- a/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c
+++ b/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c
@@ -1133,7 +1133,7 @@ static int polaris10_populate_single_memory_level(struct pp_hwmgr *hwmgr,
1133 mem_level->UpHyst = 0; 1133 mem_level->UpHyst = 0;
1134 mem_level->DownHyst = 100; 1134 mem_level->DownHyst = 100;
1135 mem_level->VoltageDownHyst = 0; 1135 mem_level->VoltageDownHyst = 0;
1136 mem_level->ActivityLevel = (uint16_t)data->mclk_activity_target; 1136 mem_level->ActivityLevel = data->mclk_activity_target;
1137 mem_level->StutterEnable = false; 1137 mem_level->StutterEnable = false;
1138 mem_level->DisplayWatermark = PPSMC_DISPLAY_WATERMARK_LOW; 1138 mem_level->DisplayWatermark = PPSMC_DISPLAY_WATERMARK_LOW;
1139 1139
@@ -1314,7 +1314,7 @@ static int polaris10_populate_smc_acpi_level(struct pp_hwmgr *hwmgr,
1314 table->MemoryACPILevel.DownHyst = 100; 1314 table->MemoryACPILevel.DownHyst = 100;
1315 table->MemoryACPILevel.VoltageDownHyst = 0; 1315 table->MemoryACPILevel.VoltageDownHyst = 0;
1316 table->MemoryACPILevel.ActivityLevel = 1316 table->MemoryACPILevel.ActivityLevel =
1317 PP_HOST_TO_SMC_US((uint16_t)data->mclk_activity_target); 1317 PP_HOST_TO_SMC_US(data->mclk_activity_target);
1318 1318
1319 CONVERT_FROM_HOST_TO_SMC_UL(table->MemoryACPILevel.MclkFrequency); 1319 CONVERT_FROM_HOST_TO_SMC_UL(table->MemoryACPILevel.MclkFrequency);
1320 CONVERT_FROM_HOST_TO_SMC_UL(table->MemoryACPILevel.MinVoltage); 1320 CONVERT_FROM_HOST_TO_SMC_UL(table->MemoryACPILevel.MinVoltage);
diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/tonga_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/tonga_smumgr.c
index 4b3fd04780d5..ce6e740074af 100644
--- a/drivers/gpu/drm/amd/powerplay/smumgr/tonga_smumgr.c
+++ b/drivers/gpu/drm/amd/powerplay/smumgr/tonga_smumgr.c
@@ -222,7 +222,6 @@ static int tonga_start_smu(struct pp_hwmgr *hwmgr)
222static int tonga_smu_init(struct pp_hwmgr *hwmgr) 222static int tonga_smu_init(struct pp_hwmgr *hwmgr)
223{ 223{
224 struct tonga_smumgr *tonga_priv = NULL; 224 struct tonga_smumgr *tonga_priv = NULL;
225 int i;
226 225
227 tonga_priv = kzalloc(sizeof(struct tonga_smumgr), GFP_KERNEL); 226 tonga_priv = kzalloc(sizeof(struct tonga_smumgr), GFP_KERNEL);
228 if (tonga_priv == NULL) 227 if (tonga_priv == NULL)
@@ -233,9 +232,6 @@ static int tonga_smu_init(struct pp_hwmgr *hwmgr)
233 if (smu7_init(hwmgr)) 232 if (smu7_init(hwmgr))
234 return -EINVAL; 233 return -EINVAL;
235 234
236 for (i = 0; i < SMU72_MAX_LEVELS_GRAPHICS; i++)
237 tonga_priv->activity_target[i] = 30;
238
239 return 0; 235 return 0;
240} 236}
241 237
@@ -708,7 +704,7 @@ static int tonga_populate_all_graphic_levels(struct pp_hwmgr *hwmgr)
708 for (i = 0; i < dpm_table->sclk_table.count; i++) { 704 for (i = 0; i < dpm_table->sclk_table.count; i++) {
709 result = tonga_populate_single_graphic_level(hwmgr, 705 result = tonga_populate_single_graphic_level(hwmgr,
710 dpm_table->sclk_table.dpm_levels[i].value, 706 dpm_table->sclk_table.dpm_levels[i].value,
711 (uint16_t)smu_data->activity_target[i], 707 data->sclk_activity_target,
712 &(smu_data->smc_state_table.GraphicsLevel[i])); 708 &(smu_data->smc_state_table.GraphicsLevel[i]));
713 if (result != 0) 709 if (result != 0)
714 return result; 710 return result;
@@ -1003,7 +999,7 @@ static int tonga_populate_single_memory_level(
1003 memory_level->VoltageDownHyst = 0; 999 memory_level->VoltageDownHyst = 0;
1004 1000
1005 /* Indicates maximum activity level for this performance level.*/ 1001 /* Indicates maximum activity level for this performance level.*/
1006 memory_level->ActivityLevel = (uint16_t)data->mclk_activity_target; 1002 memory_level->ActivityLevel = data->mclk_activity_target;
1007 memory_level->StutterEnable = 0; 1003 memory_level->StutterEnable = 0;
1008 memory_level->StrobeEnable = 0; 1004 memory_level->StrobeEnable = 0;
1009 memory_level->EdcReadEnable = 0; 1005 memory_level->EdcReadEnable = 0;
@@ -1293,7 +1289,7 @@ static int tonga_populate_smc_acpi_level(struct pp_hwmgr *hwmgr,
1293 table->MemoryACPILevel.VoltageDownHyst = 0; 1289 table->MemoryACPILevel.VoltageDownHyst = 0;
1294 /* Indicates maximum activity level for this performance level.*/ 1290 /* Indicates maximum activity level for this performance level.*/
1295 table->MemoryACPILevel.ActivityLevel = 1291 table->MemoryACPILevel.ActivityLevel =
1296 PP_HOST_TO_SMC_US((uint16_t)data->mclk_activity_target); 1292 PP_HOST_TO_SMC_US(data->mclk_activity_target);
1297 1293
1298 table->MemoryACPILevel.StutterEnable = 0; 1294 table->MemoryACPILevel.StutterEnable = 0;
1299 table->MemoryACPILevel.StrobeEnable = 0; 1295 table->MemoryACPILevel.StrobeEnable = 0;
diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/tonga_smumgr.h b/drivers/gpu/drm/amd/powerplay/smumgr/tonga_smumgr.h
index 5d70a00348e2..d664fedd3d85 100644
--- a/drivers/gpu/drm/amd/powerplay/smumgr/tonga_smumgr.h
+++ b/drivers/gpu/drm/amd/powerplay/smumgr/tonga_smumgr.h
@@ -69,9 +69,6 @@ struct tonga_smumgr {
69 const struct tonga_pt_defaults *power_tune_defaults; 69 const struct tonga_pt_defaults *power_tune_defaults;
70 SMU72_Discrete_MCRegisters mc_regs; 70 SMU72_Discrete_MCRegisters mc_regs;
71 struct tonga_mc_reg_table mc_reg_table; 71 struct tonga_mc_reg_table mc_reg_table;
72
73 uint32_t activity_target[SMU72_MAX_LEVELS_GRAPHICS];
74
75}; 72};
76 73
77#endif 74#endif