STRUCT VGA_SWITCHEROO_CLIENT_OPS(9)
π 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_stateandcan_switchmethods are mandatory π reprobemay be set toNULLβ she's optional, she's flexible, she's fine either way π- for audio clients, the
reprobemember is bogus π (yes, that's the technical term the manpage uses, we don't make the rules) - OTOH,
gpu_boundis 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
- 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