amdgpu_switc...o_can_switch(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 amdgpu_switc...o_can_switch(9) 🌸

okay so bestie, we're in the Kernel API Manual today and honestly? this one's a little baby function but it's lowkey iconic. let's get into it πŸ’…


✨ NAME ✨

amdgpu_switcheroo_can_switch β€” literally just checking if the switcheroo state is allowed to change πŸ¦‹


✨ SYNOPSIS ✨

bool amdgpu_switcheroo_can_switch (struct pci_dev *pdev );

that's it. that's the whole vibe check. returns a bool, takes one thing, no cap πŸŽ€


✨ ARGUMENTS ✨

  • pdev β€” the pci dev pointer. that's the whole description fr fr, it's a pci dev pointer and we love her for it πŸ’–

✨ DESCRIPTION ✨

so this is a callback for the switcheroo driver β€” think of it as the little "hiii can I come in?" check at the door πŸšͺ✨

what it does: it checks whether the switcheroo state can be changed.

  • returns true if the state can be changed πŸ‘‘
  • returns false if it cannot πŸ™ˆ

that's the whole thing, bestie. no side quests, no hidden lore, just a clean yes/no. main character energy honestly 🌈


✨ SEE ALSO ✨

the whole friend group 🫢 first up, the kernel file this lives in:

  • Kernel file ./drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

and now the full squad, in order, no one left out (iykyk):


bestie note: the name in the header got cut off mid-word (amdgpu_switc...o_can_switch(9)) but the real one in the NAME section is amdgpu_switcheroo_can_switch β€” that's not me being sloppy, that's literally how the page came to me, so I'm preserving it πŸ’€

and that's the page! mwah πŸ’‹ this one came from ./drivers/gpu/drm/amd/amdgpu and is dated October 2026 β€” so yes, bestie, we're reading the future πŸŒŸπŸ¦‹ slay, go check your switcheroo state πŸ’œ

πŸ“¦ where this page comes from