AUB capture with a capability to get engine instance

Change-Id: I52c47505476053d6e692fc9d89cca25a6e122a63
This commit is contained in:
Milczarek, Slawomir
2018-10-19 11:32:05 -07:00
committed by sys_ocldev
parent 7bd92190d9
commit 9be4850213
4 changed files with 82 additions and 9 deletions

View File

@@ -85,6 +85,35 @@ TEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenTypeIsChe
EXPECT_EQ(CommandStreamReceiverType::CSR_AUB, aubCsr->getType());
}
HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenGetInstanceIsCalledForAGivenEngineTypeThenEngineInstanceForThatTypeIsReturned) {
auto aubCsr = std::make_unique<AUBCommandStreamReceiverHw<FamilyType>>(**platformDevices, "", true, executionEnvironment);
EXPECT_NE(nullptr, aubCsr);
auto engineId = aubCsr->getEngineInstance(EngineType::ENGINE_RCS);
EXPECT_EQ(EngineType::ENGINE_RCS, allEngineInstances[engineId].type);
engineId = aubCsr->getEngineInstance(EngineType::ENGINE_BCS);
EXPECT_EQ(EngineType::ENGINE_BCS, allEngineInstances[engineId].type);
engineId = aubCsr->getEngineInstance(EngineType::ENGINE_VCS);
EXPECT_EQ(EngineType::ENGINE_VCS, allEngineInstances[engineId].type);
engineId = aubCsr->getEngineInstance(EngineType::ENGINE_VECS);
EXPECT_EQ(EngineType::ENGINE_VECS, allEngineInstances[engineId].type);
}
HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenSetCsTraitsIsCalledThenLRCAIsSetForAGivenEngine) {
const auto &csTraits = AUBCommandStreamReceiverHw<FamilyType>::getCsTraits(EngineType::ENGINE_RCS);
auto mmioBase = 0x12345679u;
const AubMemDump::LrcaHelper lrca(mmioBase);
AUBCommandStreamReceiverHw<FamilyType>::setCsTraits(EngineType::ENGINE_RCS, &lrca);
const auto &traits = AUBCommandStreamReceiverHw<FamilyType>::getCsTraits(EngineType::ENGINE_RCS);
EXPECT_EQ(mmioBase, traits.mmioBase);
AUBCommandStreamReceiverHw<FamilyType>::setCsTraits(EngineType::ENGINE_RCS, &csTraits);
}
HWTEST_F(AubCommandStreamReceiverTests, givenAubCsrWhenItIsCreatedWithDefaultSettingsThenItHasBatchedDispatchModeEnabled) {
DebugManagerStateRestore stateRestore;
DebugManager.flags.CsrDispatchMode.set(0);