WDDM Linux - allocate 32bit through KMD

Signed-off-by: Jaroslaw Chodor <jaroslaw.chodor@intel.com>
This commit is contained in:
Jaroslaw Chodor
2021-08-31 21:30:28 +02:00
committed by Compute-Runtime-Automation
parent c03620468b
commit 37af6a64c1
2 changed files with 90 additions and 3 deletions

View File

@@ -337,7 +337,7 @@ GraphicsAllocation *WddmMemoryManager::allocate32BitGraphicsMemoryImpl(const All
ptrAligned = alignDown(allocationData.hostPtr, MemoryConstants::allocationAlignment);
sizeAligned = alignSizeWholePage(allocationData.hostPtr, sizeAligned);
offset = ptrDiff(allocationData.hostPtr, ptrAligned);
} else {
} else if (preferredAllocationMethod == GfxMemoryAllocationMethod::UseUmdSystemPtr) {
sizeAligned = alignUp(sizeAligned, MemoryConstants::allocationAlignment);
pSysMem = allocateSystemMemory(sizeAligned, MemoryConstants::allocationAlignment);
if (pSysMem == nullptr) {
@@ -369,6 +369,11 @@ GraphicsAllocation *WddmMemoryManager::allocate32BitGraphicsMemoryImpl(const All
auto baseAddress = getGfxPartition(allocationData.rootDeviceIndex)->getHeapBase(heapAssigner.get32BitHeapIndex(allocationData.type, useLocalMemory, *hwInfo, allocationData.flags.use32BitFrontWindow));
wddmAllocation->setGpuBaseAddress(GmmHelper::canonize(baseAddress));
if (preferredAllocationMethod != GfxMemoryAllocationMethod::UseUmdSystemPtr) {
auto lockedPtr = lockResource(wddmAllocation.get());
wddmAllocation->setCpuAddress(lockedPtr);
}
return wddmAllocation.release();
}