aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/2355-drm-amd-powerplay-add-function-get_current_activity_.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/2355-drm-amd-powerplay-add-function-get_current_activity_.patch')
-rw-r--r--meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/2355-drm-amd-powerplay-add-function-get_current_activity_.patch56
1 files changed, 56 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/2355-drm-amd-powerplay-add-function-get_current_activity_.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/2355-drm-amd-powerplay-add-function-get_current_activity_.patch
new file mode 100644
index 00000000..f34c7363
--- /dev/null
+++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/2355-drm-amd-powerplay-add-function-get_current_activity_.patch
@@ -0,0 +1,56 @@
+From 5bd27b91300f15dfb1a4d133e1f7843bf0ee1b77 Mon Sep 17 00:00:00 2001
+From: Kevin Wang <kevin1.wang@amd.com>
+Date: Tue, 23 Apr 2019 11:10:30 +0800
+Subject: [PATCH 2355/2940] drm/amd/powerplay: add function
+ get_current_activity_percent for navi10
+
+add callback function get_current_activity_percent for navi10 asic
+
+Signed-off-by: Kevin Wang <kevin1.wang@amd.com>
+Reviewed-by: Huang Rui <ray.huang@amd.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+---
+ drivers/gpu/drm/amd/powerplay/navi10_ppt.c | 20 ++++++++++++++++++++
+ 1 file changed, 20 insertions(+)
+
+diff --git a/drivers/gpu/drm/amd/powerplay/navi10_ppt.c b/drivers/gpu/drm/amd/powerplay/navi10_ppt.c
+index e21a1eaee8b9..711da04c30a8 100644
+--- a/drivers/gpu/drm/amd/powerplay/navi10_ppt.c
++++ b/drivers/gpu/drm/amd/powerplay/navi10_ppt.c
+@@ -767,6 +767,25 @@ static int navi10_get_gpu_power(struct smu_context *smu, uint32_t *value)
+ return 0;
+ }
+
++static int navi10_get_current_activity_percent(struct smu_context *smu,
++ uint32_t *value)
++{
++ int ret = 0;
++ SmuMetrics_t metrics;
++
++ if (!value)
++ return -EINVAL;
++
++ ret = smu_update_table(smu, SMU_TABLE_SMU_METRICS,
++ (void *)&metrics, false);
++ if (ret)
++ return ret;
++
++ *value = metrics.AverageGfxActivity;
++
++ return 0;
++}
++
+ static const struct pptable_funcs navi10_ppt_funcs = {
+ .tables_init = navi10_tables_init,
+ .alloc_dpm_context = navi10_allocate_dpm_context,
+@@ -791,6 +810,7 @@ static const struct pptable_funcs navi10_ppt_funcs = {
+ .force_dpm_limit_value = navi10_force_dpm_limit_value,
+ .unforce_dpm_levels = navi10_unforce_dpm_levels,
+ .get_gpu_power = navi10_get_gpu_power,
++ .get_current_activity_percent = navi10_get_current_activity_percent,
+ };
+
+ void navi10_set_ppt_funcs(struct smu_context *smu)
+--
+2.17.1
+