Skip to contentSkip to conversation

Add AI sensors to --top

PATCH In review Tom St Denis 2 participants 2 messages Apr 7, 2017 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add AI sensors to --top

---
 src/app/top.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
src/app/top.c +13 -1
index b8a91e317ba5..96e33ff2e1da 100644
@@ -252,6 +252,15 @@ static struct umr_bitfield stat_si_sensor_bits[] = {
 	{ NULL, 0, 0, NULL },
 };
 
+static struct umr_bitfield stat_ai_sensor_bits[] = {
+	{ "GFX_SCLK", AMDGPU_PP_SENSOR_GFX_SCLK, SENSOR_D100|(SENSOR_MHZ<<4), &umr_bitfield_default },
+	{ "GFX_MCLK", AMDGPU_PP_SENSOR_GFX_MCLK, SENSOR_D100|(SENSOR_MHZ<<4), &umr_bitfield_default },
+	{ "GPU_LOAD", AMDGPU_PP_SENSOR_GPU_LOAD, SENSOR_PERCENT<<4, &umr_bitfield_default },
+	{ "GPU_TEMP", AMDGPU_PP_SENSOR_GPU_TEMP, SENSOR_D1000|(SENSOR_TEMP<<4), &umr_bitfield_default },
+	{ NULL, 0, 0, NULL },
+};
+
+
 #define AMDGPU_INFO_NUM_BYTES_MOVED		0x0f
 #define AMDGPU_INFO_VRAM_USAGE			0x10
 #define AMDGPU_INFO_GTT_USAGE			0x11
@@ -794,7 +803,10 @@ static void top_build_vi_program(struct umr_asic *asic)
 		ENTRY(i++, "mmRLC_GPM_STAT", &stat_rlc_gpm_bits[0], &top_options.vi.gfxpwr, "GFX PWR");
 
 	// sensors
-	if (asic->config.gfx.family == 135) {
+	if (asic->config.gfx.family == 141) {
+		// Arctic Island Family
+		ENTRY_SENSOR(i++, "GFX_SCLK", &stat_ai_sensor_bits[0], &top_options.vi.sensors, "Sensors");
+	} else if (asic->config.gfx.family == 135) {
 		// Carrizo/Stoney family
 		ENTRY_SENSOR(i++, "GFX_SCLK", &stat_carrizo_sensor_bits[0], &top_options.vi.sensors, "Sensors");
 	} else if (asic->config.gfx.family == 130) {
Signature · 6 lines
2.12.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
#2 lore raw
Quoted 28 lines · Tom St Denis
---
 src/app/top.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
src/app/top.c +9 -0
index b8a91e317ba5..96e33ff2e1da 100644
@@ -252,6 +252,15 @@ static struct umr_bitfield stat_si_sensor_bits[] = {
 	{ NULL, 0, 0, NULL },
 };
 
+static struct umr_bitfield stat_ai_sensor_bits[] = {
+	{ "GFX_SCLK", AMDGPU_PP_SENSOR_GFX_SCLK, SENSOR_D100|(SENSOR_MHZ<<4), &umr_bitfield_default },
+	{ "GFX_MCLK", AMDGPU_PP_SENSOR_GFX_MCLK, SENSOR_D100|(SENSOR_MHZ<<4), &umr_bitfield_default },
+	{ "GPU_LOAD", AMDGPU_PP_SENSOR_GPU_LOAD, SENSOR_PERCENT<<4, &umr_bitfield_default },
+	{ "GPU_TEMP", AMDGPU_PP_SENSOR_GPU_TEMP, SENSOR_D1000|(SENSOR_TEMP<<4), &umr_bitfield_default },
+	{ NULL, 0, 0, NULL },
+};
+
+
 #define AMDGPU_INFO_NUM_BYTES_MOVED		0x0f
 #define AMDGPU_INFO_VRAM_USAGE			0x10
 #define AMDGPU_INFO_GTT_USAGE			0x11
@@ -794,7 +803,10 @@ static void top_build_vi_program(struct umr_asic *asic)
 		ENTRY(i++, "mmRLC_GPM_STAT", &stat_rlc_gpm_bits[0], &top_options.vi.gfxpwr, "GFX PWR");

src/app/top.c static void top_build_vi_program(struct umr_asic *asic) · line 812

Quoted 10 lines
src/app/top.c +4 -1
 
 	// sensors
-	if (asic->config.gfx.family == 135) {
+	if (asic->config.gfx.family == 141) {
+		// Arctic Island Family
+		ENTRY_SENSOR(i++, "GFX_SCLK", &stat_ai_sensor_bits[0], &top_options.vi.sensors, "Sensors");
+	} else if (asic->config.gfx.family == 135) {
 		// Carrizo/Stoney family
 		ENTRY_SENSOR(i++, "GFX_SCLK", &stat_carrizo_sensor_bits[0], &top_options.vi.sensors, "Sensors");
 	} else if (asic->config.gfx.family == 130) {

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