vga_switcheroo_lock_ddc(9)
π vga_switcheroo_lock_ddc β like, the kernel API manual page, bestie β¨
okay so this is vga_switcheroo_lock_ddc from the Kernel API Manual, and honestly? it's giving "borrow the aux cord for one sec" energy π
πΈ NAME πΈ
vga_switcheroo_lock_ddc β temporarily switch DDC lines to a given client
like, temporarily. we're borrowing, not stealing. π
β¨ SYNOPSIS β¨
int vga_switcheroo_lock_ddc (struct pci_dev *pdev );
π«Ά ARGUMENTS π«Ά
pdevβ the client pci device. that's your lil guy. the one whose corner of the DDC lines you're about to borrow. π
π₯ DESCRIPTION π₯
okay bestie, listen π β this one is lowkey simple but the rules are real.
vga_switcheroo_lock_ddc temporarily switches the DDC lines over to the client identified by pdev. but β and this is the important part β it leaves the outputs otherwise switched to exactly where they already are. nothing else moves. just the DDC lines. very "scoot over a lil bit" of it all. π¦
why tho? because it lets the inactive client probe EDID. that's the whole vibe check. π
β οΈ but fr fr: the DDC lines must afterwards be switched back by calling vga_switcheroo_unlock_ddc, even if this function returns an error. no cap. even on the fail path. especially on the fail path. don't leave 'em hanging. π
π RETURN π
so what do you get back? π
- Previous DDC owner on success π
- a negative
inton error π
specifically:
-ENODEVif no handler has registered β or if the handler just doesn't support switching the DDC lines. like, not their thing. π- also, any negative value returned by the handler gets propagated right back to the caller. it's not being filtered, it's just being passed along, main character energy through and through.
and here's the tea β β the return value has merely an informational purpose for any caller which might be interested in it. so it's fine to just... ignore it π€·ββοΈ and simply rely on the result of the subsequent EDID probe, which will be NULL if DDC switching failed. that's your actual signal. periodt. π
π§ SEE ALSO π§
literally the whole friend group, go say hi:
- Kernel file
./drivers/gpu/vga/vga_switcheroo.c - Overview(9)
- struct
vga_switcheroo_client(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_unlock_ddc(9)β the one you will be calling, bestie, don't forget π- Manual switching and manual power control(9)
vga_switcheroo_process_delayed_switch(9)- Driver power control(9)
vga_switcheroo_init_domain_pm_ops(9)
π and that's the page, mwah π
source lives over in ./drivers/gpu/vga, the version stamp says October 2026, and it's all straight out of the Kernel API Manual. now go unlock those DDC lines before you leave, 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