Merge tag 'drm-next-2020-12-24' of git://anongit.freedesktop.org/drm/drm
[linux-2.6-microblaze.git] / drivers / gpu / drm / amd / pm / swsmu / smu11 / vangogh_ppt.c
index a81e5c8..8cb4fce 100644 (file)
@@ -64,7 +64,7 @@ static struct cmn2asic_msg_mapping vangogh_message_map[SMU_MSG_MAX_COUNT] = {
        MSG_MAP(PowerUpIspByTile,               PPSMC_MSG_PowerUpIspByTile,             0),
        MSG_MAP(PowerDownVcn,                   PPSMC_MSG_PowerDownVcn,                 0),
        MSG_MAP(PowerUpVcn,                     PPSMC_MSG_PowerUpVcn,                   0),
-       MSG_MAP(Spare,                          PPSMC_MSG_spare,                                0),
+       MSG_MAP(RlcPowerNotify,                 PPSMC_MSG_RlcPowerNotify,               0),
        MSG_MAP(SetHardMinVcn,                  PPSMC_MSG_SetHardMinVcn,                0),
        MSG_MAP(SetSoftMinGfxclk,               PPSMC_MSG_SetSoftMinGfxclk,             0),
        MSG_MAP(ActiveProcessNotify,            PPSMC_MSG_ActiveProcessNotify,          0),
@@ -722,6 +722,17 @@ static int vangogh_set_fine_grain_gfx_freq_parameters(struct smu_context *smu)
        return 0;
 }
 
+static int vangogh_system_features_control(struct smu_context *smu, bool en)
+{
+       struct amdgpu_device *adev = smu->adev;
+
+       if (adev->pm.fw_version >= 0x43f1700)
+               return smu_cmn_send_smc_msg_with_param(smu, SMU_MSG_RlcPowerNotify,
+                                               en ? RLC_STATUS_NORMAL : RLC_STATUS_OFF, NULL);
+       else
+               return 0;
+}
+
 static const struct pptable_funcs vangogh_ppt_funcs = {
 
        .check_fw_status = smu_v11_0_check_fw_status,
@@ -749,6 +760,7 @@ static const struct pptable_funcs vangogh_ppt_funcs = {
        .print_clk_levels = vangogh_print_fine_grain_clk,
        .set_default_dpm_table = vangogh_set_default_dpm_tables,
        .set_fine_grain_gfx_freq_parameters = vangogh_set_fine_grain_gfx_freq_parameters,
+       .system_features_control = vangogh_system_features_control,
 };
 
 void vangogh_set_ppt_funcs(struct smu_context *smu)