sphinx.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]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}(hjohhhNhNubah}(h]h ]h"]h$]h&]uh1j hhhK5hjkubj)}(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*hj}ubh)}(hG",decodes=,owns=,locks= (ic,mc)"h]hK“,decodes=,owns=,locks= (ic,mc)”}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK,hj}ubh)}(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.hj}ubeh}(h]h ]h"]h$]h&]uh1jhjkubeh}(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 hhhKOhjubj)}(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:hjubj)}(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&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhK:hjubj)}(hHlock acquires locks on target ("none" is an invalid io_state)h](j)}(hlock h]hlock }(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j hhhK non-blocking acquire locks on target (returns EBUSY if unsuccessful)h](j)}(htrylock h]htrylock }(hj>hhhNhNubah}(h]h ]h"]h$]h&]uh1j hhhK?hj:ubj)}(hhh]h)}(hDnon-blocking acquire locks on target (returns EBUSY if unsuccessful)h]hDnon-blocking acquire locks on target (returns EBUSY if unsuccessful)}(hjOhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK?hjLubah}(h]h ]h"]h$]h&]uh1jhj:ubeh}(h]h ]h"]h$]h&]uh1jhhhK?hjubj)}(h)unlock release locks on targeth](j)}(hunlock h]hunlock }(hjmhhhNhNubah}(h]h ]h"]h$]h&]uh1j hhhKAhjiubj)}(hhh]h)}(hrelease locks on targeth]hrelease locks on target}(hj~hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKBhj{ubah}(h]h ]h"]h$]h&]uh1jhjiubeh}(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 hhhKDhjubj)}(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&]uh1jhjubeh}(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 hhhKGhjubj)}(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&]uh1jhjubeh}(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 hhhKJhjubj)}(hhh]h)}(hmodnameN classnameNjKjN)}jQ]jT)}jGvga_default_devicesbc.vga_default_deviceasbuh1hhjhhhj*hKubj)}(h h]h }(hj]hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjhhhj*hKubjh)}(hjkh]h*}(hjkhhhNhNubah}(h]h ]jtah"]h$]h&]uh1jghjhhhj*hKubj)}(hvga_default_deviceh]j)}(hjZh]hvga_default_device}(hj|hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjxubah}(h]h ](jjeh"]h$]h&]jjuh1jhjhhhj*hKubj)}(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&]jjuh1jhjhhhj*hKubeh}(h]h ]h"]h$]h&]jjjuh1jjjhjhhhj*hKubah}(h]jah ](jjeh"]h$]h&]jj)jhuh1jhj*hKhjhhubj)}(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&]uh1jhjhhhj*hKubeh}(h]h ](jEfunctioneh"]h$]h&]j jEj jj jj jjuh1jhhhjhNhNubj)}(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&]uh1jhjubah}(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]j<)}(hj h]hvoid}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j;hj ubah}(h]h ]h"]h$]h&]uh1j hT/var/lib/git/docbuild/linux/Documentation/gpu/vgaarbiter:103: ./drivers/pci/vgaarb.chK|hjubj)}(hhh]h)}(h no argumentsh]h no arguments}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hK|hj ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhj hK|hjubah}(h]h ]h"]h$]h&]uh1jhjubh)}(h**Description**h]j)}(hj= h]h Description}(hj? hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj; ubah}(h]h ]h"]h$]h&]uh1hhT/var/lib/git/docbuild/linux/Documentation/gpu/vgaarbiter:103: ./drivers/pci/vgaarb.chK~hjubh)}(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.}(hjS 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().}(hjb 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&]uh1jhjhhhNhNubj)}(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)}(hjh]hstruct}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj 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&] refdomainjEreftypejG reftargetj modnameN classnameNjKjN)}jQ]jT)}jGj sbc.vga_remove_vgaconasbuh1hhj ubj)}(h h]h }(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubjh)}(hjkh]h*}(hj hhhNhNubah}(h]h ]jtah"]h$]h&]uh1jghj 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&]jj)jhuh1jhj hKhj hhubj)}(hhh]h)}(hdeactivate VGA consoleh]hdeactivate VGA console}(hjQ hhhNhNubah}(h]h ]h"]h$]h&]uh1hhT/var/lib/git/docbuild/linux/Documentation/gpu/vgaarbiter:103: ./drivers/pci/vgaarb.chKhjN hhubah}(h]h ]h"]h$]h&]uh1jhj hhhj hKubeh}(h]h ](jEfunctioneh"]h$]h&]j jEj ji j ji j jjuh1jhhhjhNhNubj)}(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)}(hjs h]h Parameters}(hju hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjq ubah}(h]h ]h"]h$]h&]uh1hhT/var/lib/git/docbuild/linux/Documentation/gpu/vgaarbiter:103: ./drivers/pci/vgaarb.chKhjm ubj)}(hhh]j)}(h%``struct pci_dev *pdev`` PCI device. h](j)}(h``struct pci_dev *pdev``h]j<)}(hj h]hstruct pci_dev *pdev}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j;hj ubah}(h]h ]h"]h$]h&]uh1j hT/var/lib/git/docbuild/linux/Documentation/gpu/vgaarbiter:103: ./drivers/pci/vgaarb.chKhj ubj)}(hhh]h)}(h PCI device.h]h PCI device.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hKhj ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jhj hKhj ubah}(h]h ]h"]h$]h&]uh1jhjm ubh)}(h**Description**h]j)}(hj h]h Description}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1hhT/var/lib/git/docbuild/linux/Documentation/gpu/vgaarbiter:103: ./drivers/pci/vgaarb.chKhjm 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.chKhjm ubeh}(h]h ] kernelindentah"]h$]h&]uh1jhjhhhNhNubj)}(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 }(hj! hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj hhhj hMubj)}(hvga_geth]j)}(hvga_geth]hvga_get}(hj3 hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj/ ubah}(h]h ](jjeh"]h$]h&]jjuh1jhj hhhj hMubj)}(h<(struct pci_dev *pdev, unsigned int rsrc, int interruptible)h](j )}(hstruct pci_dev *pdevh](j)}(hjh]hstruct}(hjO hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjK ubj)}(h h]h }(hj\ hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjK ubh)}(hhh]j)}(hpci_devh]hpci_dev}(hjm hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjj ubah}(h]h ]h"]h$]h&] refdomainjEreftypejG reftargetjo modnameN classnameNjKjN)}jQ]jT)}jGj5 sb c.vga_getasbuh1hhjK ubj)}(h h]h }(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjK ubjh)}(hjkh]h*}(hj hhhNhNubah}(h]h ]jtah"]h$]h&]uh1jghjK ubj)}(hpdevh]hpdev}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjK ubeh}(h]h ]h"]h$]h&]noemphjjuh1jhjG 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&]noemphjjuh1jhjG ubj )}(hint interruptibleh](j)}(hinth]hint}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubj)}(h h]h }(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubj)}(h interruptibleh]h interruptible}(hj. hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]noemphjjuh1jhjG ubeh}(h]h ]h"]h$]h&]jjuh1jhj hhhj hMubeh}(h]h ]h"]h$]h&]jjjuh1jjjhj hhhj hMubah}(h]j ah ](jjeh"]h$]h&]jj)jhuh1jhj hMhj hhubj)}(hhh]h)}(hacquire & lock VGA resourcesh]hacquire & lock VGA resources}(hjX hhhNhNubah}(h]h ]h"]h$]h&]uh1hhT/var/lib/git/docbuild/linux/Documentation/gpu/vgaarbiter:103: ./drivers/pci/vgaarb.chMhjU hhubah}(h]h ]h"]h$]h&]uh1jhj hhhj hMubeh}(h]h ](jEfunctioneh"]h$]h&]j jEj jp j jp j jjuh1jhhhjhNhNubj)}(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. **Return**h](h)}(h**Parameters**h]j)}(hjz h]h Parameters}(hj| hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjx ubah}(h]h ]h"]h$]h&]uh1hhT/var/lib/git/docbuild/linux/Documentation/gpu/vgaarbiter:103: ./drivers/pci/vgaarb.chMhjt 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]j<)}(hj h]hstruct pci_dev *pdev}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j;hj ubah}(h]h ]h"]h$]h&]uh1j hT/var/lib/git/docbuild/linux/Documentation/gpu/vgaarbiter:103: ./drivers/pci/vgaarb.chMhj ubj)}(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&]uh1jhj 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]j<)}(hj h]hunsigned int rsrc}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j;hj ubah}(h]h ]h"]h$]h&]uh1j hT/var/lib/git/docbuild/linux/Documentation/gpu/vgaarbiter:103: ./drivers/pci/vgaarb.chMhj ubj)}(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&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jhj hMhj ubj)}(hD``int interruptible`` blocking should be interruptible by signals ? h](j)}(h``int interruptible``h]j<)}(hj h]hint interruptible}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j;hj ubah}(h]h ]h"]h$]h&]uh1j hT/var/lib/git/docbuild/linux/Documentation/gpu/vgaarbiter:103: ./drivers/pci/vgaarb.chMhj ubj)}(hhh]h)}(h-blocking should be interruptible by signals ?h]h-blocking should be interruptible by signals ?}(hj$ hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hMhj! ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jhj hMhj ubeh}(h]h ]h"]h$]h&]uh1jhjt ubh)}(h**Description**h]j)}(hjF h]h Description}(hjH hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjD ubah}(h]h ]h"]h$]h&]uh1hhT/var/lib/git/docbuild/linux/Documentation/gpu/vgaarbiter:103: ./drivers/pci/vgaarb.chMhjt 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.}(hj\ hhhNhNubah}(h]h ]h"]h$]h&]uh1hhT/var/lib/git/docbuild/linux/Documentation/gpu/vgaarbiter:103: ./drivers/pci/vgaarb.chMhjt 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).}(hjk hhhNhNubah}(h]h ]h"]h$]h&]uh1hhT/var/lib/git/docbuild/linux/Documentation/gpu/vgaarbiter:103: ./drivers/pci/vgaarb.chMhjt 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.}(hjz hhhNhNubah}(h]h ]h"]h$]h&]uh1hhT/var/lib/git/docbuild/linux/Documentation/gpu/vgaarbiter:103: ./drivers/pci/vgaarb.chMhjt 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.chMhjt 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.chMhjt 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.chMhjt ubh)}(h **Return**h]j)}(hj h]hReturn}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1hhT/var/lib/git/docbuild/linux/Documentation/gpu/vgaarbiter:103: ./drivers/pci/vgaarb.chMhjt ubeh}(h]h ] kernelindentah"]h$]h&]uh1jhjhhhNhNubj)}(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}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubah}(h]h ](jjeh"]h$]h&]jjuh1jhj hhhj hMubj)}(h)(struct pci_dev *pdev, unsigned int rsrc)h](j )}(hstruct pci_dev *pdevh](j)}(hjh]hstruct}(hj+hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj'ubj)}(h h]h }(hj8hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj'ubh)}(hhh]j)}(hpci_devh]hpci_dev}(hjIhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjFubah}(h]h ]h"]h$]h&] refdomainjEreftypejG reftargetjKmodnameN classnameNjKjN)}jQ]jT)}jGjsb c.vga_putasbuh1hhj'ubj)}(h h]h }(hjihhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj'ubjh)}(hjkh]h*}(hjwhhhNhNubah}(h]h ]jtah"]h$]h&]uh1jghj'ubj)}(hpdevh]hpdev}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj'ubeh}(h]h ]h"]h$]h&]noemphjjuh1jhj#ubj )}(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&]noemphjjuh1jhj#ubeh}(h]h ]h"]h$]h&]jjuh1jhj hhhj hMubeh}(h]h ]h"]h$]h&]jjjuh1jjjhj hhhj hMubah}(h]j ah ](jjeh"]h$]h&]jj)jhuh1jhj 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&]uh1jhj hhhj hMubeh}(h]h ](jEfunctioneh"]h$]h&]j jEj jj jj jjuh1jhhhjhNhNubj)}(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)}(hj!h]h Parameters}(hj#hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(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]j<)}(hj@h]hstruct pci_dev *pdev}(hjBhhhNhNubah}(h]h ]h"]h$]h&]uh1j;hj>ubah}(h]h ]h"]h$]h&]uh1j hT/var/lib/git/docbuild/linux/Documentation/gpu/vgaarbiter:103: ./drivers/pci/vgaarb.chMhj:ubj)}(hhh]h)}(h1PCI device of VGA card or NULL for system defaulth]h1PCI device of VGA card or NULL for system default}(hjYhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjUhMhjVubah}(h]h ]h"]h$]h&]uh1jhj:ubeh}(h]h ]h"]h$]h&]uh1jhjUhMhj7ubj)}(h6``unsigned int rsrc`` bit mask of resource to release h](j)}(h``unsigned int rsrc``h]j<)}(hjyh]hunsigned int rsrc}(hj{hhhNhNubah}(h]h ]h"]h$]h&]uh1j;hjwubah}(h]h ]h"]h$]h&]uh1j hT/var/lib/git/docbuild/linux/Documentation/gpu/vgaarbiter:103: ./drivers/pci/vgaarb.chMhjsubj)}(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&]uh1jhjsubeh}(h]h ]h"]h$]h&]uh1jhjhMhj7ubeh}(h]h ]h"]h$]h&]uh1jhjubh)}(h**Description**h]j)}(hjh]h Description}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(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&]uh1jhjhhhNhNubj)}(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)}(hjh]hstruct}(hj6hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj2ubj)}(h h]h }(hjChhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj2ubh)}(hhh]j)}(hpci_devh]hpci_dev}(hjThhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjQubah}(h]h ]h"]h$]h&] refdomainjEreftypejG reftargetjVmodnameN classnameNjKjN)}jQ]jT)}jGjsbc.vga_set_legacy_decodingasbuh1hhj2ubj)}(h h]h }(hjthhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj2ubjh)}(hjkh]h*}(hjhhhNhNubah}(h]h ]jtah"]h$]h&]uh1jghj2ubj)}(hpdevh]hpdev}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj2ubeh}(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&]jj)jhuh1jhjhMhjhhubj)}(hhh]h}(h]h ]h"]h$]h&]uh1jhjhhhjhMubeh}(h]h ](jEfunctioneh"]h$]h&]j jEj jj jj jjuh1jhhhjhNhNubj)}(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&]uh1jhjubah}(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]j<)}(hj<h]hstruct pci_dev *pdev}(hj>hhhNhNubah}(h]h ]h"]h$]h&]uh1j;hj:ubah}(h]h ]h"]h$]h&]uh1j hT/var/lib/git/docbuild/linux/Documentation/gpu/vgaarbiter:103: ./drivers/pci/vgaarb.chMhj6ubj)}(hhh]h)}(hPCI device of the VGA cardh]hPCI device of the VGA card}(hjUhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjQhMhjRubah}(h]h ]h"]h$]h&]uh1jhj6ubeh}(h]h ]h"]h$]h&]uh1jhjQhMhj3ubj)}(hJ``unsigned int decodes`` bit mask of what legacy regions the card decodes h](j)}(h``unsigned int decodes``h]j<)}(hjuh]hunsigned int decodes}(hjwhhhNhNubah}(h]h ]h"]h$]h&]uh1j;hjsubah}(h]h ]h"]h$]h&]uh1j hT/var/lib/git/docbuild/linux/Documentation/gpu/vgaarbiter:103: ./drivers/pci/vgaarb.chMhjoubj)}(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&]uh1jhjoubeh}(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&]uh1jhjubah}(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&]uh1jhjhhhNhNubj)}(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]jHa)}(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)}(hjh]hstruct}(hj2hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj.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&] refdomainjEreftypejG reftargetjRmodnameN classnameNjKjN)}jQ]jT)}jGjsbc.vga_client_registerasbuh1hhj.ubj)}(h h]h }(hjphhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj.ubjh)}(hjkh]h*}(hj~hhhNhNubah}(h]h ]jtah"]h$]h&]uh1jghj.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&]uh1jhjubjh)}(h(h]h(}(hjhhhNhNubah}(h]h ]jtah"]h$]h&]uh1jghjubjh)}(hjkh]h*}(hjhhhNhNubah}(h]h ]jtah"]h$]h&]uh1jghjubj)}(h set_decodeh]h set_decode}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubjh)}(h)h]h)}(hjhhhNhNubah}(h]h ]jtah"]h$]h&]uh1jghjubjh)}(hjh]h(}(hjhhhNhNubah}(h]h ]jtah"]h$]h&]uh1jghjubj)}(hjh]hstruct}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(h h]h }(hj-hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubh)}(hhh]j)}(hpci_devh]hpci_dev}(hj>hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj;ubah}(h]h ]h"]h$]h&] refdomainjEreftypejG reftargetj@modnameN classnameNjKjN)}jQ]jlc.vga_client_registerasbuh1hhjubj)}(h h]h }(hj\hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubjh)}(hjkh]h*}(hjjhhhNhNubah}(h]h ]jtah"]h$]h&]uh1jghjubj)}(hpdevh]hpdev}(hjwhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubjh)}(h,h]h,}(hjhhhNhNubah}(h]h ]jtah"]h$]h&]uh1jghjubj)}(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&]uh1jhjubjh)}(hjh]h)}(hjhhhNhNubah}(h]h ]jtah"]h$]h&]uh1jghjubeh}(h]h ]h"]h$]h&]noemphjjuh1jhj*ubeh}(h]h ]h"]h$]h&]jjuh1jhjhhhjhMubeh}(h]h ]h"]h$]h&]jjjuh1jjjhjhhhjhMubah}(h]jah ](jjeh"]h$]h&]jj)jhuh1jhjhMhjhhubj)}(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&]uh1jhjhhhjhMubeh}(h]h ](jEfunctioneh"]h$]h&]j jEj j j j j jjuh1jhhhjhNhNubj)}(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&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hhT/var/lib/git/docbuild/linux/Documentation/gpu/vgaarbiter:103: ./drivers/pci/vgaarb.chMhjubj)}(hhh](j)}(h6``struct pci_dev *pdev`` PCI device of the VGA client h](j)}(h``struct pci_dev *pdev``h]j<)}(hj5h]hstruct pci_dev *pdev}(hj7hhhNhNubah}(h]h ]h"]h$]h&]uh1j;hj3ubah}(h]h ]h"]h$]h&]uh1j hT/var/lib/git/docbuild/linux/Documentation/gpu/vgaarbiter:103: ./drivers/pci/vgaarb.chMhj/ubj)}(hhh]h)}(hPCI device of the VGA clienth]hPCI device of the VGA client}(hjNhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjJhMhjKubah}(h]h ]h"]h$]h&]uh1jhj/ubeh}(h]h ]h"]h$]h&]uh1jhjJhMhj,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]j<)}(hjnh]h=unsigned int (*set_decode)(struct pci_dev *pdev, bool decode)}(hjphhhNhNubah}(h]h ]h"]h$]h&]uh1j;hjlubah}(h]h ]h"]h$]h&]uh1j hT/var/lib/git/docbuild/linux/Documentation/gpu/vgaarbiter:103: ./drivers/pci/vgaarb.chMhjhubj)}(hhh]h)}(hVGA decode change callbackh]hVGA decode change callback}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMhjubah}(h]h ]h"]h$]h&]uh1jhjhubeh}(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&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hhT/var/lib/git/docbuild/linux/Documentation/gpu/vgaarbiter:103: ./drivers/pci/vgaarb.chMhjubh)}(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.chMhjubh)}(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&]uh1jhjubhy 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.chMhjubh)}(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.chMhjubh)}(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&]uh1jhjubh has been registered already.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhT/var/lib/git/docbuild/linux/Documentation/gpu/vgaarbiter:103: ./drivers/pci/vgaarb.chMhjubh)}(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.chMhjubh)}(h **Return**h]j)}(hj,h]hReturn}(hj.hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj*ubah}(h]h ]h"]h$]h&]uh1hhT/var/lib/git/docbuild/linux/Documentation/gpu/vgaarbiter:103: ./drivers/pci/vgaarb.chMhjubh)}(h 0 on success, -ENODEV on failureh]h 0 on success, -ENODEV on failure}(hjBhhhNhNubah}(h]h ]h"]h$]h&]uh1hhT/var/lib/git/docbuild/linux/Documentation/gpu/vgaarbiter:103: ./drivers/pci/vgaarb.chMhjubeh}(h]h ] kernelindentah"]h$]h&]uh1jhjhhhNhNubeh}(h]in-kernel-interfaceah ]h"]in-kernel interfaceah$]h&]uh1hhhhhhhhKbubh)}(hhh](h)}(h libpciaccessh]h libpciaccess}(hjchhhNhNubah}(h]h ]h"]h$]h&]uh1hhj`hhhhhKkubh)}(hTo use the vga arbiter char device it was implemented an API 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 it was implemented an API inside the libpciaccess library. One field was added to struct pci_device (each device on the system):}(hjqhhhNhNubah}(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;}hjsbah}(h]h ]h"]h$]h&]jjuh1jhhhKqhj`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&]jjuh1jhhhKvhj`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&]jjuh1jhhhKhj`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&]jjuh1jhhhKhj`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&]jjuh1jhhhKhj`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&]jjuh1jhhhKhj`hhubh)}(h7Connects to the arbiter device, allocates the struct ::h]h4Connects to the arbiter device, allocates the struct}(hj7hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj`hhubj)}(h+int pci_device_vgaarb_init (void);h]h+int pci_device_vgaarb_init (void);}hjEsbah}(h]h ]h"]h$]h&]jjuh1jhhhKhj`hhubh)}(hClose the connection ::h]hClose the connection}(hjShhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj`hhubj)}(h+void pci_device_vgaarb_fini (void);h]h+void pci_device_vgaarb_fini (void);}hjasbah}(h]h ]h"]h$]h&]jjuh1jhhhKhj`hhubeh}(h] libpciaccessah ]h"] libpciaccessah$]h&]uh1hhhhhhhhKkubh)}(hhh](h)}(h(xf86VGAArbiter (X server implementation)h]h(xf86VGAArbiter (X server implementation)}(hjzhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjwhhhhhKubh)}(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&]uh1hhhhKhjwhhubeh}(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)}(hj h]j)}(hj h]hBhttps://lists.freedesktop.org/archives/xorg/2005-March/006745.html}(hjhhhNhNubah}(h]h ]h"]h$]h&]refurij uh1jhj ubah}(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}(hj0hhhNhNubah}(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}(jbj_jjj]jZjtjqjjjZjWu nametypes}(jbjj]jtjjZuh}(j_hjhjZjjjjjjjj j j j j j jjjjjqj`jjwjWju 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&]levelKtypeINFOsourcehlineKuh1jhjhhhhhKubatransform_messages] transformerN include_log] decorationNhhub.