drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c- Extension
.c- Size
- 47573 bytes
- Lines
- 1656
- 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.hsmumgr.hhwmgr.hhardwaremanager.hrv_ppsmc.hsmu10_hwmgr.hpower_state.hsoc15_common.hsmu10.hasic_reg/pwr/pwr_10_0_offset.hasic_reg/pwr/pwr_10_0_sh_mask.h
Detected Declarations
function smu10_display_clock_voltage_requestfunction smu10_initialize_dpm_defaultsfunction smu10_construct_max_power_limits_tablefunction smu10_get_system_info_datafunction smu10_construct_boot_statefunction smu10_set_clock_limitfunction smu10_set_min_deep_sleep_dcefclkfunction smu10_set_hard_min_dcefclk_by_freqfunction smu10_set_hard_min_fclk_by_freqfunction smu10_set_hard_min_gfxclk_by_freqfunction smu10_set_soft_max_gfxclk_by_freqfunction smu10_set_active_display_countfunction smu10_set_power_state_tasksfunction smu10_init_power_gate_statefunction smu10_setup_asic_taskfunction smu10_reset_cc6_datafunction smu10_power_off_asicfunction smu10_is_gfx_onfunction smu10_disable_gfx_offfunction smu10_disable_dpm_tasksfunction smu10_enable_gfx_offfunction smu10_populate_umdpstate_clocksfunction smu10_enable_dpm_tasksfunction smu10_gfx_off_controlfunction smu10_apply_state_adjust_rulesfunction smu10_get_clock_voltage_dependency_tablefunction smu10_populate_clock_tablefunction smu10_hwmgr_backend_initfunction smu10_hwmgr_backend_finifunction smu10_dpm_force_dpm_levelfunction smu10_dpm_get_mclkfunction smu10_dpm_get_sclkfunction smu10_dpm_patch_boot_statefunction smu10_dpm_get_pp_table_entry_callbackfunction smu10_dpm_get_num_of_pp_table_entriesfunction smu10_dpm_get_pp_table_entryfunction smu10_get_power_state_sizefunction smu10_set_cpu_power_statefunction smu10_store_cc6_datafunction smu10_force_clock_levelfunction smu10_emit_clock_levelsfunction smu10_get_performance_levelfunction smu10_get_current_shallow_sleep_clocksfunction smu10_get_mem_latencyfunction smu10_get_clock_by_type_with_latencyfunction smu10_get_clock_by_type_with_voltagefunction smu10_get_max_high_clocksfunction smu10_thermal_get_temperature
Annotated Snippet
if (low > 2 || high > 2) {
pr_info("Currently sclk only support 3 levels on RV\n");
return -EINVAL;
}
smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_SetHardMinGfxClk,
low == 2 ? data->gfx_max_freq_limit/100 :
low == 1 ? SMU10_UMD_PSTATE_GFXCLK :
data->gfx_min_freq_limit/100,
NULL);
smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_SetSoftMaxGfxClk,
high == 0 ? data->gfx_min_freq_limit/100 :
high == 1 ? SMU10_UMD_PSTATE_GFXCLK :
data->gfx_max_freq_limit/100,
NULL);
break;
case PP_MCLK:
if (low > mclk_table->count - 1 || high > mclk_table->count - 1)
return -EINVAL;
smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_SetHardMinFclkByFreq,
mclk_table->entries[low].clk/100,
NULL);
smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_SetSoftMaxFclkByFreq,
mclk_table->entries[high].clk/100,
NULL);
break;
case PP_PCIE:
default:
break;
}
return 0;
}
static int smu10_emit_clock_levels(struct pp_hwmgr *hwmgr,
enum pp_clock_type type, char *buf,
int *offset)
{
struct smu10_hwmgr *data = (struct smu10_hwmgr *)(hwmgr->backend);
struct smu10_voltage_dependency_table *mclk_table =
data->clock_vol_info.vdd_dep_on_fclk;
uint32_t i, now, size = *offset;
uint32_t min_freq, max_freq = 0;
int ret = 0;
switch (type) {
case PP_SCLK:
ret = smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetGfxclkFrequency, &now);
if (ret)
return ret;
/* driver only know min/max gfx_clk, Add level 1 for all other gfx clks */
if (now == data->gfx_max_freq_limit/100)
i = 2;
else if (now == data->gfx_min_freq_limit/100)
i = 0;
else
i = 1;
size += sysfs_emit_at(buf, size, "0: %uMhz %s\n",
data->gfx_min_freq_limit / 100,
i == 0 ? "*" : "");
size += sysfs_emit_at(buf, size, "1: %uMhz %s\n",
i == 1 ? now : SMU10_UMD_PSTATE_GFXCLK,
i == 1 ? "*" : "");
size += sysfs_emit_at(buf, size, "2: %uMhz %s\n",
data->gfx_max_freq_limit / 100,
i == 2 ? "*" : "");
break;
case PP_MCLK:
ret = smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetFclkFrequency, &now);
if (ret)
return ret;
for (i = 0; i < mclk_table->count; i++)
size += sysfs_emit_at(
buf, size, "%d: %uMhz %s\n", i,
mclk_table->entries[i].clk / 100,
((mclk_table->entries[i].clk / 100) == now) ?
"*" :
"");
break;
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 smu10_display_clock_voltage_request`, `function smu10_initialize_dpm_defaults`, `function smu10_construct_max_power_limits_table`, `function smu10_get_system_info_data`, `function smu10_construct_boot_state`, `function smu10_set_clock_limit`, `function smu10_set_min_deep_sleep_dcefclk`, `function smu10_set_hard_min_dcefclk_by_freq`, `function smu10_set_hard_min_fclk_by_freq`, `function smu10_set_hard_min_gfxclk_by_freq`.
- 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.