From: Graham Sider <Graham.Sider@amd.com>
To: <amd-gfx@lists.freedesktop.org>
Cc: Harish.Kasiviswanathan@amd.com,
Graham Sider <Graham.Sider@amd.com>,
Elena.Sakhnovitch@amd.com
Subject: [PATCH v5 1/9] drm/amd/pm: Add u64 throttler status field to gpu_metrics
Date: Mon, 7 Jun 2021 09:44:31 -0400 [thread overview]
Message-ID: <20210607134439.28542-1-Graham.Sider@amd.com> (raw)
This patch set adds support for a new ASIC independant u64 throttler
status field (indep_throttle_status). Piggybacks off the
gpu_metrics_v1_3 bump and similarly bumps gpu_metrics_v2 version (to
v2_2) to add field.
Signed-off-by: Graham Sider <Graham.Sider@amd.com>
---
.../gpu/drm/amd/include/kgd_pp_interface.h | 58 ++++++++++++++++++-
drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c | 3 +
2 files changed, 60 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/include/kgd_pp_interface.h b/drivers/gpu/drm/amd/include/kgd_pp_interface.h
index 7bc7492f37b9..271018ce739b 100644
--- a/drivers/gpu/drm/amd/include/kgd_pp_interface.h
+++ b/drivers/gpu/drm/amd/include/kgd_pp_interface.h
@@ -579,7 +579,7 @@ struct gpu_metrics_v1_3 {
uint16_t current_vclk1;
uint16_t current_dclk1;
- /* Throttle status */
+ /* Throttle status (ASIC dependent) */
uint32_t throttle_status;
/* Fans */
@@ -605,6 +605,9 @@ struct gpu_metrics_v1_3 {
uint16_t voltage_mem;
uint16_t padding1;
+
+ /* Throttle status (ASIC independent) */
+ uint64_t indep_throttle_status;
};
/*
@@ -711,4 +714,57 @@ struct gpu_metrics_v2_1 {
uint16_t padding[3];
};
+struct gpu_metrics_v2_2 {
+ struct metrics_table_header common_header;
+
+ /* Temperature */
+ uint16_t temperature_gfx; // gfx temperature on APUs
+ uint16_t temperature_soc; // soc temperature on APUs
+ uint16_t temperature_core[8]; // CPU core temperature on APUs
+ uint16_t temperature_l3[2];
+
+ /* Utilization */
+ uint16_t average_gfx_activity;
+ uint16_t average_mm_activity; // UVD or VCN
+
+ /* Driver attached timestamp (in ns) */
+ uint64_t system_clock_counter;
+
+ /* Power/Energy */
+ uint16_t average_socket_power; // dGPU + APU power on A + A platform
+ uint16_t average_cpu_power;
+ uint16_t average_soc_power;
+ uint16_t average_gfx_power;
+ uint16_t average_core_power[8]; // CPU core power on APUs
+
+ /* Average clocks */
+ uint16_t average_gfxclk_frequency;
+ uint16_t average_socclk_frequency;
+ uint16_t average_uclk_frequency;
+ uint16_t average_fclk_frequency;
+ uint16_t average_vclk_frequency;
+ uint16_t average_dclk_frequency;
+
+ /* Current clocks */
+ uint16_t current_gfxclk;
+ uint16_t current_socclk;
+ uint16_t current_uclk;
+ uint16_t current_fclk;
+ uint16_t current_vclk;
+ uint16_t current_dclk;
+ uint16_t current_coreclk[8]; // CPU core clocks
+ uint16_t current_l3clk[2];
+
+ /* Throttle status (ASIC dependent) */
+ uint32_t throttle_status;
+
+ /* Fans */
+ uint16_t fan_pwm;
+
+ uint16_t padding[3];
+
+ /* Throttle status (ASIC independent) */
+ uint64_t indep_throttle_status;
+};
+
#endif
diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c b/drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c
index 0ceb7329838c..01645537d9ab 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c
@@ -773,6 +773,9 @@ void smu_cmn_init_soft_gpu_metrics(void *table, uint8_t frev, uint8_t crev)
case METRICS_VERSION(2, 1):
structure_size = sizeof(struct gpu_metrics_v2_1);
break;
+ case METRICS_VERSION(2, 2):
+ structure_size = sizeof(struct gpu_metrics_v2_2);
+ break;
default:
return;
}
--
2.17.1
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
next reply other threads:[~2021-06-07 13:45 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-07 13:44 Graham Sider [this message]
2021-06-07 13:44 ` [PATCH v5 2/9] drm/amd/pm: Add ASIC independent throttle bits Graham Sider
2021-06-07 13:44 ` [PATCH v5 3/9] drm/amd/pm: Add common throttler translation func Graham Sider
2021-06-07 13:44 ` [PATCH v5 4/9] drm/amd/pm: Add arcturus throttler translation Graham Sider
2021-06-07 13:44 ` [PATCH v5 5/9] drm/amd/pm: Add navi1x " Graham Sider
2021-06-07 13:44 ` [PATCH v5 6/9] drm/amd/pm: Add sienna cichlid " Graham Sider
2021-06-07 13:44 ` [PATCH v5 7/9] drm/amd/pm: Add vangogh " Graham Sider
2021-06-07 14:35 ` Lazar, Lijo
2021-06-07 14:53 ` Sider, Graham
2021-06-08 7:26 ` Lazar, Lijo
2021-06-07 13:44 ` [PATCH v5 8/9] drm/amd/pm: Add renoir " Graham Sider
2021-06-07 13:44 ` [PATCH v5 9/9] drm/amd/pm: Add aldebaran " Graham Sider
2021-06-08 2:19 ` Quan, Evan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210607134439.28542-1-Graham.Sider@amd.com \
--to=graham.sider@amd.com \
--cc=Elena.Sakhnovitch@amd.com \
--cc=Harish.Kasiviswanathan@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.