mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-28 00:03:14 +08:00
fix: Release usage when put cmd buffer to reusable list
Resolves: NEO-10004 Related-To: NEO-7116 Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
6abce2b29d
commit
2bda9f0b58
@@ -298,15 +298,21 @@ void CommandContainer::handleCmdBufferAllocations(size_t startIndex) {
|
||||
if (this->reusableAllocationList) {
|
||||
|
||||
if (isHandleFenceCompletionRequired) {
|
||||
std::vector<std::unique_lock<CommandStreamReceiver::MutexType>> locks;
|
||||
for (auto &engine : this->device->getMemoryManager()->getRegisteredEngines(cmdBufferAllocations[i]->getRootDeviceIndex())) {
|
||||
if (cmdBufferAllocations[i]->isUsedByOsContext(engine.osContext->getContextId())) {
|
||||
auto lock = engine.commandStreamReceiver->obtainUniqueOwnership();
|
||||
locks.push_back(engine.commandStreamReceiver->obtainUniqueOwnership());
|
||||
engine.commandStreamReceiver->stopDirectSubmission(false);
|
||||
}
|
||||
}
|
||||
this->device->getMemoryManager()->handleFenceCompletion(cmdBufferAllocations[i]);
|
||||
if (!locks.empty()) {
|
||||
this->device->getMemoryManager()->handleFenceCompletion(cmdBufferAllocations[i]);
|
||||
}
|
||||
}
|
||||
|
||||
for (auto &engine : this->device->getMemoryManager()->getRegisteredEngines(cmdBufferAllocations[i]->getRootDeviceIndex())) {
|
||||
cmdBufferAllocations[i]->releaseUsageInOsContext(engine.osContext->getContextId());
|
||||
}
|
||||
reusableAllocationList->pushFrontOne(*cmdBufferAllocations[i]);
|
||||
} else {
|
||||
this->device->getMemoryManager()->freeGraphicsMemory(cmdBufferAllocations[i]);
|
||||
|
||||
Reference in New Issue
Block a user