Allow debug allocs to use copyMemoryToAllocation

Signed-off-by: Szymon Morek <szymon.morek@intel.com>
This commit is contained in:
Szymon Morek
2022-11-14 12:06:54 +00:00
committed by Compute-Runtime-Automation
parent 1e0a2b897f
commit 3281dea1fe
7 changed files with 41 additions and 13 deletions

View File

@@ -1641,6 +1641,27 @@ TEST_F(DrmMemoryManagerCopyMemoryToAllocationPrelimTest, givenDrmMemoryManagerWh
drmMemoryManager.freeGraphicsMemory(allocation);
}
TEST_F(DrmMemoryManagerCopyMemoryToAllocationPrelimTest, givenDrmMemoryManagerWhenCopyDebugSurfaceToMultiTileAllocationThenCallCopyMemoryToAllocation) {
size_t sourceAllocationSize = MemoryConstants::pageSize;
size_t destinationAllocationSize = sourceAllocationSize;
DrmMemoryManagerToTestCopyMemoryToAllocation drmMemoryManager(*executionEnvironment, true, destinationAllocationSize);
std::vector<uint8_t> dataToCopy(sourceAllocationSize, 1u);
AllocationType debugSurfaces[] = {AllocationType::DEBUG_CONTEXT_SAVE_AREA, AllocationType::DEBUG_SBA_TRACKING_BUFFER};
for (auto type : debugSurfaces) {
AllocationProperties debugSurfaceProperties{0, true, sourceAllocationSize, type, false, false, 0b11};
auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(debugSurfaceProperties);
ASSERT_NE(nullptr, allocation);
auto ret = drmMemoryManager.copyMemoryToAllocation(allocation, 0, dataToCopy.data(), dataToCopy.size());
EXPECT_TRUE(ret);
EXPECT_EQ(0u, drmMemoryManager.copyMemoryToAllocationBanksCalled);
drmMemoryManager.freeGraphicsMemory(allocation);
}
}
TEST_F(DrmMemoryManagerCopyMemoryToAllocationPrelimTest, givenDrmMemoryManagerWhenCopyMemoryToAllocationFailsToLockResourceThenItReturnsFalse) {
DrmMemoryManagerToTestCopyMemoryToAllocation drmMemoryManager(*executionEnvironment, true, 0);
std::vector<uint8_t> dataToCopy(MemoryConstants::pageSize, 1u);