mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-21 01:04:57 +08:00
fix: Extend ULLS light mutex range
If some operatioins requires ULLS light stop, execute such operations under mutex in pair with ULLS stop to ensure no other thread will start ULLS. Related-To: NEO-14406, NEO-13922 Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
58faf6e7f5
commit
5bcf500c13
@@ -348,11 +348,13 @@ int BufferObject::validateHostPtr(BufferObject *const boToPin[], size_t numberOf
|
||||
}
|
||||
}
|
||||
} else {
|
||||
StackVec<std::unique_lock<NEO::CommandStreamReceiver::MutexType>, 1> locks{};
|
||||
if (this->drm->getRootDeviceEnvironment().executionEnvironment.memoryManager.get()) {
|
||||
const auto &engines = this->drm->getRootDeviceEnvironment().executionEnvironment.memoryManager->getRegisteredEngines(osContext->getRootDeviceIndex());
|
||||
for (const auto &engine : engines) {
|
||||
if (engine.osContext->isDirectSubmissionLightActive()) {
|
||||
engine.commandStreamReceiver->stopDirectSubmission(false, true);
|
||||
locks.push_back(engine.commandStreamReceiver->obtainUniqueOwnership());
|
||||
engine.commandStreamReceiver->stopDirectSubmission(false, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1367,6 +1367,7 @@ void DrmMemoryManager::freeGraphicsMemoryImpl(GraphicsAllocation *gfxAllocation,
|
||||
if (engine.osContext->isDirectSubmissionLightActive()) {
|
||||
lock = engine.commandStreamReceiver->obtainUniqueOwnership();
|
||||
engine.commandStreamReceiver->stopDirectSubmission(true, false);
|
||||
handleFenceCompletion(gfxAllocation);
|
||||
}
|
||||
|
||||
auto memoryOperationsInterface = static_cast<DrmMemoryOperationsHandler *>(executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->memoryOperationsInterface.get());
|
||||
|
||||
@@ -880,12 +880,14 @@ int Drm::waitHandle(uint32_t waitHandle, int64_t timeout) {
|
||||
wait.boHandle = waitHandle;
|
||||
wait.timeoutNs = timeout;
|
||||
|
||||
StackVec<std::unique_lock<NEO::CommandStreamReceiver::MutexType>, 1> locks{};
|
||||
if (this->rootDeviceEnvironment.executionEnvironment.memoryManager) {
|
||||
const auto &mulitEngines = this->rootDeviceEnvironment.executionEnvironment.memoryManager->getRegisteredEngines();
|
||||
for (const auto &engines : mulitEngines) {
|
||||
for (const auto &engine : engines) {
|
||||
if (engine.osContext->isDirectSubmissionLightActive()) {
|
||||
engine.commandStreamReceiver->stopDirectSubmission(false, true);
|
||||
locks.push_back(engine.commandStreamReceiver->obtainUniqueOwnership());
|
||||
engine.commandStreamReceiver->stopDirectSubmission(false, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user