fix: Force Close of IPC handles at memFree

Related-To: LOCI-4455

Signed-off-by: Spruit, Neil R <neil.r.spruit@intel.com>
This commit is contained in:
Spruit, Neil R
2023-05-24 20:06:13 +00:00
committed by Compute-Runtime-Automation
parent e08c1716bf
commit b589e32c4b
8 changed files with 120 additions and 9 deletions

View File

@@ -1058,8 +1058,10 @@ GraphicsAllocation *DrmMemoryManager::createGraphicsAllocationFromSharedHandle(o
}
void DrmMemoryManager::closeInternalHandle(uint64_t &handle, uint32_t handleId, GraphicsAllocation *graphicsAllocation) {
DrmAllocation *drmAllocation = static_cast<DrmAllocation *>(graphicsAllocation);
drmAllocation->clearInternalHandle(handleId);
if (graphicsAllocation) {
DrmAllocation *drmAllocation = static_cast<DrmAllocation *>(graphicsAllocation);
drmAllocation->clearInternalHandle(handleId);
}
[[maybe_unused]] auto status = this->closeFunction(static_cast<int>(handle));
DEBUG_BREAK_IF(status != 0);
}

View File

@@ -610,8 +610,10 @@ void WddmMemoryManager::freeGraphicsMemoryImpl(GraphicsAllocation *gfxAllocation
}
void WddmMemoryManager::closeInternalHandle(uint64_t &handle, uint32_t handleId, GraphicsAllocation *graphicsAllocation) {
WddmAllocation *wddmAllocation = static_cast<WddmAllocation *>(graphicsAllocation);
wddmAllocation->clearInternalHandle(handleId);
if (graphicsAllocation) {
WddmAllocation *wddmAllocation = static_cast<WddmAllocation *>(graphicsAllocation);
wddmAllocation->clearInternalHandle(handleId);
}
[[maybe_unused]] auto status = SysCalls::closeHandle(reinterpret_cast<void *>(reinterpret_cast<uintptr_t *>(handle)));
DEBUG_BREAK_IF(!status);
}