STRUCT AMD_IP_FUNCS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ 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 (pre sw_init), and it does not configure hw. it's Optional ✨
  • late_init β€” sets up late driver/hw state (post hw_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 fr
  • hw_init β€” sets up the hw state πŸ”₯ main character energy
  • hw_fini β€” tears down the hw state πŸ’€
  • late_fini β€” final cleanup πŸŽ€ the last little tidy-up
  • prepare_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 back
  • complete β€” handles IP specific changes after resume ✨
  • is_idle β€” returns current IP block idle status πŸ¦‹ is it chill or not
  • wait_for_idle β€” poll for idle ⏳ literally just waiting around
  • soft_reset β€” soft reset the IP block πŸ”„ not me hitting the reset button
  • set_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 in
  • dump_ip_state β€” dump the IP state of the ASIC during a gpu hang πŸ’€ the crime scene photos
  • print_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