Extract querying device id and revision to a dedicated method

Related-To: NEO-6999
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2022-06-08 12:43:51 +00:00
committed by Compute-Runtime-Automation
parent 39c1c4d530
commit 4d6169ee8b
9 changed files with 46 additions and 59 deletions

View File

@@ -39,20 +39,11 @@ Drm *Drm::create(std::unique_ptr<HwDeviceIdDrm> &&hwDeviceId, RootDeviceEnvironm
drmObject.reset(new Drm(std::move(hwDeviceId), rootDeviceEnvironment));
}
// Get HW version (I915_drm.h)
int ret = drmObject->getDeviceID(drmObject->deviceId);
if (ret != 0) {
printDebugString(DebugManager.flags.PrintDebugMessages.get(), stderr, "%s", "FATAL: Cannot query device ID parameter!\n");
return nullptr;
}
if (!DeviceFactory::isAllowedDeviceId(drmObject->deviceId, DebugManager.flags.FilterDeviceId.get())) {
if (!drmObject->queryDeviceIdAndRevision()) {
return nullptr;
}
// Get HW Revision (I915_drm.h)
ret = drmObject->getDeviceRevID(drmObject->revisionId);
if (ret != 0) {
printDebugString(DebugManager.flags.PrintDebugMessages.get(), stderr, "%s", "FATAL: Cannot query device Rev ID parameter!\n");
if (!DeviceFactory::isAllowedDeviceId(drmObject->deviceId, DebugManager.flags.FilterDeviceId.get())) {
return nullptr;
}
@@ -65,6 +56,7 @@ Drm *Drm::create(std::unique_ptr<HwDeviceIdDrm> &&hwDeviceId, RootDeviceEnvironm
break;
}
}
int ret = 0;
if (device) {
ret = drmObject->setupHardwareInfo(device, true);
if (ret != 0) {