drivers/gpu/drm/amd/amdgpu/cik.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/amdgpu/cik.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/amdgpu/cik.c- Extension
.c- Size
- 65968 bytes
- Lines
- 2275
- 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/slab.hlinux/module.hlinux/pci.hdrm/amdgpu_drm.hamdgpu.hamdgpu_atombios.hamdgpu_ih.hamdgpu_uvd.hamdgpu_vce.hcikd.hatom.hamd_pcie.hcik.hgmc_v7_0.hcik_ih.hdce_v8_0.hgfx_v7_0.hcik_sdma.huvd_v4_2.hvce_v2_0.hcik_dpm.huvd/uvd_4_2_d.hsmu/smu_7_0_1_d.hsmu/smu_7_0_1_sh_mask.hdce/dce_8_0_d.hdce/dce_8_0_sh_mask.hbif/bif_4_1_d.hbif/bif_4_1_sh_mask.hgca/gfx_7_2_d.hgca/gfx_7_2_enum.hgca/gfx_7_2_sh_mask.h
Detected Declarations
struct kv_reset_save_regsfunction cik_query_video_codecsfunction cik_pcie_rregfunction cik_pcie_wregfunction cik_smc_rregfunction cik_smc_wregfunction cik_uvd_ctx_rregfunction cik_uvd_ctx_wregfunction cik_didt_rregfunction cik_didt_wregfunction cik_init_golden_registersfunction cik_get_xclkfunction cik_srbm_selectfunction cik_vga_set_statefunction cik_read_disabled_biosfunction cik_read_bios_from_romfunction cik_get_register_valuefunction cik_read_registerfunction kv_save_regs_for_resetfunction kv_restore_regs_for_resetfunction cik_asic_pci_config_resetfunction cik_asic_supports_bacofunction cik_asic_reset_methodfunction cik_asic_resetfunction cik_get_config_memsizefunction cik_set_uvd_clockfunction cik_set_uvd_clocksfunction cik_set_vce_clocksfunction cik_pcie_gen3_enablefunction cik_program_aspmfunction cik_get_rev_idfunction cik_flush_hdpfunction cik_invalidate_hdpfunction cik_need_full_resetfunction cik_get_pcie_usagefunction cik_need_reset_on_initfunction cik_get_pcie_replay_countfunction cik_common_early_initfunction cik_common_hw_initfunction cik_common_hw_finifunction cik_common_resumefunction cik_common_is_idlefunction cik_common_soft_resetfunction cik_common_set_clockgating_statefunction cik_common_set_powergating_statefunction cik_set_ip_blocks
Annotated Snippet
struct kv_reset_save_regs {
u32 gmcon_reng_execute;
u32 gmcon_misc;
u32 gmcon_misc3;
};
static void kv_save_regs_for_reset(struct amdgpu_device *adev,
struct kv_reset_save_regs *save)
{
save->gmcon_reng_execute = RREG32(mmGMCON_RENG_EXECUTE);
save->gmcon_misc = RREG32(mmGMCON_MISC);
save->gmcon_misc3 = RREG32(mmGMCON_MISC3);
WREG32(mmGMCON_RENG_EXECUTE, save->gmcon_reng_execute &
~GMCON_RENG_EXECUTE__RENG_EXECUTE_ON_PWR_UP_MASK);
WREG32(mmGMCON_MISC, save->gmcon_misc &
~(GMCON_MISC__RENG_EXECUTE_ON_REG_UPDATE_MASK |
GMCON_MISC__STCTRL_STUTTER_EN_MASK));
}
static void kv_restore_regs_for_reset(struct amdgpu_device *adev,
struct kv_reset_save_regs *save)
{
int i;
WREG32(mmGMCON_PGFSM_WRITE, 0);
WREG32(mmGMCON_PGFSM_CONFIG, 0x200010ff);
for (i = 0; i < 5; i++)
WREG32(mmGMCON_PGFSM_WRITE, 0);
WREG32(mmGMCON_PGFSM_WRITE, 0);
WREG32(mmGMCON_PGFSM_CONFIG, 0x300010ff);
for (i = 0; i < 5; i++)
WREG32(mmGMCON_PGFSM_WRITE, 0);
WREG32(mmGMCON_PGFSM_WRITE, 0x210000);
WREG32(mmGMCON_PGFSM_CONFIG, 0xa00010ff);
for (i = 0; i < 5; i++)
WREG32(mmGMCON_PGFSM_WRITE, 0);
WREG32(mmGMCON_PGFSM_WRITE, 0x21003);
WREG32(mmGMCON_PGFSM_CONFIG, 0xb00010ff);
for (i = 0; i < 5; i++)
WREG32(mmGMCON_PGFSM_WRITE, 0);
WREG32(mmGMCON_PGFSM_WRITE, 0x2b00);
WREG32(mmGMCON_PGFSM_CONFIG, 0xc00010ff);
for (i = 0; i < 5; i++)
WREG32(mmGMCON_PGFSM_WRITE, 0);
WREG32(mmGMCON_PGFSM_WRITE, 0);
WREG32(mmGMCON_PGFSM_CONFIG, 0xd00010ff);
for (i = 0; i < 5; i++)
WREG32(mmGMCON_PGFSM_WRITE, 0);
WREG32(mmGMCON_PGFSM_WRITE, 0x420000);
WREG32(mmGMCON_PGFSM_CONFIG, 0x100010ff);
for (i = 0; i < 5; i++)
WREG32(mmGMCON_PGFSM_WRITE, 0);
WREG32(mmGMCON_PGFSM_WRITE, 0x120202);
WREG32(mmGMCON_PGFSM_CONFIG, 0x500010ff);
for (i = 0; i < 5; i++)
WREG32(mmGMCON_PGFSM_WRITE, 0);
WREG32(mmGMCON_PGFSM_WRITE, 0x3e3e36);
WREG32(mmGMCON_PGFSM_CONFIG, 0x600010ff);
for (i = 0; i < 5; i++)
WREG32(mmGMCON_PGFSM_WRITE, 0);
WREG32(mmGMCON_PGFSM_WRITE, 0x373f3e);
WREG32(mmGMCON_PGFSM_CONFIG, 0x700010ff);
for (i = 0; i < 5; i++)
WREG32(mmGMCON_PGFSM_WRITE, 0);
WREG32(mmGMCON_PGFSM_WRITE, 0x3e1332);
WREG32(mmGMCON_PGFSM_CONFIG, 0xe00010ff);
WREG32(mmGMCON_MISC3, save->gmcon_misc3);
WREG32(mmGMCON_MISC, save->gmcon_misc);
Annotation
- Immediate include surface: `linux/firmware.h`, `linux/slab.h`, `linux/module.h`, `linux/pci.h`, `drm/amdgpu_drm.h`, `amdgpu.h`, `amdgpu_atombios.h`, `amdgpu_ih.h`.
- Detected declarations: `struct kv_reset_save_regs`, `function cik_query_video_codecs`, `function cik_pcie_rreg`, `function cik_pcie_wreg`, `function cik_smc_rreg`, `function cik_smc_wreg`, `function cik_uvd_ctx_rreg`, `function cik_uvd_ctx_wreg`, `function cik_didt_rreg`, `function cik_didt_wreg`.
- 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.