drm/amd/pp: Allow underclocking when od table is empty in vbios
authorRex Zhu <Rex.Zhu@amd.com>
Wed, 30 May 2018 08:52:22 +0000 (16:52 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 31 May 2018 19:07:46 +0000 (14:07 -0500)
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>
drivers/gpu/drm/amd/powerplay/hwmgr/process_pptables_v1_0.c
drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_processpptables.c

index f0d48b183d22c7fe72bead64356c1fdc49c8a37c..35bd9870ab10811cd46c79adc3d8020267e828cd 100644 (file)
@@ -870,12 +870,6 @@ static int init_over_drive_limits(
        hwmgr->platform_descriptor.maxOverdriveVDDC = 0;
        hwmgr->platform_descriptor.overdriveVDDCStep = 0;
 
-       if (hwmgr->platform_descriptor.overdriveLimit.engineClock == 0 \
-               || hwmgr->platform_descriptor.overdriveLimit.memoryClock == 0) {
-               hwmgr->od_enabled = false;
-               pr_debug("OverDrive feature not support by VBIOS\n");
-       }
-
        return 0;
 }
 
index ce64dfabd34bd0cd40cf194c56156f1630d15098..925e17104f9092cd1f343591a524a906c20d1b80 100644 (file)
@@ -1074,12 +1074,6 @@ static int init_overdrive_limits(struct pp_hwmgr *hwmgr,
                                powerplay_table,
                                (const ATOM_FIRMWARE_INFO_V2_1 *)fw_info);
 
-       if (hwmgr->platform_descriptor.overdriveLimit.engineClock == 0
-               && hwmgr->platform_descriptor.overdriveLimit.memoryClock == 0) {
-               hwmgr->od_enabled = false;
-               pr_debug("OverDrive feature not support by VBIOS\n");
-       }
-
        return result;
 }
 
index 45e9b8cb169d8f6408b038c1bc1e32935417b54a..b763c542bd6e7be11d25a6306918b1df08d2298a 100644 (file)
@@ -791,7 +791,8 @@ static int smu7_setup_dpm_tables_v1(struct pp_hwmgr *hwmgr)
                        data->dpm_table.sclk_table.count++;
                }
        }
-
+       if (hwmgr->platform_descriptor.overdriveLimit.engineClock == 0)
+               hwmgr->platform_descriptor.overdriveLimit.engineClock = dep_sclk_table->entries[i-1].clk;
        /* Initialize Mclk DPM table based on allow Mclk values */
        data->dpm_table.mclk_table.count = 0;
        for (i = 0; i < dep_mclk_table->count; i++) {
@@ -806,6 +807,8 @@ static int smu7_setup_dpm_tables_v1(struct pp_hwmgr *hwmgr)
                }
        }
 
+       if (hwmgr->platform_descriptor.overdriveLimit.memoryClock == 0)
+               hwmgr->platform_descriptor.overdriveLimit.memoryClock = dep_mclk_table->entries[i-1].clk;
        return 0;
 }
 
index d156b7bb92ae74a3b9b899f2e3a7907c5b0410f0..f70dbc8ccfbaf3fead6c2a2af595cb13d984203f 100644 (file)
@@ -1311,6 +1311,9 @@ static int vega10_setup_default_dpm_tables(struct pp_hwmgr *hwmgr)
        vega10_setup_default_single_dpm_table(hwmgr,
                        dpm_table,
                        dep_gfx_table);
+       if (hwmgr->platform_descriptor.overdriveLimit.engineClock == 0)
+               hwmgr->platform_descriptor.overdriveLimit.engineClock =
+                                       dpm_table->dpm_levels[dpm_table->count-1].value;
        vega10_init_dpm_state(&(dpm_table->dpm_state));
 
        /* Initialize Mclk DPM table based on allow Mclk values */
@@ -1319,6 +1322,9 @@ static int vega10_setup_default_dpm_tables(struct pp_hwmgr *hwmgr)
        vega10_setup_default_single_dpm_table(hwmgr,
                        dpm_table,
                        dep_mclk_table);
+       if (hwmgr->platform_descriptor.overdriveLimit.memoryClock == 0)
+               hwmgr->platform_descriptor.overdriveLimit.memoryClock =
+                                       dpm_table->dpm_levels[dpm_table->count-1].value;
        vega10_init_dpm_state(&(dpm_table->dpm_state));
 
        data->dpm_table.eclk_table.count = 0;
index 0768d259c07c335f51971c634ac2bd41e014f12a..16b1a9cf6cf08219db8b4724cb29a55d8bef68f4 100644 (file)
@@ -267,12 +267,6 @@ static int init_over_drive_limits(
        hwmgr->platform_descriptor.maxOverdriveVDDC = 0;
        hwmgr->platform_descriptor.overdriveVDDCStep = 0;
 
-       if (hwmgr->platform_descriptor.overdriveLimit.engineClock == 0 ||
-               hwmgr->platform_descriptor.overdriveLimit.memoryClock == 0) {
-               hwmgr->od_enabled = false;
-               pr_debug("OverDrive feature not support by VBIOS\n");
-       }
-
        return 0;
 }