summaryrefslogtreecommitdiff
path: root/hw/pci/pcie_port.c
diff options
context:
space:
mode:
authorAlex Williamson <alex.williamson@redhat.com>2013-03-03 10:21:32 -0700
committerMichael S. Tsirkin <mst@redhat.com>2013-03-26 21:02:17 +0200
commitba7d8515c1e929baccea9f53d06d131fd2b007a1 (patch)
tree9a1115a50f7eb6c5a87ece47075eb79ca9c78a2f /hw/pci/pcie_port.c
parente01fd687185444944b0b5b0f8c739ae4b33eb029 (diff)
downloadqemu-ba7d8515c1e929baccea9f53d06d131fd2b007a1.tar.gz
pci: Teach PCI Bridges about VGA routing
Each PCI Bridge has a set of implied VGA regions that are enabled when the VGA bit is set in the bridge control register. This allows VGA devices behind bridges. Unfortunately with VGA Enable, which we formerly allowed but didn't back, comes along some required VGA baggage. VGA Palette Snooping is required, along with VGA 16-bit decoding. We don't yet have support for palette snooping. We also don't have support for 10-bit VGA aliases, the default mode, but we enable the register, even on root ports, to avoid confusing guests. Fortunately there's likely nothing from this century that requires these features, so the missing bits are noted with TODOs. Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/pci/pcie_port.c')
-rw-r--r--hw/pci/pcie_port.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/hw/pci/pcie_port.c b/hw/pci/pcie_port.c
index 33a6b0a08a..1be107b0c9 100644
--- a/hw/pci/pcie_port.c
+++ b/hw/pci/pcie_port.c
@@ -28,10 +28,12 @@ void pcie_port_init_reg(PCIDevice *d)
pci_set_word(d->config + PCI_SEC_STATUS, 0);
/* Unlike conventional pci bridge, some bits are hardwired to 0. */
+#define PCI_BRIDGE_CTL_VGA_16BIT 0x10 /* VGA 16-bit decode */
pci_set_word(d->wmask + PCI_BRIDGE_CONTROL,
PCI_BRIDGE_CTL_PARITY |
PCI_BRIDGE_CTL_ISA |
PCI_BRIDGE_CTL_VGA |
+ PCI_BRIDGE_CTL_VGA_16BIT | /* Req, but no alias support yet */
PCI_BRIDGE_CTL_SERR |
PCI_BRIDGE_CTL_BUS_RESET);
}