drivers/gpu/drm/amd/pm/powerplay/hwmgr/process_pptables_v1_0.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/pm/powerplay/hwmgr/process_pptables_v1_0.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/pm/powerplay/hwmgr/process_pptables_v1_0.c- Extension
.c- Size
- 53885 bytes
- Lines
- 1415
- 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/module.hlinux/slab.hprocess_pptables_v1_0.hppatomctrl.hatombios.hhwmgr.hcgs_common.hpptable_v1_0.h
Detected Declarations
function filesfunction set_platform_capsfunction get_vddc_lookup_tablefunction get_platform_power_management_tablefunction init_dpm_2_parametersfunction get_valid_clkfunction get_hard_limitsfunction get_mclk_voltage_dependency_tablefunction get_sclk_voltage_dependency_tablefunction get_pcie_tablefunction get_cac_tdp_tablefunction get_mm_clock_voltage_tablefunction get_gpio_tablefunction init_clock_voltage_dependencyfunction init_over_drive_limitsfunction init_thermal_controllerfunction check_powerplay_tablesfunction pp_tables_v1_0_initializefunction pp_tables_v1_0_uninitializefunction get_number_of_powerplay_table_entries_v1_0function make_classification_flagsfunction ppt_get_num_of_vce_state_table_entries_v1_0function ppt_get_vce_state_table_entry_v1_0function get_powerplay_table_entry_v1_0
Annotated Snippet
if (0 != powerplay_table->usPPMTableOffset) {
if (get_platform_power_management_table(hwmgr, atom_ppm_table) == 0) {
phm_cap_set(hwmgr->platform_descriptor.platformCaps,
PHM_PlatformCaps_EnablePlatformPowerManagement);
}
}
}
return result;
}
static int get_valid_clk(
struct pp_hwmgr *hwmgr,
struct phm_clock_array **clk_table,
phm_ppt_v1_clock_voltage_dependency_table const *clk_volt_pp_table
)
{
uint32_t i;
struct phm_clock_array *table;
phm_ppt_v1_clock_voltage_dependency_record *dep_record;
PP_ASSERT_WITH_CODE((0 != clk_volt_pp_table->count),
"Invalid PowerPlay Table!", return -1);
table = kzalloc_flex(*table, values, clk_volt_pp_table->count);
if (!table)
return -ENOMEM;
table->count = (uint32_t)clk_volt_pp_table->count;
for (i = 0; i < table->count; i++) {
dep_record = GET_FLEXIBLE_ARRAY_MEMBER_ADDR(
phm_ppt_v1_clock_voltage_dependency_record,
entries, clk_volt_pp_table, i);
table->values[i] = (uint32_t)dep_record->clk;
}
*clk_table = table;
return 0;
}
static int get_hard_limits(
struct pp_hwmgr *hwmgr,
struct phm_clock_and_voltage_limits *limits,
ATOM_Tonga_Hard_Limit_Table const *limitable
)
{
PP_ASSERT_WITH_CODE((0 != limitable->ucNumEntries), "Invalid PowerPlay Table!", return -1);
/* currently we always take entries[0] parameters */
limits->sclk = le32_to_cpu(limitable->entries[0].ulSCLKLimit);
limits->mclk = le32_to_cpu(limitable->entries[0].ulMCLKLimit);
limits->vddc = le16_to_cpu(limitable->entries[0].usVddcLimit);
limits->vddci = le16_to_cpu(limitable->entries[0].usVddciLimit);
limits->vddgfx = le16_to_cpu(limitable->entries[0].usVddgfxLimit);
return 0;
}
static int get_mclk_voltage_dependency_table(
struct pp_hwmgr *hwmgr,
phm_ppt_v1_clock_voltage_dependency_table **pp_tonga_mclk_dep_table,
ATOM_Tonga_MCLK_Dependency_Table const *mclk_dep_table
)
{
uint32_t i;
phm_ppt_v1_clock_voltage_dependency_table *mclk_table;
phm_ppt_v1_clock_voltage_dependency_record *mclk_table_record;
ATOM_Tonga_MCLK_Dependency_Record *mclk_dep_record;
PP_ASSERT_WITH_CODE((0 != mclk_dep_table->ucNumEntries),
"Invalid PowerPlay Table!", return -1);
mclk_table = kzalloc_flex(*mclk_table, entries,
mclk_dep_table->ucNumEntries);
if (!mclk_table)
return -ENOMEM;
mclk_table->count = (uint32_t)mclk_dep_table->ucNumEntries;
for (i = 0; i < mclk_dep_table->ucNumEntries; i++) {
mclk_table_record = GET_FLEXIBLE_ARRAY_MEMBER_ADDR(
phm_ppt_v1_clock_voltage_dependency_record,
entries, mclk_table, i);
mclk_dep_record = GET_FLEXIBLE_ARRAY_MEMBER_ADDR(
ATOM_Tonga_MCLK_Dependency_Record,
entries, mclk_dep_table, i);
mclk_table_record->vddInd = mclk_dep_record->ucVddcInd;
mclk_table_record->vdd_offset = le16_to_cpu(mclk_dep_record->usVddgfxOffset);
mclk_table_record->vddci = le16_to_cpu(mclk_dep_record->usVddci);
Annotation
- Immediate include surface: `pp_debug.h`, `linux/module.h`, `linux/slab.h`, `process_pptables_v1_0.h`, `ppatomctrl.h`, `atombios.h`, `hwmgr.h`, `cgs_common.h`.
- Detected declarations: `function files`, `function set_platform_caps`, `function get_vddc_lookup_table`, `function get_platform_power_management_table`, `function init_dpm_2_parameters`, `function get_valid_clk`, `function get_hard_limits`, `function get_mclk_voltage_dependency_table`, `function get_sclk_voltage_dependency_table`, `function get_pcie_table`.
- 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.