drivers/gpu/drm/radeon/si.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/radeon/si.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/radeon/si.c- Extension
.c- Size
- 211238 bytes
- Lines
- 7549
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/firmware.hlinux/module.hlinux/pci.hlinux/slab.hdrm/drm_vblank.hdrm/radeon_drm.hatom.hclearstate_si.hevergreen.hr600.hradeon.hradeon_asic.hradeon_audio.hradeon_ucode.hsi_blit_shaders.hsi.hsid.h
Detected Declarations
struct dce6_wm_paramsfunction si_init_golden_registersfunction si_get_allowed_info_registerfunction si_get_xclkfunction si_get_tempfunction si_mc_load_microcodefunction si_init_microcodefunction dce6_line_buffer_adjustfunction si_get_number_of_dram_channelsfunction dce6_dram_bandwidthfunction dce6_dram_bandwidth_for_displayfunction dce6_data_return_bandwidthfunction dce6_get_dmif_bytes_per_requestfunction dce6_dmif_request_bandwidthfunction dce6_available_bandwidthfunction dce6_average_bandwidthfunction dce6_latency_watermarkfunction dce6_average_bandwidth_vs_dram_bandwidth_for_displayfunction dce6_average_bandwidth_vs_available_bandwidthfunction dce6_check_latency_hidingfunction dce6_program_watermarksfunction dce6_bandwidth_updatefunction si_tiling_mode_table_initfunction si_select_se_shfunction si_create_bitmaskfunction si_get_cu_enabledfunction si_setup_spifunction si_get_rb_disabledfunction si_setup_rbfunction si_gpu_initfunction si_scratch_initfunction si_fence_ring_emitfunction si_ring_ib_executefunction si_cp_enablefunction si_cp_load_microcodefunction si_cp_startfunction si_cp_finifunction si_cp_resumefunction si_gpu_check_soft_resetfunction si_gpu_soft_resetfunction si_set_clk_bypass_modefunction si_spll_powerdownfunction si_gpu_pci_config_resetfunction si_asic_resetfunction si_gfx_is_lockupfunction si_mc_programfunction si_vram_gtt_locationfunction si_mc_init
Annotated Snippet
struct dce6_wm_params {
u32 dram_channels; /* number of dram channels */
u32 yclk; /* bandwidth per dram data pin in kHz */
u32 sclk; /* engine clock in kHz */
u32 disp_clk; /* display clock in kHz */
u32 src_width; /* viewport width */
u32 active_time; /* active display time in ns */
u32 blank_time; /* blank time in ns */
bool interlaced; /* mode is interlaced */
fixed20_12 vsc; /* vertical scale ratio */
u32 num_heads; /* number of active crtcs */
u32 bytes_per_pixel; /* bytes per pixel display + overlay */
u32 lb_size; /* line buffer allocated to pipe */
u32 vtaps; /* vertical scaler taps */
};
static u32 dce6_dram_bandwidth(struct dce6_wm_params *wm)
{
/* Calculate raw DRAM Bandwidth */
fixed20_12 dram_efficiency; /* 0.7 */
fixed20_12 yclk, dram_channels, bandwidth;
fixed20_12 a;
a.full = dfixed_const(1000);
yclk.full = dfixed_const(wm->yclk);
yclk.full = dfixed_div(yclk, a);
dram_channels.full = dfixed_const(wm->dram_channels * 4);
a.full = dfixed_const(10);
dram_efficiency.full = dfixed_const(7);
dram_efficiency.full = dfixed_div(dram_efficiency, a);
bandwidth.full = dfixed_mul(dram_channels, yclk);
bandwidth.full = dfixed_mul(bandwidth, dram_efficiency);
return dfixed_trunc(bandwidth);
}
static u32 dce6_dram_bandwidth_for_display(struct dce6_wm_params *wm)
{
/* Calculate DRAM Bandwidth and the part allocated to display. */
fixed20_12 disp_dram_allocation; /* 0.3 to 0.7 */
fixed20_12 yclk, dram_channels, bandwidth;
fixed20_12 a;
a.full = dfixed_const(1000);
yclk.full = dfixed_const(wm->yclk);
yclk.full = dfixed_div(yclk, a);
dram_channels.full = dfixed_const(wm->dram_channels * 4);
a.full = dfixed_const(10);
disp_dram_allocation.full = dfixed_const(3); /* XXX worse case value 0.3 */
disp_dram_allocation.full = dfixed_div(disp_dram_allocation, a);
bandwidth.full = dfixed_mul(dram_channels, yclk);
bandwidth.full = dfixed_mul(bandwidth, disp_dram_allocation);
return dfixed_trunc(bandwidth);
}
static u32 dce6_data_return_bandwidth(struct dce6_wm_params *wm)
{
/* Calculate the display Data return Bandwidth */
fixed20_12 return_efficiency; /* 0.8 */
fixed20_12 sclk, bandwidth;
fixed20_12 a;
a.full = dfixed_const(1000);
sclk.full = dfixed_const(wm->sclk);
sclk.full = dfixed_div(sclk, a);
a.full = dfixed_const(10);
return_efficiency.full = dfixed_const(8);
return_efficiency.full = dfixed_div(return_efficiency, a);
a.full = dfixed_const(32);
bandwidth.full = dfixed_mul(a, sclk);
bandwidth.full = dfixed_mul(bandwidth, return_efficiency);
return dfixed_trunc(bandwidth);
}
static u32 dce6_get_dmif_bytes_per_request(struct dce6_wm_params *wm)
{
return 32;
}
static u32 dce6_dmif_request_bandwidth(struct dce6_wm_params *wm)
{
/* Calculate the DMIF Request Bandwidth */
fixed20_12 disp_clk_request_efficiency; /* 0.8 */
fixed20_12 disp_clk, sclk, bandwidth;
fixed20_12 a, b1, b2;
u32 min_bandwidth;
a.full = dfixed_const(1000);
Annotation
- Immediate include surface: `linux/firmware.h`, `linux/module.h`, `linux/pci.h`, `linux/slab.h`, `drm/drm_vblank.h`, `drm/radeon_drm.h`, `atom.h`, `clearstate_si.h`.
- Detected declarations: `struct dce6_wm_params`, `function si_init_golden_registers`, `function si_get_allowed_info_register`, `function si_get_xclk`, `function si_get_temp`, `function si_mc_load_microcode`, `function si_init_microcode`, `function dce6_line_buffer_adjust`, `function si_get_number_of_dram_channels`, `function dce6_dram_bandwidth`.
- 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.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.