drivers/gpu/drm/amd/pm/powerplay/smumgr/polaris10_smumgr.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/pm/powerplay/smumgr/polaris10_smumgr.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/pm/powerplay/smumgr/polaris10_smumgr.c- Extension
.c- Size
- 101895 bytes
- Lines
- 2709
- Domain
- Driver Families
- Bucket
- drivers/gpu
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/pci.hpp_debug.hsmumgr.hsmu74.hsmu_ucode_xfer_vi.hpolaris10_smumgr.hsmu74_discrete.hsmu/smu_7_1_3_d.hsmu/smu_7_1_3_sh_mask.hgmc/gmc_8_1_d.hgmc/gmc_8_1_sh_mask.hoss/oss_3_0_d.hgca/gfx_8_0_d.hbif/bif_5_0_d.hbif/bif_5_0_sh_mask.hppatomctrl.hcgs_common.hsmu7_ppsmc.hsmu7_smumgr.hsmu7_dyn_defaults.hsmu7_hwmgr.hhardwaremanager.hatombios.hpppcielanes.hdce/dce_10_0_d.hdce/dce_10_0_sh_mask.h
Detected Declarations
function polaris10_perform_btcfunction polaris10_setup_graphics_level_structurefunction polaris10_avfs_event_mgrfunction polaris10_start_smu_in_protection_modefunction polaris10_start_smu_in_non_protection_modefunction polaris10_start_smufunction polaris10_is_hw_avfs_presentfunction polaris10_smu_initfunction polaris10_get_dependency_volt_by_clkfunction scale_fan_gain_settingsfunction polaris10_populate_bapm_parameters_in_dpm_tablefunction polaris10_populate_zero_rpm_parametersfunction polaris10_populate_svi_load_linefunction polaris10_populate_tdc_limitfunction polaris10_populate_dw8function polaris10_populate_temperature_scalerfunction polaris10_populate_fuzzy_fanfunction polaris10_populate_gnb_lpmlfunction polaris10_populate_bapm_vddc_base_leakage_siddfunction polaris10_populate_pm_fusesfunction polaris10_populate_smc_mvdd_tablefunction polaris10_populate_smc_vddc_tablefunction polaris10_populate_smc_vddci_tablefunction polaris10_populate_cac_tablefunction polaris10_populate_smc_voltage_tablesfunction polaris10_populate_ulv_levelfunction polaris10_populate_ulv_statefunction polaris10_populate_smc_link_levelfunction polaris10_get_sclk_range_tablefunction polaris10_calculate_sclk_paramsfunction polaris10_populate_single_graphic_levelfunction polaris10_get_vddc_shared_railinfofunction polaris10_populate_all_graphic_levelsfunction polaris10_populate_single_memory_levelfunction polaris10_populate_all_memory_levelsfunction polaris10_populate_mvdd_valuefunction polaris10_populate_smc_acpi_levelfunction polaris10_populate_smc_vce_levelfunction polaris10_populate_smc_samu_levelfunction polaris10_populate_memory_timing_parametersfunction polaris10_program_memory_timing_parametersfunction polaris10_populate_smc_uvd_levelfunction polaris10_populate_smc_boot_levelfunction polaris10_populate_smc_initailial_statefunction polaris10_populate_clock_stretcher_data_tablefunction polaris10_populate_vr_configfunction polaris10_populate_avfs_parametersfunction polaris10_initialize_power_tune_defaults
Annotated Snippet
if (dep_table->entries[i].clk >= clock) {
*voltage |= (dep_table->entries[i].vddc *
VOLTAGE_SCALE) << VDDC_SHIFT;
if (SMU7_VOLTAGE_CONTROL_NONE == data->vddci_control)
*voltage |= (data->vbios_boot_state.vddci_bootup_value *
VOLTAGE_SCALE) << VDDCI_SHIFT;
else if (dep_table->entries[i].vddci)
*voltage |= (dep_table->entries[i].vddci *
VOLTAGE_SCALE) << VDDCI_SHIFT;
else {
vddci = phm_find_closest_vddci(&(data->vddci_voltage_table),
(dep_table->entries[i].vddc -
(uint16_t)VDDC_VDDCI_DELTA));
*voltage |= (vddci * VOLTAGE_SCALE) << VDDCI_SHIFT;
}
if (SMU7_VOLTAGE_CONTROL_NONE == data->mvdd_control)
*mvdd = data->vbios_boot_state.mvdd_bootup_value *
VOLTAGE_SCALE;
else if (dep_table->entries[i].mvdd)
*mvdd = (uint32_t) dep_table->entries[i].mvdd *
VOLTAGE_SCALE;
*voltage |= 1 << PHASES_SHIFT;
return 0;
}
}
/* sclk is bigger than max sclk in the dependence table */
*voltage |= (dep_table->entries[i - 1].vddc * VOLTAGE_SCALE) << VDDC_SHIFT;
if (SMU7_VOLTAGE_CONTROL_NONE == data->vddci_control)
*voltage |= (data->vbios_boot_state.vddci_bootup_value *
VOLTAGE_SCALE) << VDDCI_SHIFT;
else if (dep_table->entries[i-1].vddci) {
*voltage |= (dep_table->entries[i - 1].vddci * VOLTAGE_SCALE) << VDDC_SHIFT;
} else {
vddci = phm_find_closest_vddci(&(data->vddci_voltage_table),
(dep_table->entries[i].vddc -
(uint16_t)VDDC_VDDCI_DELTA));
*voltage |= (vddci * VOLTAGE_SCALE) << VDDCI_SHIFT;
}
if (SMU7_VOLTAGE_CONTROL_NONE == data->mvdd_control)
*mvdd = data->vbios_boot_state.mvdd_bootup_value * VOLTAGE_SCALE;
else if (dep_table->entries[i].mvdd)
*mvdd = (uint32_t) dep_table->entries[i - 1].mvdd * VOLTAGE_SCALE;
return 0;
}
static uint16_t scale_fan_gain_settings(uint16_t raw_setting)
{
uint32_t tmp;
tmp = raw_setting * 4096 / 100;
return (uint16_t)tmp;
}
static int polaris10_populate_bapm_parameters_in_dpm_table(struct pp_hwmgr *hwmgr)
{
struct polaris10_smumgr *smu_data = (struct polaris10_smumgr *)(hwmgr->smu_backend);
const struct polaris10_pt_defaults *defaults = smu_data->power_tune_defaults;
SMU74_Discrete_DpmTable *table = &(smu_data->smc_state_table);
struct phm_ppt_v1_information *table_info =
(struct phm_ppt_v1_information *)(hwmgr->pptable);
struct phm_cac_tdp_table *cac_dtp_table = table_info->cac_dtp_table;
struct pp_advance_fan_control_parameters *fan_table =
&hwmgr->thermal_controller.advanceFanControlParameters;
int i, j, k;
const uint16_t *pdef1;
const uint16_t *pdef2;
table->DefaultTdp = PP_HOST_TO_SMC_US((uint16_t)(cac_dtp_table->usTDP * 128));
table->TargetTdp = PP_HOST_TO_SMC_US((uint16_t)(cac_dtp_table->usTDP * 128));
PP_ASSERT_WITH_CODE(cac_dtp_table->usTargetOperatingTemp <= 255,
"Target Operating Temp is out of Range!",
);
table->TemperatureLimitEdge = PP_HOST_TO_SMC_US(
cac_dtp_table->usTargetOperatingTemp * 256);
table->TemperatureLimitHotspot = PP_HOST_TO_SMC_US(
cac_dtp_table->usTemperatureLimitHotspot * 256);
table->FanGainEdge = PP_HOST_TO_SMC_US(
scale_fan_gain_settings(fan_table->usFanGainEdge));
table->FanGainHotspot = PP_HOST_TO_SMC_US(
scale_fan_gain_settings(fan_table->usFanGainHotspot));
pdef1 = defaults->BAPMTI_R;
Annotation
- Immediate include surface: `linux/pci.h`, `pp_debug.h`, `smumgr.h`, `smu74.h`, `smu_ucode_xfer_vi.h`, `polaris10_smumgr.h`, `smu74_discrete.h`, `smu/smu_7_1_3_d.h`.
- Detected declarations: `function polaris10_perform_btc`, `function polaris10_setup_graphics_level_structure`, `function polaris10_avfs_event_mgr`, `function polaris10_start_smu_in_protection_mode`, `function polaris10_start_smu_in_non_protection_mode`, `function polaris10_start_smu`, `function polaris10_is_hw_avfs_present`, `function polaris10_smu_init`, `function polaris10_get_dependency_volt_by_clk`, `function scale_fan_gain_settings`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.