Create resource with given address

Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
Lukasz Jobczyk
2022-02-23 14:06:22 +00:00
committed by Compute-Runtime-Automation
parent 4cdc4ff9c8
commit 0634aa3f1b
8 changed files with 33 additions and 11 deletions

View File

@ -4792,6 +4792,19 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWithoutLocalMemoryAndCpuPtrWhe
memoryManager.freeGraphicsMemory(allocation);
}
TEST_F(DrmMemoryManagerTest, givenNullDefaultAllocWhenCreateGraphicsAllocationFromExistingStorageThenDoNotImportHandle) {
TestedDrmMemoryManager memoryManager(false, false, false, *executionEnvironment);
mock->ioctl_expected.primeFdToHandle = 0;
MockAllocationProperties properties(0u, 1u);
MultiGraphicsAllocation allocation(0u);
auto alloc = memoryManager.createGraphicsAllocationFromExistingStorage(properties, nullptr, allocation);
EXPECT_NE(alloc, nullptr);
memoryManager.freeGraphicsMemory(alloc);
}
TEST(DrmMemoryManagerSimpleTest, givenDrmMemoryManagerWhenAllocateInDevicePoolIsCalledThenNullptrAndStatusRetryIsReturned) {
MockExecutionEnvironment executionEnvironment(defaultHwInfo.get());
executionEnvironment.rootDeviceEnvironments[0]->osInterface = std::make_unique<OSInterface>();