mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-09 22:43:00 +08:00
Delegate MemoryManager residency and eviction calls through CSR
MemoryManager::getEvictonAllocations() MemoryManager::pushAllocationForEviction() MemoryManager::clearEvictionAllocations() MemoryManager::clearResidencyAllocations() Change-Id: Iaa3051965bc9dfc09384e2bd5e9e0c372b5e722a Signed-off-by: Maciej Dziuban <maciej.dziuban@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
7aa70248e8
commit
da5a292e54
@@ -1191,7 +1191,7 @@ TEST_F(DrmCommandStreamLeaksTest, makeResidentTwice) {
|
||||
EXPECT_EQ(buffer, bo1);
|
||||
EXPECT_EQ(1u, bo1->getRefCount());
|
||||
|
||||
csr->getMemoryManager()->clearResidencyAllocations();
|
||||
csr->clearResidencyAllocations();
|
||||
csr->makeResident(*allocation);
|
||||
csr->processResidency(&csr->getResidencyAllocations(), *osContext);
|
||||
|
||||
@@ -1383,7 +1383,7 @@ TEST_F(DrmCommandStreamLeaksTest, GivenAllocationsContainingDifferentCountOfFrag
|
||||
EXPECT_EQ(1u, bo->getRefCount());
|
||||
}
|
||||
mm->freeGraphicsMemory(allocation);
|
||||
mm->clearResidencyAllocations();
|
||||
csr->clearResidencyAllocations();
|
||||
|
||||
EXPECT_EQ(0u, hostPtrManager.getFragmentCount());
|
||||
|
||||
@@ -1438,7 +1438,7 @@ TEST_F(DrmCommandStreamLeaksTest, GivenTwoAllocationsWhenBackingStorageIsTheSame
|
||||
|
||||
mm->freeGraphicsMemory(allocation);
|
||||
mm->freeGraphicsMemory(allocation2);
|
||||
mm->clearResidencyAllocations();
|
||||
csr->clearResidencyAllocations();
|
||||
}
|
||||
|
||||
TEST_F(DrmCommandStreamLeaksTest, GivenTwoAllocationsWhenBackingStorageIsDifferentThenMakeResidentShouldAddTwoLocations) {
|
||||
@@ -1461,7 +1461,7 @@ TEST_F(DrmCommandStreamLeaksTest, GivenTwoAllocationsWhenBackingStorageIsDiffere
|
||||
|
||||
mm->freeGraphicsMemory(allocation);
|
||||
mm->freeGraphicsMemory(allocation2);
|
||||
mm->clearResidencyAllocations();
|
||||
csr->clearResidencyAllocations();
|
||||
}
|
||||
|
||||
TEST_F(DrmCommandStreamLeaksTest, makeResidentSizeZero) {
|
||||
@@ -1682,7 +1682,7 @@ TEST_F(DrmCommandStreamLeaksTest, makeNonResidentOnMemObjectCallsDrmCSMakeNonRes
|
||||
|
||||
EXPECT_TRUE(tCsr->makeNonResidentResult.called);
|
||||
EXPECT_EQ(allocation1, tCsr->makeNonResidentResult.allocation);
|
||||
EXPECT_EQ(0u, mm->getEvictionAllocations().size());
|
||||
EXPECT_EQ(0u, tCsr->getEvictionAllocations().size());
|
||||
|
||||
mm->freeGraphicsMemory(allocation1);
|
||||
}
|
||||
|
||||
@@ -549,7 +549,7 @@ TEST_F(WddmCommandStreamTest, makeNonResidentPutsAllocationInEvictionAllocations
|
||||
|
||||
csr->makeNonResident(*commandBuffer);
|
||||
|
||||
EXPECT_EQ(1u, memManager->getEvictionAllocations().size());
|
||||
EXPECT_EQ(1u, csr->getEvictionAllocations().size());
|
||||
|
||||
memManager->freeGraphicsMemory(commandBuffer);
|
||||
}
|
||||
@@ -562,10 +562,10 @@ TEST_F(WddmCommandStreamTest, processEvictionPlacesAllAllocationsOnTrimCandidate
|
||||
ASSERT_NE(nullptr, allocation);
|
||||
ASSERT_NE(nullptr, allocation2);
|
||||
|
||||
memManager->pushAllocationForEviction(allocation);
|
||||
memManager->pushAllocationForEviction(allocation2);
|
||||
csr->pushAllocationForEviction(allocation);
|
||||
csr->pushAllocationForEviction(allocation2);
|
||||
|
||||
EXPECT_EQ(2u, memManager->getEvictionAllocations().size());
|
||||
EXPECT_EQ(2u, csr->getEvictionAllocations().size());
|
||||
|
||||
csr->processEviction();
|
||||
|
||||
@@ -581,13 +581,13 @@ TEST_F(WddmCommandStreamTest, processEvictionClearsEvictionAllocations) {
|
||||
GraphicsAllocation *allocation = memManager->allocateGraphicsMemory(4096);
|
||||
ASSERT_NE(nullptr, allocation);
|
||||
|
||||
memManager->pushAllocationForEviction(allocation);
|
||||
csr->pushAllocationForEviction(allocation);
|
||||
|
||||
EXPECT_EQ(1u, memManager->getEvictionAllocations().size());
|
||||
EXPECT_EQ(1u, csr->getEvictionAllocations().size());
|
||||
|
||||
csr->processEviction();
|
||||
|
||||
EXPECT_EQ(0u, memManager->getEvictionAllocations().size());
|
||||
EXPECT_EQ(0u, csr->getEvictionAllocations().size());
|
||||
|
||||
memManager->freeGraphicsMemory(allocation);
|
||||
}
|
||||
@@ -603,7 +603,7 @@ TEST_F(WddmCommandStreamTest, makeResidentNonResidentMemObj) {
|
||||
EXPECT_EQ(gfxAllocation, csr->getResidencyAllocations()[0]);
|
||||
|
||||
csr->makeNonResident(*buffer->getGraphicsAllocation());
|
||||
EXPECT_EQ(gfxAllocation, memManager->getEvictionAllocations()[0]);
|
||||
EXPECT_EQ(gfxAllocation, csr->getEvictionAllocations()[0]);
|
||||
|
||||
delete buffer;
|
||||
memManager->freeGraphicsMemory(gfxAllocation);
|
||||
@@ -709,7 +709,7 @@ TEST_F(WddmCommandStreamMockGdiTest, makeResidentClearsResidencyAllocations) {
|
||||
csr->makeResident(*commandBuffer);
|
||||
|
||||
EXPECT_EQ(1u, csr->getResidencyAllocations().size());
|
||||
EXPECT_EQ(0u, memManager->getEvictionAllocations().size());
|
||||
EXPECT_EQ(0u, csr->getEvictionAllocations().size());
|
||||
|
||||
EXPECT_EQ(trimListUnusedPosition, ((WddmAllocation *)commandBuffer)->getTrimCandidateListPosition());
|
||||
|
||||
@@ -718,7 +718,7 @@ TEST_F(WddmCommandStreamMockGdiTest, makeResidentClearsResidencyAllocations) {
|
||||
csr->makeSurfacePackNonResident(nullptr);
|
||||
|
||||
EXPECT_EQ(0u, csr->getResidencyAllocations().size());
|
||||
EXPECT_EQ(0u, memManager->getEvictionAllocations().size());
|
||||
EXPECT_EQ(0u, csr->getEvictionAllocations().size());
|
||||
|
||||
EXPECT_EQ(0u, ((WddmAllocation *)commandBuffer)->getTrimCandidateListPosition());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user