Dont close shared handle on imported allocations

Related-To: LOCI-2272

Signed-off-by: Jaime Arteaga <jaime.a.arteaga.molina@intel.com>
This commit is contained in:
Jaime Arteaga
2022-03-02 03:43:59 +00:00
committed by Compute-Runtime-Automation
parent 7ec8d8ef91
commit a010fb3634
19 changed files with 94 additions and 4 deletions

View File

@@ -78,6 +78,13 @@ DrmAllocation *TestedDrmMemoryManager::allocate32BitGraphicsMemory(uint32_t root
bool useLocalMemory = !allocationData.flags.useSystemMemory && this->localMemorySupported[rootDeviceIndex];
return allocate32BitGraphicsMemoryImpl(allocationData, useLocalMemory);
}
void TestedDrmMemoryManager::closeSharedHandle(GraphicsAllocation *gfxAllocation) {
std::unique_lock<std::mutex> lock(callsToCloseSharedHandleMtx);
DrmMemoryManager::closeSharedHandle(gfxAllocation);
callsToCloseSharedHandle++;
}
TestedDrmMemoryManager::~TestedDrmMemoryManager() {
DrmMemoryManager::commonCleanup();
}

View File

@@ -149,12 +149,15 @@ class TestedDrmMemoryManager : public MemoryManagerCreate<DrmMemoryManager> {
alignedFreeWrapperCalled++;
DrmMemoryManager::alignedFreeWrapper(ptr);
}
void closeSharedHandle(GraphicsAllocation *gfxAllocation) override;
uint32_t alignedFreeWrapperCalled = 0u;
uint32_t callsToCloseSharedHandle = 0;
protected:
std::mutex unreferenceMtx;
std::mutex releaseGpuRangeMtx;
std::mutex alignedFreeWrapperMtx;
std::mutex callsToCloseSharedHandleMtx;
};
struct MockDrmGemCloseWorker : DrmGemCloseWorker {