Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+19
+18
drivers/gpu/drm/radeon/r600_dpm.c
··· 174 174 return vblank_time_us; 175 175 } 176 176 177 + u32 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 + 177 195 void r600_calculate_u_and_p(u32 i, u32 r_c, u32 p_b, 178 196 u32 *p, u32 *u) 179 197 {
+1
drivers/gpu/drm/radeon/r600_dpm.h
··· 130 130 void r600_dpm_print_ps_status(struct radeon_device *rdev, 131 131 struct radeon_ps *rps); 132 132 u32 r600_dpm_get_vblank_time(struct radeon_device *rdev); 133 + u32 r600_dpm_get_vrefresh(struct radeon_device *rdev); 133 134 bool r600_is_uvd_state(u32 class, u32 class2); 134 135 void r600_calculate_u_and_p(u32 i, u32 r_c, u32 p_b, 135 136 u32 *p, u32 *u);