aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/linux-yocto-4.19.8/1731-drm-amd-powerplay-optimization-function-of-smu_updat.patch
diff options
context:
space:
mode:
Diffstat (limited to 'common/recipes-kernel/linux/linux-yocto-4.19.8/1731-drm-amd-powerplay-optimization-function-of-smu_updat.patch')
-rw-r--r--common/recipes-kernel/linux/linux-yocto-4.19.8/1731-drm-amd-powerplay-optimization-function-of-smu_updat.patch70
1 files changed, 70 insertions, 0 deletions
diff --git a/common/recipes-kernel/linux/linux-yocto-4.19.8/1731-drm-amd-powerplay-optimization-function-of-smu_updat.patch b/common/recipes-kernel/linux/linux-yocto-4.19.8/1731-drm-amd-powerplay-optimization-function-of-smu_updat.patch
new file mode 100644
index 00000000..6e6ba477
--- /dev/null
+++ b/common/recipes-kernel/linux/linux-yocto-4.19.8/1731-drm-amd-powerplay-optimization-function-of-smu_updat.patch
@@ -0,0 +1,70 @@
+From a81128b86797d56691c62dfef35d27840f55fdee Mon Sep 17 00:00:00 2001
+From: Kevin Wang <kevin1.wang@amd.com>
+Date: Mon, 8 Apr 2019 16:15:36 +0800
+Subject: [PATCH 1731/2940] drm/amd/powerplay: optimization function of
+ smu_update_table
+
+in fact, the firmware need 2 parameter: 1.table_id, 2.XferArg
+so change the function interface to match the firmware code
+
+Signed-off-by: Kevin Wang <kevin1.wang@amd.com>
+Reviewed-by: Evan Quan <evan.quan@amd.com>
+---
+ drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 7 +++++--
+ drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h | 5 ++++-
+ 2 files changed, 9 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
+index 7e8c74da6a74..c058c784180e 100644
+--- a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
++++ b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
+@@ -97,16 +97,19 @@ int smu_common_read_sensor(struct smu_context *smu, enum amd_pp_sensors sensor,
+ return ret;
+ }
+
+-int smu_update_table(struct smu_context *smu, uint32_t table_id,
++int smu_update_table_with_arg(struct smu_context *smu, uint16_t table_id, uint16_t exarg,
+ void *table_data, bool drv2smu)
+ {
+ struct smu_table_context *smu_table = &smu->smu_table;
+ struct smu_table *table = NULL;
+ int ret = 0;
++ uint32_t table_index;
+
+ if (!table_data || table_id >= smu_table->table_count)
+ return -EINVAL;
+
++ table_index = (exarg << 16) | table_id;
++
+ table = &smu_table->tables[table_id];
+
+ if (drv2smu)
+@@ -123,7 +126,7 @@ int smu_update_table(struct smu_context *smu, uint32_t table_id,
+ ret = smu_send_smc_msg_with_param(smu, drv2smu ?
+ SMU_MSG_TransferTableDram2Smu :
+ SMU_MSG_TransferTableSmu2Dram,
+- table_id);
++ table_index);
+ if (ret)
+ return ret;
+
+diff --git a/drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h b/drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h
+index 2083139533e9..c146b5e884f8 100644
+--- a/drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h
++++ b/drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h
+@@ -745,8 +745,11 @@ extern int smu_feature_set_enabled(struct smu_context *smu, int feature_id, bool
+ extern int smu_feature_is_supported(struct smu_context *smu, int feature_id);
+ extern int smu_feature_set_supported(struct smu_context *smu, int feature_id, bool enable);
+
+-int smu_update_table(struct smu_context *smu, uint32_t table_id,
++int smu_update_table_with_arg(struct smu_context *smu, uint16_t table_id, uint16_t exarg,
+ void *table_data, bool drv2smu);
++#define smu_update_table(smu, table_id, table_data, drv2smu) \
++ smu_update_table_with_arg((smu), (table_id), 0, (table_data), (drv2smu))
++
+ bool is_support_sw_smu(struct amdgpu_device *adev);
+ int smu_reset(struct smu_context *smu);
+ int smu_common_read_sensor(struct smu_context *smu, enum amd_pp_sensors sensor,
+--
+2.17.1
+