Add support for IPC handles with implicit scaling

When using implicit scaling, device allocations may have
more than one internal allocation created internally. In that case,
a separate dma-buf handle per internal allocation needs to be
exported.

So introduced two driver experimental extensions to export and
import more than one IPC handle:

- zexMemGetIpcHandles
- zexMemOpenIpcHandles

Related-To: LOCI-2919

Signed-off-by: Jaime Arteaga <jaime.a.arteaga.molina@intel.com>
This commit is contained in:
Jaime Arteaga
2022-01-31 23:29:01 +00:00
committed by Compute-Runtime-Automation
parent c0de4fd243
commit 3f26f45c10
38 changed files with 1311 additions and 52 deletions

View File

@@ -62,3 +62,41 @@ class MemoryAllocatorMultiDeviceFixture : public MemoryManagementFixture, public
DebugManagerStateRestore restorer;
bool isOsAgnosticMemoryManager;
};
template <uint32_t numRootDevices, uint32_t numSubDevices>
class MemoryAllocatorMultiDeviceAndMultiTileFixture : public MemoryManagementFixture, public MemoryAllocatorMultiDeviceSystemSpecificFixture, public ::testing::TestWithParam<bool> {
public:
void SetUp() override {
MemoryManagementFixture::SetUp();
isOsAgnosticMemoryManager = GetParam();
DebugManager.flags.CreateMultipleRootDevices.set(numRootDevices);
DebugManager.flags.CreateMultipleRootDevices.set(numSubDevices);
VariableBackup<UltHwConfig> backup(&ultHwConfig);
ultHwConfig.useMockedPrepareDeviceEnvironmentsFunc = false;
ultHwConfig.forceOsAgnosticMemoryManager = isOsAgnosticMemoryManager;
executionEnvironment = new MockExecutionEnvironment(defaultHwInfo.get(), true, numRootDevices);
devices = DeviceFactory::createDevices(*executionEnvironment);
memoryManager = executionEnvironment->memoryManager.get();
if (!isOsAgnosticMemoryManager) {
MemoryAllocatorMultiDeviceSystemSpecificFixture::SetUp(*executionEnvironment);
}
}
void TearDown() override {
if (!isOsAgnosticMemoryManager) {
MemoryAllocatorMultiDeviceSystemSpecificFixture::TearDown(*executionEnvironment);
}
}
uint32_t getNumRootDevices() { return numRootDevices; }
protected:
std::vector<std::unique_ptr<Device>> devices;
ExecutionEnvironment *executionEnvironment = nullptr;
MemoryManager *memoryManager = nullptr;
DebugManagerStateRestore restorer;
bool isOsAgnosticMemoryManager;
};