Lines Matching refs:rdev
46 struct rv7xx_power_info *rv770_get_pi(struct radeon_device *rdev);
47 struct evergreen_power_info *evergreen_get_pi(struct radeon_device *rdev);
49 static void cypress_enable_bif_dynamic_pcie_gen2(struct radeon_device *rdev, in cypress_enable_bif_dynamic_pcie_gen2() argument
52 struct rv7xx_power_info *pi = rv770_get_pi(rdev); in cypress_enable_bif_dynamic_pcie_gen2()
86 static void cypress_enable_dynamic_pcie_gen2(struct radeon_device *rdev, in cypress_enable_dynamic_pcie_gen2() argument
89 cypress_enable_bif_dynamic_pcie_gen2(rdev, enable); in cypress_enable_dynamic_pcie_gen2()
98 static int cypress_enter_ulp_state(struct radeon_device *rdev)
100 struct rv7xx_power_info *pi = rv770_get_pi(rdev);
119 static void cypress_gfx_clock_gating_enable(struct radeon_device *rdev, in cypress_gfx_clock_gating_enable() argument
122 struct evergreen_power_info *eg_pi = evergreen_get_pi(rdev); in cypress_gfx_clock_gating_enable()
171 static void cypress_mg_clock_gating_enable(struct radeon_device *rdev, in cypress_mg_clock_gating_enable() argument
174 struct rv7xx_power_info *pi = rv770_get_pi(rdev); in cypress_mg_clock_gating_enable()
175 struct evergreen_power_info *eg_pi = evergreen_get_pi(rdev); in cypress_mg_clock_gating_enable()
180 if (rdev->family == CHIP_CEDAR) in cypress_mg_clock_gating_enable()
182 else if (rdev->family == CHIP_REDWOOD) in cypress_mg_clock_gating_enable()
220 void cypress_enable_spread_spectrum(struct radeon_device *rdev, in cypress_enable_spread_spectrum() argument
223 struct rv7xx_power_info *pi = rv770_get_pi(rdev); in cypress_enable_spread_spectrum()
239 void cypress_start_dpm(struct radeon_device *rdev) in cypress_start_dpm() argument
244 void cypress_enable_sclk_control(struct radeon_device *rdev, in cypress_enable_sclk_control() argument
253 void cypress_enable_mclk_control(struct radeon_device *rdev, in cypress_enable_mclk_control() argument
262 int cypress_notify_smc_display_change(struct radeon_device *rdev, in cypress_notify_smc_display_change() argument
268 if (rv770_send_msg_to_smc(rdev, msg) != PPSMC_Result_OK) in cypress_notify_smc_display_change()
274 void cypress_program_response_times(struct radeon_device *rdev) in cypress_program_response_times() argument
279 reference_clock = radeon_get_xclk(rdev); in cypress_program_response_times()
282 rv770_write_smc_soft_register(rdev, in cypress_program_response_times()
286 rv770_write_smc_soft_register(rdev, in cypress_program_response_times()
289 rv770_write_smc_soft_register(rdev, in cypress_program_response_times()
292 rv770_program_response_times(rdev); in cypress_program_response_times()
294 if (ASIC_IS_LOMBOK(rdev)) in cypress_program_response_times()
295 rv770_write_smc_soft_register(rdev, in cypress_program_response_times()
300 static int cypress_pcie_performance_request(struct radeon_device *rdev, in cypress_pcie_performance_request() argument
304 struct evergreen_power_info *eg_pi = evergreen_get_pi(rdev); in cypress_pcie_performance_request()
317 return radeon_acpi_pcie_performance_request(rdev, perf_req, advertise); in cypress_pcie_performance_request()
321 return radeon_acpi_pcie_performance_request(rdev, perf_req, advertise); in cypress_pcie_performance_request()
328 void cypress_advertise_gen2_capability(struct radeon_device *rdev) in cypress_advertise_gen2_capability() argument
330 struct rv7xx_power_info *pi = rv770_get_pi(rdev); in cypress_advertise_gen2_capability()
334 radeon_acpi_pcie_notify_device_ready(rdev); in cypress_advertise_gen2_capability()
346 cypress_pcie_performance_request(rdev, PCIE_PERF_REQ_PECI_GEN2, true); in cypress_advertise_gen2_capability()
359 void cypress_notify_link_speed_change_after_state_change(struct radeon_device *rdev, in cypress_notify_link_speed_change_after_state_change() argument
377 cypress_pcie_performance_request(rdev, request, false); in cypress_notify_link_speed_change_after_state_change()
381 void cypress_notify_link_speed_change_before_state_change(struct radeon_device *rdev, in cypress_notify_link_speed_change_before_state_change() argument
399 cypress_pcie_performance_request(rdev, request, false); in cypress_notify_link_speed_change_before_state_change()
403 static int cypress_populate_voltage_value(struct radeon_device *rdev, in cypress_populate_voltage_value() argument
423 u8 cypress_get_strobe_mode_settings(struct radeon_device *rdev, u32 mclk) in cypress_get_strobe_mode_settings() argument
425 struct rv7xx_power_info *pi = rv770_get_pi(rdev); in cypress_get_strobe_mode_settings()
432 result = cypress_get_mclk_frequency_ratio(rdev, mclk, strobe_mode); in cypress_get_strobe_mode_settings()
441 u32 cypress_map_clkf_to_ibias(struct radeon_device *rdev, u32 clkf) in cypress_map_clkf_to_ibias() argument
443 u32 ref_clk = rdev->clock.mpll.reference_freq; in cypress_map_clkf_to_ibias()
473 static int cypress_populate_mclk_value(struct radeon_device *rdev, in cypress_populate_mclk_value() argument
478 struct rv7xx_power_info *pi = rv770_get_pi(rdev); in cypress_populate_mclk_value()
500 ret = radeon_atom_get_clock_dividers(rdev, COMPUTE_MEMORY_PLL_PARAM, in cypress_populate_mclk_value()
512 ibias = cypress_map_clkf_to_ibias(rdev, dividers.whole_fb_div); in cypress_populate_mclk_value()
557 if (radeon_atombios_get_asic_ss_info(rdev, &ss, in cypress_populate_mclk_value()
559 u32 reference_clock = rdev->clock.mpll.reference_freq; in cypress_populate_mclk_value()
610 u8 cypress_get_mclk_frequency_ratio(struct radeon_device *rdev, in cypress_get_mclk_frequency_ratio() argument
615 if (rdev->family >= CHIP_BARTS) { in cypress_get_mclk_frequency_ratio()
651 static int cypress_populate_mvdd_value(struct radeon_device *rdev, in cypress_populate_mvdd_value() argument
655 struct rv7xx_power_info *pi = rv770_get_pi(rdev); in cypress_populate_mvdd_value()
656 struct evergreen_power_info *eg_pi = evergreen_get_pi(rdev); in cypress_populate_mvdd_value()
675 int cypress_convert_power_level_to_smc(struct radeon_device *rdev, in cypress_convert_power_level_to_smc() argument
680 struct rv7xx_power_info *pi = rv770_get_pi(rdev); in cypress_convert_power_level_to_smc()
681 struct evergreen_power_info *eg_pi = evergreen_get_pi(rdev); in cypress_convert_power_level_to_smc()
691 ret = rv740_populate_sclk_value(rdev, pl->sclk, &level->sclk); in cypress_convert_power_level_to_smc()
713 level->strobeMode = cypress_get_strobe_mode_settings(rdev, pl->mclk); in cypress_convert_power_level_to_smc()
716 if (cypress_get_mclk_frequency_ratio(rdev, pl->mclk, true) >= in cypress_convert_power_level_to_smc()
724 ret = cypress_populate_mclk_value(rdev, in cypress_convert_power_level_to_smc()
731 ret = cypress_populate_mclk_value(rdev, in cypress_convert_power_level_to_smc()
741 ret = cypress_populate_voltage_value(rdev, in cypress_convert_power_level_to_smc()
749 ret = cypress_populate_voltage_value(rdev, in cypress_convert_power_level_to_smc()
757 ret = cypress_populate_mvdd_value(rdev, pl->mclk, &level->mvdd); in cypress_convert_power_level_to_smc()
762 static int cypress_convert_power_state_to_smc(struct radeon_device *rdev, in cypress_convert_power_state_to_smc() argument
767 struct evergreen_power_info *eg_pi = evergreen_get_pi(rdev); in cypress_convert_power_state_to_smc()
773 ret = cypress_convert_power_level_to_smc(rdev, in cypress_convert_power_state_to_smc()
780 ret = cypress_convert_power_level_to_smc(rdev, in cypress_convert_power_state_to_smc()
787 ret = cypress_convert_power_level_to_smc(rdev, in cypress_convert_power_state_to_smc()
808 rv770_populate_smc_sp(rdev, radeon_state, smc_state); in cypress_convert_power_state_to_smc()
810 return rv770_populate_smc_t(rdev, radeon_state, smc_state); in cypress_convert_power_state_to_smc()
827 static void cypress_convert_mc_reg_table_entry_to_smc(struct radeon_device *rdev, in cypress_convert_mc_reg_table_entry_to_smc() argument
831 struct evergreen_power_info *eg_pi = evergreen_get_pi(rdev); in cypress_convert_mc_reg_table_entry_to_smc()
849 static void cypress_convert_mc_reg_table_to_smc(struct radeon_device *rdev, in cypress_convert_mc_reg_table_to_smc() argument
855 cypress_convert_mc_reg_table_entry_to_smc(rdev, in cypress_convert_mc_reg_table_to_smc()
858 cypress_convert_mc_reg_table_entry_to_smc(rdev, in cypress_convert_mc_reg_table_to_smc()
861 cypress_convert_mc_reg_table_entry_to_smc(rdev, in cypress_convert_mc_reg_table_to_smc()
866 int cypress_upload_sw_state(struct radeon_device *rdev, in cypress_upload_sw_state() argument
869 struct rv7xx_power_info *pi = rv770_get_pi(rdev); in cypress_upload_sw_state()
875 ret = cypress_convert_power_state_to_smc(rdev, radeon_new_state, &state); in cypress_upload_sw_state()
879 return rv770_copy_bytes_to_smc(rdev, address, (u8 *)&state, in cypress_upload_sw_state()
884 int cypress_upload_mc_reg_table(struct radeon_device *rdev, in cypress_upload_mc_reg_table() argument
887 struct rv7xx_power_info *pi = rv770_get_pi(rdev); in cypress_upload_mc_reg_table()
888 struct evergreen_power_info *eg_pi = evergreen_get_pi(rdev); in cypress_upload_mc_reg_table()
892 cypress_convert_mc_reg_table_to_smc(rdev, radeon_new_state, &mc_reg_table); in cypress_upload_mc_reg_table()
897 return rv770_copy_bytes_to_smc(rdev, address, in cypress_upload_mc_reg_table()
903 u32 cypress_calculate_burst_time(struct radeon_device *rdev, in cypress_calculate_burst_time() argument
906 struct rv7xx_power_info *pi = rv770_get_pi(rdev); in cypress_calculate_burst_time()
924 void cypress_program_memory_timing_parameters(struct radeon_device *rdev, in cypress_program_memory_timing_parameters() argument
932 mc_arb_burst_time |= STATE1(cypress_calculate_burst_time(rdev, in cypress_program_memory_timing_parameters()
935 mc_arb_burst_time |= STATE2(cypress_calculate_burst_time(rdev, in cypress_program_memory_timing_parameters()
938 mc_arb_burst_time |= STATE3(cypress_calculate_burst_time(rdev, in cypress_program_memory_timing_parameters()
942 rv730_program_memory_timing_parameters(rdev, radeon_new_state); in cypress_program_memory_timing_parameters()
947 static void cypress_populate_mc_reg_addresses(struct radeon_device *rdev, in cypress_populate_mc_reg_addresses() argument
950 struct evergreen_power_info *eg_pi = evergreen_get_pi(rdev); in cypress_populate_mc_reg_addresses()
966 static void cypress_set_mc_reg_address_table(struct radeon_device *rdev) in cypress_set_mc_reg_address_table() argument
968 struct evergreen_power_info *eg_pi = evergreen_get_pi(rdev); in cypress_set_mc_reg_address_table()
1030 static void cypress_retrieve_ac_timing_for_one_entry(struct radeon_device *rdev, in cypress_retrieve_ac_timing_for_one_entry() argument
1033 struct evergreen_power_info *eg_pi = evergreen_get_pi(rdev); in cypress_retrieve_ac_timing_for_one_entry()
1042 static void cypress_retrieve_ac_timing_for_all_ranges(struct radeon_device *rdev, in cypress_retrieve_ac_timing_for_all_ranges() argument
1045 struct evergreen_power_info *eg_pi = evergreen_get_pi(rdev); in cypress_retrieve_ac_timing_for_all_ranges()
1051 radeon_atom_set_ac_timing(rdev, range_table->mclk[i]); in cypress_retrieve_ac_timing_for_all_ranges()
1052 cypress_retrieve_ac_timing_for_one_entry(rdev, in cypress_retrieve_ac_timing_for_all_ranges()
1070 static int cypress_initialize_mc_reg_table(struct radeon_device *rdev) in cypress_initialize_mc_reg_table() argument
1072 struct rv7xx_power_info *pi = rv770_get_pi(rdev); in cypress_initialize_mc_reg_table()
1073 u8 module_index = rv770_get_memory_module_index(rdev); in cypress_initialize_mc_reg_table()
1077 ret = radeon_atom_get_mclk_range_table(rdev, in cypress_initialize_mc_reg_table()
1083 cypress_retrieve_ac_timing_for_all_ranges(rdev, &range_table); in cypress_initialize_mc_reg_table()
1088 static void cypress_wait_for_mc_sequencer(struct radeon_device *rdev, u8 value) in cypress_wait_for_mc_sequencer() argument
1093 if ((rdev->family == CHIP_CYPRESS) || in cypress_wait_for_mc_sequencer()
1094 (rdev->family == CHIP_HEMLOCK)) in cypress_wait_for_mc_sequencer()
1096 else if (rdev->family == CHIP_CEDAR) in cypress_wait_for_mc_sequencer()
1100 if ((rdev->family == CHIP_CYPRESS) || in cypress_wait_for_mc_sequencer()
1101 (rdev->family == CHIP_HEMLOCK)) { in cypress_wait_for_mc_sequencer()
1108 for (j = 0; j < rdev->usec_timeout; j++) { in cypress_wait_for_mc_sequencer()
1116 static void cypress_force_mc_use_s1(struct radeon_device *rdev, in cypress_force_mc_use_s1() argument
1127 radeon_atom_set_ac_timing(rdev, boot_state->low.mclk); in cypress_force_mc_use_s1()
1128 radeon_mc_wait_for_idle(rdev); in cypress_force_mc_use_s1()
1130 if ((rdev->family == CHIP_CYPRESS) || in cypress_force_mc_use_s1()
1131 (rdev->family == CHIP_HEMLOCK)) { in cypress_force_mc_use_s1()
1139 for (i = 0; i < rdev->num_crtc; i++) in cypress_force_mc_use_s1()
1140 radeon_wait_for_vblank(rdev, i); in cypress_force_mc_use_s1()
1143 cypress_wait_for_mc_sequencer(rdev, MC_CG_SEQ_YCLK_SUSPEND); in cypress_force_mc_use_s1()
1145 strobe_mode = cypress_get_strobe_mode_settings(rdev, in cypress_force_mc_use_s1()
1152 for (i = 0; i < rdev->usec_timeout; i++) { in cypress_force_mc_use_s1()
1162 cypress_wait_for_mc_sequencer(rdev, MC_CG_SEQ_YCLK_RESUME); in cypress_force_mc_use_s1()
1165 static void cypress_copy_ac_timing_from_s1_to_s0(struct radeon_device *rdev) in cypress_copy_ac_timing_from_s1_to_s0() argument
1167 struct evergreen_power_info *eg_pi = evergreen_get_pi(rdev); in cypress_copy_ac_timing_from_s1_to_s0()
1177 static void cypress_force_mc_use_s0(struct radeon_device *rdev, in cypress_force_mc_use_s0() argument
1185 cypress_copy_ac_timing_from_s1_to_s0(rdev); in cypress_force_mc_use_s0()
1186 radeon_mc_wait_for_idle(rdev); in cypress_force_mc_use_s0()
1188 if ((rdev->family == CHIP_CYPRESS) || in cypress_force_mc_use_s0()
1189 (rdev->family == CHIP_HEMLOCK)) { in cypress_force_mc_use_s0()
1197 for (i = 0; i < rdev->num_crtc; i++) in cypress_force_mc_use_s0()
1198 radeon_wait_for_vblank(rdev, i); in cypress_force_mc_use_s0()
1201 cypress_wait_for_mc_sequencer(rdev, MC_CG_SEQ_YCLK_SUSPEND); in cypress_force_mc_use_s0()
1203 strobe_mode = cypress_get_strobe_mode_settings(rdev, in cypress_force_mc_use_s0()
1210 for (i = 0; i < rdev->usec_timeout; i++) { in cypress_force_mc_use_s0()
1220 cypress_wait_for_mc_sequencer(rdev, MC_CG_SEQ_YCLK_RESUME); in cypress_force_mc_use_s0()
1223 static int cypress_populate_initial_mvdd_value(struct radeon_device *rdev, in cypress_populate_initial_mvdd_value() argument
1226 struct evergreen_power_info *eg_pi = evergreen_get_pi(rdev); in cypress_populate_initial_mvdd_value()
1234 int cypress_populate_smc_initial_state(struct radeon_device *rdev, in cypress_populate_smc_initial_state() argument
1239 struct rv7xx_power_info *pi = rv770_get_pi(rdev); in cypress_populate_smc_initial_state()
1240 struct evergreen_power_info *eg_pi = evergreen_get_pi(rdev); in cypress_populate_smc_initial_state()
1282 cypress_populate_voltage_value(rdev, in cypress_populate_smc_initial_state()
1288 cypress_populate_voltage_value(rdev, in cypress_populate_smc_initial_state()
1293 cypress_populate_initial_mvdd_value(rdev, in cypress_populate_smc_initial_state()
1313 cypress_get_strobe_mode_settings(rdev, in cypress_populate_smc_initial_state()
1330 int cypress_populate_smc_acpi_state(struct radeon_device *rdev, in cypress_populate_smc_acpi_state() argument
1333 struct rv7xx_power_info *pi = rv770_get_pi(rdev); in cypress_populate_smc_acpi_state()
1334 struct evergreen_power_info *eg_pi = evergreen_get_pi(rdev); in cypress_populate_smc_acpi_state()
1359 cypress_populate_voltage_value(rdev, in cypress_populate_smc_acpi_state()
1375 cypress_populate_voltage_value(rdev, in cypress_populate_smc_acpi_state()
1384 cypress_populate_voltage_value(rdev, in cypress_populate_smc_acpi_state()
1427 if (rdev->family <= CHIP_HEMLOCK) in cypress_populate_smc_acpi_state()
1456 cypress_populate_mvdd_value(rdev, 0, &table->ACPIState.levels[0].mvdd); in cypress_populate_smc_acpi_state()
1467 static void cypress_trim_voltage_table_to_fit_state_table(struct radeon_device *rdev, in cypress_trim_voltage_table_to_fit_state_table() argument
1483 int cypress_construct_voltage_tables(struct radeon_device *rdev) in cypress_construct_voltage_tables() argument
1485 struct evergreen_power_info *eg_pi = evergreen_get_pi(rdev); in cypress_construct_voltage_tables()
1488 ret = radeon_atom_get_voltage_table(rdev, SET_VOLTAGE_TYPE_ASIC_VDDC, 0, in cypress_construct_voltage_tables()
1494 cypress_trim_voltage_table_to_fit_state_table(rdev, in cypress_construct_voltage_tables()
1498 ret = radeon_atom_get_voltage_table(rdev, SET_VOLTAGE_TYPE_ASIC_VDDCI, 0, in cypress_construct_voltage_tables()
1504 cypress_trim_voltage_table_to_fit_state_table(rdev, in cypress_construct_voltage_tables()
1511 static void cypress_populate_smc_voltage_table(struct radeon_device *rdev, in cypress_populate_smc_voltage_table() argument
1523 int cypress_populate_smc_voltage_tables(struct radeon_device *rdev, in cypress_populate_smc_voltage_tables() argument
1526 struct rv7xx_power_info *pi = rv770_get_pi(rdev); in cypress_populate_smc_voltage_tables()
1527 struct evergreen_power_info *eg_pi = evergreen_get_pi(rdev); in cypress_populate_smc_voltage_tables()
1531 cypress_populate_smc_voltage_table(rdev, in cypress_populate_smc_voltage_tables()
1549 cypress_populate_smc_voltage_table(rdev, in cypress_populate_smc_voltage_tables()
1570 int cypress_get_mvdd_configuration(struct radeon_device *rdev) in cypress_get_mvdd_configuration() argument
1572 struct rv7xx_power_info *pi = rv770_get_pi(rdev); in cypress_get_mvdd_configuration()
1573 struct evergreen_power_info *eg_pi = evergreen_get_pi(rdev); in cypress_get_mvdd_configuration()
1593 module_index = rv770_get_memory_module_index(rdev); in cypress_get_mvdd_configuration()
1595 if (radeon_atom_get_memory_info(rdev, module_index, &memory_info)) { in cypress_get_mvdd_configuration()
1611 static int cypress_init_smc_table(struct radeon_device *rdev, in cypress_init_smc_table() argument
1614 struct rv7xx_power_info *pi = rv770_get_pi(rdev); in cypress_init_smc_table()
1620 cypress_populate_smc_voltage_tables(rdev, table); in cypress_init_smc_table()
1622 switch (rdev->pm.int_thermal_type) { in cypress_init_smc_table()
1635 if (rdev->pm.dpm.platform_caps & ATOM_PP_PLATFORM_CAP_HARDWAREDC) in cypress_init_smc_table()
1638 if (rdev->pm.dpm.platform_caps & ATOM_PP_PLATFORM_CAP_REGULATOR_HOT) in cypress_init_smc_table()
1641 if (rdev->pm.dpm.platform_caps & ATOM_PP_PLATFORM_CAP_STEPVDDC) in cypress_init_smc_table()
1647 ret = cypress_populate_smc_initial_state(rdev, radeon_boot_state, table); in cypress_init_smc_table()
1651 ret = cypress_populate_smc_acpi_state(rdev, table); in cypress_init_smc_table()
1657 return rv770_copy_bytes_to_smc(rdev, in cypress_init_smc_table()
1663 int cypress_populate_mc_reg_table(struct radeon_device *rdev, in cypress_populate_mc_reg_table() argument
1666 struct rv7xx_power_info *pi = rv770_get_pi(rdev); in cypress_populate_mc_reg_table()
1667 struct evergreen_power_info *eg_pi = evergreen_get_pi(rdev); in cypress_populate_mc_reg_table()
1671 rv770_write_smc_soft_register(rdev, in cypress_populate_mc_reg_table()
1674 cypress_populate_mc_reg_addresses(rdev, &mc_reg_table); in cypress_populate_mc_reg_table()
1676 cypress_convert_mc_reg_table_entry_to_smc(rdev, in cypress_populate_mc_reg_table()
1684 cypress_convert_mc_reg_table_to_smc(rdev, radeon_boot_state, &mc_reg_table); in cypress_populate_mc_reg_table()
1686 return rv770_copy_bytes_to_smc(rdev, eg_pi->mc_reg_table_start, in cypress_populate_mc_reg_table()
1691 int cypress_get_table_locations(struct radeon_device *rdev) in cypress_get_table_locations() argument
1693 struct rv7xx_power_info *pi = rv770_get_pi(rdev); in cypress_get_table_locations()
1694 struct evergreen_power_info *eg_pi = evergreen_get_pi(rdev); in cypress_get_table_locations()
1698 ret = rv770_read_smc_sram_dword(rdev, in cypress_get_table_locations()
1707 ret = rv770_read_smc_sram_dword(rdev, in cypress_get_table_locations()
1716 ret = rv770_read_smc_sram_dword(rdev, in cypress_get_table_locations()
1728 void cypress_enable_display_gap(struct radeon_device *rdev) in cypress_enable_display_gap() argument
1742 static void cypress_program_display_gap(struct radeon_device *rdev) in cypress_program_display_gap() argument
1748 if (rdev->pm.dpm.new_active_crtc_count > 0) in cypress_program_display_gap()
1753 if (rdev->pm.dpm.new_active_crtc_count > 1) in cypress_program_display_gap()
1763 if ((rdev->pm.dpm.new_active_crtc_count > 0) && in cypress_program_display_gap()
1764 (!(rdev->pm.dpm.new_active_crtcs & (1 << pipe)))) { in cypress_program_display_gap()
1766 for (i = 0; i < rdev->num_crtc; i++) { in cypress_program_display_gap()
1767 if (rdev->pm.dpm.new_active_crtcs & (1 << i)) in cypress_program_display_gap()
1770 if (i == rdev->num_crtc) in cypress_program_display_gap()
1780 cypress_notify_smc_display_change(rdev, rdev->pm.dpm.new_active_crtc_count > 0); in cypress_program_display_gap()
1783 void cypress_dpm_setup_asic(struct radeon_device *rdev) in cypress_dpm_setup_asic() argument
1785 struct evergreen_power_info *eg_pi = evergreen_get_pi(rdev); in cypress_dpm_setup_asic()
1787 rv740_read_clock_registers(rdev); in cypress_dpm_setup_asic()
1788 rv770_read_voltage_smio_registers(rdev); in cypress_dpm_setup_asic()
1789 rv770_get_max_vddc(rdev); in cypress_dpm_setup_asic()
1790 rv770_get_memory_type(rdev); in cypress_dpm_setup_asic()
1796 cypress_advertise_gen2_capability(rdev); in cypress_dpm_setup_asic()
1798 rv770_get_pcie_gen2_status(rdev); in cypress_dpm_setup_asic()
1800 rv770_enable_acpi_pm(rdev); in cypress_dpm_setup_asic()
1803 int cypress_dpm_enable(struct radeon_device *rdev) in cypress_dpm_enable() argument
1805 struct rv7xx_power_info *pi = rv770_get_pi(rdev); in cypress_dpm_enable()
1806 struct evergreen_power_info *eg_pi = evergreen_get_pi(rdev); in cypress_dpm_enable()
1807 struct radeon_ps *boot_ps = rdev->pm.dpm.boot_ps; in cypress_dpm_enable()
1811 rv770_restore_cgcg(rdev); in cypress_dpm_enable()
1813 if (rv770_dpm_enabled(rdev)) in cypress_dpm_enable()
1817 rv770_enable_voltage_control(rdev, true); in cypress_dpm_enable()
1818 ret = cypress_construct_voltage_tables(rdev); in cypress_dpm_enable()
1826 ret = cypress_get_mvdd_configuration(rdev); in cypress_dpm_enable()
1834 cypress_set_mc_reg_address_table(rdev); in cypress_dpm_enable()
1835 cypress_force_mc_use_s0(rdev, boot_ps); in cypress_dpm_enable()
1836 ret = cypress_initialize_mc_reg_table(rdev); in cypress_dpm_enable()
1839 cypress_force_mc_use_s1(rdev, boot_ps); in cypress_dpm_enable()
1842 if (rdev->pm.dpm.platform_caps & ATOM_PP_PLATFORM_CAP_BACKBIAS) in cypress_dpm_enable()
1843 rv770_enable_backbias(rdev, true); in cypress_dpm_enable()
1846 cypress_enable_spread_spectrum(rdev, true); in cypress_dpm_enable()
1849 rv770_enable_thermal_protection(rdev, true); in cypress_dpm_enable()
1851 rv770_setup_bsp(rdev); in cypress_dpm_enable()
1852 rv770_program_git(rdev); in cypress_dpm_enable()
1853 rv770_program_tp(rdev); in cypress_dpm_enable()
1854 rv770_program_tpp(rdev); in cypress_dpm_enable()
1855 rv770_program_sstp(rdev); in cypress_dpm_enable()
1856 rv770_program_engine_speed_parameters(rdev); in cypress_dpm_enable()
1857 cypress_enable_display_gap(rdev); in cypress_dpm_enable()
1858 rv770_program_vc(rdev); in cypress_dpm_enable()
1861 cypress_enable_dynamic_pcie_gen2(rdev, true); in cypress_dpm_enable()
1863 ret = rv770_upload_firmware(rdev); in cypress_dpm_enable()
1869 ret = cypress_get_table_locations(rdev); in cypress_dpm_enable()
1874 ret = cypress_init_smc_table(rdev, boot_ps); in cypress_dpm_enable()
1880 ret = cypress_populate_mc_reg_table(rdev, boot_ps); in cypress_dpm_enable()
1887 cypress_program_response_times(rdev); in cypress_dpm_enable()
1889 r7xx_start_smc(rdev); in cypress_dpm_enable()
1891 ret = cypress_notify_smc_display_change(rdev, false); in cypress_dpm_enable()
1896 cypress_enable_sclk_control(rdev, true); in cypress_dpm_enable()
1899 cypress_enable_mclk_control(rdev, true); in cypress_dpm_enable()
1901 cypress_start_dpm(rdev); in cypress_dpm_enable()
1904 cypress_gfx_clock_gating_enable(rdev, true); in cypress_dpm_enable()
1907 cypress_mg_clock_gating_enable(rdev, true); in cypress_dpm_enable()
1909 rv770_enable_auto_throttle_source(rdev, RADEON_DPM_AUTO_THROTTLE_SRC_THERMAL, true); in cypress_dpm_enable()
1914 void cypress_dpm_disable(struct radeon_device *rdev) in cypress_dpm_disable() argument
1916 struct rv7xx_power_info *pi = rv770_get_pi(rdev); in cypress_dpm_disable()
1917 struct evergreen_power_info *eg_pi = evergreen_get_pi(rdev); in cypress_dpm_disable()
1918 struct radeon_ps *boot_ps = rdev->pm.dpm.boot_ps; in cypress_dpm_disable()
1920 if (!rv770_dpm_enabled(rdev)) in cypress_dpm_disable()
1923 rv770_clear_vc(rdev); in cypress_dpm_disable()
1926 rv770_enable_thermal_protection(rdev, false); in cypress_dpm_disable()
1929 cypress_enable_dynamic_pcie_gen2(rdev, false); in cypress_dpm_disable()
1931 if (rdev->irq.installed && in cypress_dpm_disable()
1932 r600_is_internal_thermal_sensor(rdev->pm.int_thermal_type)) { in cypress_dpm_disable()
1933 rdev->irq.dpm_thermal = false; in cypress_dpm_disable()
1934 radeon_irq_set(rdev); in cypress_dpm_disable()
1938 cypress_gfx_clock_gating_enable(rdev, false); in cypress_dpm_disable()
1941 cypress_mg_clock_gating_enable(rdev, false); in cypress_dpm_disable()
1943 rv770_stop_dpm(rdev); in cypress_dpm_disable()
1944 r7xx_stop_smc(rdev); in cypress_dpm_disable()
1946 cypress_enable_spread_spectrum(rdev, false); in cypress_dpm_disable()
1949 cypress_force_mc_use_s1(rdev, boot_ps); in cypress_dpm_disable()
1951 rv770_reset_smio_status(rdev); in cypress_dpm_disable()
1954 int cypress_dpm_set_power_state(struct radeon_device *rdev) in cypress_dpm_set_power_state() argument
1956 struct evergreen_power_info *eg_pi = evergreen_get_pi(rdev); in cypress_dpm_set_power_state()
1957 struct radeon_ps *new_ps = rdev->pm.dpm.requested_ps; in cypress_dpm_set_power_state()
1958 struct radeon_ps *old_ps = rdev->pm.dpm.current_ps; in cypress_dpm_set_power_state()
1961 ret = rv770_restrict_performance_levels_before_switch(rdev); in cypress_dpm_set_power_state()
1967 cypress_notify_link_speed_change_before_state_change(rdev, new_ps, old_ps); in cypress_dpm_set_power_state()
1969 rv770_set_uvd_clock_before_set_eng_clock(rdev, new_ps, old_ps); in cypress_dpm_set_power_state()
1970 ret = rv770_halt_smc(rdev); in cypress_dpm_set_power_state()
1975 ret = cypress_upload_sw_state(rdev, new_ps); in cypress_dpm_set_power_state()
1981 ret = cypress_upload_mc_reg_table(rdev, new_ps); in cypress_dpm_set_power_state()
1988 cypress_program_memory_timing_parameters(rdev, new_ps); in cypress_dpm_set_power_state()
1990 ret = rv770_resume_smc(rdev); in cypress_dpm_set_power_state()
1995 ret = rv770_set_sw_state(rdev); in cypress_dpm_set_power_state()
2000 rv770_set_uvd_clock_after_set_eng_clock(rdev, new_ps, old_ps); in cypress_dpm_set_power_state()
2003 cypress_notify_link_speed_change_after_state_change(rdev, new_ps, old_ps); in cypress_dpm_set_power_state()
2009 void cypress_dpm_reset_asic(struct radeon_device *rdev)
2011 rv770_restrict_performance_levels_before_switch(rdev);
2012 rv770_set_boot_state(rdev);
2016 void cypress_dpm_display_configuration_changed(struct radeon_device *rdev) in cypress_dpm_display_configuration_changed() argument
2018 cypress_program_display_gap(rdev); in cypress_dpm_display_configuration_changed()
2021 int cypress_dpm_init(struct radeon_device *rdev) in cypress_dpm_init() argument
2031 rdev->pm.dpm.priv = eg_pi; in cypress_dpm_init()
2034 rv770_get_max_vddc(rdev); in cypress_dpm_init()
2042 ret = r600_get_platform_caps(rdev); in cypress_dpm_init()
2046 ret = rv7xx_parse_power_table(rdev); in cypress_dpm_init()
2050 if (rdev->pm.dpm.voltage_response_time == 0) in cypress_dpm_init()
2051 rdev->pm.dpm.voltage_response_time = R600_VOLTAGERESPONSETIME_DFLT; in cypress_dpm_init()
2052 if (rdev->pm.dpm.backbias_response_time == 0) in cypress_dpm_init()
2053 rdev->pm.dpm.backbias_response_time = R600_BACKBIASRESPONSETIME_DFLT; in cypress_dpm_init()
2055 ret = radeon_atom_get_clock_dividers(rdev, COMPUTE_ENGINE_PLL_PARAM, in cypress_dpm_init()
2072 radeon_atom_is_voltage_gpio(rdev, SET_VOLTAGE_TYPE_ASIC_VDDC, 0); in cypress_dpm_init()
2075 radeon_atom_is_voltage_gpio(rdev, SET_VOLTAGE_TYPE_ASIC_MVDDC, 0); in cypress_dpm_init()
2078 radeon_atom_is_voltage_gpio(rdev, SET_VOLTAGE_TYPE_ASIC_VDDCI, 0); in cypress_dpm_init()
2080 rv770_get_engine_memory_ss(rdev); in cypress_dpm_init()
2088 if ((rdev->family == CHIP_CYPRESS) || in cypress_dpm_init()
2089 (rdev->family == CHIP_HEMLOCK)) in cypress_dpm_init()
2101 if (rdev->pm.int_thermal_type != THERMAL_TYPE_NONE) in cypress_dpm_init()
2108 if (rdev->flags & RADEON_IS_MOBILITY) in cypress_dpm_init()
2122 radeon_acpi_is_pcie_performance_request_supported(rdev); in cypress_dpm_init()
2127 if ((rdev->family == CHIP_CYPRESS) || in cypress_dpm_init()
2128 (rdev->family == CHIP_HEMLOCK) || in cypress_dpm_init()
2129 (rdev->family == CHIP_JUNIPER)) in cypress_dpm_init()
2142 void cypress_dpm_fini(struct radeon_device *rdev) in cypress_dpm_fini() argument
2146 for (i = 0; i < rdev->pm.dpm.num_ps; i++) { in cypress_dpm_fini()
2147 kfree(rdev->pm.dpm.ps[i].ps_priv); in cypress_dpm_fini()
2149 kfree(rdev->pm.dpm.ps); in cypress_dpm_fini()
2150 kfree(rdev->pm.dpm.priv); in cypress_dpm_fini()
2153 bool cypress_dpm_vblank_too_short(struct radeon_device *rdev) in cypress_dpm_vblank_too_short() argument
2155 struct rv7xx_power_info *pi = rv770_get_pi(rdev); in cypress_dpm_vblank_too_short()
2156 u32 vblank_time = r600_dpm_get_vblank_time(rdev); in cypress_dpm_vblank_too_short()