drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c- Extension
.c- Size
- 196826 bytes
- Lines
- 5963
- 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.hlinux/delay.hlinux/module.hlinux/pci.hlinux/slab.hasm/div64.hasm/intel-family.hdrm/amdgpu_drm.hppatomctrl.hatombios.hpptable_v1_0.hpppcielanes.hamd_pcie_helpers.hhardwaremanager.hprocess_pptables_v1_0.hcgs_common.hsmu7_common.hhwmgr.hsmu7_hwmgr.hsmu_ucode_xfer_vi.hsmu7_powertune.hsmu7_dyn_defaults.hsmu7_thermal.hsmu7_clockpowergating.hprocesspptables.hpp_thermal.hsmu7_baco.hsmu7_smumgr.hpolaris10_smumgr.hivsrcid/ivsrcid_vislands30.h
Detected Declarations
enum DPM_EVENT_SRCfunction smu7_get_mc_microcode_versionfunction smu7_get_current_pcie_speedfunction smu7_get_current_pcie_lane_numberfunction smu7_enable_smc_voltage_controllerfunction smu7_voltage_controlfunction smu7_enable_voltage_controlfunction phm_get_svi2_voltage_table_v0function smu7_construct_voltage_tablesfunction smu7_program_static_screen_threshold_parametersfunction smu7_enable_display_gapfunction smu7_program_voting_clientsfunction smu7_clear_voting_clientsfunction smu7_copy_and_switch_arb_setsfunction smu7_reset_to_defaultfunction smu7_initial_switch_from_arbf0_to_f1function smu7_force_switch_to_arbf0function smu7_override_pcie_speedfunction smu7_override_pcie_widthfunction smu7_setup_default_pcie_tablefunction smu7_reset_dpm_tablesfunction smu7_setup_dpm_tables_v0function smu7_setup_dpm_tables_v1function smu7_odn_initial_default_settingfunction smu7_setup_voltage_range_from_vbiosfunction smu7_check_dpm_table_updatedfunction smu7_setup_default_dpm_tablesfunction smu7_enable_vrhot_gpio_interruptfunction smu7_enable_sclk_controlfunction smu7_enable_ulvfunction smu7_disable_ulvfunction smu7_enable_deep_sleep_master_switchfunction smu7_disable_deep_sleep_master_switchfunction smu7_disable_sclk_vce_handshakefunction smu7_disable_handshake_uvdfunction smu7_enable_sclk_mclk_dpmfunction smu7_start_dpmfunction smu7_disable_sclk_mclk_dpmfunction smu7_stop_dpmfunction smu7_set_dpm_event_sourcesfunction smu7_enable_auto_throttle_sourcefunction smu7_enable_thermal_auto_throttlefunction smu7_disable_auto_throttle_sourcefunction smu7_disable_thermal_auto_throttlefunction smu7_pcie_performance_requestfunction smu7_program_edc_didt_registersfunction smu7_populate_edc_leakage_registersfunction smu7_populate_umdpstate_clocks
Annotated Snippet
if (dep_table->entries[i].vddc != odn_dep_table->entries[i].vddc) {
data->need_update_smu7_dpm_table |= DPMTABLE_OD_UPDATE_VDDC | DPMTABLE_OD_UPDATE_MCLK;
return;
}
}
dep_table = table_info->vdd_dep_on_sclk;
odn_dep_table = (struct phm_ppt_v1_clock_voltage_dependency_table *)&(odn_table->vdd_dependency_on_sclk);
for (i = 0; i < dep_table->count; i++) {
if (dep_table->entries[i].vddc != odn_dep_table->entries[i].vddc) {
data->need_update_smu7_dpm_table |= DPMTABLE_OD_UPDATE_VDDC | DPMTABLE_OD_UPDATE_SCLK;
return;
}
}
if (data->need_update_smu7_dpm_table & DPMTABLE_OD_UPDATE_VDDC) {
data->need_update_smu7_dpm_table &= ~DPMTABLE_OD_UPDATE_VDDC;
data->need_update_smu7_dpm_table |= DPMTABLE_OD_UPDATE_SCLK | DPMTABLE_OD_UPDATE_MCLK;
}
}
static int smu7_setup_default_dpm_tables(struct pp_hwmgr *hwmgr)
{
struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend);
smu7_reset_dpm_tables(hwmgr);
if (hwmgr->pp_table_version == PP_TABLE_V1)
smu7_setup_dpm_tables_v1(hwmgr);
else if (hwmgr->pp_table_version == PP_TABLE_V0)
smu7_setup_dpm_tables_v0(hwmgr);
smu7_setup_default_pcie_table(hwmgr);
/* save a copy of the default DPM table */
memcpy(&(data->golden_dpm_table), &(data->dpm_table),
sizeof(struct smu7_dpm_table));
/* initialize ODN table */
if (hwmgr->od_enabled) {
if (data->odn_dpm_table.max_vddc) {
smu7_check_dpm_table_updated(hwmgr);
} else {
smu7_setup_voltage_range_from_vbios(hwmgr);
smu7_odn_initial_default_setting(hwmgr);
}
}
return 0;
}
static int smu7_enable_vrhot_gpio_interrupt(struct pp_hwmgr *hwmgr)
{
if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps,
PHM_PlatformCaps_RegulatorHot))
return smum_send_msg_to_smc(hwmgr,
PPSMC_MSG_EnableVRHotGPIOInterrupt,
NULL);
return 0;
}
static int smu7_enable_sclk_control(struct pp_hwmgr *hwmgr)
{
PHM_WRITE_INDIRECT_FIELD(hwmgr->device, CGS_IND_REG__SMC, SCLK_PWRMGT_CNTL,
SCLK_PWRMGT_OFF, 0);
return 0;
}
static int smu7_enable_ulv(struct pp_hwmgr *hwmgr)
{
struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend);
if (data->ulv_supported)
return smum_send_msg_to_smc(hwmgr, PPSMC_MSG_EnableULV, NULL);
return 0;
}
static int smu7_disable_ulv(struct pp_hwmgr *hwmgr)
{
struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend);
if (data->ulv_supported)
return smum_send_msg_to_smc(hwmgr, PPSMC_MSG_DisableULV, NULL);
return 0;
}
static int smu7_enable_deep_sleep_master_switch(struct pp_hwmgr *hwmgr)
{
Annotation
- Immediate include surface: `pp_debug.h`, `linux/delay.h`, `linux/module.h`, `linux/pci.h`, `linux/slab.h`, `asm/div64.h`, `asm/intel-family.h`, `drm/amdgpu_drm.h`.
- Detected declarations: `enum DPM_EVENT_SRC`, `function smu7_get_mc_microcode_version`, `function smu7_get_current_pcie_speed`, `function smu7_get_current_pcie_lane_number`, `function smu7_enable_smc_voltage_controller`, `function smu7_voltage_control`, `function smu7_enable_voltage_control`, `function phm_get_svi2_voltage_table_v0`, `function smu7_construct_voltage_tables`, `function smu7_program_static_screen_threshold_parameters`.
- 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.