mirror of
https://github.com/intel/compute-runtime.git
synced 2025-11-15 10:14:56 +08:00
Refactor: Change decanonize method accessing point
Accessing decanonize method as a member of GmmHelper class object Signed-off-by: Krzysztof Gibala <krzysztof.gibala@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
7bb3bcbc05
commit
2fcda0a528
@@ -288,9 +288,9 @@ void OsAgnosticMemoryManager::freeGraphicsMemoryImpl(GraphicsAllocation *gfxAllo
|
||||
delete gfxAllocation;
|
||||
return;
|
||||
}
|
||||
|
||||
auto memoryAllocation = static_cast<MemoryAllocation *>(gfxAllocation);
|
||||
auto sizeToFree = memoryAllocation->sizeToFree;
|
||||
auto rootDeviceIndex = gfxAllocation->getRootDeviceIndex();
|
||||
|
||||
if (sizeToFree) {
|
||||
auto gpuAddressToFree = GmmHelper::decanonize(memoryAllocation->getGpuAddress()) & ~MemoryConstants::pageMask;
|
||||
@@ -303,8 +303,6 @@ void OsAgnosticMemoryManager::freeGraphicsMemoryImpl(GraphicsAllocation *gfxAllo
|
||||
releaseReservedCpuAddressRange(gfxAllocation->getReservedAddressPtr(), gfxAllocation->getReservedAddressSize(), gfxAllocation->getRootDeviceIndex());
|
||||
}
|
||||
|
||||
auto rootDeviceIndex = gfxAllocation->getRootDeviceIndex();
|
||||
|
||||
if (executionEnvironment.rootDeviceEnvironments.size() > rootDeviceIndex) {
|
||||
auto aubCenter = executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->aubCenter.get();
|
||||
if (aubCenter && aubCenter->getAubManager() && DebugManager.flags.EnableFreeMemory.get()) {
|
||||
@@ -453,7 +451,8 @@ AddressRange OsAgnosticMemoryManager::reserveGpuAddress(size_t size, uint32_t ro
|
||||
|
||||
void OsAgnosticMemoryManager::freeGpuAddress(AddressRange addressRange, uint32_t rootDeviceIndex) {
|
||||
uint64_t graphicsAddress = addressRange.address;
|
||||
graphicsAddress = GmmHelper::decanonize(graphicsAddress);
|
||||
auto gmmHelper = getGmmHelper(rootDeviceIndex);
|
||||
graphicsAddress = gmmHelper->decanonize(graphicsAddress);
|
||||
auto gfxPartition = getGfxPartition(rootDeviceIndex);
|
||||
gfxPartition->freeGpuAddressRange(graphicsAddress, addressRange.size);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user