]> www.infradead.org Git - users/hch/configfs.git/commitdiff
drm/amd/pm: always pick the pptable from IFWI
authorKenneth Feng <kenneth.feng@amd.com>
Fri, 1 Nov 2024 03:55:25 +0000 (11:55 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 4 Nov 2024 17:48:51 +0000 (12:48 -0500)
always pick the pptable from IFWI on smu v14.0.2/3

Signed-off-by: Kenneth Feng <kenneth.feng@amd.com>
Reviewed-by: Yang Wang <kevinyang.wang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 136ce12bd5907388cb4e9aa63ee5c9c8c441640b)
Cc: stable@vger.kernel.org # 6.11.x
drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_2_ppt.c

index e83ea2bc7f9c4ecf6e0e925572f13b045eb71564..1e16a281f2dcde29ffb028740b6ed6a43852f4f6 100644 (file)
@@ -367,54 +367,6 @@ static int smu_v14_0_2_store_powerplay_table(struct smu_context *smu)
        return 0;
 }
 
-#ifndef atom_smc_dpm_info_table_14_0_0
-struct atom_smc_dpm_info_table_14_0_0 {
-       struct atom_common_table_header table_header;
-       BoardTable_t BoardTable;
-};
-#endif
-
-static int smu_v14_0_2_append_powerplay_table(struct smu_context *smu)
-{
-       struct smu_table_context *table_context = &smu->smu_table;
-       PPTable_t *smc_pptable = table_context->driver_pptable;
-       struct atom_smc_dpm_info_table_14_0_0 *smc_dpm_table;
-       BoardTable_t *BoardTable = &smc_pptable->BoardTable;
-       int index, ret;
-
-       index = get_index_into_master_table(atom_master_list_of_data_tables_v2_1,
-                                           smc_dpm_info);
-
-       ret = amdgpu_atombios_get_data_table(smu->adev, index, NULL, NULL, NULL,
-                                            (uint8_t **)&smc_dpm_table);
-       if (ret)
-               return ret;
-
-       memcpy(BoardTable, &smc_dpm_table->BoardTable, sizeof(BoardTable_t));
-
-       return 0;
-}
-
-#if 0
-static int smu_v14_0_2_get_pptable_from_pmfw(struct smu_context *smu,
-                                            void **table,
-                                            uint32_t *size)
-{
-       struct smu_table_context *smu_table = &smu->smu_table;
-       void *combo_pptable = smu_table->combo_pptable;
-       int ret = 0;
-
-       ret = smu_cmn_get_combo_pptable(smu);
-       if (ret)
-               return ret;
-
-       *table = combo_pptable;
-       *size = sizeof(struct smu_14_0_powerplay_table);
-
-       return 0;
-}
-#endif
-
 static int smu_v14_0_2_get_pptable_from_pmfw(struct smu_context *smu,
                                             void **table,
                                             uint32_t *size)
@@ -436,16 +388,12 @@ static int smu_v14_0_2_get_pptable_from_pmfw(struct smu_context *smu,
 static int smu_v14_0_2_setup_pptable(struct smu_context *smu)
 {
        struct smu_table_context *smu_table = &smu->smu_table;
-       struct amdgpu_device *adev = smu->adev;
        int ret = 0;
 
        if (amdgpu_sriov_vf(smu->adev))
                return 0;
 
-       if (!adev->scpm_enabled)
-               ret = smu_v14_0_setup_pptable(smu);
-       else
-               ret = smu_v14_0_2_get_pptable_from_pmfw(smu,
+       ret = smu_v14_0_2_get_pptable_from_pmfw(smu,
                                                        &smu_table->power_play_table,
                                                        &smu_table->power_play_table_size);
        if (ret)
@@ -455,16 +403,6 @@ static int smu_v14_0_2_setup_pptable(struct smu_context *smu)
        if (ret)
                return ret;
 
-       /*
-        * With SCPM enabled, the operation below will be handled
-        * by PSP. Driver involvment is unnecessary and useless.
-        */
-       if (!adev->scpm_enabled) {
-               ret = smu_v14_0_2_append_powerplay_table(smu);
-               if (ret)
-                       return ret;
-       }
-
        ret = smu_v14_0_2_check_powerplay_table(smu);
        if (ret)
                return ret;
@@ -2799,7 +2737,6 @@ static const struct pptable_funcs smu_v14_0_2_ppt_funcs = {
        .check_fw_status = smu_v14_0_check_fw_status,
        .setup_pptable = smu_v14_0_2_setup_pptable,
        .check_fw_version = smu_v14_0_check_fw_version,
-       .write_pptable = smu_cmn_write_pptable,
        .set_driver_table_location = smu_v14_0_set_driver_table_location,
        .system_features_control = smu_v14_0_system_features_control,
        .set_allowed_mask = smu_v14_0_set_allowed_mask,