mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-29 09:03:14 +08:00
Unbind BO before unmap
Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
b510923e25
commit
cfebccdd3f
@@ -694,15 +694,15 @@ void DrmMemoryManager::freeGraphicsMemoryImpl(GraphicsAllocation *gfxAllocation)
|
||||
DrmAllocation *drmAlloc = static_cast<DrmAllocation *>(gfxAllocation);
|
||||
this->unregisterAllocation(gfxAllocation);
|
||||
|
||||
if (drmAlloc->getMmapPtr()) {
|
||||
this->munmapFunction(drmAlloc->getMmapPtr(), drmAlloc->getMmapSize());
|
||||
}
|
||||
|
||||
for (auto &engine : this->registeredEngines) {
|
||||
auto memoryOperationsInterface = static_cast<DrmMemoryOperationsHandler *>(executionEnvironment.rootDeviceEnvironments[gfxAllocation->getRootDeviceIndex()]->memoryOperationsInterface.get());
|
||||
memoryOperationsInterface->evictWithinOsContext(engine.osContext, *gfxAllocation);
|
||||
}
|
||||
|
||||
if (drmAlloc->getMmapPtr()) {
|
||||
this->munmapFunction(drmAlloc->getMmapPtr(), drmAlloc->getMmapSize());
|
||||
}
|
||||
|
||||
for (auto handleId = 0u; handleId < gfxAllocation->getNumGmms(); handleId++) {
|
||||
delete gfxAllocation->getGmm(handleId);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user