Ensure that allocations in 4GB heap have non 0 GPU address to patch.
- That address is used later to deduce that allocation is non null - If we have address 0 it is incorrectly detected as null ptr on the GPU. Change-Id: I45e1bb31f1788528327da35bfdcc13f3fa6beec2
This commit is contained in:
parent
bb7f8d9b88
commit
2ca3e4c4e5
|
@ -349,7 +349,7 @@ bool Wddm::mapGpuVirtualAddressImpl(Gmm *gmm, D3DKMT_HANDLE handle, void *cpuPtr
|
|||
}
|
||||
|
||||
if (allocation32bit) {
|
||||
MapGPUVA.MinimumAddress = gfxPartition.Heap32[3].Base;
|
||||
MapGPUVA.MinimumAddress = gfxPartition.Heap32[3].Base + MemoryConstants::pageSize;
|
||||
MapGPUVA.MaximumAddress = gfxPartition.Heap32[3].Limit;
|
||||
MapGPUVA.BaseAddress = 0;
|
||||
}
|
||||
|
|
|
@ -706,6 +706,14 @@ TEST_F(WddmMemoryManagerTest, Allocate32BitMemoryWithNullptr) {
|
|||
memoryManager->freeGraphicsMemory(gpuAllocation);
|
||||
}
|
||||
|
||||
TEST_F(WddmMemoryManagerTest, given32BitAllocationWhenItIsCreatedThenItHasNonZeroGpuAddressToPatch) {
|
||||
auto *gpuAllocation = memoryManager->allocate32BitGraphicsMemory(3 * MemoryConstants::pageSize, nullptr, AllocationOrigin::EXTERNAL_ALLOCATION);
|
||||
|
||||
ASSERT_NE(nullptr, gpuAllocation);
|
||||
EXPECT_NE(0llu, gpuAllocation->getGpuAddressToPatch());
|
||||
memoryManager->freeGraphicsMemory(gpuAllocation);
|
||||
}
|
||||
|
||||
TEST_F(WddmMemoryManagerTest, Allocate32BitMemoryWithMisalignedHostPtrDoesNotDoTripleAlloc) {
|
||||
size_t misalignedSize = 0x2500;
|
||||
void *misalignedPtr = reinterpret_cast<void *>(0x12500);
|
||||
|
|
Loading…
Reference in New Issue