summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg
diff options
context:
space:
mode:
authorRuiyu Ni <ruiyu.ni@intel.com>2018-08-23 10:50:16 +0800
committerRuiyu Ni <ruiyu.ni@intel.com>2018-08-27 09:40:22 +0800
commit983f5abb9a0d6cf9cfb5e16d671f15e5dc7510d8 (patch)
treeba17cc103629c3da56d86e9c873ec84ca8ee1479 /MdeModulePkg
parent06da1e310bcea971073a8dabc5c3d35bc190847c (diff)
downloadedk2-983f5abb9a0d6cf9cfb5e16d671f15e5dc7510d8.tar.gz
edk2-983f5abb9a0d6cf9cfb5e16d671f15e5dc7510d8.tar.bz2
edk2-983f5abb9a0d6cf9cfb5e16d671f15e5dc7510d8.zip
MdeModulePkg/PciBus: Restrict one VGA per HostBridge not Segment
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1109 Today's restriction of VGA device is to have only one VGA device enabled per PCI segment. It's not correct because several segments may share one IO / MMIO address space. We should restrict to have one VGA per Host Bridge because each Host Bridge has its only IO / MMIO address space. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
Diffstat (limited to 'MdeModulePkg')
-rw-r--r--MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c22
-rw-r--r--MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.h10
-rw-r--r--MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.c8
3 files changed, 20 insertions, 20 deletions
diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c
index 5a4b830604..ab791541c3 100644
--- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c
+++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c
@@ -979,33 +979,33 @@ PciDeviceExisted (
}
/**
- Get the active VGA device on the same segment.
+ Get the active VGA device on the specified Host Bridge.
- @param VgaDevice PCI IO instance for the VGA device.
+ @param HostBridgeHandle Host Bridge handle.
- @return The active VGA device on the same segment.
+ @return The active VGA device on the specified Host Bridge.
**/
PCI_IO_DEVICE *
-ActiveVGADeviceOnTheSameSegment (
- IN PCI_IO_DEVICE *VgaDevice
+LocateVgaDeviceOnHostBridge (
+ IN EFI_HANDLE HostBridgeHandle
)
{
LIST_ENTRY *CurrentLink;
- PCI_IO_DEVICE *Temp;
+ PCI_IO_DEVICE *PciIoDevice;
CurrentLink = mPciDevicePool.ForwardLink;
while (CurrentLink != NULL && CurrentLink != &mPciDevicePool) {
- Temp = PCI_IO_DEVICE_FROM_LINK (CurrentLink);
+ PciIoDevice = PCI_IO_DEVICE_FROM_LINK (CurrentLink);
- if (Temp->PciRootBridgeIo->SegmentNumber == VgaDevice->PciRootBridgeIo->SegmentNumber) {
+ if (PciIoDevice->PciRootBridgeIo->ParentHandle== HostBridgeHandle) {
- Temp = LocateVgaDevice (Temp);
+ PciIoDevice = LocateVgaDevice (PciIoDevice);
- if (Temp != NULL) {
- return Temp;
+ if (PciIoDevice != NULL) {
+ return PciIoDevice;
}
}
diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.h b/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.h
index 1ec2178a21..b45d2a5d77 100644
--- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.h
+++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.h
@@ -230,16 +230,16 @@ PciDeviceExisted (
);
/**
- Get the active VGA device on the same segment.
+ Get the active VGA device on the specified Host Bridge.
- @param VgaDevice PCI IO instance for the VGA device.
+ @param HostBridgeHandle Host Bridge handle.
- @return The active VGA device on the same segment.
+ @return The active VGA device on the specified Host Bridge.
**/
PCI_IO_DEVICE *
-ActiveVGADeviceOnTheSameSegment (
- IN PCI_IO_DEVICE *VgaDevice
+LocateVgaDeviceOnHostBridge (
+ IN EFI_HANDLE HostBridgeHandle
);
/**
diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.c
index 291578c63c..2a4f66a01a 100644
--- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.c
+++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.c
@@ -1413,9 +1413,9 @@ SupportPaletteSnoopAttributes (
}
//
- // Get the boot VGA on the same segement
+ // Get the boot VGA on the same Host Bridge
//
- Temp = ActiveVGADeviceOnTheSameSegment (PciIoDevice);
+ Temp = LocateVgaDeviceOnHostBridge (PciIoDevice->PciRootBridgeIo->ParentHandle);
if (Temp == NULL) {
//
@@ -1668,9 +1668,9 @@ PciIoAttributes (
//
if (Operation == EfiPciIoAttributeOperationEnable) {
//
- // Check if there have been an active VGA device on the same segment
+ // Check if there have been an active VGA device on the same Host Bridge
//
- Temp = ActiveVGADeviceOnTheSameSegment (PciIoDevice);
+ Temp = LocateVgaDeviceOnHostBridge (PciIoDevice->PciRootBridgeIo->ParentHandle);
if (Temp != NULL && Temp != PciIoDevice) {
//
// An active VGA has been detected, so can not enable another