Improve query PCI info

Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
Zbigniew Zdanowicz
2021-05-31 16:58:10 +00:00
committed by Compute-Runtime-Automation
parent 9e677da83e
commit 2829226937
12 changed files with 120 additions and 128 deletions

View File

@@ -1077,22 +1077,10 @@ void Wddm::createPagingFenceLogger() {
}
PhysicalDevicePciBusInfo Wddm::getPciBusInfo() const {
D3DKMT_ADAPTERADDRESS adapterAddress;
D3DKMT_QUERYADAPTERINFO queryAdapterInfo;
queryAdapterInfo.hAdapter = getAdapter();
queryAdapterInfo.Type = KMTQAITYPE_ADAPTERADDRESS;
queryAdapterInfo.pPrivateDriverData = &adapterAddress;
queryAdapterInfo.PrivateDriverDataSize = sizeof(adapterAddress);
auto gdi = getGdi();
UNRECOVERABLE_IF(gdi == nullptr);
if (gdi->queryAdapterInfo(&queryAdapterInfo) == STATUS_SUCCESS) {
return PhysicalDevicePciBusInfo(0, adapterAddress.BusNumber, adapterAddress.DeviceNumber, adapterAddress.FunctionNumber);
if (adapterBDF.Data == std::numeric_limits<uint32_t>::max()) {
return PhysicalDevicePciBusInfo(PhysicalDevicePciBusInfo::InvalidValue, PhysicalDevicePciBusInfo::InvalidValue, PhysicalDevicePciBusInfo::InvalidValue, PhysicalDevicePciBusInfo::InvalidValue);
}
return PhysicalDevicePciBusInfo::invalid();
return PhysicalDevicePciBusInfo(0, adapterBDF.Bus, adapterBDF.Device, adapterBDF.Function);
}
} // namespace NEO