Initialize tag allocation for Aub CSR in HW+AUB mode

Change-Id: Ia483dbdd211a25ca246675c97e59224f0b098ca5
Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
This commit is contained in:
Dunajski, Bartosz
2020-01-13 11:19:00 +01:00
committed by sys_ocldev
parent 5e4ade58f8
commit be12b8d2e4
2 changed files with 18 additions and 1 deletions

View File

@@ -205,6 +205,21 @@ HWTEST_F(CommandStreamReceiverWithAubDumpSimpleTest, givenCsrWithAubDumpWhenWait
csrWithAubDump.waitForTaskCountWithKmdNotifyFallback(1, 0, false, false);
}
HWTEST_F(CommandStreamReceiverWithAubDumpSimpleTest, givenCsrWithAubDumpWhenCreatingAubCsrThenInitializeTagAllocation) {
MockAubCenter *mockAubCenter = new MockAubCenter(*platformDevices, false, "file_name.aub", CommandStreamReceiverType::CSR_HW_WITH_AUB);
mockAubCenter->aubManager = std::unique_ptr<MockAubManager>(new MockAubManager());
auto executionEnvironment = platformImpl->peekExecutionEnvironment();
executionEnvironment->initializeMemoryManager();
executionEnvironment->rootDeviceEnvironments[0]->aubCenter = std::unique_ptr<MockAubCenter>(mockAubCenter);
CommandStreamReceiverWithAUBDump<UltCommandStreamReceiver<FamilyType>> csrWithAubDump("file_name.aub", *executionEnvironment, 0);
EXPECT_NE(nullptr, csrWithAubDump.aubCSR->getTagAllocation());
EXPECT_NE(nullptr, csrWithAubDump.aubCSR->getTagAddress());
EXPECT_EQ(std::numeric_limits<uint32_t>::max(), *csrWithAubDump.aubCSR->getTagAddress());
}
struct CommandStreamReceiverTagTests : public ::testing::Test {
template <typename FamilyType>
using AubWithHw = CommandStreamReceiverWithAUBDump<UltCommandStreamReceiver<FamilyType>>;
@@ -264,8 +279,8 @@ using SimulatedCsrTest = ::testing::Test;
HWTEST_F(SimulatedCsrTest, givenHwWithAubDumpCsrTypeWhenCreateCommandStreamReceiverThenProperAubCenterIsInitialized) {
uint32_t expectedRootDeviceIndex = 10;
ExecutionEnvironment executionEnvironment;
executionEnvironment.initializeMemoryManager();
executionEnvironment.prepareRootDeviceEnvironments(expectedRootDeviceIndex + 2);
executionEnvironment.initializeMemoryManager();
auto rootDeviceEnvironment = new MockRootDeviceEnvironment(executionEnvironment);
executionEnvironment.rootDeviceEnvironments[expectedRootDeviceIndex].reset(rootDeviceEnvironment);