Skip to contentSkip to conversation

drm/amd/pm: Add ASIC independent throttle bits

PATCH In review Graham Sider 4 participants 16 messages May 20, 2021 – May 25, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/6 drm/amd/pm: Add ASIC independent throttle bits

Add new defines for thermal throttle status bits which are ASIC independent. This bit field will be visible to userspace via gpu_metrics, replacing the previous ASIC dependent bit fields.

---
 drivers/gpu/drm/amd/pm/inc/amdgpu_smu.h | 32 +++++++++++++++++++++++++
 1 file changed, 32 insertions(+)
drivers/gpu/drm/amd/pm/inc/amdgpu_smu.h +32 -0
index 523f9d2982e9..fbbebb1da913 100644
@@ -35,6 +35,38 @@
 
 #define SMU_DPM_USER_PROFILE_RESTORE (1 << 0)
 
+#define INDEP_THROTTLER_PPT0_BIT		0
+#define INDEP_THROTTLER_PPT1_BIT		1
+#define INDEP_THROTTLER_PPT2_BIT		2
+#define INDEP_THROTTLER_PPT3_BIT		3
+#define INDEP_THROTTLER_TDC_GFX_BIT		4
+#define INDEP_THROTTLER_TDC_SOC_BIT		5
+#define INDEP_THROTTLER_TDC_HBM_BIT		6
+#define INDEP_THROTTLER_TEMP_GPU_BIT		7
+#define INDEP_THROTTLER_TEMP_MEM_BIT		8
+#define INDEP_THROTTLER_TEMP_EDGE_BIT		9
+#define INDEP_THROTTLER_TEMP_HOTSPOT_BIT	10
+#define INDEP_THROTTLER_TEMP_VR_GFX_BIT		11
+#define INDEP_THROTTLER_TEMP_VR_SOC_BIT		12
+#define INDEP_THROTTLER_TEMP_VR_MEM_BIT		13
+#define INDEP_THROTTLER_TEMP_LIQUID_BIT		14
+#define INDEP_THROTTLER_APCC_BIT		15
+#define INDEP_THROTTLER_PPM_BIT			16
+#define INDEP_THROTTLER_FIT_BIT			17
+#define INDEP_THROTTLER_VRHOT0_BIT		18
+#define INDEP_THROTTLER_VRHOT1_BIT		19
+#define INDEP_THROTTLER_STATUS_BIT_SPL		20
+#define INDEP_THROTTLER_STATUS_BIT_FPPT		21
+#define INDEP_THROTTLER_STATUS_BIT_SPPT		22
+#define INDEP_THROTTLER_STATUS_BIT_SPPT_APU	23
+#define INDEP_THROTTLER_STATUS_BIT_THM_CORE	24
+#define INDEP_THROTTLER_STATUS_BIT_THM_GFX	25
+#define INDEP_THROTTLER_STATUS_BIT_THM_SOC	26
+#define INDEP_THROTTLER_STATUS_BIT_TDC_VDD	27
+#define INDEP_THROTTLER_STATUS_BIT_TDC_SOC	28
+#define INDEP_THROTTLER_STATUS_BIT_TDC_GFX	29
+#define INDEP_THROTTLER_STATUS_BIT_TDC_CVIP	30
+
 struct smu_hw_power_state {
 	unsigned int magic;
 };
Signature · 6 lines
2.17.1

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

PATCH 5/6 drm/amd/pm: Add vangogh throttler translation

Perform dependent to independent throttle status translation for vangogh.

---
 .../gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c  | 41 +++++++++++++++++--
 1 file changed, 37 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +37 -4
index 77f532a49e37..6e3cfb4bda1d 100644
@@ -251,6 +251,37 @@ static int vangogh_tables_init(struct smu_context *smu)
 	return -ENOMEM;
 }
 
+static uint32_t vangogh_get_indep_throttler_status(
+					unsigned long dep_throttler_status)
+{
+	unsigned long indep_throttler_status = 0;
+
+	__assign_bit(INDEP_THROTTLER_STATUS_BIT_SPL, &indep_throttler_status,
+		  test_bit(THROTTLER_STATUS_BIT_SPL, &dep_throttler_status));
+	__assign_bit(INDEP_THROTTLER_STATUS_BIT_FPPT, &indep_throttler_status,
+		  test_bit(THROTTLER_STATUS_BIT_FPPT, &dep_throttler_status));
+	__assign_bit(INDEP_THROTTLER_STATUS_BIT_SPPT, &indep_throttler_status,
+		  test_bit(THROTTLER_STATUS_BIT_SPPT, &dep_throttler_status));
+	__assign_bit(INDEP_THROTTLER_STATUS_BIT_SPPT_APU, &indep_throttler_status,
+		  test_bit(THROTTLER_STATUS_BIT_SPPT_APU, &dep_throttler_status));
+	__assign_bit(INDEP_THROTTLER_STATUS_BIT_THM_CORE, &indep_throttler_status,
+		  test_bit(THROTTLER_STATUS_BIT_THM_CORE, &dep_throttler_status));
+	__assign_bit(INDEP_THROTTLER_STATUS_BIT_THM_GFX, &indep_throttler_status,
+		  test_bit(THROTTLER_STATUS_BIT_THM_GFX, &dep_throttler_status));
+	__assign_bit(INDEP_THROTTLER_STATUS_BIT_THM_SOC, &indep_throttler_status,
+		  test_bit(THROTTLER_STATUS_BIT_THM_SOC, &dep_throttler_status));
+	__assign_bit(INDEP_THROTTLER_STATUS_BIT_TDC_VDD, &indep_throttler_status,
+		  test_bit(THROTTLER_STATUS_BIT_TDC_VDD, &dep_throttler_status));
+	__assign_bit(INDEP_THROTTLER_STATUS_BIT_TDC_SOC, &indep_throttler_status,
+		  test_bit(THROTTLER_STATUS_BIT_TDC_SOC, &dep_throttler_status));
+	__assign_bit(INDEP_THROTTLER_STATUS_BIT_TDC_GFX, &indep_throttler_status,
+		  test_bit(THROTTLER_STATUS_BIT_TDC_GFX, &dep_throttler_status));
+	__assign_bit(INDEP_THROTTLER_STATUS_BIT_TDC_CVIP, &indep_throttler_status,
+		  test_bit(THROTTLER_STATUS_BIT_TDC_CVIP, &dep_throttler_status));
+
+	return (uint32_t)indep_throttler_status;
+}
+
 static int vangogh_get_legacy_smu_metrics_data(struct smu_context *smu,
 				       MetricsMember_t member,
 				       uint32_t *value)
@@ -304,7 +335,7 @@ static int vangogh_get_legacy_smu_metrics_data(struct smu_context *smu,
 		SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;
 		break;
 	case METRICS_THROTTLER_STATUS:
-		*value = metrics->ThrottlerStatus;
+		*value = vangogh_get_indep_throttler_status(metrics->ThrottlerStatus);
 		break;
 	case METRICS_VOLTAGE_VDDGFX:
 		*value = metrics->Voltage[2];
@@ -379,7 +410,7 @@ static int vangogh_get_smu_metrics_data(struct smu_context *smu,
 		SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;
 		break;
 	case METRICS_THROTTLER_STATUS:
-		*value = metrics->Current.ThrottlerStatus;
+		*value = vangogh_get_indep_throttler_status(metrics->Current.ThrottlerStatus);
 		break;
 	case METRICS_VOLTAGE_VDDGFX:
 		*value = metrics->Current.Voltage[2];
@@ -1673,7 +1704,8 @@ static ssize_t vangogh_get_legacy_gpu_metrics(struct smu_context *smu,
 		sizeof(uint16_t) * 4);
 	gpu_metrics->current_l3clk[0] = metrics.L3Frequency[0];
 
-	gpu_metrics->throttle_status = metrics.ThrottlerStatus;
+	gpu_metrics->throttle_status =
+			vangogh_get_indep_throttler_status(metrics.ThrottlerStatus);
 
 	gpu_metrics->system_clock_counter = ktime_get_boottime_ns();
 
@@ -1734,7 +1766,8 @@ static ssize_t vangogh_get_gpu_metrics(struct smu_context *smu,
 		sizeof(uint16_t) * 4);
 	gpu_metrics->current_l3clk[0] = metrics.Current.L3Frequency[0];
 
-	gpu_metrics->throttle_status = metrics.Current.ThrottlerStatus;
+	gpu_metrics->throttle_status =
+			vangogh_get_indep_throttler_status(metrics.Current.ThrottlerStatus);
 
 	gpu_metrics->system_clock_counter = ktime_get_boottime_ns();
 
Signature · 6 lines
2.17.1

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

PATCH 2/6 drm/amd/pm: Add arcturus throttler translation

In reply to Graham Sider

Perform dependent to independent throttle status translation for arcturus.

---
 .../gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c | 62 ++++++++++++++++---
 1 file changed, 53 insertions(+), 9 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c +53 -9
index 1735a96dd307..7c01c0bf2073 100644
@@ -540,6 +540,49 @@ static int arcturus_freqs_in_same_level(int32_t frequency1,
 	return (abs(frequency1 - frequency2) <= EPSILON);
 }
 
+static uint32_t arcturus_get_indep_throttler_status(
+					unsigned long dep_throttler_status)
+{
+	unsigned long indep_throttler_status = 0;
+
+	__assign_bit(INDEP_THROTTLER_TEMP_EDGE_BIT, &indep_throttler_status,
+		  test_bit(THROTTLER_TEMP_EDGE_BIT, &dep_throttler_status));
+	__assign_bit(INDEP_THROTTLER_TEMP_HOTSPOT_BIT, &indep_throttler_status,
+		  test_bit(THROTTLER_TEMP_HOTSPOT_BIT, &dep_throttler_status));
+	__assign_bit(INDEP_THROTTLER_TEMP_MEM_BIT, &indep_throttler_status,
+		  test_bit(THROTTLER_TEMP_MEM_BIT, &dep_throttler_status));
+	__assign_bit(INDEP_THROTTLER_TEMP_VR_GFX_BIT, &indep_throttler_status,
+		  test_bit(THROTTLER_TEMP_VR_GFX_BIT, &dep_throttler_status));
+	__assign_bit(INDEP_THROTTLER_TEMP_VR_MEM_BIT, &indep_throttler_status,
+		  test_bit(THROTTLER_TEMP_VR_MEM_BIT, &dep_throttler_status));
+	__assign_bit(INDEP_THROTTLER_TEMP_VR_SOC_BIT, &indep_throttler_status,
+		  test_bit(THROTTLER_TEMP_VR_SOC_BIT, &dep_throttler_status));
+	__assign_bit(INDEP_THROTTLER_TDC_GFX_BIT, &indep_throttler_status,
+		  test_bit(THROTTLER_TDC_GFX_BIT, &dep_throttler_status));
+	__assign_bit(INDEP_THROTTLER_TDC_SOC_BIT, &indep_throttler_status,
+		  test_bit(THROTTLER_TDC_SOC_BIT, &dep_throttler_status));
+	__assign_bit(INDEP_THROTTLER_PPT0_BIT, &indep_throttler_status,
+		  test_bit(THROTTLER_PPT0_BIT, &dep_throttler_status));
+	__assign_bit(INDEP_THROTTLER_PPT1_BIT, &indep_throttler_status,
+		  test_bit(THROTTLER_PPT1_BIT, &dep_throttler_status));
+	__assign_bit(INDEP_THROTTLER_PPT2_BIT, &indep_throttler_status,
+		  test_bit(THROTTLER_PPT2_BIT, &dep_throttler_status));
+	__assign_bit(INDEP_THROTTLER_PPT3_BIT, &indep_throttler_status,
+		  test_bit(THROTTLER_PPT3_BIT, &dep_throttler_status));
+	__assign_bit(INDEP_THROTTLER_PPM_BIT, &indep_throttler_status,
+		  test_bit(THROTTLER_PPM_BIT, &dep_throttler_status));
+	__assign_bit(INDEP_THROTTLER_FIT_BIT, &indep_throttler_status,
+		  test_bit(THROTTLER_FIT_BIT, &dep_throttler_status));
+	__assign_bit(INDEP_THROTTLER_APCC_BIT, &indep_throttler_status,
+		  test_bit(THROTTLER_APCC_BIT, &dep_throttler_status));
+	__assign_bit(INDEP_THROTTLER_VRHOT0_BIT, &indep_throttler_status,
+		  test_bit(THROTTLER_VRHOT0_BIT, &dep_throttler_status));
+	__assign_bit(INDEP_THROTTLER_VRHOT1_BIT, &indep_throttler_status,
+		  test_bit(THROTTLER_VRHOT1_BIT, &dep_throttler_status));
+
+	return (uint32_t)indep_throttler_status;
+}
+
 static int arcturus_get_smu_metrics_data(struct smu_context *smu,
 					 MetricsMember_t member,
 					 uint32_t *value)
@@ -629,7 +672,7 @@ static int arcturus_get_smu_metrics_data(struct smu_context *smu,
 			SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;
 		break;
 	case METRICS_THROTTLER_STATUS:
-		*value = metrics->ThrottlerStatus;
+		*value = arcturus_get_indep_throttler_status(metrics->ThrottlerStatus);
 		break;
 	case METRICS_CURR_FANSPEED:
 		*value = metrics->CurrFanSpeed;
@@ -2213,13 +2256,13 @@ static const struct throttling_logging_label {
 	uint32_t feature_mask;
 	const char *label;
 } logging_label[] = {
-	{(1U << THROTTLER_TEMP_HOTSPOT_BIT), "GPU"},
-	{(1U << THROTTLER_TEMP_MEM_BIT), "HBM"},
-	{(1U << THROTTLER_TEMP_VR_GFX_BIT), "VR of GFX rail"},
-	{(1U << THROTTLER_TEMP_VR_MEM_BIT), "VR of HBM rail"},
-	{(1U << THROTTLER_TEMP_VR_SOC_BIT), "VR of SOC rail"},
-	{(1U << THROTTLER_VRHOT0_BIT), "VR0 HOT"},
-	{(1U << THROTTLER_VRHOT1_BIT), "VR1 HOT"},
+	{(1U << INDEP_THROTTLER_TEMP_HOTSPOT_BIT), "GPU"},
+	{(1U << INDEP_THROTTLER_TEMP_MEM_BIT), "HBM"},
+	{(1U << INDEP_THROTTLER_TEMP_VR_GFX_BIT), "VR of GFX rail"},
+	{(1U << INDEP_THROTTLER_TEMP_VR_MEM_BIT), "VR of HBM rail"},
+	{(1U << INDEP_THROTTLER_TEMP_VR_SOC_BIT), "VR of SOC rail"},
+	{(1U << INDEP_THROTTLER_VRHOT0_BIT), "VR0 HOT"},
+	{(1U << INDEP_THROTTLER_VRHOT1_BIT), "VR1 HOT"},
 };
 static void arcturus_log_thermal_throttling_event(struct smu_context *smu)
 {
@@ -2314,7 +2357,8 @@ static ssize_t arcturus_get_gpu_metrics(struct smu_context *smu,
 	gpu_metrics->current_vclk0 = metrics.CurrClock[PPCLK_VCLK];
 	gpu_metrics->current_dclk0 = metrics.CurrClock[PPCLK_DCLK];
 
-	gpu_metrics->throttle_status = metrics.ThrottlerStatus;
+	gpu_metrics->throttle_status =
+			arcturus_get_indep_throttler_status(metrics.ThrottlerStatus);
 
 	gpu_metrics->current_fan_speed = metrics.CurrFanSpeed;
 
Signature · 6 lines
2.17.1

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

PATCH 3/6 drm/amd/pm: Add navi1x throttler translation

In reply to Graham Sider

Perform dependent to independent throttle status translation for navi1x (navi10, navi12).

---
 .../gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c   | 63 ++++++++++++++++---
 1 file changed, 55 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +55 -8
index 78fe13183e8b..8d216c46d057 100644
@@ -524,6 +524,49 @@ static int navi10_tables_init(struct smu_context *smu)
 	return -ENOMEM;
 }
 
+static uint32_t navi1x_get_indep_throttler_status(
+					unsigned long dep_throttler_status)
+{
+	unsigned long indep_throttler_status = 0;
+
+	__assign_bit(INDEP_THROTTLER_TEMP_EDGE_BIT, &indep_throttler_status,
+		  test_bit(THROTTLER_TEMP_EDGE_BIT, &dep_throttler_status));
+	__assign_bit(INDEP_THROTTLER_TEMP_HOTSPOT_BIT, &indep_throttler_status,
+		  test_bit(THROTTLER_TEMP_HOTSPOT_BIT, &dep_throttler_status));
+	__assign_bit(INDEP_THROTTLER_TEMP_MEM_BIT, &indep_throttler_status,
+		  test_bit(THROTTLER_TEMP_MEM_BIT, &dep_throttler_status));
+	__assign_bit(INDEP_THROTTLER_TEMP_VR_GFX_BIT, &indep_throttler_status,
+		  test_bit(THROTTLER_TEMP_VR_GFX_BIT, &dep_throttler_status));
+	__assign_bit(INDEP_THROTTLER_TEMP_VR_MEM_BIT, &indep_throttler_status,
+		  test_bit(THROTTLER_TEMP_VR_MEM0_BIT, &dep_throttler_status) ||
+		  test_bit(THROTTLER_TEMP_VR_MEM1_BIT, &dep_throttler_status));
+	__assign_bit(INDEP_THROTTLER_TEMP_VR_SOC_BIT, &indep_throttler_status,
+		  test_bit(THROTTLER_TEMP_VR_SOC_BIT, &dep_throttler_status));
+	__assign_bit(INDEP_THROTTLER_TEMP_LIQUID_BIT, &indep_throttler_status,
+		  test_bit(THROTTLER_TEMP_LIQUID0_BIT, &dep_throttler_status) ||
+		  test_bit(THROTTLER_TEMP_LIQUID1_BIT, &dep_throttler_status));
+	__assign_bit(INDEP_THROTTLER_TDC_GFX_BIT, &indep_throttler_status,
+		  test_bit(THROTTLER_TDC_GFX_BIT, &dep_throttler_status));
+	__assign_bit(INDEP_THROTTLER_TDC_SOC_BIT, &indep_throttler_status,
+		  test_bit(THROTTLER_TDC_SOC_BIT, &dep_throttler_status));
+	__assign_bit(INDEP_THROTTLER_PPT0_BIT, &indep_throttler_status,
+		  test_bit(THROTTLER_PPT0_BIT, &dep_throttler_status));
+	__assign_bit(INDEP_THROTTLER_PPT1_BIT, &indep_throttler_status,
+		  test_bit(THROTTLER_PPT1_BIT, &dep_throttler_status));
+	__assign_bit(INDEP_THROTTLER_PPT2_BIT, &indep_throttler_status,
+		  test_bit(THROTTLER_PPT2_BIT, &dep_throttler_status));
+	__assign_bit(INDEP_THROTTLER_PPT3_BIT, &indep_throttler_status,
+		  test_bit(THROTTLER_PPT3_BIT, &dep_throttler_status));
+	__assign_bit(INDEP_THROTTLER_FIT_BIT, &indep_throttler_status,
+		  test_bit(THROTTLER_FIT_BIT, &dep_throttler_status));
+	__assign_bit(INDEP_THROTTLER_PPM_BIT, &indep_throttler_status,
+		  test_bit(THROTTLER_PPM_BIT, &dep_throttler_status));
+	__assign_bit(INDEP_THROTTLER_APCC_BIT, &indep_throttler_status,
+		  test_bit(THROTTLER_APCC_BIT, &dep_throttler_status));
+
+	return (uint32_t)indep_throttler_status;
+}
+
 static int navi10_get_legacy_smu_metrics_data(struct smu_context *smu,
 					      MetricsMember_t member,
 					      uint32_t *value)
@@ -601,7 +644,7 @@ static int navi10_get_legacy_smu_metrics_data(struct smu_context *smu,
 			SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;
 		break;
 	case METRICS_THROTTLER_STATUS:
-		*value = metrics->ThrottlerStatus;
+		*value = navi1x_get_indep_throttler_status(metrics->ThrottlerStatus);
 		break;
 	case METRICS_CURR_FANSPEED:
 		*value = metrics->CurrFanSpeed;
@@ -696,7 +739,7 @@ static int navi10_get_smu_metrics_data(struct smu_context *smu,
 			SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;
 		break;
 	case METRICS_THROTTLER_STATUS:
-		*value = metrics->ThrottlerStatus;
+		*value = navi1x_get_indep_throttler_status(metrics->ThrottlerStatus);
 		break;
 	case METRICS_CURR_FANSPEED:
 		*value = metrics->CurrFanSpeed;
@@ -788,7 +831,7 @@ static int navi12_get_legacy_smu_metrics_data(struct smu_context *smu,
 			SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;
 		break;
 	case METRICS_THROTTLER_STATUS:
-		*value = metrics->ThrottlerStatus;
+		*value = navi1x_get_indep_throttler_status(metrics->ThrottlerStatus);
 		break;
 	case METRICS_CURR_FANSPEED:
 		*value = metrics->CurrFanSpeed;
@@ -883,7 +926,7 @@ static int navi12_get_smu_metrics_data(struct smu_context *smu,
 			SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;
 		break;
 	case METRICS_THROTTLER_STATUS:
-		*value = metrics->ThrottlerStatus;
+		*value = navi1x_get_indep_throttler_status(metrics->ThrottlerStatus);
 		break;
 	case METRICS_CURR_FANSPEED:
 		*value = metrics->CurrFanSpeed;
@@ -2672,7 +2715,8 @@ static ssize_t navi10_get_legacy_gpu_metrics(struct smu_context *smu,
 	gpu_metrics->current_vclk0 = metrics.CurrClock[PPCLK_VCLK];
 	gpu_metrics->current_dclk0 = metrics.CurrClock[PPCLK_DCLK];
 
-	gpu_metrics->throttle_status = metrics.ThrottlerStatus;
+	gpu_metrics->throttle_status =
+			navi1x_get_indep_throttler_status(metrics.ThrottlerStatus);
 
 	gpu_metrics->current_fan_speed = metrics.CurrFanSpeed;
 
@@ -2749,7 +2793,8 @@ static ssize_t navi10_get_gpu_metrics(struct smu_context *smu,
 	gpu_metrics->current_vclk0 = metrics.CurrClock[PPCLK_VCLK];
 	gpu_metrics->current_dclk0 = metrics.CurrClock[PPCLK_DCLK];
 
-	gpu_metrics->throttle_status = metrics.ThrottlerStatus;
+	gpu_metrics->throttle_status =
+			navi1x_get_indep_throttler_status(metrics.ThrottlerStatus);
 
 	gpu_metrics->current_fan_speed = metrics.CurrFanSpeed;
 
@@ -2825,7 +2870,8 @@ static ssize_t navi12_get_legacy_gpu_metrics(struct smu_context *smu,
 	gpu_metrics->current_vclk0 = metrics.CurrClock[PPCLK_VCLK];
 	gpu_metrics->current_dclk0 = metrics.CurrClock[PPCLK_DCLK];
 
-	gpu_metrics->throttle_status = metrics.ThrottlerStatus;
+	gpu_metrics->throttle_status =
+			navi1x_get_indep_throttler_status(metrics.ThrottlerStatus);
 
 	gpu_metrics->current_fan_speed = metrics.CurrFanSpeed;
 
@@ -2907,7 +2953,8 @@ static ssize_t navi12_get_gpu_metrics(struct smu_context *smu,
 	gpu_metrics->current_vclk0 = metrics.CurrClock[PPCLK_VCLK];
 	gpu_metrics->current_dclk0 = metrics.CurrClock[PPCLK_DCLK];
 
-	gpu_metrics->throttle_status = metrics.ThrottlerStatus;
+	gpu_metrics->throttle_status =
+			navi1x_get_indep_throttler_status(metrics.ThrottlerStatus);
 
 	gpu_metrics->current_fan_speed = metrics.CurrFanSpeed;
 
Signature · 6 lines
2.17.1

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

PATCH 6/6 drm/amd/pm: Add aldebaran throttler translation

In reply to Graham Sider

Perform dependent to independent throttle status translation for aldebaran.

---
 .../drm/amd/pm/swsmu/smu13/aldebaran_ppt.c    | 44 ++++++++++++++++---
 1 file changed, 38 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c +38 -6
index fb744f3e17d7..1281c74980b7 100644
@@ -511,6 +511,37 @@ static int aldebaran_freqs_in_same_level(int32_t frequency1,
 	return (abs(frequency1 - frequency2) <= EPSILON);
 }
 
+static uint32_t aldebaran_get_indep_throttler_status(
+					unsigned long dep_throttler_status)
+{
+	unsigned long indep_throttler_status = 0;
+
+	__assign_bit(INDEP_THROTTLER_PPT0_BIT, &indep_throttler_status,
+		  test_bit(THROTTLER_PPT0_BIT, &dep_throttler_status));
+	__assign_bit(INDEP_THROTTLER_PPT1_BIT, &indep_throttler_status,
+		  test_bit(THROTTLER_PPT1_BIT, &dep_throttler_status));
+	__assign_bit(INDEP_THROTTLER_TDC_GFX_BIT, &indep_throttler_status,
+		  test_bit(THROTTLER_TDC_GFX_BIT, &dep_throttler_status));
+	__assign_bit(INDEP_THROTTLER_TDC_SOC_BIT, &indep_throttler_status,
+		  test_bit(THROTTLER_TDC_SOC_BIT, &dep_throttler_status));
+	__assign_bit(INDEP_THROTTLER_TDC_HBM_BIT, &indep_throttler_status,
+		  test_bit(THROTTLER_TDC_HBM_BIT, &dep_throttler_status));
+	__assign_bit(INDEP_THROTTLER_TEMP_GPU_BIT, &indep_throttler_status,
+		  test_bit(THROTTLER_TEMP_GPU_BIT, &dep_throttler_status));
+	__assign_bit(INDEP_THROTTLER_TEMP_MEM_BIT, &indep_throttler_status,
+		  test_bit(THROTTLER_TEMP_MEM_BIT, &dep_throttler_status));
+	__assign_bit(INDEP_THROTTLER_TEMP_VR_GFX_BIT, &indep_throttler_status,
+		  test_bit(THROTTLER_TEMP_VR_GFX_BIT, &dep_throttler_status));
+	__assign_bit(INDEP_THROTTLER_TEMP_VR_SOC_BIT, &indep_throttler_status,
+		  test_bit(THROTTLER_TEMP_VR_SOC_BIT, &dep_throttler_status));
+	__assign_bit(INDEP_THROTTLER_TEMP_VR_MEM_BIT, &indep_throttler_status,
+		  test_bit(THROTTLER_TEMP_VR_MEM_BIT, &dep_throttler_status));
+	__assign_bit(INDEP_THROTTLER_APCC_BIT, &indep_throttler_status,
+		  test_bit(THROTTLER_APCC_BIT, &dep_throttler_status));
+
+	return (uint32_t)indep_throttler_status;
+}
+
 static int aldebaran_get_smu_metrics_data(struct smu_context *smu,
 					  MetricsMember_t member,
 					  uint32_t *value)
@@ -591,7 +622,7 @@ static int aldebaran_get_smu_metrics_data(struct smu_context *smu,
 			SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;
 		break;
 	case METRICS_THROTTLER_STATUS:
-		*value = metrics->ThrottlerStatus;
+		*value = aldebaran_get_indep_throttler_status(metrics->ThrottlerStatus);
 		break;
 	default:
 		*value = UINT_MAX;
@@ -1645,10 +1676,10 @@ static const struct throttling_logging_label {
 	uint32_t feature_mask;
 	const char *label;
 } logging_label[] = {
-	{(1U << THROTTLER_TEMP_MEM_BIT), "HBM"},
-	{(1U << THROTTLER_TEMP_VR_GFX_BIT), "VR of GFX rail"},
-	{(1U << THROTTLER_TEMP_VR_MEM_BIT), "VR of HBM rail"},
-	{(1U << THROTTLER_TEMP_VR_SOC_BIT), "VR of SOC rail"},
+	{(1U << INDEP_THROTTLER_TEMP_MEM_BIT), "HBM"},
+	{(1U << INDEP_THROTTLER_TEMP_VR_GFX_BIT), "VR of GFX rail"},
+	{(1U << INDEP_THROTTLER_TEMP_VR_MEM_BIT), "VR of HBM rail"},
+	{(1U << INDEP_THROTTLER_TEMP_VR_SOC_BIT), "VR of SOC rail"},
 };
 static void aldebaran_log_thermal_throttling_event(struct smu_context *smu)
 {
@@ -1745,7 +1776,8 @@ static ssize_t aldebaran_get_gpu_metrics(struct smu_context *smu,
 	gpu_metrics->current_vclk0 = metrics.CurrClock[PPCLK_VCLK];
 	gpu_metrics->current_dclk0 = metrics.CurrClock[PPCLK_DCLK];
 
-	gpu_metrics->throttle_status = metrics.ThrottlerStatus;
+	gpu_metrics->throttle_status =
+			aldebaran_get_indep_throttler_status(metrics.ThrottlerStatus);
 
 	gpu_metrics->current_fan_speed = 0;
 
Signature · 6 lines
2.17.1

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

PATCH 4/6 drm/amd/pm: Add sienna cichlid throttler translation

In reply to Graham Sider

Perform dependent to independent throttle status translation for sienna cichlid.

---
 .../amd/pm/swsmu/smu11/sienna_cichlid_ppt.c   | 48 ++++++++++++++++++-
 1 file changed, 46 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +46 -2
index 75acdb80c499..023b10306c3e 100644
@@ -453,6 +453,49 @@ static int sienna_cichlid_tables_init(struct smu_context *smu)
 	return -ENOMEM;
 }
 
+static uint32_t sienna_cichlid_get_indep_throttler_status(
+					unsigned long dep_throttler_status)
+{
+	unsigned long indep_throttler_status = 0;
+
+	__assign_bit(INDEP_THROTTLER_TEMP_EDGE_BIT, &indep_throttler_status,
+		  test_bit(THROTTLER_TEMP_EDGE_BIT, &dep_throttler_status));
+	__assign_bit(INDEP_THROTTLER_TEMP_HOTSPOT_BIT, &indep_throttler_status,
+		  test_bit(THROTTLER_TEMP_HOTSPOT_BIT, &dep_throttler_status));
+	__assign_bit(INDEP_THROTTLER_TEMP_MEM_BIT, &indep_throttler_status,
+		  test_bit(THROTTLER_TEMP_MEM_BIT, &dep_throttler_status));
+	__assign_bit(INDEP_THROTTLER_TEMP_VR_GFX_BIT, &indep_throttler_status,
+		  test_bit(THROTTLER_TEMP_VR_GFX_BIT, &dep_throttler_status));
+	__assign_bit(INDEP_THROTTLER_TEMP_VR_MEM_BIT, &indep_throttler_status,
+		  test_bit(THROTTLER_TEMP_VR_MEM0_BIT, &dep_throttler_status) ||
+		  test_bit(THROTTLER_TEMP_VR_MEM1_BIT, &dep_throttler_status));
+	__assign_bit(INDEP_THROTTLER_TEMP_VR_SOC_BIT, &indep_throttler_status,
+		  test_bit(THROTTLER_TEMP_VR_SOC_BIT, &dep_throttler_status));
+	__assign_bit(INDEP_THROTTLER_TEMP_LIQUID_BIT, &indep_throttler_status,
+		  test_bit(THROTTLER_TEMP_LIQUID0_BIT, &dep_throttler_status) ||
+		  test_bit(THROTTLER_TEMP_LIQUID1_BIT, &dep_throttler_status));
+	__assign_bit(INDEP_THROTTLER_TDC_GFX_BIT, &indep_throttler_status,
+		  test_bit(THROTTLER_TDC_GFX_BIT, &dep_throttler_status));
+	__assign_bit(INDEP_THROTTLER_TDC_SOC_BIT, &indep_throttler_status,
+		  test_bit(THROTTLER_TDC_SOC_BIT, &dep_throttler_status));
+	__assign_bit(INDEP_THROTTLER_PPT0_BIT, &indep_throttler_status,
+		  test_bit(THROTTLER_PPT0_BIT, &dep_throttler_status));
+	__assign_bit(INDEP_THROTTLER_PPT1_BIT, &indep_throttler_status,
+		  test_bit(THROTTLER_PPT1_BIT, &dep_throttler_status));
+	__assign_bit(INDEP_THROTTLER_PPT2_BIT, &indep_throttler_status,
+		  test_bit(THROTTLER_PPT2_BIT, &dep_throttler_status));
+	__assign_bit(INDEP_THROTTLER_PPT3_BIT, &indep_throttler_status,
+		  test_bit(THROTTLER_PPT3_BIT, &dep_throttler_status));
+	__assign_bit(INDEP_THROTTLER_FIT_BIT, &indep_throttler_status,
+		  test_bit(THROTTLER_FIT_BIT, &dep_throttler_status));
+	__assign_bit(INDEP_THROTTLER_PPM_BIT, &indep_throttler_status,
+		  test_bit(THROTTLER_PPM_BIT, &dep_throttler_status));
+	__assign_bit(INDEP_THROTTLER_APCC_BIT, &indep_throttler_status,
+		  test_bit(THROTTLER_APCC_BIT, &dep_throttler_status));
+
+	return (uint32_t)indep_throttler_status;
+}
+
 static int sienna_cichlid_get_smu_metrics_data(struct smu_context *smu,
 					       MetricsMember_t member,
 					       uint32_t *value)
@@ -542,7 +585,7 @@ static int sienna_cichlid_get_smu_metrics_data(struct smu_context *smu,
 			SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;
 		break;
 	case METRICS_THROTTLER_STATUS:
-		*value = metrics->ThrottlerStatus;
+		*value = sienna_cichlid_get_indep_throttler_status(metrics->ThrottlerStatus);
 		break;
 	case METRICS_CURR_FANSPEED:
 		*value = metrics->CurrFanSpeed;
@@ -3666,7 +3709,8 @@ static ssize_t sienna_cichlid_get_gpu_metrics(struct smu_context *smu,
 	gpu_metrics->current_vclk1 = metrics->CurrClock[PPCLK_VCLK_1];
 	gpu_metrics->current_dclk1 = metrics->CurrClock[PPCLK_DCLK_1];
 
-	gpu_metrics->throttle_status = metrics->ThrottlerStatus;
+	gpu_metrics->throttle_status =
+			sienna_cichlid_get_indep_throttler_status(metrics->ThrottlerStatus);
 
 	gpu_metrics->current_fan_speed = metrics->CurrFanSpeed;
 
Signature · 6 lines
2.17.1

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

RE: [PATCH 2/6] drm/amd/pm: Add arcturus throttler translation

In reply to Graham Sider

[AMD Official Use Only]

Hi Graham,

This patch series looks good. Please add "Signed-off-by" to all the commit messages. One additional comment inline below.

-----Original Message-----
From: Sider, Graham <[email protected]>
Sent: Thursday, May 20, 2021 10:29 AM
To: [email protected]
Cc: Kasiviswanathan, Harish <[email protected]>; Sakhnovitch, Elena (Elen) <[email protected]>; Sider, Graham <[email protected]>
Subject: [PATCH 2/6] drm/amd/pm: Add arcturus throttler translation

Perform dependent to independent throttle status translation for arcturus.

---
 .../gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c | 62 ++++++++++++++++---
 1 file changed, 53 insertions(+), 9 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c +5 -0
index 1735a96dd307..7c01c0bf2073 100644
@@ -540,6 +540,49 @@ static int arcturus_freqs_in_same_level(int32_t frequency1,
 	return (abs(frequency1 - frequency2) <= EPSILON);
 }
 
+static uint32_t arcturus_get_indep_throttler_status(
+					unsigned long dep_throttler_status)
+{
+	unsigned long indep_throttler_status = 0;
+
 

[HK] You can a simple optimization here. During most of the time throttler_status would be 0. So if (dep_throttler_status == 0) you could just return here. You can add this to other commits too.

+ __assign_bit(INDEP_THROTTLER_TEMP_EDGE_BIT, &indep_throttler_status,
+ test_bit(THROTTLER_TEMP_EDGE_BIT, &dep_throttler_status));
+ __assign_bit(INDEP_THROTTLER_TEMP_HOTSPOT_BIT, &indep_throttler_status,
+ test_bit(THROTTLER_TEMP_HOTSPOT_BIT, &dep_throttler_status));
+ __assign_bit(INDEP_THROTTLER_TEMP_MEM_BIT, &indep_throttler_status,
+ test_bit(THROTTLER_TEMP_MEM_BIT, &dep_throttler_status));
+ __assign_bit(INDEP_THROTTLER_TEMP_VR_GFX_BIT, &indep_throttler_status,
+ test_bit(THROTTLER_TEMP_VR_GFX_BIT, &dep_throttler_status));
+ __assign_bit(INDEP_THROTTLER_TEMP_VR_MEM_BIT, &indep_throttler_status,
+ test_bit(THROTTLER_TEMP_VR_MEM_BIT, &dep_throttler_status));
+ __assign_bit(INDEP_THROTTLER_TEMP_VR_SOC_BIT, &indep_throttler_status,
+ test_bit(THROTTLER_TEMP_VR_SOC_BIT, &dep_throttler_status));
+ __assign_bit(INDEP_THROTTLER_TDC_GFX_BIT, &indep_throttler_status,
+ test_bit(THROTTLER_TDC_GFX_BIT, &dep_throttler_status));
+ __assign_bit(INDEP_THROTTLER_TDC_SOC_BIT, &indep_throttler_status,
+ test_bit(THROTTLER_TDC_SOC_BIT, &dep_throttler_status));
+ __assign_bit(INDEP_THROTTLER_PPT0_BIT, &indep_throttler_status,
+ test_bit(THROTTLER_PPT0_BIT, &dep_throttler_status));
+ __assign_bit(INDEP_THROTTLER_PPT1_BIT, &indep_throttler_status,
+ test_bit(THROTTLER_PPT1_BIT, &dep_throttler_status));
+ __assign_bit(INDEP_THROTTLER_PPT2_BIT, &indep_throttler_status,
+ test_bit(THROTTLER_PPT2_BIT, &dep_throttler_status));
+ __assign_bit(INDEP_THROTTLER_PPT3_BIT, &indep_throttler_status,
+ test_bit(THROTTLER_PPT3_BIT, &dep_throttler_status));
+ __assign_bit(INDEP_THROTTLER_PPM_BIT, &indep_throttler_status,
+ test_bit(THROTTLER_PPM_BIT, &dep_throttler_status));
+ __assign_bit(INDEP_THROTTLER_FIT_BIT, &indep_throttler_status,
+ test_bit(THROTTLER_FIT_BIT, &dep_throttler_status));
+ __assign_bit(INDEP_THROTTLER_APCC_BIT, &indep_throttler_status,
+ test_bit(THROTTLER_APCC_BIT, &dep_throttler_status));
+ __assign_bit(INDEP_THROTTLER_VRHOT0_BIT, &indep_throttler_status,
+ test_bit(THROTTLER_VRHOT0_BIT, &dep_throttler_status));
+ __assign_bit(INDEP_THROTTLER_VRHOT1_BIT, &indep_throttler_status,
+ test_bit(THROTTLER_VRHOT1_BIT, &dep_throttler_status));
+
+ return (uint32_t)indep_throttler_status;
+}
+
static int arcturus_get_smu_metrics_data(struct smu_context *smu,
MetricsMember_t member, uint32_t *value)
@@ -629,7 +672,7 @@ static int arcturus_get_smu_metrics_data(struct smu_context *smu,
SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;
break;
case METRICS_THROTTLER_STATUS:
- *value = metrics->ThrottlerStatus;
+ *value = arcturus_get_indep_throttler_status(metrics->ThrottlerStatus);
break;
case METRICS_CURR_FANSPEED:
*value = metrics->CurrFanSpeed;
@@ -2213,13 +2256,13 @@ static const struct throttling_logging_label {
uint32_t feature_mask;
const char *label;
} logging_label[] = {
- {(1U << THROTTLER_TEMP_HOTSPOT_BIT), "GPU"},
- {(1U << THROTTLER_TEMP_MEM_BIT), "HBM"},
- {(1U << THROTTLER_TEMP_VR_GFX_BIT), "VR of GFX rail"},
- {(1U << THROTTLER_TEMP_VR_MEM_BIT), "VR of HBM rail"},
- {(1U << THROTTLER_TEMP_VR_SOC_BIT), "VR of SOC rail"},
- {(1U << THROTTLER_VRHOT0_BIT), "VR0 HOT"},
- {(1U << THROTTLER_VRHOT1_BIT), "VR1 HOT"},
+ {(1U << INDEP_THROTTLER_TEMP_HOTSPOT_BIT), "GPU"},
+ {(1U << INDEP_THROTTLER_TEMP_MEM_BIT), "HBM"},
+ {(1U << INDEP_THROTTLER_TEMP_VR_GFX_BIT), "VR of GFX rail"},
+ {(1U << INDEP_THROTTLER_TEMP_VR_MEM_BIT), "VR of HBM rail"},
+ {(1U << INDEP_THROTTLER_TEMP_VR_SOC_BIT), "VR of SOC rail"},
+ {(1U << INDEP_THROTTLER_VRHOT0_BIT), "VR0 HOT"},
+ {(1U << INDEP_THROTTLER_VRHOT1_BIT), "VR1 HOT"},
};
static void arcturus_log_thermal_throttling_event(struct smu_context *smu) {
@@ -2314,7 +2357,8 @@ static ssize_t arcturus_get_gpu_metrics(struct smu_context *smu,
gpu_metrics->current_vclk0 = metrics.CurrClock[PPCLK_VCLK]; gpu_metrics->current_dclk0 = metrics.CurrClock[PPCLK_DCLK];

- gpu_metrics->throttle_status = metrics.ThrottlerStatus;
+ gpu_metrics->throttle_status =
+ arcturus_get_indep_throttler_status(metrics.ThrottlerStatus);

gpu_metrics->current_fan_speed = metrics.CurrFanSpeed;

Signature · 5 lines
2.17.1
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#3 lore raw

Re: [PATCH 2/6] drm/amd/pm: Add arcturus throttler translation

In reply to Graham Sider

General comment on the patch series, do you want to bump the metrics table version since the meaning of the throttler status has changed?

Alex

Quoted 104 lines · Graham Sider

Perform dependent to independent throttle status translation for arcturus.

---
 .../gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c | 62 ++++++++++++++++---
 1 file changed, 53 insertions(+), 9 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c +53 -10
index 1735a96dd307..7c01c0bf2073 100644
@@ -540,6 +540,49 @@ static int arcturus_freqs_in_same_level(int32_t frequency1,
        return (abs(frequency1 - frequency2) <= EPSILON);
 }
 
+static uint32_t arcturus_get_indep_throttler_status(
+                                       unsigned long dep_throttler_status)
+{
+       unsigned long indep_throttler_status = 0;
+
+       __assign_bit(INDEP_THROTTLER_TEMP_EDGE_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_TEMP_EDGE_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_TEMP_HOTSPOT_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_TEMP_HOTSPOT_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_TEMP_MEM_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_TEMP_MEM_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_TEMP_VR_GFX_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_TEMP_VR_GFX_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_TEMP_VR_MEM_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_TEMP_VR_MEM_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_TEMP_VR_SOC_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_TEMP_VR_SOC_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_TDC_GFX_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_TDC_GFX_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_TDC_SOC_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_TDC_SOC_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_PPT0_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_PPT0_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_PPT1_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_PPT1_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_PPT2_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_PPT2_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_PPT3_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_PPT3_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_PPM_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_PPM_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_FIT_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_FIT_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_APCC_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_APCC_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_VRHOT0_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_VRHOT0_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_VRHOT1_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_VRHOT1_BIT, &dep_throttler_status));
+
+       return (uint32_t)indep_throttler_status;
+}
+
 static int arcturus_get_smu_metrics_data(struct smu_context *smu,
                                         MetricsMember_t member,
                                         uint32_t *value)
@@ -629,7 +672,7 @@ static int arcturus_get_smu_metrics_data(struct smu_context *smu,
                        SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;
                break;
        case METRICS_THROTTLER_STATUS:
-               *value = metrics->ThrottlerStatus;
+               *value = arcturus_get_indep_throttler_status(metrics->ThrottlerStatus);
                break;
        case METRICS_CURR_FANSPEED:
                *value = metrics->CurrFanSpeed;
@@ -2213,13 +2256,13 @@ static const struct throttling_logging_label {
        uint32_t feature_mask;
        const char *label;
 } logging_label[] = {
-       {(1U << THROTTLER_TEMP_HOTSPOT_BIT), "GPU"},
-       {(1U << THROTTLER_TEMP_MEM_BIT), "HBM"},
-       {(1U << THROTTLER_TEMP_VR_GFX_BIT), "VR of GFX rail"},
-       {(1U << THROTTLER_TEMP_VR_MEM_BIT), "VR of HBM rail"},
-       {(1U << THROTTLER_TEMP_VR_SOC_BIT), "VR of SOC rail"},
-       {(1U << THROTTLER_VRHOT0_BIT), "VR0 HOT"},
-       {(1U << THROTTLER_VRHOT1_BIT), "VR1 HOT"},
+       {(1U << INDEP_THROTTLER_TEMP_HOTSPOT_BIT), "GPU"},
+       {(1U << INDEP_THROTTLER_TEMP_MEM_BIT), "HBM"},
+       {(1U << INDEP_THROTTLER_TEMP_VR_GFX_BIT), "VR of GFX rail"},
+       {(1U << INDEP_THROTTLER_TEMP_VR_MEM_BIT), "VR of HBM rail"},
+       {(1U << INDEP_THROTTLER_TEMP_VR_SOC_BIT), "VR of SOC rail"},
+       {(1U << INDEP_THROTTLER_VRHOT0_BIT), "VR0 HOT"},
+       {(1U << INDEP_THROTTLER_VRHOT1_BIT), "VR1 HOT"},
 };
 static void arcturus_log_thermal_throttling_event(struct smu_context *smu)
 {
@@ -2314,7 +2357,8 @@ static ssize_t arcturus_get_gpu_metrics(struct smu_context *smu,
        gpu_metrics->current_vclk0 = metrics.CurrClock[PPCLK_VCLK];
        gpu_metrics->current_dclk0 = metrics.CurrClock[PPCLK_DCLK];
 
-       gpu_metrics->throttle_status = metrics.ThrottlerStatus;
+       gpu_metrics->throttle_status =
+                       arcturus_get_indep_throttler_status(metrics.ThrottlerStatus);
 
        gpu_metrics->current_fan_speed = metrics.CurrFanSpeed;
 
--

2.17.1

Quoted 4 lines

_______________________________________________
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

#4 lore raw

RE: [PATCH 2/6] drm/amd/pm: Add arcturus throttler translation

Hi Alex,

Are you referring to bumping the gpu_metrics_vX_Y version number? Different ASICs are currently using different version numbers already, so I'm not sure how feasible this might be (e.g. arcturus == gpu_metrics_v1_1, navi1x == gpu_metrics_v1_3, vangogh == gpu_metrics_v2_1).

Technically speaking no new fields have been added to any of the gpu_metrics versions, just a change in representation in the throttle_status field. Let me know your thoughts on this.

Best,
Graham

-----Original Message-----
From: Alex Deucher <[email protected]>
Sent: Friday, May 21, 2021 10:27 AM
To: Sider, Graham <[email protected]>
Cc: amd-gfx list <[email protected]>; Kasiviswanathan, Harish <[email protected]>; Sakhnovitch, Elena (Elen) <[email protected]>
Subject: Re: [PATCH 2/6] drm/amd/pm: Add arcturus throttler translation

[CAUTION: External Email]

General comment on the patch series, do you want to bump the metrics table version since the meaning of the throttler status has changed?

Alex

Quoted 107 lines · Graham Sider

Perform dependent to independent throttle status translation for arcturus.

---
 .../gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c | 62 
++++++++++++++++---
 1 file changed, 53 insertions(+), 9 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c +46 -1
index 1735a96dd307..7c01c0bf2073 100644
@@ -540,6 +540,49 @@ static int arcturus_freqs_in_same_level(int32_t frequency1,
        return (abs(frequency1 - frequency2) <= EPSILON);  }
 
+static uint32_t arcturus_get_indep_throttler_status(
+                                       unsigned long 
+dep_throttler_status) {
+       unsigned long indep_throttler_status = 0;
+
+       __assign_bit(INDEP_THROTTLER_TEMP_EDGE_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_TEMP_EDGE_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_TEMP_HOTSPOT_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_TEMP_HOTSPOT_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_TEMP_MEM_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_TEMP_MEM_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_TEMP_VR_GFX_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_TEMP_VR_GFX_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_TEMP_VR_MEM_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_TEMP_VR_MEM_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_TEMP_VR_SOC_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_TEMP_VR_SOC_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_TDC_GFX_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_TDC_GFX_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_TDC_SOC_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_TDC_SOC_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_PPT0_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_PPT0_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_PPT1_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_PPT1_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_PPT2_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_PPT2_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_PPT3_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_PPT3_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_PPM_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_PPM_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_FIT_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_FIT_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_APCC_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_APCC_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_VRHOT0_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_VRHOT0_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_VRHOT1_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_VRHOT1_BIT, 
+ &dep_throttler_status));
+
+       return (uint32_t)indep_throttler_status; }
+
 static int arcturus_get_smu_metrics_data(struct smu_context *smu,
                                         MetricsMember_t member,
                                         uint32_t *value) @@ -629,7 
+672,7 @@ static int arcturus_get_smu_metrics_data(struct smu_context *smu,
                        SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;
                break;
        case METRICS_THROTTLER_STATUS:
-               *value = metrics->ThrottlerStatus;
+               *value = 
+ arcturus_get_indep_throttler_status(metrics->ThrottlerStatus);
                break;
        case METRICS_CURR_FANSPEED:
                *value = metrics->CurrFanSpeed; @@ -2213,13 +2256,13 
@@ static const struct throttling_logging_label {
        uint32_t feature_mask;
        const char *label;

} logging_label[] = {

drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c +7 -7
-       {(1U << THROTTLER_TEMP_HOTSPOT_BIT), "GPU"},
-       {(1U << THROTTLER_TEMP_MEM_BIT), "HBM"},
-       {(1U << THROTTLER_TEMP_VR_GFX_BIT), "VR of GFX rail"},
-       {(1U << THROTTLER_TEMP_VR_MEM_BIT), "VR of HBM rail"},
-       {(1U << THROTTLER_TEMP_VR_SOC_BIT), "VR of SOC rail"},
-       {(1U << THROTTLER_VRHOT0_BIT), "VR0 HOT"},
-       {(1U << THROTTLER_VRHOT1_BIT), "VR1 HOT"},
+       {(1U << INDEP_THROTTLER_TEMP_HOTSPOT_BIT), "GPU"},
+       {(1U << INDEP_THROTTLER_TEMP_MEM_BIT), "HBM"},
+       {(1U << INDEP_THROTTLER_TEMP_VR_GFX_BIT), "VR of GFX rail"},
+       {(1U << INDEP_THROTTLER_TEMP_VR_MEM_BIT), "VR of HBM rail"},
+       {(1U << INDEP_THROTTLER_TEMP_VR_SOC_BIT), "VR of SOC rail"},
+       {(1U << INDEP_THROTTLER_VRHOT0_BIT), "VR0 HOT"},
+       {(1U << INDEP_THROTTLER_VRHOT1_BIT), "VR1 HOT"},
 };
 static void arcturus_log_thermal_throttling_event(struct smu_context 

*smu) { @@ -2314,7 +2357,8 @@ static ssize_t
arcturus_get_gpu_metrics(struct smu_context *smu,

        gpu_metrics->current_vclk0 = metrics.CurrClock[PPCLK_VCLK];
        gpu_metrics->current_dclk0 = metrics.CurrClock[PPCLK_DCLK];
drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c +3 -2
-       gpu_metrics->throttle_status = metrics.ThrottlerStatus;
+       gpu_metrics->throttle_status =
+                       
+ arcturus_get_indep_throttler_status(metrics.ThrottlerStatus);
 
        gpu_metrics->current_fan_speed = metrics.CurrFanSpeed;
 
--

2.17.1

Quoted 10 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flist
s.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=04%7C01%7CGr aham.Sider%40amd.com%7Ca3ca9a6b0576479e545808d91c648f50%7C3dd8961fe488 4e608e11a82d994e183d%7C0%7C0%7C637572040495495758%7CUnknown%7CTWFpbGZs b3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D %7C1000&amp;sdata=YxUx7BrsQKBauKE3fHpNrkWMAG4dBy11fV9xnJdMHns%3D&amp;r eserved=0

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

#5 lore raw

Re: [PATCH 2/6] drm/amd/pm: Add arcturus throttler translation

Quoted 7 lines · Graham

Hi Alex,

Are you referring to bumping the gpu_metrics_vX_Y version number? Different ASICs are currently using different version numbers already, so I'm not sure how feasible this might be (e.g. arcturus == gpu_metrics_v1_1, navi1x == gpu_metrics_v1_3, vangogh == gpu_metrics_v2_1).

Technically speaking no new fields have been added to any of the gpu_metrics versions, just a change in representation in the throttle_status field. Let me know your thoughts on this.

I don't know if we have any existing tools out there that parse this data, but if so, they would interpret it incorrectly after this change. If we bump the version, at least the tools will know how to handle it.

Alex

Quoted 124 lines

Best,
Graham

-----Original Message-----
From: Alex Deucher <[email protected]>
Sent: Friday, May 21, 2021 10:27 AM
To: Sider, Graham <[email protected]>
Cc: amd-gfx list <[email protected]>; Kasiviswanathan, Harish <[email protected]>; Sakhnovitch, Elena (Elen) <[email protected]>
Subject: Re: [PATCH 2/6] drm/amd/pm: Add arcturus throttler translation

[CAUTION: External Email]

General comment on the patch series, do you want to bump the metrics table version since the meaning of the throttler status has changed?

Alex

Quoted 107 lines · Graham Sider

Perform dependent to independent throttle status translation for arcturus.

---
 .../gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c | 62
++++++++++++++++---
 1 file changed, 53 insertions(+), 9 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c +46 -1
index 1735a96dd307..7c01c0bf2073 100644
@@ -540,6 +540,49 @@ static int arcturus_freqs_in_same_level(int32_t frequency1,
        return (abs(frequency1 - frequency2) <= EPSILON);  }
 
+static uint32_t arcturus_get_indep_throttler_status(
+                                       unsigned long
+dep_throttler_status) {
+       unsigned long indep_throttler_status = 0;
+
+       __assign_bit(INDEP_THROTTLER_TEMP_EDGE_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_TEMP_EDGE_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_TEMP_HOTSPOT_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_TEMP_HOTSPOT_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_TEMP_MEM_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_TEMP_MEM_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_TEMP_VR_GFX_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_TEMP_VR_GFX_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_TEMP_VR_MEM_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_TEMP_VR_MEM_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_TEMP_VR_SOC_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_TEMP_VR_SOC_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_TDC_GFX_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_TDC_GFX_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_TDC_SOC_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_TDC_SOC_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_PPT0_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_PPT0_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_PPT1_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_PPT1_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_PPT2_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_PPT2_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_PPT3_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_PPT3_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_PPM_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_PPM_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_FIT_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_FIT_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_APCC_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_APCC_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_VRHOT0_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_VRHOT0_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_VRHOT1_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_VRHOT1_BIT,
+ &dep_throttler_status));
+
+       return (uint32_t)indep_throttler_status; }
+
 static int arcturus_get_smu_metrics_data(struct smu_context *smu,
                                         MetricsMember_t member,
                                         uint32_t *value) @@ -629,7
+672,7 @@ static int arcturus_get_smu_metrics_data(struct smu_context *smu,
                        SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;
                break;
        case METRICS_THROTTLER_STATUS:
-               *value = metrics->ThrottlerStatus;
+               *value =
+ arcturus_get_indep_throttler_status(metrics->ThrottlerStatus);
                break;
        case METRICS_CURR_FANSPEED:
                *value = metrics->CurrFanSpeed; @@ -2213,13 +2256,13
@@ static const struct throttling_logging_label {
        uint32_t feature_mask;
        const char *label;

} logging_label[] = {

drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c +7 -7
-       {(1U << THROTTLER_TEMP_HOTSPOT_BIT), "GPU"},
-       {(1U << THROTTLER_TEMP_MEM_BIT), "HBM"},
-       {(1U << THROTTLER_TEMP_VR_GFX_BIT), "VR of GFX rail"},
-       {(1U << THROTTLER_TEMP_VR_MEM_BIT), "VR of HBM rail"},
-       {(1U << THROTTLER_TEMP_VR_SOC_BIT), "VR of SOC rail"},
-       {(1U << THROTTLER_VRHOT0_BIT), "VR0 HOT"},
-       {(1U << THROTTLER_VRHOT1_BIT), "VR1 HOT"},
+       {(1U << INDEP_THROTTLER_TEMP_HOTSPOT_BIT), "GPU"},
+       {(1U << INDEP_THROTTLER_TEMP_MEM_BIT), "HBM"},
+       {(1U << INDEP_THROTTLER_TEMP_VR_GFX_BIT), "VR of GFX rail"},
+       {(1U << INDEP_THROTTLER_TEMP_VR_MEM_BIT), "VR of HBM rail"},
+       {(1U << INDEP_THROTTLER_TEMP_VR_SOC_BIT), "VR of SOC rail"},
+       {(1U << INDEP_THROTTLER_VRHOT0_BIT), "VR0 HOT"},
+       {(1U << INDEP_THROTTLER_VRHOT1_BIT), "VR1 HOT"},
 };
 static void arcturus_log_thermal_throttling_event(struct smu_context

*smu) { @@ -2314,7 +2357,8 @@ static ssize_t
arcturus_get_gpu_metrics(struct smu_context *smu,

        gpu_metrics->current_vclk0 = metrics.CurrClock[PPCLK_VCLK];
        gpu_metrics->current_dclk0 = metrics.CurrClock[PPCLK_DCLK];
drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c +3 -2
-       gpu_metrics->throttle_status = metrics.ThrottlerStatus;
+       gpu_metrics->throttle_status =
+
+ arcturus_get_indep_throttler_status(metrics.ThrottlerStatus);
 
        gpu_metrics->current_fan_speed = metrics.CurrFanSpeed;
 
--

2.17.1

Quoted 10 lines
Quoted 10 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flist
s.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=04%7C01%7CGr aham.Sider%40amd.com%7Ca3ca9a6b0576479e545808d91c648f50%7C3dd8961fe488 4e608e11a82d994e183d%7C0%7C0%7C637572040495495758%7CUnknown%7CTWFpbGZs b3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D %7C1000&amp;sdata=YxUx7BrsQKBauKE3fHpNrkWMAG4dBy11fV9xnJdMHns%3D&amp;r eserved=0

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

#6 lore raw

RE: [PATCH 2/6] drm/amd/pm: Add arcturus throttler translation

Would this be referring to tools that may parse /sys/class/.../device/gpu_metrics or the actual gpu_metrics_vX_Y structs? For the latter, if there are tools that parse dependent on version vX_Y, I agree that we would not want to break those.

Since most ASICs are using different version currently, we would have to create a duplicate struct for each gpu_metrics version currently being used, unless I'm misunderstanding. I'm not sure if this is what you had in mind - let me know.

Best,
Graham

-----Original Message-----
From: Alex Deucher <[email protected]>
Sent: Friday, May 21, 2021 4:15 PM
To: Sider, Graham <[email protected]>
Cc: amd-gfx list <[email protected]>; Kasiviswanathan, Harish <[email protected]>; Sakhnovitch, Elena (Elen) <[email protected]>
Subject: Re: [PATCH 2/6] drm/amd/pm: Add arcturus throttler translation

[CAUTION: External Email]

Quoted 7 lines · Graham

Hi Alex,

Are you referring to bumping the gpu_metrics_vX_Y version number? Different ASICs are currently using different version numbers already, so I'm not sure how feasible this might be (e.g. arcturus == gpu_metrics_v1_1, navi1x == gpu_metrics_v1_3, vangogh == gpu_metrics_v2_1).

Technically speaking no new fields have been added to any of the gpu_metrics versions, just a change in representation in the throttle_status field. Let me know your thoughts on this.

I don't know if we have any existing tools out there that parse this data, but if so, they would interpret it incorrectly after this change. If we bump the version, at least the tools will know how to handle it.

Alex

Quoted 129 lines

Best,
Graham

-----Original Message-----
From: Alex Deucher <[email protected]>
Sent: Friday, May 21, 2021 10:27 AM
To: Sider, Graham <[email protected]>
Cc: amd-gfx list <[email protected]>; Kasiviswanathan, Harish <[email protected]>; Sakhnovitch, Elena (Elen) <[email protected]>
Subject: Re: [PATCH 2/6] drm/amd/pm: Add arcturus throttler translation

[CAUTION: External Email]

General comment on the patch series, do you want to bump the metrics table version since the meaning of the throttler status has changed?

Alex

Quoted 109 lines · Graham Sider

Perform dependent to independent throttle status translation for arcturus.

---
 .../gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c | 62
++++++++++++++++---
 1 file changed, 53 insertions(+), 9 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c +47 -1
index 1735a96dd307..7c01c0bf2073 100644
@@ -540,6 +540,49 @@ static int arcturus_freqs_in_same_level(int32_t frequency1,
        return (abs(frequency1 - frequency2) <= EPSILON);  }
 
+static uint32_t arcturus_get_indep_throttler_status(
+                                       unsigned long
+dep_throttler_status) {
+       unsigned long indep_throttler_status = 0;
+
+       __assign_bit(INDEP_THROTTLER_TEMP_EDGE_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_TEMP_EDGE_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_TEMP_HOTSPOT_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_TEMP_HOTSPOT_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_TEMP_MEM_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_TEMP_MEM_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_TEMP_VR_GFX_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_TEMP_VR_GFX_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_TEMP_VR_MEM_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_TEMP_VR_MEM_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_TEMP_VR_SOC_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_TEMP_VR_SOC_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_TDC_GFX_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_TDC_GFX_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_TDC_SOC_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_TDC_SOC_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_PPT0_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_PPT0_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_PPT1_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_PPT1_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_PPT2_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_PPT2_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_PPT3_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_PPT3_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_PPM_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_PPM_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_FIT_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_FIT_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_APCC_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_APCC_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_VRHOT0_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_VRHOT0_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_VRHOT1_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_VRHOT1_BIT, 
+ &dep_throttler_status));
+
+       return (uint32_t)indep_throttler_status; }
+
 static int arcturus_get_smu_metrics_data(struct smu_context *smu,
                                         MetricsMember_t member,
                                         uint32_t *value) @@ -629,7
+672,7 @@ static int arcturus_get_smu_metrics_data(struct 
+smu_context *smu,
                        SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;
                break;
        case METRICS_THROTTLER_STATUS:
-               *value = metrics->ThrottlerStatus;
+               *value =
+ arcturus_get_indep_throttler_status(metrics->ThrottlerStatus);
                break;
        case METRICS_CURR_FANSPEED:
                *value = metrics->CurrFanSpeed; @@ -2213,13 +2256,13 
@@ static const struct throttling_logging_label {
        uint32_t feature_mask;
        const char *label;

} logging_label[] = {

drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c +7 -7
-       {(1U << THROTTLER_TEMP_HOTSPOT_BIT), "GPU"},
-       {(1U << THROTTLER_TEMP_MEM_BIT), "HBM"},
-       {(1U << THROTTLER_TEMP_VR_GFX_BIT), "VR of GFX rail"},
-       {(1U << THROTTLER_TEMP_VR_MEM_BIT), "VR of HBM rail"},
-       {(1U << THROTTLER_TEMP_VR_SOC_BIT), "VR of SOC rail"},
-       {(1U << THROTTLER_VRHOT0_BIT), "VR0 HOT"},
-       {(1U << THROTTLER_VRHOT1_BIT), "VR1 HOT"},
+       {(1U << INDEP_THROTTLER_TEMP_HOTSPOT_BIT), "GPU"},
+       {(1U << INDEP_THROTTLER_TEMP_MEM_BIT), "HBM"},
+       {(1U << INDEP_THROTTLER_TEMP_VR_GFX_BIT), "VR of GFX rail"},
+       {(1U << INDEP_THROTTLER_TEMP_VR_MEM_BIT), "VR of HBM rail"},
+       {(1U << INDEP_THROTTLER_TEMP_VR_SOC_BIT), "VR of SOC rail"},
+       {(1U << INDEP_THROTTLER_VRHOT0_BIT), "VR0 HOT"},
+       {(1U << INDEP_THROTTLER_VRHOT1_BIT), "VR1 HOT"},
 };
 static void arcturus_log_thermal_throttling_event(struct 

smu_context
*smu) { @@ -2314,7 +2357,8 @@ static ssize_t
arcturus_get_gpu_metrics(struct smu_context *smu,

        gpu_metrics->current_vclk0 = metrics.CurrClock[PPCLK_VCLK];
        gpu_metrics->current_dclk0 = metrics.CurrClock[PPCLK_DCLK];
drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c +3 -2
-       gpu_metrics->throttle_status = metrics.ThrottlerStatus;
+       gpu_metrics->throttle_status =
+
+ arcturus_get_indep_throttler_status(metrics.ThrottlerStatus);
 
        gpu_metrics->current_fan_speed = metrics.CurrFanSpeed;
 
--

2.17.1

Quoted 16 lines
Quoted 8 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fli
st s.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=04%7C01%7C Gr aham.Sider%40amd.com%7Ca3ca9a6b0576479e545808d91c648f50%7C3dd8961fe4

Quoted 8 lines

88 4e608e11a82d994e183d%7C0%7C0%7C637572040495495758%7CUnknown%7CTWFpbG Zs b3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0% 3D %7C1000&amp;sdata=YxUx7BrsQKBauKE3fHpNrkWMAG4dBy11fV9xnJdMHns%3D&amp ;r
eserved=0

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

#7 lore raw

Re: [PATCH 2/6] drm/amd/pm: Add arcturus throttler translation

Quoted 5 lines · Graham

Would this be referring to tools that may parse /sys/class/.../device/gpu_metrics or the actual gpu_metrics_vX_Y structs? For the latter, if there are tools that parse dependent on version vX_Y, I agree that we would not want to break those.

Since most ASICs are using different version currently, we would have to create a duplicate struct for each gpu_metrics version currently being used, unless I'm misunderstanding. I'm not sure if this is what you had in mind - let me know.

Just update them all to the latest version. The newer ones are just supersets of the previous versions. I think a newer revision just went in in the last day or two for some additional new data, you can probably just piggy back on that since the code is not upstream yet.

Alex

Quoted 155 lines

Best,
Graham

-----Original Message-----
From: Alex Deucher <[email protected]>
Sent: Friday, May 21, 2021 4:15 PM
To: Sider, Graham <[email protected]>
Cc: amd-gfx list <[email protected]>; Kasiviswanathan, Harish <[email protected]>; Sakhnovitch, Elena (Elen) <[email protected]>
Subject: Re: [PATCH 2/6] drm/amd/pm: Add arcturus throttler translation

[CAUTION: External Email]

Quoted 7 lines · Graham

Hi Alex,

Are you referring to bumping the gpu_metrics_vX_Y version number? Different ASICs are currently using different version numbers already, so I'm not sure how feasible this might be (e.g. arcturus == gpu_metrics_v1_1, navi1x == gpu_metrics_v1_3, vangogh == gpu_metrics_v2_1).

Technically speaking no new fields have been added to any of the gpu_metrics versions, just a change in representation in the throttle_status field. Let me know your thoughts on this.

I don't know if we have any existing tools out there that parse this data, but if so, they would interpret it incorrectly after this change. If we bump the version, at least the tools will know how to handle it.

Alex

Quoted 129 lines

Best,
Graham

-----Original Message-----
From: Alex Deucher <[email protected]>
Sent: Friday, May 21, 2021 10:27 AM
To: Sider, Graham <[email protected]>
Cc: amd-gfx list <[email protected]>; Kasiviswanathan, Harish <[email protected]>; Sakhnovitch, Elena (Elen) <[email protected]>
Subject: Re: [PATCH 2/6] drm/amd/pm: Add arcturus throttler translation

[CAUTION: External Email]

General comment on the patch series, do you want to bump the metrics table version since the meaning of the throttler status has changed?

Alex

Quoted 109 lines · Graham Sider

Perform dependent to independent throttle status translation for arcturus.

---
 .../gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c | 62
++++++++++++++++---
 1 file changed, 53 insertions(+), 9 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c +47 -1
index 1735a96dd307..7c01c0bf2073 100644
@@ -540,6 +540,49 @@ static int arcturus_freqs_in_same_level(int32_t frequency1,
        return (abs(frequency1 - frequency2) <= EPSILON);  }
 
+static uint32_t arcturus_get_indep_throttler_status(
+                                       unsigned long
+dep_throttler_status) {
+       unsigned long indep_throttler_status = 0;
+
+       __assign_bit(INDEP_THROTTLER_TEMP_EDGE_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_TEMP_EDGE_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_TEMP_HOTSPOT_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_TEMP_HOTSPOT_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_TEMP_MEM_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_TEMP_MEM_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_TEMP_VR_GFX_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_TEMP_VR_GFX_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_TEMP_VR_MEM_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_TEMP_VR_MEM_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_TEMP_VR_SOC_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_TEMP_VR_SOC_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_TDC_GFX_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_TDC_GFX_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_TDC_SOC_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_TDC_SOC_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_PPT0_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_PPT0_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_PPT1_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_PPT1_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_PPT2_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_PPT2_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_PPT3_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_PPT3_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_PPM_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_PPM_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_FIT_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_FIT_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_APCC_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_APCC_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_VRHOT0_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_VRHOT0_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_VRHOT1_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_VRHOT1_BIT,
+ &dep_throttler_status));
+
+       return (uint32_t)indep_throttler_status; }
+
 static int arcturus_get_smu_metrics_data(struct smu_context *smu,
                                         MetricsMember_t member,
                                         uint32_t *value) @@ -629,7
+672,7 @@ static int arcturus_get_smu_metrics_data(struct
+smu_context *smu,
                        SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;
                break;
        case METRICS_THROTTLER_STATUS:
-               *value = metrics->ThrottlerStatus;
+               *value =
+ arcturus_get_indep_throttler_status(metrics->ThrottlerStatus);
                break;
        case METRICS_CURR_FANSPEED:
                *value = metrics->CurrFanSpeed; @@ -2213,13 +2256,13
@@ static const struct throttling_logging_label {
        uint32_t feature_mask;
        const char *label;

} logging_label[] = {

drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c +7 -7
-       {(1U << THROTTLER_TEMP_HOTSPOT_BIT), "GPU"},
-       {(1U << THROTTLER_TEMP_MEM_BIT), "HBM"},
-       {(1U << THROTTLER_TEMP_VR_GFX_BIT), "VR of GFX rail"},
-       {(1U << THROTTLER_TEMP_VR_MEM_BIT), "VR of HBM rail"},
-       {(1U << THROTTLER_TEMP_VR_SOC_BIT), "VR of SOC rail"},
-       {(1U << THROTTLER_VRHOT0_BIT), "VR0 HOT"},
-       {(1U << THROTTLER_VRHOT1_BIT), "VR1 HOT"},
+       {(1U << INDEP_THROTTLER_TEMP_HOTSPOT_BIT), "GPU"},
+       {(1U << INDEP_THROTTLER_TEMP_MEM_BIT), "HBM"},
+       {(1U << INDEP_THROTTLER_TEMP_VR_GFX_BIT), "VR of GFX rail"},
+       {(1U << INDEP_THROTTLER_TEMP_VR_MEM_BIT), "VR of HBM rail"},
+       {(1U << INDEP_THROTTLER_TEMP_VR_SOC_BIT), "VR of SOC rail"},
+       {(1U << INDEP_THROTTLER_VRHOT0_BIT), "VR0 HOT"},
+       {(1U << INDEP_THROTTLER_VRHOT1_BIT), "VR1 HOT"},
 };
 static void arcturus_log_thermal_throttling_event(struct

smu_context
*smu) { @@ -2314,7 +2357,8 @@ static ssize_t
arcturus_get_gpu_metrics(struct smu_context *smu,

        gpu_metrics->current_vclk0 = metrics.CurrClock[PPCLK_VCLK];
        gpu_metrics->current_dclk0 = metrics.CurrClock[PPCLK_DCLK];
drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c +3 -2
-       gpu_metrics->throttle_status = metrics.ThrottlerStatus;
+       gpu_metrics->throttle_status =
+
+ arcturus_get_indep_throttler_status(metrics.ThrottlerStatus);
 
        gpu_metrics->current_fan_speed = metrics.CurrFanSpeed;
 
--

2.17.1

Quoted 16 lines
Quoted 8 lines
Quoted 8 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fli
st s.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=04%7C01%7C Gr aham.Sider%40amd.com%7Ca3ca9a6b0576479e545808d91c648f50%7C3dd8961fe4

Quoted 8 lines
Quoted 8 lines

88 4e608e11a82d994e183d%7C0%7C0%7C637572040495495758%7CUnknown%7CTWFpbG Zs b3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0% 3D %7C1000&amp;sdata=YxUx7BrsQKBauKE3fHpNrkWMAG4dBy11fV9xnJdMHns%3D&amp ;r
eserved=0

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

#8 lore raw

Re: [PATCH 2/6] drm/amd/pm: Add arcturus throttler translation

Quoted 5 lines · Alex Deucher
Quoted 3 lines · Graham

Would this be referring to tools that may parse /sys/class/.../device/gpu_metrics or the actual gpu_metrics_vX_Y structs? For the latter, if there are tools that parse dependent on version vX_Y, I agree that we would not want to break those.

Quoted 7 lines
Quoted 2 lines

Since most ASICs are using different version currently, we would have to create a duplicate struct for each gpu_metrics version currently being used, unless I'm misunderstanding. I'm not sure if this is what you had in mind - let me know.

Just update them all to the latest version. The newer ones are just supersets of the previous versions. I think a newer revision just went in in the last day or two for some additional new data, you can probably just piggy back on that since the code is not upstream yet.

Another option would be to leave the current throttle status as is, and add a new one that provides the standardized format. Not sure if there is much value in having both though. That said, we could increase the size of the new one to 64 bits to accommodate future throttle status bits.

Alex

Quoted 159 lines

Alex

Quoted 155 lines

Best,
Graham

-----Original Message-----
From: Alex Deucher <[email protected]>
Sent: Friday, May 21, 2021 4:15 PM
To: Sider, Graham <[email protected]>
Cc: amd-gfx list <[email protected]>; Kasiviswanathan, Harish <[email protected]>; Sakhnovitch, Elena (Elen) <[email protected]>
Subject: Re: [PATCH 2/6] drm/amd/pm: Add arcturus throttler translation

[CAUTION: External Email]

Quoted 7 lines · Graham

Hi Alex,

Are you referring to bumping the gpu_metrics_vX_Y version number? Different ASICs are currently using different version numbers already, so I'm not sure how feasible this might be (e.g. arcturus == gpu_metrics_v1_1, navi1x == gpu_metrics_v1_3, vangogh == gpu_metrics_v2_1).

Technically speaking no new fields have been added to any of the gpu_metrics versions, just a change in representation in the throttle_status field. Let me know your thoughts on this.

I don't know if we have any existing tools out there that parse this data, but if so, they would interpret it incorrectly after this change. If we bump the version, at least the tools will know how to handle it.

Alex

Quoted 129 lines

Best,
Graham

-----Original Message-----
From: Alex Deucher <[email protected]>
Sent: Friday, May 21, 2021 10:27 AM
To: Sider, Graham <[email protected]>
Cc: amd-gfx list <[email protected]>; Kasiviswanathan, Harish <[email protected]>; Sakhnovitch, Elena (Elen) <[email protected]>
Subject: Re: [PATCH 2/6] drm/amd/pm: Add arcturus throttler translation

[CAUTION: External Email]

General comment on the patch series, do you want to bump the metrics table version since the meaning of the throttler status has changed?

Alex

Quoted 109 lines · Graham Sider

Perform dependent to independent throttle status translation for arcturus.

---
 .../gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c | 62
++++++++++++++++---
 1 file changed, 53 insertions(+), 9 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c +47 -1
index 1735a96dd307..7c01c0bf2073 100644
@@ -540,6 +540,49 @@ static int arcturus_freqs_in_same_level(int32_t frequency1,
        return (abs(frequency1 - frequency2) <= EPSILON);  }
 
+static uint32_t arcturus_get_indep_throttler_status(
+                                       unsigned long
+dep_throttler_status) {
+       unsigned long indep_throttler_status = 0;
+
+       __assign_bit(INDEP_THROTTLER_TEMP_EDGE_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_TEMP_EDGE_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_TEMP_HOTSPOT_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_TEMP_HOTSPOT_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_TEMP_MEM_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_TEMP_MEM_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_TEMP_VR_GFX_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_TEMP_VR_GFX_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_TEMP_VR_MEM_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_TEMP_VR_MEM_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_TEMP_VR_SOC_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_TEMP_VR_SOC_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_TDC_GFX_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_TDC_GFX_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_TDC_SOC_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_TDC_SOC_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_PPT0_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_PPT0_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_PPT1_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_PPT1_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_PPT2_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_PPT2_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_PPT3_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_PPT3_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_PPM_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_PPM_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_FIT_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_FIT_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_APCC_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_APCC_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_VRHOT0_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_VRHOT0_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_VRHOT1_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_VRHOT1_BIT,
+ &dep_throttler_status));
+
+       return (uint32_t)indep_throttler_status; }
+
 static int arcturus_get_smu_metrics_data(struct smu_context *smu,
                                         MetricsMember_t member,
                                         uint32_t *value) @@ -629,7
+672,7 @@ static int arcturus_get_smu_metrics_data(struct
+smu_context *smu,
                        SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;
                break;
        case METRICS_THROTTLER_STATUS:
-               *value = metrics->ThrottlerStatus;
+               *value =
+ arcturus_get_indep_throttler_status(metrics->ThrottlerStatus);
                break;
        case METRICS_CURR_FANSPEED:
                *value = metrics->CurrFanSpeed; @@ -2213,13 +2256,13
@@ static const struct throttling_logging_label {
        uint32_t feature_mask;
        const char *label;

} logging_label[] = {

drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c +7 -7
-       {(1U << THROTTLER_TEMP_HOTSPOT_BIT), "GPU"},
-       {(1U << THROTTLER_TEMP_MEM_BIT), "HBM"},
-       {(1U << THROTTLER_TEMP_VR_GFX_BIT), "VR of GFX rail"},
-       {(1U << THROTTLER_TEMP_VR_MEM_BIT), "VR of HBM rail"},
-       {(1U << THROTTLER_TEMP_VR_SOC_BIT), "VR of SOC rail"},
-       {(1U << THROTTLER_VRHOT0_BIT), "VR0 HOT"},
-       {(1U << THROTTLER_VRHOT1_BIT), "VR1 HOT"},
+       {(1U << INDEP_THROTTLER_TEMP_HOTSPOT_BIT), "GPU"},
+       {(1U << INDEP_THROTTLER_TEMP_MEM_BIT), "HBM"},
+       {(1U << INDEP_THROTTLER_TEMP_VR_GFX_BIT), "VR of GFX rail"},
+       {(1U << INDEP_THROTTLER_TEMP_VR_MEM_BIT), "VR of HBM rail"},
+       {(1U << INDEP_THROTTLER_TEMP_VR_SOC_BIT), "VR of SOC rail"},
+       {(1U << INDEP_THROTTLER_VRHOT0_BIT), "VR0 HOT"},
+       {(1U << INDEP_THROTTLER_VRHOT1_BIT), "VR1 HOT"},
 };
 static void arcturus_log_thermal_throttling_event(struct

smu_context
*smu) { @@ -2314,7 +2357,8 @@ static ssize_t
arcturus_get_gpu_metrics(struct smu_context *smu,

        gpu_metrics->current_vclk0 = metrics.CurrClock[PPCLK_VCLK];
        gpu_metrics->current_dclk0 = metrics.CurrClock[PPCLK_DCLK];
drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c +3 -2
-       gpu_metrics->throttle_status = metrics.ThrottlerStatus;
+       gpu_metrics->throttle_status =
+
+ arcturus_get_indep_throttler_status(metrics.ThrottlerStatus);
 
        gpu_metrics->current_fan_speed = metrics.CurrFanSpeed;
 
--

2.17.1

Quoted 16 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fli
st s.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=04%7C01%7C Gr aham.Sider%40amd.com%7Ca3ca9a6b0576479e545808d91c648f50%7C3dd8961fe4

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

88 4e608e11a82d994e183d%7C0%7C0%7C637572040495495758%7CUnknown%7CTWFpbG Zs b3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0% 3D %7C1000&amp;sdata=YxUx7BrsQKBauKE3fHpNrkWMAG4dBy11fV9xnJdMHns%3D&amp ;r
eserved=0

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

#9 lore raw

RE: [PATCH 2/6] drm/amd/pm: Add arcturus throttler translation

Right, that all makes sense. I'm fine with either of these options. Thanks for the insights -- I'll give this a bit more thought and get back to you.

Best,
Graham

-----Original Message-----
From: Alex Deucher <[email protected]>
Sent: Friday, May 21, 2021 5:50 PM
To: Sider, Graham <[email protected]>
Cc: amd-gfx list <[email protected]>; Kasiviswanathan, Harish <[email protected]>; Sakhnovitch, Elena (Elen) <[email protected]>
Subject: Re: [PATCH 2/6] drm/amd/pm: Add arcturus throttler translation

[CAUTION: External Email]

Quoted 5 lines · Alex Deucher
Quoted 3 lines · Graham

Would this be referring to tools that may parse /sys/class/.../device/gpu_metrics or the actual gpu_metrics_vX_Y structs? For the latter, if there are tools that parse dependent on version vX_Y, I agree that we would not want to break those.

Quoted 7 lines
Quoted 2 lines

Since most ASICs are using different version currently, we would have to create a duplicate struct for each gpu_metrics version currently being used, unless I'm misunderstanding. I'm not sure if this is what you had in mind - let me know.

Just update them all to the latest version. The newer ones are just supersets of the previous versions. I think a newer revision just went in in the last day or two for some additional new data, you can probably just piggy back on that since the code is not upstream yet.

Another option would be to leave the current throttle status as is, and add a new one that provides the standardized format. Not sure if there is much value in having both though. That said, we could increase the size of the new one to 64 bits to accommodate future throttle status bits.

Alex

Quoted 178 lines

Alex

Quoted 174 lines

Best,
Graham

-----Original Message-----
From: Alex Deucher <[email protected]>
Sent: Friday, May 21, 2021 4:15 PM
To: Sider, Graham <[email protected]>
Cc: amd-gfx list <[email protected]>; Kasiviswanathan, Harish <[email protected]>; Sakhnovitch, Elena (Elen) <[email protected]>
Subject: Re: [PATCH 2/6] drm/amd/pm: Add arcturus throttler translation

[CAUTION: External Email]

Quoted 7 lines · Graham

Hi Alex,

Are you referring to bumping the gpu_metrics_vX_Y version number? Different ASICs are currently using different version numbers already, so I'm not sure how feasible this might be (e.g. arcturus == gpu_metrics_v1_1, navi1x == gpu_metrics_v1_3, vangogh == gpu_metrics_v2_1).

Technically speaking no new fields have been added to any of the gpu_metrics versions, just a change in representation in the throttle_status field. Let me know your thoughts on this.

I don't know if we have any existing tools out there that parse this data, but if so, they would interpret it incorrectly after this change. If we bump the version, at least the tools will know how to handle it.

Alex

Quoted 145 lines

Best,
Graham

-----Original Message-----
From: Alex Deucher <[email protected]>
Sent: Friday, May 21, 2021 10:27 AM
To: Sider, Graham <[email protected]>
Cc: amd-gfx list <[email protected]>; Kasiviswanathan, Harish <[email protected]>; Sakhnovitch, Elena (Elen) <[email protected]>
Subject: Re: [PATCH 2/6] drm/amd/pm: Add arcturus throttler translation

[CAUTION: External Email]

General comment on the patch series, do you want to bump the metrics table version since the meaning of the throttler status has changed?

Alex

Quoted 125 lines · Graham Sider

Perform dependent to independent throttle status translation for arcturus.

---
 .../gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c | 62
++++++++++++++++---
 1 file changed, 53 insertions(+), 9 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c +55 -9
index 1735a96dd307..7c01c0bf2073 100644
@@ -540,6 +540,49 @@ static int arcturus_freqs_in_same_level(int32_t frequency1,
        return (abs(frequency1 - frequency2) <= EPSILON);  }
 
+static uint32_t arcturus_get_indep_throttler_status(
+                                       unsigned long
+dep_throttler_status) {
+       unsigned long indep_throttler_status = 0;
+
+       __assign_bit(INDEP_THROTTLER_TEMP_EDGE_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_TEMP_EDGE_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_TEMP_HOTSPOT_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_TEMP_HOTSPOT_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_TEMP_MEM_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_TEMP_MEM_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_TEMP_VR_GFX_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_TEMP_VR_GFX_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_TEMP_VR_MEM_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_TEMP_VR_MEM_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_TEMP_VR_SOC_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_TEMP_VR_SOC_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_TDC_GFX_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_TDC_GFX_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_TDC_SOC_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_TDC_SOC_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_PPT0_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_PPT0_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_PPT1_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_PPT1_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_PPT2_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_PPT2_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_PPT3_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_PPT3_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_PPM_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_PPM_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_FIT_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_FIT_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_APCC_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_APCC_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_VRHOT0_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_VRHOT0_BIT, &dep_throttler_status));
+       __assign_bit(INDEP_THROTTLER_VRHOT1_BIT, &indep_throttler_status,
+                 test_bit(THROTTLER_VRHOT1_BIT, 
+ &dep_throttler_status));
+
+       return (uint32_t)indep_throttler_status; }
+
 static int arcturus_get_smu_metrics_data(struct smu_context *smu,
                                         MetricsMember_t member,
                                         uint32_t *value) @@ 
-629,7
+672,7 @@ static int arcturus_get_smu_metrics_data(struct
+smu_context *smu,
                        SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;
                break;
        case METRICS_THROTTLER_STATUS:
-               *value = metrics->ThrottlerStatus;
+               *value =
+ arcturus_get_indep_throttler_status(metrics->ThrottlerStatus);
                break;
        case METRICS_CURR_FANSPEED:
                *value = metrics->CurrFanSpeed; @@ -2213,13 
+2256,13 @@ static const struct throttling_logging_label {
        uint32_t feature_mask;
        const char *label;
 } logging_label[] = {
-       {(1U << THROTTLER_TEMP_HOTSPOT_BIT), "GPU"},
-       {(1U << THROTTLER_TEMP_MEM_BIT), "HBM"},
-       {(1U << THROTTLER_TEMP_VR_GFX_BIT), "VR of GFX rail"},
-       {(1U << THROTTLER_TEMP_VR_MEM_BIT), "VR of HBM rail"},
-       {(1U << THROTTLER_TEMP_VR_SOC_BIT), "VR of SOC rail"},
-       {(1U << THROTTLER_VRHOT0_BIT), "VR0 HOT"},
-       {(1U << THROTTLER_VRHOT1_BIT), "VR1 HOT"},
+       {(1U << INDEP_THROTTLER_TEMP_HOTSPOT_BIT), "GPU"},
+       {(1U << INDEP_THROTTLER_TEMP_MEM_BIT), "HBM"},
+       {(1U << INDEP_THROTTLER_TEMP_VR_GFX_BIT), "VR of GFX rail"},
+       {(1U << INDEP_THROTTLER_TEMP_VR_MEM_BIT), "VR of HBM rail"},
+       {(1U << INDEP_THROTTLER_TEMP_VR_SOC_BIT), "VR of SOC rail"},
+       {(1U << INDEP_THROTTLER_VRHOT0_BIT), "VR0 HOT"},
+       {(1U << INDEP_THROTTLER_VRHOT1_BIT), "VR1 HOT"},
 };
 static void arcturus_log_thermal_throttling_event(struct

smu_context
*smu) { @@ -2314,7 +2357,8 @@ static ssize_t
arcturus_get_gpu_metrics(struct smu_context *smu,

        gpu_metrics->current_vclk0 = metrics.CurrClock[PPCLK_VCLK];
        gpu_metrics->current_dclk0 = 

metrics.CurrClock[PPCLK_DCLK];

drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c +3 -2
-       gpu_metrics->throttle_status = metrics.ThrottlerStatus;
+       gpu_metrics->throttle_status =
+
+ arcturus_get_indep_throttler_status(metrics.ThrottlerStatus);
 
        gpu_metrics->current_fan_speed = metrics.CurrFanSpeed;
 
--

2.17.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%
2Fli
st s.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=04%7C0 1%7C
Gr aham.Sider%40amd.com%7Ca3ca9a6b0576479e545808d91c648f50%7C3dd896 1fe4
88 4e608e11a82d994e183d%7C0%7C0%7C637572040495495758%7CUnknown%7CTW FpbG

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

Zs b3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6 Mn0%
3D %7C1000&amp;sdata=YxUx7BrsQKBauKE3fHpNrkWMAG4dBy11fV9xnJdMHns%3D &amp
;r
eserved=0

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

#14 lore raw
In reply to Graham Sider

There are duplicates in this list. It's better to classify as Power/Temperature/Current/Others and map; maybe, allocate 16 bit each in a 64-bit mask. Also, keep the naming consistent and start with "SMU_", that's what we do for others like SMU messages.

Power throttlers
-----------------

#define SMU_THROTTLER_PPT1_BIT
#define SMU_THROTTLER_PPT0_BIT
#define SMU_THROTTLER_PPT2_BIT
#define SMU_THROTTLER_PPT3_BIT
#define SMU_THROTTLER_SPL_BIT
#define SMU_THROTTLER_FPPT_BIT
#define SMU_THROTTLER_SPPT_BIT
#define SMU_THROTTLER_SPPT_APU_BIT

Current Throttlers
-------------------

#define SMU_THROTTLER_TDC_GFX_BIT
#define SMU_THROTTLER_TDC_VDD_BIT
#define SMU_THROTTLER_TDC_SOC_BIT
#define SMU_THROTTLER_TDC_MEM_BIT => Should be the one used for HBM as well #define SMU_THROTTLER_TDC_CVIP_BIT
#define SMU_THROTTLER_APCC_BIT

Temperature
------------

#define SMU_THROTTLER_TEMP_GPU_BIT
#define SMU_THROTTLER_TEMP_CORE_BIT
#define SMU_THROTTLER_TEMP_MEM_BIT
#define SMU_THROTTLER_TEMP_EDGE_BIT
#define SMU_THROTTLER_TEMP_HOTSPOT_BIT

#define SMU_THROTTLER_TEMP_VR_GFX_BIT
#define SMU_THROTTLER_TEMP_VR_SOC_BIT
#define SMU_THROTTLER_TEMP_VR_MEM_BIT
#define SMU_THROTTLER_VRHOT0_BIT
#define SMU_THROTTLER_VRHOT1_BIT

#define SMU_THROTTLER_TEMP_LIQUID_BIT

Others
-------

#define SMU_THROTTLER_PPM_BIT
#define SMU_THROTTLER_FIT_BIT

Signature · 2 lines
Thanks,
Lijo
Quoted 41 lines · Graham Sider

Add new defines for thermal throttle status bits which are ASIC independent. This bit field will be visible to userspace via gpu_metrics, replacing the previous ASIC dependent bit fields.

---
  drivers/gpu/drm/amd/pm/inc/amdgpu_smu.h | 32 +++++++++++++++++++++++++
  1 file changed, 32 insertions(+)
drivers/gpu/drm/amd/pm/inc/amdgpu_smu.h +25 -0
index 523f9d2982e9..fbbebb1da913 100644
@@ -35,6 +35,38 @@
 
  #define SMU_DPM_USER_PROFILE_RESTORE (1 << 0)
 
+#define INDEP_THROTTLER_PPT0_BIT		0
+#define INDEP_THROTTLER_PPT1_BIT		1
+#define INDEP_THROTTLER_PPT2_BIT		2
+#define INDEP_THROTTLER_PPT3_BIT		3
+#define INDEP_THROTTLER_TDC_GFX_BIT		4
+#define INDEP_THROTTLER_TDC_SOC_BIT		5
+#define INDEP_THROTTLER_TDC_HBM_BIT		6
+#define INDEP_THROTTLER_TEMP_GPU_BIT		7
+#define INDEP_THROTTLER_TEMP_MEM_BIT		8
+#define INDEP_THROTTLER_TEMP_EDGE_BIT		9
+#define INDEP_THROTTLER_TEMP_HOTSPOT_BIT	10
+#define INDEP_THROTTLER_TEMP_VR_GFX_BIT		11
+#define INDEP_THROTTLER_TEMP_VR_SOC_BIT		12
+#define INDEP_THROTTLER_TEMP_VR_MEM_BIT		13
+#define INDEP_THROTTLER_TEMP_LIQUID_BIT		14
+#define INDEP_THROTTLER_APCC_BIT		15
+#define INDEP_THROTTLER_PPM_BIT			16
+#define INDEP_THROTTLER_FIT_BIT			17
+#define INDEP_THROTTLER_VRHOT0_BIT		18
+#define INDEP_THROTTLER_VRHOT1_BIT		19
+#define INDEP_THROTTLER_STATUS_BIT_SPL		20
+#define INDEP_THROTTLER_STATUS_BIT_FPPT		21
+#define INDEP_THROTTLER_STATUS_BIT_SPPT		22
+#define INDEP_THROTTLER_STATUS_BIT_SPPT_APU	23
+#define INDEP_THROTTLER_STATUS_BIT_THM_CORE	24

drivers/gpu/drm/amd/pm/inc/amdgpu_smu.h line 72

Quoted 10 lines
drivers/gpu/drm/amd/pm/inc/amdgpu_smu.h +7 -0
+#define INDEP_THROTTLER_STATUS_BIT_THM_GFX	25
+#define INDEP_THROTTLER_STATUS_BIT_THM_SOC	26
+#define INDEP_THROTTLER_STATUS_BIT_TDC_VDD	27
+#define INDEP_THROTTLER_STATUS_BIT_TDC_SOC	28
+#define INDEP_THROTTLER_STATUS_BIT_TDC_GFX	29
+#define INDEP_THROTTLER_STATUS_BIT_TDC_CVIP	30
+
  struct smu_hw_power_state {
  	unsigned int magic;
  };

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

#15 lore raw

Most of these changes are due to Van Gogh having a different naming scheme than the rest. Just to confirm, let me know if this translation is what you're referring to with the below defines for Van Gogh:

THROTTLER_STATUS_BIT_SPL -> SMU_THROTTLER_SPL_BIT
THROTTLER_STATUS_BIT_FPPT -> SMU_THROTTLER_FPPT_BIT
THROTTER_STATUS_BIT_SPPT -> SMU_THROTTLER_SPPT_BIT
THROTTLER_STATUS_BIT_SPPT_APU -> SMU_THROTTLER_SPPT_APU_BIT
THROTTLER_STATUS_BIT_THM_CORE -> SMU_THROTTLER_TEMP_CORE_BIT
THROTTLER_STATUS_BIT_THM_GFX -> SMU_THROTTLER_TEMP_VR_GFX_BIT
THROTTLER_STATUS_BIT_THM_SOC -> SMU_THROTTLER_TEMP_VR_SOC_BIT
THROTTLER_STATUS_BIT_TDC_VDD -> SMU_THROTTLER_TDC_VDD_BIT
THROTTLER_STATUS_BIT_TDC_SOC -> SMU_THROTTLER_TDC_SOC_BIT
THROTTLER_STATUS_BIT_TDC_GFX -> SMU_THROTTLER_TDC_GFX_BIT
THROTTLER_STATUS_BIT_TDC_CVIP -> SMU_THROTTLER_TDC_CVIP_BIT

Graham

-----Original Message-----
From: Lazar, Lijo <[email protected]>
Sent: Monday, May 24, 2021 2:58 AM
To: Sider, Graham <[email protected]>; [email protected]
Cc: Kasiviswanathan, Harish <[email protected]>; Sakhnovitch, Elena (Elen) <[email protected]>
Subject: Re: [PATCH 1/6] drm/amd/pm: Add ASIC independent throttle bits

There are duplicates in this list. It's better to classify as Power/Temperature/Current/Others and map; maybe, allocate 16 bit each in a 64-bit mask. Also, keep the naming consistent and start with "SMU_", that's what we do for others like SMU messages.

Power throttlers
-----------------

#define SMU_THROTTLER_PPT1_BIT
#define SMU_THROTTLER_PPT0_BIT
#define SMU_THROTTLER_PPT2_BIT
#define SMU_THROTTLER_PPT3_BIT
#define SMU_THROTTLER_SPL_BIT
#define SMU_THROTTLER_FPPT_BIT
#define SMU_THROTTLER_SPPT_BIT
#define SMU_THROTTLER_SPPT_APU_BIT

Current Throttlers
-------------------

#define SMU_THROTTLER_TDC_GFX_BIT
#define SMU_THROTTLER_TDC_VDD_BIT
#define SMU_THROTTLER_TDC_SOC_BIT
#define SMU_THROTTLER_TDC_MEM_BIT => Should be the one used for HBM as well #define SMU_THROTTLER_TDC_CVIP_BIT #define SMU_THROTTLER_APCC_BIT

Temperature
------------

#define SMU_THROTTLER_TEMP_GPU_BIT
#define SMU_THROTTLER_TEMP_CORE_BIT
#define SMU_THROTTLER_TEMP_MEM_BIT
#define SMU_THROTTLER_TEMP_EDGE_BIT
#define SMU_THROTTLER_TEMP_HOTSPOT_BIT

#define SMU_THROTTLER_TEMP_VR_GFX_BIT
#define SMU_THROTTLER_TEMP_VR_SOC_BIT
#define SMU_THROTTLER_TEMP_VR_MEM_BIT
#define SMU_THROTTLER_VRHOT0_BIT
#define SMU_THROTTLER_VRHOT1_BIT

#define SMU_THROTTLER_TEMP_LIQUID_BIT

Others
-------

#define SMU_THROTTLER_PPM_BIT
#define SMU_THROTTLER_FIT_BIT

--
Thanks,
Lijo

Quoted 42 lines · Graham Sider

Add new defines for thermal throttle status bits which are ASIC independent. This bit field will be visible to userspace via gpu_metrics, replacing the previous ASIC dependent bit fields.

---
  drivers/gpu/drm/amd/pm/inc/amdgpu_smu.h | 32 +++++++++++++++++++++++++
  1 file changed, 32 insertions(+)
drivers/gpu/drm/amd/pm/inc/amdgpu_smu.h +25 -0
index 523f9d2982e9..fbbebb1da913 100644
@@ -35,6 +35,38 @@
 
  #define SMU_DPM_USER_PROFILE_RESTORE (1 << 0)
 
+#define INDEP_THROTTLER_PPT0_BIT		0
+#define INDEP_THROTTLER_PPT1_BIT		1
+#define INDEP_THROTTLER_PPT2_BIT		2
+#define INDEP_THROTTLER_PPT3_BIT		3
+#define INDEP_THROTTLER_TDC_GFX_BIT		4
+#define INDEP_THROTTLER_TDC_SOC_BIT		5
+#define INDEP_THROTTLER_TDC_HBM_BIT		6
+#define INDEP_THROTTLER_TEMP_GPU_BIT		7
+#define INDEP_THROTTLER_TEMP_MEM_BIT		8
+#define INDEP_THROTTLER_TEMP_EDGE_BIT		9
+#define INDEP_THROTTLER_TEMP_HOTSPOT_BIT	10
+#define INDEP_THROTTLER_TEMP_VR_GFX_BIT		11
+#define INDEP_THROTTLER_TEMP_VR_SOC_BIT		12
+#define INDEP_THROTTLER_TEMP_VR_MEM_BIT		13
+#define INDEP_THROTTLER_TEMP_LIQUID_BIT		14
+#define INDEP_THROTTLER_APCC_BIT		15
+#define INDEP_THROTTLER_PPM_BIT			16
+#define INDEP_THROTTLER_FIT_BIT			17
+#define INDEP_THROTTLER_VRHOT0_BIT		18
+#define INDEP_THROTTLER_VRHOT1_BIT		19
+#define INDEP_THROTTLER_STATUS_BIT_SPL		20
+#define INDEP_THROTTLER_STATUS_BIT_FPPT		21
+#define INDEP_THROTTLER_STATUS_BIT_SPPT		22
+#define INDEP_THROTTLER_STATUS_BIT_SPPT_APU	23
+#define INDEP_THROTTLER_STATUS_BIT_THM_CORE	24

drivers/gpu/drm/amd/pm/inc/amdgpu_smu.h line 72

Quoted 10 lines
drivers/gpu/drm/amd/pm/inc/amdgpu_smu.h +7 -0
+#define INDEP_THROTTLER_STATUS_BIT_THM_GFX	25
+#define INDEP_THROTTLER_STATUS_BIT_THM_SOC	26
+#define INDEP_THROTTLER_STATUS_BIT_TDC_VDD	27
+#define INDEP_THROTTLER_STATUS_BIT_TDC_SOC	28
+#define INDEP_THROTTLER_STATUS_BIT_TDC_GFX	29
+#define INDEP_THROTTLER_STATUS_BIT_TDC_CVIP	30
+
  struct smu_hw_power_state {
  	unsigned int magic;
  };

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