Remove debug flag ForceResourceLockOnTransferCalls

Unlock locked resoures in freeGraphicsMemory method

Change-Id: I2baae7b7f9d8260f19a4b083849c5bf0d1a764f3
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2019-01-24 15:16:12 +01:00
committed by sys_ocldev
parent 82046c25d2
commit 128bf4552f
13 changed files with 66 additions and 49 deletions

View File

@@ -137,6 +137,9 @@ void MemoryManager::freeGraphicsMemory(GraphicsAllocation *gfxAllocation) {
if (!gfxAllocation) {
return;
}
if (gfxAllocation->isLocked()) {
unlockResource(gfxAllocation);
}
freeGraphicsMemoryImpl(gfxAllocation);
}
//if not in use destroy in place
@@ -353,9 +356,11 @@ void *MemoryManager::lockResource(GraphicsAllocation *graphicsAllocation) {
if (!graphicsAllocation) {
return nullptr;
}
DEBUG_BREAK_IF(graphicsAllocation->isLocked());
if (graphicsAllocation->isLocked()) {
return graphicsAllocation->getLockedPtr();
}
auto retVal = lockResourceImpl(*graphicsAllocation);
graphicsAllocation->setLocked(true);
graphicsAllocation->lock(retVal);
return retVal;
}
@@ -365,6 +370,6 @@ void MemoryManager::unlockResource(GraphicsAllocation *graphicsAllocation) {
}
DEBUG_BREAK_IF(!graphicsAllocation->isLocked());
unlockResourceImpl(*graphicsAllocation);
graphicsAllocation->setLocked(false);
graphicsAllocation->unlock();
}
} // namespace OCLRT