STRUCT VGA_SWITCHEROO_HANDLER(9)
π NAME π
struct vga_switcheroo_handler β bestie, it's the handler callbacks π (the plug-and-play brain of the whole switcheroo situation)
So like, this page lives in the Kernel API Manual, and it's giving "backstage pass to the GPU glow-up department" energy β¨
π¦ SYNOPSIS π¦
struct vga_switcheroo_handler {
int (*init)(void);
int (*switchto)(enum vga_switcheroo_client_id id);
int (*switch_ddc)(enum vga_switcheroo_client_id id);
int (*power_state)(enum vga_switcheroo_client_id id, enum vga_switcheroo_state state);
enum vga_switcheroo_client_id (*get_client_id)(struct pci_dev *pdev);
};
πΈ Members πΈ
initβ initialize the handler π Optional, okurr. This gets called when vga_switcheroo is enabled, i.e. when two vga clients have registered. It lets the handler do some delayed initialization that depends on the vga clients actually existing. Currently only theradeonandamdgpudrivers use this. And the return value? Ignored. Not read. Not perceived. πswitchtoβ switch the outputs to the given client π₯οΈ Mandatory, no skipping. For muxless machines this should be a no-op (literally nothing, on purpose). Returning0denotes success, anything else is failure β and in that failure case the switch is aborted. π¨switch_ddcβ switch the DDC lines to the given client π Optional. Should return the previous DDC owner on success, or a negativeinton failure. Ngl that return value is doing double duty.power_stateβ cut or reinstate power of the given client β‘ Optional. The return value is ignored. Yeah. It just goes in the void. πget_client_idβ determine if the given pci device is an integrated or a discrete GPU π§ Mandatory. This one's the vibe check that tells you who's who.
π Description π
Handler callbacks, bestie β the multiplexer itself. Like the group-chat admin who decides whose turn it is to post. π
The switchto and get_client_id methods are mandatory; all the others may be set to NULL. Periodt. π
π SEE ALSO π
- Kernel file
./include/linux/vga_switcheroo.h enum vga_switcheroo_handler_flags_t(9)enum vga_switcheroo_state(9)enum vga_switcheroo_client_id(9)struct vga_switcheroo_client_ops(9)
Okay that's the whole page, you ate that π This one's served fresh from ./include/linux, dated October 2026 β mwah, go read the kernel source, ily, bye π«Άπ
π¦ 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