STRUCT AMD_IP_FUNCS(9)
π struct amd_ip_funcs β NAME π
okay so bestie, welcome to struct amd_ip_funcs β the general hooks for managing amdgpu IP Blocks β¨ like genuinely, this is the vibe-check struct for the whole IP block situation.
This is from the Kernel API Manual, and yes we're gonna get through all of it together, no cap π
β¨ SYNOPSIS β¨
here's the whole struct, copied EXACTLY so nothing gets lost, don't @ me:
struct amd_ip_funcs {
char *name;
int (*early_init)(struct amdgpu_ip_block *ip_block);
int (*late_init)(struct amdgpu_ip_block *ip_block);
int (*sw_init)(struct amdgpu_ip_block *ip_block);
int (*sw_fini)(struct amdgpu_ip_block *ip_block);
int (*early_fini)(struct amdgpu_ip_block *ip_block);
int (*hw_init)(struct amdgpu_ip_block *ip_block);
int (*hw_fini)(struct amdgpu_ip_block *ip_block);
void (*late_fini)(struct amdgpu_ip_block *ip_block);
int (*prepare_suspend)(struct amdgpu_ip_block *ip_block);
int (*suspend)(struct amdgpu_ip_block *ip_block);
int (*resume)(struct amdgpu_ip_block *ip_block);
void (*complete)(struct amdgpu_ip_block *ip_block);
bool (*is_idle)(struct amdgpu_ip_block *ip_block);
int (*wait_for_idle)(struct amdgpu_ip_block *ip_block);
int (*soft_reset)(struct amdgpu_ip_block *ip_block);
int (*set_clockgating_state)(struct amdgpu_ip_block *ip_block, enum
amd_clockgating_state state);
int (*set_powergating_state)(struct amdgpu_ip_block *ip_block, enum
amd_powergating_state state);
void (*get_clockgating_state)(struct amdgpu_ip_block *ip_block, u64
*flags);
void (*dump_ip_state)(struct amdgpu_ip_block *ip_block);
void (*print_ip_state)(struct amdgpu_ip_block *ip_block, struct
drm_printer *p);
};
likeβ¦ look at all those function pointers. the way that struct ate π π₯
π MEMBERS π
okay breaking down every single one, because we don't skip anything in this house π«Ά
nameβ the name of the IP block. yes literally just the name π·οΈearly_initβ sets up early driver state (presw_init), and it does not configure hw. it's Optional β¨late_initβ sets up late driver/hw state (posthw_init). also Optional π«sw_initβ sets up driver state, and nope, it does not configure hw πsw_finiβ tears down driver state, still not touching hw config π§Ήearly_finiβ tears down stuff before dev detached from driver π the breakup phase frhw_initβ sets up the hw state π₯ main character energyhw_finiβ tears down the hw state πlate_finiβ final cleanup π the last little tidy-upprepare_suspendβ handle IP specific changes to prepare for suspend (such as allocating any required memory) π΄suspendβ handles IP specific hw/sw changes for suspend πresumeβ handles IP specific hw/sw changes for resume βοΈ we're so backcompleteβ handles IP specific changes after resume β¨is_idleβ returns current IP block idle status π¦ is it chill or notwait_for_idleβ poll for idle β³ literally just waiting aroundsoft_resetβ soft reset the IP block π not me hitting the reset buttonset_clockgating_stateβ enable/disable cg for the IP block β‘set_powergating_stateβ enable/disable pg for the IP block πget_clockgating_stateβ get current clockgating status π just checking indump_ip_stateβ dump the IP state of the ASIC during a gpu hang π the crime scene photosprint_ip_stateβ print the IP state in devcoredump for each IP of the ASIC π¨οΈπΈ
π DESCRIPTION π
so these hooks provide an interface for controlling the operational state of IP blocks ποΈ
After acquiring a list of IP blocks for the GPU in use, the driver can make chip-wide state changes by walking this list and making calls to hooks from each IP block.
and β important, bestie β this list is ordered to ensure that the driver initializes the IP blocks in a safe sequence β like the order is not decorative, it is the whole point, iykyk π§
π SEE ALSO π
- Kernel file
./drivers/gpu/drm/amd/include/amd_shared.h IP Blocks(9)enum amd_ip_block_type(9)enum PP_FEATURE_MASK(9)enum DC_FEATURE_MASK(9)enum DC_DEBUG_MASK(9)
and that's the whole page, you ate that π«Ά go forth and initialize your IP blocks safely β¨
mwah π this came to you from ./drivers/gpu/drm/amd/include, dated October 2026 β and yes, it's still struct amd_ip_funcs(9), bestie πΈ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms