drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu8_hwmgr.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu8_hwmgr.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu8_hwmgr.c- Extension
.c- Size
- 56132 bytes
- Lines
- 2023
- 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/types.hlinux/kernel.hlinux/slab.hatom-types.hatombios.hprocesspptables.hcgs_common.hsmu/smu_8_0_d.hsmu8_fusion.hsmu/smu_8_0_sh_mask.hsmumgr.hhwmgr.hhardwaremanager.hcz_ppsmc.hsmu8_hwmgr.hpower_state.hpp_thermal.h
Detected Declarations
function smu8_get_eclk_levelfunction smu8_get_sclk_levelfunction smu8_get_uvd_levelfunction smu8_get_max_sclk_levelfunction smu8_initialize_dpm_defaultsfunction smu8_convert_8Bit_index_to_voltagefunction smu8_construct_max_power_limits_tablefunction smu8_get_system_info_datafunction smu8_construct_boot_statefunction smu8_upload_pptable_to_smufunction smu8_init_sclk_limitfunction smu8_init_uvd_limitfunction smu8_init_vce_limitfunction smu8_init_acp_limitfunction smu8_init_power_gate_statefunction smu8_init_sclk_thresholdfunction smu8_update_sclk_limitfunction smu8_set_deep_sleep_sclk_thresholdfunction smu8_set_watermark_thresholdfunction smu8_nbdpm_pstate_enable_disablefunction smu8_disable_nb_dpmfunction smu8_enable_nb_dpmfunction smu8_update_low_mem_pstatefunction smu8_set_power_state_tasksfunction smu8_setup_asic_taskfunction smu8_power_up_display_clock_sys_pllfunction smu8_clear_nb_dpm_flagfunction smu8_reset_cc6_datafunction smu8_program_voting_clientsfunction smu8_clear_voting_clientsfunction smu8_start_dpmfunction smu8_stop_dpmfunction smu8_program_bootup_statefunction smu8_reset_acp_boot_levelfunction smu8_populate_umdpstate_clocksfunction smu8_enable_dpm_tasksfunction smu8_disable_dpm_tasksfunction smu8_power_off_asicfunction smu8_apply_state_adjust_rulesfunction smu8_hwmgr_backend_initfunction smu8_hwmgr_backend_finifunction smu8_phm_force_dpm_highestfunction smu8_phm_unforce_dpm_levelsfunction smu8_phm_force_dpm_lowestfunction smu8_dpm_force_dpm_levelfunction smu8_dpm_powerdown_uvdfunction smu8_dpm_powerup_uvdfunction smu8_dpm_update_vce_dpm
Annotated Snippet
if (i < SMU8_NUM_NBPMEMORYCLOCK) {
data->sys_info.nbp_memory_clock[i] =
le32_to_cpu(info->ulNbpStateMemclkFreq[i]);
}
data->sys_info.nbp_n_clock[i] =
le32_to_cpu(info->ulNbpStateNClkFreq[i]);
}
for (i = 0; i < MAX_DISPLAY_CLOCK_LEVEL; i++) {
data->sys_info.display_clock[i] =
le32_to_cpu(info->sDispClkVoltageMapping[i].ulMaximumSupportedCLK);
}
/* Here use 4 levels, make sure not exceed */
for (i = 0; i < SMU8_NUM_NBPSTATES; i++) {
data->sys_info.nbp_voltage_index[i] =
le16_to_cpu(info->usNBPStateVoltage[i]);
}
if (!data->sys_info.nb_dpm_enable) {
for (i = 1; i < SMU8_NUM_NBPSTATES; i++) {
if (i < SMU8_NUM_NBPMEMORYCLOCK) {
data->sys_info.nbp_memory_clock[i] =
data->sys_info.nbp_memory_clock[0];
}
data->sys_info.nbp_n_clock[i] =
data->sys_info.nbp_n_clock[0];
data->sys_info.nbp_voltage_index[i] =
data->sys_info.nbp_voltage_index[0];
}
}
if (le32_to_cpu(info->ulGPUCapInfo) &
SYS_INFO_GPUCAPS__ENABLE_DFS_BYPASS) {
phm_cap_set(hwmgr->platform_descriptor.platformCaps,
PHM_PlatformCaps_EnableDFSBypass);
}
data->sys_info.uma_channel_number = info->ucUMAChannelNumber;
smu8_construct_max_power_limits_table (hwmgr,
&hwmgr->dyn_state.max_clock_voltage_on_ac);
return result;
}
static int smu8_construct_boot_state(struct pp_hwmgr *hwmgr)
{
struct smu8_hwmgr *data = hwmgr->backend;
data->boot_power_level.engineClock =
data->sys_info.bootup_engine_clock;
data->boot_power_level.vddcIndex =
(uint8_t)data->sys_info.bootup_nb_voltage_index;
data->boot_power_level.dsDividerIndex = 0;
data->boot_power_level.ssDividerIndex = 0;
data->boot_power_level.allowGnbSlow = 1;
data->boot_power_level.forceNBPstate = 0;
data->boot_power_level.hysteresis_up = 0;
data->boot_power_level.numSIMDToPowerDown = 0;
data->boot_power_level.display_wm = 0;
data->boot_power_level.vce_wm = 0;
return 0;
}
static int smu8_upload_pptable_to_smu(struct pp_hwmgr *hwmgr)
{
struct SMU8_Fusion_ClkTable *clock_table;
int ret;
uint32_t i;
void *table = NULL;
pp_atomctrl_clock_dividers_kong dividers;
struct phm_clock_voltage_dependency_table *vddc_table =
hwmgr->dyn_state.vddc_dependency_on_sclk;
struct phm_clock_voltage_dependency_table *vdd_gfx_table =
hwmgr->dyn_state.vdd_gfx_dependency_on_sclk;
struct phm_acp_clock_voltage_dependency_table *acp_table =
hwmgr->dyn_state.acp_clock_voltage_dependency_table;
struct phm_uvd_clock_voltage_dependency_table *uvd_table =
hwmgr->dyn_state.uvd_clock_voltage_dependency_table;
struct phm_vce_clock_voltage_dependency_table *vce_table =
hwmgr->dyn_state.vce_clock_voltage_dependency_table;
if (!hwmgr->need_pp_table_upload)
return 0;
Annotation
- Immediate include surface: `pp_debug.h`, `linux/types.h`, `linux/kernel.h`, `linux/slab.h`, `atom-types.h`, `atombios.h`, `processpptables.h`, `cgs_common.h`.
- Detected declarations: `function smu8_get_eclk_level`, `function smu8_get_sclk_level`, `function smu8_get_uvd_level`, `function smu8_get_max_sclk_level`, `function smu8_initialize_dpm_defaults`, `function smu8_convert_8Bit_index_to_voltage`, `function smu8_construct_max_power_limits_table`, `function smu8_get_system_info_data`, `function smu8_construct_boot_state`, `function smu8_upload_pptable_to_smu`.
- 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.