summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2009-08-28 11:25:15 +1000
committerDave Airlie <airlied@redhat.com>2009-08-28 11:25:15 +1000
commit81b4705525bdf82d75f5b3c740c53fa4a866d9c3 (patch)
treeedd691618532ee88ba5b1b9053c7834eda51be35
parentf5148525d546015c12b703a768b5e6c3726446a3 (diff)
parent2f997f90c8d0b54baab85285703550e8df28325e (diff)
Merge branch 'vga'
-rw-r--r--src/Makefile.am2
-rw-r--r--src/common_vgaarb.c2
-rw-r--r--src/common_vgaarb_stub.c79
3 files changed, 82 insertions, 1 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index c7be653..0de6894 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -47,6 +47,8 @@ endif
if LINUX
VGA_ARBITER = common_vgaarb.c
+else
+VGA_ARBITER = common_vgaarb_stub.c
endif
libpciaccess_la_SOURCES = common_bridge.c \
diff --git a/src/common_vgaarb.c b/src/common_vgaarb.c
index b7ef021..a40b064 100644
--- a/src/common_vgaarb.c
+++ b/src/common_vgaarb.c
@@ -317,7 +317,7 @@ int pci_device_vgaarb_get_info(struct pci_device *dev, int *vga_count, int *rsrc
{
*vga_count = pci_sys->vga_count;
if (!dev)
- return -1;
+ return 0;
*rsrc_decodes = dev->vgaarb_rsrc;
return 0;
diff --git a/src/common_vgaarb_stub.c b/src/common_vgaarb_stub.c
new file mode 100644
index 0000000..764733b
--- /dev/null
+++ b/src/common_vgaarb_stub.c
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2009 Tiago Vignatti
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following
+ * conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+#include <stdio.h>
+#include "pciaccess.h"
+
+int
+pci_device_vgaarb_init(void)
+{
+#ifdef DEBUG
+ fprintf(stderr, "%s: You're using VGA arbiter stub functions!\n",
+ __FUNCTION__);
+#endif
+ return -1;
+}
+
+void
+pci_device_vgaarb_fini(void)
+{
+}
+
+int
+pci_device_vgaarb_set_target(struct pci_device *dev)
+{
+ return -1;
+}
+
+int
+pci_device_vgaarb_decodes(int new_vga_rsrc)
+{
+ return -1;
+}
+
+int
+pci_device_vgaarb_lock(void)
+{
+ return -1;
+}
+
+int
+pci_device_vgaarb_trylock(void)
+{
+ return -1;
+}
+
+int
+pci_device_vgaarb_unlock(void);
+{
+ return 0;
+}
+
+int pci_device_vgaarb_get_info(struct pci_device *dev, int *vga_count,
+ int *rsrc_decodes)
+{
+ return -1;
+}