aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2013-07-19 12:42:08 -0400
committerAlex Deucher <alexander.deucher@amd.com>2013-08-30 16:30:27 -0400
commit6bb5c0d74c1962a8b1c722521c01e19d38c47370 (patch)
tree3983222ad86524346798a4dd37c30fabe0ecd471 /drivers
parent61fb192a1cf87413e19f565495595c8c116d7c10 (diff)
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')
-rw-r--r--drivers/gpu/drm/radeon/r600_dpm.c18
-rw-r--r--drivers/gpu/drm/radeon/r600_dpm.h1
2 files changed, 19 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)
174 return vblank_time_us; 174 return vblank_time_us;
175} 175}
176 176
177u32 r600_dpm_get_vrefresh(struct radeon_device *rdev)
178{
179 struct drm_device *dev = rdev->ddev;
180 struct drm_crtc *crtc;
181 struct radeon_crtc *radeon_crtc;
182 u32 vrefresh = 0;
183
184 list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
185 radeon_crtc = to_radeon_crtc(crtc);
186 if (crtc->enabled && radeon_crtc->enabled && radeon_crtc->hw_mode.clock) {
187 vrefresh = radeon_crtc->hw_mode.vrefresh;
188 break;
189 }
190 }
191
192 return vrefresh;
193}
194
177void r600_calculate_u_and_p(u32 i, u32 r_c, u32 p_b, 195void r600_calculate_u_and_p(u32 i, u32 r_c, u32 p_b,
178 u32 *p, u32 *u) 196 u32 *p, u32 *u)
179{ 197{
diff --git a/drivers/gpu/drm/radeon/r600_dpm.h b/drivers/gpu/drm/radeon/r600_dpm.h
index 8dc1fbd9dbf1..1000bf9719f2 100644
--- a/drivers/gpu/drm/radeon/r600_dpm.h
+++ b/drivers/gpu/drm/radeon/r600_dpm.h
@@ -130,6 +130,7 @@ void r600_dpm_print_cap_info(u32 caps);
130void r600_dpm_print_ps_status(struct radeon_device *rdev, 130void r600_dpm_print_ps_status(struct radeon_device *rdev,
131 struct radeon_ps *rps); 131 struct radeon_ps *rps);
132u32 r600_dpm_get_vblank_time(struct radeon_device *rdev); 132u32 r600_dpm_get_vblank_time(struct radeon_device *rdev);
133u32 r600_dpm_get_vrefresh(struct radeon_device *rdev);
133bool r600_is_uvd_state(u32 class, u32 class2); 134bool r600_is_uvd_state(u32 class, u32 class2);
134void r600_calculate_u_and_p(u32 i, u32 r_c, u32 p_b, 135void r600_calculate_u_and_p(u32 i, u32 r_c, u32 p_b,
135 u32 *p, u32 *u); 136 u32 *p, u32 *u);