Skip to contentSkip to conversation

drm/amd/powerplay: support uclk activity retrieve on sw smu routine

PATCH In review Evan Quan 2 participants 3 messages May 14, 2019 2 messages not in the archive

Subsystems (2)
lore
Share & tools
lore

Evan Quan

author
#0 lore raw

PATCH 1/2 drm/amd/powerplay: support uclk activity retrieve on sw smu routine

Support realtime uclk activity report.

Change-Id I89cf7c95233060ee106e9fcef3b8e6707cd60466
---
 drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/powerplay/smu_v11_0.c +14 -1
index 87ccca045f36..738ae1d2ef17 100644
@@ -1123,6 +1123,7 @@ static int smu_v11_0_get_metrics_table(struct smu_context *smu,
 }
 
 static int smu_v11_0_get_current_activity_percent(struct smu_context *smu,
+						  enum amd_pp_sensors sensor,
 						  uint32_t *value)
 {
 	int ret = 0;
@@ -1135,7 +1136,17 @@ static int smu_v11_0_get_current_activity_percent(struct smu_context *smu,
 	if (ret)
 		return ret;
 
-	*value = metrics.AverageGfxActivity;
+	switch (sensor) {
+	case AMDGPU_PP_SENSOR_GPU_LOAD:
+		*value = metrics.AverageGfxActivity;
+		break;
+	case AMDGPU_PP_SENSOR_MEM_LOAD:
+		*value = metrics.AverageUclkActivity;
+		break;
+	default:
+		pr_err("Invalid sensor for retrieving clock activity\n");
+		return -EINVAL;
+	}
 
 	return 0;
 }
@@ -1210,7 +1221,9 @@ static int smu_v11_0_read_sensor(struct smu_context *smu,
 	int ret = 0;
 	switch (sensor) {
 	case AMDGPU_PP_SENSOR_GPU_LOAD:
+	case AMDGPU_PP_SENSOR_MEM_LOAD:
 		ret = smu_v11_0_get_current_activity_percent(smu,
+							     sensor,
 							     (uint32_t *)data);
 		*size = 4;
 		break;
Signature · 6 lines
2.21.0

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

A message that is not in the archive (sent off-list or not yet received): [email protected]

author
#2 lore raw

PATCH 2/2 drm/amd/powerplay: support sw smu hotspot and memory temperature retrieval

Support hotspot and memory temperature retrieval on sw smu routine.

Change-Id If2ed1e2835f4b158a4a6d93aee8b358af18b9bfc
---
 drivers/gpu/drm/amd/powerplay/inc/smu_v11_0.h |  3 +
 drivers/gpu/drm/amd/powerplay/smu_v11_0.c     | 74 ++++++++++++++++---
 2 files changed, 66 insertions(+), 11 deletions(-)
drivers/gpu/drm/amd/powerplay/inc/smu_v11_0.h +3 -0
index aa8d81f4111e..02c965d64256 100644
@@ -36,6 +36,9 @@
 #define smnMP0_FW_INTF			0x30101c0
 #define smnMP1_PUB_CTRL			0x3010b14
 
+#define TEMP_RANGE_MIN			(0)
+#define TEMP_RANGE_MAX			(80 * 1000)
+
 struct smu_11_0_max_sustainable_clocks {
 	uint32_t display_clock;
 	uint32_t phy_clock;
drivers/gpu/drm/amd/powerplay/smu_v11_0.c +63 -11

115 lines not on this page · raw message

Signature · 6 lines
2.21.0

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

A message that is not in the archive (sent off-list or not yet received): [email protected]

Reviewed-by
#4 lore raw

Re: [PATCH 2/2] drm/amd/powerplay: support sw smu hotspot and memory temperature retrieval

Series is:

________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Evan Quan <[email protected]>
Sent: Tuesday, May 14, 2019 7:19 AM
To: [email protected]
Cc: Quan, Evan
Subject: [PATCH 2/2] drm/amd/powerplay: support sw smu hotspot and memory temperature retrieval

[CAUTION: External Email]

Support hotspot and memory temperature retrieval on sw smu routine.

Change-Id If2ed1e2835f4b158a4a6d93aee8b358af18b9bfc
---
 drivers/gpu/drm/amd/powerplay/inc/smu_v11_0.h |  3 +
 drivers/gpu/drm/amd/powerplay/smu_v11_0.c     | 74 ++++++++++++++++---
 2 files changed, 66 insertions(+), 11 deletions(-)
drivers/gpu/drm/amd/powerplay/inc/smu_v11_0.h +3 -0
index aa8d81f4111e..02c965d64256 100644
@@ -36,6 +36,9 @@
 #define smnMP0_FW_INTF                 0x30101c0
 #define smnMP1_PUB_CTRL                        0x3010b14
 
+#define TEMP_RANGE_MIN                 (0)
+#define TEMP_RANGE_MAX                 (80 * 1000)
+
 struct smu_11_0_max_sustainable_clocks {
        uint32_t display_clock;
        uint32_t phy_clock;
drivers/gpu/drm/amd/powerplay/smu_v11_0.c +63 -11

115 lines not on this page · raw message

--
2.21.0

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

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