Lines Matching refs:pi

83 	struct sumo_power_info *pi = rdev->pm.dpm.priv;  in sumo_get_pi()  local
85 return pi; in sumo_get_pi()
286 struct sumo_power_info *pi = sumo_get_pi(rdev); in sumo_enable_clock_power_gating() local
288 if (pi->enable_gfx_clock_gating) in sumo_enable_clock_power_gating()
290 if (pi->enable_gfx_power_gating) in sumo_enable_clock_power_gating()
292 if (pi->enable_mg_clock_gating) in sumo_enable_clock_power_gating()
294 if (pi->enable_gfx_clock_gating) in sumo_enable_clock_power_gating()
296 if (pi->enable_gfx_power_gating) in sumo_enable_clock_power_gating()
304 struct sumo_power_info *pi = sumo_get_pi(rdev); in sumo_disable_clock_power_gating() local
306 if (pi->enable_gfx_clock_gating) in sumo_disable_clock_power_gating()
308 if (pi->enable_gfx_power_gating) in sumo_disable_clock_power_gating()
310 if (pi->enable_mg_clock_gating) in sumo_disable_clock_power_gating()
317 struct sumo_power_info *pi = sumo_get_pi(rdev); in sumo_calculate_bsp() local
320 pi->pasi = 65535 * 100 / high_clk; in sumo_calculate_bsp()
321 pi->asi = 65535 * 100 / high_clk; in sumo_calculate_bsp()
323 r600_calculate_u_and_p(pi->asi, in sumo_calculate_bsp()
324 xclk, 16, &pi->bsp, &pi->bsu); in sumo_calculate_bsp()
326 r600_calculate_u_and_p(pi->pasi, in sumo_calculate_bsp()
327 xclk, 16, &pi->pbsp, &pi->pbsu); in sumo_calculate_bsp()
329 pi->dsp = BSP(pi->bsp) | BSU(pi->bsu); in sumo_calculate_bsp()
330 pi->psp = BSP(pi->pbsp) | BSU(pi->pbsu); in sumo_calculate_bsp()
335 struct sumo_power_info *pi = sumo_get_pi(rdev); in sumo_init_bsp() local
337 WREG32(CG_BSP_0, pi->psp); in sumo_init_bsp()
344 struct sumo_power_info *pi = sumo_get_pi(rdev); in sumo_program_bsp() local
350 highest_engine_clock = pi->boost_pl.sclk; in sumo_program_bsp()
355 WREG32(CG_BSP_0 + (i * 4), pi->dsp); in sumo_program_bsp()
357 WREG32(CG_BSP_0 + (i * 4), pi->psp); in sumo_program_bsp()
360 WREG32(CG_BSP_0 + (BOOST_DPM_LEVEL * 4), pi->psp); in sumo_program_bsp()
387 struct sumo_power_info *pi = sumo_get_pi(rdev); in sumo_program_at() local
409 asi = (i == ps->num_levels - 1) ? pi->pasi : pi->asi; in sumo_program_at()
419 asi = pi->pasi; in sumo_program_at()
421 m_a = asi * pi->boost_pl.sclk / 100; in sumo_program_at()
496 struct sumo_power_info *pi = sumo_get_pi(rdev); in sumo_set_ds_dividers() local
498 if (pi->enable_sclk_ds) { in sumo_set_ds_dividers()
510 struct sumo_power_info *pi = sumo_get_pi(rdev); in sumo_set_ss_dividers() local
512 if (pi->enable_sclk_ds) { in sumo_set_ss_dividers()
532 struct sumo_power_info *pi = sumo_get_pi(rdev); in sumo_set_allos_gnb_slow() local
536 if (pi->driver_nbps_policy_disable) in sumo_set_allos_gnb_slow()
549 struct sumo_power_info *pi = sumo_get_pi(rdev); in sumo_program_power_level() local
576 if (pi->enable_boost) in sumo_program_power_level()
666 struct sumo_power_info *pi = sumo_get_pi(rdev); in sumo_patch_boost_state() local
670 pi->boost_pl = new_ps->levels[new_ps->num_levels - 1]; in sumo_patch_boost_state()
671 pi->boost_pl.sclk = pi->sys_info.boost_sclk; in sumo_patch_boost_state()
672 pi->boost_pl.vddc_index = pi->sys_info.boost_vid_2bit; in sumo_patch_boost_state()
673 pi->boost_pl.sclk_dpm_tdp_limit = pi->sys_info.sclk_dpm_tdp_limit_boost; in sumo_patch_boost_state()
755 struct sumo_power_info *pi = sumo_get_pi(rdev); in sumo_program_power_levels_0_to_n() local
770 sumo_program_power_level(rdev, &pi->boost_pl, BOOST_DPM_LEVEL); in sumo_program_power_levels_0_to_n()
785 struct sumo_power_info *pi = sumo_get_pi(rdev); in sumo_program_acpi_power_level() local
790 pi->acpi_pl.sclk, in sumo_program_acpi_power_level()
801 struct sumo_power_info *pi = sumo_get_pi(rdev); in sumo_program_bootup_state() local
805 sumo_program_power_level(rdev, &pi->boot_pl, 0); in sumo_program_bootup_state()
818 struct sumo_power_info *pi = sumo_get_pi(rdev); in sumo_setup_uvd_clocks() local
820 if (pi->enable_gfx_power_gating) { in sumo_setup_uvd_clocks()
826 if (pi->enable_gfx_power_gating) { in sumo_setup_uvd_clocks()
827 if (!pi->disable_gfx_power_gating_in_uvd || in sumo_setup_uvd_clocks()
943 struct sumo_power_info *pi = sumo_get_pi(rdev); in sumo_program_ttt() local
946 cg_sclk_dpm_ctrl_3 |= GNB_TT(pi->thermal_auto_throttling + 49); in sumo_program_ttt()
987 struct sumo_power_info *pi = sumo_get_pi(rdev); in sumo_force_nbp_state() local
990 if (!pi->driver_nbps_policy_disable) { in sumo_force_nbp_state()
1007 struct sumo_power_info *pi = sumo_get_pi(rdev); in sumo_get_sleep_divider_id_from_clock() local
1016 if (!pi->enable_sclk_ds) in sumo_get_sleep_divider_id_from_clock()
1031 struct sumo_power_info *pi = sumo_get_pi(rdev); in sumo_get_valid_engine_clock() local
1034 for (i = 0; i < pi->sys_info.sclk_voltage_mapping_table.num_max_dpm_entries; i++) { in sumo_get_valid_engine_clock()
1035 if (pi->sys_info.sclk_voltage_mapping_table.entries[i].sclk_frequency >= lower_limit) in sumo_get_valid_engine_clock()
1036 return pi->sys_info.sclk_voltage_mapping_table.entries[i].sclk_frequency; in sumo_get_valid_engine_clock()
1039 …return pi->sys_info.sclk_voltage_mapping_table.entries[pi->sys_info.sclk_voltage_mapping_table.num… in sumo_get_valid_engine_clock()
1046 struct sumo_power_info *pi = sumo_get_pi(rdev); in sumo_patch_thermal_state() local
1047 u32 sclk_in_sr = pi->sys_info.min_sclk; /* ??? */ in sumo_patch_thermal_state()
1056 current_vddc = pi->boot_pl.vddc_index; in sumo_patch_thermal_state()
1057 current_sclk = pi->boot_pl.sclk; in sumo_patch_thermal_state()
1092 struct sumo_power_info *pi = sumo_get_pi(rdev); in sumo_apply_state_adjust_rules() local
1094 u32 min_sclk = pi->sys_info.min_sclk; /* XXX check against disp reqs */ in sumo_apply_state_adjust_rules()
1095 u32 sclk_in_sr = pi->sys_info.min_sclk; /* ??? */ in sumo_apply_state_adjust_rules()
1101 if (pi->enable_boost) { in sumo_apply_state_adjust_rules()
1184 struct sumo_power_info *pi = sumo_get_pi(rdev); in sumo_update_current_ps() local
1186 pi->current_rps = *rps; in sumo_update_current_ps()
1187 pi->current_ps = *new_ps; in sumo_update_current_ps()
1188 pi->current_rps.ps_priv = &pi->current_ps; in sumo_update_current_ps()
1195 struct sumo_power_info *pi = sumo_get_pi(rdev); in sumo_update_requested_ps() local
1197 pi->requested_rps = *rps; in sumo_update_requested_ps()
1198 pi->requested_ps = *new_ps; in sumo_update_requested_ps()
1199 pi->requested_rps.ps_priv = &pi->requested_ps; in sumo_update_requested_ps()
1204 struct sumo_power_info *pi = sumo_get_pi(rdev); in sumo_dpm_enable() local
1215 if (pi->enable_auto_thermal_throttling) { in sumo_dpm_enable()
1227 if (pi->enable_sclk_ds) in sumo_dpm_enable()
1229 if (pi->enable_boost) in sumo_dpm_enable()
1259 struct sumo_power_info *pi = sumo_get_pi(rdev); in sumo_dpm_disable() local
1264 if (pi->enable_sclk_ds) in sumo_dpm_disable()
1282 struct sumo_power_info *pi = sumo_get_pi(rdev); in sumo_dpm_pre_set_power_state() local
1288 if (pi->enable_dynamic_patch_ps) in sumo_dpm_pre_set_power_state()
1290 &pi->requested_rps, in sumo_dpm_pre_set_power_state()
1291 &pi->current_rps); in sumo_dpm_pre_set_power_state()
1298 struct sumo_power_info *pi = sumo_get_pi(rdev); in sumo_dpm_set_power_state() local
1299 struct radeon_ps *new_ps = &pi->requested_rps; in sumo_dpm_set_power_state()
1300 struct radeon_ps *old_ps = &pi->current_rps; in sumo_dpm_set_power_state()
1302 if (pi->enable_dpm) in sumo_dpm_set_power_state()
1304 if (pi->enable_boost) { in sumo_dpm_set_power_state()
1308 if (pi->enable_dpm) { in sumo_dpm_set_power_state()
1324 if (pi->enable_boost) in sumo_dpm_set_power_state()
1326 if (pi->enable_dpm) in sumo_dpm_set_power_state()
1334 struct sumo_power_info *pi = sumo_get_pi(rdev); in sumo_dpm_post_set_power_state() local
1335 struct radeon_ps *new_ps = &pi->requested_rps; in sumo_dpm_post_set_power_state()
1356 struct sumo_power_info *pi = sumo_get_pi(rdev); in sumo_dpm_setup_asic() local
1359 pi->fw_version = sumo_get_running_fw_version(rdev); in sumo_dpm_setup_asic()
1360 DRM_INFO("Found smc ucode version: 0x%08x\n", pi->fw_version); in sumo_dpm_setup_asic()
1395 struct sumo_power_info *pi = sumo_get_pi(rdev); in sumo_patch_boot_state() local
1399 ps->levels[0] = pi->boot_pl; in sumo_patch_boot_state()
1433 struct sumo_power_info *pi = sumo_get_pi(rdev); in sumo_parse_pplib_clock_info() local
1446 if (pi->enable_sclk_ds) { in sumo_parse_pplib_clock_info()
1563 struct sumo_power_info *pi = sumo_get_pi(rdev); in sumo_convert_voltage_index_to_value() local
1564 u32 vid_7bit = sumo_convert_vid2_to_vid7(rdev, &pi->sys_info.vid_mapping_table, vid_2bit); in sumo_convert_voltage_index_to_value()
1659 struct sumo_power_info *pi = sumo_get_pi(rdev); in sumo_parse_sys_info_table() local
1676 pi->sys_info.bootup_sclk = le32_to_cpu(igp_info->info_6.ulBootUpEngineClock); in sumo_parse_sys_info_table()
1677 pi->sys_info.min_sclk = le32_to_cpu(igp_info->info_6.ulMinEngineClock); in sumo_parse_sys_info_table()
1678 pi->sys_info.bootup_uma_clk = le32_to_cpu(igp_info->info_6.ulBootUpUMAClock); in sumo_parse_sys_info_table()
1679 pi->sys_info.bootup_nb_voltage_index = in sumo_parse_sys_info_table()
1682 pi->sys_info.htc_tmp_lmt = 203; in sumo_parse_sys_info_table()
1684 pi->sys_info.htc_tmp_lmt = igp_info->info_6.ucHtcTmpLmt; in sumo_parse_sys_info_table()
1686 pi->sys_info.htc_hyst_lmt = 5; in sumo_parse_sys_info_table()
1688 pi->sys_info.htc_hyst_lmt = igp_info->info_6.ucHtcHystLmt; in sumo_parse_sys_info_table()
1689 if (pi->sys_info.htc_tmp_lmt <= pi->sys_info.htc_hyst_lmt) { in sumo_parse_sys_info_table()
1693 pi->sys_info.csr_m3_arb_cntl_default[i] = in sumo_parse_sys_info_table()
1695 pi->sys_info.csr_m3_arb_cntl_uvd[i] = in sumo_parse_sys_info_table()
1697 pi->sys_info.csr_m3_arb_cntl_fs3d[i] = in sumo_parse_sys_info_table()
1700 pi->sys_info.sclk_dpm_boost_margin = in sumo_parse_sys_info_table()
1702 pi->sys_info.sclk_dpm_throttle_margin = in sumo_parse_sys_info_table()
1704 pi->sys_info.sclk_dpm_tdp_limit_pg = in sumo_parse_sys_info_table()
1706 pi->sys_info.gnb_tdp_limit = le16_to_cpu(igp_info->info_6.GnbTdpLimit); in sumo_parse_sys_info_table()
1707 pi->sys_info.sclk_dpm_tdp_limit_boost = in sumo_parse_sys_info_table()
1709 pi->sys_info.boost_sclk = le32_to_cpu(igp_info->info_6.ulBoostEngineCLock); in sumo_parse_sys_info_table()
1710 pi->sys_info.boost_vid_2bit = igp_info->info_6.ulBoostVid_2bit; in sumo_parse_sys_info_table()
1712 pi->sys_info.enable_boost = true; in sumo_parse_sys_info_table()
1714 pi->sys_info.enable_boost = false; in sumo_parse_sys_info_table()
1716 &pi->sys_info.disp_clk_voltage_mapping_table, in sumo_parse_sys_info_table()
1719 &pi->sys_info.sclk_voltage_mapping_table, in sumo_parse_sys_info_table()
1721 sumo_construct_vid_mapping_table(rdev, &pi->sys_info.vid_mapping_table, in sumo_parse_sys_info_table()
1730 struct sumo_power_info *pi = sumo_get_pi(rdev); in sumo_construct_boot_and_acpi_state() local
1732 pi->boot_pl.sclk = pi->sys_info.bootup_sclk; in sumo_construct_boot_and_acpi_state()
1733 pi->boot_pl.vddc_index = pi->sys_info.bootup_nb_voltage_index; in sumo_construct_boot_and_acpi_state()
1734 pi->boot_pl.ds_divider_index = 0; in sumo_construct_boot_and_acpi_state()
1735 pi->boot_pl.ss_divider_index = 0; in sumo_construct_boot_and_acpi_state()
1736 pi->boot_pl.allow_gnb_slow = 1; in sumo_construct_boot_and_acpi_state()
1737 pi->acpi_pl = pi->boot_pl; in sumo_construct_boot_and_acpi_state()
1738 pi->current_ps.num_levels = 1; in sumo_construct_boot_and_acpi_state()
1739 pi->current_ps.levels[0] = pi->boot_pl; in sumo_construct_boot_and_acpi_state()
1744 struct sumo_power_info *pi; in sumo_dpm_init() local
1748 pi = kzalloc(sizeof(struct sumo_power_info), GFP_KERNEL); in sumo_dpm_init()
1749 if (pi == NULL) in sumo_dpm_init()
1751 rdev->pm.dpm.priv = pi; in sumo_dpm_init()
1753 pi->driver_nbps_policy_disable = false; in sumo_dpm_init()
1755 pi->disable_gfx_power_gating_in_uvd = true; in sumo_dpm_init()
1757 pi->disable_gfx_power_gating_in_uvd = false; in sumo_dpm_init()
1758 pi->enable_alt_vddnb = true; in sumo_dpm_init()
1759 pi->enable_sclk_ds = true; in sumo_dpm_init()
1760 pi->enable_dynamic_m3_arbiter = false; in sumo_dpm_init()
1761 pi->enable_dynamic_patch_ps = true; in sumo_dpm_init()
1766 pi->enable_gfx_power_gating = false; in sumo_dpm_init()
1768 pi->enable_gfx_power_gating = true; in sumo_dpm_init()
1769 pi->enable_gfx_clock_gating = true; in sumo_dpm_init()
1770 pi->enable_mg_clock_gating = true; in sumo_dpm_init()
1771 pi->enable_auto_thermal_throttling = true; in sumo_dpm_init()
1787 pi->pasi = CYPRESS_HASI_DFLT; in sumo_dpm_init()
1788 pi->asi = RV770_ASI_DFLT; in sumo_dpm_init()
1789 pi->thermal_auto_throttling = pi->sys_info.htc_tmp_lmt; in sumo_dpm_init()
1790 pi->enable_boost = pi->sys_info.enable_boost; in sumo_dpm_init()
1791 pi->enable_dpm = true; in sumo_dpm_init()
1817 struct sumo_power_info *pi = sumo_get_pi(rdev); in sumo_dpm_debugfs_print_current_performance_level() local
1818 struct radeon_ps *rps = &pi->current_rps; in sumo_dpm_debugfs_print_current_performance_level()
1826 pl = &pi->boost_pl; in sumo_dpm_debugfs_print_current_performance_level()
1844 struct sumo_power_info *pi = sumo_get_pi(rdev); in sumo_dpm_get_current_sclk() local
1845 struct radeon_ps *rps = &pi->current_rps; in sumo_dpm_get_current_sclk()
1853 pl = &pi->boost_pl; in sumo_dpm_get_current_sclk()
1865 struct sumo_power_info *pi = sumo_get_pi(rdev); in sumo_dpm_get_current_mclk() local
1867 return pi->sys_info.bootup_uma_clk; in sumo_dpm_get_current_mclk()
1872 struct sumo_power_info *pi = sumo_get_pi(rdev); in sumo_dpm_get_current_vddc() local
1873 struct radeon_ps *rps = &pi->current_rps; in sumo_dpm_get_current_vddc()
1881 pl = &pi->boost_pl; in sumo_dpm_get_current_vddc()
1905 struct sumo_power_info *pi = sumo_get_pi(rdev); in sumo_dpm_get_sclk() local
1906 struct sumo_ps *requested_state = sumo_get_ps(&pi->requested_rps); in sumo_dpm_get_sclk()
1916 struct sumo_power_info *pi = sumo_get_pi(rdev); in sumo_dpm_get_mclk() local
1918 return pi->sys_info.bootup_uma_clk; in sumo_dpm_get_mclk()
1924 struct sumo_power_info *pi = sumo_get_pi(rdev); in sumo_dpm_force_performance_level() local
1925 struct radeon_ps *rps = &pi->current_rps; in sumo_dpm_force_performance_level()
1933 if (pi->enable_boost) in sumo_dpm_force_performance_level()
1945 if (pi->enable_boost) in sumo_dpm_force_performance_level()
1960 if (pi->enable_boost) in sumo_dpm_force_performance_level()