mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 23:32:14 +00:00
drm/radeon/tn: implement get_current_sclk/mclk
Will be used for exposing current clocks via INFO ioctl. Tested-by: Marek Olšák <marek.olsak@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
2f8e1eb7d6
commit
7ce9cdaec3
3 changed files with 29 additions and 0 deletions
|
@ -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)
|
||||
{
|
||||
int i;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue