diff options
author | marcel <marcel@FreeBSD.org> | 2005-04-29 02:15:40 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2005-04-29 02:15:40 +0000 |
commit | 6d5a555d4bd646f78dd7f873b483e88aa0941c18 (patch) | |
tree | bb45296c56dca11a70b8bcb5c37865f94519bd91 /sys/dev/pci/pci_pci.c | |
parent | 05efdf30cf2c5667b9a23d6d2a603926a3f03cec (diff) | |
download | FreeBSD-src-6d5a555d4bd646f78dd7f873b483e88aa0941c18.zip FreeBSD-src-6d5a555d4bd646f78dd7f873b483e88aa0941c18.tar.gz |
In pcib_alloc_resource() check if the resource allocation request is
for the VGA I/O or memory ranges, when it's not within the default
ranges decoded by the bridge. When allocation for VGA addresses is
attempted, check that the bridge has the VGA Enable bit set before
allowing it.
As such, newbusified VGA drivers can allocate their resources when
the VGA adapter is behind a PCI-to-PCI bridge.
Reviewed by: imp@, jhb@
Diffstat (limited to 'sys/dev/pci/pci_pci.c')
-rw-r--r-- | sys/dev/pci/pci_pci.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/sys/dev/pci/pci_pci.c b/sys/dev/pci/pci_pci.c index 130205c..9971420 100644 --- a/sys/dev/pci/pci_pci.c +++ b/sys/dev/pci/pci_pci.c @@ -313,6 +313,14 @@ pcib_alloc_resource(device_t dev, device_t child, int type, int *rid, if (!pcib_is_io_open(sc)) break; ok = (start >= sc->iobase && end <= sc->iolimit); + + /* + * Make sure we allow access to VGA I/O addresses when the + * bridge has the "VGA Enable" bit set. + */ + if (!ok && pci_is_vga_ioport_range(start, end)) + ok = (sc->bridgectl & PCIB_BCR_VGA_ENABLE) ? 1 : 0; + if ((sc->flags & PCIB_SUBTRACTIVE) == 0) { if (!ok) { if (start < sc->iobase) @@ -357,6 +365,14 @@ pcib_alloc_resource(device_t dev, device_t child, int type, int *rid, ok = ok || (start >= sc->membase && end <= sc->memlimit); if (pcib_is_prefetch_open(sc)) ok = ok || (start >= sc->pmembase && end <= sc->pmemlimit); + + /* + * Make sure we allow access to VGA memory addresses when the + * bridge has the "VGA Enable" bit set. + */ + if (!ok && pci_is_vga_memory_range(start, end)) + ok = (sc->bridgectl & PCIB_BCR_VGA_ENABLE) ? 1 : 0; + if ((sc->flags & PCIB_SUBTRACTIVE) == 0) { if (!ok) { ok = 1; |