[PATCH V2 6/7] drm/amd/pm: move SMU13.0.10 related pptable settings to smu_v13_0_0_ppt.c

Evan Quan evan.quan at amd.com
Mon Sep 19 02:02:50 UTC 2022


SMU13.0.10 shares the same implementation with SMU13.0.0.

Signed-off-by: Evan Quan <evan.quan at amd.com>
Change-Id: Ic3720ee8fd05f75f39e4e9242fc4c57d92efd6b2
---
 drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c          | 12 ++----------
 .../gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c   | 14 ++++++++++++--
 2 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
index 24be318adf7a..1c354321630a 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
@@ -1026,16 +1026,8 @@ static void smu_interrupt_work_fn(struct work_struct *work)
 
 static void smu_pptable_source_init(struct smu_context *smu)
 {
-	switch (smu->adev->ip_versions[MP1_HWIP][0]) {
-	case IP_VERSION(13, 0, 10):
-		smu->pptable_source = PPTABLE_SOURCE_INTERNAL_HARDCOPY;
-		smu->pptable_id = 6666;
-		break;
-	default:
-		smu->pptable_source = PPTABLE_SOURCE_VBIOS;
-		smu->pptable_id = smu->smu_table.boot_values.pp_table_id;
-		break;
-	}
+	smu->pptable_source = PPTABLE_SOURCE_VBIOS;
+	smu->pptable_id = smu->smu_table.boot_values.pp_table_id;
 
 	if (smu->ppt_funcs && smu->ppt_funcs->pptable_source_init)
 		smu->ppt_funcs->pptable_source_init(smu);
diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c
index fd405e2420cd..18b02b99ee95 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c
@@ -1758,8 +1758,18 @@ static int smu_v13_0_0_set_mp1_state(struct smu_context *smu,
 
 static void smu_v13_0_0_pptable_source_init(struct smu_context *smu)
 {
-	smu->pptable_source = PPTABLE_SOURCE_PMFW;
-	smu->pptable_id = smu->smu_table.boot_values.pp_table_id;
+	switch (smu->adev->ip_versions[MP1_HWIP][0]) {
+	case IP_VERSION(13, 0, 0):
+		smu->pptable_source = PPTABLE_SOURCE_PMFW;
+		smu->pptable_id = smu->smu_table.boot_values.pp_table_id;
+		break;
+	case IP_VERSION(13, 0, 10):
+		smu->pptable_source = PPTABLE_SOURCE_INTERNAL_HARDCOPY;
+		smu->pptable_id = 6666;
+		break;
+	default:
+		break;
+	}
 }
 
 static const struct pptable_funcs smu_v13_0_0_ppt_funcs = {
-- 
2.34.1



More information about the amd-gfx mailing list