aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd
diff options
context:
space:
mode:
authorRex Zhu <Rex.Zhu@amd.com>2018-05-30 04:52:22 -0400
committerAlex Deucher <alexander.deucher@amd.com>2018-05-31 15:07:46 -0400
commit46defdd6fff70edf6bd21848ee75d927c36e4153 (patch)
tree41328c5b876b821d995b144daf30ff2ed2d95add /drivers/gpu/drm/amd
parent9dac0c3fb41056ae48b93e679c2a796c4dcfa8ed (diff)
drm/amd/pp: Allow underclocking when od table is empty in vbios
if max od engine clock limit and memory clock limit are not set in vbios. driver will allow underclocking instand of disable od feature completely. 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/gpu/drm/amd')
-rw-r--r--drivers/gpu/drm/amd/powerplay/hwmgr/process_pptables_v1_0.c6
-rw-r--r--drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c6
-rw-r--r--drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c5
-rw-r--r--drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c6
-rw-r--r--drivers/gpu/drm/amd/powerplay/hwmgr/vega10_processpptables.c6
5 files changed, 10 insertions, 19 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/process_pptables_v1_0.c b/drivers/gpu/drm/amd/powerplay/hwmgr/process_pptables_v1_0.c
index f0d48b183d22..35bd9870ab10 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/process_pptables_v1_0.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/process_pptables_v1_0.c
@@ -870,12 +870,6 @@ static int init_over_drive_limits(
870 hwmgr->platform_descriptor.maxOverdriveVDDC = 0; 870 hwmgr->platform_descriptor.maxOverdriveVDDC = 0;
871 hwmgr->platform_descriptor.overdriveVDDCStep = 0; 871 hwmgr->platform_descriptor.overdriveVDDCStep = 0;
872 872
873 if (hwmgr->platform_descriptor.overdriveLimit.engineClock == 0 \
874 || hwmgr->platform_descriptor.overdriveLimit.memoryClock == 0) {
875 hwmgr->od_enabled = false;
876 pr_debug("OverDrive feature not support by VBIOS\n");
877 }
878
879 return 0; 873 return 0;
880} 874}
881 875
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c b/drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c
index ce64dfabd34b..925e17104f90 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c
@@ -1074,12 +1074,6 @@ static int init_overdrive_limits(struct pp_hwmgr *hwmgr,
1074 powerplay_table, 1074 powerplay_table,
1075 (const ATOM_FIRMWARE_INFO_V2_1 *)fw_info); 1075 (const ATOM_FIRMWARE_INFO_V2_1 *)fw_info);
1076 1076
1077 if (hwmgr->platform_descriptor.overdriveLimit.engineClock == 0
1078 && hwmgr->platform_descriptor.overdriveLimit.memoryClock == 0) {
1079 hwmgr->od_enabled = false;
1080 pr_debug("OverDrive feature not support by VBIOS\n");
1081 }
1082
1083 return result; 1077 return result;
1084} 1078}
1085 1079
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
index 45e9b8cb169d..b763c542bd6e 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
@@ -791,7 +791,8 @@ static int smu7_setup_dpm_tables_v1(struct pp_hwmgr *hwmgr)
791 data->dpm_table.sclk_table.count++; 791 data->dpm_table.sclk_table.count++;
792 } 792 }
793 } 793 }
794 794 if (hwmgr->platform_descriptor.overdriveLimit.engineClock == 0)
795 hwmgr->platform_descriptor.overdriveLimit.engineClock = dep_sclk_table->entries[i-1].clk;
795 /* Initialize Mclk DPM table based on allow Mclk values */ 796 /* Initialize Mclk DPM table based on allow Mclk values */
796 data->dpm_table.mclk_table.count = 0; 797 data->dpm_table.mclk_table.count = 0;
797 for (i = 0; i < dep_mclk_table->count; i++) { 798 for (i = 0; i < dep_mclk_table->count; i++) {
@@ -806,6 +807,8 @@ static int smu7_setup_dpm_tables_v1(struct pp_hwmgr *hwmgr)
806 } 807 }
807 } 808 }
808 809
810 if (hwmgr->platform_descriptor.overdriveLimit.memoryClock == 0)
811 hwmgr->platform_descriptor.overdriveLimit.memoryClock = dep_mclk_table->entries[i-1].clk;
809 return 0; 812 return 0;
810} 813}
811 814
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
index d156b7bb92ae..f70dbc8ccfba 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
@@ -1311,6 +1311,9 @@ static int vega10_setup_default_dpm_tables(struct pp_hwmgr *hwmgr)
1311 vega10_setup_default_single_dpm_table(hwmgr, 1311 vega10_setup_default_single_dpm_table(hwmgr,
1312 dpm_table, 1312 dpm_table,
1313 dep_gfx_table); 1313 dep_gfx_table);
1314 if (hwmgr->platform_descriptor.overdriveLimit.engineClock == 0)
1315 hwmgr->platform_descriptor.overdriveLimit.engineClock =
1316 dpm_table->dpm_levels[dpm_table->count-1].value;
1314 vega10_init_dpm_state(&(dpm_table->dpm_state)); 1317 vega10_init_dpm_state(&(dpm_table->dpm_state));
1315 1318
1316 /* Initialize Mclk DPM table based on allow Mclk values */ 1319 /* Initialize Mclk DPM table based on allow Mclk values */
@@ -1319,6 +1322,9 @@ static int vega10_setup_default_dpm_tables(struct pp_hwmgr *hwmgr)
1319 vega10_setup_default_single_dpm_table(hwmgr, 1322 vega10_setup_default_single_dpm_table(hwmgr,
1320 dpm_table, 1323 dpm_table,
1321 dep_mclk_table); 1324 dep_mclk_table);
1325 if (hwmgr->platform_descriptor.overdriveLimit.memoryClock == 0)
1326 hwmgr->platform_descriptor.overdriveLimit.memoryClock =
1327 dpm_table->dpm_levels[dpm_table->count-1].value;
1322 vega10_init_dpm_state(&(dpm_table->dpm_state)); 1328 vega10_init_dpm_state(&(dpm_table->dpm_state));
1323 1329
1324 data->dpm_table.eclk_table.count = 0; 1330 data->dpm_table.eclk_table.count = 0;
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_processpptables.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_processpptables.c
index 0768d259c07c..16b1a9cf6cf0 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_processpptables.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_processpptables.c
@@ -267,12 +267,6 @@ static int init_over_drive_limits(
267 hwmgr->platform_descriptor.maxOverdriveVDDC = 0; 267 hwmgr->platform_descriptor.maxOverdriveVDDC = 0;
268 hwmgr->platform_descriptor.overdriveVDDCStep = 0; 268 hwmgr->platform_descriptor.overdriveVDDCStep = 0;
269 269
270 if (hwmgr->platform_descriptor.overdriveLimit.engineClock == 0 ||
271 hwmgr->platform_descriptor.overdriveLimit.memoryClock == 0) {
272 hwmgr->od_enabled = false;
273 pr_debug("OverDrive feature not support by VBIOS\n");
274 }
275
276 return 0; 270 return 0;
277} 271}
278 272