diff options
author | Evan Quan <evan.quan@amd.com> | 2019-12-31 05:33:19 +0300 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2020-01-07 20:01:15 +0300 |
commit | 9fa1ed5bf628a871be52bb2d84ade8b108db8902 (patch) | |
tree | 3aa0b608e24a1c3b095258697345a0a76235622b /drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | |
parent | d5ec4b45682e21f0d954e532a70531dc19723265 (diff) | |
download | linux-9fa1ed5bf628a871be52bb2d84ade8b108db8902.tar.xz |
drm/amd/powerplay: cache the watermark settings on system memory
So that we do not need to allocate a piece of VRAM for it. This
is a preparation for coming change which unifies the VRAM address
for all driver tables interaction with SMU.
Signed-off-by: Evan Quan <evan.quan@amd.com>
Acked-by: Alex Deucher <alexander.deucher@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 | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c index d432ba08968a..3b6275831004 100644 --- a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c +++ b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c @@ -1929,32 +1929,25 @@ int smu_set_df_cstate(struct smu_context *smu, int smu_write_watermarks_table(struct smu_context *smu) { - int ret = 0; - struct smu_table_context *smu_table = &smu->smu_table; - struct smu_table *table = NULL; + void *watermarks_table = smu->smu_table.watermarks_table; - table = &smu_table->tables[SMU_TABLE_WATERMARKS]; - - if (!table->cpu_addr) + if (!watermarks_table) return -EINVAL; - ret = smu_update_table(smu, SMU_TABLE_WATERMARKS, 0, table->cpu_addr, + return smu_update_table(smu, + SMU_TABLE_WATERMARKS, + 0, + watermarks_table, true); - - return ret; } int smu_set_watermarks_for_clock_ranges(struct smu_context *smu, struct dm_pp_wm_sets_with_clock_ranges_soc15 *clock_ranges) { - struct smu_table *watermarks; - void *table; - - if (!smu->smu_table.tables) - return 0; + void *table = smu->smu_table.watermarks_table; - watermarks = &smu->smu_table.tables[SMU_TABLE_WATERMARKS]; - table = watermarks->cpu_addr; + if (!table) + return -EINVAL; mutex_lock(&smu->mutex); |