Commit dbbd3c81 authored by Alex Deucher's avatar Alex Deucher

drm/radeon/ci: 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 ca1110bc
...@@ -5922,6 +5922,20 @@ void ci_dpm_print_power_state(struct radeon_device *rdev, ...@@ -5922,6 +5922,20 @@ void ci_dpm_print_power_state(struct radeon_device *rdev,
r600_dpm_print_ps_status(rdev, rps); r600_dpm_print_ps_status(rdev, rps);
} }
u32 ci_dpm_get_current_sclk(struct radeon_device *rdev)
{
u32 sclk = ci_get_average_sclk_freq(rdev);
return sclk;
}
u32 ci_dpm_get_current_mclk(struct radeon_device *rdev)
{
u32 mclk = ci_get_average_mclk_freq(rdev);
return mclk;
}
u32 ci_dpm_get_sclk(struct radeon_device *rdev, bool low) u32 ci_dpm_get_sclk(struct radeon_device *rdev, bool low)
{ {
struct ci_power_info *pi = ci_get_pi(rdev); struct ci_power_info *pi = ci_get_pi(rdev);
......
...@@ -2137,6 +2137,8 @@ static struct radeon_asic ci_asic = { ...@@ -2137,6 +2137,8 @@ static struct radeon_asic ci_asic = {
.fan_ctrl_get_mode = &ci_fan_ctrl_get_mode, .fan_ctrl_get_mode = &ci_fan_ctrl_get_mode,
.get_fan_speed_percent = &ci_fan_ctrl_get_fan_speed_percent, .get_fan_speed_percent = &ci_fan_ctrl_get_fan_speed_percent,
.set_fan_speed_percent = &ci_fan_ctrl_set_fan_speed_percent, .set_fan_speed_percent = &ci_fan_ctrl_set_fan_speed_percent,
.get_current_sclk = &ci_dpm_get_current_sclk,
.get_current_mclk = &ci_dpm_get_current_mclk,
}, },
.pflip = { .pflip = {
.page_flip = &evergreen_page_flip, .page_flip = &evergreen_page_flip,
......
...@@ -874,6 +874,8 @@ int ci_dpm_force_performance_level(struct radeon_device *rdev, ...@@ -874,6 +874,8 @@ int ci_dpm_force_performance_level(struct radeon_device *rdev,
enum radeon_dpm_forced_level level); enum radeon_dpm_forced_level level);
bool ci_dpm_vblank_too_short(struct radeon_device *rdev); bool ci_dpm_vblank_too_short(struct radeon_device *rdev);
void ci_dpm_powergate_uvd(struct radeon_device *rdev, bool gate); void ci_dpm_powergate_uvd(struct radeon_device *rdev, bool gate);
u32 ci_dpm_get_current_sclk(struct radeon_device *rdev);
u32 ci_dpm_get_current_mclk(struct radeon_device *rdev);
int ci_fan_ctrl_get_fan_speed_percent(struct radeon_device *rdev, int ci_fan_ctrl_get_fan_speed_percent(struct radeon_device *rdev,
u32 *speed); u32 *speed);
......
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