fix: Create GMM in DrmMemoryManager::createAllocWithAlignment

Resolves: NEO-9739
Related-To: NEO-9543

Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
Lukasz Jobczyk
2024-01-05 10:55:48 +00:00
committed by Compute-Runtime-Automation
parent 5664b764f0
commit add394722c
2 changed files with 4 additions and 0 deletions

View File

@@ -2206,6 +2206,9 @@ DrmAllocation *DrmMemoryManager::createAllocWithAlignment(const AllocationData &
return nullptr;
}
auto gmm = makeGmmIfSingleHandle(allocationData, alignedSize);
allocation->setDefaultGmm(gmm.release());
bo.release();
allocation->isShareableHostMemory = true;
allocation->storageInfo = allocationData.storageInfo;

View File

@@ -1461,6 +1461,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenAlignmentAndSizeWhenMmapRetur
munmapCalledCount = 0;
auto allocation = memoryManager->createAllocWithAlignment(allocationData, MemoryConstants::pageSize, MemoryConstants::pageSize64k, MemoryConstants::pageSize64k, 0u);
EXPECT_NE(allocation->getDefaultGmm(), nullptr);
EXPECT_EQ(alignUp(reinterpret_cast<void *>(0x12345678), MemoryConstants::pageSize64k), allocation->getMmapPtr());
EXPECT_EQ(1u, munmapCalledCount);