Commit 7ce9cdae authored by Alex Deucher's avatar Alex Deucher

drm/radeon/tn: implement get_current_sclk/mclk

Will be used for exposing current clocks via INFO ioctl.
Tested-by: default avatarMarek Olšák <marek.olsak@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 2f8e1eb7
...@@ -1833,6 +1833,8 @@ static struct radeon_asic trinity_asic = { ...@@ -1833,6 +1833,8 @@ static struct radeon_asic trinity_asic = {
.debugfs_print_current_performance_level = &trinity_dpm_debugfs_print_current_performance_level, .debugfs_print_current_performance_level = &trinity_dpm_debugfs_print_current_performance_level,
.force_performance_level = &trinity_dpm_force_performance_level, .force_performance_level = &trinity_dpm_force_performance_level,
.enable_bapm = &trinity_dpm_enable_bapm, .enable_bapm = &trinity_dpm_enable_bapm,
.get_current_sclk = &trinity_dpm_get_current_sclk,
.get_current_mclk = &trinity_dpm_get_current_mclk,
}, },
.pflip = { .pflip = {
.page_flip = &evergreen_page_flip, .page_flip = &evergreen_page_flip,
......
...@@ -686,6 +686,8 @@ void trinity_dpm_debugfs_print_current_performance_level(struct radeon_device *r ...@@ -686,6 +686,8 @@ void trinity_dpm_debugfs_print_current_performance_level(struct radeon_device *r
int trinity_dpm_force_performance_level(struct radeon_device *rdev, int trinity_dpm_force_performance_level(struct radeon_device *rdev,
enum radeon_dpm_forced_level level); enum radeon_dpm_forced_level level);
void trinity_dpm_enable_bapm(struct radeon_device *rdev, bool enable); void trinity_dpm_enable_bapm(struct radeon_device *rdev, bool enable);
u32 trinity_dpm_get_current_sclk(struct radeon_device *rdev);
u32 trinity_dpm_get_current_mclk(struct radeon_device *rdev);
/* DCE6 - SI */ /* DCE6 - SI */
void dce6_bandwidth_update(struct radeon_device *rdev); void dce6_bandwidth_update(struct radeon_device *rdev);
......
...@@ -1964,6 +1964,31 @@ void trinity_dpm_debugfs_print_current_performance_level(struct radeon_device *r ...@@ -1964,6 +1964,31 @@ void trinity_dpm_debugfs_print_current_performance_level(struct radeon_device *r
} }
} }
u32 trinity_dpm_get_current_sclk(struct radeon_device *rdev)
{
struct trinity_power_info *pi = trinity_get_pi(rdev);
struct radeon_ps *rps = &pi->current_rps;
struct trinity_ps *ps = trinity_get_ps(rps);
struct trinity_pl *pl;
u32 current_index =
(RREG32(TARGET_AND_CURRENT_PROFILE_INDEX) & CURRENT_STATE_MASK) >>
CURRENT_STATE_SHIFT;
if (current_index >= ps->num_levels) {
return 0;
} else {
pl = &ps->levels[current_index];
return pl->sclk;
}
}
u32 trinity_dpm_get_current_mclk(struct radeon_device *rdev)
{
struct trinity_power_info *pi = trinity_get_pi(rdev);
return pi->sys_info.bootup_uma_clk;
}
void trinity_dpm_fini(struct radeon_device *rdev) void trinity_dpm_fini(struct radeon_device *rdev)
{ {
int i; int i;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment