aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/vgaarb.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/vgaarb.h')
-rw-r--r--include/linux/vgaarb.h38
1 files changed, 35 insertions, 3 deletions
diff --git a/include/linux/vgaarb.h b/include/linux/vgaarb.h
index 2dfaa293ae8c..e9e1524b582c 100644
--- a/include/linux/vgaarb.h
+++ b/include/linux/vgaarb.h
@@ -5,11 +5,32 @@
5 * (C) Copyright 2005 Benjamin Herrenschmidt <benh@kernel.crashing.org> 5 * (C) Copyright 2005 Benjamin Herrenschmidt <benh@kernel.crashing.org>
6 * (C) Copyright 2007 Paulo R. Zanoni <przanoni@gmail.com> 6 * (C) Copyright 2007 Paulo R. Zanoni <przanoni@gmail.com>
7 * (C) Copyright 2007, 2009 Tiago Vignatti <vignatti@freedesktop.org> 7 * (C) Copyright 2007, 2009 Tiago Vignatti <vignatti@freedesktop.org>
8 *
9 * Permission is hereby granted, free of charge, to any person obtaining a
10 * copy of this software and associated documentation files (the "Software"),
11 * to deal in the Software without restriction, including without limitation
12 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
13 * and/or sell copies of the Software, and to permit persons to whom the
14 * Software is furnished to do so, subject to the following conditions:
15 *
16 * The above copyright notice and this permission notice (including the next
17 * paragraph) shall be included in all copies or substantial portions of the
18 * Software.
19 *
20 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
25 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
26 * DEALINGS
27 * IN THE SOFTWARE.
28 *
8 */ 29 */
9 30
10#ifndef LINUX_VGA_H 31#ifndef LINUX_VGA_H
32#define LINUX_VGA_H
11 33
12#include <asm/vga.h>
13 34
14/* Legacy VGA regions */ 35/* Legacy VGA regions */
15#define VGA_RSRC_NONE 0x00 36#define VGA_RSRC_NONE 0x00
@@ -72,8 +93,11 @@ extern void vga_set_legacy_decoding(struct pci_dev *pdev,
72 * Nested calls are supported (a per-resource counter is maintained) 93 * Nested calls are supported (a per-resource counter is maintained)
73 */ 94 */
74 95
75extern int vga_get(struct pci_dev *pdev, unsigned int rsrc, 96#if defined(CONFIG_VGA_ARB)
76 int interruptible); 97extern int vga_get(struct pci_dev *pdev, unsigned int rsrc, int interruptible);
98#else
99static inline int vga_get(struct pci_dev *pdev, unsigned int rsrc, int interruptible) { return 0; }
100#endif
77 101
78/** 102/**
79 * vga_get_interruptible 103 * vga_get_interruptible
@@ -110,7 +134,11 @@ static inline int vga_get_uninterruptible(struct pci_dev *pdev,
110 * are already locked by another card. It can be called in any context 134 * are already locked by another card. It can be called in any context
111 */ 135 */
112 136
137#if defined(CONFIG_VGA_ARB)
113extern int vga_tryget(struct pci_dev *pdev, unsigned int rsrc); 138extern int vga_tryget(struct pci_dev *pdev, unsigned int rsrc);
139#else
140static inline int vga_tryget(struct pci_dev *pdev, unsigned int rsrc) { return 0; }
141#endif
114 142
115/** 143/**
116 * vga_put - release lock on legacy VGA resources 144 * vga_put - release lock on legacy VGA resources
@@ -125,7 +153,11 @@ extern int vga_tryget(struct pci_dev *pdev, unsigned int rsrc);
125 * released if the counter reaches 0. 153 * released if the counter reaches 0.
126 */ 154 */
127 155
156#if defined(CONFIG_VGA_ARB)
128extern void vga_put(struct pci_dev *pdev, unsigned int rsrc); 157extern void vga_put(struct pci_dev *pdev, unsigned int rsrc);
158#else
159#define vga_put(pdev, rsrc)
160#endif
129 161
130 162
131/** 163/**