aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/linux-yocto-4.19.8/1463-drm-amd-powerplay-implement-uvd-vce-dpm-enable-funct.patch
diff options
context:
space:
mode:
Diffstat (limited to 'common/recipes-kernel/linux/linux-yocto-4.19.8/1463-drm-amd-powerplay-implement-uvd-vce-dpm-enable-funct.patch')
-rw-r--r--common/recipes-kernel/linux/linux-yocto-4.19.8/1463-drm-amd-powerplay-implement-uvd-vce-dpm-enable-funct.patch86
1 files changed, 86 insertions, 0 deletions
diff --git a/common/recipes-kernel/linux/linux-yocto-4.19.8/1463-drm-amd-powerplay-implement-uvd-vce-dpm-enable-funct.patch b/common/recipes-kernel/linux/linux-yocto-4.19.8/1463-drm-amd-powerplay-implement-uvd-vce-dpm-enable-funct.patch
new file mode 100644
index 00000000..a112738d
--- /dev/null
+++ b/common/recipes-kernel/linux/linux-yocto-4.19.8/1463-drm-amd-powerplay-implement-uvd-vce-dpm-enable-funct.patch
@@ -0,0 +1,86 @@
+From 23d884912896ad5b46e50efdda04981b64cf18eb Mon Sep 17 00:00:00 2001
+From: Kevin Wang <kevin1.wang@amd.com>
+Date: Thu, 24 Jan 2019 19:58:11 +0800
+Subject: [PATCH 1463/2940] drm/amd/powerplay: implement uvd & vce dpm enable
+ functions
+
+add dpm enable functions for vce,uvd.
+
+Signed-off-by: Kevin Wang <kevin1.wang@amd.com>
+Reviewed-by: Huang Rui <ray.huang@amd.com>
+Acked-by: Alex Deucher <alexander.deucher@amd.com>
+---
+ .../gpu/drm/amd/powerplay/inc/amdgpu_smu.h | 6 +++++
+ drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 25 +++++++++++++++++++
+ 2 files changed, 31 insertions(+)
+
+diff --git a/drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h b/drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h
+index 101f04d0770e..955b3508f1ce 100644
+--- a/drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h
++++ b/drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h
+@@ -514,6 +514,8 @@ struct smu_funcs
+ int (*update_od8_settings)(struct smu_context *smu,
+ uint32_t index,
+ uint32_t value);
++ int (*dpm_set_uvd_enable)(struct smu_context *smu, bool enable);
++ int (*dpm_set_vce_enable)(struct smu_context *smu, bool enable);
+ };
+
+ #define smu_init_microcode(smu) \
+@@ -659,6 +661,10 @@ struct smu_funcs
+ ((smu)->funcs->notify_smu_enable_pwe ? (smu)->funcs->notify_smu_enable_pwe((smu)) : 0)
+ #define smu_set_watermarks_for_clock_ranges(smu, clock_ranges) \
+ ((smu)->funcs->set_watermarks_for_clock_ranges ? (smu)->funcs->set_watermarks_for_clock_ranges((smu), (clock_ranges)) : 0)
++#define smu_dpm_set_uvd_enable(smu, enable) \
++ ((smu)->funcs->dpm_set_uvd_enable ? (smu)->funcs->dpm_set_uvd_enable((smu), (enable)) : 0)
++#define smu_dpm_set_vce_enable(smu, enable) \
++ ((smu)->funcs->dpm_set_vce_enable ? (smu)->funcs->dpm_set_vce_enable((smu), (enable)) : 0)
+
+
+ extern int smu_get_atom_data_table(struct smu_context *smu, uint32_t table,
+diff --git a/drivers/gpu/drm/amd/powerplay/smu_v11_0.c b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c
+index 400d981bda5a..cdaf23f82016 100644
+--- a/drivers/gpu/drm/amd/powerplay/smu_v11_0.c
++++ b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c
+@@ -1590,6 +1590,28 @@ static int smu_v11_0_update_od8_settings(struct smu_context *smu,
+ return 0;
+ }
+
++static int smu_v11_0_dpm_set_uvd_enable(struct smu_context *smu, bool enable)
++{
++ if (!smu_feature_is_supported(smu, FEATURE_DPM_VCE_BIT))
++ return 0;
++
++ if (enable == smu_feature_is_enabled(smu, FEATURE_DPM_VCE_BIT))
++ return 0;
++
++ return smu_feature_set_enabled(smu, FEATURE_DPM_VCE_BIT, enable);
++}
++
++static int smu_v11_0_dpm_set_vce_enable(struct smu_context *smu, bool enable)
++{
++ if (!smu_feature_is_supported(smu, FEATURE_DPM_UVD_BIT))
++ return 0;
++
++ if (enable == smu_feature_is_enabled(smu, FEATURE_DPM_UVD_BIT))
++ return 0;
++
++ return smu_feature_set_enabled(smu, FEATURE_DPM_UVD_BIT, enable);
++}
++
+ static const struct smu_funcs smu_v11_0_funcs = {
+ .init_microcode = smu_v11_0_init_microcode,
+ .load_microcode = smu_v11_0_load_microcode,
+@@ -1635,6 +1657,9 @@ static const struct smu_funcs smu_v11_0_funcs = {
+ .get_power_profile_mode = smu_v11_0_get_power_profile_mode,
+ .set_power_profile_mode = smu_v11_0_set_power_profile_mode,
+ .update_od8_settings = smu_v11_0_update_od8_settings,
++ .dpm_set_uvd_enable = smu_v11_0_dpm_set_uvd_enable,
++ .dpm_set_vce_enable = smu_v11_0_dpm_set_vce_enable,
++
+ };
+
+ void smu_v11_0_set_smu_funcs(struct smu_context *smu)
+--
+2.17.1
+