aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/linux-yocto-4.19.8/1426-drm-amd-powerplay-add-interface-to-get-clock-by-type.patch
diff options
context:
space:
mode:
Diffstat (limited to 'common/recipes-kernel/linux/linux-yocto-4.19.8/1426-drm-amd-powerplay-add-interface-to-get-clock-by-type.patch')
-rw-r--r--common/recipes-kernel/linux/linux-yocto-4.19.8/1426-drm-amd-powerplay-add-interface-to-get-clock-by-type.patch76
1 files changed, 76 insertions, 0 deletions
diff --git a/common/recipes-kernel/linux/linux-yocto-4.19.8/1426-drm-amd-powerplay-add-interface-to-get-clock-by-type.patch b/common/recipes-kernel/linux/linux-yocto-4.19.8/1426-drm-amd-powerplay-add-interface-to-get-clock-by-type.patch
new file mode 100644
index 00000000..97e7afb7
--- /dev/null
+++ b/common/recipes-kernel/linux/linux-yocto-4.19.8/1426-drm-amd-powerplay-add-interface-to-get-clock-by-type.patch
@@ -0,0 +1,76 @@
+From 87749ebce56d48bffc4301f4f52a7efd6c3b2c38 Mon Sep 17 00:00:00 2001
+From: Huang Rui <ray.huang@amd.com>
+Date: Mon, 14 Jan 2019 14:08:18 +0800
+Subject: [PATCH 1426/2940] drm/amd/powerplay: add interface to get clock by
+ type with voltage for display
+
+This patch adds inteface to get clock by type with voltage, display will use it
+to get current clocks with voltage.
+
+Signed-off-by: Huang Rui <ray.huang@amd.com>
+Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
+---
+ .../amd/display/amdgpu_dm/amdgpu_dm_pp_smu.c | 20 ++++++++++++-------
+ .../gpu/drm/amd/powerplay/inc/amdgpu_smu.h | 7 +++++++
+ 2 files changed, 20 insertions(+), 7 deletions(-)
+
+diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_pp_smu.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_pp_smu.c
+index 70be528fb12b..29946e1000fc 100644
+--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_pp_smu.c
++++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_pp_smu.c
+@@ -422,14 +422,20 @@ bool dm_pp_get_clock_levels_by_type_with_voltage(
+ void *pp_handle = adev->powerplay.pp_handle;
+ struct pp_clock_levels_with_voltage pp_clk_info = {0};
+ const struct amd_pm_funcs *pp_funcs = adev->powerplay.pp_funcs;
++ int ret;
+
+- if (!pp_funcs || !pp_funcs->get_clock_by_type_with_voltage)
+- return false;
+-
+- if (pp_funcs->get_clock_by_type_with_voltage(pp_handle,
+- dc_to_pp_clock_type(clk_type),
+- &pp_clk_info))
+- return false;
++ if (pp_funcs && pp_funcs->get_clock_by_type_with_voltage) {
++ ret = pp_funcs->get_clock_by_type_with_voltage(pp_handle,
++ dc_to_pp_clock_type(clk_type),
++ &pp_clk_info);
++ if (ret)
++ return false;
++ } else if (adev->smu.ppt_funcs && adev->smu.ppt_funcs->get_clock_by_type_with_voltage) {
++ if (smu_get_clock_by_type_with_voltage(&adev->smu,
++ dc_to_pp_clock_type(clk_type),
++ &pp_clk_info))
++ return false;
++ }
+
+ pp_to_dc_clock_levels_with_voltage(&pp_clk_info, clk_level_info, clk_type);
+
+diff --git a/drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h b/drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h
+index 7f1ea41c2190..9b0080427de6 100644
+--- a/drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h
++++ b/drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h
+@@ -229,6 +229,11 @@ struct pptable_funcs {
+ struct
+ pp_clock_levels_with_latency
+ *clocks);
++ int (*get_clock_by_type_with_voltage)(struct smu_context *smu,
++ enum amd_pp_clock_type type,
++ struct
++ pp_clock_levels_with_voltage
++ *clocks);
+ };
+
+ struct smu_funcs
+@@ -386,6 +391,8 @@ struct smu_funcs
+ ((smu)->funcs->get_max_high_clocks ? (smu)->funcs->get_max_high_clocks((smu), (clocks)) : 0)
+ #define smu_get_clock_by_type_with_latency(smu, type, clocks) \
+ ((smu)->ppt_funcs->get_clock_by_type_with_latency ? (smu)->ppt_funcs->get_clock_by_type_with_latency((smu), (type), (clocks)) : 0)
++#define smu_get_clock_by_type_with_voltage(smu, type, clocks) \
++ ((smu)->ppt_funcs->get_clock_by_type_with_voltage ? (smu)->ppt_funcs->get_clock_by_type_with_voltage((smu), (type), (clocks)) : 0)
+
+
+ extern int smu_get_atom_data_table(struct smu_context *smu, uint32_t table,
+--
+2.17.1
+