drivers/gpu/drm/amd/pm/powerplay/smumgr/fiji_smumgr.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/pm/powerplay/smumgr/fiji_smumgr.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/pm/powerplay/smumgr/fiji_smumgr.c- Extension
.c- Size
- 93475 bytes
- Lines
- 2671
- 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
pp_debug.hsmumgr.hsmu7_dyn_defaults.hsmu73.hsmu_ucode_xfer_vi.hfiji_smumgr.hfiji_ppsmc.hsmu73_discrete.hppatomctrl.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.hdce/dce_10_0_d.hdce/dce_10_0_sh_mask.hhardwaremanager.hcgs_common.hatombios.hpppcielanes.hhwmgr.hsmu7_hwmgr.h
Detected Declarations
function fiji_start_smu_in_protection_modefunction fiji_start_smu_in_non_protection_modefunction fiji_start_avfs_btcfunction fiji_setup_graphics_level_structurefunction fiji_avfs_event_mgrfunction fiji_start_smufunction fiji_is_hw_avfs_presentfunction fiji_smu_initfunction fiji_get_dependency_volt_by_clkfunction scale_fan_gain_settingsfunction get_scl_sda_valuefunction fiji_initialize_power_tune_defaultsfunction fiji_populate_bapm_parameters_in_dpm_tablefunction fiji_populate_svi_load_linefunction fiji_populate_tdc_limitfunction fiji_populate_dw8function fiji_populate_temperature_scalerfunction fiji_populate_fuzzy_fanfunction fiji_populate_gnb_lpmlfunction fiji_populate_bapm_vddc_base_leakage_siddfunction fiji_populate_pm_fusesfunction fiji_populate_cac_tablefunction fiji_populate_smc_voltage_tablesfunction fiji_populate_ulv_levelfunction fiji_populate_ulv_statefunction fiji_populate_smc_link_levelfunction fiji_calculate_sclk_paramsfunction fiji_populate_single_graphic_levelfunction fiji_populate_all_graphic_levelsfunction fiji_get_mclk_frequency_ratiofunction fiji_calculate_mclk_paramsfunction fiji_populate_single_memory_levelfunction fiji_populate_all_memory_levelsfunction fiji_populate_mvdd_valuefunction fiji_populate_smc_acpi_levelfunction fiji_populate_smc_vce_levelfunction fiji_populate_smc_acp_levelfunction fiji_populate_memory_timing_parametersfunction fiji_program_memory_timing_parametersfunction fiji_populate_smc_uvd_levelfunction fiji_populate_smc_boot_levelfunction fiji_populate_smc_initailial_statefunction fiji_populate_clock_stretcher_data_tablefunction fiji_populate_vr_configfunction fiji_init_arb_table_indexfunction fiji_setup_dpm_led_configfunction fiji_init_smc_tablefunction fiji_thermal_setup_fan_table
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 -
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) {
vddci = phm_find_closest_vddci(&(data->vddci_voltage_table),
(dep_table->entries[i].vddc -
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 void get_scl_sda_value(uint8_t line, uint8_t *scl, uint8_t *sda)
{
switch (line) {
case SMU7_I2CLineID_DDC1:
*scl = SMU7_I2C_DDC1CLK;
*sda = SMU7_I2C_DDC1DATA;
break;
case SMU7_I2CLineID_DDC2:
*scl = SMU7_I2C_DDC2CLK;
*sda = SMU7_I2C_DDC2DATA;
break;
case SMU7_I2CLineID_DDC3:
*scl = SMU7_I2C_DDC3CLK;
*sda = SMU7_I2C_DDC3DATA;
break;
case SMU7_I2CLineID_DDC4:
*scl = SMU7_I2C_DDC4CLK;
*sda = SMU7_I2C_DDC4DATA;
break;
case SMU7_I2CLineID_DDC5:
*scl = SMU7_I2C_DDC5CLK;
*sda = SMU7_I2C_DDC5DATA;
break;
case SMU7_I2CLineID_DDC6:
*scl = SMU7_I2C_DDC6CLK;
*sda = SMU7_I2C_DDC6DATA;
break;
case SMU7_I2CLineID_SCLSDA:
*scl = SMU7_I2C_SCL;
*sda = SMU7_I2C_SDA;
break;
case SMU7_I2CLineID_DDCVGA:
*scl = SMU7_I2C_DDCVGACLK;
Annotation
- Immediate include surface: `pp_debug.h`, `smumgr.h`, `smu7_dyn_defaults.h`, `smu73.h`, `smu_ucode_xfer_vi.h`, `fiji_smumgr.h`, `fiji_ppsmc.h`, `smu73_discrete.h`.
- Detected declarations: `function fiji_start_smu_in_protection_mode`, `function fiji_start_smu_in_non_protection_mode`, `function fiji_start_avfs_btc`, `function fiji_setup_graphics_level_structure`, `function fiji_avfs_event_mgr`, `function fiji_start_smu`, `function fiji_is_hw_avfs_present`, `function fiji_smu_init`, `function fiji_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.