drivers/gpu/drm/radeon/kv_dpm.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/radeon/kv_dpm.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/radeon/kv_dpm.c- Extension
.c- Size
- 74813 bytes
- Lines
- 2696
- 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
linux/pci.hlinux/seq_file.hcikd.hkv_dpm.hr600_dpm.hradeon.hradeon_asic.h
Detected Declarations
function kv_program_pt_config_registersfunction kv_do_enable_didtfunction kv_enable_didtfunction kv_enable_smc_cacfunction kv_process_firmware_headerfunction kv_enable_dpm_voltage_scalingfunction kv_set_dpm_intervalfunction kv_set_dpm_boot_statefunction kv_program_vcfunction kv_clear_vcfunction kv_set_divider_valuefunction kv_convert_vid2_to_vid7function kv_convert_vid7_to_vid2function kv_convert_8bit_index_to_voltagefunction kv_convert_2bit_index_to_voltagefunction kv_set_vidfunction kv_set_atfunction kv_dpm_power_level_enablefunction kv_start_dpmfunction kv_stop_dpmfunction kv_start_amfunction kv_reset_amfunction kv_freeze_sclk_dpmfunction kv_force_lowest_validfunction kv_unforce_levelsfunction kv_update_sclk_tfunction kv_program_bootup_statefunction kv_enable_auto_thermal_throttlingfunction kv_upload_dpm_settingsfunction kv_get_clock_differencefunction kv_get_clk_bypassfunction kv_populate_uvd_tablefunction kv_populate_vce_tablefunction kv_populate_samu_tablefunction kv_populate_acp_tablefunction kv_calculate_dfs_bypass_settingsfunction kv_enable_ulvfunction kv_reset_acp_boot_levelfunction kv_update_current_psfunction kv_update_requested_psfunction kv_dpm_enable_bapmfunction kv_enable_thermal_intfunction kv_dpm_enablefunction kv_dpm_late_enablefunction kv_dpm_disablefunction kv_init_sclk_tfunction kv_init_fps_limitsfunction kv_init_powergate_state
Annotated Snippet
if (config_regs->type == KV_CONFIGREG_CACHE) {
cache |= ((config_regs->value << config_regs->shift) & config_regs->mask);
} else {
switch (config_regs->type) {
case KV_CONFIGREG_SMC_IND:
data = RREG32_SMC(config_regs->offset);
break;
case KV_CONFIGREG_DIDT_IND:
data = RREG32_DIDT(config_regs->offset);
break;
default:
data = RREG32(config_regs->offset << 2);
break;
}
data &= ~config_regs->mask;
data |= ((config_regs->value << config_regs->shift) & config_regs->mask);
data |= cache;
cache = 0;
switch (config_regs->type) {
case KV_CONFIGREG_SMC_IND:
WREG32_SMC(config_regs->offset, data);
break;
case KV_CONFIGREG_DIDT_IND:
WREG32_DIDT(config_regs->offset, data);
break;
default:
WREG32(config_regs->offset << 2, data);
break;
}
}
config_regs++;
}
return 0;
}
static void kv_do_enable_didt(struct radeon_device *rdev, bool enable)
{
struct kv_power_info *pi = kv_get_pi(rdev);
u32 data;
if (pi->caps_sq_ramping) {
data = RREG32_DIDT(DIDT_SQ_CTRL0);
if (enable)
data |= DIDT_CTRL_EN;
else
data &= ~DIDT_CTRL_EN;
WREG32_DIDT(DIDT_SQ_CTRL0, data);
}
if (pi->caps_db_ramping) {
data = RREG32_DIDT(DIDT_DB_CTRL0);
if (enable)
data |= DIDT_CTRL_EN;
else
data &= ~DIDT_CTRL_EN;
WREG32_DIDT(DIDT_DB_CTRL0, data);
}
if (pi->caps_td_ramping) {
data = RREG32_DIDT(DIDT_TD_CTRL0);
if (enable)
data |= DIDT_CTRL_EN;
else
data &= ~DIDT_CTRL_EN;
WREG32_DIDT(DIDT_TD_CTRL0, data);
}
if (pi->caps_tcp_ramping) {
data = RREG32_DIDT(DIDT_TCP_CTRL0);
if (enable)
data |= DIDT_CTRL_EN;
else
data &= ~DIDT_CTRL_EN;
WREG32_DIDT(DIDT_TCP_CTRL0, data);
}
}
static int kv_enable_didt(struct radeon_device *rdev, bool enable)
{
struct kv_power_info *pi = kv_get_pi(rdev);
int ret;
if (pi->caps_sq_ramping ||
pi->caps_db_ramping ||
pi->caps_td_ramping ||
pi->caps_tcp_ramping) {
cik_enter_rlc_safe_mode(rdev);
Annotation
- Immediate include surface: `linux/pci.h`, `linux/seq_file.h`, `cikd.h`, `kv_dpm.h`, `r600_dpm.h`, `radeon.h`, `radeon_asic.h`.
- Detected declarations: `function kv_program_pt_config_registers`, `function kv_do_enable_didt`, `function kv_enable_didt`, `function kv_enable_smc_cac`, `function kv_process_firmware_header`, `function kv_enable_dpm_voltage_scaling`, `function kv_set_dpm_interval`, `function kv_set_dpm_boot_state`, `function kv_program_vc`, `function kv_clear_vc`.
- 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.