diff --git a/runtime/memory_manager/os_agnostic_memory_manager.cpp b/runtime/memory_manager/os_agnostic_memory_manager.cpp index d337d3136f..a4529449c8 100644 --- a/runtime/memory_manager/os_agnostic_memory_manager.cpp +++ b/runtime/memory_manager/os_agnostic_memory_manager.cpp @@ -60,7 +60,7 @@ GraphicsAllocation *OsAgnosticMemoryManager::allocateGraphicsMemoryForNonSvmHost auto alignedPtr = alignDown(reinterpret_cast(cpuPtr), MemoryConstants::pageSize); auto offsetInPage = reinterpret_cast(cpuPtr) - alignedPtr; - memoryAllocation = new MemoryAllocation(GraphicsAllocation::AllocationType::UNDECIDED, nullptr, cpuPtr, reinterpret_cast(alignedPtr), + memoryAllocation = new MemoryAllocation(GraphicsAllocation::AllocationType::EXTERNAL_HOST_PTR, nullptr, cpuPtr, reinterpret_cast(alignedPtr), size, counter, MemoryPool::System4KBPages, false); memoryAllocation->allocationOffset = offsetInPage; diff --git a/runtime/os_interface/linux/drm_allocation.h b/runtime/os_interface/linux/drm_allocation.h index 9133415944..8392678342 100644 --- a/runtime/os_interface/linux/drm_allocation.h +++ b/runtime/os_interface/linux/drm_allocation.h @@ -17,13 +17,13 @@ struct OsHandle { class DrmAllocation : public GraphicsAllocation { public: - DrmAllocation(BufferObject *bo, void *ptrIn, size_t sizeIn, osHandle sharedHandle, MemoryPool::Type pool, bool multiOsContextCapable) - : GraphicsAllocation(AllocationType::UNKNOWN, ptrIn, sizeIn, sharedHandle, pool, multiOsContextCapable), + DrmAllocation(AllocationType allocationType, BufferObject *bo, void *ptrIn, size_t sizeIn, osHandle sharedHandle, MemoryPool::Type pool, bool multiOsContextCapable) + : GraphicsAllocation(allocationType, ptrIn, sizeIn, sharedHandle, pool, multiOsContextCapable), bo(bo) { } - DrmAllocation(BufferObject *bo, void *ptrIn, uint64_t gpuAddress, size_t sizeIn, MemoryPool::Type pool, bool multiOsContextCapable) - : GraphicsAllocation(AllocationType::UNKNOWN, ptrIn, gpuAddress, 0, sizeIn, pool, multiOsContextCapable), + DrmAllocation(AllocationType allocationType, BufferObject *bo, void *ptrIn, uint64_t gpuAddress, size_t sizeIn, MemoryPool::Type pool, bool multiOsContextCapable) + : GraphicsAllocation(allocationType, ptrIn, gpuAddress, 0, sizeIn, pool, multiOsContextCapable), bo(bo) { } diff --git a/runtime/os_interface/linux/drm_memory_manager.cpp b/runtime/os_interface/linux/drm_memory_manager.cpp index 75e240b275..864802eab0 100644 --- a/runtime/os_interface/linux/drm_memory_manager.cpp +++ b/runtime/os_interface/linux/drm_memory_manager.cpp @@ -219,7 +219,7 @@ void DrmMemoryManager::emitPinningRequest(BufferObject *bo, const AllocationData DrmAllocation *DrmMemoryManager::createGraphicsAllocation(OsHandleStorage &handleStorage, const AllocationData &allocationData) { auto hostPtr = const_cast(allocationData.hostPtr); - auto allocation = new DrmAllocation(nullptr, hostPtr, castToUint64(hostPtr), allocationData.size, MemoryPool::System4KBPages, false); + auto allocation = new DrmAllocation(allocationData.type, nullptr, hostPtr, castToUint64(hostPtr), allocationData.size, MemoryPool::System4KBPages, false); allocation->fragmentsStorage = handleStorage; return allocation; } @@ -262,7 +262,7 @@ DrmAllocation *DrmMemoryManager::allocateGraphicsMemoryWithAlignment(const Alloc emitPinningRequest(bo, allocationData); - auto allocation = new DrmAllocation(bo, res, bo->gpuAddress, cSize, MemoryPool::System4KBPages, allocationData.flags.multiOsContextCapable); + auto allocation = new DrmAllocation(allocationData.type, bo, res, bo->gpuAddress, cSize, MemoryPool::System4KBPages, allocationData.flags.multiOsContextCapable); allocation->driverAllocatedCpuPointer = limitedGpuAddressRangeAllocator ? res : nullptr; return allocation; } @@ -301,7 +301,7 @@ DrmAllocation *DrmMemoryManager::allocateGraphicsMemoryForNonSvmHostPtr(size_t s bo->gpuAddress = gpuVirtualAddress; bo->setAllocationType(allocType); - auto allocation = new DrmAllocation(bo, alignedPtr, gpuVirtualAddress, size, MemoryPool::System4KBPages, false); + auto allocation = new DrmAllocation(GraphicsAllocation::AllocationType::EXTERNAL_HOST_PTR, bo, alignedPtr, gpuVirtualAddress, size, MemoryPool::System4KBPages, false); allocation->allocationOffset = offsetInPage; allocation->gpuBaseAddress = 0; @@ -345,7 +345,7 @@ GraphicsAllocation *DrmMemoryManager::allocateGraphicsMemoryForImageImpl(const A bo->setUnmapSize(allocationData.imgInfo->size); - auto allocation = new DrmAllocation(bo, nullptr, (uint64_t)gpuRange, allocationData.imgInfo->size, MemoryPool::SystemCpuInaccessible, false); + auto allocation = new DrmAllocation(allocationData.type, bo, nullptr, (uint64_t)gpuRange, allocationData.imgInfo->size, MemoryPool::SystemCpuInaccessible, false); bo->setAllocationType(allocatorType); allocation->gmm = gmm.release(); return allocation; @@ -377,7 +377,7 @@ DrmAllocation *DrmMemoryManager::allocate32BitGraphicsMemoryImpl(const Allocatio bo->setUnmapSize(realAllocationSize); bo->gpuAddress = gpuVirtualAddress; bo->setAllocationType(allocatorType); - auto allocation = new DrmAllocation(bo, const_cast(allocationData.hostPtr), static_cast(ptrOffset(gpuVirtualAddress, inputPointerOffset)), + auto allocation = new DrmAllocation(allocationData.type, bo, const_cast(allocationData.hostPtr), ptrOffset(gpuVirtualAddress, inputPointerOffset), allocationSize, MemoryPool::System4KBPagesWith32BitGpuAddressing, false); allocation->is32BitAllocation = true; allocation->gpuBaseAddress = allocatorToUse->getBase(); @@ -420,7 +420,7 @@ DrmAllocation *DrmMemoryManager::allocate32BitGraphicsMemoryImpl(const Allocatio bo->gpuAddress = res; // softpin to the GPU address, res if it uses limitedRange Allocation - auto allocation = new DrmAllocation(bo, ptrAlloc, res, alignedAllocationSize, + auto allocation = new DrmAllocation(allocationData.type, bo, ptrAlloc, res, alignedAllocationSize, MemoryPool::System4KBPagesWith32BitGpuAddressing, false); allocation->is32BitAllocation = true; @@ -493,7 +493,8 @@ GraphicsAllocation *DrmMemoryManager::createGraphicsAllocationFromSharedHandle(o lock.unlock(); - auto drmAllocation = new DrmAllocation(bo, reinterpret_cast(bo->gpuAddress), bo->size, handle, MemoryPool::SystemCpuInaccessible, false); + auto drmAllocation = new DrmAllocation(GraphicsAllocation::AllocationType::UNDECIDED, bo, reinterpret_cast(bo->gpuAddress), bo->size, + handle, MemoryPool::SystemCpuInaccessible, false); if (requireSpecificBitness && this->force32bitAllocations) { drmAllocation->is32BitAllocation = true; @@ -523,7 +524,7 @@ GraphicsAllocation *DrmMemoryManager::createPaddedAllocation(GraphicsAllocation bo->gpuAddress = gpuRange; bo->setUnmapSize(sizeWithPadding); bo->setAllocationType(storageType); - return new DrmAllocation(bo, (void *)srcPtr, (uint64_t)ptrOffset(gpuRange, offset), sizeWithPadding, + return new DrmAllocation(inputGraphicsAllocation->getAllocationType(), bo, srcPtr, ptrOffset(gpuRange, offset), sizeWithPadding, inputGraphicsAllocation->getMemoryPool(), false); } diff --git a/unit_tests/mocks/linux/mock_drm_allocation.h b/unit_tests/mocks/linux/mock_drm_allocation.h index b12ed3ce5f..93353a1f0e 100644 --- a/unit_tests/mocks/linux/mock_drm_allocation.h +++ b/unit_tests/mocks/linux/mock_drm_allocation.h @@ -24,7 +24,7 @@ class MockDrmAllocation : public DrmAllocation { using DrmAllocation::bo; using DrmAllocation::memoryPool; - MockDrmAllocation() : DrmAllocation(nullptr, nullptr, 0, static_cast(0), MemoryPool::MemoryNull, false) { + MockDrmAllocation(AllocationType allocationType, MemoryPool::Type pool) : DrmAllocation(allocationType, nullptr, nullptr, 0, static_cast(0), pool, false) { } }; diff --git a/unit_tests/os_interface/linux/debug_settings_manager_linux_tests.cpp b/unit_tests/os_interface/linux/debug_settings_manager_linux_tests.cpp index 33426a59a5..dd75a0d269 100644 --- a/unit_tests/os_interface/linux/debug_settings_manager_linux_tests.cpp +++ b/unit_tests/os_interface/linux/debug_settings_manager_linux_tests.cpp @@ -19,9 +19,7 @@ TEST(DebugSettingsManager, GivenDebugSettingsManagerWithLogAllocationsThenLogsCo debugManager.flags.LogAllocationMemoryPool.set(true); - MockDrmAllocation allocation; - allocation.setAllocationType(GraphicsAllocation::AllocationType::BUFFER); - allocation.memoryPool = MemoryPool::System64KBPages; + MockDrmAllocation allocation(GraphicsAllocation::AllocationType::BUFFER, MemoryPool::System64KBPages); MockBufferObject bo; bo.handle = 4; @@ -56,9 +54,7 @@ TEST(DebugSettingsManager, GivenDebugSettingsManagerWithDrmAllocationWithoutBOTh debugManager.flags.LogAllocationMemoryPool.set(true); - MockDrmAllocation allocation; - allocation.setAllocationType(GraphicsAllocation::AllocationType::BUFFER); - allocation.memoryPool = MemoryPool::System64KBPages; + MockDrmAllocation allocation(GraphicsAllocation::AllocationType::BUFFER, MemoryPool::System64KBPages); debugManager.logAllocation(&allocation); @@ -88,9 +84,7 @@ TEST(DebugSettingsManager, GivenDebugSettingsManagerWithoutLogAllocationsThenAll debugManager.flags.LogAllocationMemoryPool.set(false); - MockDrmAllocation allocation; - allocation.setAllocationType(GraphicsAllocation::AllocationType::BUFFER); - allocation.memoryPool = MemoryPool::System64KBPages; + MockDrmAllocation allocation(GraphicsAllocation::AllocationType::BUFFER, MemoryPool::System64KBPages); debugManager.logAllocation(&allocation); diff --git a/unit_tests/os_interface/linux/drm_command_stream_tests.cpp b/unit_tests/os_interface/linux/drm_command_stream_tests.cpp index e183f032f7..700a5de4d4 100644 --- a/unit_tests/os_interface/linux/drm_command_stream_tests.cpp +++ b/unit_tests/os_interface/linux/drm_command_stream_tests.cpp @@ -112,7 +112,7 @@ TEST_F(DrmCommandStreamTest, makeResident) { .Times(0); EXPECT_CALL(*mock, ioctl(DRM_IOCTL_I915_GEM_WAIT, ::testing::_)) .Times(0); - DrmAllocation graphicsAllocation(nullptr, nullptr, 1024, MemoryPool::MemoryNull, 1u, false); + DrmAllocation graphicsAllocation(GraphicsAllocation::AllocationType::UNDECIDED, nullptr, nullptr, 1024, MemoryPool::MemoryNull, 1u, false); csr->makeResident(graphicsAllocation); } @@ -126,7 +126,7 @@ TEST_F(DrmCommandStreamTest, makeResidentTwiceTheSame) { EXPECT_CALL(*mock, ioctl(DRM_IOCTL_I915_GEM_WAIT, ::testing::_)) .Times(0); - DrmAllocation graphicsAllocation(nullptr, nullptr, 1024, MemoryPool::MemoryNull, 1u, false); + DrmAllocation graphicsAllocation(GraphicsAllocation::AllocationType::UNDECIDED, nullptr, nullptr, 1024, MemoryPool::MemoryNull, 1u, false); csr->makeResident(graphicsAllocation); csr->makeResident(graphicsAllocation); @@ -142,7 +142,7 @@ TEST_F(DrmCommandStreamTest, makeResidentSizeZero) { EXPECT_CALL(*mock, ioctl(DRM_IOCTL_I915_GEM_WAIT, ::testing::_)) .Times(0); - DrmAllocation graphicsAllocation(nullptr, nullptr, 0, MemoryPool::MemoryNull, 1u, false); + DrmAllocation graphicsAllocation(GraphicsAllocation::AllocationType::UNDECIDED, nullptr, nullptr, 0, MemoryPool::MemoryNull, 1u, false); csr->makeResident(graphicsAllocation); } @@ -157,8 +157,8 @@ TEST_F(DrmCommandStreamTest, makeResidentResized) { EXPECT_CALL(*mock, ioctl(DRM_IOCTL_I915_GEM_WAIT, ::testing::_)) .Times(0); - DrmAllocation graphicsAllocation(nullptr, nullptr, 1024, MemoryPool::MemoryNull, 1u, false); - DrmAllocation graphicsAllocation2(nullptr, nullptr, 8192, MemoryPool::MemoryNull, 1u, false); + DrmAllocation graphicsAllocation(GraphicsAllocation::AllocationType::UNDECIDED, nullptr, nullptr, 1024, MemoryPool::MemoryNull, 1u, false); + DrmAllocation graphicsAllocation2(GraphicsAllocation::AllocationType::UNDECIDED, nullptr, nullptr, 8192, MemoryPool::MemoryNull, 1u, false); csr->makeResident(graphicsAllocation); csr->makeResident(graphicsAllocation2); @@ -321,7 +321,7 @@ TEST_F(DrmCommandStreamTest, FlushInvalidAddress) { //allocate command buffer manually char *commandBuffer = new (std::nothrow) char[1024]; ASSERT_NE(nullptr, commandBuffer); - DrmAllocation commandBufferAllocation(nullptr, commandBuffer, 1024, MemoryPool::MemoryNull, 1u, false); + DrmAllocation commandBufferAllocation(GraphicsAllocation::AllocationType::COMMAND_BUFFER, nullptr, commandBuffer, 1024, MemoryPool::MemoryNull, 1u, false); LinearStream cs(&commandBufferAllocation); csr->addBatchBufferEnd(cs, nullptr); @@ -463,8 +463,8 @@ TEST_F(DrmCommandStreamTest, FlushCheckFlags) { .Times(1) .WillRepeatedly(::testing::Return(0)); - DrmAllocation allocation(nullptr, (void *)0x7FFFFFFF, 1024, MemoryPool::MemoryNull, 1u, false); - DrmAllocation allocation2(nullptr, (void *)0x307FFFFFFF, 1024, MemoryPool::MemoryNull, 1u, false); + DrmAllocation allocation(GraphicsAllocation::AllocationType::UNDECIDED, nullptr, (void *)0x7FFFFFFF, 1024, MemoryPool::MemoryNull, 1u, false); + DrmAllocation allocation2(GraphicsAllocation::AllocationType::UNDECIDED, nullptr, (void *)0x307FFFFFFF, 1024, MemoryPool::MemoryNull, 1u, false); csr->makeResident(allocation); csr->makeResident(allocation2); csr->addBatchBufferEnd(cs, nullptr); @@ -497,7 +497,7 @@ TEST_F(DrmCommandStreamTest, CheckDrmFree) { EXPECT_CALL(*mock, ioctl(DRM_IOCTL_I915_GEM_WAIT, ::testing::_)) .Times(2); - DrmAllocation allocation(nullptr, nullptr, 1024, MemoryPool::MemoryNull, 1u, false); + DrmAllocation allocation(GraphicsAllocation::AllocationType::UNDECIDED, nullptr, nullptr, 1024, MemoryPool::MemoryNull, 1u, false); csr->makeResident(allocation); csr->addBatchBufferEnd(cs, nullptr); @@ -538,7 +538,7 @@ TEST_F(DrmCommandStreamTest, CheckDrmFreeCloseFailed) { .WillOnce(::testing::Return(-1)); EXPECT_CALL(*mock, ioctl(DRM_IOCTL_I915_GEM_WAIT, ::testing::_)) .Times(2); - DrmAllocation allocation(nullptr, nullptr, 1024, MemoryPool::MemoryNull, 1u, false); + DrmAllocation allocation(GraphicsAllocation::AllocationType::UNDECIDED, nullptr, nullptr, 1024, MemoryPool::MemoryNull, 1u, false); csr->makeResident(allocation); csr->addBatchBufferEnd(cs, nullptr); @@ -940,7 +940,7 @@ typedef Test DrmCommandStreamLeaksTest; TEST_F(DrmCommandStreamLeaksTest, makeResident) { auto buffer = this->createBO(1024); - auto allocation = new DrmAllocation(buffer, nullptr, buffer->peekSize(), MemoryPool::MemoryNull, 1u, false); + auto allocation = new DrmAllocation(GraphicsAllocation::AllocationType::UNDECIDED, buffer, nullptr, buffer->peekSize(), MemoryPool::MemoryNull, 1u, false); EXPECT_EQ(nullptr, allocation->getUnderlyingBuffer()); csr->makeResident(*allocation); @@ -962,8 +962,8 @@ TEST_F(DrmCommandStreamLeaksTest, makeResident) { TEST_F(DrmCommandStreamLeaksTest, makeResidentOnly) { BufferObject *buffer1 = this->createBO(4096); BufferObject *buffer2 = this->createBO(4096); - auto allocation1 = new DrmAllocation(buffer1, nullptr, buffer1->peekSize(), MemoryPool::MemoryNull, 1u, false); - auto allocation2 = new DrmAllocation(buffer2, nullptr, buffer2->peekSize(), MemoryPool::MemoryNull, 1u, false); + auto allocation1 = new DrmAllocation(GraphicsAllocation::AllocationType::UNDECIDED, buffer1, nullptr, buffer1->peekSize(), MemoryPool::MemoryNull, 1u, false); + auto allocation2 = new DrmAllocation(GraphicsAllocation::AllocationType::UNDECIDED, buffer2, nullptr, buffer2->peekSize(), MemoryPool::MemoryNull, 1u, false); EXPECT_EQ(nullptr, allocation1->getUnderlyingBuffer()); EXPECT_EQ(nullptr, allocation2->getUnderlyingBuffer()); @@ -990,7 +990,7 @@ TEST_F(DrmCommandStreamLeaksTest, makeResidentOnly) { TEST_F(DrmCommandStreamLeaksTest, makeResidentTwice) { auto buffer = this->createBO(1024); - auto allocation = new DrmAllocation(buffer, nullptr, buffer->peekSize(), MemoryPool::MemoryNull, 1u, false); + auto allocation = new DrmAllocation(GraphicsAllocation::AllocationType::UNDECIDED, buffer, nullptr, buffer->peekSize(), MemoryPool::MemoryNull, 1u, false); csr->makeResident(*allocation); csr->processResidency(csr->getResidencyAllocations()); @@ -1262,7 +1262,7 @@ TEST_F(DrmCommandStreamLeaksTest, GivenTwoAllocationsWhenBackingStorageIsDiffere TEST_F(DrmCommandStreamLeaksTest, makeResidentSizeZero) { std::unique_ptr buffer(this->createBO(0)); - DrmAllocation allocation(buffer.get(), nullptr, buffer->peekSize(), MemoryPool::MemoryNull, 1u, false); + DrmAllocation allocation(GraphicsAllocation::AllocationType::UNDECIDED, buffer.get(), nullptr, buffer->peekSize(), MemoryPool::MemoryNull, 1u, false); EXPECT_EQ(nullptr, allocation.getUnderlyingBuffer()); EXPECT_EQ(buffer->peekSize(), allocation.getUnderlyingBufferSize()); @@ -1487,7 +1487,7 @@ class DrmMockBuffer : public Buffer { public: static DrmMockBuffer *create() { char *data = static_cast(::alignedMalloc(128, 64)); - DrmAllocation *alloc = new (std::nothrow) DrmAllocation(nullptr, &data, sizeof(data), MemoryPool::MemoryNull, 1u, false); + DrmAllocation *alloc = new (std::nothrow) DrmAllocation(GraphicsAllocation::AllocationType::UNDECIDED, nullptr, &data, sizeof(data), MemoryPool::MemoryNull, 1u, false); return new DrmMockBuffer(data, 128, alloc); } diff --git a/unit_tests/os_interface/linux/drm_gem_close_worker_tests.cpp b/unit_tests/os_interface/linux/drm_gem_close_worker_tests.cpp index 583b434b75..b09678d18d 100644 --- a/unit_tests/os_interface/linux/drm_gem_close_worker_tests.cpp +++ b/unit_tests/os_interface/linux/drm_gem_close_worker_tests.cpp @@ -82,12 +82,14 @@ class DrmGemCloseWorkerFixture { protected: class BufferObjectWrapper : public BufferObject { public: - BufferObjectWrapper(Drm *drm, int handle) : BufferObject(drm, handle, false) { + BufferObjectWrapper(Drm *drm, int handle) + : BufferObject(drm, handle, false) { } }; class DrmAllocationWrapper : public DrmAllocation { public: - DrmAllocationWrapper(BufferObject *bo) : DrmAllocation(bo, nullptr, 0, MemoryPool::MemoryNull, 1u, false) { + DrmAllocationWrapper(BufferObject *bo) + : DrmAllocation(GraphicsAllocation::AllocationType::UNDECIDED, bo, nullptr, 0, MemoryPool::MemoryNull, 1u, false) { } }; ExecutionEnvironment executionEnvironment; diff --git a/unit_tests/os_interface/linux/drm_memory_manager_tests.cpp b/unit_tests/os_interface/linux/drm_memory_manager_tests.cpp index 896aa06d30..bc6432834b 100644 --- a/unit_tests/os_interface/linux/drm_memory_manager_tests.cpp +++ b/unit_tests/os_interface/linux/drm_memory_manager_tests.cpp @@ -144,7 +144,7 @@ TEST_F(DrmMemoryManagerTest, GivenGraphicsAllocationWhenAddAndRemoveAllocationTo void *cpuPtr = (void *)0x30000; size_t size = 0x1000; - DrmAllocation gfxAllocation(nullptr, cpuPtr, size, MemoryPool::MemoryNull, 1u, false); + DrmAllocation gfxAllocation(GraphicsAllocation::AllocationType::UNDECIDED, nullptr, cpuPtr, size, MemoryPool::MemoryNull, 1u, false); memoryManager->addAllocationToHostPtrManager(&gfxAllocation); auto fragment = memoryManager->getHostPtrManager()->getFragment(gfxAllocation.getUnderlyingBuffer()); EXPECT_NE(fragment, nullptr); @@ -1974,7 +1974,7 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenLockUnlockIsCalledOnNullAl } TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenLockUnlockIsCalledOnAllocationWithoutBufferObjectThenReturnNullPtr) { - DrmAllocation drmAllocation(nullptr, nullptr, 0u, 0u, 1u, false); + DrmAllocation drmAllocation(GraphicsAllocation::AllocationType::UNDECIDED, nullptr, nullptr, 0u, 0u, 1u, false); EXPECT_EQ(nullptr, drmAllocation.getBO()); auto ptr = memoryManager->lockResource(&drmAllocation); @@ -1993,7 +1993,7 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenLockUnlockIsCalledButFails BufferObjectMock(Drm *drm) : BufferObject(drm, 1, true) {} }; BufferObjectMock bo(&drmMock); - DrmAllocation drmAllocation(&bo, nullptr, 0u, 0u, 1u, false); + DrmAllocation drmAllocation(GraphicsAllocation::AllocationType::UNDECIDED, &bo, nullptr, 0u, 0u, 1u, false); EXPECT_NE(nullptr, drmAllocation.getBO()); auto ptr = memoryManager->lockResource(&drmAllocation); @@ -2004,7 +2004,7 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenLockUnlockIsCalledButFails } TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenSetDomainCpuIsCalledOnAllocationWithoutBufferObjectThenReturnFalse) { - DrmAllocation drmAllocation(nullptr, nullptr, 0u, 0u, 1u, false); + DrmAllocation drmAllocation(GraphicsAllocation::AllocationType::UNDECIDED, nullptr, nullptr, 0u, 0u, 1u, false); EXPECT_EQ(nullptr, drmAllocation.getBO()); auto success = memoryManager->setDomainCpu(drmAllocation, false); @@ -2021,7 +2021,7 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenSetDomainCpuIsCalledButFai BufferObjectMock(Drm *drm) : BufferObject(drm, 1, true) {} }; BufferObjectMock bo(&drmMock); - DrmAllocation drmAllocation(&bo, nullptr, 0u, 0u, 1u, false); + DrmAllocation drmAllocation(GraphicsAllocation::AllocationType::UNDECIDED, &bo, nullptr, 0u, 0u, 1u, false); EXPECT_NE(nullptr, drmAllocation.getBO()); auto success = memoryManager->setDomainCpu(drmAllocation, false); @@ -2037,7 +2037,7 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenSetDomainCpuIsCalledOnAllo BufferObjectMock(Drm *drm) : BufferObject(drm, 1, true) {} }; BufferObjectMock bo(&drmMock); - DrmAllocation drmAllocation(&bo, nullptr, 0u, 0u, 1u, false); + DrmAllocation drmAllocation(GraphicsAllocation::AllocationType::UNDECIDED, &bo, nullptr, 0u, 0u, 1u, false); EXPECT_NE(nullptr, drmAllocation.getBO()); auto success = memoryManager->setDomainCpu(drmAllocation, true); @@ -2058,7 +2058,7 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerAndUnifiedAuxCapableAllocation auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{MemoryConstants::pageSize}); allocation->gmm = gmm; - auto mockGmmRes = reinterpret_cast(gmm->gmmResourceInfo.get()); + auto mockGmmRes = static_cast(gmm->gmmResourceInfo.get()); mockGmmRes->setUnifiedAuxTranslationCapable(); EXPECT_FALSE(memoryManager->mapAuxGpuVA(allocation));