drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c- Extension
.c- Size
- 39617 bytes
- Lines
- 1370
- 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
amdgpu.hamdgpu_smu.hsmu_v13_0.hsmu13_driver_if_yellow_carp.hyellow_carp_ppt.hsmu_v13_0_1_ppsmc.hsmu_v13_0_1_pmfw.hsmu_cmn.h
Detected Declarations
function yellow_carp_init_smc_tablesfunction yellow_carp_fini_smc_tablesfunction yellow_carp_system_features_controlfunction yellow_carp_dpm_set_vcn_enablefunction yellow_carp_dpm_set_jpeg_enablefunction yellow_carp_is_dpm_runningfunction yellow_carp_post_smu_initfunction yellow_carp_mode_resetfunction yellow_carp_mode2_resetfunction yellow_carp_get_ss_power_percentfunction yellow_carp_get_smu_metrics_datafunction yellow_carp_read_sensorfunction yellow_carp_set_watermarks_tablefunction yellow_carp_get_gpu_metricsfunction yellow_carp_get_gfxoff_statusfunction yellow_carp_set_default_dpm_tablesfunction yellow_carp_od_edit_dpm_tablefunction yellow_carp_get_current_clk_freqfunction yellow_carp_get_dpm_level_countfunction yellow_carp_get_dpm_freq_by_indexfunction yellow_carp_clk_dpm_is_enabledfunction yellow_carp_get_dpm_ultimate_freqfunction yellow_carp_set_soft_freq_limited_rangefunction yellow_carp_get_umd_pstate_clk_defaultfunction yellow_carp_emit_clk_levelsfunction yellow_carp_force_clk_levelsfunction yellow_carp_get_dpm_profile_freqfunction yellow_carp_set_performance_levelfunction yellow_carp_set_fine_grain_gfx_freq_parametersfunction yellow_carp_set_ppt_funcs
Annotated Snippet
if (ret) {
dev_err(smu->adev->dev, "Failed to update WMTABLE!");
return ret;
}
smu->watermarks_bitmap |= WATERMARKS_LOADED;
}
return 0;
}
static ssize_t yellow_carp_get_gpu_metrics(struct smu_context *smu,
void **table)
{
struct gpu_metrics_v2_1 *gpu_metrics =
(struct gpu_metrics_v2_1 *)smu_driver_table_ptr(
smu, SMU_DRIVER_TABLE_GPU_METRICS);
SmuMetrics_t metrics;
int ret = 0;
ret = smu_cmn_get_metrics_table(smu, &metrics, true);
if (ret)
return ret;
smu_cmn_init_soft_gpu_metrics(gpu_metrics, 2, 1);
gpu_metrics->temperature_gfx = metrics.GfxTemperature;
gpu_metrics->temperature_soc = metrics.SocTemperature;
memcpy(&gpu_metrics->temperature_core[0],
&metrics.CoreTemperature[0],
sizeof(uint16_t) * 8);
gpu_metrics->temperature_l3[0] = metrics.L3Temperature;
gpu_metrics->average_gfx_activity = metrics.GfxActivity;
gpu_metrics->average_mm_activity = metrics.UvdActivity;
gpu_metrics->average_socket_power = metrics.CurrentSocketPower;
gpu_metrics->average_gfx_power = metrics.Power[0];
gpu_metrics->average_soc_power = metrics.Power[1];
memcpy(&gpu_metrics->average_core_power[0],
&metrics.CorePower[0],
sizeof(uint16_t) * 8);
gpu_metrics->average_gfxclk_frequency = metrics.GfxclkFrequency;
gpu_metrics->average_socclk_frequency = metrics.SocclkFrequency;
gpu_metrics->average_uclk_frequency = metrics.MemclkFrequency;
gpu_metrics->average_fclk_frequency = metrics.MemclkFrequency;
gpu_metrics->average_vclk_frequency = metrics.VclkFrequency;
gpu_metrics->average_dclk_frequency = metrics.DclkFrequency;
memcpy(&gpu_metrics->current_coreclk[0],
&metrics.CoreFrequency[0],
sizeof(uint16_t) * 8);
gpu_metrics->current_l3clk[0] = metrics.L3Frequency;
gpu_metrics->throttle_status = metrics.ThrottlerStatus;
gpu_metrics->system_clock_counter = ktime_get_boottime_ns();
*table = (void *)gpu_metrics;
smu_driver_table_update_cache_time(smu, SMU_DRIVER_TABLE_GPU_METRICS);
return sizeof(struct gpu_metrics_v2_1);
}
/**
* yellow_carp_get_gfxoff_status - get gfxoff status
*
* @smu: smu_context pointer
*
* This function will be used to get gfxoff status
*
* Returns 0=GFXOFF(default).
* Returns 1=Transition out of GFX State.
* Returns 2=Not in GFXOFF.
* Returns 3=Transition into GFXOFF.
*/
static uint32_t yellow_carp_get_gfxoff_status(struct smu_context *smu)
{
uint32_t reg;
uint32_t gfxoff_status = 0;
struct amdgpu_device *adev = smu->adev;
reg = RREG32_SOC15(SMUIO, 0, regSMUIO_GFX_MISC_CNTL);
gfxoff_status = (reg & SMUIO_GFX_MISC_CNTL__PWR_GFXOFF_STATUS_MASK)
>> SMUIO_GFX_MISC_CNTL__PWR_GFXOFF_STATUS__SHIFT;
return gfxoff_status;
}
Annotation
- Immediate include surface: `amdgpu.h`, `amdgpu_smu.h`, `smu_v13_0.h`, `smu13_driver_if_yellow_carp.h`, `yellow_carp_ppt.h`, `smu_v13_0_1_ppsmc.h`, `smu_v13_0_1_pmfw.h`, `smu_cmn.h`.
- Detected declarations: `function yellow_carp_init_smc_tables`, `function yellow_carp_fini_smc_tables`, `function yellow_carp_system_features_control`, `function yellow_carp_dpm_set_vcn_enable`, `function yellow_carp_dpm_set_jpeg_enable`, `function yellow_carp_is_dpm_running`, `function yellow_carp_post_smu_init`, `function yellow_carp_mode_reset`, `function yellow_carp_mode2_reset`, `function yellow_carp_get_ss_power_percent`.
- 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.