Add ULT for DrmMemoryManager

- ensure DrmMemoryManager::releaseGpuRange() calls GmmHelper::decanonize()
  before pass gpuAddress to GfxPartition::freeGpuAddressRange()

Related-To: NEO-2877, NEO-3530

Change-Id: I6f6b745a8f9262c6980b9ddd32c70d376fa49726
Signed-off-by: Venevtsev, Igor <igor.venevtsev@intel.com>
This commit is contained in:
Venevtsev, Igor
2019-07-29 17:50:46 +02:00
committed by sys_ocldev
parent 5f4cf2ac35
commit e721ff1ec3
10 changed files with 89 additions and 66 deletions

View File

@@ -45,7 +45,7 @@ WddmMemoryManager::WddmMemoryManager(ExecutionEnvironment &executionEnvironment)
if (asyncDeleterEnabled)
deferredDeleter = createDeferredDeleter();
mallocRestrictions.minAddress = wddm->getWddmMinAddress();
wddm->initGfxPartition(gfxPartition);
wddm->initGfxPartition(*gfxPartition);
}
GraphicsAllocation *WddmMemoryManager::allocateGraphicsMemoryForImageImpl(const AllocationData &allocationData, std::unique_ptr<Gmm> gmm) {
@@ -504,13 +504,13 @@ bool WddmMemoryManager::mapGpuVaForOneHandleAllocation(WddmAllocation *allocatio
addressToMap = allocation->reservedGpuVirtualAddress;
}
auto status = wddm->mapGpuVirtualAddress(allocation->getDefaultGmm(), allocation->getDefaultHandle(),
gfxPartition.getHeapMinimalAddress(heapIndex), gfxPartition.getHeapLimit(heapIndex),
gfxPartition->getHeapMinimalAddress(heapIndex), gfxPartition->getHeapLimit(heapIndex),
addressToMap, allocation->getGpuAddressToModify());
if (!status && deferredDeleter) {
deferredDeleter->drain(true);
status = wddm->mapGpuVirtualAddress(allocation->getDefaultGmm(), allocation->getDefaultHandle(),
gfxPartition.getHeapMinimalAddress(heapIndex), gfxPartition.getHeapLimit(heapIndex),
gfxPartition->getHeapMinimalAddress(heapIndex), gfxPartition->getHeapLimit(heapIndex),
addressToMap, allocation->getGpuAddressToModify());
}
if (!status) {
@@ -542,8 +542,8 @@ void WddmMemoryManager::obtainGpuAddressIfNeeded(WddmAllocation *allocation) {
if (allocation->getNumHandles() > 1u) {
auto heapIndex = selectHeap(allocation, false, executionEnvironment.isFullRangeSvm());
allocation->reservedSizeForGpuVirtualAddress = allocation->getAlignedSize();
allocation->reservedGpuVirtualAddress = wddm->reserveGpuVirtualAddress(gfxPartition.getHeapMinimalAddress(heapIndex),
gfxPartition.getHeapLimit(heapIndex),
allocation->reservedGpuVirtualAddress = wddm->reserveGpuVirtualAddress(gfxPartition->getHeapMinimalAddress(heapIndex),
gfxPartition->getHeapLimit(heapIndex),
allocation->reservedSizeForGpuVirtualAddress);
}
}