drm/radeon/dpm/rs780: use drm_mode_vrefresh()
Subsystems (2)
PATCH 1/4 drm/radeon/dpm/rs780: use drm_mode_vrefresh()
Rather than open coding it.
--- drivers/gpu/drm/radeon/rs780_dpm.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpu/drm/radeon/rs780_dpm.c +1 -3
@@ -62,9 +62,7 @@ static void rs780_get_pm_mode_parameters(struct radeon_device *rdev) radeon_crtc =to_radeon_crtc (crtc); pi->crtc_id = radeon_crtc->crtc_id;if (crtc->mode.htotal && crtc->mode.vtotal) - pi->refresh_rate = - (crtc->mode.clock *1000 ) / - (crtc->mode.htotal * crtc->mode.vtotal); + pi->refresh_rate =drm_mode_vrefresh (&crtc->mode);break ; } }
Signature · 1 line
1.8.3.1
PATCH 2/4 drm/radeon/dpm/rs780: add some sanity checking to sclk scaling
Since the clock scaling is based on fb divider adjustments, make sure the other pll parameters are the same.
--- drivers/gpu/drm/radeon/rs780_dpm.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/gpu/drm/radeon/rs780_dpm.c +6 -0
@@ -449,6 +449,12 @@ static int rs780_set_engine_clock_scaling(struct radeon_device *rdev,if (ret)return ret; +if ((min_dividers.ref_div != max_dividers.ref_div) || + (min_dividers.post_div != max_dividers.post_div) || + (max_dividers.ref_div != current_max_dividers.ref_div) || + (max_dividers.post_div != current_max_dividers.post_div)) +return -EINVAL ; +rs780_force_fbdiv (rdev, max_dividers.fb_div);if (max_dividers.fb_div > min_dividers.fb_div) {
Signature · 1 line
1.8.3.1
PATCH 3/4 drm/radeon/dpm/rs780: don't enable sclk scaling if not required
In reply to Alex DeucherIf the low and high sclks are the same, there is no need to enable sclk scaling. This causes display stability issues on certain boards.
Fixes:
https://bugzilla.kernel.org/show_bug.cgi?id=60857
--- drivers/gpu/drm/radeon/rs780_dpm.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/radeon/rs780_dpm.c +3 -0
@@ -499,6 +499,9 @@ static void rs780_activate_engine_clk_scaling(struct radeon_device *rdev, (new_state->sclk_low == old_state->sclk_low)) return; +if (new_state->sclk_high == new_state->sclk_low) +return ; +rs780_clk_scaling_enable (rdev, true); }
Signature · 1 line
1.8.3.1
PATCH 4/4 drm/radeon/dpm/rs780: fix force_performance state for same sclks
In reply to Alex DeucherIf the low and high sclks within a power state are the same, there no need to enable sclk scaling. Enabling sclk scaling can cause display stability issues on some boards.
--- drivers/gpu/drm/radeon/rs780_dpm.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/radeon/rs780_dpm.c +4 -2
@@ -1043,8 +1043,10 @@ int rs780_dpm_force_performance_level(struct radeon_device *rdev,if (pi->voltage_control)rs780_force_voltage (rdev, pi->max_voltage); -WREG32_P (FVTHROT_FBDIV_REG1 ,0 , ~FORCE_FEEDBACK_DIV ); -rs780_clk_scaling_enable (rdev, true); +if (ps->sclk_high != ps->sclk_low) { +WREG32_P (FVTHROT_FBDIV_REG1 ,0 , ~FORCE_FEEDBACK_DIV ); +rs780_clk_scaling_enable (rdev, true); + }if (pi->voltage_control) {rs780_voltage_scaling_enable (rdev, true);
Signature · 1 line
1.8.3.1
Am 13.09.2013 17:08, schrieb Alex Deucher:
Quoted 3 lines
Rather than open coding it.
Signed-off-by Alex Deucher <[email protected]>
For this series: Reviewed-by: Christian König <[email protected]>
Quoted 19 lines
--- drivers/gpu/drm/radeon/rs780_dpm.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)drivers/gpu/drm/radeon/rs780_dpm.c +1
-3@@ -62,9 +62,7 @@ static void rs780_get_pm_mode_parameters(struct radeon_device *rdev) radeon_crtc =to_radeon_crtc (crtc); pi->crtc_id = radeon_crtc->crtc_id;if (crtc->mode.htotal && crtc->mode.vtotal) - pi->refresh_rate = - (crtc->mode.clock *1000 ) / - (crtc->mode.htotal * crtc->mode.vtotal); + pi->refresh_rate =drm_mode_vrefresh (&crtc->mode);break ; } }