Change method of access to pinBB vectors

Related-To: NEO-4319

Change-Id: I70695361c368a7769b6dbb7db57597f188226133
Signed-off-by: Andrzej Swierczynski <andrzej.swierczynski@intel.com>
This commit is contained in:
Andrzej Swierczynski
2020-02-24 12:46:03 +01:00
committed by sys_ocldev
parent 357fdc2e65
commit e453d2c04f
4 changed files with 33 additions and 36 deletions

View File

@@ -47,11 +47,11 @@ DrmMemoryManager::DrmMemoryManager(gemCloseWorkerMode mode,
for (uint32_t rootDeviceIndex = 0; rootDeviceIndex < gfxPartitions.size(); ++rootDeviceIndex) {
if (forcePinEnabled || validateHostPtrMemory) {
memoryForPinBBs.push_back(alignedMallocWrapper(MemoryConstants::pageSize, MemoryConstants::pageSize));
DEBUG_BREAK_IF(memoryForPinBBs.at(rootDeviceIndex) == nullptr);
pinBBs.push_back(allocUserptr(reinterpret_cast<uintptr_t>(memoryForPinBBs.at(rootDeviceIndex)), MemoryConstants::pageSize, 0, rootDeviceIndex));
if (!pinBBs.at(rootDeviceIndex)) {
alignedFreeWrapper(memoryForPinBBs.at(rootDeviceIndex));
memoryForPinBBs.at(rootDeviceIndex) = nullptr;
DEBUG_BREAK_IF(memoryForPinBBs[rootDeviceIndex] == nullptr);
pinBBs.push_back(allocUserptr(reinterpret_cast<uintptr_t>(memoryForPinBBs[rootDeviceIndex]), MemoryConstants::pageSize, 0, rootDeviceIndex));
if (!pinBBs[rootDeviceIndex]) {
alignedFreeWrapper(memoryForPinBBs[rootDeviceIndex]);
memoryForPinBBs[rootDeviceIndex] = nullptr;
DEBUG_BREAK_IF(true);
UNRECOVERABLE_IF(validateHostPtrMemory);
}
@@ -67,7 +67,6 @@ DrmMemoryManager::~DrmMemoryManager() {
MemoryManager::alignedFreeWrapper(memoryForPinBB);
}
}
memoryForPinBBs.clear();
}
void DrmMemoryManager::commonCleanup() {