drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c- Extension
.c- Size
- 106703 bytes
- Lines
- 3212
- 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.hlinux/pci.hlinux/i2c.hamdgpu.hamdgpu_dpm.hamdgpu_smu.hatomfirmware.hamdgpu_atomfirmware.hamdgpu_atombios.hsmu_v11_0.hsmu11_driver_if_sienna_cichlid.hsoc15_common.hatom.hsienna_cichlid_ppt.hsmu_v11_0_7_pptable.hsmu_v11_0_7_ppsmc.hnbio/nbio_2_3_offset.hnbio/nbio_2_3_sh_mask.hthm/thm_11_0_2_offset.hthm/thm_11_0_2_sh_mask.hmp/mp_11_0_offset.hmp/mp_11_0_sh_mask.hasic_reg/mp/mp_11_0_sh_mask.hamdgpu_ras.hsmu_cmn.h
Detected Declarations
function get_table_sizefunction sienna_cichlid_init_allowed_featuresfunction sienna_cichlid_check_bxco_supportfunction sienna_cichlid_check_fan_supportfunction sienna_cichlid_check_powerplay_tablefunction sienna_cichlid_append_powerplay_tablefunction sienna_cichlid_store_powerplay_tablefunction sienna_cichlid_patch_pptable_quirkfunction sienna_cichlid_setup_pptablefunction sienna_cichlid_tables_initfunction sienna_cichlid_get_throttler_status_lockedfunction sienna_cichlid_is_od_feature_supportedfunction sienna_cichlid_get_power_limitfunction sienna_cichlid_get_smartshift_power_percentagefunction sienna_cichlid_get_smu_metrics_datafunction sienna_cichlid_allocate_dpm_contextfunction sienna_cichlid_init_smc_tablesfunction sienna_cichlid_set_default_dpm_tablefunction sienna_cichlid_dpm_set_vcn_enablefunction sienna_cichlid_dpm_set_jpeg_enablefunction sienna_cichlid_get_current_clk_freq_by_tablefunction sienna_cichlid_is_support_fine_grained_dpmfunction sienna_cichlid_get_od_setting_rangefunction sienna_cichlid_emit_clk_levelsfunction sienna_cichlid_force_clk_levelsfunction sienna_cichlid_populate_umd_state_clkfunction sienna_cichlid_pre_display_config_changedfunction sienna_cichlid_display_config_changedfunction sienna_cichlid_is_dpm_runningfunction sienna_cichlid_get_fan_speed_rpmfunction sienna_cichlid_get_fan_parametersfunction sienna_cichlid_get_power_profile_modefunction sienna_cichlid_set_power_profile_mode_coefffunction sienna_cichlid_set_power_profile_modefunction sienna_cichlid_notify_smc_display_configfunction sienna_cichlid_set_watermarks_tablefunction sienna_cichlid_read_sensorfunction sienna_cichlid_get_unique_idfunction sienna_cichlid_get_uclk_dpm_statesfunction sienna_cichlid_get_thermal_temperature_rangefunction sienna_cichlid_display_disable_memory_clock_switchfunction sienna_cichlid_update_pcie_parametersfunction sienna_cichlid_get_dpm_ultimate_freqfunction sienna_cichlid_dump_od_tablefunction sienna_cichlid_set_default_od_settingsfunction sienna_cichlid_od_setting_check_rangefunction sienna_cichlid_od_edit_dpm_tablefunction sienna_cichlid_restore_user_od_settings
Annotated Snippet
sienna_cichlid_is_od_feature_supported(od_settings, SMU_11_0_7_ODCAP_POWER_LIMIT)) {
od_percent_upper = le32_to_cpu(powerplay_table->overdrive_table.max[SMU_11_0_7_ODSETTING_POWERPERCENTAGE]);
od_percent_lower = le32_to_cpu(powerplay_table->overdrive_table.min[SMU_11_0_7_ODSETTING_POWERPERCENTAGE]);
} else if ((sienna_cichlid_is_od_feature_supported(od_settings, SMU_11_0_7_ODCAP_POWER_LIMIT))) {
od_percent_upper = 0;
od_percent_lower = le32_to_cpu(powerplay_table->overdrive_table.min[SMU_11_0_7_ODSETTING_POWERPERCENTAGE]);
}
}
dev_dbg(smu->adev->dev, "od percent upper:%d, od percent lower:%d (default power: %d)\n",
od_percent_upper, od_percent_lower, power_limit);
if (max_power_limit) {
*max_power_limit = power_limit * (100 + od_percent_upper);
*max_power_limit /= 100;
}
if (min_power_limit) {
*min_power_limit = power_limit * (100 - od_percent_lower);
*min_power_limit /= 100;
}
return 0;
}
static void sienna_cichlid_get_smartshift_power_percentage(struct smu_context *smu,
uint32_t *apu_percent,
uint32_t *dgpu_percent)
{
struct smu_table_context *smu_table = &smu->smu_table;
SmuMetrics_V4_t *metrics_v4 =
&(((SmuMetricsExternal_t *)(smu_table->metrics_table))->SmuMetrics_V4);
uint16_t powerRatio = 0;
uint16_t apu_power_limit = 0;
uint16_t dgpu_power_limit = 0;
uint32_t apu_boost = 0;
uint32_t dgpu_boost = 0;
uint32_t cur_power_limit;
if (metrics_v4->ApuSTAPMSmartShiftLimit != 0) {
sienna_cichlid_get_power_limit(smu, &cur_power_limit, NULL, NULL, NULL);
apu_power_limit = metrics_v4->ApuSTAPMLimit;
dgpu_power_limit = cur_power_limit;
powerRatio = (((apu_power_limit +
dgpu_power_limit) * 100) /
metrics_v4->ApuSTAPMSmartShiftLimit);
if (powerRatio > 100) {
apu_power_limit = (apu_power_limit * 100) /
powerRatio;
dgpu_power_limit = (dgpu_power_limit * 100) /
powerRatio;
}
if (metrics_v4->AverageApuSocketPower > apu_power_limit &&
apu_power_limit != 0) {
apu_boost = ((metrics_v4->AverageApuSocketPower -
apu_power_limit) * 100) /
apu_power_limit;
if (apu_boost > 100)
apu_boost = 100;
}
if (metrics_v4->AverageSocketPower > dgpu_power_limit &&
dgpu_power_limit != 0) {
dgpu_boost = ((metrics_v4->AverageSocketPower -
dgpu_power_limit) * 100) /
dgpu_power_limit;
if (dgpu_boost > 100)
dgpu_boost = 100;
}
if (dgpu_boost >= apu_boost)
apu_boost = 0;
else
dgpu_boost = 0;
}
*apu_percent = apu_boost;
*dgpu_percent = dgpu_boost;
}
static int sienna_cichlid_get_smu_metrics_data(struct smu_context *smu,
MetricsMember_t member,
uint32_t *value)
{
struct smu_table_context *smu_table= &smu->smu_table;
SmuMetrics_t *metrics =
&(((SmuMetricsExternal_t *)(smu_table->metrics_table))->SmuMetrics);
SmuMetrics_V2_t *metrics_v2 =
&(((SmuMetricsExternal_t *)(smu_table->metrics_table))->SmuMetrics_V2);
SmuMetrics_V3_t *metrics_v3 =
&(((SmuMetricsExternal_t *)(smu_table->metrics_table))->SmuMetrics_V3);
bool use_metrics_v2 = false;
Annotation
- Immediate include surface: `linux/firmware.h`, `linux/pci.h`, `linux/i2c.h`, `amdgpu.h`, `amdgpu_dpm.h`, `amdgpu_smu.h`, `atomfirmware.h`, `amdgpu_atomfirmware.h`.
- Detected declarations: `function get_table_size`, `function sienna_cichlid_init_allowed_features`, `function sienna_cichlid_check_bxco_support`, `function sienna_cichlid_check_fan_support`, `function sienna_cichlid_check_powerplay_table`, `function sienna_cichlid_append_powerplay_table`, `function sienna_cichlid_store_powerplay_table`, `function sienna_cichlid_patch_pptable_quirk`, `function sienna_cichlid_setup_pptable`, `function sienna_cichlid_tables_init`.
- 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.