drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c- Extension
.c- Size
- 76952 bytes
- Lines
- 2568
- 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
amdgpu.hamdgpu_smu.hsmu_v11_0.hsmu11_driver_if_vangogh.hvangogh_ppt.hsmu_v11_5_ppsmc.hsmu_v11_5_pmfw.hsmu_cmn.hsoc15_common.hasic_reg/gc/gc_10_3_0_offset.hasic_reg/gc/gc_10_3_0_sh_mask.hasm/processor.h
Detected Declarations
struct clk_feature_mapfunction vangogh_tables_initfunction vangogh_get_legacy_smu_metrics_datafunction vangogh_get_smu_metrics_datafunction vangogh_common_get_smu_metrics_datafunction vangogh_allocate_dpm_contextfunction vangogh_init_smc_tablesfunction vangogh_dpm_set_vcn_enablefunction vangogh_dpm_set_jpeg_enablefunction vangogh_is_dpm_runningfunction vangogh_get_dpm_clk_limitedfunction vangogh_emit_legacy_clk_levelsfunction vangogh_emit_clk_levelsfunction vangogh_common_emit_clk_levelsfunction vangogh_get_profiling_clk_maskfunction vangogh_clk_dpm_is_enabledfunction vangogh_get_dpm_ultimate_freqfunction vangogh_get_power_profile_modefunction vangogh_set_power_profile_modefunction vangogh_set_soft_freq_limited_rangefunction vangogh_force_clk_levelsfunction vangogh_force_dpm_limit_valuefunction vangogh_unforce_dpm_levelsfunction vangogh_set_peak_clock_by_devicefunction vangogh_set_performance_levelfunction vangogh_read_sensorfunction vangogh_get_apu_thermal_limitfunction vangogh_set_apu_thermal_limitfunction vangogh_set_watermarks_tablefunction vangogh_get_legacy_gpu_metrics_v2_3function vangogh_get_legacy_gpu_metricsfunction vangogh_get_gpu_metrics_v2_3function vangogh_get_gpu_metrics_v2_4function vangogh_get_gpu_metricsfunction vangogh_common_get_gpu_metricsfunction vangogh_od_edit_dpm_tablefunction vangogh_set_default_dpm_tablesfunction vangogh_set_fine_grain_gfx_freq_parametersfunction vangogh_get_dpm_clock_tablefunction vangogh_notify_rlc_statefunction vangogh_post_smu_initfunction vangogh_mode_resetfunction vangogh_mode2_resetfunction vangogh_get_gfxoff_statusfunction vangogh_get_power_limitfunction vangogh_get_ppt_limitfunction vangogh_set_power_limitfunction vangogh_set_gfxoff_residency
Annotated Snippet
struct clk_feature_map {
enum smu_clk_type clk_type;
uint32_t feature;
} clk_feature_map[] = {
{SMU_FCLK, SMU_FEATURE_DPM_FCLK_BIT},
{SMU_SOCCLK, SMU_FEATURE_DPM_SOCCLK_BIT},
{SMU_VCLK, SMU_FEATURE_VCN_DPM_BIT},
{SMU_DCLK, SMU_FEATURE_VCN_DPM_BIT},
};
for (i = 0; i < ARRAY_SIZE(clk_feature_map); i++) {
if (!smu_cmn_feature_is_enabled(smu, clk_feature_map[i].feature))
continue;
clk_type = clk_feature_map[i].clk_type;
ret = vangogh_get_dpm_ultimate_freq(smu, clk_type, &min_freq, &max_freq);
if (ret)
return ret;
ret = vangogh_set_soft_freq_limited_range(smu, clk_type, min_freq, max_freq, false);
if (ret)
return ret;
}
return ret;
}
static int vangogh_set_peak_clock_by_device(struct smu_context *smu)
{
int ret = 0;
uint32_t socclk_freq = 0, fclk_freq = 0;
uint32_t vclk_freq = 0, dclk_freq = 0;
ret = vangogh_get_dpm_ultimate_freq(smu, SMU_FCLK, NULL, &fclk_freq);
if (ret)
return ret;
ret = vangogh_set_soft_freq_limited_range(smu, SMU_FCLK, fclk_freq, fclk_freq, false);
if (ret)
return ret;
ret = vangogh_get_dpm_ultimate_freq(smu, SMU_SOCCLK, NULL, &socclk_freq);
if (ret)
return ret;
ret = vangogh_set_soft_freq_limited_range(smu, SMU_SOCCLK, socclk_freq, socclk_freq, false);
if (ret)
return ret;
ret = vangogh_get_dpm_ultimate_freq(smu, SMU_VCLK, NULL, &vclk_freq);
if (ret)
return ret;
ret = vangogh_set_soft_freq_limited_range(smu, SMU_VCLK, vclk_freq, vclk_freq, false);
if (ret)
return ret;
ret = vangogh_get_dpm_ultimate_freq(smu, SMU_DCLK, NULL, &dclk_freq);
if (ret)
return ret;
ret = vangogh_set_soft_freq_limited_range(smu, SMU_DCLK, dclk_freq, dclk_freq, false);
if (ret)
return ret;
return ret;
}
static int vangogh_set_performance_level(struct smu_context *smu,
enum amd_dpm_forced_level level)
{
int ret = 0, i;
uint32_t soc_mask, mclk_mask, fclk_mask;
uint32_t vclk_mask = 0, dclk_mask = 0;
smu->cpu_actual_soft_min_freq = smu->cpu_default_soft_min_freq;
smu->cpu_actual_soft_max_freq = smu->cpu_default_soft_max_freq;
switch (level) {
case AMD_DPM_FORCED_LEVEL_HIGH:
smu->gfx_actual_hard_min_freq = smu->gfx_default_soft_max_freq;
smu->gfx_actual_soft_max_freq = smu->gfx_default_soft_max_freq;
ret = vangogh_force_dpm_limit_value(smu, true);
if (ret)
Annotation
- Immediate include surface: `amdgpu.h`, `amdgpu_smu.h`, `smu_v11_0.h`, `smu11_driver_if_vangogh.h`, `vangogh_ppt.h`, `smu_v11_5_ppsmc.h`, `smu_v11_5_pmfw.h`, `smu_cmn.h`.
- Detected declarations: `struct clk_feature_map`, `function vangogh_tables_init`, `function vangogh_get_legacy_smu_metrics_data`, `function vangogh_get_smu_metrics_data`, `function vangogh_common_get_smu_metrics_data`, `function vangogh_allocate_dpm_context`, `function vangogh_init_smc_tables`, `function vangogh_dpm_set_vcn_enable`, `function vangogh_dpm_set_jpeg_enable`, `function vangogh_is_dpm_running`.
- 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.