drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu_helper.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu_helper.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu_helper.c- Extension
.c- Size
- 18773 bytes
- Lines
- 683
- 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.hlinux/reboot.hhwmgr.hpp_debug.hppatomctrl.hppsmc.hatom.hivsrcid/thm/irqsrcs_thm_9_0.hivsrcid/smuio/irqsrcs_smuio_9_0.hivsrcid/ivsrcid_vislands30.h
Detected Declarations
function filesfunction convert_to_vddcfunction phm_copy_clock_limits_arrayfunction phm_copy_overdrive_settings_limits_arrayfunction phm_set_field_to_u32function phm_wait_on_registerfunction phm_wait_on_indirect_registerfunction phm_wait_for_register_unequalfunction phm_wait_for_indirect_register_unequalfunction phm_cf_want_uvd_power_gatingfunction phm_cf_want_vce_power_gatingfunction phm_trim_voltage_tablefunction phm_get_svi2_mvdd_voltage_tablefunction phm_get_svi2_vddci_voltage_tablefunction phm_get_svi2_vdd_voltage_tablefunction phm_trim_voltage_table_to_fit_state_tablefunction phm_reset_single_dpm_tablefunction phm_setup_pcie_table_entryfunction phm_get_dpm_level_enable_mask_valuefunction phm_get_voltage_indexfunction phm_get_voltage_idfunction phm_find_closest_vddcifunction phm_find_boot_levelfunction phm_get_sclk_for_voltage_evvfunction phm_get_lowest_enabled_levelfunction phm_get_voltage_evv_on_sclkfunction phm_irq_processfunction smu9_register_irq_handlersfunction smu_get_voltage_dependency_table_ppt_v1function smu_set_watermarks_for_clocks_ranges
Annotated Snippet
if (vvalue == table->entries[j].value) {
found = true;
break;
}
}
if (!found) {
table->entries[table->count].value = vvalue;
table->entries[table->count].smio_low =
vol_table->entries[i].smio_low;
table->count++;
}
}
memcpy(vol_table, table, sizeof(struct pp_atomctrl_voltage_table));
kfree(table);
table = NULL;
return 0;
}
int phm_get_svi2_mvdd_voltage_table(struct pp_atomctrl_voltage_table *vol_table,
phm_ppt_v1_clock_voltage_dependency_table *dep_table)
{
uint32_t i;
int result;
PP_ASSERT_WITH_CODE((0 != dep_table->count),
"Voltage Dependency Table empty.", return -EINVAL);
PP_ASSERT_WITH_CODE((NULL != vol_table),
"vol_table empty.", return -EINVAL);
vol_table->mask_low = 0;
vol_table->phase_delay = 0;
vol_table->count = dep_table->count;
for (i = 0; i < dep_table->count; i++) {
vol_table->entries[i].value = dep_table->entries[i].mvdd;
vol_table->entries[i].smio_low = 0;
}
result = phm_trim_voltage_table(vol_table);
PP_ASSERT_WITH_CODE((0 == result),
"Failed to trim MVDD table.", return result);
return 0;
}
int phm_get_svi2_vddci_voltage_table(struct pp_atomctrl_voltage_table *vol_table,
phm_ppt_v1_clock_voltage_dependency_table *dep_table)
{
uint32_t i;
int result;
PP_ASSERT_WITH_CODE((0 != dep_table->count),
"Voltage Dependency Table empty.", return -EINVAL);
PP_ASSERT_WITH_CODE((NULL != vol_table),
"vol_table empty.", return -EINVAL);
vol_table->mask_low = 0;
vol_table->phase_delay = 0;
vol_table->count = dep_table->count;
for (i = 0; i < dep_table->count; i++) {
vol_table->entries[i].value = dep_table->entries[i].vddci;
vol_table->entries[i].smio_low = 0;
}
result = phm_trim_voltage_table(vol_table);
PP_ASSERT_WITH_CODE((0 == result),
"Failed to trim VDDCI table.", return result);
return 0;
}
int phm_get_svi2_vdd_voltage_table(struct pp_atomctrl_voltage_table *vol_table,
phm_ppt_v1_voltage_lookup_table *lookup_table)
{
int i = 0;
PP_ASSERT_WITH_CODE((0 != lookup_table->count),
"Voltage Lookup Table empty.", return -EINVAL);
PP_ASSERT_WITH_CODE((NULL != vol_table),
"vol_table empty.", return -EINVAL);
vol_table->mask_low = 0;
vol_table->phase_delay = 0;
Annotation
- Immediate include surface: `linux/pci.h`, `linux/reboot.h`, `hwmgr.h`, `pp_debug.h`, `ppatomctrl.h`, `ppsmc.h`, `atom.h`, `ivsrcid/thm/irqsrcs_thm_9_0.h`.
- Detected declarations: `function files`, `function convert_to_vddc`, `function phm_copy_clock_limits_array`, `function phm_copy_overdrive_settings_limits_array`, `function phm_set_field_to_u32`, `function phm_wait_on_register`, `function phm_wait_on_indirect_register`, `function phm_wait_for_register_unequal`, `function phm_wait_for_indirect_register_unequal`, `function phm_cf_want_uvd_power_gating`.
- 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.