aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2013-08-14 13:55:53 -0400
committerAlex Deucher <alexander.deucher@amd.com>2013-08-30 16:30:57 -0400
commitcf0ab2cd450357bd430c6799aed18a427a8420f6 (patch)
tree5a8596b8b7a0add613501bd8fbcca217553e8be8
parenta0f38609c9870fe0e3d5c10b1e6926a5750d0a7a (diff)
drm/radeon: handle cg in CI dpm code
Clockgating needs to be disabled around certain parts of dpm setup otherwise the smc gets into a bad state and dpm doesn't work properly. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/radeon/ci_dpm.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/ci_dpm.c b/drivers/gpu/drm/radeon/ci_dpm.c
index e4d9d50ce908..af04b5c28d96 100644
--- a/drivers/gpu/drm/radeon/ci_dpm.c
+++ b/drivers/gpu/drm/radeon/ci_dpm.c
@@ -155,6 +155,8 @@ extern void si_trim_voltage_table_to_fit_state_table(struct radeon_device *rdev,
155 struct atom_voltage_table *voltage_table); 155 struct atom_voltage_table *voltage_table);
156extern void cik_enter_rlc_safe_mode(struct radeon_device *rdev); 156extern void cik_enter_rlc_safe_mode(struct radeon_device *rdev);
157extern void cik_exit_rlc_safe_mode(struct radeon_device *rdev); 157extern void cik_exit_rlc_safe_mode(struct radeon_device *rdev);
158extern void cik_update_cg(struct radeon_device *rdev,
159 u32 block, bool enable);
158 160
159static int ci_get_std_voltage_value_sidd(struct radeon_device *rdev, 161static int ci_get_std_voltage_value_sidd(struct radeon_device *rdev,
160 struct atom_voltage_table_entry *voltage_table, 162 struct atom_voltage_table_entry *voltage_table,
@@ -4492,6 +4494,13 @@ int ci_dpm_enable(struct radeon_device *rdev)
4492 struct radeon_ps *boot_ps = rdev->pm.dpm.boot_ps; 4494 struct radeon_ps *boot_ps = rdev->pm.dpm.boot_ps;
4493 int ret; 4495 int ret;
4494 4496
4497 cik_update_cg(rdev, (RADEON_CG_BLOCK_GFX |
4498 RADEON_CG_BLOCK_MC |
4499 RADEON_CG_BLOCK_SDMA |
4500 RADEON_CG_BLOCK_BIF |
4501 RADEON_CG_BLOCK_UVD |
4502 RADEON_CG_BLOCK_HDP), false);
4503
4495 if (ci_is_smc_running(rdev)) 4504 if (ci_is_smc_running(rdev))
4496 return -EINVAL; 4505 return -EINVAL;
4497 if (pi->voltage_control != CISLANDS_VOLTAGE_CONTROL_NONE) { 4506 if (pi->voltage_control != CISLANDS_VOLTAGE_CONTROL_NONE) {
@@ -4611,6 +4620,13 @@ int ci_dpm_enable(struct radeon_device *rdev)
4611 4620
4612 ci_enable_auto_throttle_source(rdev, RADEON_DPM_AUTO_THROTTLE_SRC_THERMAL, true); 4621 ci_enable_auto_throttle_source(rdev, RADEON_DPM_AUTO_THROTTLE_SRC_THERMAL, true);
4613 4622
4623 cik_update_cg(rdev, (RADEON_CG_BLOCK_GFX |
4624 RADEON_CG_BLOCK_MC |
4625 RADEON_CG_BLOCK_SDMA |
4626 RADEON_CG_BLOCK_BIF |
4627 RADEON_CG_BLOCK_UVD |
4628 RADEON_CG_BLOCK_HDP), true);
4629
4614 ci_update_current_ps(rdev, boot_ps); 4630 ci_update_current_ps(rdev, boot_ps);
4615 4631
4616 return 0; 4632 return 0;
@@ -4621,6 +4637,12 @@ void ci_dpm_disable(struct radeon_device *rdev)
4621 struct ci_power_info *pi = ci_get_pi(rdev); 4637 struct ci_power_info *pi = ci_get_pi(rdev);
4622 struct radeon_ps *boot_ps = rdev->pm.dpm.boot_ps; 4638 struct radeon_ps *boot_ps = rdev->pm.dpm.boot_ps;
4623 4639
4640 cik_update_cg(rdev, (RADEON_CG_BLOCK_GFX |
4641 RADEON_CG_BLOCK_MC |
4642 RADEON_CG_BLOCK_SDMA |
4643 RADEON_CG_BLOCK_UVD |
4644 RADEON_CG_BLOCK_HDP), false);
4645
4624 if (!ci_is_smc_running(rdev)) 4646 if (!ci_is_smc_running(rdev))
4625 return; 4647 return;
4626 4648
@@ -4649,6 +4671,13 @@ int ci_dpm_set_power_state(struct radeon_device *rdev)
4649 struct radeon_ps *old_ps = &pi->current_rps; 4671 struct radeon_ps *old_ps = &pi->current_rps;
4650 int ret; 4672 int ret;
4651 4673
4674 cik_update_cg(rdev, (RADEON_CG_BLOCK_GFX |
4675 RADEON_CG_BLOCK_MC |
4676 RADEON_CG_BLOCK_SDMA |
4677 RADEON_CG_BLOCK_BIF |
4678 RADEON_CG_BLOCK_UVD |
4679 RADEON_CG_BLOCK_HDP), false);
4680
4652 ci_find_dpm_states_clocks_in_dpm_table(rdev, new_ps); 4681 ci_find_dpm_states_clocks_in_dpm_table(rdev, new_ps);
4653 if (pi->pcie_performance_request) 4682 if (pi->pcie_performance_request)
4654 ci_request_link_speed_change_before_state_change(rdev, new_ps, old_ps); 4683 ci_request_link_speed_change_before_state_change(rdev, new_ps, old_ps);
@@ -4710,6 +4739,13 @@ int ci_dpm_set_power_state(struct radeon_device *rdev)
4710 return ret; 4739 return ret;
4711 } 4740 }
4712 4741
4742 cik_update_cg(rdev, (RADEON_CG_BLOCK_GFX |
4743 RADEON_CG_BLOCK_MC |
4744 RADEON_CG_BLOCK_SDMA |
4745 RADEON_CG_BLOCK_BIF |
4746 RADEON_CG_BLOCK_UVD |
4747 RADEON_CG_BLOCK_HDP), true);
4748
4713 return 0; 4749 return 0;
4714} 4750}
4715 4751