mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-05 09:09:04 +08:00
Add logic to create wddm allocation with many handles
Change-Id: I1eeffddf7108183ad867d2b05d313f0cf6941c01 Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
22c3c10679
commit
6abc3f7d9b
@@ -1621,3 +1621,25 @@ TEST_F(WddmMemoryManagerSimpleTest, whenDestroyingNotLockedAllocationThatNeedsMa
|
||||
memoryManager->freeGraphicsMemory(allocation);
|
||||
EXPECT_EQ(0u, wddm->evictTemporaryResourceResult.called);
|
||||
}
|
||||
TEST_F(WddmMemoryManagerSimpleTest, whenDestroyingAllocationWithPreferredGpuAddressThenReleaseTheAddress) {
|
||||
auto allocation = static_cast<WddmAllocation *>(memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{MemoryConstants::pageSize}));
|
||||
uint64_t gpuAddress = 0x123;
|
||||
allocation->preferredGpuAddress = gpuAddress;
|
||||
memoryManager->freeGraphicsMemory(allocation);
|
||||
EXPECT_EQ(1u, wddm->freeGpuVirtualAddressResult.called);
|
||||
EXPECT_EQ(gpuAddress, wddm->freeGpuVirtualAddressResult.uint64ParamPassed);
|
||||
}
|
||||
|
||||
TEST_F(WddmMemoryManagerSimpleTest, givenAllocationWithPreferredGpuAddressWhenMapCallFailsDuringCreateWddmAllocationThenReleasePreferredAddress) {
|
||||
MockWddmAllocation allocation;
|
||||
allocation.setAllocationType(GraphicsAllocation::AllocationType::KERNEL_ISA);
|
||||
uint64_t gpuAddress = 0x123;
|
||||
allocation.preferredGpuAddress = gpuAddress;
|
||||
|
||||
wddm->callBaseMapGpuVa = false;
|
||||
wddm->mapGpuVaStatus = false;
|
||||
|
||||
memoryManager->createWddmAllocation(&allocation, nullptr);
|
||||
EXPECT_EQ(1u, wddm->freeGpuVirtualAddressResult.called);
|
||||
EXPECT_EQ(gpuAddress, wddm->freeGpuVirtualAddressResult.uint64ParamPassed);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user