refactor: pass arrayIndex to Wddm::openSharedHandle function

Related-To: NEO-11498
Signed-off-by: Jaroslaw Warchulski <jaroslaw.warchulski@intel.com>
This commit is contained in:
Jaroslaw Warchulski
2024-06-06 16:56:16 +00:00
committed by Compute-Runtime-Automation
parent 89a8623933
commit 0ac1be7669
50 changed files with 279 additions and 232 deletions

View File

@@ -221,13 +221,13 @@ GraphicsAllocation *MockMemoryManager::createGraphicsAllocationFromExistingStora
return allocation;
}
GraphicsAllocation *MockMemoryManager::createGraphicsAllocationFromSharedHandle(osHandle handle, const AllocationProperties &properties, bool requireSpecificBitness, bool isHostIpcAllocation, bool reuseSharedAllocation, void *mapPointer) {
if (handle != invalidSharedHandle) {
auto allocation = OsAgnosticMemoryManager::createGraphicsAllocationFromSharedHandle(handle, properties, requireSpecificBitness, isHostIpcAllocation, reuseSharedAllocation, mapPointer);
this->capturedSharedHandle = handle;
GraphicsAllocation *MockMemoryManager::createGraphicsAllocationFromSharedHandle(const OsHandleData &osHandleData, const AllocationProperties &properties, bool requireSpecificBitness, bool isHostIpcAllocation, bool reuseSharedAllocation, void *mapPointer) {
if (osHandleData.handle != invalidSharedHandle) {
auto allocation = OsAgnosticMemoryManager::createGraphicsAllocationFromSharedHandle(osHandleData, properties, requireSpecificBitness, isHostIpcAllocation, reuseSharedAllocation, mapPointer);
this->capturedSharedHandle = osHandleData.handle;
return allocation;
} else {
this->capturedSharedHandle = handle;
this->capturedSharedHandle = osHandleData.handle;
return nullptr;
}
}

View File

@@ -83,7 +83,7 @@ class MockMemoryManager : public MemoryManagerCreate<OsAgnosticMemoryManager> {
GraphicsAllocation *allocateGraphicsMemoryWithProperties(const AllocationProperties &properties) override;
GraphicsAllocation *allocateGraphicsMemoryWithProperties(const AllocationProperties &properties, const void *ptr) override;
GraphicsAllocation *createGraphicsAllocationFromExistingStorage(AllocationProperties &properties, void *ptr, MultiGraphicsAllocation &multiGraphicsAllocation) override;
GraphicsAllocation *createGraphicsAllocationFromSharedHandle(osHandle handle, const AllocationProperties &properties, bool requireSpecificBitness, bool isHostIpcAllocation, bool reuseSharedAllocation, void *mapPointer) override;
GraphicsAllocation *createGraphicsAllocationFromSharedHandle(const OsHandleData &osHandleData, const AllocationProperties &properties, bool requireSpecificBitness, bool isHostIpcAllocation, bool reuseSharedAllocation, void *mapPointer) override;
GraphicsAllocation *createGraphicsAllocationFromNTHandle(void *handle, uint32_t rootDeviceIndex, AllocationType allocType) override;
void *allocateSystemMemory(size_t size, size_t alignment) override;
@@ -326,7 +326,7 @@ class FailMemoryManager : public MockMemoryManager {
return nullptr;
}
GraphicsAllocation *createGraphicsAllocationFromSharedHandle(osHandle handle, const AllocationProperties &properties, bool requireSpecificBitness, bool isHostIpcAllocation, bool reuseSharedAllocation, void *mapPointer) override {
GraphicsAllocation *createGraphicsAllocationFromSharedHandle(const OsHandleData &osHandleData, const AllocationProperties &properties, bool requireSpecificBitness, bool isHostIpcAllocation, bool reuseSharedAllocation, void *mapPointer) override {
return nullptr;
}
GraphicsAllocation *createGraphicsAllocationFromNTHandle(void *handle, uint32_t rootDeviceIndex, AllocationType allocType) override {

View File

@@ -161,11 +161,11 @@ bool WddmMock::destroyAllocation(WddmAllocation *alloc, OsContextWin *osContext)
return success;
}
bool WddmMock::openSharedHandle(D3DKMT_HANDLE handle, WddmAllocation *alloc) {
bool WddmMock::openSharedHandle(const MemoryManager::ExtendedOsHandleData &osHandleData, WddmAllocation *alloc) {
if (failOpenSharedHandle) {
return false;
} else {
return Wddm::openSharedHandle(handle, alloc);
return Wddm::openSharedHandle(osHandleData, alloc);
}
}

View File

@@ -77,7 +77,7 @@ class WddmMock : public Wddm {
NTSTATUS createAllocation(WddmAllocation *wddmAllocation);
bool createAllocation64k(WddmAllocation *wddmAllocation);
bool destroyAllocation(WddmAllocation *alloc, OsContextWin *osContext);
bool openSharedHandle(D3DKMT_HANDLE handle, WddmAllocation *alloc) override;
bool openSharedHandle(const MemoryManager::ExtendedOsHandleData &osHandleData, WddmAllocation *alloc) override;
bool createContext(OsContextWin &osContext) override;
void applyAdditionalContextFlags(CREATECONTEXT_PVTDATA &privateData, OsContextWin &osContext) override;
bool destroyContext(D3DKMT_HANDLE context) override;