vga_client_register(9)
π vga_client_register(9)
okay so bestie, welcome to the Kernel API Manual page for vga_client_register(9) β yes the number is part of the name, it's a section-9 thing, iykyk π
β¨ NAME β¨
vga_client_register β register or unregister a VGA arbitration client π₯οΈβ¨
πΈ SYNOPSIS πΈ
int vga_client_register (struct pci_dev *pdev , unsigned int
(*set_decode)(struct pci_dev *pdev, bool decode) );
like, that's the whole signature, no cap π
π¦ ARGUMENTS π¦
pdevβ the PCI device of the VGA client π«Άset_decodeβ the VGA decode change callback, aka the little function that gets pinged when decode state changes β
π DESCRIPTION π
okay so here's the tea β clients have two callback mechanisms they can use. two. iconic behaviour honestly π
set_decode callback: if a client can disable its GPU VGA resource, it will get a callback from this to set the encode/decode state. literally that simple π§
Rationale: (yes we're doing the why, it matters) we cannot disable VGA decode resources unconditionally because some single GPU laptops seem to require ACPI or BIOS access to the VGA registers to control things like backlights etc. hopefully newer multi-GPU laptops do something saner, and desktops won't have any special ACPI for this. the driver will get a callback when VGA arbitration is first used by userspace since some older X servers have issues π (legacy X, we love you but bestieβ¦)
π¨ real talk: this function does not check whether a client for pdev has been registered already. no vibe check, no dupe detection. so like, be careful π
to unregister, call vga_client_unregister. that's it, that's the exit strategy πͺβ¨
β RETURN β
0on success π-ENODEVon failure π
π SEE ALSO π
- Kernel file
./drivers/pci/vgaarb.c(<- the source of truth, go read it fr fr) vga_default_device(9)vga_remove_vgacon(9)vga_get(9)vga_tryget(9)vga_put(9)vga_set_legacy_decoding(9)
all the vga besties in one place π«Άπ
and that's the page!! mwah π this one lives under ./drivers/pci, and the version you're reading is dated October 2026 β go forth and arbitrate responsibly, queen ππ
π¦
π¦ 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