Skip to contentSkip to conversation

drm/amdgpu/pm: add VCN activity for renoir

PATCH In review Alex Deucher 3 participants 9 messages Mar 11, 2025 – Mar 12, 2025

Subsystems (3)
lore
Share & tools
lore

Alex Deucher

author maintainer
#0 lore raw

PATCH 1/6 drm/amdgpu/pm: add VCN activity for renoir

Wire up the query.

---
 drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c +6 -0
index 37d82a71a2d7c..9481f897432d7 100644
@@ -1285,6 +1285,12 @@ static int renoir_read_sensor(struct smu_context *smu,
 						  (uint32_t *)data);
 		*size = 4;
 		break;
+	case AMDGPU_PP_SENSOR_VCN_LOAD:
+		ret = renoir_get_smu_metrics_data(smu,
+						  METRICS_AVERAGE_VCNACTIVITY,
+						  (uint32_t *)data);
+		*size = 4;
+		break;
 	case AMDGPU_PP_SENSOR_EDGE_TEMP:
 		ret = renoir_get_smu_metrics_data(smu,
 						  METRICS_TEMPERATURE_EDGE,
Signature · 1 line
2.48.1
author maintainer
#1 lore raw

PATCH 2/6 drm/amdgpu/pm: add VCN activity for SMU 13.0.0/7

Wire up the query.

---
 drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c | 10 ++++++++++
 drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c | 10 ++++++++++
 2 files changed, 20 insertions(+)
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c +10 -0
index 898487ad6cd2e..5a9711e8cf689 100644
@@ -836,6 +836,10 @@ static int smu_v13_0_0_get_smu_metrics_data(struct smu_context *smu,
 	case METRICS_AVERAGE_MEMACTIVITY:
 		*value = metrics->AverageUclkActivity;
 		break;
+	case METRICS_AVERAGE_VCNACTIVITY:
+		*value = max(metrics->Vcn0ActivityPercentage,
+			     metrics->Vcn1ActivityPercentage);
+		break;
 	case METRICS_AVERAGE_SOCKETPOWER:
 		*value = metrics->AverageSocketPower << 8;
 		break;
@@ -962,6 +966,12 @@ static int smu_v13_0_0_read_sensor(struct smu_context *smu,
 						       (uint32_t *)data);
 		*size = 4;
 		break;
+	case AMDGPU_PP_SENSOR_VCN_LOAD:
+		ret = smu_v13_0_0_get_smu_metrics_data(smu,
+						       METRICS_AVERAGE_VCNACTIVITY,
+						       (uint32_t *)data);
+		*size = 4;
+		break;
 	case AMDGPU_PP_SENSOR_GPU_AVG_POWER:
 		ret = smu_v13_0_0_get_smu_metrics_data(smu,
 						       METRICS_AVERAGE_SOCKETPOWER,
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c +10 -0
index 19f47811f6db2..c8f4f6fb40834 100644
@@ -807,6 +807,10 @@ static int smu_v13_0_7_get_smu_metrics_data(struct smu_context *smu,
 		else
 			*value = metrics->AverageMemclkFrequencyPreDs;
 		break;
+	case METRICS_AVERAGE_VCNACTIVITY:
+		*value = max(metrics->Vcn0ActivityPercentage,
+			     metrics->Vcn1ActivityPercentage);
+		break;
 	case METRICS_AVERAGE_VCLK:
 		*value = metrics->AverageVclk0Frequency;
 		break;
@@ -951,6 +955,12 @@ static int smu_v13_0_7_read_sensor(struct smu_context *smu,
 						       (uint32_t *)data);
 		*size = 4;
 		break;
+	case AMDGPU_PP_SENSOR_VCN_LOAD:
+		ret = smu_v13_0_7_get_smu_metrics_data(smu,
+						       METRICS_AVERAGE_VCNACTIVITY,
+						       (uint32_t *)data);
+		*size = 4;
+		break;
 	case AMDGPU_PP_SENSOR_GPU_AVG_POWER:
 		ret = smu_v13_0_7_get_smu_metrics_data(smu,
 						       METRICS_AVERAGE_SOCKETPOWER,
Signature · 1 line
2.48.1
author maintainer
#2 lore raw

PATCH 3/6 drm/amdgpu/pm: add VCN activity for SMU 14.0.2

In reply to Alex Deucher

Wire up the query.

---
 drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_2_ppt.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_2_ppt.c +10 -0
index e4089fd58711c..21d1b34ada053 100644
@@ -756,6 +756,10 @@ static int smu_v14_0_2_get_smu_metrics_data(struct smu_context *smu,
 	case METRICS_AVERAGE_MEMACTIVITY:
 		*value = metrics->AverageUclkActivity;
 		break;
+	case METRICS_AVERAGE_VCNACTIVITY:
+		*value = max(metrics->AverageVcn0ActivityPercentage,
+			     metrics->Vcn1ActivityPercentage);
+		break;
 	case METRICS_AVERAGE_SOCKETPOWER:
 		*value = metrics->AverageSocketPower << 8;
 		break;
@@ -882,6 +886,12 @@ static int smu_v14_0_2_read_sensor(struct smu_context *smu,
 						       (uint32_t *)data);
 		*size = 4;
 		break;
+	case AMDGPU_PP_SENSOR_VCN_LOAD:
+		ret = smu_v14_0_2_get_smu_metrics_data(smu,
+						       METRICS_AVERAGE_VCNACTIVITY,
+						       (uint32_t *)data);
+		*size = 4;
+		break;
 	case AMDGPU_PP_SENSOR_GPU_AVG_POWER:
 		ret = smu_v14_0_2_get_smu_metrics_data(smu,
 						       METRICS_AVERAGE_SOCKETPOWER,
Signature · 1 line
2.48.1
author maintainer
#3 lore raw

PATCH 4/6 drm/amdgpu/pm: enable vcn busy sysfs for additional GC 11.x

In reply to Alex Deucher

Make it visible for the all GC 11.x chips that support it.

---
 drivers/gpu/drm/amd/pm/amdgpu_pm.c | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/pm/amdgpu_pm.c +12 -6
index e463f7a739988..bb39e7f83341b 100644
@@ -2315,12 +2315,18 @@ static int default_attr_update(struct amdgpu_device *adev, struct amdgpu_device_
 			*states = ATTR_STATE_UNSUPPORTED;
 	} else if (DEVICE_ATTR_IS(vcn_busy_percent)) {
 		if (!(gc_ver == IP_VERSION(10, 3, 1) ||
-			  gc_ver == IP_VERSION(10, 3, 3) ||
-			  gc_ver == IP_VERSION(10, 3, 6) ||
-			  gc_ver == IP_VERSION(10, 3, 7) ||
-			  gc_ver == IP_VERSION(11, 0, 1) ||
-			  gc_ver == IP_VERSION(11, 0, 4) ||
-			  gc_ver == IP_VERSION(11, 5, 0)))
+		      gc_ver == IP_VERSION(10, 3, 3) ||
+		      gc_ver == IP_VERSION(10, 3, 6) ||
+		      gc_ver == IP_VERSION(10, 3, 7) ||
+		      gc_ver == IP_VERSION(11, 0, 0) ||
+		      gc_ver == IP_VERSION(11, 0, 1) ||
+		      gc_ver == IP_VERSION(11, 0, 2) ||
+		      gc_ver == IP_VERSION(11, 0, 3) ||
+		      gc_ver == IP_VERSION(11, 0, 4) ||
+		      gc_ver == IP_VERSION(11, 5, 0) ||
+		      gc_ver == IP_VERSION(11, 5, 1) ||
+		      gc_ver == IP_VERSION(11, 5, 2) ||
+		      gc_ver == IP_VERSION(11, 5, 3)))
 			*states = ATTR_STATE_UNSUPPORTED;
 	} else if (DEVICE_ATTR_IS(pcie_bw)) {
 		/* PCIe Perf counters won't work on APU nodes */
Signature · 1 line
2.48.1
author maintainer
#4 lore raw

PATCH 5/6 drm/amdgpu/pm: enable vcn busy sysfs for GC 12.x

In reply to Alex Deucher

Make it visible for the all GC 12.x chips that support it.

---
 drivers/gpu/drm/amd/pm/amdgpu_pm.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/pm/amdgpu_pm.c +3 -1
index bb39e7f83341b..c5abf4eacbfcd 100644
@@ -2326,7 +2326,9 @@ static int default_attr_update(struct amdgpu_device *adev, struct amdgpu_device_
 		      gc_ver == IP_VERSION(11, 5, 0) ||
 		      gc_ver == IP_VERSION(11, 5, 1) ||
 		      gc_ver == IP_VERSION(11, 5, 2) ||
-		      gc_ver == IP_VERSION(11, 5, 3)))
+		      gc_ver == IP_VERSION(11, 5, 3) ||
+		      gc_ver == IP_VERSION(12, 0, 0) ||
+		      gc_ver == IP_VERSION(12, 0, 1)))
 			*states = ATTR_STATE_UNSUPPORTED;
 	} else if (DEVICE_ATTR_IS(pcie_bw)) {
 		/* PCIe Perf counters won't work on APU nodes */
Signature · 1 line
2.48.1
author maintainer
#5 lore raw

PATCH 6/6 drm/amdgpu/pm: enable vcn busy sysfs for GC 9.3.0

In reply to Alex Deucher

Make it visible for the all GC 9.3.0 chips that support it.

---
 drivers/gpu/drm/amd/pm/amdgpu_pm.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/pm/amdgpu_pm.c +2 -1
index c5abf4eacbfcd..3ff9750baa0c3 100644
@@ -2314,7 +2314,8 @@ static int default_attr_update(struct amdgpu_device *adev, struct amdgpu_device_
 		    gc_ver == IP_VERSION(9, 0, 1))
 			*states = ATTR_STATE_UNSUPPORTED;
 	} else if (DEVICE_ATTR_IS(vcn_busy_percent)) {
-		if (!(gc_ver == IP_VERSION(10, 3, 1) ||
+		if (!(gc_ver == IP_VERSION(9, 3, 0) ||
+		      gc_ver == IP_VERSION(10, 3, 1) ||
 		      gc_ver == IP_VERSION(10, 3, 3) ||
 		      gc_ver == IP_VERSION(10, 3, 6) ||
 		      gc_ver == IP_VERSION(10, 3, 7) ||
Signature · 1 line
2.48.1
maintainer
#6 lore raw
In reply to Alex Deucher

[AMD Official Use Only - AMD Internal Distribution Only]

Series is Reviewed-by: Kenneth Feng <[email protected]>

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Alex Deucher
Sent: Wednesday, March 12, 2025 4:45 AM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>
Subject: [PATCH 1/6] drm/amdgpu/pm: add VCN activity for renoir

Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.

Wire up the query.

---
 drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c +6 -0
index 37d82a71a2d7c..9481f897432d7 100644
@@ -1285,6 +1285,12 @@ static int renoir_read_sensor(struct smu_context *smu,
                                                  (uint32_t *)data);
                *size = 4;
                break;
+       case AMDGPU_PP_SENSOR_VCN_LOAD:
+               ret = renoir_get_smu_metrics_data(smu,
+                                                 METRICS_AVERAGE_VCNACTIVITY,
+                                                 (uint32_t *)data);
+               *size = 4;
+               break;
        case AMDGPU_PP_SENSOR_EDGE_TEMP:
                ret = renoir_get_smu_metrics_data(smu,
                                                  METRICS_TEMPERATURE_EDGE,

--
2.48.1

Reviewed-by on v1 1/6
#7 lore raw
In reply to Alex Deucher
Quoted 3 lines · Alex Deucher

Wire up the query.

Series is -

Thanks,
Lijo

Quoted 21 lines
---
 drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c +6 -0
index 37d82a71a2d7c..9481f897432d7 100644
@@ -1285,6 +1285,12 @@ static int renoir_read_sensor(struct smu_context *smu,
 						  (uint32_t *)data);
 		*size = 4;
 		break;
+	case AMDGPU_PP_SENSOR_VCN_LOAD:
+		ret = renoir_get_smu_metrics_data(smu,
+						  METRICS_AVERAGE_VCNACTIVITY,
+						  (uint32_t *)data);
+		*size = 4;
+		break;
 	case AMDGPU_PP_SENSOR_EDGE_TEMP:
 		ret = renoir_get_smu_metrics_data(smu,
 						  METRICS_TEMPERATURE_EDGE,
Reviewed-by on v1 1/6
#8 lore raw
In reply to Alex Deucher
Quoted 3 lines · Alex Deucher

Wire up the query.

Series is -

Thanks,
Lijo

Quoted 21 lines
---
 drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c +6 -0
index 37d82a71a2d7c..9481f897432d7 100644
@@ -1285,6 +1285,12 @@ static int renoir_read_sensor(struct smu_context *smu,
 						  (uint32_t *)data);
 		*size = 4;
 		break;
+	case AMDGPU_PP_SENSOR_VCN_LOAD:
+		ret = renoir_get_smu_metrics_data(smu,
+						  METRICS_AVERAGE_VCNACTIVITY,
+						  (uint32_t *)data);
+		*size = 4;
+		break;
 	case AMDGPU_PP_SENSOR_EDGE_TEMP:
 		ret = renoir_get_smu_metrics_data(smu,
 						  METRICS_TEMPERATURE_EDGE,