|
|
|
|
@@ -53,7 +53,6 @@ struct WddmResidencyControllerTest : ::testing::Test {
|
|
|
|
|
wddm->getWddmInterface()->createMonitoredFence(*mockOsContextWin);
|
|
|
|
|
residencyController = &mockOsContextWin->mockResidencyController;
|
|
|
|
|
csr.reset(createCommandStream(*executionEnvironment, 0u, 1));
|
|
|
|
|
residencyController->setCommandStreamReceiver(csr.get());
|
|
|
|
|
csr->setupContext(*mockOsContextWin);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -71,23 +70,30 @@ struct WddmResidencyControllerWithGdiTest : ::testing::Test {
|
|
|
|
|
void SetUp() override {
|
|
|
|
|
executionEnvironment = std::make_unique<MockExecutionEnvironment>();
|
|
|
|
|
executionEnvironment->initializeMemoryManager();
|
|
|
|
|
rootDeviceEnvironment = std::make_unique<RootDeviceEnvironment>(*executionEnvironment);
|
|
|
|
|
rootDeviceEnvironment = executionEnvironment->rootDeviceEnvironments[0].get();
|
|
|
|
|
wddm = static_cast<WddmMock *>(Wddm::createWddm(nullptr, *rootDeviceEnvironment));
|
|
|
|
|
gdi = new MockGdi();
|
|
|
|
|
wddm->resetGdi(gdi);
|
|
|
|
|
wddm->init();
|
|
|
|
|
|
|
|
|
|
mockOsContextWin = std::make_unique<MockOsContextWin>(*wddm, 0, osContextId, EngineDescriptorHelper::getDefaultDescriptor());
|
|
|
|
|
mockOsContextWin->contextInitialized = true;
|
|
|
|
|
wddm->getWddmInterface()->createMonitoredFence(*mockOsContextWin);
|
|
|
|
|
csr.reset(createCommandStream(*executionEnvironment, 0u, 1));
|
|
|
|
|
auto &engines = executionEnvironment->memoryManager->getRegisteredEngines(0);
|
|
|
|
|
const_cast<EngineControlContainer &>(engines).emplace_back(csr.get(), mockOsContextWin.get());
|
|
|
|
|
residencyController = &mockOsContextWin->mockResidencyController;
|
|
|
|
|
residencyController->setCommandStreamReceiver(csr.get());
|
|
|
|
|
csr->setupContext(*mockOsContextWin);
|
|
|
|
|
residencyController->registerCallback();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void TearDown() override {
|
|
|
|
|
auto &engines = executionEnvironment->memoryManager->getRegisteredEngines(0);
|
|
|
|
|
const_cast<EngineControlContainer &>(engines).pop_back();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::unique_ptr<MockExecutionEnvironment> executionEnvironment;
|
|
|
|
|
std::unique_ptr<RootDeviceEnvironment> rootDeviceEnvironment;
|
|
|
|
|
RootDeviceEnvironment *rootDeviceEnvironment;
|
|
|
|
|
WddmMock *wddm = nullptr;
|
|
|
|
|
std::unique_ptr<MockOsContextWin> mockOsContextWin;
|
|
|
|
|
std::unique_ptr<CommandStreamReceiver> csr;
|
|
|
|
|
@@ -109,14 +115,13 @@ struct WddmResidencyControllerWithMockWddmTest : public WddmResidencyControllerT
|
|
|
|
|
|
|
|
|
|
csr.reset(createCommandStream(executionEnvironment, 0u, 1));
|
|
|
|
|
auto &gfxCoreHelper = executionEnvironment.rootDeviceEnvironments[0]->getHelper<GfxCoreHelper>();
|
|
|
|
|
osContext = memoryManager->createAndRegisterOsContext(csr.get(), EngineDescriptorHelper::getDefaultDescriptor(gfxCoreHelper.getGpgpuEngineInstances(*executionEnvironment.rootDeviceEnvironments[0])[0],
|
|
|
|
|
preemptionMode));
|
|
|
|
|
osContext = executionEnvironment.memoryManager->createAndRegisterOsContext(csr.get(), EngineDescriptorHelper::getDefaultDescriptor(gfxCoreHelper.getGpgpuEngineInstances(*executionEnvironment.rootDeviceEnvironments[0])[0],
|
|
|
|
|
preemptionMode));
|
|
|
|
|
csr->setupContext(*osContext);
|
|
|
|
|
osContext->ensureContextInitialized(false);
|
|
|
|
|
|
|
|
|
|
osContext->incRefInternal();
|
|
|
|
|
residencyController = &static_cast<OsContextWin *>(osContext)->getResidencyController();
|
|
|
|
|
residencyController->setCommandStreamReceiver(csr.get());
|
|
|
|
|
gmmHelper = executionEnvironment.rootDeviceEnvironments[0]->getGmmHelper();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -148,14 +153,13 @@ struct WddmResidencyControllerWithGdiAndMemoryManagerTest : ::testing::Test {
|
|
|
|
|
memoryManager = std::make_unique<MockWddmMemoryManager>(executionEnvironment);
|
|
|
|
|
csr.reset(createCommandStream(executionEnvironment, 0u, 1));
|
|
|
|
|
auto &gfxCoreHelper = executionEnvironment.rootDeviceEnvironments[0]->getHelper<GfxCoreHelper>();
|
|
|
|
|
osContext = memoryManager->createAndRegisterOsContext(csr.get(), EngineDescriptorHelper::getDefaultDescriptor(gfxCoreHelper.getGpgpuEngineInstances(*executionEnvironment.rootDeviceEnvironments[0])[0],
|
|
|
|
|
PreemptionHelper::getDefaultPreemptionMode(*defaultHwInfo)));
|
|
|
|
|
osContext = executionEnvironment.memoryManager->createAndRegisterOsContext(csr.get(), EngineDescriptorHelper::getDefaultDescriptor(gfxCoreHelper.getGpgpuEngineInstances(*executionEnvironment.rootDeviceEnvironments[0])[0],
|
|
|
|
|
PreemptionHelper::getDefaultPreemptionMode(*defaultHwInfo)));
|
|
|
|
|
osContext->ensureContextInitialized(false);
|
|
|
|
|
|
|
|
|
|
osContext->incRefInternal();
|
|
|
|
|
|
|
|
|
|
residencyController = &static_cast<OsContextWin *>(osContext)->getResidencyController();
|
|
|
|
|
residencyController->setCommandStreamReceiver(csr.get());
|
|
|
|
|
csr->setupContext(*osContext);
|
|
|
|
|
gmmHelper = executionEnvironment.rootDeviceEnvironments[0]->getGmmHelper();
|
|
|
|
|
}
|
|
|
|
|
@@ -182,6 +186,7 @@ TEST(WddmResidencyController, givenWddmResidencyControllerWhenItIsConstructedThe
|
|
|
|
|
auto wddm = static_cast<WddmMock *>(Wddm::createWddm(nullptr, *executionEnvironment.rootDeviceEnvironments[0].get()));
|
|
|
|
|
wddm->resetGdi(gdi);
|
|
|
|
|
wddm->init();
|
|
|
|
|
EXPECT_EQ(0u, wddm->registerTrimCallbackResult.called);
|
|
|
|
|
|
|
|
|
|
std::memset(&gdi->getRegisterTrimNotificationArg(), 0, sizeof(D3DKMT_REGISTERTRIMNOTIFICATION));
|
|
|
|
|
NEO::MockWddmResidencyController residencyController{*wddm};
|
|
|
|
|
@@ -200,16 +205,14 @@ TEST(WddmResidencyController, givenWddmResidencyControllerWhenRegisterCallbackTh
|
|
|
|
|
auto gdi = new MockGdi();
|
|
|
|
|
auto wddm = static_cast<WddmMock *>(Wddm::createWddm(nullptr, *executionEnvironment.rootDeviceEnvironments[0].get()));
|
|
|
|
|
wddm->resetGdi(gdi);
|
|
|
|
|
wddm->init();
|
|
|
|
|
|
|
|
|
|
std::memset(&gdi->getRegisterTrimNotificationArg(), 0, sizeof(D3DKMT_REGISTERTRIMNOTIFICATION));
|
|
|
|
|
|
|
|
|
|
WddmResidencyController residencyController{*wddm};
|
|
|
|
|
residencyController.registerCallback();
|
|
|
|
|
wddm->init();
|
|
|
|
|
wddm->getResidencyController().registerCallback();
|
|
|
|
|
|
|
|
|
|
EXPECT_EQ(1u, wddm->registerTrimCallbackResult.called);
|
|
|
|
|
EXPECT_EQ(reinterpret_cast<PFND3DKMT_TRIMNOTIFICATIONCALLBACK>(WddmResidencyController::trimCallback), gdi->getRegisterTrimNotificationArg().Callback);
|
|
|
|
|
EXPECT_EQ(reinterpret_cast<void *>(&residencyController), gdi->getRegisterTrimNotificationArg().Context);
|
|
|
|
|
EXPECT_EQ(reinterpret_cast<void *>(&wddm->getResidencyController()), gdi->getRegisterTrimNotificationArg().Context);
|
|
|
|
|
EXPECT_EQ(wddm->getDeviceHandle(), gdi->getRegisterTrimNotificationArg().hDevice);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -230,17 +233,6 @@ TEST_F(WddmResidencyControllerTest, givenWddmResidencyControllerThenUpdateLastTr
|
|
|
|
|
EXPECT_EQ(12345u, mockOsContextWin->lastTrimFenceValue);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TEST_F(WddmResidencyControllerWithGdiTest, givenWddmResidencyControllerWhenItIsDestructedThenUnregisterTrimCallback) {
|
|
|
|
|
auto trimCallbackHandle = residencyController->trimCallbackHandle;
|
|
|
|
|
auto trimCallbackAddress = reinterpret_cast<PFND3DKMT_TRIMNOTIFICATIONCALLBACK>(WddmResidencyController::trimCallback);
|
|
|
|
|
|
|
|
|
|
std::memset(&gdi->getUnregisterTrimNotificationArg(), 0, sizeof(D3DKMT_UNREGISTERTRIMNOTIFICATION));
|
|
|
|
|
mockOsContextWin.reset();
|
|
|
|
|
|
|
|
|
|
EXPECT_EQ(trimCallbackAddress, gdi->getUnregisterTrimNotificationArg().Callback);
|
|
|
|
|
EXPECT_EQ(trimCallbackHandle, gdi->getUnregisterTrimNotificationArg().Handle);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TEST_F(WddmResidencyControllerWithGdiTest, givenWddmResidencyControllerWhenItIsDestructedDuringProcessShutdownThenDontUnregisterTrimCallback) {
|
|
|
|
|
wddm->shutdownStatus = true;
|
|
|
|
|
|
|
|
|
|
@@ -286,15 +278,15 @@ TEST_F(WddmResidencyControllerWithGdiTest, givenNotUsedAllocationsFromPreviousPe
|
|
|
|
|
wddm->evictResult.called = 0;
|
|
|
|
|
wddm->callBaseEvict = true;
|
|
|
|
|
|
|
|
|
|
residencyController->getEvictionAllocations().push_back(&allocation1);
|
|
|
|
|
residencyController->getEvictionAllocations().push_back(&allocation2);
|
|
|
|
|
wddm->getResidencyController().getEvictionAllocations().push_back(&allocation1);
|
|
|
|
|
wddm->getResidencyController().getEvictionAllocations().push_back(&allocation2);
|
|
|
|
|
|
|
|
|
|
residencyController->trimResidency(trimNotification.Flags, trimNotification.NumBytesToTrim);
|
|
|
|
|
wddm->getResidencyController().trimResidency(trimNotification.Flags, trimNotification.NumBytesToTrim);
|
|
|
|
|
|
|
|
|
|
// Single evict called
|
|
|
|
|
EXPECT_EQ(1u, wddm->evictResult.called);
|
|
|
|
|
EXPECT_EQ(1u, gdi->getEvictArg().Flags.EvictOnlyIfNecessary);
|
|
|
|
|
EXPECT_TRUE(residencyController->getEvictionAllocations().empty());
|
|
|
|
|
EXPECT_TRUE(wddm->getResidencyController().getEvictionAllocations().empty());
|
|
|
|
|
// marked nonresident
|
|
|
|
|
EXPECT_FALSE(allocation1.getResidencyData().resident[osContextId]);
|
|
|
|
|
EXPECT_FALSE(allocation2.getResidencyData().resident[osContextId]);
|
|
|
|
|
@@ -377,9 +369,9 @@ TEST_F(WddmResidencyControllerWithGdiAndMemoryManagerTest, givenTripleAllocation
|
|
|
|
|
wddm->evictResult.called = 0;
|
|
|
|
|
wddm->callBaseEvict = true;
|
|
|
|
|
|
|
|
|
|
residencyController->getEvictionAllocations().push_back(allocationTriple);
|
|
|
|
|
wddm->getResidencyController().getEvictionAllocations().push_back(allocationTriple);
|
|
|
|
|
|
|
|
|
|
residencyController->trimResidency(trimNotification.Flags, trimNotification.NumBytesToTrim);
|
|
|
|
|
wddm->getResidencyController().trimResidency(trimNotification.Flags, trimNotification.NumBytesToTrim);
|
|
|
|
|
|
|
|
|
|
// 2 fragments evicted with one call
|
|
|
|
|
EXPECT_EQ(1u, wddm->evictResult.called);
|
|
|
|
|
@@ -751,15 +743,6 @@ TEST_F(WddmResidencyControllerLockTest, givenTrimToBudgetWhenTrimmingResidencyTh
|
|
|
|
|
EXPECT_EQ(1u, residencyController->acquireLockCallCount);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
HWTEST_F(WddmResidencyControllerLockTest, givenTrimToBudgetWhenTrimmingToBudgetThenLockCsr) {
|
|
|
|
|
D3DKMT_TRIMNOTIFICATION trimNotification = {0};
|
|
|
|
|
trimNotification.Flags.TrimToBudget = 1;
|
|
|
|
|
trimNotification.NumBytesToTrim = 0;
|
|
|
|
|
|
|
|
|
|
residencyController->trimResidency(trimNotification.Flags, trimNotification.NumBytesToTrim);
|
|
|
|
|
EXPECT_EQ(1u, static_cast<UltCommandStreamReceiver<FamilyType> *>(residencyController->csr)->recursiveLockCounter);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TEST_F(WddmResidencyControllerLockTest, givenPeriodicTrimAndTrimToBudgetWhenTrimmingResidencyThenLockTwice) {
|
|
|
|
|
D3DKMT_TRIMNOTIFICATION trimNotification = {0};
|
|
|
|
|
trimNotification.Flags.PeriodicTrim = 1;
|
|
|
|
|
@@ -777,7 +760,7 @@ TEST_F(WddmResidencyControllerWithGdiAndMemoryManagerTest, WhenMakingResidentRes
|
|
|
|
|
MockWddmAllocation allocation4(gmmHelper);
|
|
|
|
|
ResidencyContainer residencyPack{&allocation1, &allocation2, &allocation3, &allocation4};
|
|
|
|
|
bool requiresBlockingResidencyHandling = true;
|
|
|
|
|
residencyController->makeResidentResidencyAllocations(residencyPack, requiresBlockingResidencyHandling, *static_cast<OsContextWin *>(osContext));
|
|
|
|
|
residencyController->makeResidentResidencyAllocations(residencyPack, requiresBlockingResidencyHandling, csr.get());
|
|
|
|
|
|
|
|
|
|
EXPECT_TRUE(allocation1.getResidencyData().resident[osContextId]);
|
|
|
|
|
EXPECT_TRUE(allocation2.getResidencyData().resident[osContextId]);
|
|
|
|
|
@@ -794,7 +777,7 @@ TEST_F(WddmResidencyControllerWithGdiAndMemoryManagerTest, WhenMakingResidentRes
|
|
|
|
|
|
|
|
|
|
static_cast<OsContextWin *>(osContext)->getMonitoredFence().currentFenceValue = 20;
|
|
|
|
|
bool requiresBlockingResidencyHandling = true;
|
|
|
|
|
residencyController->makeResidentResidencyAllocations(residencyPack, requiresBlockingResidencyHandling, *static_cast<OsContextWin *>(osContext));
|
|
|
|
|
residencyController->makeResidentResidencyAllocations(residencyPack, requiresBlockingResidencyHandling, csr.get());
|
|
|
|
|
|
|
|
|
|
EXPECT_EQ(20u, allocation1.getResidencyData().getFenceValueForContextId(osContext->getContextId()));
|
|
|
|
|
EXPECT_EQ(20u, allocation2.getResidencyData().getFenceValueForContextId(osContext->getContextId()));
|
|
|
|
|
@@ -814,7 +797,7 @@ TEST_F(WddmResidencyControllerWithGdiAndMemoryManagerTest, GivenTripleAllocation
|
|
|
|
|
WddmAllocation *allocationTriple = (WddmAllocation *)memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{csr->getRootDeviceIndex(), false, 2 * MemoryConstants::pageSize}, ptr);
|
|
|
|
|
ResidencyContainer residencyPack{&allocation1, allocationTriple, &allocation2};
|
|
|
|
|
bool requiresBlockingResidencyHandling = true;
|
|
|
|
|
residencyController->makeResidentResidencyAllocations(residencyPack, requiresBlockingResidencyHandling, *static_cast<OsContextWin *>(osContext));
|
|
|
|
|
residencyController->makeResidentResidencyAllocations(residencyPack, requiresBlockingResidencyHandling, csr.get());
|
|
|
|
|
|
|
|
|
|
for (uint32_t i = 0; i < allocationTriple->fragmentsStorage.fragmentCount; i++) {
|
|
|
|
|
EXPECT_TRUE(allocationTriple->fragmentsStorage.fragmentStorageData[i].residency->resident[osContextId]);
|
|
|
|
|
@@ -834,7 +817,7 @@ TEST_F(WddmResidencyControllerWithGdiAndMemoryManagerTest, GivenTripleAllocation
|
|
|
|
|
static_cast<OsContextWin *>(osContext)->getMonitoredFence().currentFenceValue = 20;
|
|
|
|
|
bool requiresBlockingResidencyHandling = true;
|
|
|
|
|
ResidencyContainer residencyPack{&allocation1, allocationTriple, &allocation2};
|
|
|
|
|
residencyController->makeResidentResidencyAllocations(residencyPack, requiresBlockingResidencyHandling, *static_cast<OsContextWin *>(osContext));
|
|
|
|
|
residencyController->makeResidentResidencyAllocations(residencyPack, requiresBlockingResidencyHandling, csr.get());
|
|
|
|
|
|
|
|
|
|
for (uint32_t i = 0; i < allocationTriple->fragmentsStorage.fragmentCount; i++) {
|
|
|
|
|
EXPECT_EQ(20u, allocationTriple->fragmentsStorage.fragmentStorageData[i].residency->getFenceValueForContextId(0));
|
|
|
|
|
@@ -854,7 +837,7 @@ TEST_F(WddmResidencyControllerWithMockWddmTest, givenMakeResidentFailsWhenCallin
|
|
|
|
|
|
|
|
|
|
ResidencyContainer residencyPack{&allocation1, &allocation2, &allocation3, &allocation4};
|
|
|
|
|
bool requiresBlockingResidencyHandling = true;
|
|
|
|
|
bool result = residencyController->makeResidentResidencyAllocations(residencyPack, requiresBlockingResidencyHandling, *static_cast<OsContextWin *>(osContext));
|
|
|
|
|
bool result = residencyController->makeResidentResidencyAllocations(residencyPack, requiresBlockingResidencyHandling, csr.get());
|
|
|
|
|
|
|
|
|
|
EXPECT_FALSE(result);
|
|
|
|
|
|
|
|
|
|
@@ -876,7 +859,7 @@ TEST_F(WddmResidencyControllerWithMockWddmTest, givenMakeResidentFailsWhenCallin
|
|
|
|
|
|
|
|
|
|
ResidencyContainer residencyPack{&allocation1, &allocation2, &allocation3, &allocation4};
|
|
|
|
|
bool requiresBlockingResidencyHandling = true;
|
|
|
|
|
bool result = residencyController->makeResidentResidencyAllocations(residencyPack, requiresBlockingResidencyHandling, *static_cast<OsContextWin *>(osContext));
|
|
|
|
|
bool result = residencyController->makeResidentResidencyAllocations(residencyPack, requiresBlockingResidencyHandling, csr.get());
|
|
|
|
|
|
|
|
|
|
EXPECT_FALSE(result);
|
|
|
|
|
EXPECT_EQ(residencyPack.size(), 0u);
|
|
|
|
|
@@ -895,7 +878,7 @@ TEST_F(WddmResidencyControllerWithMockWddmTest, givenMakeResidentFailsWhenCallin
|
|
|
|
|
|
|
|
|
|
ResidencyContainer residencyPack{&allocation1, allocationTriple, &allocation2};
|
|
|
|
|
bool requiresBlockingResidencyHandling = true;
|
|
|
|
|
bool result = residencyController->makeResidentResidencyAllocations(residencyPack, requiresBlockingResidencyHandling, *static_cast<OsContextWin *>(osContext));
|
|
|
|
|
bool result = residencyController->makeResidentResidencyAllocations(residencyPack, requiresBlockingResidencyHandling, csr.get());
|
|
|
|
|
|
|
|
|
|
EXPECT_FALSE(result);
|
|
|
|
|
|
|
|
|
|
@@ -917,7 +900,7 @@ TEST_F(WddmResidencyControllerWithMockWddmTest, givenMakeResidentFailsWhenCallin
|
|
|
|
|
|
|
|
|
|
ResidencyContainer residencyPack{&allocation1};
|
|
|
|
|
bool requiresBlockingResidencyHandling = true;
|
|
|
|
|
bool result = residencyController->makeResidentResidencyAllocations(residencyPack, requiresBlockingResidencyHandling, *static_cast<OsContextWin *>(osContext));
|
|
|
|
|
bool result = residencyController->makeResidentResidencyAllocations(residencyPack, requiresBlockingResidencyHandling, csr.get());
|
|
|
|
|
|
|
|
|
|
EXPECT_FALSE(result);
|
|
|
|
|
EXPECT_NE(wddm->makeResidentParamsPassed[0].cantTrimFurther, wddm->makeResidentParamsPassed[1].cantTrimFurther);
|
|
|
|
|
@@ -932,7 +915,7 @@ TEST_F(WddmResidencyControllerWithMockWddmTest, givenAllocationPackPassedWhenCal
|
|
|
|
|
allocation2.handle = 2;
|
|
|
|
|
ResidencyContainer residencyPack{&allocation1, &allocation2};
|
|
|
|
|
bool requiresBlockingResidencyHandling = true;
|
|
|
|
|
bool result = residencyController->makeResidentResidencyAllocations(residencyPack, requiresBlockingResidencyHandling, *static_cast<OsContextWin *>(osContext));
|
|
|
|
|
bool result = residencyController->makeResidentResidencyAllocations(residencyPack, requiresBlockingResidencyHandling, csr.get());
|
|
|
|
|
EXPECT_TRUE(result);
|
|
|
|
|
EXPECT_EQ(2 * EngineLimits::maxHandleCount, wddm->makeResidentResult.handleCount);
|
|
|
|
|
EXPECT_EQ(false, wddm->makeResidentResult.cantTrimFurther);
|
|
|
|
|
@@ -957,7 +940,7 @@ TEST_F(WddmResidencyControllerWithMockWddmTest, givenMakeResidentFailsAndTrimToB
|
|
|
|
|
|
|
|
|
|
ResidencyContainer residencyPack{&allocation1};
|
|
|
|
|
bool requiresBlockingResidencyHandling = true;
|
|
|
|
|
bool result = residencyController->makeResidentResidencyAllocations(residencyPack, requiresBlockingResidencyHandling, *static_cast<OsContextWin *>(osContext));
|
|
|
|
|
bool result = residencyController->makeResidentResidencyAllocations(residencyPack, requiresBlockingResidencyHandling, csr.get());
|
|
|
|
|
|
|
|
|
|
EXPECT_TRUE(result);
|
|
|
|
|
|
|
|
|
|
@@ -983,7 +966,7 @@ TEST_F(WddmResidencyControllerWithMockWddmTest, givenMakeResidentFailsAndTrimToB
|
|
|
|
|
|
|
|
|
|
ResidencyContainer residencyPack{&allocation1, &allocationAlreadyResident};
|
|
|
|
|
bool requiresBlockingResidencyHandling = true;
|
|
|
|
|
bool result = residencyController->makeResidentResidencyAllocations(residencyPack, requiresBlockingResidencyHandling, *static_cast<OsContextWin *>(osContext));
|
|
|
|
|
bool result = residencyController->makeResidentResidencyAllocations(residencyPack, requiresBlockingResidencyHandling, csr.get());
|
|
|
|
|
|
|
|
|
|
EXPECT_TRUE(result);
|
|
|
|
|
|
|
|
|
|
@@ -1000,7 +983,7 @@ TEST_F(WddmResidencyControllerWithMockWddmTest, givenMakeResidentFailsWhenCallin
|
|
|
|
|
|
|
|
|
|
wddm->makeResidentResults = {false, true};
|
|
|
|
|
bool requiresBlockingResidencyHandling = true;
|
|
|
|
|
residencyController->makeResidentResidencyAllocations(residencyPack, requiresBlockingResidencyHandling, *static_cast<OsContextWin *>(osContext));
|
|
|
|
|
residencyController->makeResidentResidencyAllocations(residencyPack, requiresBlockingResidencyHandling, csr.get());
|
|
|
|
|
EXPECT_TRUE(residencyController->isMemoryBudgetExhausted());
|
|
|
|
|
EXPECT_EQ(2u, wddm->makeResidentResult.called);
|
|
|
|
|
}
|
|
|
|
|
@@ -1037,7 +1020,6 @@ struct WddmResidencyControllerWithMockWddmMakeResidentTest : public WddmResidenc
|
|
|
|
|
|
|
|
|
|
osContext->incRefInternal();
|
|
|
|
|
residencyController = &static_cast<OsContextWin *>(osContext)->getResidencyController();
|
|
|
|
|
residencyController->setCommandStreamReceiver(csr.get());
|
|
|
|
|
csr->setupContext(*osContext);
|
|
|
|
|
gmmHelper = executionEnvironment.rootDeviceEnvironments[0]->getGmmHelper();
|
|
|
|
|
}
|
|
|
|
|
@@ -1052,7 +1034,7 @@ TEST_F(WddmResidencyControllerWithMockWddmMakeResidentTest, givenMakeResidentFai
|
|
|
|
|
MockWddmAllocation allocation1(gmmHelper);
|
|
|
|
|
ResidencyContainer residencyPack{&allocation1};
|
|
|
|
|
bool requiresBlockingResidencyHandling = true;
|
|
|
|
|
bool result = residencyController->makeResidentResidencyAllocations(residencyPack, requiresBlockingResidencyHandling, *static_cast<OsContextWin *>(osContext));
|
|
|
|
|
bool result = residencyController->makeResidentResidencyAllocations(residencyPack, requiresBlockingResidencyHandling, csr.get());
|
|
|
|
|
|
|
|
|
|
EXPECT_TRUE(result);
|
|
|
|
|
EXPECT_EQ(3u, wddm->makeResidentResult.called);
|
|
|
|
|
|