Generate multiple devices in AUB and TBX CSR modes

This commit adds a capability for a driver to generate multiple devices
and hwinfo in AUB and TBX CSR modes.

Change-Id: Icc0eac7c16760d3d4ae6ef08cd0be950b45d35e7
This commit is contained in:
Milczarek, Slawomir
2018-09-18 16:31:47 +02:00
committed by sys_ocldev
parent 962b6ce883
commit 65dc5fb7de
6 changed files with 95 additions and 11 deletions

View File

@@ -181,6 +181,29 @@ TEST_F(DeviceFactoryTest, givenCreateMultipleDevicesDebugFlagWhenGetDevicesIsCal
EXPECT_EQ(requiredDeviceCount, numDevices);
}
TEST_F(DeviceFactoryTest, givenCreateMultipleDevicesDebugFlagWhenGetDevicesForProductFamilyOverrideIsCalledThenNumberOfReturnedDevicesIsEqualToDebugVariable) {
DeviceFactoryCleaner cleaner;
DebugManagerStateRestore stateRestore;
auto requiredDeviceCount = 2u;
DebugManager.flags.CreateMultipleDevices.set(requiredDeviceCount);
HardwareInfo *hwInfo = nullptr;
size_t numDevices = 0;
bool success = DeviceFactory::getDevicesForProductFamilyOverride(&hwInfo, numDevices, executionEnvironment);
ASSERT_NE(nullptr, hwInfo);
for (auto deviceIndex = 0u; deviceIndex < requiredDeviceCount; deviceIndex++) {
EXPECT_NE(nullptr, hwInfo[deviceIndex].pPlatform);
EXPECT_NE(nullptr, hwInfo[deviceIndex].pSkuTable);
EXPECT_NE(nullptr, hwInfo[deviceIndex].pSysInfo);
EXPECT_NE(nullptr, hwInfo[deviceIndex].pWaTable);
}
EXPECT_EQ(hwInfo[0].pPlatform->eDisplayCoreFamily, hwInfo[1].pPlatform->eDisplayCoreFamily);
ASSERT_TRUE(success);
EXPECT_EQ(requiredDeviceCount, numDevices);
}
TEST_F(DeviceFactoryTest, givenGetDevicesCallWhenItIsDoneThenOsInterfaceIsAllocated) {
DeviceFactoryCleaner cleaner;
HardwareInfo *hwInfo = nullptr;