Skip to contentSkip to conversation

drm/amd/swsmu: modify the gfx activity scaling

PATCH In review Li Ma 3 participants 3 messages Feb 28, 2024 – Feb 29, 2024

Subsystems (3)
lore
Share & tools
lore

Li Ma

author
#0 lore raw

PATCH 1/1 drm/amd/swsmu: modify the gfx activity scaling

Add an if condition for gfx activity because the scaling has been changed after smu fw version 5d4600. And remove a warning log.

---
 drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0.c       | 2 --
 drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_0_ppt.c | 5 ++++-
 2 files changed, 4 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0.c +0 -2
index 2aa7e9945a0b..7ac9bc0df8fd 100644
@@ -229,8 +229,6 @@ int smu_v14_0_check_fw_version(struct smu_context *smu)
 		smu->smc_driver_if_version = SMU14_DRIVER_IF_VERSION_SMU_V14_0_2;
 		break;
 	case IP_VERSION(14, 0, 0):
-		if ((smu->smc_fw_version < 0x5d3a00))
-			dev_warn(smu->adev->dev, "The PMFW version(%x) is behind in this BIOS!\n", smu->smc_fw_version);
 		smu->smc_driver_if_version = SMU14_DRIVER_IF_VERSION_SMU_V14_0_0;
 		break;
 	default:
drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_0_ppt.c +4 -1
index 47fdbae4adfc..9310c4758e38 100644
@@ -261,7 +261,10 @@ static int smu_v14_0_0_get_smu_metrics_data(struct smu_context *smu,
 		*value = metrics->MpipuclkFrequency;
 		break;
 	case METRICS_AVERAGE_GFXACTIVITY:
-		*value = metrics->GfxActivity / 100;
+		if ((smu->smc_fw_version > 0x5d4600))
+			*value = metrics->GfxActivity;
+		else
+			*value = metrics->GfxActivity / 100;
 		break;
 	case METRICS_AVERAGE_VCNACTIVITY:
 		*value = metrics->VcnActivity / 100;
Signature · 1 line
2.25.1
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Li Ma

Add an if condition for gfx activity because the scaling has been changed after smu fw version 5d4600. And remove a warning log.

Quoted 37 lines
---
 drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0.c       | 2 --
 drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_0_ppt.c | 5 ++++-
 2 files changed, 4 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0.c +0 -2
index 2aa7e9945a0b..7ac9bc0df8fd 100644
@@ -229,8 +229,6 @@ int smu_v14_0_check_fw_version(struct smu_context *smu)
                smu->smc_driver_if_version = SMU14_DRIVER_IF_VERSION_SMU_V14_0_2;
                break;
        case IP_VERSION(14, 0, 0):
-               if ((smu->smc_fw_version < 0x5d3a00))
-                       dev_warn(smu->adev->dev, "The PMFW version(%x) is behind in this BIOS!\n", smu->smc_fw_version);
                smu->smc_driver_if_version = SMU14_DRIVER_IF_VERSION_SMU_V14_0_0;
                break;
        default:
drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_0_ppt.c +4 -2
index 47fdbae4adfc..9310c4758e38 100644
@@ -261,7 +261,10 @@ static int smu_v14_0_0_get_smu_metrics_data(struct smu_context *smu,
                *value = metrics->MpipuclkFrequency;
                break;
        case METRICS_AVERAGE_GFXACTIVITY:
-               *value = metrics->GfxActivity / 100;
+               if ((smu->smc_fw_version > 0x5d4600))
+                       *value = metrics->GfxActivity;
+               else
+                       *value = metrics->GfxActivity / 100;
                break;
        case METRICS_AVERAGE_VCNACTIVITY:
                *value = metrics->VcnActivity / 100;
--

2.25.1

Reviewed-by Acked-by Alex Deucher
#2 lore raw

[AMD Official Use Only - General]

-----Original Message-----
From: Alex Deucher <[email protected]>
Sent: Wednesday, February 28, 2024 10:25 PM
To: Ma, Li <[email protected]>
Cc: [email protected]; Deucher, Alexander <[email protected]>; Zhang, Yifan <[email protected]>; Yu, Lang <[email protected]>
Subject: Re: [PATCH] drm/amd/swsmu: modify the gfx activity scaling

Quoted 5 lines · Li Ma

Add an if condition for gfx activity because the scaling has been changed after smu fw version 5d4600. And remove a warning log.

Quoted 37 lines
---
 drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0.c       | 2 --
 drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_0_ppt.c | 5 ++++-
 2 files changed, 4 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0.c +0 -2
index 2aa7e9945a0b..7ac9bc0df8fd 100644
@@ -229,8 +229,6 @@ int smu_v14_0_check_fw_version(struct smu_context *smu)
                smu->smc_driver_if_version = SMU14_DRIVER_IF_VERSION_SMU_V14_0_2;
                break;
        case IP_VERSION(14, 0, 0):
-               if ((smu->smc_fw_version < 0x5d3a00))
-                       dev_warn(smu->adev->dev, "The PMFW version(%x) is behind in this BIOS!\n", smu->smc_fw_version);
                smu->smc_driver_if_version = SMU14_DRIVER_IF_VERSION_SMU_V14_0_0;
                break;
        default:
drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_0_ppt.c +4 -2
index 47fdbae4adfc..9310c4758e38 100644
@@ -261,7 +261,10 @@ static int smu_v14_0_0_get_smu_metrics_data(struct smu_context *smu,
                *value = metrics->MpipuclkFrequency;
                break;
        case METRICS_AVERAGE_GFXACTIVITY:
-               *value = metrics->GfxActivity / 100;
+               if ((smu->smc_fw_version > 0x5d4600))
+                       *value = metrics->GfxActivity;
+               else
+                       *value = metrics->GfxActivity / 100;
                break;
        case METRICS_AVERAGE_VCNACTIVITY:
                *value = metrics->VcnActivity / 100;
--

2.25.1