Do not execute trim callback if there are no registered contexts.

Change-Id: I9a274281a085cdbeb98a1d495ce9ef9ab897d08a
This commit is contained in:
Mrozek, Michal
2018-10-22 17:15:13 +02:00
committed by sys_ocldev
parent 56f67748fd
commit 77b00fa749
2 changed files with 11 additions and 0 deletions

View File

@@ -113,6 +113,13 @@ TEST_F(WddmMemoryManagerSimpleTest, givenMemoryManagerWhenAllocateGraphicsMemory
memoryManager->freeGraphicsMemory(allocation);
}
TEST_F(WddmMemoryManagerSimpleTest, givenMemoryManagerWhichDoesntRegisteredAnyOsContextWhenTrimCallbackIsCalledThenItReturnsWithoutDoingAnyWork) {
memoryManager.reset(new MockWddmMemoryManager(false, false, wddm, executionEnvironment));
D3DKMT_TRIMNOTIFICATION trimNotification = {};
trimNotification.Context = memoryManager.get();
WddmMemoryManager::trimCallback(&trimNotification);
}
TEST_F(WddmMemoryManagerSimpleTest, givenMemoryManagerWith64KBPagesEnabledWhenAllocateGraphicsMemory64kbIsCalledThenMemoryPoolIsSystem64KBPages) {
memoryManager.reset(new MockWddmMemoryManager(false, false, wddm, executionEnvironment));
auto size = 4096u;