drm/amd/powerplay: set default fclk for no fclk dpm support case
authorEvan Quan <evan.quan@amd.com>
Wed, 20 Feb 2019 09:20:40 +0000 (17:20 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 28 Feb 2019 03:20:16 +0000 (22:20 -0500)
Set the default fclk as what we got from VBIOS.

Signed-off-by: Evan Quan <evan.quan@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/powerplay/hwmgr/ppatomfwctrl.c
drivers/gpu/drm/amd/powerplay/hwmgr/ppatomfwctrl.h
drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c
drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.h

index a28192bfb03585b069422ddc16a065eea9225008..615cf2c09e54e73e55aa06e162426a97ba3474e9 100644 (file)
@@ -545,6 +545,9 @@ static void pp_atomfwctrl_copy_vbios_bootup_values_3_2(struct pp_hwmgr *hwmgr,
 
        if (!pp_atomfwctrl_get_clk_information_by_clkid(hwmgr, SMU11_SYSPLL0_DCLK_ID, SMU11_SYSPLL0_ID, &frequency))
                boot_values->ulDClk     = frequency;
+
+       if (!pp_atomfwctrl_get_clk_information_by_clkid(hwmgr, SMU11_SYSPLL1_0_FCLK_ID, SMU11_SYSPLL1_2_ID, &frequency))
+               boot_values->ulFClk     = frequency;
 }
 
 static void pp_atomfwctrl_copy_vbios_bootup_values_3_1(struct pp_hwmgr *hwmgr,
index 9bafd00324a9cec806766d358db1652816a5beb6..b7e2651b570bcfa2e13f83aa34a5ed2c3dd2428b 100644 (file)
@@ -139,6 +139,7 @@ struct pp_atomfwctrl_bios_boot_up_values {
        uint32_t   ulEClk;
        uint32_t   ulVClk;
        uint32_t   ulDClk;
+       uint32_t   ulFClk;
        uint16_t   usVddc;
        uint16_t   usVddci;
        uint16_t   usMvddc;
index ea79417958ecb96d20ce9710abf5c830ffd7c756..d7350bbadafa8d29bc3640689069a446457853fc 100644 (file)
@@ -711,8 +711,10 @@ static int vega20_setup_default_dpm_tables(struct pp_hwmgr *hwmgr)
                PP_ASSERT_WITH_CODE(!ret,
                                "[SetupDefaultDpmTable] failed to get fclk dpm levels!",
                                return ret);
-       } else
-               dpm_table->count = 0;
+       } else {
+               dpm_table->count = 1;
+               dpm_table->dpm_levels[0].value = data->vbios_boot_state.fclock / 100;
+       }
        vega20_init_dpm_state(&(dpm_table->dpm_state));
 
        /* save a copy of the default DPM table */
@@ -754,6 +756,7 @@ static int vega20_init_smc_table(struct pp_hwmgr *hwmgr)
        data->vbios_boot_state.eclock = boot_up_values.ulEClk;
        data->vbios_boot_state.vclock = boot_up_values.ulVClk;
        data->vbios_boot_state.dclock = boot_up_values.ulDClk;
+       data->vbios_boot_state.fclock = boot_up_values.ulFClk;
        data->vbios_boot_state.uc_cooling_id = boot_up_values.ucCoolingID;
 
        smum_send_msg_to_smc_with_parameter(hwmgr,
index 37f5f5e657da796a2610cc86d21e8170520405b7..4a4cad35dc8f23b7b5993e34ec0465040129c23c 100644 (file)
@@ -219,6 +219,7 @@ struct vega20_vbios_boot_state {
        uint32_t    eclock;
        uint32_t    dclock;
        uint32_t    vclock;
+       uint32_t    fclock;
 };
 
 #define DPMTABLE_OD_UPDATE_SCLK     0x00000001