mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 14:55:24 +08:00
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:
committed by
Compute-Runtime-Automation
parent
89a8623933
commit
0ac1be7669
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user