Clarify meaning of ForceDeviceId debug flag

this flag can be used only to override device id in AUB/TBX mode

Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2022-09-19 12:31:20 +00:00
committed by Compute-Runtime-Automation
parent eea582355d
commit 99d63facb5
7 changed files with 2 additions and 79 deletions

View File

@ -115,29 +115,6 @@ TEST_F(DrmSimpleTests, GivenTwoOpenableDevicesWhenDiscoverDevicesThenCreateTwoHw
EXPECT_EQ(2u, hwDeviceIds.size());
}
TEST_F(DrmSimpleTests, GivenSelectedNotExistingDeviceUsingForceDeviceIdFlagWhenGetDeviceFdThenFail) {
DebugManagerStateRestore stateRestore;
DebugManager.flags.ForceDeviceId.set("invalid");
openFull = nullptr; // open shouldn't be called
ExecutionEnvironment executionEnvironment;
auto hwDeviceIds = OSInterface::discoverDevices(executionEnvironment);
EXPECT_TRUE(hwDeviceIds.empty());
}
TEST_F(DrmSimpleTests, GivenSelectedExistingDeviceUsingForceDeviceIdFlagWhenGetDeviceFdThenReturnFd) {
DebugManagerStateRestore stateRestore;
DebugManager.flags.ForceDeviceId.set("0000:00:02.0");
VariableBackup<decltype(openFull)> backupOpenFull(&openFull);
openFull = openWithCounter;
openCounter = 10;
ExecutionEnvironment executionEnvironment;
auto hwDeviceIds = OSInterface::discoverDevices(executionEnvironment);
EXPECT_EQ(1u, hwDeviceIds.size());
EXPECT_NE(nullptr, hwDeviceIds[0].get());
EXPECT_STREQ("/dev/dri/by-path/platform-4010000000.pcie-pci-0000:00:02.0-render", lastOpenedPath.c_str());
EXPECT_EQ(9, openCounter); // only one opened file
}
TEST_F(DrmSimpleTests, GivenSelectedNotExistingDeviceUsingFilterBdfWhenGetDeviceFdThenFail) {
DebugManagerStateRestore stateRestore;
DebugManager.flags.FilterBdfPath.set("invalid");

View File

@ -368,23 +368,6 @@ TEST(DeviceFactory, givenNonHwModeSelectedWhenIsHwModeSelectedIsCalledThenFalseI
}
}
TEST(DiscoverDevices, whenDiscoverDevicesAndForceDeviceIdIsDifferentFromTheExistingDeviceThenReturnNullptr) {
DebugManagerStateRestore stateRestore;
DebugManager.flags.ForceDeviceId.set("invalid");
ExecutionEnvironment executionEnviornment;
auto hwDeviceIds = OSInterface::discoverDevices(executionEnviornment);
EXPECT_TRUE(hwDeviceIds.empty());
}
TEST(DiscoverDevices, whenDiscoverDevicesAndForceDeviceIdIsDifferentFromTheExistingDeviceThenPrepareDeviceEnvironmentsReturnsFalse) {
DebugManagerStateRestore stateRestore;
DebugManager.flags.ForceDeviceId.set("invalid");
ExecutionEnvironment executionEnviornment;
auto result = DeviceFactory::prepareDeviceEnvironments(executionEnviornment);
EXPECT_FALSE(result);
}
TEST(DiscoverDevices, whenDiscoverDevicesAndFilterDifferentFromTheExistingDeviceThenReturnNullptr) {
DebugManagerStateRestore stateRestore;
DebugManager.flags.FilterDeviceId.set("invalid");

View File

@ -1383,15 +1383,6 @@ TEST_F(Wddm20Tests, givenWddmWhenDiscoverDevicesAndFilterDeviceIdIsTheSameAsTheE
EXPECT_NE(nullptr, hwDeviceIds[0].get());
}
TEST_F(Wddm20Tests, givenWddmWhenDiscoverDevicesAndForceDeviceIdIsTheSameAsTheExistingDeviceThenReturnTheAdapter) {
DebugManagerStateRestore stateRestore;
DebugManager.flags.ForceDeviceId.set("1234"); // Existing device Id
ExecutionEnvironment executionEnvironment;
auto hwDeviceIds = OSInterface::discoverDevices(executionEnvironment);
EXPECT_EQ(1u, hwDeviceIds.size());
EXPECT_NE(nullptr, hwDeviceIds[0].get());
}
TEST_F(WddmTest, WhenFeatureFlagHwQueueIsDisabledThenReturnWddm20Version) {
wddm->featureTable->flags.ftrWddmHwQueues = 0;
EXPECT_EQ(WddmVersion::WDDM_2_0, wddm->getWddmVersion());