aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/2345-drm-amd-powerplay-add-helper-function-of-smu_set_sof.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/2345-drm-amd-powerplay-add-helper-function-of-smu_set_sof.patch')
-rw-r--r--meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/2345-drm-amd-powerplay-add-helper-function-of-smu_set_sof.patch74
1 files changed, 74 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/2345-drm-amd-powerplay-add-helper-function-of-smu_set_sof.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/2345-drm-amd-powerplay-add-helper-function-of-smu_set_sof.patch
new file mode 100644
index 00000000..28ef25cf
--- /dev/null
+++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/2345-drm-amd-powerplay-add-helper-function-of-smu_set_sof.patch
@@ -0,0 +1,74 @@
+From 2e4a254d5860ac4215f0a6016172170a10780d3a Mon Sep 17 00:00:00 2001
+From: Kevin Wang <kevin1.wang@amd.com>
+Date: Fri, 19 Apr 2019 10:19:28 +0800
+Subject: [PATCH 2345/2940] drm/amd/powerplay: add helper function of
+ smu_set_soft_freq_range
+
+add this helper function to get dpm clk information.
+
+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/amdgpu_smu.c | 33 +++++++++++++++++++
+ .../gpu/drm/amd/powerplay/inc/amdgpu_smu.h | 2 ++
+ 2 files changed, 35 insertions(+)
+
+diff --git a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
+index c37f59b3995b..5404f32cc2c5 100644
+--- a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
++++ b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
+@@ -60,6 +60,39 @@ int smu_get_smc_version(struct smu_context *smu, uint32_t *if_version, uint32_t
+ return ret;
+ }
+
++int smu_set_soft_freq_range(struct smu_context *smu, enum smu_clk_type clk_type,
++ uint32_t min, uint32_t max)
++{
++ int ret = 0, clk_id = 0;
++ uint32_t param;
++
++ if (min <= 0 && max <= 0)
++ return -EINVAL;
++
++ clk_id = smu_clk_get_index(smu, clk_type);
++ if (clk_id < 0)
++ return clk_id;
++
++ if (max > 0) {
++ param = (uint32_t)((clk_id << 16) | (max & 0xffff));
++ ret = smu_send_smc_msg_with_param(smu, SMU_MSG_SetSoftMaxByFreq,
++ param);
++ if (ret)
++ return ret;
++ }
++
++ if (min > 0) {
++ param = (uint32_t)((clk_id << 16) | (min & 0xffff));
++ ret = smu_send_smc_msg_with_param(smu, SMU_MSG_SetSoftMinByFreq,
++ param);
++ if (ret)
++ return ret;
++ }
++
++
++ return ret;
++}
++
+ int smu_get_dpm_freq_range(struct smu_context *smu, enum smu_clk_type clk_type,
+ uint32_t *min, uint32_t *max)
+ {
+diff --git a/drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h b/drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h
+index 78993e4ee588..416ea7b85761 100644
+--- a/drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h
++++ b/drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h
+@@ -941,4 +941,6 @@ int smu_get_dpm_level_count(struct smu_context *smu, enum smu_clk_type clk_type,
+ uint32_t *value);
+ int smu_get_dpm_freq_range(struct smu_context *smu, enum smu_clk_type clk_type,
+ uint32_t *min, uint32_t *max);
++int smu_set_soft_freq_range(struct smu_context *smu, enum smu_clk_type clk_type,
++ uint32_t min, uint32_t max);
+ #endif
+--
+2.17.1
+