summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
diff options
context:
space:
mode:
authorDarren Powell <darren.powell@amd.com>2020-10-24 21:28:00 -0400
committerAlex Deucher <alexander.deucher@amd.com>2021-02-26 17:16:52 -0500
commit4df144f80d5b67895317833a5e7b9ecc34642bec (patch)
tree906af93fac2a7ee9baf16c78c558871ce5718980 /drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
parent996aede28094465381e977f249ab07fecb6e7e87 (diff)
downloadlinux-stable-4df144f80d5b67895317833a5e7b9ecc34642bec.tar.gz
linux-stable-4df144f80d5b67895317833a5e7b9ecc34642bec.tar.bz2
linux-stable-4df144f80d5b67895317833a5e7b9ecc34642bec.zip
amdgpu/pm: Powerplay API for smu , added get_performance_level
v2: updated the structure name to swsmu_pm_funcs Modified Functions smu_get_performance_level() - modifed arg0 to match Powerplay API get_performance_level Other Changes added a new structure swsmu_dpm_funcs to hold smu functions for Powerplay API removed special smu handling from amdgpu_get_power_dpm_force_performance_level Signed-off-by: Darren Powell <darren.powell@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Evan Quan <evan.quan@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c')
-rw-r--r--drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
index d143ef1b460b..1c77444c75b5 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
@@ -46,6 +46,8 @@
#undef pr_info
#undef pr_debug
+static const struct amd_pm_funcs swsmu_pm_funcs;
+
size_t smu_sys_get_pp_feature_mask(struct smu_context *smu, char *buf)
{
size_t size = 0;
@@ -553,6 +555,9 @@ static int smu_early_init(void *handle)
smu->smu_baco.state = SMU_BACO_STATE_EXIT;
smu->smu_baco.platform_support = false;
+ adev->powerplay.pp_handle = smu;
+ adev->powerplay.pp_funcs = &swsmu_pm_funcs;
+
return smu_set_funcs(adev);
}
@@ -1691,8 +1696,9 @@ int smu_switch_power_profile(struct smu_context *smu,
return 0;
}
-enum amd_dpm_forced_level smu_get_performance_level(struct smu_context *smu)
+enum amd_dpm_forced_level smu_get_performance_level(void *handle)
{
+ struct smu_context *smu = handle;
struct smu_dpm_context *smu_dpm_ctx = &(smu->smu_dpm);
enum amd_dpm_forced_level level;
@@ -2723,3 +2729,7 @@ int smu_gfx_state_change_set(struct smu_context *smu, uint32_t state)
return ret;
}
+
+static const struct amd_pm_funcs swsmu_pm_funcs = {
+ .get_performance_level = smu_get_performance_level,
+};