9sphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget"/translations/zh_CN/gpu/vgaarbitermodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget"/translations/zh_TW/gpu/vgaarbitermodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget"/translations/it_IT/gpu/vgaarbitermodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget"/translations/ja_JP/gpu/vgaarbitermodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget"/translations/ko_KR/gpu/vgaarbitermodnameN classnameN refexplicituh1hhh ubh)}(hhh]hPortuguese (Brazilian)}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget"/translations/pt_BR/gpu/vgaarbitermodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget"/translations/sp_SP/gpu/vgaarbitermodnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhsection)}(hhh](htitle)}(h VGA Arbiterh]h VGA Arbiter}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhh,decodes=,owns=,locks= (ic,mc)" An IO state string is of the form {io,mem,io+mem,none}, mc and ic are respectively mem and io lock counts (for debugging/ diagnostic only). "decodes" indicate what the card currently decodes, "owns" indicates what is currently enabled on it, and "locks" indicates what is locked by this card. If the card is unplugged, we get "invalid" then for card_ID and an -ENODEV error is returned for any command until a new card is targeted. h](j")}(hreadh]hread}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j!hhhK5hjubj2)}(hhh](h)}(h9Return a string indicating the status of the target like:h]h9Return a string indicating the status of the target like:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK*hjubh)}(hG",decodes=,owns=,locks= (ic,mc)"h]hK“,decodes=,owns=,locks= (ic,mc)”}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK,hjubh)}(hXAn IO state string is of the form {io,mem,io+mem,none}, mc and ic are respectively mem and io lock counts (for debugging/ diagnostic only). "decodes" indicate what the card currently decodes, "owns" indicates what is currently enabled on it, and "locks" indicates what is locked by this card. If the card is unplugged, we get "invalid" then for card_ID and an -ENODEV error is returned for any command until a new card is targeted.h]hXAn IO state string is of the form {io,mem,io+mem,none}, mc and ic are respectively mem and io lock counts (for debugging/ diagnostic only). “decodes” indicate what the card currently decodes, “owns” indicates what is currently enabled on it, and “locks” indicates what is locked by this card. If the card is unplugged, we get “invalid” then for card_ID and an -ENODEV error is returned for any command until a new card is targeted.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK.hjubeh}(h]h ]h"]h$]h&]uh1j1hjubeh}(h]h ]h"]h$]h&]uh1jhhhK5hjhhubj)}(hXwrite Write a command to the arbiter. List of commands: target switch target to card (see below) lock acquires locks on target ("none" is an invalid io_state) trylock non-blocking acquire locks on target (returns EBUSY if unsuccessful) unlock release locks on target unlock all release all locks on target held by this user (not implemented yet) decodes set the legacy decoding attributes for the card poll event if something changes on any card (not just the target) card_ID is of the form "PCI:domain:bus:dev.fn". It can be set to "default" to go back to the system default card (TODO: not implemented yet). Currently, only PCI is supported as a prefix, but the userland API may support other bus types in the future, even if the current kernel implementation doesn't. h](j")}(hwriteh]hwrite}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j!hhhKOhjubj2)}(hhh](h)}(h1Write a command to the arbiter. List of commands:h]h1Write a command to the arbiter. List of commands:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK8hjubj)}(hhh](j)}(h switch target to card (see below)h](j")}(htarget h]htarget }(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j!hhhK:hjubj2)}(hhh]h)}(h+switch target to card (see below)h]h+switch target to card (see below)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK;hjubah}(h]h ]h"]h$]h&]uh1j1hjubeh}(h]h ]h"]h$]h&]uh1jhhhK:hjubj)}(hHlock acquires locks on target ("none" is an invalid io_state)h](j")}(hlock h]hlock }(hj#hhhNhNubah}(h]h ]h"]h$]h&]uh1j!hhhK non-blocking acquire locks on target (returns EBUSY if unsuccessful)h](j")}(htrylock h]htrylock }(hjRhhhNhNubah}(h]h ]h"]h$]h&]uh1j!hhhK?hjNubj2)}(hhh]h)}(hDnon-blocking acquire locks on target (returns EBUSY if unsuccessful)h]hDnon-blocking acquire locks on target (returns EBUSY if unsuccessful)}(hjchhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK?hj`ubah}(h]h ]h"]h$]h&]uh1j1hjNubeh}(h]h ]h"]h$]h&]uh1jhhhK?hjubj)}(h)unlock release locks on targeth](j")}(hunlock h]hunlock }(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j!hhhKAhj}ubj2)}(hhh]h)}(hrelease locks on targeth]hrelease locks on target}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKBhjubah}(h]h ]h"]h$]h&]uh1j1hj}ubeh}(h]h ]h"]h$]h&]uh1jhhhKAhjubj)}(hNunlock all release all locks on target held by this user (not implemented yet)h](j")}(h unlock allh]h unlock all}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j!hhhKDhjubj2)}(hhh]h)}(hCrelease all locks on target held by this user (not implemented yet)h]hCrelease all locks on target held by this user (not implemented yet)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKDhjubah}(h]h ]h"]h$]h&]uh1j1hjubeh}(h]h ]h"]h$]h&]uh1jhhhKDhjubj)}(hCdecodes set the legacy decoding attributes for the card h](j")}(hdecodes h]hdecodes }(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j!hhhKGhjubj2)}(hhh]h)}(h/set the legacy decoding attributes for the cardh]h/set the legacy decoding attributes for the card}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKGhjubah}(h]h ]h"]h$]h&]uh1j1hjubeh}(h]h ]h"]h$]h&]uh1jhhhKGhjubj)}(hBpoll event if something changes on any card (not just the target) h](j")}(hpollh]hpoll}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j!hhhKJhj ubj2)}(hhh]h)}(hhKuubh)}(hhh]j)}(hpci_devh]hpci_dev}(hjPhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjMubah}(h]h ]h"]h$]h&] refdomainjYreftypej[ reftargetjRmodnameN classnameNj_jb)}je]jh)}j[vga_default_devicesbc.vga_default_deviceasbuh1hhj-hhhj>hKuubj)}(h h]h }(hjqhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj-hhhj>hKuubj|)}(hjh]h*}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1j{hj-hhhj>hKuubj)}(hvga_default_deviceh]j)}(hjnh]hvga_default_device}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubah}(h]h ](jjeh"]h$]h&]jjuh1jhj-hhhj>hKuubj)}(h(void)h]j)}(hvoidh]j)}(hvoidh]hvoid}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]noemphjjuh1jhjubah}(h]h ]h"]h$]h&]jjuh1jhj-hhhj>hKuubeh}(h]h ]h"]h$]h&]jjjuh1jjjhj)hhhj>hKuubah}(h]j$ah ](jjeh"]h$]h&]j j )j huh1jhj>hKuhj&hhubj )}(hhh]h)}(h)return the default VGA device, for vgaconh]h)return the default VGA device, for vgacon}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhT/var/lib/git/docbuild/linux/Documentation/gpu/vgaarbiter:103: ./drivers/pci/vgaarb.chKuhjhhubah}(h]h ]h"]h$]h&]uh1j hj&hhhj>hKuubeh}(h]h ](jYfunctioneh"]h$]h&]jjYjjj jj!j"j#uh1jhhhjhNhNubj%)}(hX**Parameters** ``void`` no arguments **Description** This can be defined by the platform. The default implementation is rather dumb and will probably only work properly on single VGA card setups and/or x86 platforms. If your VGA default device is not PCI, you'll have to return NULL here. In this case, I assume it will not conflict with any PCI card. If this is not true, I'll have to define two arch hooks for enabling/disabling the VGA default device if that is possible. This may be a problem with real _ISA_ VGA cards, in addition to a PCI one. I don't know at this point how to deal with that card. Can their IOs be disabled at all? If not, then I suppose it's a matter of having the proper arch hook telling us about it, so we basically never allow anybody to succeed a vga_get().h](h)}(h**Parameters**h]j/)}(hjh]h Parameters}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j.hjubah}(h]h ]h"]h$]h&]uh1hhT/var/lib/git/docbuild/linux/Documentation/gpu/vgaarbiter:103: ./drivers/pci/vgaarb.chKyhjubj)}(hhh]j)}(h``void`` no arguments h](j")}(h``void``h]jP)}(hj h]hvoid}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jOhj ubah}(h]h ]h"]h$]h&]uh1j!hT/var/lib/git/docbuild/linux/Documentation/gpu/vgaarbiter:103: ./drivers/pci/vgaarb.chKhj ubj2)}(hhh]h)}(h no argumentsh]h no arguments}(hj/ hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj+ hKhj, ubah}(h]h ]h"]h$]h&]uh1j1hj ubeh}(h]h ]h"]h$]h&]uh1jhj+ hKhj ubah}(h]h ]h"]h$]h&]uh1jhjubh)}(h**Description**h]j/)}(hjQ h]h Description}(hjS hhhNhNubah}(h]h ]h"]h$]h&]uh1j.hjO ubah}(h]h ]h"]h$]h&]uh1hhT/var/lib/git/docbuild/linux/Documentation/gpu/vgaarbiter:103: ./drivers/pci/vgaarb.chKhjubh)}(hThis can be defined by the platform. The default implementation is rather dumb and will probably only work properly on single VGA card setups and/or x86 platforms.h]hThis can be defined by the platform. The default implementation is rather dumb and will probably only work properly on single VGA card setups and/or x86 platforms.}(hjg hhhNhNubah}(h]h ]h"]h$]h&]uh1hhT/var/lib/git/docbuild/linux/Documentation/gpu/vgaarbiter:103: ./drivers/pci/vgaarb.chKvhjubh)}(hX:If your VGA default device is not PCI, you'll have to return NULL here. In this case, I assume it will not conflict with any PCI card. If this is not true, I'll have to define two arch hooks for enabling/disabling the VGA default device if that is possible. This may be a problem with real _ISA_ VGA cards, in addition to a PCI one. I don't know at this point how to deal with that card. Can their IOs be disabled at all? If not, then I suppose it's a matter of having the proper arch hook telling us about it, so we basically never allow anybody to succeed a vga_get().h]hXBIf your VGA default device is not PCI, you’ll have to return NULL here. In this case, I assume it will not conflict with any PCI card. If this is not true, I’ll have to define two arch hooks for enabling/disabling the VGA default device if that is possible. This may be a problem with real _ISA_ VGA cards, in addition to a PCI one. I don’t know at this point how to deal with that card. Can their IOs be disabled at all? If not, then I suppose it’s a matter of having the proper arch hook telling us about it, so we basically never allow anybody to succeed a vga_get().}(hjv hhhNhNubah}(h]h ]h"]h$]h&]uh1hhT/var/lib/git/docbuild/linux/Documentation/gpu/vgaarbiter:103: ./drivers/pci/vgaarb.chKzhjubeh}(h]h ] kernelindentah"]h$]h&]uh1j$hjhhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](jvga_remove_vgacon (C function)c.vga_remove_vgaconhNtauh1jhjhhhNhNubj)}(hhh](j)}(h,int vga_remove_vgacon (struct pci_dev *pdev)h]j)}(h+int vga_remove_vgacon(struct pci_dev *pdev)h](j)}(hinth]hint}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj hhhT/var/lib/git/docbuild/linux/Documentation/gpu/vgaarbiter:103: ./drivers/pci/vgaarb.chKubj)}(h h]h }(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj hhhj hKubj)}(hvga_remove_vgaconh]j)}(hvga_remove_vgaconh]hvga_remove_vgacon}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubah}(h]h ](jjeh"]h$]h&]jjuh1jhj hhhj hKubj)}(h(struct pci_dev *pdev)h]j)}(hstruct pci_dev *pdevh](j#)}(hj&h]hstruct}(hj hhhNhNubah}(h]h ]j/ah"]h$]h&]uh1j"hj ubj)}(h h]h }(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubh)}(hhh]j)}(hpci_devh]hpci_dev}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&] refdomainjYreftypej[ reftargetj modnameN classnameNj_jb)}je]jh)}j[j sbc.vga_remove_vgaconasbuh1hhj ubj)}(h h]h }(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubj|)}(hjh]h*}(hj. hhhNhNubah}(h]h ]jah"]h$]h&]uh1j{hj ubj)}(hpdevh]hpdev}(hj; hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]noemphjjuh1jhj ubah}(h]h ]h"]h$]h&]jjuh1jhj hhhj hKubeh}(h]h ]h"]h$]h&]jjjuh1jjjhj hhhj hKubah}(h]j ah ](jjeh"]h$]h&]j j )j huh1jhj hKhj hhubj )}(hhh]h)}(hdeactivate VGA consoleh]hdeactivate VGA console}(hje hhhNhNubah}(h]h ]h"]h$]h&]uh1hhT/var/lib/git/docbuild/linux/Documentation/gpu/vgaarbiter:103: ./drivers/pci/vgaarb.chKhjb hhubah}(h]h ]h"]h$]h&]uh1j hj hhhj hKubeh}(h]h ](jYfunctioneh"]h$]h&]jjYjj} j j} j!j"j#uh1jhhhjhNhNubj%)}(hX **Parameters** ``struct pci_dev *pdev`` PCI device. **Description** Unbind and unregister vgacon in case pdev is the default VGA device. Can be called by GPU drivers on initialization to make sure VGA register access done by vgacon will not disturb the device.h](h)}(h**Parameters**h]j/)}(hj h]h Parameters}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j.hj ubah}(h]h ]h"]h$]h&]uh1hhT/var/lib/git/docbuild/linux/Documentation/gpu/vgaarbiter:103: ./drivers/pci/vgaarb.chKhj ubj)}(hhh]j)}(h%``struct pci_dev *pdev`` PCI device. h](j")}(h``struct pci_dev *pdev``h]jP)}(hj h]hstruct pci_dev *pdev}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jOhj ubah}(h]h ]h"]h$]h&]uh1j!hT/var/lib/git/docbuild/linux/Documentation/gpu/vgaarbiter:103: ./drivers/pci/vgaarb.chKhj ubj2)}(hhh]h)}(h PCI device.h]h PCI device.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hKhj ubah}(h]h ]h"]h$]h&]uh1j1hj ubeh}(h]h ]h"]h$]h&]uh1jhj hKhj ubah}(h]h ]h"]h$]h&]uh1jhj ubh)}(h**Description**h]j/)}(hj h]h Description}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j.hj ubah}(h]h ]h"]h$]h&]uh1hhT/var/lib/git/docbuild/linux/Documentation/gpu/vgaarbiter:103: ./drivers/pci/vgaarb.chKhj ubh)}(hUnbind and unregister vgacon in case pdev is the default VGA device. Can be called by GPU drivers on initialization to make sure VGA register access done by vgacon will not disturb the device.h]hUnbind and unregister vgacon in case pdev is the default VGA device. Can be called by GPU drivers on initialization to make sure VGA register access done by vgacon will not disturb the device.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhT/var/lib/git/docbuild/linux/Documentation/gpu/vgaarbiter:103: ./drivers/pci/vgaarb.chKhj ubeh}(h]h ] kernelindentah"]h$]h&]uh1j$hjhhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](jvga_get (C function) c.vga_gethNtauh1jhjhhhNhNubj)}(hhh](j)}(hHint vga_get (struct pci_dev *pdev, unsigned int rsrc, int interruptible)h]j)}(hGint vga_get(struct pci_dev *pdev, unsigned int rsrc, int interruptible)h](j)}(hinth]hint}(hj& hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj" hhhT/var/lib/git/docbuild/linux/Documentation/gpu/vgaarbiter:103: ./drivers/pci/vgaarb.chMubj)}(h h]h }(hj5 hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj" hhhj4 hMubj)}(hvga_geth]j)}(hvga_geth]hvga_get}(hjG hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjC ubah}(h]h ](jjeh"]h$]h&]jjuh1jhj" hhhj4 hMubj)}(h<(struct pci_dev *pdev, unsigned int rsrc, int interruptible)h](j)}(hstruct pci_dev *pdevh](j#)}(hj&h]hstruct}(hjc hhhNhNubah}(h]h ]j/ah"]h$]h&]uh1j"hj_ ubj)}(h h]h }(hjp hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj_ ubh)}(hhh]j)}(hpci_devh]hpci_dev}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj~ ubah}(h]h ]h"]h$]h&] refdomainjYreftypej[ reftargetj modnameN classnameNj_jb)}je]jh)}j[jI sb c.vga_getasbuh1hhj_ ubj)}(h h]h }(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj_ ubj|)}(hjh]h*}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1j{hj_ ubj)}(hpdevh]hpdev}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj_ ubeh}(h]h ]h"]h$]h&]noemphjjuh1jhj[ ubj)}(hunsigned int rsrch](j)}(hunsignedh]hunsigned}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubj)}(h h]h }(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubj)}(hinth]hint}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubj)}(h h]h }(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubj)}(hrsrch]hrsrc}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]noemphjjuh1jhj[ ubj)}(hint interruptibleh](j)}(hinth]hint}(hj& hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj" ubj)}(h h]h }(hj4 hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj" ubj)}(h interruptibleh]h interruptible}(hjB hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj" ubeh}(h]h ]h"]h$]h&]noemphjjuh1jhj[ ubeh}(h]h ]h"]h$]h&]jjuh1jhj" hhhj4 hMubeh}(h]h ]h"]h$]h&]jjjuh1jjjhj hhhj4 hMubah}(h]j ah ](jjeh"]h$]h&]j j )j huh1jhj4 hMhj hhubj )}(hhh]h)}(hacquire & lock VGA resourcesh]hacquire & lock VGA resources}(hjl hhhNhNubah}(h]h ]h"]h$]h&]uh1hhT/var/lib/git/docbuild/linux/Documentation/gpu/vgaarbiter:103: ./drivers/pci/vgaarb.chMhji hhubah}(h]h ]h"]h$]h&]uh1j hj hhhj4 hMubeh}(h]h ](jYfunctioneh"]h$]h&]jjYjj j j j!j"j#uh1jhhhjhNhNubj%)}(hX**Parameters** ``struct pci_dev *pdev`` PCI device of the VGA card or NULL for the system default ``unsigned int rsrc`` bit mask of resources to acquire and lock ``int interruptible`` blocking should be interruptible by signals ? **Description** Acquire VGA resources for the given card and mark those resources locked. If the resources requested are "normal" (and not legacy) resources, the arbiter will first check whether the card is doing legacy decoding for that type of resource. If yes, the lock is "converted" into a legacy resource lock. The arbiter will first look for all VGA cards that might conflict and disable their IOs and/or Memory access, including VGA forwarding on P2P bridges if necessary, so that the requested resources can be used. Then, the card is marked as locking these resources and the IO and/or Memory accesses are enabled on the card (including VGA forwarding on parent P2P bridges if any). This function will block if some conflicting card is already locking one of the required resources (or any resource on a different bus segment, since P2P bridges don't differentiate VGA memory and IO afaik). You can indicate whether this blocking should be interruptible by a signal (for userland interface) or not. Must not be called at interrupt time or in atomic context. If the card already owns the resources, the function succeeds. Nested calls are supported (a per-resource counter is maintained) On success, release the VGA resource again with vga_put(). 0 on success, negative error code on failure.h](h)}(h**Parameters**h]j/)}(hj h]h Parameters}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j.hj ubah}(h]h ]h"]h$]h&]uh1hhT/var/lib/git/docbuild/linux/Documentation/gpu/vgaarbiter:103: ./drivers/pci/vgaarb.chMhj ubj)}(hhh](j)}(hS``struct pci_dev *pdev`` PCI device of the VGA card or NULL for the system default h](j")}(h``struct pci_dev *pdev``h]jP)}(hj h]hstruct pci_dev *pdev}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jOhj ubah}(h]h ]h"]h$]h&]uh1j!hT/var/lib/git/docbuild/linux/Documentation/gpu/vgaarbiter:103: ./drivers/pci/vgaarb.chMhj ubj2)}(hhh]h)}(h9PCI device of the VGA card or NULL for the system defaulth]h9PCI device of the VGA card or NULL for the system default}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hMhj ubah}(h]h ]h"]h$]h&]uh1j1hj ubeh}(h]h ]h"]h$]h&]uh1jhj hMhj ubj)}(h@``unsigned int rsrc`` bit mask of resources to acquire and lock h](j")}(h``unsigned int rsrc``h]jP)}(hj h]hunsigned int rsrc}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jOhj ubah}(h]h ]h"]h$]h&]uh1j!hT/var/lib/git/docbuild/linux/Documentation/gpu/vgaarbiter:103: ./drivers/pci/vgaarb.chMhj ubj2)}(hhh]h)}(h)bit mask of resources to acquire and lockh]h)bit mask of resources to acquire and lock}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hMhj ubah}(h]h ]h"]h$]h&]uh1j1hj ubeh}(h]h ]h"]h$]h&]uh1jhj hMhj ubj)}(hD``int interruptible`` blocking should be interruptible by signals ? h](j")}(h``int interruptible``h]jP)}(hj h]hint interruptible}(hj! hhhNhNubah}(h]h ]h"]h$]h&]uh1jOhj ubah}(h]h ]h"]h$]h&]uh1j!hT/var/lib/git/docbuild/linux/Documentation/gpu/vgaarbiter:103: ./drivers/pci/vgaarb.chMhj ubj2)}(hhh]h)}(h-blocking should be interruptible by signals ?h]h-blocking should be interruptible by signals ?}(hj8 hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj4 hMhj5 ubah}(h]h ]h"]h$]h&]uh1j1hj ubeh}(h]h ]h"]h$]h&]uh1jhj4 hMhj ubeh}(h]h ]h"]h$]h&]uh1jhj ubh)}(h**Description**h]j/)}(hjZ h]h Description}(hj\ hhhNhNubah}(h]h ]h"]h$]h&]uh1j.hjX ubah}(h]h ]h"]h$]h&]uh1hhT/var/lib/git/docbuild/linux/Documentation/gpu/vgaarbiter:103: ./drivers/pci/vgaarb.chMhj ubh)}(hX,Acquire VGA resources for the given card and mark those resources locked. If the resources requested are "normal" (and not legacy) resources, the arbiter will first check whether the card is doing legacy decoding for that type of resource. If yes, the lock is "converted" into a legacy resource lock.h]hX4Acquire VGA resources for the given card and mark those resources locked. If the resources requested are “normal” (and not legacy) resources, the arbiter will first check whether the card is doing legacy decoding for that type of resource. If yes, the lock is “converted” into a legacy resource lock.}(hjp hhhNhNubah}(h]h ]h"]h$]h&]uh1hhT/var/lib/git/docbuild/linux/Documentation/gpu/vgaarbiter:103: ./drivers/pci/vgaarb.chMhj ubh)}(hXwThe arbiter will first look for all VGA cards that might conflict and disable their IOs and/or Memory access, including VGA forwarding on P2P bridges if necessary, so that the requested resources can be used. Then, the card is marked as locking these resources and the IO and/or Memory accesses are enabled on the card (including VGA forwarding on parent P2P bridges if any).h]hXwThe arbiter will first look for all VGA cards that might conflict and disable their IOs and/or Memory access, including VGA forwarding on P2P bridges if necessary, so that the requested resources can be used. Then, the card is marked as locking these resources and the IO and/or Memory accesses are enabled on the card (including VGA forwarding on parent P2P bridges if any).}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhT/var/lib/git/docbuild/linux/Documentation/gpu/vgaarbiter:103: ./drivers/pci/vgaarb.chMhj ubh)}(hX;This function will block if some conflicting card is already locking one of the required resources (or any resource on a different bus segment, since P2P bridges don't differentiate VGA memory and IO afaik). You can indicate whether this blocking should be interruptible by a signal (for userland interface) or not.h]hX=This function will block if some conflicting card is already locking one of the required resources (or any resource on a different bus segment, since P2P bridges don’t differentiate VGA memory and IO afaik). You can indicate whether this blocking should be interruptible by a signal (for userland interface) or not.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhT/var/lib/git/docbuild/linux/Documentation/gpu/vgaarbiter:103: ./drivers/pci/vgaarb.chMhj ubh)}(hMust not be called at interrupt time or in atomic context. If the card already owns the resources, the function succeeds. Nested calls are supported (a per-resource counter is maintained)h]hMust not be called at interrupt time or in atomic context. If the card already owns the resources, the function succeeds. Nested calls are supported (a per-resource counter is maintained)}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhT/var/lib/git/docbuild/linux/Documentation/gpu/vgaarbiter:103: ./drivers/pci/vgaarb.chMhj ubh)}(h:On success, release the VGA resource again with vga_put().h]h:On success, release the VGA resource again with vga_put().}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhT/var/lib/git/docbuild/linux/Documentation/gpu/vgaarbiter:103: ./drivers/pci/vgaarb.chMhj ubh)}(h-0 on success, negative error code on failure.h]h-0 on success, negative error code on failure.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhT/var/lib/git/docbuild/linux/Documentation/gpu/vgaarbiter:103: ./drivers/pci/vgaarb.chMhj ubeh}(h]h ] kernelindentah"]h$]h&]uh1j$hjhhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](jvga_put (C function) c.vga_puthNtauh1jhjhhhNhNubj)}(hhh](j)}(h6void vga_put (struct pci_dev *pdev, unsigned int rsrc)h]j)}(h5void vga_put(struct pci_dev *pdev, unsigned int rsrc)h](j)}(hvoidh]hvoid}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj hhhT/var/lib/git/docbuild/linux/Documentation/gpu/vgaarbiter:103: ./drivers/pci/vgaarb.chMubj)}(h h]h }(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj hhhj hMubj)}(hvga_puth]j)}(hvga_puth]hvga_put}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubah}(h]h ](jjeh"]h$]h&]jjuh1jhj hhhj hMubj)}(h)(struct pci_dev *pdev, unsigned int rsrc)h](j)}(hstruct pci_dev *pdevh](j#)}(hj&h]hstruct}(hj'hhhNhNubah}(h]h ]j/ah"]h$]h&]uh1j"hj#ubj)}(h h]h }(hj4hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj#ubh)}(hhh]j)}(hpci_devh]hpci_dev}(hjEhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjBubah}(h]h ]h"]h$]h&] refdomainjYreftypej[ reftargetjGmodnameN classnameNj_jb)}je]jh)}j[j sb c.vga_putasbuh1hhj#ubj)}(h h]h }(hjehhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj#ubj|)}(hjh]h*}(hjshhhNhNubah}(h]h ]jah"]h$]h&]uh1j{hj#ubj)}(hpdevh]hpdev}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj#ubeh}(h]h ]h"]h$]h&]noemphjjuh1jhjubj)}(hunsigned int rsrch](j)}(hunsignedh]hunsigned}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(hinth]hint}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(hrsrch]hrsrc}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]noemphjjuh1jhjubeh}(h]h ]h"]h$]h&]jjuh1jhj hhhj hMubeh}(h]h ]h"]h$]h&]jjjuh1jjjhj hhhj hMubah}(h]j ah ](jjeh"]h$]h&]j j )j huh1jhj hMhj hhubj )}(hhh]h)}(h$release lock on legacy VGA resourcesh]h$release lock on legacy VGA resources}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhT/var/lib/git/docbuild/linux/Documentation/gpu/vgaarbiter:103: ./drivers/pci/vgaarb.chMhjhhubah}(h]h ]h"]h$]h&]uh1j hj hhhj hMubeh}(h]h ](jYfunctioneh"]h$]h&]jjYjjj jj!j"j#uh1jhhhjhNhNubj%)}(hX**Parameters** ``struct pci_dev *pdev`` PCI device of VGA card or NULL for system default ``unsigned int rsrc`` bit mask of resource to release **Description** Release resources previously locked by vga_get() or vga_tryget(). The resources aren't disabled right away, so that a subsequent vga_get() on the same card will succeed immediately. Resources have a counter, so locks are only released if the counter reaches 0.h](h)}(h**Parameters**h]j/)}(hjh]h Parameters}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j.hjubah}(h]h ]h"]h$]h&]uh1hhT/var/lib/git/docbuild/linux/Documentation/gpu/vgaarbiter:103: ./drivers/pci/vgaarb.chMhjubj)}(hhh](j)}(hK``struct pci_dev *pdev`` PCI device of VGA card or NULL for system default h](j")}(h``struct pci_dev *pdev``h]jP)}(hj<h]hstruct pci_dev *pdev}(hj>hhhNhNubah}(h]h ]h"]h$]h&]uh1jOhj:ubah}(h]h ]h"]h$]h&]uh1j!hT/var/lib/git/docbuild/linux/Documentation/gpu/vgaarbiter:103: ./drivers/pci/vgaarb.chMhj6ubj2)}(hhh]h)}(h1PCI device of VGA card or NULL for system defaulth]h1PCI device of VGA card or NULL for system default}(hjUhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjQhMhjRubah}(h]h ]h"]h$]h&]uh1j1hj6ubeh}(h]h ]h"]h$]h&]uh1jhjQhMhj3ubj)}(h6``unsigned int rsrc`` bit mask of resource to release h](j")}(h``unsigned int rsrc``h]jP)}(hjuh]hunsigned int rsrc}(hjwhhhNhNubah}(h]h ]h"]h$]h&]uh1jOhjsubah}(h]h ]h"]h$]h&]uh1j!hT/var/lib/git/docbuild/linux/Documentation/gpu/vgaarbiter:103: ./drivers/pci/vgaarb.chMhjoubj2)}(hhh]h)}(hbit mask of resource to releaseh]hbit mask of resource to release}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMhjubah}(h]h ]h"]h$]h&]uh1j1hjoubeh}(h]h ]h"]h$]h&]uh1jhjhMhj3ubeh}(h]h ]h"]h$]h&]uh1jhjubh)}(h**Description**h]j/)}(hjh]h Description}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j.hjubah}(h]h ]h"]h$]h&]uh1hhT/var/lib/git/docbuild/linux/Documentation/gpu/vgaarbiter:103: ./drivers/pci/vgaarb.chMhjubh)}(hXRelease resources previously locked by vga_get() or vga_tryget(). The resources aren't disabled right away, so that a subsequent vga_get() on the same card will succeed immediately. Resources have a counter, so locks are only released if the counter reaches 0.h]hXRelease resources previously locked by vga_get() or vga_tryget(). The resources aren’t disabled right away, so that a subsequent vga_get() on the same card will succeed immediately. Resources have a counter, so locks are only released if the counter reaches 0.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhT/var/lib/git/docbuild/linux/Documentation/gpu/vgaarbiter:103: ./drivers/pci/vgaarb.chMhjubeh}(h]h ] kernelindentah"]h$]h&]uh1j$hjhhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j$vga_set_legacy_decoding (C function)c.vga_set_legacy_decodinghNtauh1jhjhhhNhNubj)}(hhh](j)}(hIvoid vga_set_legacy_decoding (struct pci_dev *pdev, unsigned int decodes)h]j)}(hHvoid vga_set_legacy_decoding(struct pci_dev *pdev, unsigned int decodes)h](j)}(hvoidh]hvoid}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjhhhT/var/lib/git/docbuild/linux/Documentation/gpu/vgaarbiter:103: ./drivers/pci/vgaarb.chMubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjhhhjhMubj)}(hvga_set_legacy_decodingh]j)}(hvga_set_legacy_decodingh]hvga_set_legacy_decoding}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubah}(h]h ](jjeh"]h$]h&]jjuh1jhjhhhjhMubj)}(h,(struct pci_dev *pdev, unsigned int decodes)h](j)}(hstruct pci_dev *pdevh](j#)}(hj&h]hstruct}(hj2hhhNhNubah}(h]h ]j/ah"]h$]h&]uh1j"hj.ubj)}(h h]h }(hj?hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj.ubh)}(hhh]j)}(hpci_devh]hpci_dev}(hjPhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjMubah}(h]h ]h"]h$]h&] refdomainjYreftypej[ reftargetjRmodnameN classnameNj_jb)}je]jh)}j[jsbc.vga_set_legacy_decodingasbuh1hhj.ubj)}(h h]h }(hjphhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj.ubj|)}(hjh]h*}(hj~hhhNhNubah}(h]h ]jah"]h$]h&]uh1j{hj.ubj)}(hpdevh]hpdev}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj.ubeh}(h]h ]h"]h$]h&]noemphjjuh1jhj*ubj)}(hunsigned int decodesh](j)}(hunsignedh]hunsigned}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(hinth]hint}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(hdecodesh]hdecodes}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]noemphjjuh1jhj*ubeh}(h]h ]h"]h$]h&]jjuh1jhjhhhjhMubeh}(h]h ]h"]h$]h&]jjjuh1jjjhjhhhjhMubah}(h]jah ](jjeh"]h$]h&]j j )j huh1jhjhMhjhhubj )}(hhh]h}(h]h ]h"]h$]h&]uh1j hjhhhjhMubeh}(h]h ](jYfunctioneh"]h$]h&]jjYjjj jj!j"j#uh1jhhhjhNhNubj%)}(hX**Parameters** ``struct pci_dev *pdev`` PCI device of the VGA card ``unsigned int decodes`` bit mask of what legacy regions the card decodes **Description** Indicate to the arbiter if the card decodes legacy VGA IOs, legacy VGA Memory, both, or none. All cards default to both, the card driver (fbdev for example) should tell the arbiter if it has disabled legacy decoding, so the card can be left out of the arbitration process (and can be safe to take interrupts at any time.h](h)}(h**Parameters**h]j/)}(hjh]h Parameters}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j.hjubah}(h]h ]h"]h$]h&]uh1hhT/var/lib/git/docbuild/linux/Documentation/gpu/vgaarbiter:103: ./drivers/pci/vgaarb.chMhjubj)}(hhh](j)}(h4``struct pci_dev *pdev`` PCI device of the VGA card h](j")}(h``struct pci_dev *pdev``h]jP)}(hj8h]hstruct pci_dev *pdev}(hj:hhhNhNubah}(h]h ]h"]h$]h&]uh1jOhj6ubah}(h]h ]h"]h$]h&]uh1j!hT/var/lib/git/docbuild/linux/Documentation/gpu/vgaarbiter:103: ./drivers/pci/vgaarb.chMhj2ubj2)}(hhh]h)}(hPCI device of the VGA cardh]hPCI device of the VGA card}(hjQhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjMhMhjNubah}(h]h ]h"]h$]h&]uh1j1hj2ubeh}(h]h ]h"]h$]h&]uh1jhjMhMhj/ubj)}(hJ``unsigned int decodes`` bit mask of what legacy regions the card decodes h](j")}(h``unsigned int decodes``h]jP)}(hjqh]hunsigned int decodes}(hjshhhNhNubah}(h]h ]h"]h$]h&]uh1jOhjoubah}(h]h ]h"]h$]h&]uh1j!hT/var/lib/git/docbuild/linux/Documentation/gpu/vgaarbiter:103: ./drivers/pci/vgaarb.chMhjkubj2)}(hhh]h)}(h0bit mask of what legacy regions the card decodesh]h0bit mask of what legacy regions the card decodes}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMhjubah}(h]h ]h"]h$]h&]uh1j1hjkubeh}(h]h ]h"]h$]h&]uh1jhjhMhj/ubeh}(h]h ]h"]h$]h&]uh1jhjubh)}(h**Description**h]j/)}(hjh]h Description}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j.hjubah}(h]h ]h"]h$]h&]uh1hhT/var/lib/git/docbuild/linux/Documentation/gpu/vgaarbiter:103: ./drivers/pci/vgaarb.chMhjubh)}(hX@Indicate to the arbiter if the card decodes legacy VGA IOs, legacy VGA Memory, both, or none. All cards default to both, the card driver (fbdev for example) should tell the arbiter if it has disabled legacy decoding, so the card can be left out of the arbitration process (and can be safe to take interrupts at any time.h]hX@Indicate to the arbiter if the card decodes legacy VGA IOs, legacy VGA Memory, both, or none. All cards default to both, the card driver (fbdev for example) should tell the arbiter if it has disabled legacy decoding, so the card can be left out of the arbitration process (and can be safe to take interrupts at any time.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhT/var/lib/git/docbuild/linux/Documentation/gpu/vgaarbiter:103: ./drivers/pci/vgaarb.chMhjubeh}(h]h ] kernelindentah"]h$]h&]uh1j$hjhhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j vga_client_register (C function)c.vga_client_registerhNtauh1jhjhhhNhNubj)}(hhh](j)}(hmint vga_client_register (struct pci_dev *pdev, unsigned int (*set_decode)(struct pci_dev *pdev, bool decode))h]j)}(hlint vga_client_register(struct pci_dev *pdev, unsigned int (*set_decode)(struct pci_dev *pdev, bool decode))`h](j)}(hinth]hint}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjhhhT/var/lib/git/docbuild/linux/Documentation/gpu/vgaarbiter:103: ./drivers/pci/vgaarb.chMubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjhhhjhMubj)}(hvga_client_registerh]j)}(hvga_client_registerh]hvga_client_register}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubah}(h]h ](jjeh"]h$]h&]jjuh1jhjhhhjhMubj)}(hU(struct pci_dev *pdev, unsigned int (*set_decode)(struct pci_dev *pdev, bool decode))h](j)}(hstruct pci_dev *pdevh](j#)}(hj&h]hstruct}(hj.hhhNhNubah}(h]h ]j/ah"]h$]h&]uh1j"hj*ubj)}(h h]h }(hj;hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj*ubh)}(hhh]j)}(hpci_devh]hpci_dev}(hjLhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjIubah}(h]h ]h"]h$]h&] refdomainjYreftypej[ reftargetjNmodnameN classnameNj_jb)}je]jh)}j[jsbc.vga_client_registerasbuh1hhj*ubj)}(h h]h }(hjlhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj*ubj|)}(hjh]h*}(hjzhhhNhNubah}(h]h ]jah"]h$]h&]uh1j{hj*ubj)}(hpdevh]hpdev}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj*ubeh}(h]h ]h"]h$]h&]noemphjjuh1jhj&ubj)}(h=unsigned int (*set_decode)(struct pci_dev *pdev, bool decode)h](j)}(hunsignedh]hunsigned}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(hinth]hint}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj|)}(h(h]h(}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1j{hjubj|)}(hjh]h*}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1j{hjubj)}(h set_decodeh]h set_decode}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj|)}(h)h]h)}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1j{hjubj|)}(hjh]h(}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1j{hjubj#)}(hj&h]hstruct}(hjhhhNhNubah}(h]h ]j/ah"]h$]h&]uh1j"hjubj)}(h h]h }(hj)hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubh)}(hhh]j)}(hpci_devh]hpci_dev}(hj:hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj7ubah}(h]h ]h"]h$]h&] refdomainjYreftypej[ reftargetj<modnameN classnameNj_jb)}je]jhc.vga_client_registerasbuh1hhjubj)}(h h]h }(hjXhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj|)}(hjh]h*}(hjfhhhNhNubah}(h]h ]jah"]h$]h&]uh1j{hjubj)}(hpdevh]hpdev}(hjshhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj|)}(h,h]h,}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1j{hjubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(hboolh]hbool}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(hdecodeh]hdecode}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj|)}(hjh]h)}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1j{hjubeh}(h]h ]h"]h$]h&]noemphjjuh1jhj&ubeh}(h]h ]h"]h$]h&]jjuh1jhjhhhjhMubeh}(h]h ]h"]h$]h&]jjjuh1jjjhjhhhjhMubah}(h]jah ](jjeh"]h$]h&]j j )j huh1jhjhMhjhhubj )}(hhh]h)}(h/register or unregister a VGA arbitration clienth]h/register or unregister a VGA arbitration client}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhT/var/lib/git/docbuild/linux/Documentation/gpu/vgaarbiter:103: ./drivers/pci/vgaarb.chMhjhhubah}(h]h ]h"]h$]h&]uh1j hjhhhjhMubeh}(h]h ](jYfunctioneh"]h$]h&]jjYjjj jj!j"j#uh1jhhhjhNhNubj%)}(hX**Parameters** ``struct pci_dev *pdev`` PCI device of the VGA client ``unsigned int (*set_decode)(struct pci_dev *pdev, bool decode)`` VGA decode change callback **Description** Clients have two callback mechanisms they can use. **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. Rationale: 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. Does not check whether a client for **pdev** has been registered already. To unregister, call vga_client_unregister(). **Return** 0 on success, -ENODEV on failureh](h)}(h**Parameters**h]j/)}(hjh]h Parameters}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j.hjubah}(h]h ]h"]h$]h&]uh1hhT/var/lib/git/docbuild/linux/Documentation/gpu/vgaarbiter:103: ./drivers/pci/vgaarb.chMhj ubj)}(hhh](j)}(h6``struct pci_dev *pdev`` PCI device of the VGA client h](j")}(h``struct pci_dev *pdev``h]jP)}(hj1h]hstruct pci_dev *pdev}(hj3hhhNhNubah}(h]h ]h"]h$]h&]uh1jOhj/ubah}(h]h ]h"]h$]h&]uh1j!hT/var/lib/git/docbuild/linux/Documentation/gpu/vgaarbiter:103: ./drivers/pci/vgaarb.chMhj+ubj2)}(hhh]h)}(hPCI device of the VGA clienth]hPCI device of the VGA client}(hjJhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjFhMhjGubah}(h]h ]h"]h$]h&]uh1j1hj+ubeh}(h]h ]h"]h$]h&]uh1jhjFhMhj(ubj)}(h]``unsigned int (*set_decode)(struct pci_dev *pdev, bool decode)`` VGA decode change callback h](j")}(hA``unsigned int (*set_decode)(struct pci_dev *pdev, bool decode)``h]jP)}(hjjh]h=unsigned int (*set_decode)(struct pci_dev *pdev, bool decode)}(hjlhhhNhNubah}(h]h ]h"]h$]h&]uh1jOhjhubah}(h]h ]h"]h$]h&]uh1j!hT/var/lib/git/docbuild/linux/Documentation/gpu/vgaarbiter:103: ./drivers/pci/vgaarb.chMhjdubj2)}(hhh]h)}(hVGA decode change callbackh]hVGA decode change callback}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMhjubah}(h]h ]h"]h$]h&]uh1j1hjdubeh}(h]h ]h"]h$]h&]uh1jhjhMhj(ubeh}(h]h ]h"]h$]h&]uh1jhj ubh)}(h**Description**h]j/)}(hjh]h Description}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j.hjubah}(h]h ]h"]h$]h&]uh1hhT/var/lib/git/docbuild/linux/Documentation/gpu/vgaarbiter:103: ./drivers/pci/vgaarb.chMhj ubh)}(h2Clients have two callback mechanisms they can use.h]h2Clients have two callback mechanisms they can use.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhT/var/lib/git/docbuild/linux/Documentation/gpu/vgaarbiter:103: ./drivers/pci/vgaarb.chMhj ubh)}(h**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.h](j/)}(h**set_decode**h]h set_decode}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j.hjubhy callback: If a client can disable its GPU VGA resource, it will get a callback from this to set the encode/decode state.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhT/var/lib/git/docbuild/linux/Documentation/gpu/vgaarbiter:103: ./drivers/pci/vgaarb.chMhj ubh)}(hXRationale: 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.h]hXRationale: 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.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhT/var/lib/git/docbuild/linux/Documentation/gpu/vgaarbiter:103: ./drivers/pci/vgaarb.chMhj ubh)}(hIDoes not check whether a client for **pdev** has been registered already.h](h$Does not check whether a client for }(hjhhhNhNubj/)}(h**pdev**h]hpdev}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j.hjubh has been registered already.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhT/var/lib/git/docbuild/linux/Documentation/gpu/vgaarbiter:103: ./drivers/pci/vgaarb.chMhj ubh)}(h,To unregister, call vga_client_unregister().h]h,To unregister, call vga_client_unregister().}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhT/var/lib/git/docbuild/linux/Documentation/gpu/vgaarbiter:103: ./drivers/pci/vgaarb.chMhj ubh)}(h **Return**h]j/)}(hj(h]hReturn}(hj*hhhNhNubah}(h]h ]h"]h$]h&]uh1j.hj&ubah}(h]h ]h"]h$]h&]uh1hhT/var/lib/git/docbuild/linux/Documentation/gpu/vgaarbiter:103: ./drivers/pci/vgaarb.chMhj ubh)}(h 0 on success, -ENODEV on failureh]h 0 on success, -ENODEV on failure}(hj>hhhNhNubah}(h]h ]h"]h$]h&]uh1hhT/var/lib/git/docbuild/linux/Documentation/gpu/vgaarbiter:103: ./drivers/pci/vgaarb.chMhj ubeh}(h]h ] kernelindentah"]h$]h&]uh1j$hjhhhNhNubeh}(h]in-kernel-interfaceah ]h"]in-kernel interfaceah$]h&]uh1hhhhhhhhKbubh)}(hhh](h)}(h libpciaccessh]h libpciaccess}(hj_hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj\hhhhhKkubh)}(hTo use the vga arbiter char device, an API was implemented inside the libpciaccess library. One field was added to struct pci_device (each device on the system)::h]hTo use the vga arbiter char device, an API was implemented inside the libpciaccess library. One field was added to struct pci_device (each device on the system):}(hjmhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKmhj\hhubh literal_block)}(hA/* the type of resource decoded by the device */ int vgaarb_rsrc;h]hA/* the type of resource decoded by the device */ int vgaarb_rsrc;}hj}sbah}(h]h ]h"]h$]h&]jjuh1j{hhhKqhj\hhubh)}(h&Besides it, in pci_system were added::h]h%Besides it, in pci_system were added:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKthj\hhubj|)}(h`int vgaarb_fd; int vga_count; struct pci_device *vga_target; struct pci_device *vga_default_dev;h]h`int vgaarb_fd; int vga_count; struct pci_device *vga_target; struct pci_device *vga_default_dev;}hjsbah}(h]h ]h"]h$]h&]jjuh1j{hhhKvhj\hhubh)}(hThe vga_count is used to track how many cards are being arbitrated, so for instance, if there is only one card, then it can completely escape arbitration.h]hThe vga_count is used to track how many cards are being arbitrated, so for instance, if there is only one card, then it can completely escape arbitration.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK{hj\hhubh)}(hXgThese functions below acquire VGA resources for the given card and mark those resources as locked. If the resources requested are "normal" (and not legacy) resources, the arbiter will first check whether the card is doing legacy decoding for that type of resource. If yes, the lock is "converted" into a legacy resource lock. The arbiter will first look for all VGA cards that might conflict and disable their IOs and/or Memory access, including VGA forwarding on P2P bridges if necessary, so that the requested resources can be used. Then, the card is marked as locking these resources and the IO and/or Memory access is enabled on the card (including VGA forwarding on parent P2P bridges if any). In the case of vga_arb_lock(), the function will block if some conflicting card is already locking one of the required resources (or any resource on a different bus segment, since P2P bridges don't differentiate VGA memory and IO afaik). If the card already owns the resources, the function succeeds. vga_arb_trylock() will return (-EBUSY) instead of blocking. Nested calls are supported (a per-resource counter is maintained).h]hXqThese functions below acquire VGA resources for the given card and mark those resources as locked. If the resources requested are “normal” (and not legacy) resources, the arbiter will first check whether the card is doing legacy decoding for that type of resource. If yes, the lock is “converted” into a legacy resource lock. The arbiter will first look for all VGA cards that might conflict and disable their IOs and/or Memory access, including VGA forwarding on P2P bridges if necessary, so that the requested resources can be used. Then, the card is marked as locking these resources and the IO and/or Memory access is enabled on the card (including VGA forwarding on parent P2P bridges if any). In the case of vga_arb_lock(), the function will block if some conflicting card is already locking one of the required resources (or any resource on a different bus segment, since P2P bridges don’t differentiate VGA memory and IO afaik). If the card already owns the resources, the function succeeds. vga_arb_trylock() will return (-EBUSY) instead of blocking. Nested calls are supported (a per-resource counter is maintained).}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK~hj\hhubh)}(h(Set the target device of this client. ::h]h%Set the target device of this client.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj\hhubj|)}(h=int pci_device_vgaarb_set_target (struct pci_device *dev);h]h=int pci_device_vgaarb_set_target (struct pci_device *dev);}hjsbah}(h]h ]h"]h$]h&]jjuh1j{hhhKhj\hhubh)}(hFor instance, in x86 if two devices on the same bus want to lock different resources, both will succeed (lock). If devices are in different buses and trying to lock different resources, only the first who tried succeeds. ::h]hFor instance, in x86 if two devices on the same bus want to lock different resources, both will succeed (lock). If devices are in different buses and trying to lock different resources, only the first who tried succeeds.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj\hhubj|)}(hWint pci_device_vgaarb_lock (void); int pci_device_vgaarb_trylock (void);h]hWint pci_device_vgaarb_lock (void); int pci_device_vgaarb_trylock (void);}hjsbah}(h]h ]h"]h$]h&]jjuh1j{hhhKhj\hhubh)}(hUnlock resources of device. ::h]hUnlock resources of device.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj\hhubj|)}(h+int pci_device_vgaarb_unlock (void);h]h+int pci_device_vgaarb_unlock (void);}hj sbah}(h]h ]h"]h$]h&]jjuh1j{hhhKhj\hhubh)}(hXDIndicates to the arbiter if the card decodes legacy VGA IOs, legacy VGA Memory, both, or none. All cards default to both, the card driver (fbdev for example) should tell the arbiter if it has disabled legacy decoding, so the card can be left out of the arbitration process (and can be safe to take interrupts at any time. ::h]hXAIndicates to the arbiter if the card decodes legacy VGA IOs, legacy VGA Memory, both, or none. All cards default to both, the card driver (fbdev for example) should tell the arbiter if it has disabled legacy decoding, so the card can be left out of the arbitration process (and can be safe to take interrupts at any time.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj\hhubj|)}(h:int pci_device_vgaarb_decodes (int new_vgaarb_rsrc);h]h:int pci_device_vgaarb_decodes (int new_vgaarb_rsrc);}hj%sbah}(h]h ]h"]h$]h&]jjuh1j{hhhKhj\hhubh)}(h7Connects to the arbiter device, allocates the struct ::h]h4Connects to the arbiter device, allocates the struct}(hj3hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj\hhubj|)}(h+int pci_device_vgaarb_init (void);h]h+int pci_device_vgaarb_init (void);}hjAsbah}(h]h ]h"]h$]h&]jjuh1j{hhhKhj\hhubh)}(hClose the connection ::h]hClose the connection}(hjOhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj\hhubj|)}(h+void pci_device_vgaarb_fini (void);h]h+void pci_device_vgaarb_fini (void);}hj]sbah}(h]h ]h"]h$]h&]jjuh1j{hhhKhj\hhubeh}(h] libpciaccessah ]h"] libpciaccessah$]h&]uh1hhhhhhhhKkubh)}(hhh](h)}(h(xf86VGAArbiter (X server implementation)h]h(xf86VGAArbiter (X server implementation)}(hjvhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjshhhhhKubh)}(hLX server basically wraps all the functions that touch VGA registers somehow.h]hLX server basically wraps all the functions that touch VGA registers somehow.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjshhubeh}(h]&xf86vgaarbiter-x-server-implementationah ]h"](xf86vgaarbiter (x server implementation)ah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(h Referencesh]h References}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(hXBenjamin Herrenschmidt (IBM?) started this work when he discussed such design with the Xorg community in 2005 [1, 2]. In the end of 2007, Paulo Zanoni and Tiago Vignatti (both of C3SL/Federal University of Paraná) proceeded his work enhancing the kernel code to adapt as a kernel module and also did the implementation of the user space side [3]. Now (2009) Tiago Vignatti and Dave Airlie finally put this work in shape and queued to Jesse Barnes' PCI tree.h]hXBenjamin Herrenschmidt (IBM?) started this work when he discussed such design with the Xorg community in 2005 [1, 2]. In the end of 2007, Paulo Zanoni and Tiago Vignatti (both of C3SL/Federal University of Paraná) proceeded his work enhancing the kernel code to adapt as a kernel module and also did the implementation of the user space side [3]. Now (2009) Tiago Vignatti and Dave Airlie finally put this work in shape and queued to Jesse Barnes’ PCI tree.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubhenumerated_list)}(hhh](h list_item)}(h]https://cgit.freedesktop.org/xorg/xserver/commit/?id=4b42448a2388d40f257774fbffdccaea87bd0347h]h)}(hjh]h reference)}(hjh]h]https://cgit.freedesktop.org/xorg/xserver/commit/?id=4b42448a2388d40f257774fbffdccaea87bd0347}(hjhhhNhNubah}(h]h ]h"]h$]h&]refurijuh1jhjubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubj)}(hBhttps://lists.freedesktop.org/archives/xorg/2005-March/006663.htmlh]h)}(hjh]j)}(hjh]hBhttps://lists.freedesktop.org/archives/xorg/2005-March/006663.html}(hjhhhNhNubah}(h]h ]h"]h$]h&]refurijuh1jhjubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubj)}(hBhttps://lists.freedesktop.org/archives/xorg/2005-March/006745.htmlh]h)}(hjh]j)}(hjh]hBhttps://lists.freedesktop.org/archives/xorg/2005-March/006745.html}(hj hhhNhNubah}(h]h ]h"]h$]h&]refurijuh1jhjubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubj)}(hDhttps://lists.freedesktop.org/archives/xorg/2007-October/029507.htmlh]h)}(hj'h]j)}(hj'h]hDhttps://lists.freedesktop.org/archives/xorg/2007-October/029507.html}(hj,hhhNhNubah}(h]h ]h"]h$]h&]refurij'uh1jhj)ubah}(h]h ]h"]h$]h&]uh1hhhhKhj%ubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubeh}(h]h ]h"]h$]h&]enumtypearabicprefixhsuffixjstartKuh1jhjhhhhhKubeh}(h] referencesah ]h"] referencesah$]h&]uh1hhhhhhhhKubeh}(h] vga-arbiterah ]h"] vga arbiterah$]h&]uh1hhhhhhhhKubeh}(h]h ]h"]h$]h&]sourcehuh1hcurrent_sourceN current_lineNsettingsdocutils.frontendValues)}(hN generatorN datestampN source_linkN source_urlN toc_backlinksentryfootnote_backlinksK sectnum_xformKstrip_commentsNstrip_elements_with_classesN strip_classesN report_levelK halt_levelKexit_status_levelKdebugNwarning_streamN tracebackinput_encoding utf-8-siginput_encoding_error_handlerstrictoutput_encodingutf-8output_encoding_error_handlerjerror_encodingutf-8error_encoding_error_handlerbackslashreplace language_codeenrecord_dependenciesNconfigN id_prefixhauto_id_prefixid dump_settingsNdump_internalsNdump_transformsNdump_pseudo_xmlNexpose_internalsNstrict_visitorN_disable_configN_sourcehʌ _destinationN _config_files]7/var/lib/git/docbuild/linux/Documentation/docutils.confafile_insertion_enabled raw_enabledKline_length_limitM'pep_referencesN pep_base_urlhttps://peps.python.org/pep_file_url_templatepep-%04drfc_referencesN rfc_base_url&https://datatracker.ietf.org/doc/html/ tab_widthKtrim_footnote_reference_spacesyntax_highlightlong smart_quotessmartquotes_locales]character_level_inline_markupdoctitle_xform docinfo_xformKsectsubtitle_xform image_loadinglinkembed_stylesheetcloak_email_addressessection_self_linkenvNubreporterNindirect_targets]substitution_defs}substitution_names}refnames}refids}nameids}(j^j[jjjYjVjpjmjjjVjSu nametypes}(j^jjYjpjjVuh}(j[hjhjVjjjj jj$j)j j j j j j jjjjjmj\jjsjSju footnote_refs} citation_refs} autofootnotes]autofootnote_refs]symbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}Rparse_messages]hsystem_message)}(hhh]h)}(h:Enumerated list start value not ordinal-1: "0" (ordinal 0)h]h>Enumerated list start value not ordinal-1: “0” (ordinal 0)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]levelKtypeINFOsourcehʌlineKuh1jhjhhhhhKubatransform_messages] transformerN include_log] decorationNhhub.