STRUCT VGA_SWITCHEROO_CLIENT_OPS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct vga_switcheroo_client_ops(9) β€” the kernel API manual, bestie edition πŸ’…

okay so this is the man page for struct vga_switcheroo_client_ops(9), from the kernel API manual β€” yes the same manual, she's just got a whole new outfit now. ✨


🌸 NAME 🌸

struct vga_switcheroo_client_ops β€” client callbacks. that's it. that's the whole vibe. callback city. πŸŽ€


✨ SYNOPSIS ✨

struct vga_switcheroo_client_ops {
    void (*set_gpu_state)(struct pci_dev *dev, enum
vga_switcheroo_state);
    void (*reprobe)(struct pci_dev *dev);
    bool (*can_switch)(struct pci_dev *dev);
    void (*gpu_bound)(struct pci_dev *dev, enum
vga_switcheroo_client_id);
 };

no cap, that's the whole struct right there. four function pointers, zero drama (okay, a little drama). πŸ¦‹


πŸ‘‘ Members πŸ‘‘

⭐ set_gpu_state

lowkey the main character of this struct. it does the equivalent of suspend/resume for the card. it's Mandatory β€” you literally cannot skip it, bestie. πŸ™ˆ

⚠️ and listen: this should not cut power to the discrete GPU. that's not your job. that is the handler's job. stay in your lane, queen. πŸ’…

πŸŽ€ reprobe

this one polls outputs. it's Optional, so if you're feeling lazy you can set it to NULL.

it gets called after waking the GPU and switching the outputs to it. so like, the whole "okay you're awake, now go look at what's plugged in" moment. 🌈

🧚 can_switch

this is the vibe check function, fr fr. it checks if the device is in a position to switch now. Mandatory β€” no skipping this one either.

the client should return false if a user space process has one of its device files open. like, if someone's still using the thing, the answer is no. periodt. 🫢

πŸ’– gpu_bound

this one's the messenger. it notifies the client id to the audio client when the GPU is bound. 🐦✨


πŸ”₯ Description πŸ”₯

so these are the client callbacks. a client can be either a GPU or an audio device on a GPU β€” like, both of them are valid clients, they're just different girlies. πŸ‘‘

the rules of the land:

  • the set_gpu_state and can_switch methods are mandatory πŸ”’
  • reprobe may be set to NULL β€” she's optional, she's flexible, she's fine either way πŸ’…
  • for audio clients, the reprobe member is bogus πŸ’€ (yes, that's the technical term the manpage uses, we don't make the rules)
  • OTOH, gpu_bound is only for audio clients, and it is not used for GPU clients πŸ™…β€β™€οΈ

πŸ¦‹ SEE ALSO πŸ¦‹

kernel file ./include/linux/vga_switcheroo.h, plus these baddies right here:

  • enum vga_switcheroo_handler_flags_t(9)
  • enum vga_switcheroo_state(9)
  • enum vga_switcheroo_client_id(9)
  • struct vga_switcheroo_handler(9)

aaaand that's the whole page, bestie. this one came from ./include/linux, dated October 2026, and it's filed under that struct vga_s...o_client_ops(9) name you keep seeing at the top of every page β€” she's iconic, she's truncated, she's everywhere. πŸ’œπŸŽ€βœ¨

mwah, go read some source code, ily πŸ«ΆπŸ’–

πŸ“¦ where this page comes from