[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 03/12] pci: add a pci_vga_init() function
From: |
Aurelien Jarno |
Subject: |
[Qemu-devel] [PATCH 03/12] pci: add a pci_vga_init() function |
Date: |
Sat, 8 Sep 2012 13:26:15 +0200 |
This function create a PCI VGA device according to the value of
vga_interface_type. It returns a PCIDevice (and not a DeviceState).
Cc: Anthony Liguori <address@hidden>
Signed-off-by: Aurelien Jarno <address@hidden>
---
hw/pci.c | 18 ++++++++++++++++++
hw/pci.h | 3 +++
2 files changed, 21 insertions(+)
diff --git a/hw/pci.c b/hw/pci.c
index 4d95984..1b775b6 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -1474,6 +1474,24 @@ PCIDevice *pci_nic_init_nofail(NICInfo *nd, const char
*default_model,
return res;
}
+PCIDevice *pci_vga_init(PCIBus *bus)
+{
+ switch (vga_interface_type) {
+ case VGA_CIRRUS:
+ return pci_create_simple(bus, -1, "cirrus-vga");
+ case VGA_QXL:
+ return pci_create_simple(bus, -1, "qxl-vga");
+ case VGA_STD:
+ return pci_create_simple(bus, -1, "VGA");
+ case VGA_VMWARE:
+ return pci_create_simple(bus, -1, "vmware-svga");
+ case VGA_NONE:
+ default: /* Other non-PCI types. Checking for unsupported types is already
+ done in vl.c. */
+ return NULL;
+ }
+}
+
/* Whether a given bus number is in range of the secondary
* bus of the given bridge device. */
static bool pci_secondary_bus_in_range(PCIDevice *dev, int bus_num)
diff --git a/hw/pci.h b/hw/pci.h
index 4b6ab3d..84b43b2 100644
--- a/hw/pci.h
+++ b/hw/pci.h
@@ -334,6 +334,9 @@ PCIDevice *pci_nic_init(NICInfo *nd, const char
*default_model,
const char *default_devaddr);
PCIDevice *pci_nic_init_nofail(NICInfo *nd, const char *default_model,
const char *default_devaddr);
+
+PCIDevice *pci_vga_init(PCIBus *bus);
+
int pci_bus_num(PCIBus *s);
void pci_for_each_device(PCIBus *bus, int bus_num,
void (*fn)(PCIBus *bus, PCIDevice *d, void *opaque),
--
1.7.10.4
- [Qemu-devel] [PATCH 00/12] Rework PCI video card initialization, Aurelien Jarno, 2012/09/08
- [Qemu-devel] [PATCH 02/12] vl.c: check for qxl availability, Aurelien Jarno, 2012/09/08
- [Qemu-devel] [PATCH 09/12] ppc/pSeries: use the new pci_vga_init() function, Aurelien Jarno, 2012/09/08
- [Qemu-devel] [PATCH 03/12] pci: add a pci_vga_init() function,
Aurelien Jarno <=
- [Qemu-devel] [PATCH 08/12] ppc/prep: use the new pci_vga_init() function, Aurelien Jarno, 2012/09/08
- [Qemu-devel] [PATCH 11/12] pc: use the new pci_vga_init() function, Aurelien Jarno, 2012/09/08
- [Qemu-devel] [PATCH 06/12] ppc/newworld: use the new pci_vga_init() function, Aurelien Jarno, 2012/09/08
- [Qemu-devel] [PATCH 01/12] vga: rename pci_vga_init() into pci_std_vga_init(), Aurelien Jarno, 2012/09/08
- [Qemu-devel] [PATCH 04/12] mips/malta: use the new pci_vga_init() function, Aurelien Jarno, 2012/09/08
- [Qemu-devel] [PATCH 05/12] alpha: use the new pci_vga_init() function, Aurelien Jarno, 2012/09/08