mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-05 09:09:04 +08:00
Report correct PCI width from API zetSysmanPciGetProperties
If system reports incorrect PCI width, then check width against valid value, and report correct PCI width accordingly. Change-Id: I56f8fe96785ccd22032860d55dd96b81d5fc53f7 Signed-off-by: Jitendra Sharma <jitendra.sharma@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
87b9c5f4e6
commit
8dff60b6a5
@@ -19,6 +19,8 @@ const std::string LinuxPciImp::resourceFile("device/resource");
|
||||
const std::string LinuxPciImp::maxLinkSpeedFile("device/max_link_speed");
|
||||
const std::string LinuxPciImp::maxLinkWidthFile("device/max_link_width");
|
||||
constexpr uint8_t maxPciBars = 6;
|
||||
// Linux kernel would report 255 link width, as an indication of unknown.
|
||||
constexpr uint32_t unknownPcieLinkWidth = 255u;
|
||||
|
||||
ze_result_t LinuxPciImp::getPciBdf(std::string &bdf) {
|
||||
std::string bdfDir;
|
||||
@@ -50,6 +52,9 @@ ze_result_t LinuxPciImp::getMaxLinkWidth(uint32_t &maxLinkwidth) {
|
||||
if (ZE_RESULT_SUCCESS != result) {
|
||||
return result;
|
||||
}
|
||||
if (intVal == static_cast<int>(unknownPcieLinkWidth)) {
|
||||
intVal = 0;
|
||||
}
|
||||
maxLinkwidth = intVal;
|
||||
return ZE_RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user