fix: dont reset cpu ptr in tbx mode during virtual map

Related-To: HSD-18038484849

Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
Bartosz Dunajski
2024-07-23 14:22:45 +00:00
committed by Compute-Runtime-Automation
parent 8a7923c6ee
commit 18c4f0b54f
4 changed files with 23 additions and 2 deletions

View File

@@ -82,6 +82,9 @@ class GraphicsAllocation : public IDNode<GraphicsAllocation> {
this->cpuPtr = cpuPtr;
this->gpuAddress = canonizedGpuAddress;
}
void setGpuPtr(uint64_t canonizedGpuAddress) {
this->gpuAddress = canonizedGpuAddress;
}
size_t getUnderlyingBufferSize() const { return size; }
void setSize(size_t size) { this->size = size; }

View File

@@ -417,12 +417,12 @@ void OsAgnosticMemoryManager::cleanOsHandles(OsHandleStorage &handleStorage, uin
}
void OsAgnosticMemoryManager::unMapPhysicalToVirtualMemory(GraphicsAllocation *physicalAllocation, uint64_t gpuRange, size_t bufferSize, OsContext *osContext, uint32_t rootDeviceIndex) {
physicalAllocation->setCpuPtrAndGpuAddress(nullptr, 0u);
physicalAllocation->setGpuPtr(0u);
physicalAllocation->setReservedAddressRange(nullptr, 0u);
}
bool OsAgnosticMemoryManager::mapPhysicalToVirtualMemory(GraphicsAllocation *physicalAllocation, uint64_t gpuRange, size_t bufferSize) {
physicalAllocation->setCpuPtrAndGpuAddress(nullptr, gpuRange);
physicalAllocation->setGpuPtr(gpuRange);
physicalAllocation->setReservedAddressRange(reinterpret_cast<void *>(gpuRange), bufferSize);
return true;
}