diff options
author | Huang Rui | 2019-03-31 06:02:00 +0200 |
---|---|---|
committer | Alex Deucher | 2019-06-22 01:59:26 +0200 |
commit | 33bd73ae6c615754cffb94336abbbd8bb841eb34 (patch) | |
tree | d5cda9f35c6c4b5a4778770fcf7db05fdcdd3db3 /drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | |
parent | drm/amd/powerplay/smu11: remove smu_update_table_with_arg (diff) | |
download | kernel-qcow2-linux-33bd73ae6c615754cffb94336abbbd8bb841eb34.tar.gz kernel-qcow2-linux-33bd73ae6c615754cffb94336abbbd8bb841eb34.tar.xz kernel-qcow2-linux-33bd73ae6c615754cffb94336abbbd8bb841eb34.zip |
drm/amd/powerplay: modify smu_update_table to use SMU_TABLE_xxx as the input
Table id may be different for each asic, so it's good to use this as the input
for common interface.
Signed-off-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: Kevin Wang <kevin1.wang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/powerplay/amdgpu_smu.c')
-rw-r--r-- | drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c index fedd5ff694f2..fd628fc3c255 100644 --- a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c +++ b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c @@ -127,18 +127,18 @@ 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_index, +int smu_update_table(struct smu_context *smu, enum smu_table_id table_index, void *table_data, bool drv2smu) { struct smu_table_context *smu_table = &smu->smu_table; struct smu_table *table = NULL; int ret = 0; - int table_id = table_index & 0xffff; + int table_id = smu_table_get_index(smu, table_index); if (!table_data || table_id >= smu_table->table_count) return -EINVAL; - table = &smu_table->tables[table_id]; + table = &smu_table->tables[table_index]; if (drv2smu) memcpy(table->cpu_addr, table_data, table->size); @@ -154,7 +154,7 @@ int smu_update_table(struct smu_context *smu, uint32_t table_index, ret = smu_send_smc_msg_with_param(smu, drv2smu ? SMU_MSG_TransferTableDram2Smu : SMU_MSG_TransferTableSmu2Dram, - table_index); + table_id); if (ret) return ret; |