drivers/gpu/drm/radeon/rv770_dpm.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/radeon/rv770_dpm.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/radeon/rv770_dpm.c- Extension
.c- Size
- 71863 bytes
- Lines
- 2588
- 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
radeon.hradeon_asic.hrv770.hrv770d.hr600_dpm.hrv770_dpm.hcypress_dpm.hatom.hevergreen.hlinux/seq_file.h
Detected Declarations
function filesfunction rv770_enable_bif_dynamic_pcie_gen2function rv770_enable_l0sfunction rv770_enable_l1function rv770_enable_pll_sleep_in_l1function rv770_gfx_clock_gating_enablefunction rv770_mg_clock_gating_enablefunction rv770_restore_cgcgfunction rv770_start_dpmfunction rv770_stop_dpmfunction rv770_dpm_enabledfunction rv770_enable_thermal_protectionfunction rv770_enable_acpi_pmfunction rv770_get_seq_valuefunction rv770_read_smc_soft_registerfunction rv770_write_smc_soft_registerfunction rv770_populate_smc_tfunction rv770_populate_smc_spfunction rv770_calculate_fractional_mpll_feedback_dividerfunction rv770_encode_yclk_post_divfunction rv770_map_clkf_to_ibiasfunction rv770_populate_mclk_valuefunction rv770_populate_sclk_valuefunction rv770_populate_vddc_valuefunction rv770_populate_mvdd_valuefunction rv770_convert_power_level_to_smcfunction rv770_convert_power_state_to_smcfunction rv770_calculate_memory_refresh_ratefunction rv770_program_memory_timing_parametersfunction rv770_enable_backbiasfunction rv770_enable_spread_spectrumfunction rv770_program_mpll_timing_parametersfunction rv770_setup_bspfunction rv770_program_gitfunction rv770_program_tpfunction rv770_program_tppfunction rv770_program_sstpfunction rv770_program_engine_speed_parametersfunction rv770_enable_display_gapfunction rv770_program_vcfunction rv770_clear_vcfunction rv770_upload_firmwarefunction rv770_populate_smc_acpi_statefunction rv770_populate_initial_mvdd_valuefunction rv770_populate_smc_initial_statefunction rv770_populate_smc_vddc_tablefunction rv770_populate_smc_mvdd_tablefunction rv770_init_smc_table
Annotated Snippet
if (!pi->boot_in_gen2) {
tmp &= ~LC_HW_VOLTAGE_IF_CONTROL_MASK;
tmp &= ~LC_GEN2_EN_STRAP;
}
}
if ((tmp & LC_OTHER_SIDE_EVER_SENT_GEN2) ||
(tmp & LC_OTHER_SIDE_SUPPORTS_GEN2))
WREG32_PCIE_PORT(PCIE_LC_SPEED_CNTL, tmp);
}
static void rv770_enable_l0s(struct radeon_device *rdev)
{
u32 tmp;
tmp = RREG32_PCIE_PORT(PCIE_LC_CNTL) & ~LC_L0S_INACTIVITY_MASK;
tmp |= LC_L0S_INACTIVITY(3);
WREG32_PCIE_PORT(PCIE_LC_CNTL, tmp);
}
static void rv770_enable_l1(struct radeon_device *rdev)
{
u32 tmp;
tmp = RREG32_PCIE_PORT(PCIE_LC_CNTL);
tmp &= ~LC_L1_INACTIVITY_MASK;
tmp |= LC_L1_INACTIVITY(4);
tmp &= ~LC_PMI_TO_L1_DIS;
tmp &= ~LC_ASPM_TO_L1_DIS;
WREG32_PCIE_PORT(PCIE_LC_CNTL, tmp);
}
static void rv770_enable_pll_sleep_in_l1(struct radeon_device *rdev)
{
u32 tmp;
tmp = RREG32_PCIE_PORT(PCIE_LC_CNTL) & ~LC_L1_INACTIVITY_MASK;
tmp |= LC_L1_INACTIVITY(8);
WREG32_PCIE_PORT(PCIE_LC_CNTL, tmp);
/* NOTE, this is a PCIE indirect reg, not PCIE PORT */
tmp = RREG32_PCIE(PCIE_P_CNTL);
tmp |= P_PLL_PWRDN_IN_L1L23;
tmp &= ~P_PLL_BUF_PDNB;
tmp &= ~P_PLL_PDNB;
tmp |= P_ALLOW_PRX_FRONTEND_SHUTOFF;
WREG32_PCIE(PCIE_P_CNTL, tmp);
}
static void rv770_gfx_clock_gating_enable(struct radeon_device *rdev,
bool enable)
{
if (enable)
WREG32_P(SCLK_PWRMGT_CNTL, DYN_GFX_CLK_OFF_EN, ~DYN_GFX_CLK_OFF_EN);
else {
WREG32_P(SCLK_PWRMGT_CNTL, 0, ~DYN_GFX_CLK_OFF_EN);
WREG32_P(SCLK_PWRMGT_CNTL, GFX_CLK_FORCE_ON, ~GFX_CLK_FORCE_ON);
WREG32_P(SCLK_PWRMGT_CNTL, 0, ~GFX_CLK_FORCE_ON);
RREG32(GB_TILING_CONFIG);
}
}
static void rv770_mg_clock_gating_enable(struct radeon_device *rdev,
bool enable)
{
struct rv7xx_power_info *pi = rv770_get_pi(rdev);
if (enable) {
u32 mgcg_cgtt_local0;
if (rdev->family == CHIP_RV770)
mgcg_cgtt_local0 = RV770_MGCGTTLOCAL0_DFLT;
else
mgcg_cgtt_local0 = RV7XX_MGCGTTLOCAL0_DFLT;
WREG32(CG_CGTT_LOCAL_0, mgcg_cgtt_local0);
WREG32(CG_CGTT_LOCAL_1, (RV770_MGCGTTLOCAL1_DFLT & 0xFFFFCFFF));
if (pi->mgcgtssm)
WREG32(CGTS_SM_CTRL_REG, RV770_MGCGCGTSSMCTRL_DFLT);
} else {
WREG32(CG_CGTT_LOCAL_0, 0xFFFFFFFF);
WREG32(CG_CGTT_LOCAL_1, 0xFFFFCFFF);
}
}
void rv770_restore_cgcg(struct radeon_device *rdev)
{
bool dpm_en = false, cg_en = false;
Annotation
- Immediate include surface: `radeon.h`, `radeon_asic.h`, `rv770.h`, `rv770d.h`, `r600_dpm.h`, `rv770_dpm.h`, `cypress_dpm.h`, `atom.h`.
- Detected declarations: `function files`, `function rv770_enable_bif_dynamic_pcie_gen2`, `function rv770_enable_l0s`, `function rv770_enable_l1`, `function rv770_enable_pll_sleep_in_l1`, `function rv770_gfx_clock_gating_enable`, `function rv770_mg_clock_gating_enable`, `function rv770_restore_cgcg`, `function rv770_start_dpm`, `function rv770_stop_dpm`.
- 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.