drivers/gpu/drm/radeon/rv6xx_dpm.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/radeon/rv6xx_dpm.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/radeon/rv6xx_dpm.c- Extension
.c- Size
- 63874 bytes
- Lines
- 2159
- 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.hrv6xxd.hr600_dpm.hrv6xx_dpm.hatom.hlinux/seq_file.h
Detected Declarations
function rv6xx_force_pcie_gen1function rv6xx_enable_pcie_gen2_supportfunction rv6xx_enable_bif_dynamic_pcie_gen2function rv6xx_enable_l0sfunction rv6xx_enable_l1function rv6xx_enable_pll_sleep_in_l1function rv6xx_convert_clock_to_steppingfunction rv6xx_output_steppingfunction rv6xx_next_vco_stepfunction rv6xx_can_step_post_divfunction rv6xx_next_post_div_stepfunction rv6xx_reached_stepping_targetfunction rv6xx_generate_stepsfunction rv6xx_generate_single_stepfunction rv6xx_invalidate_intermediate_steps_rangefunction rv6xx_set_engine_spread_spectrum_clk_sfunction rv6xx_set_engine_spread_spectrum_clk_vfunction rv6xx_enable_engine_spread_spectrumfunction rv6xx_set_memory_spread_spectrum_clk_sfunction rv6xx_set_memory_spread_spectrum_clk_vfunction rv6xx_enable_memory_spread_spectrumfunction rv6xx_enable_dynamic_spread_spectrumfunction rv6xx_memory_clock_entry_enable_post_dividerfunction rv6xx_memory_clock_entry_set_post_dividerfunction rv6xx_memory_clock_entry_set_feedback_dividerfunction rv6xx_memory_clock_entry_set_reference_dividerfunction rv6xx_vid_response_set_brtfunction rv6xx_enable_engine_feedback_and_reference_syncfunction rv6xx_clocks_per_unitfunction rv6xx_scale_count_given_unitfunction rv6xx_compute_count_for_delayfunction rv6xx_calculate_engine_speed_stepping_parametersfunction rv6xx_calculate_memory_clock_stepping_parametersfunction rv6xx_calculate_voltage_stepping_parametersfunction rv6xx_calculate_vco_frequencyfunction rv6xx_calculate_spread_spectrum_clk_vfunction rv6xx_calculate_spread_spectrum_clk_sfunction rv6xx_program_engine_spread_spectrumfunction rv6xx_program_sclk_spread_spectrum_parameters_except_lowest_entryfunction rv6xx_program_mclk_stepping_entryfunction rv6xx_program_mclk_stepping_parameters_except_lowest_entryfunction rv6xx_find_memory_clock_with_highest_vcofunction rv6xx_program_mclk_spread_spectrum_parametersfunction rv6xx_program_voltage_stepping_entryfunction rv6xx_program_voltage_stepping_parameters_except_lowest_entryfunction rv6xx_program_backbias_stepping_parameters_except_lowest_entryfunction rv6xx_program_sclk_spread_spectrum_parameters_lowest_entryfunction rv6xx_program_mclk_stepping_parameters_lowest_entry
Annotated Snippet
if (rv6xx_reached_stepping_target(rdev, &next, &target, increasing_vco)) {
struct rv6xx_sclk_stepping tiny =
rv6xx_next_vco_step(rdev, &target, !increasing_vco, R600_ENDINGVCOSTEPPCT_DFLT);
tiny.post_divider = next.post_divider;
if (!rv6xx_reached_stepping_target(rdev, &tiny, &cur, !increasing_vco))
rv6xx_output_stepping(rdev, step_index++, &tiny);
if ((next.post_divider != target.post_divider) &&
(next.vco_frequency != target.vco_frequency)) {
struct rv6xx_sclk_stepping final_vco;
final_vco.vco_frequency = target.vco_frequency;
final_vco.post_divider = next.post_divider;
rv6xx_output_stepping(rdev, step_index++, &final_vco);
}
rv6xx_output_stepping(rdev, step_index++, &target);
break;
} else
rv6xx_output_stepping(rdev, step_index++, &next);
cur = next;
}
*end_index = (u8)step_index - 1;
}
static void rv6xx_generate_single_step(struct radeon_device *rdev,
u32 clock, u32 index)
{
struct rv6xx_sclk_stepping step;
rv6xx_convert_clock_to_stepping(rdev, clock, &step);
rv6xx_output_stepping(rdev, index, &step);
}
static void rv6xx_invalidate_intermediate_steps_range(struct radeon_device *rdev,
u32 start_index, u32 end_index)
{
u32 step_index;
for (step_index = start_index + 1; step_index < end_index; step_index++)
r600_engine_clock_entry_enable(rdev, step_index, false);
}
static void rv6xx_set_engine_spread_spectrum_clk_s(struct radeon_device *rdev,
u32 index, u32 clk_s)
{
WREG32_P(CG_SPLL_SPREAD_SPECTRUM_LOW + (index * 4),
CLKS(clk_s), ~CLKS_MASK);
}
static void rv6xx_set_engine_spread_spectrum_clk_v(struct radeon_device *rdev,
u32 index, u32 clk_v)
{
WREG32_P(CG_SPLL_SPREAD_SPECTRUM_LOW + (index * 4),
CLKV(clk_v), ~CLKV_MASK);
}
static void rv6xx_enable_engine_spread_spectrum(struct radeon_device *rdev,
u32 index, bool enable)
{
if (enable)
WREG32_P(CG_SPLL_SPREAD_SPECTRUM_LOW + (index * 4),
SSEN, ~SSEN);
else
WREG32_P(CG_SPLL_SPREAD_SPECTRUM_LOW + (index * 4),
0, ~SSEN);
}
static void rv6xx_set_memory_spread_spectrum_clk_s(struct radeon_device *rdev,
u32 clk_s)
{
WREG32_P(CG_MPLL_SPREAD_SPECTRUM, CLKS(clk_s), ~CLKS_MASK);
}
static void rv6xx_set_memory_spread_spectrum_clk_v(struct radeon_device *rdev,
u32 clk_v)
{
WREG32_P(CG_MPLL_SPREAD_SPECTRUM, CLKV(clk_v), ~CLKV_MASK);
}
static void rv6xx_enable_memory_spread_spectrum(struct radeon_device *rdev,
bool enable)
{
if (enable)
WREG32_P(CG_MPLL_SPREAD_SPECTRUM, SSEN, ~SSEN);
Annotation
- Immediate include surface: `radeon.h`, `radeon_asic.h`, `rv6xxd.h`, `r600_dpm.h`, `rv6xx_dpm.h`, `atom.h`, `linux/seq_file.h`.
- Detected declarations: `function rv6xx_force_pcie_gen1`, `function rv6xx_enable_pcie_gen2_support`, `function rv6xx_enable_bif_dynamic_pcie_gen2`, `function rv6xx_enable_l0s`, `function rv6xx_enable_l1`, `function rv6xx_enable_pll_sleep_in_l1`, `function rv6xx_convert_clock_to_stepping`, `function rv6xx_output_stepping`, `function rv6xx_next_vco_step`, `function rv6xx_can_step_post_div`.
- 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.