~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/vgaarb.h

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: MIT */
  2 
  3 /*
  4  * The VGA aribiter manages VGA space routing and VGA resource decode to
  5  * allow multiple VGA devices to be used in a system in a safe way.
  6  *
  7  * (C) Copyright 2005 Benjamin Herrenschmidt <benh@kernel.crashing.org>
  8  * (C) Copyright 2007 Paulo R. Zanoni <przanoni@gmail.com>
  9  * (C) Copyright 2007, 2009 Tiago Vignatti <vignatti@freedesktop.org>
 10  */
 11 
 12 #ifndef LINUX_VGA_H
 13 #define LINUX_VGA_H
 14 
 15 #include <video/vga.h>
 16 
 17 struct pci_dev;
 18 
 19 /* Legacy VGA regions */
 20 #define VGA_RSRC_NONE          0x00
 21 #define VGA_RSRC_LEGACY_IO     0x01
 22 #define VGA_RSRC_LEGACY_MEM    0x02
 23 #define VGA_RSRC_LEGACY_MASK   (VGA_RSRC_LEGACY_IO | VGA_RSRC_LEGACY_MEM)
 24 /* Non-legacy access */
 25 #define VGA_RSRC_NORMAL_IO     0x04
 26 #define VGA_RSRC_NORMAL_MEM    0x08
 27 
 28 #ifdef CONFIG_VGA_ARB
 29 void vga_set_legacy_decoding(struct pci_dev *pdev, unsigned int decodes);
 30 int vga_get(struct pci_dev *pdev, unsigned int rsrc, int interruptible);
 31 void vga_put(struct pci_dev *pdev, unsigned int rsrc);
 32 struct pci_dev *vga_default_device(void);
 33 void vga_set_default_device(struct pci_dev *pdev);
 34 int vga_remove_vgacon(struct pci_dev *pdev);
 35 int vga_client_register(struct pci_dev *pdev,
 36                 unsigned int (*set_decode)(struct pci_dev *pdev, bool state));
 37 #else /* CONFIG_VGA_ARB */
 38 static inline void vga_set_legacy_decoding(struct pci_dev *pdev,
 39                 unsigned int decodes)
 40 {
 41 };
 42 static inline int vga_get(struct pci_dev *pdev, unsigned int rsrc,
 43                 int interruptible)
 44 {
 45         return 0;
 46 }
 47 static inline void vga_put(struct pci_dev *pdev, unsigned int rsrc)
 48 {
 49 }
 50 static inline struct pci_dev *vga_default_device(void)
 51 {
 52         return NULL;
 53 }
 54 static inline void vga_set_default_device(struct pci_dev *pdev)
 55 {
 56 }
 57 static inline int vga_remove_vgacon(struct pci_dev *pdev)
 58 {
 59         return 0;
 60 }
 61 static inline int vga_client_register(struct pci_dev *pdev,
 62                 unsigned int (*set_decode)(struct pci_dev *pdev, bool state))
 63 {
 64         return 0;
 65 }
 66 #endif /* CONFIG_VGA_ARB */
 67 
 68 /**
 69  * vga_get_interruptible
 70  * @pdev: pci device of the VGA card or NULL for the system default
 71  * @rsrc: bit mask of resources to acquire and lock
 72  *
 73  * Shortcut to vga_get with interruptible set to true.
 74  *
 75  * On success, release the VGA resource again with vga_put().
 76  */
 77 static inline int vga_get_interruptible(struct pci_dev *pdev,
 78                                         unsigned int rsrc)
 79 {
 80         return vga_get(pdev, rsrc, 1);
 81 }
 82 
 83 /**
 84  * vga_get_uninterruptible - shortcut to vga_get()
 85  * @pdev: pci device of the VGA card or NULL for the system default
 86  * @rsrc: bit mask of resources to acquire and lock
 87  *
 88  * Shortcut to vga_get with interruptible set to false.
 89  *
 90  * On success, release the VGA resource again with vga_put().
 91  */
 92 static inline int vga_get_uninterruptible(struct pci_dev *pdev,
 93                                           unsigned int rsrc)
 94 {
 95         return vga_get(pdev, rsrc, 0);
 96 }
 97 
 98 static inline void vga_client_unregister(struct pci_dev *pdev)
 99 {
100         vga_client_register(pdev, NULL);
101 }
102 
103 #endif /* LINUX_VGA_H */
104 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php