Add device callback for GMM library to notify AUB subcapture

This commit adds a new callback to be called by GMM library
when it allocates/deallocates compressed resources to collect data
about their addresses and sizes and handle their AUB residency.

Change-Id: I075d3ff4cb049cfe626da82892069c4460ea585c
This commit is contained in:
Milczarek, Slawomir
2018-08-17 13:38:09 +02:00
parent 044255e9bd
commit 393c2219c9
25 changed files with 245 additions and 34 deletions

View File

@@ -178,3 +178,26 @@ TEST(ExecutionEnvironment, givenMultipleDevicesWhenTheyAreCreatedTheyAllReuseThe
EXPECT_EQ(&commandStreamReceiver, &device->getCommandStreamReceiver());
EXPECT_EQ(memoryManager, device2->getMemoryManager());
}
typedef ::testing::Test ExecutionEnvironmentHw;
HWTEST_F(ExecutionEnvironmentHw, givenExecutionEnvironmentWhenCommandStreamReceiverIsInitializedForCompressedBuffersThenCreatePageTableManagerIsCalled) {
ExecutionEnvironment executionEnvironment;
HardwareInfo localHwInfo = *platformDevices[0];
localHwInfo.capabilityTable.ftrRenderCompressedBuffers = true;
executionEnvironment.initializeCommandStreamReceiver(&localHwInfo);
auto csr = static_cast<UltCommandStreamReceiver<FamilyType> *>(executionEnvironment.commandStreamReceiver.get());
ASSERT_NE(nullptr, csr);
EXPECT_TRUE(csr->createPageTableManagerCalled);
}
HWTEST_F(ExecutionEnvironmentHw, givenExecutionEnvironmentWhenCommandStreamReceiverIsInitializedForCompressedImagesThenCreatePageTableManagerIsCalled) {
ExecutionEnvironment executionEnvironment;
HardwareInfo localHwInfo = *platformDevices[0];
localHwInfo.capabilityTable.ftrRenderCompressedImages = true;
executionEnvironment.initializeCommandStreamReceiver(&localHwInfo);
EXPECT_NE(nullptr, executionEnvironment.commandStreamReceiver);
auto csr = static_cast<UltCommandStreamReceiver<FamilyType> *>(executionEnvironment.commandStreamReceiver.get());
ASSERT_NE(nullptr, csr);
EXPECT_TRUE(csr->createPageTableManagerCalled);
}