drm/radeon/ci: implement get_current_sclk/mclk
authorAlex Deucher <alexander.deucher@amd.com>
Tue, 30 Sep 2014 14:54:05 +0000 (10:54 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 19 Mar 2015 16:26:34 +0000 (12:26 -0400)
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>
drivers/gpu/drm/radeon/ci_dpm.c
drivers/gpu/drm/radeon/radeon_asic.c
drivers/gpu/drm/radeon/radeon_asic.h

index bcd2f1fe803fa9e35fc654625c496d98efe29f69..8730562323a8b77d0dd86ec399207806a6807ddc 100644 (file)
@@ -5922,6 +5922,20 @@ void ci_dpm_print_power_state(struct radeon_device *rdev,
        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)
 {
        struct ci_power_info *pi = ci_get_pi(rdev);
index 7826493eb58771a7d7177684ebaf3777530d8338..63bbd66344b000693f494a0cfb4c1273abaf74e2 100644 (file)
@@ -2137,6 +2137,8 @@ static struct radeon_asic ci_asic = {
                .fan_ctrl_get_mode = &ci_fan_ctrl_get_mode,
                .get_fan_speed_percent = &ci_fan_ctrl_get_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 = {
                .page_flip = &evergreen_page_flip,
index 23ba9d72005cafbd85454949e538e8f84eb6c139..dd4f8bcb96335b913cc835be602c65d44278c2e7 100644 (file)
@@ -874,6 +874,8 @@ int ci_dpm_force_performance_level(struct radeon_device *rdev,
                                   enum radeon_dpm_forced_level level);
 bool ci_dpm_vblank_too_short(struct radeon_device *rdev);
 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,
                                                 u32 *speed);