summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/radeon/sumo_dpm.c
diff options
context:
space:
mode:
authorSandeep Raghuraman <sandy.8925@gmail.com>2020-10-09 13:16:09 +0530
committerAlex Deucher <alexander.deucher@amd.com>2020-10-27 17:43:42 -0400
commitc57a8308e2cc2e83a268c0123ff2060f30a38950 (patch)
tree6bf232cf4b45c3fe31b959a9f4be66f7d126354d /drivers/gpu/drm/radeon/sumo_dpm.c
parentca22f3beb6f9a9c50728994c73044d4dfabea17d (diff)
drm/radeon: Add implementation of get_current_vddc for Sumo
Add implementation of get_current_vddc() callback for Sumo. Signed-off-by: Sandeep Raghuraman <sandy.8925@gmail.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/sumo_dpm.c')
-rw-r--r--drivers/gpu/drm/radeon/sumo_dpm.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/sumo_dpm.c b/drivers/gpu/drm/radeon/sumo_dpm.c
index b95d5d390caf..f74f381af05f 100644
--- a/drivers/gpu/drm/radeon/sumo_dpm.c
+++ b/drivers/gpu/drm/radeon/sumo_dpm.c
@@ -1865,6 +1865,26 @@ u32 sumo_dpm_get_current_mclk(struct radeon_device *rdev)
return pi->sys_info.bootup_uma_clk;
}
+u16 sumo_dpm_get_current_vddc(struct radeon_device *rdev)
+{
+ struct sumo_power_info *pi = sumo_get_pi(rdev);
+ struct radeon_ps *rps = &pi->current_rps;
+ struct sumo_ps *ps = sumo_get_ps(rps);
+ struct sumo_pl *pl;
+ u32 current_index =
+ (RREG32(TARGET_AND_CURRENT_PROFILE_INDEX) & CURR_INDEX_MASK) >>
+ CURR_INDEX_SHIFT;
+
+ if (current_index == BOOST_DPM_LEVEL) {
+ pl = &pi->boost_pl;
+ } else if (current_index >= ps->num_levels) {
+ return 0;
+ } else {
+ pl = &ps->levels[current_index];
+ }
+ return sumo_convert_voltage_index_to_value(rdev, pl->vddc_index);
+}
+
void sumo_dpm_fini(struct radeon_device *rdev)
{
int i;