drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c- Extension
.c- Size
- 62526 bytes
- Lines
- 2040
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- 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/firmware.hamdgpu.hamdgpu_dpm.hamdgpu_smu.hatomfirmware.hamdgpu_atomfirmware.hamdgpu_atombios.hsmu_v13_0.hsmu13_driver_if_aldebaran.hsoc15_common.hatom.haldebaran_ppt.hsmu_v13_0_pptable.haldebaran_ppsmc.hnbio/nbio_7_4_offset.hnbio/nbio_7_4_sh_mask.hthm/thm_11_0_2_offset.hthm/thm_11_0_2_sh_mask.hamdgpu_xgmi.hlinux/pci.hamdgpu_ras.hsmu_cmn.hmp/mp_13_0_2_offset.h
Detected Declarations
function aldebaran_tables_initfunction aldebaran_select_plpd_policyfunction aldebaran_allocate_dpm_contextfunction aldebaran_init_smc_tablesfunction aldebaran_init_allowed_featuresfunction aldebaran_get_dpm_ultimate_freqfunction aldebaran_set_default_dpm_tablefunction aldebaran_check_powerplay_tablefunction aldebaran_store_powerplay_tablefunction aldebaran_append_powerplay_tablefunction aldebaran_setup_pptablefunction aldebaran_is_primaryfunction aldebaran_run_board_btcfunction aldebaran_run_btcfunction aldebaran_populate_umd_state_clkfunction aldebaran_get_smu_metrics_datafunction aldebaran_get_current_clk_freq_by_tablefunction aldebaran_emit_clk_levelsfunction aldebaran_upload_dpm_levelfunction aldebaran_force_clk_levelsfunction aldebaran_get_thermal_temperature_rangefunction aldebaran_get_current_activity_percentfunction aldebaran_thermal_get_temperaturefunction aldebaran_read_sensorfunction aldebaran_get_power_limitfunction aldebaran_set_power_limitfunction aldebaran_system_features_controlfunction aldebaran_set_performance_levelfunction aldebaran_set_soft_freq_limited_rangefunction aldebaran_usr_edit_dpm_tablefunction aldebaran_is_dpm_runningfunction aldebaran_i2c_xferfunction aldebaran_i2c_funcfunction aldebaran_i2c_control_initfunction aldebaran_i2c_control_finifunction aldebaran_get_unique_idfunction aldebaran_get_bamaco_supportfunction aldebaran_set_df_cstatefunction aldebaran_log_thermal_throttling_eventfunction aldebaran_get_current_pcie_link_speedfunction aldebaran_get_gpu_metricsfunction aldebaran_check_ecc_table_supportfunction aldebaran_get_ecc_infofunction aldebaran_mode1_resetfunction aldebaran_mode2_resetfunction aldebaran_smu_handle_passthrough_sbrfunction aldebaran_is_mode1_reset_supportedfunction aldebaran_set_mp1_state
Annotated Snippet
switch (clk_type) {
case SMU_MCLK:
case SMU_UCLK:
dpm_table = &dpm_context->dpm_tables.uclk_table;
break;
case SMU_GFXCLK:
case SMU_SCLK:
dpm_table = &dpm_context->dpm_tables.gfx_table;
break;
case SMU_SOCCLK:
dpm_table = &dpm_context->dpm_tables.soc_table;
break;
case SMU_FCLK:
dpm_table = &dpm_context->dpm_tables.fclk_table;
break;
case SMU_VCLK:
dpm_table = &dpm_context->dpm_tables.vclk_table;
break;
case SMU_DCLK:
dpm_table = &dpm_context->dpm_tables.dclk_table;
break;
default:
return -EINVAL;
}
min_clk = SMU_DPM_TABLE_MIN(dpm_table);
max_clk = SMU_DPM_TABLE_MAX(dpm_table);
if (min) {
if (!min_clk)
return -ENODATA;
*min = min_clk;
}
if (max) {
if (!max_clk)
return -ENODATA;
*max = max_clk;
}
} else {
return smu_v13_0_get_dpm_ultimate_freq(smu, clk_type, min, max);
}
return 0;
}
static int aldebaran_set_default_dpm_table(struct smu_context *smu)
{
struct smu_13_0_dpm_context *dpm_context = smu->smu_dpm.dpm_context;
struct smu_dpm_table *dpm_table = NULL;
PPTable_t *pptable = smu->smu_table.driver_pptable;
int ret = 0;
/* socclk dpm table setup */
dpm_table = &dpm_context->dpm_tables.soc_table;
dpm_table->clk_type = SMU_SOCCLK;
if (smu_cmn_feature_is_enabled(smu, SMU_FEATURE_DPM_SOCCLK_BIT)) {
ret = smu_v13_0_set_single_dpm_table(smu,
SMU_SOCCLK,
dpm_table);
if (ret)
return ret;
} else {
dpm_table->count = 1;
dpm_table->dpm_levels[0].value = smu->smu_table.boot_values.socclk / 100;
dpm_table->dpm_levels[0].enabled = true;
}
/* gfxclk dpm table setup */
dpm_table = &dpm_context->dpm_tables.gfx_table;
dpm_table->clk_type = SMU_GFXCLK;
if (smu_cmn_feature_is_enabled(smu, SMU_FEATURE_DPM_GFXCLK_BIT)) {
/* in the case of gfxclk, only fine-grained dpm is honored */
dpm_table->count = 2;
dpm_table->dpm_levels[0].value = pptable->GfxclkFmin;
dpm_table->dpm_levels[0].enabled = true;
dpm_table->dpm_levels[1].value = pptable->GfxclkFmax;
dpm_table->dpm_levels[1].enabled = true;
dpm_table->flags |= SMU_DPM_TABLE_FINE_GRAINED;
} else {
dpm_table->count = 1;
dpm_table->dpm_levels[0].value = smu->smu_table.boot_values.gfxclk / 100;
dpm_table->dpm_levels[0].enabled = true;
}
/* memclk dpm table setup */
dpm_table = &dpm_context->dpm_tables.uclk_table;
dpm_table->clk_type = SMU_UCLK;
if (smu_cmn_feature_is_enabled(smu, SMU_FEATURE_DPM_UCLK_BIT)) {
ret = smu_v13_0_set_single_dpm_table(smu,
Annotation
- Immediate include surface: `linux/firmware.h`, `amdgpu.h`, `amdgpu_dpm.h`, `amdgpu_smu.h`, `atomfirmware.h`, `amdgpu_atomfirmware.h`, `amdgpu_atombios.h`, `smu_v13_0.h`.
- Detected declarations: `function aldebaran_tables_init`, `function aldebaran_select_plpd_policy`, `function aldebaran_allocate_dpm_context`, `function aldebaran_init_smc_tables`, `function aldebaran_init_allowed_features`, `function aldebaran_get_dpm_ultimate_freq`, `function aldebaran_set_default_dpm_table`, `function aldebaran_check_powerplay_table`, `function aldebaran_store_powerplay_table`, `function aldebaran_append_powerplay_table`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.