mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-05 09:09:04 +08:00
improve pci path search to use regex to make it more flexible
Related-To: NEO-6364 Signed-off-by: Artur Harasimiuk <artur.harasimiuk@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
c3e5e4d3cc
commit
83b099a48c
@@ -17,13 +17,15 @@ namespace NEO {
|
||||
|
||||
class DrmMockDefault : public DrmMock {
|
||||
public:
|
||||
DrmMockDefault(RootDeviceEnvironment &rootDeviceEnvironment) : DrmMock(rootDeviceEnvironment) {
|
||||
DrmMockDefault(std::unique_ptr<HwDeviceIdDrm> &&hwDeviceIdIn, RootDeviceEnvironment &rootDeviceEnvironment) : DrmMock(rootDeviceEnvironment) {
|
||||
storedRetVal = 0;
|
||||
storedRetValForDeviceID = 0;
|
||||
storedRetValForDeviceRevID = 0;
|
||||
storedRetValForPooledEU = 0;
|
||||
storedRetValForMinEUinPool = 0;
|
||||
setGtType(GTTYPE_GT1);
|
||||
if (hwDeviceIdIn != nullptr)
|
||||
this->hwDeviceId = std::move(hwDeviceIdIn);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -35,7 +37,7 @@ Drm *Drm::create(std::unique_ptr<HwDeviceIdDrm> &&hwDeviceId, RootDeviceEnvironm
|
||||
if (pDrmToReturnFromCreateFunc) {
|
||||
return *pDrmToReturnFromCreateFunc;
|
||||
}
|
||||
auto drm = new DrmMockDefault(rootDeviceEnvironment);
|
||||
auto drm = new DrmMockDefault(std::move(hwDeviceId), rootDeviceEnvironment);
|
||||
|
||||
const HardwareInfo *hwInfo = rootDeviceEnvironment.getHardwareInfo();
|
||||
|
||||
|
||||
@@ -54,9 +54,10 @@ int open(const char *file, int flags) {
|
||||
if (strcmp(file, "/dev/dri/by-path/pci-0000:invalid-render") == 0) {
|
||||
return 0;
|
||||
}
|
||||
if (strcmp(file, "./test_files/linux/by-path/pci-0000-device-render") == 0) {
|
||||
if (strcmp(file, "./test_files/linux/by-path/pci-0000:00:02.0-render") == 0) {
|
||||
return fakeFileDescriptor;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user