refactor: correct naming of allocation types

Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2023-12-11 14:24:36 +00:00
committed by Compute-Runtime-Automation
parent eac3d2130d
commit b182917d9d
302 changed files with 2536 additions and 2536 deletions

View File

@@ -105,7 +105,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamMemExecTest, GivenDrmSupportsVmBindAndComplet
mock->isVmBindAvailableCall.returnValue = true;
TestedBufferObject bo(rootDeviceIndex, mock, 128);
MockDrmAllocation cmdBuffer(rootDeviceIndex, AllocationType::COMMAND_BUFFER, MemoryPool::System4KBPages);
MockDrmAllocation cmdBuffer(rootDeviceIndex, AllocationType::commandBuffer, MemoryPool::System4KBPages);
cmdBuffer.bufferObjects[0] = &bo;
uint8_t buff[128];
@@ -139,7 +139,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamMemExecTest, GivenDrmSupportsVmBindAndNotComp
mock->isVmBindAvailableCall.returnValue = true;
TestedBufferObject bo(rootDeviceIndex, mock, 128);
MockDrmAllocation cmdBuffer(rootDeviceIndex, AllocationType::COMMAND_BUFFER, MemoryPool::System4KBPages);
MockDrmAllocation cmdBuffer(rootDeviceIndex, AllocationType::commandBuffer, MemoryPool::System4KBPages);
cmdBuffer.bufferObjects[0] = &bo;
uint8_t buff[128];
@@ -174,7 +174,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamMemExecTest, GivenDrmSupportsCompletionFenceA
mock->isVmBindAvailableCall.returnValue = false;
TestedBufferObject bo(rootDeviceIndex, mock, 128);
MockDrmAllocation cmdBuffer(rootDeviceIndex, AllocationType::COMMAND_BUFFER, MemoryPool::System4KBPages);
MockDrmAllocation cmdBuffer(rootDeviceIndex, AllocationType::commandBuffer, MemoryPool::System4KBPages);
cmdBuffer.bufferObjects[0] = &bo;
uint8_t buff[128];

View File

@@ -89,7 +89,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamTest, GivenExecBufferErrorWhenFlushInternalTh
mock->errnoRetVal = EWOULDBLOCK;
auto rootDeviceIndex = csr->getRootDeviceIndex();
TestedBufferObject bo(rootDeviceIndex, mock, 128);
MockDrmAllocation cmdBuffer(rootDeviceIndex, AllocationType::COMMAND_BUFFER, MemoryPool::System4KBPages);
MockDrmAllocation cmdBuffer(rootDeviceIndex, AllocationType::commandBuffer, MemoryPool::System4KBPages);
cmdBuffer.bufferObjects[0] = &bo;
uint8_t buff[128]{};
@@ -272,7 +272,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, givenDrmCsrCreatedWithInactiveG
HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, givenDrmAllocationWhenGetBufferObjectToModifyIsCalledForAGivenHandleIdThenTheCorrespondingBufferObjectGetsModified) {
auto size = 1024u;
auto allocation = new DrmAllocation(0, AllocationType::UNKNOWN, nullptr, nullptr, size, static_cast<osHandle>(0u), MemoryPool::MemoryNull);
auto allocation = new DrmAllocation(0, AllocationType::unknown, nullptr, nullptr, size, static_cast<osHandle>(0u), MemoryPool::MemoryNull);
auto &bos = allocation->getBOs();
for (auto handleId = 0u; handleId < EngineLimits::maxHandleCount; handleId++) {
@@ -292,7 +292,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, givenDrmAllocationWhenGetBuffer
HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, WhenMakingResidentThenSucceeds) {
auto buffer = this->createBO(1024);
auto allocation = new DrmAllocation(0, AllocationType::UNKNOWN, buffer, nullptr, buffer->peekSize(), static_cast<osHandle>(0u), MemoryPool::MemoryNull);
auto allocation = new DrmAllocation(0, AllocationType::unknown, buffer, nullptr, buffer->peekSize(), static_cast<osHandle>(0u), MemoryPool::MemoryNull);
EXPECT_EQ(nullptr, allocation->getUnderlyingBuffer());
csr->makeResident(*allocation);
@@ -310,8 +310,8 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, WhenMakingResidentThenSucceeds)
HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, GivenMultipleAllocationsWhenMakingResidentThenEachSucceeds) {
BufferObject *buffer1 = this->createBO(4096);
BufferObject *buffer2 = this->createBO(4096);
auto allocation1 = new DrmAllocation(0, AllocationType::UNKNOWN, buffer1, nullptr, buffer1->peekSize(), static_cast<osHandle>(0u), MemoryPool::MemoryNull);
auto allocation2 = new DrmAllocation(0, AllocationType::UNKNOWN, buffer2, nullptr, buffer2->peekSize(), static_cast<osHandle>(0u), MemoryPool::MemoryNull);
auto allocation1 = new DrmAllocation(0, AllocationType::unknown, buffer1, nullptr, buffer1->peekSize(), static_cast<osHandle>(0u), MemoryPool::MemoryNull);
auto allocation2 = new DrmAllocation(0, AllocationType::unknown, buffer2, nullptr, buffer2->peekSize(), static_cast<osHandle>(0u), MemoryPool::MemoryNull);
EXPECT_EQ(nullptr, allocation1->getUnderlyingBuffer());
EXPECT_EQ(nullptr, allocation2->getUnderlyingBuffer());
@@ -334,7 +334,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, GivenMultipleAllocationsWhenMak
HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, WhenMakingResidentTwiceThenRefCountIsOne) {
auto buffer = this->createBO(1024);
auto allocation = new DrmAllocation(0, AllocationType::UNKNOWN, buffer, nullptr, buffer->peekSize(), static_cast<osHandle>(0u), MemoryPool::MemoryNull);
auto allocation = new DrmAllocation(0, AllocationType::unknown, buffer, nullptr, buffer->peekSize(), static_cast<osHandle>(0u), MemoryPool::MemoryNull);
csr->makeResident(*allocation);
csr->processResidency(csr->getResidencyAllocations(), 0u);
@@ -852,7 +852,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, givenBindBOsFailsThenMakeBOsRes
auto bo = this->createBO(size);
BufferObjects bos{bo};
auto allocation = new MockDrmAllocationBindBOs(0, AllocationType::UNKNOWN, bos, nullptr, 0u, size, MemoryPool::LocalMemory);
auto allocation = new MockDrmAllocationBindBOs(0, AllocationType::unknown, bos, nullptr, 0u, size, MemoryPool::LocalMemory);
allocation->bindBOsResult = -1;
auto res = allocation->makeBOsResident(&csr->getOsContext(), 0, nullptr, true);
@@ -868,7 +868,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, givenFragmentStorageAndBindBOFa
auto bo = this->createBO(size);
BufferObjects bos{bo};
auto allocation = new MockDrmAllocationBindBO(0, AllocationType::UNKNOWN, bos, nullptr, 0u, size, MemoryPool::LocalMemory);
auto allocation = new MockDrmAllocationBindBO(0, AllocationType::unknown, bos, nullptr, 0u, size, MemoryPool::LocalMemory);
allocation->bindBOResult = -1;
OsHandleStorage prevStorage;
@@ -899,7 +899,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, givenBindBOFailsThenBindBOsRetu
auto bo = this->createBO(size);
BufferObjects bos{bo};
auto allocation = new MockDrmAllocationBindBO(0, AllocationType::UNKNOWN, bos, nullptr, 0u, size, MemoryPool::LocalMemory);
auto allocation = new MockDrmAllocationBindBO(0, AllocationType::unknown, bos, nullptr, 0u, size, MemoryPool::LocalMemory);
allocation->bindBOResult = -1;
auto res = allocation->bindBOs(&csr->getOsContext(), 0u, &static_cast<TestedDrmCommandStreamReceiver<FamilyType> *>(csr)->residency, false);
@@ -915,7 +915,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, givenBindBOFailsWithMultipleMem
auto bo2 = this->createBO(size);
BufferObjects bos{bo, bo2};
auto allocation = new MockDrmAllocationBindBO(0, AllocationType::UNKNOWN, bos, nullptr, 0u, size, MemoryPool::LocalMemory);
auto allocation = new MockDrmAllocationBindBO(0, AllocationType::unknown, bos, nullptr, 0u, size, MemoryPool::LocalMemory);
allocation->bindBOResult = -1;
allocation->storageInfo.memoryBanks = 0b11;
EXPECT_EQ(allocation->storageInfo.getNumBanks(), 2u);
@@ -933,7 +933,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, givenBindBOFailsWithMultipleMem
auto bo2 = this->createBO(size);
BufferObjects bos{bo, bo2};
auto allocation = new MockDrmAllocationBindBO(0, AllocationType::UNKNOWN, bos, nullptr, 0u, size, MemoryPool::LocalMemory);
auto allocation = new MockDrmAllocationBindBO(0, AllocationType::unknown, bos, nullptr, 0u, size, MemoryPool::LocalMemory);
allocation->bindBOResult = -1;
allocation->storageInfo.tileInstanced = true;
allocation->storageInfo.memoryBanks = 0b11;
@@ -950,7 +950,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, givenAllocationWithSingleBuffer
auto size = 1024u;
auto bo = this->createBO(size);
BufferObjects bos{bo};
auto allocation = new DrmAllocation(0, AllocationType::UNKNOWN, bos, nullptr, 0u, size, MemoryPool::LocalMemory);
auto allocation = new DrmAllocation(0, AllocationType::unknown, bos, nullptr, 0u, size, MemoryPool::LocalMemory);
EXPECT_EQ(bo, allocation->getBO());
makeResidentBufferObjects<FamilyType>(&csr->getOsContext(), allocation);

View File

@@ -125,7 +125,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamTest, givenDebugFlagSetWhenSubmittingThenCall
}
HWTEST_TEMPLATED_F(DrmCommandStreamTest, WhenMakingResidentThenSucceeds) {
DrmAllocation graphicsAllocation(0, AllocationType::UNKNOWN, nullptr, nullptr, 1024, static_cast<osHandle>(1u), MemoryPool::MemoryNull);
DrmAllocation graphicsAllocation(0, AllocationType::unknown, nullptr, nullptr, 1024, static_cast<osHandle>(1u), MemoryPool::MemoryNull);
csr->makeResident(graphicsAllocation);
EXPECT_EQ(0, mock->ioctlCount.gemUserptr);
@@ -137,7 +137,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamTest, WhenMakingResidentThenSucceeds) {
}
HWTEST_TEMPLATED_F(DrmCommandStreamTest, WhenMakingResidentTwiceThenSucceeds) {
DrmAllocation graphicsAllocation(0, AllocationType::UNKNOWN, nullptr, nullptr, 1024, static_cast<osHandle>(1u), MemoryPool::MemoryNull);
DrmAllocation graphicsAllocation(0, AllocationType::unknown, nullptr, nullptr, 1024, static_cast<osHandle>(1u), MemoryPool::MemoryNull);
csr->makeResident(graphicsAllocation);
csr->makeResident(graphicsAllocation);
@@ -151,7 +151,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamTest, WhenMakingResidentTwiceThenSucceeds) {
}
HWTEST_TEMPLATED_F(DrmCommandStreamTest, GivenSizeZeroWhenMakingResidentTwiceThenSucceeds) {
DrmAllocation graphicsAllocation(0, AllocationType::UNKNOWN, nullptr, nullptr, 0, static_cast<osHandle>(1u), MemoryPool::MemoryNull);
DrmAllocation graphicsAllocation(0, AllocationType::unknown, nullptr, nullptr, 0, static_cast<osHandle>(1u), MemoryPool::MemoryNull);
csr->makeResident(graphicsAllocation);
@@ -164,8 +164,8 @@ HWTEST_TEMPLATED_F(DrmCommandStreamTest, GivenSizeZeroWhenMakingResidentTwiceThe
}
HWTEST_TEMPLATED_F(DrmCommandStreamTest, GivenResizedWhenMakingResidentTwiceThenSucceeds) {
DrmAllocation graphicsAllocation(0, AllocationType::UNKNOWN, nullptr, nullptr, 1024, static_cast<osHandle>(1u), MemoryPool::MemoryNull);
DrmAllocation graphicsAllocation2(0, AllocationType::UNKNOWN, nullptr, nullptr, 8192, static_cast<osHandle>(1u), MemoryPool::MemoryNull);
DrmAllocation graphicsAllocation(0, AllocationType::unknown, nullptr, nullptr, 1024, static_cast<osHandle>(1u), MemoryPool::MemoryNull);
DrmAllocation graphicsAllocation2(0, AllocationType::unknown, nullptr, nullptr, 8192, static_cast<osHandle>(1u), MemoryPool::MemoryNull);
csr->makeResident(graphicsAllocation);
csr->makeResident(graphicsAllocation2);
@@ -302,7 +302,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamTest, GivenInvalidAddressWhenFlushingThenSucc
ASSERT_NE(nullptr, commandBuffer); // NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks)
auto canonizedGpuAddress = gmmHelper->canonize(castToUint64(commandBuffer));
DrmAllocation commandBufferAllocation(0, AllocationType::COMMAND_BUFFER, nullptr, commandBuffer, 1024, static_cast<osHandle>(1u), MemoryPool::MemoryNull, canonizedGpuAddress);
DrmAllocation commandBufferAllocation(0, AllocationType::commandBuffer, nullptr, commandBuffer, 1024, static_cast<osHandle>(1u), MemoryPool::MemoryNull, canonizedGpuAddress);
LinearStream cs(&commandBufferAllocation);
CommandStreamReceiverHw<FamilyType>::addBatchBufferEnd(cs, nullptr);
@@ -395,8 +395,8 @@ HWTEST_TEMPLATED_F(DrmCommandStreamTest, GivenNotAlignedWhenFlushingThenSucceeds
HWTEST_TEMPLATED_F(DrmCommandStreamTest, GivenCheckFlagsWhenFlushingThenSucceeds) {
auto &cs = csr->getCS();
DrmAllocation allocation(0, AllocationType::UNKNOWN, nullptr, (void *)0x7FFFFFFF, 1024, static_cast<osHandle>(0u), MemoryPool::MemoryNull);
DrmAllocation allocation2(0, AllocationType::UNKNOWN, nullptr, (void *)0x307FFFFFFF, 1024, static_cast<osHandle>(0u), MemoryPool::MemoryNull);
DrmAllocation allocation(0, AllocationType::unknown, nullptr, (void *)0x7FFFFFFF, 1024, static_cast<osHandle>(0u), MemoryPool::MemoryNull);
DrmAllocation allocation2(0, AllocationType::unknown, nullptr, (void *)0x307FFFFFFF, 1024, static_cast<osHandle>(0u), MemoryPool::MemoryNull);
csr->makeResident(allocation);
csr->makeResident(allocation2);
CommandStreamReceiverHw<FamilyType>::addBatchBufferEnd(cs, nullptr);
@@ -420,7 +420,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamTest, GivenCheckDrmFreeWhenFlushingThenSuccee
auto expectedBatchStartOffset = (reinterpret_cast<uintptr_t>(commandBuffer->getUnderlyingBuffer()) + 4) & (this->alignment - 1);
auto expectedSize = alignUp(8u, MemoryConstants::cacheLineSize); // bbEnd
DrmAllocation allocation(0, AllocationType::UNKNOWN, nullptr, nullptr, 1024, static_cast<osHandle>(0u), MemoryPool::MemoryNull);
DrmAllocation allocation(0, AllocationType::unknown, nullptr, nullptr, 1024, static_cast<osHandle>(0u), MemoryPool::MemoryNull);
csr->makeResident(allocation);
CommandStreamReceiverHw<FamilyType>::addBatchBufferEnd(cs, nullptr);
@@ -463,7 +463,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamTest, GivenCheckDrmFreeCloseFailedWhenFlushin
mock->storedRetValForGemClose = -1;
DrmAllocation allocation(0, AllocationType::UNKNOWN, nullptr, nullptr, 1024, static_cast<osHandle>(0u), MemoryPool::MemoryNull);
DrmAllocation allocation(0, AllocationType::unknown, nullptr, nullptr, 1024, static_cast<osHandle>(0u), MemoryPool::MemoryNull);
csr->makeResident(allocation);
CommandStreamReceiverHw<FamilyType>::addBatchBufferEnd(cs, nullptr);
@@ -1068,9 +1068,9 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, givenPrintBOsForSubmitWhenPrint
DebugManagerStateRestore restorer;
debugManager.flags.PrintBOsForSubmit.set(true);
MockDrmAllocation allocation1(rootDeviceIndex, AllocationType::BUFFER, MemoryPool::System4KBPages);
MockDrmAllocation allocation2(rootDeviceIndex, AllocationType::BUFFER, MemoryPool::System4KBPages);
MockDrmAllocation cmdBuffer(rootDeviceIndex, AllocationType::COMMAND_BUFFER, MemoryPool::System4KBPages);
MockDrmAllocation allocation1(rootDeviceIndex, AllocationType::buffer, MemoryPool::System4KBPages);
MockDrmAllocation allocation2(rootDeviceIndex, AllocationType::buffer, MemoryPool::System4KBPages);
MockDrmAllocation cmdBuffer(rootDeviceIndex, AllocationType::commandBuffer, MemoryPool::System4KBPages);
csr->makeResident(allocation1);
csr->makeResident(allocation2);
@@ -1104,9 +1104,9 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, givenPrintBOsForSubmitAndFailur
DebugManagerStateRestore restorer;
debugManager.flags.PrintBOsForSubmit.set(true);
MockDrmAllocation allocation1(rootDeviceIndex, AllocationType::BUFFER, MemoryPool::System4KBPages);
MockDrmAllocation allocation2(rootDeviceIndex, AllocationType::BUFFER, MemoryPool::System4KBPages);
MockDrmAllocation cmdBuffer(rootDeviceIndex, AllocationType::COMMAND_BUFFER, MemoryPool::System4KBPages);
MockDrmAllocation allocation1(rootDeviceIndex, AllocationType::buffer, MemoryPool::System4KBPages);
MockDrmAllocation allocation2(rootDeviceIndex, AllocationType::buffer, MemoryPool::System4KBPages);
MockDrmAllocation cmdBuffer(rootDeviceIndex, AllocationType::commandBuffer, MemoryPool::System4KBPages);
cmdBuffer.makeBOsResidentResult = ENOSPC;
@@ -1129,9 +1129,9 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, givenPrintBOsForSubmitAndFailur
DebugManagerStateRestore restorer;
debugManager.flags.PrintBOsForSubmit.set(true);
MockDrmAllocation allocation1(rootDeviceIndex, AllocationType::BUFFER, MemoryPool::System4KBPages);
MockDrmAllocation allocation2(rootDeviceIndex, AllocationType::BUFFER, MemoryPool::System4KBPages);
MockDrmAllocation cmdBuffer(rootDeviceIndex, AllocationType::COMMAND_BUFFER, MemoryPool::System4KBPages);
MockDrmAllocation allocation1(rootDeviceIndex, AllocationType::buffer, MemoryPool::System4KBPages);
MockDrmAllocation allocation2(rootDeviceIndex, AllocationType::buffer, MemoryPool::System4KBPages);
MockDrmAllocation cmdBuffer(rootDeviceIndex, AllocationType::commandBuffer, MemoryPool::System4KBPages);
allocation1.makeBOsResidentResult = ENOSPC;

View File

@@ -32,7 +32,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, givenAllocationWithMultipleBuff
auto bo2 = this->createBO(size);
auto bo3 = this->createBO(size);
BufferObjects bos{bo0, bo1, bo2, bo3};
auto allocation = new DrmAllocation(0, AllocationType::UNKNOWN, bos, nullptr, 0u, size, MemoryPool::LocalMemory);
auto allocation = new DrmAllocation(0, AllocationType::unknown, bos, nullptr, 0u, size, MemoryPool::LocalMemory);
allocation->storageInfo.memoryBanks = maxNBitValue(MemoryBanks::getBankForLocalMemory(3));
csr->CommandStreamReceiver::makeResident(*allocation);
@@ -258,7 +258,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, givenAllocationWithMultipleBuff
auto bo2 = this->createBO(size);
auto bo3 = this->createBO(size);
BufferObjects bos{bo0, bo1, bo2, bo3};
auto allocation = new DrmAllocation(0, AllocationType::UNKNOWN, bos, nullptr, 0u, size, MemoryPool::LocalMemory);
auto allocation = new DrmAllocation(0, AllocationType::unknown, bos, nullptr, 0u, size, MemoryPool::LocalMemory);
allocation->storageInfo.memoryBanks = maxNBitValue(MemoryBanks::getBankForLocalMemory(3));
allocation->storageInfo.tileInstanced = true;
@@ -466,14 +466,14 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, DrmImplicitScalingCommandStreamTest, givenTwoTilesW
auto multiStorageBo0 = new BufferObject(0u, drm, 3, 30, 0, 1);
auto multiStorageBo1 = new BufferObject(0u, drm, 3, 31, 0, 1);
BufferObjects multiStorageBos{multiStorageBo0, multiStorageBo1};
auto multiStorageAllocation = new DrmAllocation(0, AllocationType::UNKNOWN, multiStorageBos, nullptr, 0u, size, MemoryPool::LocalMemory);
auto multiStorageAllocation = new DrmAllocation(0, AllocationType::unknown, multiStorageBos, nullptr, 0u, size, MemoryPool::LocalMemory);
multiStorageAllocation->storageInfo.memoryBanks = 0b11;
csr->CommandStreamReceiver::makeResident(*multiStorageAllocation);
auto tileInstancedBo0 = new BufferObject(0u, drm, 3, 40, 0, 1);
auto tileInstancedBo1 = new BufferObject(0u, drm, 3, 41, 0, 1);
BufferObjects tileInstancedBos{tileInstancedBo0, tileInstancedBo1};
auto tileInstancedAllocation = new DrmAllocation(0, AllocationType::UNKNOWN, tileInstancedBos, nullptr, 0u, size, MemoryPool::LocalMemory);
auto tileInstancedAllocation = new DrmAllocation(0, AllocationType::unknown, tileInstancedBos, nullptr, 0u, size, MemoryPool::LocalMemory);
tileInstancedAllocation->storageInfo.memoryBanks = 0b11;
tileInstancedAllocation->storageInfo.tileInstanced = true;
csr->CommandStreamReceiver::makeResident(*tileInstancedAllocation);
@@ -540,7 +540,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, DrmImplicitScalingCommandStreamTest, whenForceExecu
auto tileInstancedBo2 = new BufferObject(0u, drm, 3, 42, 0, 1);
auto tileInstancedBo3 = new BufferObject(0u, drm, 3, 43, 0, 1);
BufferObjects tileInstancedBos{tileInstancedBo0, tileInstancedBo1, tileInstancedBo2, tileInstancedBo3};
auto tileInstancedAllocation = new DrmAllocation(0, AllocationType::UNKNOWN, tileInstancedBos, nullptr, 0u, 1024u, MemoryPool::LocalMemory);
auto tileInstancedAllocation = new DrmAllocation(0, AllocationType::unknown, tileInstancedBos, nullptr, 0u, 1024u, MemoryPool::LocalMemory);
tileInstancedAllocation->storageInfo.memoryBanks = 0b11;
tileInstancedAllocation->storageInfo.tileInstanced = true;
csr->CommandStreamReceiver::makeResident(*tileInstancedAllocation);
@@ -583,7 +583,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, DrmImplicitScalingCommandStreamTest, whenForceExecu
auto tileInstancedBo2 = new BufferObject(0u, drm, 3, 42, 0, 1);
auto tileInstancedBo3 = new BufferObject(0u, drm, 3, 43, 0, 1);
BufferObjects tileInstancedBos{tileInstancedBo0, tileInstancedBo1, tileInstancedBo2, tileInstancedBo3};
auto tileInstancedAllocation = new DrmAllocation(0, AllocationType::UNKNOWN, tileInstancedBos, nullptr, 0u, 1024u, MemoryPool::LocalMemory);
auto tileInstancedAllocation = new DrmAllocation(0, AllocationType::unknown, tileInstancedBos, nullptr, 0u, 1024u, MemoryPool::LocalMemory);
tileInstancedAllocation->storageInfo.memoryBanks = 0b11;
tileInstancedAllocation->storageInfo.tileInstanced = true;
csr->CommandStreamReceiver::makeResident(*tileInstancedAllocation);
@@ -629,7 +629,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, DrmImplicitScalingCommandStreamTest, givenDisabledI
const auto size = 1024u;
BufferObject *bufferObject = new BufferObject(0u, drm, 3, 30, 0, 1);
BufferObjects bufferObjects{bufferObject};
auto allocation = new DrmAllocation(0, AllocationType::UNKNOWN, bufferObjects, nullptr, 0u, size, MemoryPool::LocalMemory);
auto allocation = new DrmAllocation(0, AllocationType::unknown, bufferObjects, nullptr, 0u, size, MemoryPool::LocalMemory);
csr->CommandStreamReceiver::makeResident(*allocation);
auto &cs = csr->getCS();
@@ -663,7 +663,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, DrmImplicitScalingCommandStreamTest, givenMultiTile
const auto size = 1024u;
BufferObject *bufferObject = new BufferObject(0u, drm, 3, 30, 0, 1);
BufferObjects bufferObjects{bufferObject};
auto allocation = new DrmAllocation(0, AllocationType::UNKNOWN, bufferObjects, nullptr, 0u, size, MemoryPool::LocalMemory);
auto allocation = new DrmAllocation(0, AllocationType::unknown, bufferObjects, nullptr, 0u, size, MemoryPool::LocalMemory);
csr->CommandStreamReceiver::makeResident(*allocation);
auto &cs = csr->getCS();

View File

@@ -83,7 +83,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, DrmCommandStreamMultiTileMemExecTest, GivenDrmSuppo
mock->isVmBindAvailableCall.returnValue = true;
TestedBufferObject bo(0, mock, 128);
MockDrmAllocation cmdBuffer(0u, AllocationType::COMMAND_BUFFER, MemoryPool::System4KBPages);
MockDrmAllocation cmdBuffer(0u, AllocationType::commandBuffer, MemoryPool::System4KBPages);
cmdBuffer.bufferObjects[0] = &bo;
uint8_t buff[128];
@@ -124,7 +124,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, DrmCommandStreamMultiTileMemExecTest, GivenDrmSuppo
mock->isVmBindAvailableCall.callParent = false;
mock->isVmBindAvailableCall.returnValue = true;
auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{0, 1024, AllocationType::COMMAND_BUFFER});
auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{0, 1024, AllocationType::commandBuffer});
allocation->updateTaskCount(2, defaultEngine.osContext->getContextId());
volatile TagAddressType *completionAddress = defaultEngine.commandStreamReceiver->getTagAddress();
@@ -158,7 +158,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, DrmCommandStreamMultiTileMemExecTest, GivenDrmSuppo
mock->isVmBindAvailableCall.callParent = false;
mock->isVmBindAvailableCall.returnValue = true;
auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{0, 1024, AllocationType::COMMAND_BUFFER});
auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{0, 1024, AllocationType::commandBuffer});
allocation->updateTaskCount(2, defaultEngine.osContext->getContextId());
volatile TagAddressType *completionAddress = defaultEngine.commandStreamReceiver->getTagAddress();

View File

@@ -90,7 +90,7 @@ class DrmGemCloseWorkerFixture {
class DrmAllocationWrapper : public DrmAllocation {
public:
DrmAllocationWrapper(BufferObject *bo)
: DrmAllocation(0, AllocationType::UNKNOWN, bo, nullptr, 0, static_cast<osHandle>(0u), MemoryPool::MemoryNull) {
: DrmAllocation(0, AllocationType::unknown, bo, nullptr, 0, static_cast<osHandle>(0u), MemoryPool::MemoryNull) {
}
};
MockExecutionEnvironment executionEnvironment;

View File

@@ -35,7 +35,7 @@ struct GlobalBindlessDrmMemManagerFixture : public DrmMemoryManagerFixtureWithou
using DrmGlobalBindlessAllocatorTests = Test<GlobalBindlessDrmMemManagerFixture>;
TEST_F(DrmGlobalBindlessAllocatorTests, givenLocalMemoryWhenSurfaceStatesAllocationCreatedThenGpuBaseAddressIsSetToCorrectBaseAddress) {
MockAllocationProperties properties(rootDeviceIndex, true, MemoryConstants::pageSize64k, AllocationType::LINEAR_STREAM);
MockAllocationProperties properties(rootDeviceIndex, true, MemoryConstants::pageSize64k, AllocationType::linearStream);
executionEnvironment->rootDeviceEnvironments[rootDeviceIndex]->createBindlessHeapsHelper(memoryManager.get(), false, rootDeviceIndex, 1);
auto allocation = memoryManager->allocateGraphicsMemoryInPreferredPool(properties, nullptr);
ASSERT_NE(nullptr, allocation);
@@ -52,7 +52,7 @@ TEST_F(DrmGlobalBindlessAllocatorTests, givenLocalMemoryWhenSurfaceStatesAllocat
TEST_F(DrmGlobalBindlessAllocatorTests, givenLocalMemoryWhenSurfaceStatesAllocationCreatedInDevicePoolThenGpuBaseAddressIsSetToBindlessBaseAddress) {
debugManager.flags.ForceLocalMemoryAccessMode.set(0);
AllocationData allocData = {};
allocData.type = AllocationType::LINEAR_STREAM;
allocData.type = AllocationType::linearStream;
allocData.size = MemoryConstants::pageSize64k;
executionEnvironment->rootDeviceEnvironments[rootDeviceIndex]->createBindlessHeapsHelper(memoryManager.get(), false, rootDeviceIndex, 1);
@@ -72,7 +72,7 @@ TEST_F(DrmGlobalBindlessAllocatorTests, givenLocalMemoryWhenSurfaceStatesAllocat
TEST_F(DrmGlobalBindlessAllocatorTests, givenLocalMemoryWhenSpecialSshHeapCreatedInDevicePoolThenGpuAddressIsSetToBindlessBaseAddress) {
debugManager.flags.ForceLocalMemoryAccessMode.set(0);
AllocationData allocData = {};
allocData.type = AllocationType::LINEAR_STREAM;
allocData.type = AllocationType::linearStream;
allocData.size = MemoryConstants::pageSize64k;
executionEnvironment->rootDeviceEnvironments[rootDeviceIndex]->createBindlessHeapsHelper(memoryManager.get(), false, rootDeviceIndex, 1);
@@ -89,12 +89,12 @@ TEST_F(DrmGlobalBindlessAllocatorTests, givenLocalMemoryWhenSpecialSshHeapCreate
TEST_F(DrmGlobalBindlessAllocatorTests, givenLocalMemoryWhenSurfaceStatesAllocationCreatedInPreferredPoolThenGpuBaseAddressIsSetToCorrectBaseAddress) {
AllocationData allocData = {};
allocData.type = AllocationType::LINEAR_STREAM;
allocData.type = AllocationType::linearStream;
allocData.size = MemoryConstants::pageSize64k;
executionEnvironment->rootDeviceEnvironments[0]->createBindlessHeapsHelper(memoryManager.get(), false, rootDeviceIndex, 1);
AllocationProperties properties = {rootDeviceIndex, MemoryConstants::pageSize64k, AllocationType::LINEAR_STREAM, {}};
AllocationProperties properties = {rootDeviceIndex, MemoryConstants::pageSize64k, AllocationType::linearStream, {}};
auto allocation = memoryManager->allocateGraphicsMemoryInPreferredPool(properties, nullptr);
ASSERT_NE(nullptr, allocation);
auto gmmHelper = memoryManager->getGmmHelper(rootDeviceIndex);

View File

@@ -22,13 +22,13 @@
#include "gtest/gtest.h"
TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenCreateDebugSurfaceWithUnalignedSizeCalledThenNullptrReturned) {
AllocationProperties debugSurfaceProperties{0, true, MemoryConstants::pageSize + 101, NEO::AllocationType::DEBUG_CONTEXT_SAVE_AREA, false, false, 0b1011};
AllocationProperties debugSurfaceProperties{0, true, MemoryConstants::pageSize + 101, NEO::AllocationType::debugContextSaveArea, false, false, 0b1011};
auto debugSurface = memoryManager->allocateGraphicsMemoryWithProperties(debugSurfaceProperties);
EXPECT_EQ(nullptr, debugSurface);
}
TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenCreateDebugSurfaceAndAlignedMallocFailedThenNullptrReturned) {
AllocationProperties debugSurfaceProperties{0, true, MemoryConstants::pageSize, NEO::AllocationType::DEBUG_CONTEXT_SAVE_AREA, false, false, 0b1011};
AllocationProperties debugSurfaceProperties{0, true, MemoryConstants::pageSize, NEO::AllocationType::debugContextSaveArea, false, false, 0b1011};
memoryManager->alignedMallocShouldFail = true;
auto debugSurface = memoryManager->allocateGraphicsMemoryWithProperties(debugSurfaceProperties);
memoryManager->alignedMallocShouldFail = false;
@@ -37,7 +37,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenCreateDebugSurfaceAndAlignedM
TEST_F(DrmMemoryManagerLocalMemoryWithCustomPrelimMockTest, givenCreateDebugSurfaceAndAllocUserptrFailedThenNullptrReturned) {
mock->ioctlRes = -1;
AllocationProperties debugSurfaceProperties{0, true, MemoryConstants::pageSize, NEO::AllocationType::DEBUG_CONTEXT_SAVE_AREA, false, false, 0b1011};
AllocationProperties debugSurfaceProperties{0, true, MemoryConstants::pageSize, NEO::AllocationType::debugContextSaveArea, false, false, 0b1011};
auto debugSurface = memoryManager->allocateGraphicsMemoryWithProperties(debugSurfaceProperties);
mock->ioctlRes = 0;
EXPECT_EQ(1, mock->ioctlCnt.gemUserptr);
@@ -45,7 +45,7 @@ TEST_F(DrmMemoryManagerLocalMemoryWithCustomPrelimMockTest, givenCreateDebugSurf
}
TEST_F(DrmMemoryManagerLocalMemoryWithCustomPrelimMockTest, givenCreateDebugSurfaceSuccessThenCorrectMultiHostAllocationReturned) {
AllocationProperties debugSurfaceProperties{0, true, MemoryConstants::pageSize, NEO::AllocationType::DEBUG_CONTEXT_SAVE_AREA, false, false, 0b1011};
AllocationProperties debugSurfaceProperties{0, true, MemoryConstants::pageSize, NEO::AllocationType::debugContextSaveArea, false, false, 0b1011};
auto debugSurface = static_cast<DrmAllocation *>(memoryManager->allocateGraphicsMemoryWithProperties(debugSurfaceProperties));
EXPECT_NE(nullptr, debugSurface);

View File

@@ -31,7 +31,7 @@
TEST_F(DrmMemoryManagerLocalMemoryWithCustomPrelimMockTest, givenDrmMemoryManagerWithLocalMemoryWhenLockResourceIsCalledOnBufferObjectThenReturnPtr) {
BufferObject bo(0, mock, 3, 1, 1024, 1);
DrmAllocation drmAllocation(0, AllocationType::UNKNOWN, &bo, nullptr, 0u, 0u, MemoryPool::LocalMemory);
DrmAllocation drmAllocation(0, AllocationType::unknown, &bo, nullptr, 0u, 0u, MemoryPool::LocalMemory);
EXPECT_EQ(&bo, drmAllocation.getBO());
auto ptr = memoryManager->lockBufferObject(&bo);
@@ -56,7 +56,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenDrmMemoryManagerWithPrelimSup
auto bo = std::unique_ptr<BufferObject>(memoryManager->createBufferObjectInMemoryRegion(0u,
nullptr,
AllocationType::BUFFER,
AllocationType::buffer,
gpuAddress,
size,
(1 << (MemoryBanks::getBankForLocalMemory(0) - 1)),
@@ -115,7 +115,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenMultiRootDeviceEnvironmentAnd
executionEnvironment->memoryManager.reset(memoryManager);
size_t size = 4096u;
AllocationProperties properties(rootDeviceIndex, true, size, AllocationType::BUFFER_HOST_MEMORY, false, {});
AllocationProperties properties(rootDeviceIndex, true, size, AllocationType::bufferHostMemory, false, {});
static_cast<DrmQueryMock *>(executionEnvironment->rootDeviceEnvironments[0]->osInterface->getDriverModel()->as<Drm>())->outputFd = 7;
@@ -165,7 +165,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenMultiRootDeviceEnvironmentAnd
executionEnvironment->memoryManager.reset(memoryManager);
size_t size = 4096u;
AllocationProperties properties(rootDeviceIndex, true, size, AllocationType::BUFFER_HOST_MEMORY, false, {});
AllocationProperties properties(rootDeviceIndex, true, size, AllocationType::bufferHostMemory, false, {});
memoryManager->failOnObtainFdFromHandle = true;
auto ptr = memoryManager->createMultiGraphicsAllocationInSystemMemoryPool(rootDeviceIndices, properties, multiGraphics);
@@ -204,7 +204,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenMultiRootDeviceEnvironmentAnd
auto memoryManager = std::make_unique<TestedDrmMemoryManager>(true, false, false, *executionEnvironment);
size_t size = 4096u;
AllocationProperties properties(rootDeviceIndex, true, size, AllocationType::BUFFER_HOST_MEMORY, false, {});
AllocationProperties properties(rootDeviceIndex, true, size, AllocationType::bufferHostMemory, false, {});
auto ptr = memoryManager->createMultiGraphicsAllocationInSystemMemoryPool(rootDeviceIndices, properties, multiGraphics);
@@ -241,7 +241,7 @@ TEST_F(DrmMemoryManagerUsmSharedHandlePrelimTest, givenMultiRootDeviceEnvironmen
auto memoryManager = std::make_unique<TestedDrmMemoryManager>(true, false, false, *executionEnvironment);
size_t size = 4096u;
AllocationProperties properties(rootDeviceIndex, true, size, AllocationType::BUFFER_HOST_MEMORY, false, {});
AllocationProperties properties(rootDeviceIndex, true, size, AllocationType::bufferHostMemory, false, {});
auto ptr = memoryManager->createUSMHostAllocationFromSharedHandle(1, properties, false, true);
EXPECT_EQ(ptr, nullptr);
@@ -275,7 +275,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenMultiRootDeviceEnvironmentAnd
auto memoryManager = std::make_unique<TestedDrmMemoryManager>(true, false, false, *executionEnvironment);
size_t size = 4096u;
AllocationProperties properties(rootDeviceIndex, true, size, AllocationType::BUFFER_HOST_MEMORY, false, {});
AllocationProperties properties(rootDeviceIndex, true, size, AllocationType::bufferHostMemory, false, {});
auto ptr = memoryManager->createMultiGraphicsAllocationInSystemMemoryPool(rootDeviceIndices, properties, multiGraphics);
@@ -301,7 +301,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, whenCreateUnifiedMemoryAllocationT
AllocationProperties gpuProperties{0u,
MemoryConstants::pageSize64k,
AllocationType::UNIFIED_SHARED_MEMORY,
AllocationType::unifiedSharedMemory,
1u};
gpuProperties.alignment = 2 * MemoryConstants::megaByte;
gpuProperties.usmInitialPlacement = GraphicsAllocation::UsmInitialPlacement::CPU;
@@ -342,7 +342,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest,
AllocationProperties gpuProperties{0u,
MemoryConstants::chunkThreshold,
AllocationType::UNIFIED_SHARED_MEMORY,
AllocationType::unifiedSharedMemory,
1u};
gpuProperties.alignment = 2 * MemoryConstants::megaByte;
gpuProperties.usmInitialPlacement = GraphicsAllocation::UsmInitialPlacement::CPU;
@@ -383,7 +383,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest,
AllocationProperties gpuProperties{0u,
MemoryConstants::chunkThreshold,
AllocationType::UNIFIED_SHARED_MEMORY,
AllocationType::unifiedSharedMemory,
1u};
gpuProperties.alignment = 2 * MemoryConstants::megaByte;
gpuProperties.usmInitialPlacement = GraphicsAllocation::UsmInitialPlacement::CPU;
@@ -425,7 +425,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest,
AllocationProperties gpuProperties{0u,
mock->minimalChunkingSize / 2,
AllocationType::UNIFIED_SHARED_MEMORY,
AllocationType::unifiedSharedMemory,
1u};
gpuProperties.alignment = 2 * MemoryConstants::megaByte;
gpuProperties.usmInitialPlacement = GraphicsAllocation::UsmInitialPlacement::CPU;
@@ -467,7 +467,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest,
AllocationProperties gpuProperties{0u,
mock->minimalChunkingSize * 2,
AllocationType::UNIFIED_SHARED_MEMORY,
AllocationType::unifiedSharedMemory,
1u};
gpuProperties.alignment = 2 * MemoryConstants::megaByte;
gpuProperties.usmInitialPlacement = GraphicsAllocation::UsmInitialPlacement::CPU;
@@ -511,7 +511,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest,
AllocationProperties gpuProperties{0u,
mock->minimalChunkingSize * 2,
AllocationType::UNIFIED_SHARED_MEMORY,
AllocationType::unifiedSharedMemory,
1u};
gpuProperties.alignment = 2 * MemoryConstants::megaByte;
gpuProperties.usmInitialPlacement = GraphicsAllocation::UsmInitialPlacement::CPU;
@@ -551,7 +551,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest,
AllocationProperties gpuProperties{0u,
MemoryConstants::chunkThreshold,
AllocationType::UNIFIED_SHARED_MEMORY,
AllocationType::unifiedSharedMemory,
1u};
gpuProperties.alignment = 2 * MemoryConstants::megaByte;
gpuProperties.usmInitialPlacement = GraphicsAllocation::UsmInitialPlacement::CPU;
@@ -593,7 +593,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, whenCreateUnifiedMemoryAllocationW
0u,
true,
MemoryConstants::megaByte,
AllocationType::UNIFIED_SHARED_MEMORY,
AllocationType::unifiedSharedMemory,
false,
devices};
gpuProperties.alignment = MemoryConstants::pageSize64k;
@@ -640,7 +640,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenKMDSupportForCrossTileMigrati
0u,
true,
MemoryConstants::pageSize64k,
AllocationType::UNIFIED_SHARED_MEMORY,
AllocationType::unifiedSharedMemory,
false,
devices};
gpuProperties.alignment = 2 * MemoryConstants::megaByte;
@@ -1123,7 +1123,7 @@ TEST_F(DrmMemoryManagerWithSingleSubDevicePrelimTest, givenUnifiedMemoryAllocati
DeviceBitfield subDevices = 0b01;
AllocationProperties gpuProperties{0u,
MemoryConstants::pageSize64k,
AllocationType::UNIFIED_SHARED_MEMORY,
AllocationType::unifiedSharedMemory,
subDevices};
gpuProperties.alignment = 2 * MemoryConstants::megaByte;
gpuProperties.usmInitialPlacement = GraphicsAllocation::UsmInitialPlacement::GPU;
@@ -1146,7 +1146,7 @@ TEST_F(DrmMemoryManagerWithMultipleSubDevicesPrelimTest, givenUnifiedMemoryAlloc
DeviceBitfield subDevices = 0b10;
AllocationProperties gpuProperties{0u,
MemoryConstants::pageSize64k,
AllocationType::UNIFIED_SHARED_MEMORY,
AllocationType::unifiedSharedMemory,
subDevices};
gpuProperties.alignment = 2 * MemoryConstants::megaByte;
gpuProperties.usmInitialPlacement = GraphicsAllocation::UsmInitialPlacement::GPU;
@@ -1168,7 +1168,7 @@ TEST_F(DrmMemoryManagerWithMultipleSubDevicesPrelimTest, givenUnifiedMemoryAlloc
DeviceBitfield subDevices = 0b11;
AllocationProperties gpuProperties{0u,
2 * MemoryConstants::pageSize64k,
AllocationType::UNIFIED_SHARED_MEMORY,
AllocationType::unifiedSharedMemory,
subDevices};
gpuProperties.alignment = 2 * MemoryConstants::megaByte;
gpuProperties.usmInitialPlacement = GraphicsAllocation::UsmInitialPlacement::GPU;
@@ -1199,7 +1199,7 @@ TEST_F(DrmMemoryManagerWithMultipleSubDevicesPrelimTest, givenCreateKmdMigratedS
DeviceBitfield subDevices = 0b11;
AllocationProperties gpuProperties{0u,
MemoryConstants::pageSize64k,
AllocationType::UNIFIED_SHARED_MEMORY,
AllocationType::unifiedSharedMemory,
subDevices};
gpuProperties.alignment = 2 * MemoryConstants::megaByte;
gpuProperties.usmInitialPlacement = GraphicsAllocation::UsmInitialPlacement::GPU;
@@ -1358,7 +1358,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenNoMemoryInfoWhenCreateUnified
AllocationProperties gpuProperties{0u,
MemoryConstants::pageSize64k,
AllocationType::UNIFIED_SHARED_MEMORY,
AllocationType::unifiedSharedMemory,
1u};
auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(gpuProperties);
@@ -1376,7 +1376,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenMmapFailWhenCreateUnifiedMemo
AllocationProperties gpuProperties{0u,
MemoryConstants::pageSize64k,
AllocationType::UNIFIED_SHARED_MEMORY,
AllocationType::unifiedSharedMemory,
1u};
auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(gpuProperties);
@@ -1394,7 +1394,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenGemCreateExtFailWhenCreateUni
AllocationProperties gpuProperties{0u,
MemoryConstants::pageSize64k,
AllocationType::UNIFIED_SHARED_MEMORY,
AllocationType::unifiedSharedMemory,
1u};
auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(gpuProperties);
@@ -1645,7 +1645,7 @@ HWTEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenNotSetUseSystemMemoryWhenGr
debugManager.flags.RenderCompressedBuffersEnabled.set(1);
DeviceBitfield deviceBitfield{0x0};
AllocationProperties properties(0, MemoryConstants::pageSize,
AllocationType::BUFFER,
AllocationType::buffer,
deviceBitfield);
AllocationData allocData;
@@ -1682,7 +1682,7 @@ HWTEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenEnableStatelessCompressionW
MemoryManager::AllocationStatus status = MemoryManager::AllocationStatus::Success;
for (auto allocationType : {AllocationType::GLOBAL_SURFACE, AllocationType::CONSTANT_SURFACE}) {
for (auto allocationType : {AllocationType::globalSurface, AllocationType::constantSurface}) {
DeviceBitfield deviceBitfield{0x0};
AllocationProperties properties(0, MemoryConstants::pageSize, allocationType, deviceBitfield);
@@ -1701,7 +1701,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenChunkSizeBasedColouringPolicy
allocData.allFlags = 0;
allocData.size = 18 * MemoryConstants::pageSize64k;
allocData.flags.allocateMemory = true;
allocData.type = AllocationType::BUFFER;
allocData.type = AllocationType::buffer;
allocData.storageInfo.memoryBanks = maxNBitValue(MemoryBanks::getBankForLocalMemory(3));
allocData.storageInfo.multiStorage = true;
allocData.rootDeviceIndex = rootDeviceIndex;
@@ -1741,7 +1741,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenMappingBasedColouringPolicyWh
allocData.allFlags = 0;
allocData.size = 18 * MemoryConstants::pageSize64k;
allocData.flags.allocateMemory = true;
allocData.type = AllocationType::BUFFER;
allocData.type = AllocationType::buffer;
allocData.storageInfo.memoryBanks = maxNBitValue(MemoryBanks::getBankForLocalMemory(3));
allocData.storageInfo.multiStorage = true;
allocData.rootDeviceIndex = rootDeviceIndex;
@@ -1791,7 +1791,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenCpuAccessRequiredWhenAllocati
allocData.size = MemoryConstants::pageSize;
allocData.flags.requiresCpuAccess = true;
allocData.flags.allocateMemory = true;
allocData.type = AllocationType::BUFFER;
allocData.type = AllocationType::buffer;
allocData.rootDeviceIndex = rootDeviceIndex;
auto allocation = memoryManager->allocateGraphicsMemoryInDevicePool(allocData, status);
@@ -1813,7 +1813,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenCpuAccessRequiredWhenAllocati
allocData.size = MemoryConstants::pageSize;
allocData.flags.requiresCpuAccess = true;
allocData.flags.allocateMemory = true;
allocData.type = AllocationType::BUFFER;
allocData.type = AllocationType::buffer;
allocData.rootDeviceIndex = rootDeviceIndex;
memoryManager->mmapFunction = [](void *addr, size_t len, int prot,
@@ -1830,7 +1830,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenCpuAccessRequiredWhenAllocati
allocData.size = MemoryConstants::pageSize;
allocData.flags.requiresCpuAccess = true;
allocData.flags.allocateMemory = true;
allocData.type = AllocationType::WRITE_COMBINED;
allocData.type = AllocationType::writeCombined;
allocData.rootDeviceIndex = rootDeviceIndex;
auto allocation2 = memoryManager->allocateGraphicsMemoryInDevicePool(allocData, status);
@@ -1842,7 +1842,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenWriteCombinedAllocationWhenAl
MemoryManager::AllocationStatus status = MemoryManager::AllocationStatus::Success;
AllocationData allocData{};
allocData.size = MemoryConstants::pageSize;
allocData.type = AllocationType::WRITE_COMBINED;
allocData.type = AllocationType::writeCombined;
allocData.rootDeviceIndex = rootDeviceIndex;
auto sizeAligned = alignUp(allocData.size + MemoryConstants::pageSize64k, 2 * MemoryConstants::megaByte) + 2 * MemoryConstants::megaByte;
@@ -1887,29 +1887,29 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenSupportedTypeWhenAllocatingIn
auto imgInfo = MockGmm::initImgInfo(imgDesc, 0, nullptr);
bool resource48Bit[] = {true, false};
AllocationType supportedTypes[] = {AllocationType::BUFFER,
AllocationType::IMAGE,
AllocationType::COMMAND_BUFFER,
AllocationType::LINEAR_STREAM,
AllocationType::INDIRECT_OBJECT_HEAP,
AllocationType::TIMESTAMP_PACKET_TAG_BUFFER,
AllocationType::INTERNAL_HEAP,
AllocationType::KERNEL_ISA,
AllocationType::KERNEL_ISA_INTERNAL,
AllocationType::DEBUG_MODULE_AREA,
AllocationType::SVM_GPU};
AllocationType supportedTypes[] = {AllocationType::buffer,
AllocationType::image,
AllocationType::commandBuffer,
AllocationType::linearStream,
AllocationType::indirectObjectHeap,
AllocationType::timestampPacketTagBuffer,
AllocationType::internalHeap,
AllocationType::kernelIsa,
AllocationType::kernelIsaInternal,
AllocationType::debugModuleArea,
AllocationType::svmGpu};
for (auto res48bit : resource48Bit) {
for (auto supportedType : supportedTypes) {
allocData.type = supportedType;
allocData.imgInfo = (AllocationType::IMAGE == supportedType) ? &imgInfo : nullptr;
allocData.hostPtr = (AllocationType::SVM_GPU == supportedType) ? ::alignedMalloc(allocData.size, 4096) : nullptr;
allocData.imgInfo = (AllocationType::image == supportedType) ? &imgInfo : nullptr;
allocData.hostPtr = (AllocationType::svmGpu == supportedType) ? ::alignedMalloc(allocData.size, 4096) : nullptr;
switch (supportedType) {
case AllocationType::IMAGE:
case AllocationType::INDIRECT_OBJECT_HEAP:
case AllocationType::INTERNAL_HEAP:
case AllocationType::KERNEL_ISA:
case AllocationType::KERNEL_ISA_INTERNAL:
case AllocationType::image:
case AllocationType::indirectObjectHeap:
case AllocationType::internalHeap:
case AllocationType::kernelIsa:
case AllocationType::kernelIsaInternal:
allocData.flags.resource48Bit = true;
break;
default:
@@ -1922,7 +1922,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenSupportedTypeWhenAllocatingIn
auto gpuAddress = allocation->getGpuAddress();
auto gmmHelper = device->getGmmHelper();
if (allocation->getAllocationType() == AllocationType::SVM_GPU) {
if (allocation->getAllocationType() == AllocationType::svmGpu) {
if (!memoryManager->isLimitedRange(0)) {
EXPECT_LT(gmmHelper->canonize(memoryManager->getGfxPartition(0)->getHeapBase(HeapIndex::HEAP_SVM)), gpuAddress);
EXPECT_GT(gmmHelper->canonize(memoryManager->getGfxPartition(0)->getHeapLimit(HeapIndex::HEAP_SVM)), gpuAddress);
@@ -1946,7 +1946,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenSupportedTypeWhenAllocatingIn
}
memoryManager->freeGraphicsMemory(allocation);
if (AllocationType::SVM_GPU == supportedType) {
if (AllocationType::svmGpu == supportedType) {
::alignedFree(const_cast<void *>(allocData.hostPtr));
}
}
@@ -1976,7 +1976,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenPrintBOCreateDestroyResultFla
testing::internal::CaptureStdout();
auto bo = std::unique_ptr<BufferObject>(memoryManager->createBufferObjectInMemoryRegion(0u,
nullptr,
AllocationType::BUFFER,
AllocationType::buffer,
gpuAddress,
size,
(1 << (MemoryBanks::getBankForLocalMemory(0) - 1)),
@@ -2034,7 +2034,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenDebugModuleAreaTypeWhenAlloca
memoryManager->gfxPartitions[rootDeviceIndex].reset(gfxPartitionDrm);
NEO::AllocationProperties properties{device->getRootDeviceIndex(), true, MemoryConstants::pageSize64k,
NEO::AllocationType::DEBUG_MODULE_AREA,
NEO::AllocationType::debugModuleArea,
false,
device->getDeviceBitfield()};
@@ -2065,7 +2065,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenSipKernelTypeWhenAllocatingBy
memoryManager->gfxPartitions[rootDeviceIndex].reset(gfxPartitionDrm);
AllocationProperties properties = {rootDeviceIndex, 0x1000, NEO::AllocationType::KERNEL_ISA_INTERNAL, device->getDeviceBitfield()};
AllocationProperties properties = {rootDeviceIndex, 0x1000, NEO::AllocationType::kernelIsaInternal, device->getDeviceBitfield()};
properties.flags.use32BitFrontWindow = true;
auto sipKernel = memoryManager->allocateGraphicsMemoryWithProperties(properties);
@@ -2088,7 +2088,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenSipKernelTypeWhenAllocatingBy
TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenDebugModuleAreaTypeWhenAllocatingThenBothUseFrontWindowInternalDeviceHeaps) {
NEO::AllocationProperties properties{device->getRootDeviceIndex(), true, MemoryConstants::pageSize64k,
NEO::AllocationType::DEBUG_MODULE_AREA,
NEO::AllocationType::debugModuleArea,
false,
device->getDeviceBitfield()};
auto moduleDebugArea = memoryManager->allocateGraphicsMemoryWithProperties(properties);
@@ -2105,7 +2105,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenDebugModuleAreaTypeWhenAlloca
}
TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenSipKernelTypeWhenAllocatingThenFrontWindowInternalDeviceHeapIsUsed) {
const auto allocType = AllocationType::KERNEL_ISA_INTERNAL;
const auto allocType = AllocationType::kernelIsaInternal;
AllocationProperties properties = {rootDeviceIndex, 0x1000, allocType, device->getDeviceBitfield()};
properties.flags.use32BitFrontWindow = true;
@@ -2125,7 +2125,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenSipKernelTypeWhenAllocatingTh
TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenDebugVariableSetWhenAllocatingThenForceHeapAlignment) {
debugManager.flags.ExperimentalEnableCustomLocalMemoryAlignment.set(static_cast<int32_t>(MemoryConstants::megaByte * 2));
const auto allocType = AllocationType::KERNEL_ISA_INTERNAL;
const auto allocType = AllocationType::kernelIsaInternal;
AllocationProperties properties = {rootDeviceIndex, 0x1000, allocType, device->getDeviceBitfield()};
auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(properties);
@@ -2167,7 +2167,7 @@ TEST_F(DrmMemoryManagerFailInjectionPrelimTest, givenEnabledLocalMemoryWhenNewFa
allocData.allFlags = 0;
allocData.size = MemoryConstants::pageSize;
allocData.flags.allocateMemory = true;
allocData.type = AllocationType::BUFFER;
allocData.type = AllocationType::buffer;
allocData.rootDeviceIndex = rootDeviceIndex;
auto allocation = testedMemoryManager.allocateGraphicsMemoryInDevicePool(allocData, status);
@@ -2236,7 +2236,7 @@ TEST_F(DrmMemoryManagerCopyMemoryToAllocationPrelimTest, givenDrmMemoryManagerWh
allocData.allFlags = 0;
allocData.size = dataToCopy.size();
allocData.flags.allocateMemory = true;
allocData.type = AllocationType::KERNEL_ISA;
allocData.type = AllocationType::kernelIsa;
allocData.rootDeviceIndex = rootDeviceIndex;
allocData.storageInfo.memoryBanks.set(0, true);
@@ -2263,7 +2263,7 @@ TEST_F(DrmMemoryManagerCopyMemoryToAllocationPrelimTest, givenDrmMemoryManagerWh
allocData.allFlags = 0;
allocData.size = dataToCopy.size();
allocData.flags.allocateMemory = true;
allocData.type = AllocationType::CONSTANT_SURFACE;
allocData.type = AllocationType::constantSurface;
allocData.rootDeviceIndex = rootDeviceIndex;
allocData.storageInfo.memoryBanks = 0b11;
@@ -2286,7 +2286,7 @@ TEST_F(DrmMemoryManagerCopyMemoryToAllocationPrelimTest, givenDrmMemoryManagerWh
DrmMemoryManagerToTestCopyMemoryToAllocation drmMemoryManager(*executionEnvironment, true, destinationAllocationSize);
std::vector<uint8_t> dataToCopy(sourceAllocationSize, 1u);
AllocationType debugSurfaces[] = {AllocationType::DEBUG_CONTEXT_SAVE_AREA, AllocationType::DEBUG_SBA_TRACKING_BUFFER};
AllocationType debugSurfaces[] = {AllocationType::debugContextSaveArea, AllocationType::debugSbaTrackingBuffer};
for (auto type : debugSurfaces) {
AllocationProperties debugSurfaceProperties{0, true, sourceAllocationSize, type, false, false, 0b11};
@@ -2308,7 +2308,7 @@ TEST_F(DrmMemoryManagerCopyMemoryToAllocationPrelimTest, givenDrmMemoryManagerWh
allocData.allFlags = 0;
allocData.size = dataToCopy.size();
allocData.flags.allocateMemory = true;
allocData.type = AllocationType::KERNEL_ISA;
allocData.type = AllocationType::kernelIsa;
allocData.rootDeviceIndex = rootDeviceIndex;
allocData.storageInfo.memoryBanks.set(0, true);
MemoryManager::AllocationStatus status = MemoryManager::AllocationStatus::Success;
@@ -2329,7 +2329,7 @@ TEST_F(DrmMemoryManagerCopyMemoryToAllocationPrelimTest, givenDrmMemoryManagerWh
DrmMemoryManagerToTestCopyMemoryToAllocation drmMemoryManager(*executionEnvironment, false, 0);
std::vector<uint8_t> dataToCopy(sourceAllocationSize, 1u);
auto allocation = drmMemoryManager.allocateGraphicsMemoryWithProperties({mockRootDeviceIndex, destinationAllocationSize, AllocationType::KERNEL_ISA, mockDeviceBitfield});
auto allocation = drmMemoryManager.allocateGraphicsMemoryWithProperties({mockRootDeviceIndex, destinationAllocationSize, AllocationType::kernelIsa, mockDeviceBitfield});
ASSERT_NE(nullptr, allocation);
auto ret = drmMemoryManager.copyMemoryToAllocation(allocation, offset, dataToCopy.data(), dataToCopy.size());
@@ -2352,7 +2352,7 @@ TEST_F(DrmMemoryManagerCopyMemoryToAllocationPrelimTest, givenDrmMemoryManagerWh
allocData.allFlags = 0;
allocData.size = dataToCopy.size();
allocData.flags.allocateMemory = true;
allocData.type = AllocationType::KERNEL_ISA;
allocData.type = AllocationType::kernelIsa;
allocData.storageInfo.memoryBanks = maxNBitValue(MemoryBanks::getBankForLocalMemory(3));
allocData.rootDeviceIndex = rootDeviceIndex;
MemoryManager::AllocationStatus status = MemoryManager::AllocationStatus::Success;
@@ -2378,7 +2378,7 @@ TEST_F(DrmMemoryManagerTestPrelim, whenSettingNumHandlesThenTheyAreRetrievedCorr
std::vector<NEO::osHandle> handles{6, 7};
size_t size = 65536u * 2;
AllocationProperties properties(rootDeviceIndex, true, size, AllocationType::BUFFER_HOST_MEMORY, false, device->getDeviceBitfield());
AllocationProperties properties(rootDeviceIndex, true, size, AllocationType::bufferHostMemory, false, device->getDeviceBitfield());
auto graphicsAllocation = memoryManager->createGraphicsAllocationFromMultipleSharedHandles(handles, properties, false, false, true, nullptr);
ASSERT_NE(nullptr, graphicsAllocation);
@@ -2399,7 +2399,7 @@ TEST_F(DrmMemoryManagerTestPrelim, whenCreatingAllocationFromMultipleSharedHandl
std::vector<NEO::osHandle> handles{6, 7};
size_t size = 65536u * 2;
AllocationProperties properties(rootDeviceIndex, true, size, AllocationType::BUFFER_HOST_MEMORY, false, device->getDeviceBitfield());
AllocationProperties properties(rootDeviceIndex, true, size, AllocationType::bufferHostMemory, false, device->getDeviceBitfield());
memoryManager->failOnfindAndReferenceSharedBufferObject = false;
@@ -2432,7 +2432,7 @@ TEST_F(DrmMemoryManagerTestPrelim, whenCreatingAllocationFromMultipleSharedHandl
std::vector<NEO::osHandle> handles{6, 7};
size_t size = 65536u * 2;
AllocationProperties properties(rootDeviceIndex, true, size, AllocationType::BUFFER_HOST_MEMORY, false, device->getDeviceBitfield());
AllocationProperties properties(rootDeviceIndex, true, size, AllocationType::bufferHostMemory, false, device->getDeviceBitfield());
memoryManager->failOnfindAndReferenceSharedBufferObject = false;
@@ -2466,7 +2466,7 @@ TEST_F(DrmMemoryManagerTestPrelim, whenCreatingAllocationFromMultipleSharedHandl
std::vector<NEO::osHandle> handles{6, 7};
size_t size = 65536u * 2;
AllocationProperties properties(rootDeviceIndex, true, size, AllocationType::BUFFER_HOST_MEMORY, false, device->getDeviceBitfield());
AllocationProperties properties(rootDeviceIndex, true, size, AllocationType::bufferHostMemory, false, device->getDeviceBitfield());
memoryManager->failOnfindAndReferenceSharedBufferObject = false;
@@ -2499,7 +2499,7 @@ TEST_F(DrmMemoryManagerTestPrelim, whenCreatingAllocationFromMultipleSharedHandl
std::vector<NEO::osHandle> handles{6, 7};
size_t size = 65536u * 2;
AllocationProperties properties(rootDeviceIndex, true, size, AllocationType::BUFFER_HOST_MEMORY, false, device->getDeviceBitfield());
AllocationProperties properties(rootDeviceIndex, true, size, AllocationType::bufferHostMemory, false, device->getDeviceBitfield());
memoryManager->failOnfindAndReferenceSharedBufferObject = false;
auto graphicsAllocation = memoryManager->createGraphicsAllocationFromMultipleSharedHandles(handles, properties, false, false, true, nullptr);
@@ -2529,7 +2529,7 @@ TEST_F(DrmMemoryManagerTestPrelim, whenCreatingAllocationFromMultipleSharedHandl
std::vector<NEO::osHandle> handles{6};
size_t size = 65536u * 2;
AllocationProperties properties(rootDeviceIndex, true, size, AllocationType::BUFFER_HOST_MEMORY, false, device->getDeviceBitfield());
AllocationProperties properties(rootDeviceIndex, true, size, AllocationType::bufferHostMemory, false, device->getDeviceBitfield());
memoryManager->failOnfindAndReferenceSharedBufferObject = false;
auto graphicsAllocation = memoryManager->createGraphicsAllocationFromMultipleSharedHandles(handles, properties, false, false, true, nullptr);
@@ -2561,7 +2561,7 @@ TEST_F(DrmMemoryManagerTestPrelim, whenCreatingAllocationFromMultipleSharedHandl
std::vector<NEO::osHandle> handles{6, 7};
size_t size = 65536u * 2;
AllocationProperties properties(rootDeviceIndex, true, size, AllocationType::BUFFER_HOST_MEMORY, false, device->getDeviceBitfield());
AllocationProperties properties(rootDeviceIndex, true, size, AllocationType::bufferHostMemory, false, device->getDeviceBitfield());
memoryManager->failOnfindAndReferenceSharedBufferObject = false;
auto graphicsAllocation = memoryManager->createGraphicsAllocationFromMultipleSharedHandles(handles, properties, false, false, true, nullptr);
@@ -2575,7 +2575,7 @@ TEST_F(DrmMemoryManagerTestPrelim, whenCreatingAllocationFromMultipleSharedHandl
std::vector<NEO::osHandle> handles{6, 7};
size_t size = 65536u * 2;
AllocationProperties properties(rootDeviceIndex, true, size, AllocationType::BUFFER_HOST_MEMORY, false, device->getDeviceBitfield());
AllocationProperties properties(rootDeviceIndex, true, size, AllocationType::bufferHostMemory, false, device->getDeviceBitfield());
auto graphicsAllocation = memoryManager->createGraphicsAllocationFromMultipleSharedHandles(handles, properties, false, false, true, nullptr);
ASSERT_NE(nullptr, graphicsAllocation);
@@ -2595,7 +2595,7 @@ TEST_F(DrmMemoryManagerTestPrelim, givenDrmMemoryManagerWhenLockUnlockIsCalledOn
mock->ioctlResExt = &ioctlResExt;
BufferObject bo(0, mock, 3, 1, 0, 1);
DrmAllocation drmAllocation(0, AllocationType::UNKNOWN, &bo, nullptr, 0u, 0u, MemoryPool::LocalMemory);
DrmAllocation drmAllocation(0, AllocationType::unknown, &bo, nullptr, 0u, 0u, MemoryPool::LocalMemory);
EXPECT_NE(nullptr, drmAllocation.getBO());
auto ptr = memoryManager->lockResource(&drmAllocation);
@@ -2610,7 +2610,7 @@ TEST_F(DrmMemoryManagerTestPrelim, givenDrmMemoryManagerWhenLockUnlockIsCalledOn
mock->failOnMmapOffset = true;
BufferObject bo(0, mock, 3, 1, 0, 1);
DrmAllocation drmAllocation(0, AllocationType::UNKNOWN, &bo, nullptr, 0u, 0u, MemoryPool::LocalMemory);
DrmAllocation drmAllocation(0, AllocationType::unknown, &bo, nullptr, 0u, 0u, MemoryPool::LocalMemory);
EXPECT_NE(nullptr, drmAllocation.getBO());
auto ptr = memoryManager->lockResource(&drmAllocation);
@@ -2628,7 +2628,7 @@ TEST_F(DrmMemoryManagerTestPrelim, givenDrmMemoryManagerAndOsHandleWhenCreateIsC
osHandle handle = 1u;
size_t size = 4096u;
AllocationProperties properties(rootDeviceIndex, false, size, AllocationType::BUFFER_HOST_MEMORY, false, {});
AllocationProperties properties(rootDeviceIndex, false, size, AllocationType::bufferHostMemory, false, {});
auto graphicsAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(handle, properties, false, true, true, nullptr);
ASSERT_NE(nullptr, graphicsAllocation);
@@ -2659,7 +2659,7 @@ TEST_F(DrmMemoryManagerTestPrelim,
osHandle handle = 1u;
size_t size = 4096u;
AllocationProperties properties(rootDeviceIndex, false, size, AllocationType::BUFFER_HOST_MEMORY, false, {});
AllocationProperties properties(rootDeviceIndex, false, size, AllocationType::bufferHostMemory, false, {});
testing::internal::CaptureStdout();
auto graphicsAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(handle, properties, false, true, true, nullptr);
@@ -2700,7 +2700,7 @@ TEST_F(DrmMemoryManagerTestPrelim, givenDrmMemoryManagerAndOsHandleWhenCreateIsC
osHandle handle = 1u;
this->mock->outputHandle = 2u;
size_t size = 4096u;
AllocationProperties properties(rootDeviceIndex, false, size, AllocationType::BUFFER_HOST_MEMORY, false, {});
AllocationProperties properties(rootDeviceIndex, false, size, AllocationType::bufferHostMemory, false, {});
auto graphicsAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(handle, properties, false, true, true, nullptr);
ASSERT_NE(nullptr, graphicsAllocation);
@@ -2729,7 +2729,7 @@ TEST_F(DrmMemoryManagerTestPrelim, givenDrmMemoryManagerAndOsHandleWhenCreateIsC
osHandle handle = 1u;
this->mock->outputHandle = 2u;
size_t size = 4096u;
AllocationProperties properties(rootDeviceIndex, false, size, AllocationType::BUFFER_HOST_MEMORY, false, {});
AllocationProperties properties(rootDeviceIndex, false, size, AllocationType::bufferHostMemory, false, {});
auto graphicsAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(handle, properties, false, true, true, nullptr);
ASSERT_NE(nullptr, graphicsAllocation);
@@ -2769,7 +2769,7 @@ TEST_F(DrmMemoryManagerTestPrelim, givenDrmMemoryManagerAndOsHandleWhenCreateIsC
osHandle handle = 1u;
size_t size = 4096u;
AllocationProperties properties(rootDeviceIndex, false, size, AllocationType::BUFFER_HOST_MEMORY, false, {});
AllocationProperties properties(rootDeviceIndex, false, size, AllocationType::bufferHostMemory, false, {});
mock->returnIoctlExtraErrorValue = true;
mock->failOnMmapOffset = true;
@@ -2788,7 +2788,7 @@ TEST_F(DrmMemoryManagerTestPrelim, givenDrmMemoryManagerAndUseMmapObjectSetToFal
this->mock->outputHandle = handle;
size_t size = 4096u;
AllocationProperties properties(rootDeviceIndex, false, size, AllocationType::BUFFER_HOST_MEMORY, false, {});
AllocationProperties properties(rootDeviceIndex, false, size, AllocationType::bufferHostMemory, false, {});
properties.useMmapObject = false;
auto graphicsAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(handle, properties, false, true, true, nullptr);
@@ -2808,7 +2808,7 @@ TEST_F(DrmMemoryManagerTestPrelim, givenDrmMemoryManagerWithoutMemoryInfoThenDrm
this->mock->outputHandle = handle;
size_t size = 4096u;
AllocationProperties properties(rootDeviceIndex, false, size, AllocationType::BUFFER_HOST_MEMORY, false, {});
AllocationProperties properties(rootDeviceIndex, false, size, AllocationType::bufferHostMemory, false, {});
auto graphicsAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(handle, properties, false, true, true, nullptr);
EXPECT_EQ(static_cast<int>(handle), static_cast<DrmAllocation *>(graphicsAllocation)->getBO()->peekHandle());
@@ -2821,7 +2821,7 @@ TEST_F(DrmMemoryManagerTestPrelim, MmapFailWhenUSMHostAllocationFromSharedHandle
osHandle handle = 1u;
size_t size = 4096u;
AllocationProperties properties(rootDeviceIndex, false, size, AllocationType::BUFFER_HOST_MEMORY, false, {});
AllocationProperties properties(rootDeviceIndex, false, size, AllocationType::bufferHostMemory, false, {});
memoryManager->mmapFunction = [](void *addr, size_t len, int prot,
int flags, int fd, off_t offset) throw() {
@@ -2834,7 +2834,7 @@ TEST_F(DrmMemoryManagerTestPrelim, MmapFailWhenUSMHostAllocationFromSharedHandle
}
TEST_F(DrmMemoryManagerTestPrelim, givenDrmMemoryManagerWhenLockUnlockIsCalledOnAllocationInLocalMemoryButBufferObjectIsNullThenReturnNullPtr) {
DrmAllocation drmAllocation(0, AllocationType::UNKNOWN, nullptr, nullptr, 0u, 0u, MemoryPool::LocalMemory);
DrmAllocation drmAllocation(0, AllocationType::unknown, nullptr, nullptr, 0u, 0u, MemoryPool::LocalMemory);
auto ptr = memoryManager->lockResource(&drmAllocation);
EXPECT_EQ(nullptr, ptr);
@@ -2915,7 +2915,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenGraphicsAllocationInDevicePoo
AllocationData allocData;
allocData.allFlags = 0;
allocData.size = MemoryConstants::pageSize;
allocData.type = AllocationType::IMAGE;
allocData.type = AllocationType::image;
allocData.flags.resource48Bit = true;
allocData.imgInfo = &imgInfo;
allocData.rootDeviceIndex = rootDeviceIndex;
@@ -2953,7 +2953,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenAllocationWithUnifiedMemoryAl
allocData.allFlags = 0;
allocData.size = 18 * MemoryConstants::pageSize64k;
allocData.flags.allocateMemory = true;
allocData.type = AllocationType::UNIFIED_SHARED_MEMORY;
allocData.type = AllocationType::unifiedSharedMemory;
allocData.rootDeviceIndex = rootDeviceIndex;
allocData.useMmapObject = false;
@@ -2968,7 +2968,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenAllocationWithUnifiedMemoryAl
allocData.allFlags = 0;
allocData.size = 18 * MemoryConstants::pageSize64k;
allocData.flags.allocateMemory = true;
allocData.type = AllocationType::UNIFIED_SHARED_MEMORY;
allocData.type = AllocationType::unifiedSharedMemory;
allocData.rootDeviceIndex = rootDeviceIndex;
allocData.useMmapObject = true;
@@ -2991,7 +2991,7 @@ TEST(AllocationInfoLogging, givenDrmGraphicsAllocationWithMultipleBOsWhenGetting
BufferObject bo0(0, &drm, 3, 0, 0, 1), bo1(0, &drm, 3, 1, 0, 1),
bo2(0, &drm, 3, 2, 0, 1), bo3(0, &drm, 3, 3, 0, 1);
BufferObjects bos{&bo0, &bo1, &bo2, &bo3};
DrmAllocation drmAllocation(0, AllocationType::UNKNOWN, bos, nullptr, 0u, 0u, MemoryPool::LocalMemory);
DrmAllocation drmAllocation(0, AllocationType::unknown, bos, nullptr, 0u, 0u, MemoryPool::LocalMemory);
EXPECT_STREQ(drmAllocation.getAllocationInfoString().c_str(), " Handle: 0 Handle: 1 Handle: 2 Handle: 3");
}
@@ -3020,13 +3020,13 @@ TEST_P(DrmMemoryManagerAllocation57BitTest, givenAllocationTypeHaveToBeAllocated
}
static const AllocationType allocation57Bit[] = {
AllocationType::BUFFER,
AllocationType::CONSTANT_SURFACE,
AllocationType::GLOBAL_SURFACE,
AllocationType::PIPE,
AllocationType::PRINTF_SURFACE,
AllocationType::PRIVATE_SURFACE,
AllocationType::SHARED_BUFFER,
AllocationType::buffer,
AllocationType::constantSurface,
AllocationType::globalSurface,
AllocationType::pipe,
AllocationType::printfSurface,
AllocationType::privateSurface,
AllocationType::sharedBuffer,
};
INSTANTIATE_TEST_CASE_P(Drm57Bit,

View File

@@ -121,7 +121,7 @@ HWTEST2_F(DrmMemoryManagerLocalMemoryTest, givenDrmMemoryManagerWhenCreateBuffer
auto bo = std::unique_ptr<BufferObject>(memoryManager->createBufferObjectInMemoryRegion(rootDeviceIndex,
nullptr,
AllocationType::BUFFER,
AllocationType::buffer,
gpuAddress,
size,
(1 << (MemoryBanks::getBankForLocalMemory(0) - 1)),
@@ -169,7 +169,7 @@ HWTEST2_F(DrmMemoryManagerLocalMemoryTest, givenMultiRootDeviceEnvironmentAndMem
auto memoryManager = std::make_unique<TestedDrmMemoryManager>(true, false, false, *executionEnvironment);
size_t size = 4096u;
AllocationProperties properties(rootDeviceIndex, true, size, AllocationType::BUFFER_HOST_MEMORY, false, {});
AllocationProperties properties(rootDeviceIndex, true, size, AllocationType::bufferHostMemory, false, {});
static_cast<DrmTipMock *>(executionEnvironment->rootDeviceEnvironments[0]->osInterface->getDriverModel()->as<Drm>())->outputFd = 7;
@@ -216,7 +216,7 @@ TEST_F(DrmMemoryManagerLocalMemoryTest, givenMultiRootDeviceEnvironmentAndMemory
auto memoryManager = std::make_unique<TestedDrmMemoryManager>(true, false, false, *executionEnvironment);
size_t size = 4096u;
AllocationProperties properties(rootDeviceIndex, true, size, AllocationType::BUFFER_HOST_MEMORY, false, {});
AllocationProperties properties(rootDeviceIndex, true, size, AllocationType::bufferHostMemory, false, {});
auto ptr = memoryManager->createMultiGraphicsAllocationInSystemMemoryPool(rootDeviceIndices, properties, multiGraphics);
@@ -231,7 +231,7 @@ TEST_F(DrmMemoryManagerUsmSharedHandleTest, givenDrmMemoryManagerAndOsHandleWhen
osHandle handle = 1u;
this->mock->outputHandle = 2u;
size_t size = 4096u;
AllocationProperties properties(rootDeviceIndex, false, size, AllocationType::BUFFER_HOST_MEMORY, false, {});
AllocationProperties properties(rootDeviceIndex, false, size, AllocationType::bufferHostMemory, false, {});
auto graphicsAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(handle, properties, false, true, true, nullptr);
ASSERT_NE(nullptr, graphicsAllocation);
@@ -275,7 +275,7 @@ TEST_F(DrmMemoryManagerUsmSharedHandleTest, givenMultiRootDeviceEnvironmentAndMe
auto memoryManager = std::make_unique<TestedDrmMemoryManager>(true, false, false, *executionEnvironment);
size_t size = 4096u;
AllocationProperties properties(rootDeviceIndex, true, size, AllocationType::BUFFER_HOST_MEMORY, false, {});
AllocationProperties properties(rootDeviceIndex, true, size, AllocationType::bufferHostMemory, false, {});
auto ptr = memoryManager->createUSMHostAllocationFromSharedHandle(1, properties, false, true);
@@ -308,7 +308,7 @@ TEST_F(DrmMemoryManagerLocalMemoryTest, givenMultiRootDeviceEnvironmentAndNoMemo
auto memoryManager = std::make_unique<TestedDrmMemoryManager>(true, false, false, *executionEnvironment);
size_t size = 4096u;
AllocationProperties properties(rootDeviceIndex, true, size, AllocationType::BUFFER_HOST_MEMORY, false, {});
AllocationProperties properties(rootDeviceIndex, true, size, AllocationType::bufferHostMemory, false, {});
auto ptr = memoryManager->createMultiGraphicsAllocationInSystemMemoryPool(rootDeviceIndices, properties, multiGraphics);
@@ -494,7 +494,7 @@ TEST_F(DrmMemoryManagerLocalMemoryMemoryBankTest, givenDeviceMemoryWhenGraphicsA
allocData.allFlags = 0;
allocData.size = MemoryConstants::pageSize;
allocData.flags.useSystemMemory = false;
allocData.type = AllocationType::BUFFER;
allocData.type = AllocationType::buffer;
allocData.rootDeviceIndex = rootDeviceIndex;
allocData.storageInfo.memoryBanks = 1u;
memoryManager->allocateGraphicsMemoryInDevicePool(allocData, status);
@@ -508,7 +508,7 @@ HWTEST2_F(DrmMemoryManagerLocalMemoryTest, givenCpuAccessRequiredWhenAllocatingI
allocData.size = MemoryConstants::pageSize;
allocData.flags.requiresCpuAccess = true;
allocData.flags.allocateMemory = true;
allocData.type = AllocationType::BUFFER;
allocData.type = AllocationType::buffer;
allocData.rootDeviceIndex = rootDeviceIndex;
auto allocation = memoryManager->allocateGraphicsMemoryInDevicePool(allocData, status);
@@ -527,7 +527,7 @@ HWTEST2_F(DrmMemoryManagerLocalMemoryTest, givenWriteCombinedAllocationWhenAlloc
MemoryManager::AllocationStatus status = MemoryManager::AllocationStatus::Success;
AllocationData allocData{};
allocData.size = MemoryConstants::pageSize;
allocData.type = AllocationType::WRITE_COMBINED;
allocData.type = AllocationType::writeCombined;
allocData.rootDeviceIndex = rootDeviceIndex;
auto sizeAligned = alignUp(allocData.size + MemoryConstants::pageSize64k, 2 * MemoryConstants::megaByte) + 2 * MemoryConstants::megaByte;
@@ -572,26 +572,26 @@ HWTEST2_F(DrmMemoryManagerLocalMemoryTest, givenSupportedTypeWhenAllocatingInDev
auto imgInfo = MockGmm::initImgInfo(imgDesc, 0, nullptr);
bool resource48Bit[] = {true, false};
AllocationType supportedTypes[] = {AllocationType::BUFFER,
AllocationType::IMAGE,
AllocationType::COMMAND_BUFFER,
AllocationType::LINEAR_STREAM,
AllocationType::INDIRECT_OBJECT_HEAP,
AllocationType::TIMESTAMP_PACKET_TAG_BUFFER,
AllocationType::INTERNAL_HEAP,
AllocationType::KERNEL_ISA,
AllocationType::SVM_GPU};
AllocationType supportedTypes[] = {AllocationType::buffer,
AllocationType::image,
AllocationType::commandBuffer,
AllocationType::linearStream,
AllocationType::indirectObjectHeap,
AllocationType::timestampPacketTagBuffer,
AllocationType::internalHeap,
AllocationType::kernelIsa,
AllocationType::svmGpu};
for (auto res48bit : resource48Bit) {
for (auto supportedType : supportedTypes) {
allocData.type = supportedType;
allocData.imgInfo = (AllocationType::IMAGE == supportedType) ? &imgInfo : nullptr;
allocData.hostPtr = (AllocationType::SVM_GPU == supportedType) ? ::alignedMalloc(allocData.size, 4096) : nullptr;
allocData.imgInfo = (AllocationType::image == supportedType) ? &imgInfo : nullptr;
allocData.hostPtr = (AllocationType::svmGpu == supportedType) ? ::alignedMalloc(allocData.size, 4096) : nullptr;
switch (supportedType) {
case AllocationType::IMAGE:
case AllocationType::INDIRECT_OBJECT_HEAP:
case AllocationType::INTERNAL_HEAP:
case AllocationType::KERNEL_ISA:
case AllocationType::image:
case AllocationType::indirectObjectHeap:
case AllocationType::internalHeap:
case AllocationType::kernelIsa:
allocData.flags.resource48Bit = true;
break;
default:
@@ -604,7 +604,7 @@ HWTEST2_F(DrmMemoryManagerLocalMemoryTest, givenSupportedTypeWhenAllocatingInDev
auto gpuAddress = allocation->getGpuAddress();
auto gmmHelper = device->getGmmHelper();
if (allocation->getAllocationType() == AllocationType::SVM_GPU) {
if (allocation->getAllocationType() == AllocationType::svmGpu) {
if (!memoryManager->isLimitedRange(0)) {
EXPECT_LT(gmmHelper->canonize(memoryManager->getGfxPartition(0)->getHeapBase(HeapIndex::HEAP_SVM)), gpuAddress);
EXPECT_GT(gmmHelper->canonize(memoryManager->getGfxPartition(0)->getHeapLimit(HeapIndex::HEAP_SVM)), gpuAddress);
@@ -627,7 +627,7 @@ HWTEST2_F(DrmMemoryManagerLocalMemoryTest, givenSupportedTypeWhenAllocatingInDev
}
memoryManager->freeGraphicsMemory(allocation);
if (AllocationType::SVM_GPU == supportedType) {
if (AllocationType::svmGpu == supportedType) {
::alignedFree(const_cast<void *>(allocData.hostPtr));
}
}
@@ -644,7 +644,7 @@ TEST_F(DrmMemoryManagerLocalMemoryTest, givenDrmMemoryManagerWithLocalMemoryWhen
TEST_F(DrmMemoryManagerLocalMemoryWithCustomMockTest, givenDrmMemoryManagerWithLocalMemoryWhenLockResourceIsCalledOnBufferObjectThenReturnPtr) {
BufferObject bo(0, mock, 3, 1, 1024, 0);
DrmAllocation drmAllocation(0, AllocationType::UNKNOWN, &bo, nullptr, 0u, 0u, MemoryPool::LocalMemory);
DrmAllocation drmAllocation(0, AllocationType::unknown, &bo, nullptr, 0u, 0u, MemoryPool::LocalMemory);
EXPECT_EQ(&bo, drmAllocation.getBO());
auto ptr = memoryManager->lockBufferObject(&bo);
@@ -686,7 +686,7 @@ HWTEST2_F(DrmMemoryManagerFailInjectionTest, givenEnabledLocalMemoryWhenNewFails
allocData.allFlags = 0;
allocData.size = MemoryConstants::pageSize;
allocData.flags.allocateMemory = true;
allocData.type = AllocationType::BUFFER;
allocData.type = AllocationType::buffer;
allocData.rootDeviceIndex = rootDeviceIndex;
auto allocation = testedMemoryManager.allocateGraphicsMemoryInDevicePool(allocData, status);
@@ -748,7 +748,7 @@ HWTEST2_F(DrmMemoryManagerCopyMemoryToAllocationTest, givenDrmMemoryManagerWhenC
allocData.allFlags = 0;
allocData.size = destinationAllocationSize;
allocData.flags.allocateMemory = true;
allocData.type = AllocationType::KERNEL_ISA;
allocData.type = AllocationType::kernelIsa;
allocData.rootDeviceIndex = rootDeviceIndex;
allocData.storageInfo.memoryBanks.set(0, true);
MemoryManager::AllocationStatus status = MemoryManager::AllocationStatus::Success;
@@ -771,7 +771,7 @@ HWTEST2_F(DrmMemoryManagerCopyMemoryToAllocationTest, givenDrmMemoryManagerWhenC
allocData.allFlags = 0;
allocData.size = dataToCopy.size();
allocData.flags.allocateMemory = true;
allocData.type = AllocationType::KERNEL_ISA;
allocData.type = AllocationType::kernelIsa;
allocData.rootDeviceIndex = rootDeviceIndex;
allocData.storageInfo.memoryBanks.set(0, true);
MemoryManager::AllocationStatus status = MemoryManager::AllocationStatus::Success;
@@ -792,7 +792,7 @@ TEST_F(DrmMemoryManagerCopyMemoryToAllocationTest, givenDrmMemoryManagerWhenCopy
DrmMemoryManagerToTestCopyMemoryToAllocation drmMemoryManger(*executionEnvironment, false, 0);
std::vector<uint8_t> dataToCopy(sourceAllocationSize, 1u);
auto allocation = drmMemoryManger.allocateGraphicsMemoryWithProperties({mockRootDeviceIndex, destinationAllocationSize, AllocationType::KERNEL_ISA, mockDeviceBitfield});
auto allocation = drmMemoryManger.allocateGraphicsMemoryWithProperties({mockRootDeviceIndex, destinationAllocationSize, AllocationType::kernelIsa, mockDeviceBitfield});
ASSERT_NE(nullptr, allocation);
auto ret = drmMemoryManger.copyMemoryToAllocation(allocation, offset, dataToCopy.data(), dataToCopy.size());
@@ -816,7 +816,7 @@ HWTEST2_F(DrmMemoryManagerTestImpl, givenDrmMemoryManagerWhenLockUnlockIsCalledO
allocData.allFlags = 0;
allocData.size = MemoryConstants::pageSize;
allocData.flags.allocateMemory = true;
allocData.type = AllocationType::INTERNAL_HEAP;
allocData.type = AllocationType::internalHeap;
allocData.rootDeviceIndex = rootDeviceIndex;
MemoryManager::AllocationStatus status = MemoryManager::AllocationStatus::Success;
auto allocation = memoryManager->allocateGraphicsMemoryInDevicePool(allocData, status);
@@ -847,7 +847,7 @@ TEST_F(DrmMemoryManagerTestImpl, givenDrmMemoryManagerWhenLockUnlockIsCalledOnAl
mockExp->ioctlResExt = &ioctlResExt;
BufferObject bo(0, mockExp, 3, 1, 0, 0);
DrmAllocation drmAllocation(0, AllocationType::UNKNOWN, &bo, nullptr, 0u, 0u, MemoryPool::LocalMemory);
DrmAllocation drmAllocation(0, AllocationType::unknown, &bo, nullptr, 0u, 0u, MemoryPool::LocalMemory);
EXPECT_NE(nullptr, drmAllocation.getBO());
auto ptr = memoryManager->lockResource(&drmAllocation);
@@ -863,7 +863,7 @@ TEST_F(DrmMemoryManagerTestImpl, givenDrmMemoryManagerWhenLockUnlockIsCalledOnAl
mockExp->failOnMmapOffset = true;
BufferObject bo(0, mockExp, 3, 1, 0, 0);
DrmAllocation drmAllocation(0, AllocationType::UNKNOWN, &bo, nullptr, 0u, 0u, MemoryPool::LocalMemory);
DrmAllocation drmAllocation(0, AllocationType::unknown, &bo, nullptr, 0u, 0u, MemoryPool::LocalMemory);
EXPECT_NE(nullptr, drmAllocation.getBO());
auto ptr = memoryManager->lockResource(&drmAllocation);
@@ -874,7 +874,7 @@ TEST_F(DrmMemoryManagerTestImpl, givenDrmMemoryManagerWhenLockUnlockIsCalledOnAl
}
TEST_F(DrmMemoryManagerTestImpl, givenDrmMemoryManagerWhenLockUnlockIsCalledOnAllocationInLocalMemoryButBufferObjectIsNullThenReturnNullPtr) {
DrmAllocation drmAllocation(0, AllocationType::UNKNOWN, nullptr, nullptr, 0u, 0u, MemoryPool::LocalMemory);
DrmAllocation drmAllocation(0, AllocationType::unknown, nullptr, nullptr, 0u, 0u, MemoryPool::LocalMemory);
auto ptr = memoryManager->lockResource(&drmAllocation);
EXPECT_EQ(nullptr, ptr);
@@ -928,7 +928,7 @@ HWTEST2_F(DrmMemoryManagerLocalMemoryTest, givenGraphicsAllocationInDevicePoolIs
AllocationData allocData;
allocData.allFlags = 0;
allocData.size = MemoryConstants::pageSize;
allocData.type = AllocationType::IMAGE;
allocData.type = AllocationType::image;
allocData.flags.resource48Bit = true;
allocData.imgInfo = &imgInfo;
allocData.rootDeviceIndex = rootDeviceIndex;
@@ -1044,7 +1044,7 @@ TEST_F(DrmMemoryManagerLocalMemoryTest, givenAllocationWithInvalidCacheRegionWhe
allocData.allFlags = 0;
allocData.size = 18 * MemoryConstants::pageSize64k;
allocData.flags.allocateMemory = true;
allocData.type = AllocationType::BUFFER;
allocData.type = AllocationType::buffer;
allocData.storageInfo.memoryBanks = maxNBitValue(MemoryBanks::getBankForLocalMemory(3));
allocData.storageInfo.multiStorage = true;
allocData.rootDeviceIndex = rootDeviceIndex;
@@ -1062,7 +1062,7 @@ TEST_F(DrmMemoryManagerLocalMemoryTest, givenAllocationWithUnifiedMemoryAllocati
allocData.allFlags = 0;
allocData.size = 18 * MemoryConstants::pageSize64k;
allocData.flags.allocateMemory = true;
allocData.type = AllocationType::UNIFIED_SHARED_MEMORY;
allocData.type = AllocationType::unifiedSharedMemory;
allocData.rootDeviceIndex = rootDeviceIndex;
auto allocation = memoryManager->allocateGraphicsMemoryInDevicePool(allocData, status);

View File

@@ -72,6 +72,6 @@ TEST(DrmQueryTest, givenDrmAllocationWhenShouldAllocationFaultIsCalledThenReturn
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
DrmMock drm{*executionEnvironment->rootDeviceEnvironments[0]};
MockDrmAllocation allocation(0u, AllocationType::BUFFER, MemoryPool::MemoryNull);
MockDrmAllocation allocation(0u, AllocationType::buffer, MemoryPool::MemoryNull);
EXPECT_FALSE(allocation.shouldAllocationPageFault(&drm));
}

View File

@@ -361,14 +361,14 @@ TEST(DrmQueryTest, givenUseKmdMigrationWhenShouldAllocationFaultIsCalledOnFaulta
drm.pageFaultSupported = true;
AllocationType allocationTypesThatShouldFault[] = {
AllocationType::UNIFIED_SHARED_MEMORY};
AllocationType::unifiedSharedMemory};
for (auto allocationType : allocationTypesThatShouldFault) {
MockDrmAllocation allocation(0u, allocationType, MemoryPool::MemoryNull);
EXPECT_TRUE(allocation.shouldAllocationPageFault(&drm));
}
MockDrmAllocation allocation(0u, AllocationType::BUFFER, MemoryPool::MemoryNull);
MockDrmAllocation allocation(0u, AllocationType::buffer, MemoryPool::MemoryNull);
EXPECT_FALSE(allocation.shouldAllocationPageFault(&drm));
}
@@ -388,7 +388,7 @@ TEST(DrmQueryTest, givenDrmAllocationWhenShouldAllocationFaultIsCalledOnNonFault
DrmQueryMock drm{*executionEnvironment->rootDeviceEnvironments[0]};
drm.pageFaultSupported = false;
MockDrmAllocation allocation(0u, AllocationType::BUFFER, MemoryPool::MemoryNull);
MockDrmAllocation allocation(0u, AllocationType::buffer, MemoryPool::MemoryNull);
EXPECT_FALSE(allocation.shouldAllocationPageFault(&drm));
}
@@ -400,7 +400,7 @@ TEST(DrmQueryTest, givenEnableImplicitMigrationOnFaultableHardwareWhenShouldAllo
DrmQueryMock drm{*executionEnvironment->rootDeviceEnvironments[0]};
drm.pageFaultSupported = true;
MockDrmAllocation allocation(0u, AllocationType::BUFFER, MemoryPool::MemoryNull);
MockDrmAllocation allocation(0u, AllocationType::buffer, MemoryPool::MemoryNull);
EXPECT_TRUE(allocation.shouldAllocationPageFault(&drm));
}
@@ -434,7 +434,7 @@ TEST(DrmQueryTest, givenKmdMigrationSupportedWhenShouldAllocationPageFaultIsCall
drm.pageFaultSupported = true;
MockBufferObject bo(0u, &drm, 3, 0, 0, 1);
MockDrmAllocation allocation(0u, AllocationType::UNIFIED_SHARED_MEMORY, MemoryPool::LocalMemory);
MockDrmAllocation allocation(0u, AllocationType::unifiedSharedMemory, MemoryPool::LocalMemory);
allocation.bufferObjects[0] = &bo;
EXPECT_EQ(drm.hasKmdMigrationSupport(), allocation.shouldAllocationPageFault(&drm));

View File

@@ -549,7 +549,7 @@ TEST_F(DrmMemoryOperationsHandlerBindTest, givenMakeBOsResidentFailsThenMakeResi
BufferObject mockBo(device->getRootDeviceIndex(), mock, 3, 1, 0, 1);
bos.push_back(&mockBo);
auto allocation = new MockDrmAllocationBOsResident(0, AllocationType::UNKNOWN, bos, nullptr, 0u, size, MemoryPool::LocalMemory);
auto allocation = new MockDrmAllocationBOsResident(0, AllocationType::unknown, bos, nullptr, 0u, size, MemoryPool::LocalMemory);
auto graphicsAllocation = static_cast<GraphicsAllocation *>(allocation);
EXPECT_EQ(operationHandler->makeResidentWithinOsContext(device->getDefaultEngine().osContext, ArrayRef<GraphicsAllocation *>(&graphicsAllocation, 1), false), MemoryOperationsStatus::OUT_OF_MEMORY);
@@ -574,7 +574,7 @@ TEST_F(DrmMemoryOperationsHandlerBindTest,
mockBo.setSize(1024);
bos.push_back(&mockBo);
auto allocation = new MockDrmAllocationBOsResident(0, AllocationType::UNKNOWN, bos, nullptr, 0u, size, MemoryPool::LocalMemory);
auto allocation = new MockDrmAllocationBOsResident(0, AllocationType::unknown, bos, nullptr, 0u, size, MemoryPool::LocalMemory);
allocation->setNumHandles(1);
allocation->storageInfo.isChunked = 1;
allocation->storageInfo.numOfChunks = 4;
@@ -1098,7 +1098,7 @@ HWTEST_F(DrmMemoryOperationsHandlerBindTest, givenPatIndexProgrammingEnabledWhen
uint64_t gpuAddress = 0x123000;
size_t size = 1;
BufferObject bo(0, mock, static_cast<uint64_t>(MockGmmClientContextBase::MockPatIndex::cached), 0, 1, 1);
DrmAllocation allocation(0, 1, AllocationType::BUFFER, &bo, nullptr, gpuAddress, size, MemoryPool::System4KBPages);
DrmAllocation allocation(0, 1, AllocationType::buffer, &bo, nullptr, gpuAddress, size, MemoryPool::System4KBPages);
auto allocationPtr = static_cast<GraphicsAllocation *>(&allocation);
@@ -1161,7 +1161,7 @@ HWTEST_F(DrmMemoryOperationsHandlerBindTest, givenPatIndexErrorAndUncachedDebugF
uint64_t gpuAddress = 0x123000;
size_t size = 1;
BufferObject bo(0, mock, static_cast<uint64_t>(MockGmmClientContextBase::MockPatIndex::cached), 0, 1, 1);
DrmAllocation allocation(0, 1, AllocationType::BUFFER, &bo, nullptr, gpuAddress, size, MemoryPool::System4KBPages);
DrmAllocation allocation(0, 1, AllocationType::buffer, &bo, nullptr, gpuAddress, size, MemoryPool::System4KBPages);
EXPECT_ANY_THROW(mock->getPatIndex(allocation.getDefaultGmm(), allocation.getAllocationType(), CacheRegion::defaultRegion, CachePolicy::writeBack, false, false));
}
@@ -1238,11 +1238,11 @@ HWTEST_F(DrmMemoryOperationsHandlerBindTest, givenDebugFlagSetWhenVmBindCalledTh
auto osContext = memoryManager->createAndRegisterOsContext(csr.get(), EngineDescriptorHelper::getDefaultDescriptor());
csr->setupContext(*osContext);
auto patIndex = mock->getPatIndex(nullptr, AllocationType::BUFFER, CacheRegion::defaultRegion, CachePolicy::writeBack, false, false);
auto patIndex = mock->getPatIndex(nullptr, AllocationType::buffer, CacheRegion::defaultRegion, CachePolicy::writeBack, false, false);
EXPECT_EQ(2u, patIndex);
MockBufferObject bo(0, mock, patIndex, 0, 0, 1);
DrmAllocation allocation(0, AllocationType::BUFFER, &bo, nullptr, 0x1234000, 1, MemoryPool::LocalMemory);
DrmAllocation allocation(0, AllocationType::buffer, &bo, nullptr, 0x1234000, 1, MemoryPool::LocalMemory);
GraphicsAllocation *allocPtr = &allocation;
@@ -1269,11 +1269,11 @@ HWTEST_F(DrmMemoryOperationsHandlerBindTest, givenDebugFlagSetWhenVmBindCalledTh
auto osContext = memoryManager->createAndRegisterOsContext(csr.get(), EngineDescriptorHelper::getDefaultDescriptor());
csr->setupContext(*osContext);
auto patIndex = mock->getPatIndex(nullptr, AllocationType::BUFFER, CacheRegion::defaultRegion, CachePolicy::writeBack, false, true);
auto patIndex = mock->getPatIndex(nullptr, AllocationType::buffer, CacheRegion::defaultRegion, CachePolicy::writeBack, false, true);
EXPECT_EQ(3u, patIndex);
MockBufferObject bo(0, mock, patIndex, 0, 0, 1);
DrmAllocation allocation(0, AllocationType::BUFFER, &bo, nullptr, 0x1234000, 1, MemoryPool::System4KBPages);
DrmAllocation allocation(0, AllocationType::buffer, &bo, nullptr, 0x1234000, 1, MemoryPool::System4KBPages);
GraphicsAllocation *allocPtr = &allocation;

View File

@@ -172,7 +172,7 @@ TEST(DrmVmBindTest, givenUseKmdMigrationWhenCallingBindBoOnUnifiedSharedMemoryTh
uint32_t vmHandleId = 0;
MockBufferObject bo(0u, &drm, 3, 0, 0, 1);
MockDrmAllocation allocation(0u, AllocationType::UNIFIED_SHARED_MEMORY, MemoryPool::LocalMemory);
MockDrmAllocation allocation(0u, AllocationType::unifiedSharedMemory, MemoryPool::LocalMemory);
allocation.bufferObjects[0] = &bo;
allocation.bindBO(&bo, &osContext, vmHandleId, nullptr, true);
@@ -195,7 +195,7 @@ TEST(DrmVmBindTest, givenDrmWithPageFaultSupportWhenCallingBindBoOnUnifiedShared
uint32_t vmHandleId = 0;
MockBufferObject bo(0u, &drm, 3, 0, 0, 1);
MockDrmAllocation allocation(0u, AllocationType::UNIFIED_SHARED_MEMORY, MemoryPool::LocalMemory);
MockDrmAllocation allocation(0u, AllocationType::unifiedSharedMemory, MemoryPool::LocalMemory);
allocation.bufferObjects[0] = &bo;
allocation.bindBO(&bo, &osContext, vmHandleId, nullptr, true);

View File

@@ -279,7 +279,7 @@ TEST_F(IoctlHelperPrelimFixture, givenDrmAllocationWhenSetMemAdviseFailsThenDont
drm->ioctlRetVal = -1;
MockBufferObject bo(0u, drm.get(), 3, 0, 0, 1);
MockDrmAllocation allocation(0u, AllocationType::BUFFER, MemoryPool::LocalMemory);
MockDrmAllocation allocation(0u, AllocationType::buffer, MemoryPool::LocalMemory);
allocation.bufferObjects[0] = &bo;
MemAdviseFlags memAdviseFlags{};
@@ -300,7 +300,7 @@ TEST_F(IoctlHelperPrelimFixture, givenDrmAllocationWhenSetMemAdviseForChunkingFa
drm->ioctlRetVal = -1;
MockBufferObject bo(0u, drm.get(), 3, 0, 0, 1);
MockDrmAllocation allocation(0u, AllocationType::BUFFER, MemoryPool::LocalMemory);
MockDrmAllocation allocation(0u, AllocationType::buffer, MemoryPool::LocalMemory);
allocation.bufferObjects[0] = &bo;
MemAdviseFlags memAdviseFlags{};
@@ -316,7 +316,7 @@ TEST_F(IoctlHelperPrelimFixture, givenDrmAllocationWhenSetMemAdviseForChunkingFa
TEST_F(IoctlHelperPrelimFixture, givenDrmAllocationWhenSetMemAdviseWithNonAtomicIsCalledThenUpdateTheCorrespondingVmAdviceForBufferObject) {
MockBufferObject bo(0u, drm.get(), 3, 0, 0, 1);
drm->ioctlCallsCount = 0;
MockDrmAllocation allocation(0u, AllocationType::BUFFER, MemoryPool::LocalMemory);
MockDrmAllocation allocation(0u, AllocationType::buffer, MemoryPool::LocalMemory);
allocation.bufferObjects[0] = &bo;
MemAdviseFlags memAdviseFlags{};
@@ -333,7 +333,7 @@ TEST_F(IoctlHelperPrelimFixture, givenDrmAllocationWhenSetMemAdviseWithNonAtomic
TEST_F(IoctlHelperPrelimFixture, givenDrmAllocationWhenSetMemAdviseWithDevicePreferredLocationIsCalledThenUpdateTheCorrespondingVmAdviceForBufferObject) {
drm->ioctlCallsCount = 0;
MockBufferObject bo(0u, drm.get(), 3, 0, 0, 1);
MockDrmAllocation allocation(0u, AllocationType::BUFFER, MemoryPool::LocalMemory);
MockDrmAllocation allocation(0u, AllocationType::buffer, MemoryPool::LocalMemory);
allocation.bufferObjects[0] = &bo;
allocation.storageInfo.memoryBanks = 0x1;
allocation.setNumHandles(1);
@@ -352,7 +352,7 @@ TEST_F(IoctlHelperPrelimFixture, givenDrmAllocationWhenSetMemAdviseWithDevicePre
TEST_F(IoctlHelperPrelimFixture, givenDrmAllocationWhenSetMemAdviseWithSystemPreferredLocationIsCalledThenUpdateTheCorrespondingVmAdviceForBufferObject) {
drm->ioctlCallsCount = 0;
MockBufferObject bo(0u, drm.get(), 3, 0, 0, 1);
MockDrmAllocation allocation(0u, AllocationType::BUFFER, MemoryPool::LocalMemory);
MockDrmAllocation allocation(0u, AllocationType::buffer, MemoryPool::LocalMemory);
allocation.bufferObjects[0] = &bo;
allocation.storageInfo.memoryBanks = 0x1;
allocation.setNumHandles(1);
@@ -382,7 +382,7 @@ TEST_F(IoctlHelperPrelimFixture, givenDrmAllocationWhenSetMemAdviseWithChunkingP
drm->ioctlCallsCount = 0;
MockBufferObject bo(0u, drm.get(), 3, 0, 0, 1);
MockDrmAllocation allocation(0u, AllocationType::BUFFER, MemoryPool::LocalMemory);
MockDrmAllocation allocation(0u, AllocationType::buffer, MemoryPool::LocalMemory);
allocation.bufferObjects[0] = &bo;
allocation.storageInfo.memoryBanks = 0x1;
allocation.setNumHandles(1);
@@ -414,7 +414,7 @@ TEST_F(IoctlHelperPrelimFixture, givenDrmAllocationWhenSetMemAdviseWithChunkingB
drm->ioctlCallsCount = 0;
MockBufferObject bo(0u, drm.get(), 3, 0, 0, 1);
MockDrmAllocation allocation(0u, AllocationType::BUFFER, MemoryPool::LocalMemory);
MockDrmAllocation allocation(0u, AllocationType::buffer, MemoryPool::LocalMemory);
allocation.bufferObjects[0] = &bo;
allocation.storageInfo.memoryBanks = 0x1;
allocation.setNumHandles(1);
@@ -448,7 +448,7 @@ TEST_F(IoctlHelperPrelimFixture,
drm->ioctlCallsCount = 0;
MockBufferObject bo(0u, drm.get(), 3, 0, 0, 1);
MockDrmAllocation allocation(0u, AllocationType::BUFFER, MemoryPool::LocalMemory);
MockDrmAllocation allocation(0u, AllocationType::buffer, MemoryPool::LocalMemory);
allocation.bufferObjects[0] = &bo;
allocation.storageInfo.memoryBanks = 0x5;
allocation.setNumHandles(1);
@@ -467,7 +467,7 @@ TEST_F(IoctlHelperPrelimFixture,
TEST_F(IoctlHelperPrelimFixture, givenDrmAllocationWhenSetAtomicAccessWithModeCalledThenIoctlCalled) {
drm->ioctlCallsCount = 0;
MockBufferObject bo(0u, drm.get(), 3, 0, 0, 1);
MockDrmAllocation allocation(0u, AllocationType::BUFFER, MemoryPool::LocalMemory);
MockDrmAllocation allocation(0u, AllocationType::buffer, MemoryPool::LocalMemory);
allocation.bufferObjects[0] = &bo;
allocation.storageInfo.memoryBanks = 0x1;
allocation.setNumHandles(1);
@@ -493,7 +493,7 @@ TEST_F(IoctlHelperPrelimFixture, givenDrmAllocationWhenSetAtomicAccessWithModeCa
TEST_F(IoctlHelperPrelimFixture, givenDrmAllocationWhenSetAtomicAccessWithNullBufferObjectThenIoctlNotCalled) {
drm->ioctlCallsCount = 0;
MockDrmAllocation allocation(0u, AllocationType::BUFFER, MemoryPool::LocalMemory);
MockDrmAllocation allocation(0u, AllocationType::buffer, MemoryPool::LocalMemory);
allocation.bufferObjects[0] = nullptr;
allocation.storageInfo.memoryBanks = 0x1;
allocation.setNumHandles(1);
@@ -507,7 +507,7 @@ TEST_F(IoctlHelperPrelimFixture, givenDrmAllocationWhenSetAtomicAccessWithNullBu
TEST_F(IoctlHelperPrelimFixture, givenDrmAllocationWhenSetMemPrefetchSucceedsThenReturnTrue) {
SubDeviceIdsVec subDeviceIds{0};
MockBufferObject bo(0u, drm.get(), 3, 0, 0, 1);
MockDrmAllocation allocation(0u, AllocationType::BUFFER, MemoryPool::LocalMemory);
MockDrmAllocation allocation(0u, AllocationType::buffer, MemoryPool::LocalMemory);
allocation.bufferObjects[0] = &bo;
drm->ioctlRetVal = 0;
@@ -517,7 +517,7 @@ TEST_F(IoctlHelperPrelimFixture, givenDrmAllocationWhenSetMemPrefetchSucceedsThe
TEST_F(IoctlHelperPrelimFixture, givenDrmAllocationWhenSetMemPrefetchFailsThenReturnFalse) {
SubDeviceIdsVec subDeviceIds{0};
MockBufferObject bo(0u, drm.get(), 3, 0, 0, 1);
MockDrmAllocation allocation(0u, AllocationType::BUFFER, MemoryPool::LocalMemory);
MockDrmAllocation allocation(0u, AllocationType::buffer, MemoryPool::LocalMemory);
allocation.bufferObjects[0] = &bo;
allocation.setNumHandles(1);
@@ -544,7 +544,7 @@ TEST_F(IoctlHelperPrelimFixture,
MockBufferObject bo(0u, drm.get(), 3, 0, 0, 1);
bo.isChunked = 1;
bo.setSize(1024);
MockDrmAllocation allocation(0u, AllocationType::BUFFER, MemoryPool::LocalMemory);
MockDrmAllocation allocation(0u, AllocationType::buffer, MemoryPool::LocalMemory);
allocation.bufferObjects[0] = &bo;
allocation.storageInfo.memoryBanks = 0x5;
allocation.setNumHandles(1);
@@ -573,7 +573,7 @@ TEST_F(IoctlHelperPrelimFixture,
MockBufferObject bo(0u, drm.get(), 3, 0, 0, 1);
bo.isChunked = 1;
bo.setSize(1024);
MockDrmAllocation allocation(0u, AllocationType::BUFFER, MemoryPool::LocalMemory);
MockDrmAllocation allocation(0u, AllocationType::buffer, MemoryPool::LocalMemory);
allocation.bufferObjects[0] = &bo;
allocation.storageInfo.memoryBanks = 0x5;
allocation.setNumHandles(1);

View File

@@ -27,7 +27,7 @@ TEST(FileLogger, GivenLogAllocationMemoryPoolFlagThenLogsCorrectInfo) {
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
DrmMock drm(*executionEnvironment->rootDeviceEnvironments[0]);
MockDrmAllocation allocation(0u, AllocationType::BUFFER, MemoryPool::System64KBPages);
MockDrmAllocation allocation(0u, AllocationType::buffer, MemoryPool::System64KBPages);
auto gmmHelper = executionEnvironment->rootDeviceEnvironments[0]->getGmmHelper();
auto canonizedGpuAddress = gmmHelper->canonize(0x12345);
@@ -78,7 +78,7 @@ TEST(FileLogger, givenLogAllocationStdoutWhenLogAllocationThenLogToStdoutInstead
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
DrmMock drm(*executionEnvironment->rootDeviceEnvironments[0]);
MockDrmAllocation allocation(0u, AllocationType::BUFFER, MemoryPool::System64KBPages);
MockDrmAllocation allocation(0u, AllocationType::buffer, MemoryPool::System64KBPages);
auto gmmHelper = executionEnvironment->rootDeviceEnvironments[0]->getGmmHelper();
auto canonizedGpuAddress = gmmHelper->canonize(0x12345);
@@ -128,7 +128,7 @@ TEST(FileLogger, GivenDrmAllocationWithoutBOThenNoHandleLogged) {
// Log file not created
bool logFileCreated = fileExists(fileLogger.getLogFileName());
EXPECT_FALSE(logFileCreated);
MockDrmAllocation allocation(0u, AllocationType::BUFFER, MemoryPool::System64KBPages);
MockDrmAllocation allocation(0u, AllocationType::buffer, MemoryPool::System64KBPages);
fileLogger.logAllocation(&allocation);
@@ -159,7 +159,7 @@ TEST(FileLogger, GivenLogAllocationMemoryPoolFlagSetFalseThenAllocationIsNotLogg
bool logFileCreated = fileExists(fileLogger.getLogFileName());
EXPECT_FALSE(logFileCreated);
MockDrmAllocation allocation(0u, AllocationType::BUFFER, MemoryPool::System64KBPages);
MockDrmAllocation allocation(0u, AllocationType::buffer, MemoryPool::System64KBPages);
fileLogger.logAllocation(&allocation);