STRUCT VGA_SWITCHEROO_CLIENT(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct vga_switcheroo_client πŸ’…

okay so bestie, welcome to the Kernel API Manual β€” yes this is the struct vga_switcheroo_client(9) page and no, it's not as scary as it sounds, i promise 🫢


✨ NAME ✨

struct vga_switcheroo_client β€” literally just a registered client, that's it, that's the whole vibe πŸŽ€


🌸 SYNOPSIS 🌸

struct vga_switcheroo_client {
    struct pci_dev *pdev;
    struct fb_info *fb_info;
    enum vga_switcheroo_state pwr_state;
    const struct vga_switcheroo_client_ops *ops;
    enum vga_switcheroo_client_id id;
    bool active;
    bool driver_power_control;
    struct list_head list;
    struct pci_dev *vga_dev;
 };

like, copy it exactly pls, every field matters πŸ‘‘


πŸ¦‹ Members πŸ¦‹

okay so this is the part where we meet the whole squad, one member at a time πŸ’–

  • pdev β€” the client's pci device. that's its whole thing, no cap.
  • fb_info β€” the framebuffer that the console gets remapped to when you switch. it's giving "where the screen actually goes" energy ✨
  • pwr_state β€” the current power state, but ONLY if you're using manual power control. if you're on driver power control instead, you don't read this β€” you call vga_switcheroo_pwr_state, periodt.
  • ops β€” the client callbacks. the little hooks it calls home with πŸ“ž
  • id β€” the client identifier. lowkey the tricky one: figuring out the id requires the handler, so gpus start out with VGA_SWITCHEROO_UNKNOWN_ID and only get their true id later, inside vga_switcheroo_enable. character development fr fr 🌈
  • active β€” whether the outputs are currently switched over to this client. y/n, main character or not πŸ’…
  • driver_power_control β€” whether the power state is controlled by the driver's runtime pm. and listen: if this is true, writing ON and OFF to the vga_switcheroo debugfs interface is a no-op, specifically so it doesn't interfere with runtime pm. don't @ me, that's just how it is 😭
  • list β€” the client list. the group chat, basically.
  • vga_dev β€” a pci device that indicates which GPU is bound to the current audio client. iykyk πŸ”₯

🌼 Description 🌼

so a registered client β€” and here's the tea β€” can be either a GPU or an audio device sitting on a GPU πŸ’€

for audio clients, the fb_info and active members are bogus (read: don't trust them, they're not real for you πŸ™ˆ).

for GPU clients, the vga_dev member is the bogus one.

that's the whole trade-off, bestie. everyone's got exactly one fake field and that's iconic in its own way ⭐


πŸ‘‘ SEE ALSO πŸ‘‘

go read these next, they're all connected, no skips 🧚

Kernel file ./drivers/gpu/vga/vga_switcheroo.c Overview(9), struct vgasr_priv(9), vga_switcheroo_register_handler(9), vga_switcheroo_unregister_handler(9), vga_switcheroo_handler_flags(9), vga_switcheroo_register_client(9), vga_switcheroo_register_audio_client(9), vga_switcheroo_client_probe_defer(9), vga_switcheroo_get_client_state(9), vga_switcheroo_unregister_client(9), vga_switcheroo_client_fb_set(9), vga_switcheroo_lock_ddc(9), vga_switcheroo_unlock_ddc(9), Manual switching and manual power control(9), vga_switcheroo_process_delayed_switch(9), Driver power control(9), vga_switcheroo_init_domain_pm_ops(9)


okay and before you go, the receipts 🧾: this one came from ./drivers/gpu/vga, dated October 2026, and it's the struct vga_switcheroo_client(9) page from the Kernel API Manual. that's it, that's the page, mwah πŸ’‹βœ¨ slay responsibly πŸŽ€

πŸ“¦ where this page comes from