Skip to contentSkip to conversation

drm/amd/powerplay: remove the support of xgmi pstate on vega20 from swsmu

PATCH In review Kevin Wang 2 participants 3 messages May 20, 2020

Subsystems (2)
lore
Share & tools
lore

Kevin Wang

author
#0 lore raw

PATCH 1/2 drm/amd/powerplay: remove the support of xgmi pstate on vega20 from swsmu

the vega20 asic uses legacy powerplay driver by default.

1. cleanup is_support_sw_smu_xgmi() function.
(ony use for vega20 xgmi pstate check)
2. by default, the vega20 set xgmi pstate by legacy powerplay routine.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.c        |  4 ++--
 drivers/gpu/drm/amd/powerplay/amdgpu_smu.c     | 11 -----------
 drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h |  1 -
 3 files changed, 2 insertions(+), 14 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.c +2 -2
index f36b58a7f485..65472b3dd815 100644
@@ -1162,7 +1162,7 @@ int amdgpu_dpm_set_xgmi_pstate(struct amdgpu_device *adev,
 {
 	int ret = 0;
 
-	if (is_support_sw_smu_xgmi(adev))
+	if (is_support_sw_smu(adev))
 		ret = smu_set_xgmi_pstate(&adev->smu, pstate);
 	else if (adev->powerplay.pp_funcs &&
 		 adev->powerplay.pp_funcs->set_xgmi_pstate)
@@ -1197,4 +1197,4 @@ int amdgpu_dpm_allow_xgmi_power_down(struct amdgpu_device *adev, bool en)
 		return smu_allow_xgmi_power_down(smu, en);
 
 	return 0;
-}
\ No newline at end of file
+}
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c +0 -11
index 1abc4be6b72e..9ad6f0f3aada 100644
@@ -575,17 +575,6 @@ bool is_support_sw_smu(struct amdgpu_device *adev)
 	return false;
 }
 
-bool is_support_sw_smu_xgmi(struct amdgpu_device *adev)
-{
-	if (!is_support_sw_smu(adev))
-		return false;
-
-	if (adev->asic_type == CHIP_VEGA20)
-		return true;
-
-	return false;
-}
-
 int smu_sys_get_pp_table(struct smu_context *smu, void **table)
 {
 	struct smu_table_context *smu_table = &smu->smu_table;
drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h +0 -1
index 4d1c2a44a8b6..bac7e13dc801 100644
@@ -675,7 +675,6 @@ int smu_update_table(struct smu_context *smu, enum smu_table_id table_index, int
 		     void *table_data, bool drv2smu);
 
 bool is_support_sw_smu(struct amdgpu_device *adev);
-bool is_support_sw_smu_xgmi(struct amdgpu_device *adev);
 int smu_reset(struct smu_context *smu);
 int smu_common_read_sensor(struct smu_context *smu, enum amd_pp_sensors sensor,
 			   void *data, uint32_t *size);
Signature · 6 lines
2.17.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
author
#1 lore raw

PATCH 2/2 drm/amd/powerplay: remove the support of vega20 from swsmu

by default, vega20 will use legacy powerplay driver. in order to maintain the code conveniently in the future, remove the support of vega20 from swsmu.

---
 drivers/gpu/drm/amd/powerplay/amdgpu_smu.c    |    9 +-
 drivers/gpu/drm/amd/powerplay/inc/smu_v11_0.h |    1 -
 drivers/gpu/drm/amd/powerplay/smu_v11_0.c     |    9 -
 drivers/gpu/drm/amd/powerplay/vega20_ppt.c    | 3288 -----------------
 drivers/gpu/drm/amd/powerplay/vega20_ppt.h    |  179 -
 5 files changed, 1 insertion(+), 3485 deletions(-)
 delete mode 100644 drivers/gpu/drm/amd/powerplay/vega20_ppt.c
 delete mode 100644 drivers/gpu/drm/amd/powerplay/vega20_ppt.h
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c +1 -8
index 9ad6f0f3aada..7894dd09c9f5 100644
@@ -29,7 +29,6 @@
 #include "smu_v11_0.h"
 #include "smu_v12_0.h"
 #include "atom.h"
-#include "vega20_ppt.h"
 #include "arcturus_ppt.h"
 #include "navi10_ppt.h"
 #include "renoir_ppt.h"
@@ -567,9 +566,7 @@ int smu_update_table(struct smu_context *smu, enum smu_table_id table_index, int
 
 bool is_support_sw_smu(struct amdgpu_device *adev)
 {
-	if (adev->asic_type == CHIP_VEGA20)
-		return (amdgpu_dpm == 2) ? true : false;
-	else if (adev->asic_type >= CHIP_ARCTURUS)
+	if (adev->asic_type >= CHIP_ARCTURUS)
 		return true;
 
 	return false;
@@ -759,10 +756,6 @@ static int smu_set_funcs(struct amdgpu_device *adev)
 		smu->od_enabled = true;
 
 	switch (adev->asic_type) {
-	case CHIP_VEGA20:
-		adev->pm.pp_feature &= ~PP_GFXOFF_MASK;
-		vega20_set_ppt_funcs(smu);
-		break;
 	case CHIP_NAVI10:
 	case CHIP_NAVI14:
 	case CHIP_NAVI12:
drivers/gpu/drm/amd/powerplay/inc/smu_v11_0.h +0 -1
index 6b3b451a8018..5c6bfe76d596 100644
@@ -26,7 +26,6 @@
 #include "amdgpu_smu.h"
 
 #define SMU11_DRIVER_IF_VERSION_INV 0xFFFFFFFF
-#define SMU11_DRIVER_IF_VERSION_VG20 0x13
 #define SMU11_DRIVER_IF_VERSION_ARCT 0x14
 #define SMU11_DRIVER_IF_VERSION_NV10 0x36
 #define SMU11_DRIVER_IF_VERSION_NV12 0x33
drivers/gpu/drm/amd/powerplay/smu_v11_0.c +0 -9
index b6a7467260a6..960360918e7a 100644
@@ -46,7 +46,6 @@
 #include "asic_reg/smuio/smuio_11_0_0_offset.h"
 #include "asic_reg/smuio/smuio_11_0_0_sh_mask.h"
 
-MODULE_FIRMWARE("amdgpu/vega20_smc.bin");
 MODULE_FIRMWARE("amdgpu/arcturus_smc.bin");
 MODULE_FIRMWARE("amdgpu/navi10_smc.bin");
 MODULE_FIRMWARE("amdgpu/navi14_smc.bin");
@@ -148,9 +147,6 @@ int smu_v11_0_init_microcode(struct smu_context *smu)
 	struct amdgpu_firmware_info *ucode = NULL;
 
 	switch (adev->asic_type) {
-	case CHIP_VEGA20:
-		chip_name = "vega20";
-		break;
 	case CHIP_ARCTURUS:
 		chip_name = "arcturus";
 		break;
@@ -270,9 +266,6 @@ int smu_v11_0_check_fw_version(struct smu_context *smu)
 	smu_debug = (smu_version >> 0) & 0xff;
 
 	switch (smu->adev->asic_type) {
-	case CHIP_VEGA20:
-		smu->smc_driver_if_version = SMU11_DRIVER_IF_VERSION_VG20;
-		break;
 	case CHIP_ARCTURUS:
 		smu->smc_driver_if_version = SMU11_DRIVER_IF_VERSION_ARCT;
 		break;
@@ -1364,8 +1357,6 @@ int smu_v11_0_gfx_off_control(struct smu_context *smu, bool enable)
 	struct amdgpu_device *adev = smu->adev;
 
 	switch (adev->asic_type) {
-	case CHIP_VEGA20:
-		break;
 	case CHIP_NAVI10:
 	case CHIP_NAVI14:
 	case CHIP_NAVI12:
drivers/gpu/drm/amd/powerplay/vega20_ppt.c deleted +0 -3288

2,933 lines not on this page · raw message

drivers/gpu/drm/amd/powerplay/vega20_ppt.h deleted +0 -179

179 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 6 lines
2.17.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Part of the diff is not shown here. View the raw message.

maintainer Reviewed-by on v1 1/2
#2 lore raw
In reply to Kevin Wang

[AMD Public Use]

Series is:

________________________________
From: Wang, Kevin(Yang) <[email protected]>
Sent: Tuesday, May 19, 2020 11:50 PM
To: [email protected] <[email protected]>
Cc: Zhang, Hawking <[email protected]>; Deucher, Alexander <[email protected]>; Wang, Kevin(Yang) <[email protected]>
Subject: [PATCH 1/2] drm/amd/powerplay: remove the support of xgmi pstate on vega20 from swsmu

the vega20 asic uses legacy powerplay driver by default.

1. cleanup is_support_sw_smu_xgmi() function.
(ony use for vega20 xgmi pstate check)
2. by default, the vega20 set xgmi pstate by legacy powerplay routine.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.c        |  4 ++--
 drivers/gpu/drm/amd/powerplay/amdgpu_smu.c     | 11 -----------
 drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h |  1 -
 3 files changed, 2 insertions(+), 14 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.c +2 -2
index f36b58a7f485..65472b3dd815 100644
@@ -1162,7 +1162,7 @@ int amdgpu_dpm_set_xgmi_pstate(struct amdgpu_device *adev,
 {
         int ret = 0;
 
-       if (is_support_sw_smu_xgmi(adev))
+       if (is_support_sw_smu(adev))
                 ret = smu_set_xgmi_pstate(&adev->smu, pstate);
         else if (adev->powerplay.pp_funcs &&
                  adev->powerplay.pp_funcs->set_xgmi_pstate)
@@ -1197,4 +1197,4 @@ int amdgpu_dpm_allow_xgmi_power_down(struct amdgpu_device *adev, bool en)
                 return smu_allow_xgmi_power_down(smu, en);
 
         return 0;
-}
\ No newline at end of file
+}
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c +0 -11
index 1abc4be6b72e..9ad6f0f3aada 100644
@@ -575,17 +575,6 @@ bool is_support_sw_smu(struct amdgpu_device *adev)
         return false;
 }
 
-bool is_support_sw_smu_xgmi(struct amdgpu_device *adev)
-{
-       if (!is_support_sw_smu(adev))
-               return false;
-
-       if (adev->asic_type == CHIP_VEGA20)
-               return true;
-
-       return false;
-}
-
 int smu_sys_get_pp_table(struct smu_context *smu, void **table)
 {
         struct smu_table_context *smu_table = &smu->smu_table;
drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h +0 -1
index 4d1c2a44a8b6..bac7e13dc801 100644
@@ -675,7 +675,6 @@ int smu_update_table(struct smu_context *smu, enum smu_table_id table_index, int
                      void *table_data, bool drv2smu);
 
 bool is_support_sw_smu(struct amdgpu_device *adev);
-bool is_support_sw_smu_xgmi(struct amdgpu_device *adev);
 int smu_reset(struct smu_context *smu);
 int smu_common_read_sensor(struct smu_context *smu, enum amd_pp_sensors sensor,
                            void *data, uint32_t *size);

--
2.17.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx