drm/amd/pm: enable the support for retrieving combo pptable
authorEvan Quan <evan.quan@amd.com>
Wed, 6 Apr 2022 22:00:16 +0000 (18:00 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 4 May 2022 13:58:33 +0000 (09:58 -0400)
We need to relay on this way to get the raw PPTable when
SCPM feature is enabled.

Signed-off-by: Evan Quan <evan.quan@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h
drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c
drivers/gpu/drm/amd/pm/swsmu/smu_cmn.h

index 491357321020364e3c5f725bdd7dce0423b3c5e9..49d2c0eb014d5e65d8b2f4ebe7cccf1947da61eb 100644 (file)
@@ -321,6 +321,7 @@ enum smu_table_id
        SMU_TABLE_I2C_COMMANDS,
        SMU_TABLE_PACE,
        SMU_TABLE_ECCINFO,
+       SMU_TABLE_COMBO_PPTABLE,
        SMU_TABLE_COUNT,
 };
 
@@ -336,7 +337,8 @@ struct smu_table_context
 
        void                            *max_sustainable_clocks;
        struct smu_bios_boot_up_values  boot_values;
-       void                            *driver_pptable;
+       void                            *driver_pptable;
+       void                            *combo_pptable;
        void                            *ecc_table;
        void                            *driver_smu_config_table;
        struct smu_table                tables[SMU_TABLE_COUNT];
index f12319883a80e0b5443867187228105a930e77f1..622881ab34c7948c4186b782ed244b7f8d1d7a4d 100644 (file)
@@ -971,6 +971,17 @@ int smu_cmn_get_metrics_table(struct smu_context *smu,
        return 0;
 }
 
+int smu_cmn_get_combo_pptable(struct smu_context *smu)
+{
+       void *pptable = smu->smu_table.combo_pptable;
+
+       return smu_cmn_update_table(smu,
+                                   SMU_TABLE_COMBO_PPTABLE,
+                                   0,
+                                   pptable,
+                                   false);
+}
+
 void smu_cmn_init_soft_gpu_metrics(void *table, uint8_t frev, uint8_t crev)
 {
        struct metrics_table_header *header = (struct metrics_table_header *)table;
index a4c593ed8b0341f45647a34271379a66dd3cf98a..1526ce09c399b529bd2722798d37ee29d4981b44 100644 (file)
@@ -99,6 +99,8 @@ int smu_cmn_get_metrics_table(struct smu_context *smu,
                              void *metrics_table,
                              bool bypass_cache);
 
+int smu_cmn_get_combo_pptable(struct smu_context *smu);
+
 void smu_cmn_init_soft_gpu_metrics(void *table, uint8_t frev, uint8_t crev);
 
 int smu_cmn_set_mp1_state(struct smu_context *smu,