summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/powerplay/navi10_ppt.c
diff options
context:
space:
mode:
authorEvan Quan <evan.quan@amd.com>2020-06-08 16:41:16 +0800
committerAlex Deucher <alexander.deucher@amd.com>2020-07-01 01:59:18 -0400
commita141b4e3c722c1c0f72177e258f2cb591949018b (patch)
tree10105ad4438d1545968812b9d15b8b4d430e0d71 /drivers/gpu/drm/amd/powerplay/navi10_ppt.c
parent1e239fdd31cdf1729bc1e8b4538bf590bd28de57 (diff)
drm/amd/powerplay: simplify the code around retrieving power limit
Use the cached max/current power limit for other cases except .late_init. Signed-off-by: Evan Quan <evan.quan@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/powerplay/navi10_ppt.c')
-rw-r--r--drivers/gpu/drm/amd/powerplay/navi10_ppt.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/navi10_ppt.c b/drivers/gpu/drm/amd/powerplay/navi10_ppt.c
index b867f94ba559..2e0836976001 100644
--- a/drivers/gpu/drm/amd/powerplay/navi10_ppt.c
+++ b/drivers/gpu/drm/amd/powerplay/navi10_ppt.c
@@ -1922,9 +1922,7 @@ static uint32_t navi10_get_pptable_power_limit(struct smu_context *smu)
return pptable->SocketPowerLimitAc[PPT_THROTTLER_PPT0];
}
-static int navi10_get_power_limit(struct smu_context *smu,
- uint32_t *limit,
- bool cap)
+static int navi10_get_power_limit(struct smu_context *smu)
{
struct smu_11_0_powerplay_table *powerplay_table =
(struct smu_11_0_powerplay_table *)smu->smu_table.power_play_table;
@@ -1952,8 +1950,6 @@ static int navi10_get_power_limit(struct smu_context *smu,
}
smu->max_power_limit = power_limit;
- *limit = (cap ? smu->max_power_limit : smu->current_power_limit);
-
return 0;
}