diff options
author | Alex Deucher <alexander.deucher@amd.com> | 2013-07-19 20:42:08 +0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2013-08-31 00:30:27 +0400 |
commit | 6bb5c0d74c1962a8b1c722521c01e19d38c47370 (patch) | |
tree | 3983222ad86524346798a4dd37c30fabe0ecd471 /drivers/gpu/drm/radeon/r600_dpm.c | |
parent | 61fb192a1cf87413e19f565495595c8c116d7c10 (diff) | |
download | linux-6bb5c0d74c1962a8b1c722521c01e19d38c47370.tar.xz |
drm/radeon/dpm: add helper to fetch the vrefresh of the current mode
Needed for DPM on CI.
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/r600_dpm.c')
-rw-r--r-- | drivers/gpu/drm/radeon/r600_dpm.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/r600_dpm.c b/drivers/gpu/drm/radeon/r600_dpm.c index 89c46c55f93d..26a787836032 100644 --- a/drivers/gpu/drm/radeon/r600_dpm.c +++ b/drivers/gpu/drm/radeon/r600_dpm.c @@ -174,6 +174,24 @@ u32 r600_dpm_get_vblank_time(struct radeon_device *rdev) return vblank_time_us; } +u32 r600_dpm_get_vrefresh(struct radeon_device *rdev) +{ + struct drm_device *dev = rdev->ddev; + struct drm_crtc *crtc; + struct radeon_crtc *radeon_crtc; + u32 vrefresh = 0; + + list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { + radeon_crtc = to_radeon_crtc(crtc); + if (crtc->enabled && radeon_crtc->enabled && radeon_crtc->hw_mode.clock) { + vrefresh = radeon_crtc->hw_mode.vrefresh; + break; + } + } + + return vrefresh; +} + void r600_calculate_u_and_p(u32 i, u32 r_c, u32 p_b, u32 *p, u32 *u) { |