Add new debug flag allowing to not register trim callback.

Change-Id: I615be3edc9d843fb7b37cf32f2abd5e2839d6ada
This commit is contained in:
Mrozek, Michal
2018-09-17 18:23:04 -07:00
committed by sys_ocldev
parent a2ed6861d8
commit f5a2b38fa4
5 changed files with 15 additions and 1 deletions

View File

@@ -1107,6 +1107,14 @@ TEST_F(WddmMemoryManagerResidencyTest, trimCallbackIsRegisteredInWddmMemoryManag
EXPECT_EQ(wddm->getDevice(), gdi->getRegisterTrimNotificationArg().hDevice);
}
TEST(WddmDebugModesTests, givenDebugModeWhenItIsActiveThenTrimCallbackIsNotRegistred) {
DebugManagerStateRestore stateRestore;
DebugManager.flags.DoNotRegisterTrimCallback.set(true);
WddmMock wddm;
wddm.init();
EXPECT_EQ(nullptr, wddm.trimCallbackHandle);
}
TEST_F(WddmMemoryManagerResidencyTest, givenNotUsedAllocationsFromPreviousPeriodicTrimWhenTrimResidencyPeriodicTrimIsCalledThenAllocationsAreEvictedMarkedAndRemovedFromTrimCandidateList) {
D3DKMT_TRIMNOTIFICATION trimNotification = {0};
trimNotification.Flags.PeriodicTrim = 1;