Revert "Align external host ptr allocation gpu va to 2MB"
This reverts commit d24f403cc4
.
Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
This commit is contained in:
parent
7c408c23b2
commit
ddb7eb07b0
|
@ -214,12 +214,6 @@ uint64_t DrmMemoryManager::acquireGpuRange(size_t &size, uint32_t rootDeviceInde
|
|||
return gmmHelper->canonize(gfxPartition->heapAllocate(heapIndex, size));
|
||||
}
|
||||
|
||||
uint64_t DrmMemoryManager::acquireGpuRangeWithCustomAlignment(size_t &size, uint32_t rootDeviceIndex, HeapIndex heapIndex, size_t alignment) {
|
||||
auto gfxPartition = getGfxPartition(rootDeviceIndex);
|
||||
auto gmmHelper = getGmmHelper(rootDeviceIndex);
|
||||
return gmmHelper->canonize(gfxPartition->heapAllocateWithCustomAlignment(heapIndex, size, alignment));
|
||||
}
|
||||
|
||||
void DrmMemoryManager::releaseGpuRange(void *address, size_t unmapSize, uint32_t rootDeviceIndex) {
|
||||
uint64_t graphicsAddress = static_cast<uint64_t>(reinterpret_cast<uintptr_t>(address));
|
||||
auto gmmHelper = getGmmHelper(rootDeviceIndex);
|
||||
|
@ -499,7 +493,7 @@ GraphicsAllocation *DrmMemoryManager::allocateGraphicsMemoryForNonSvmHostPtr(con
|
|||
auto offsetInPage = ptrDiff(allocationData.hostPtr, alignedPtr);
|
||||
auto rootDeviceIndex = allocationData.rootDeviceIndex;
|
||||
|
||||
auto gpuVirtualAddress = acquireGpuRangeWithCustomAlignment(alignedSize, rootDeviceIndex, HeapIndex::HEAP_STANDARD, MemoryConstants::pageSize2Mb);
|
||||
auto gpuVirtualAddress = acquireGpuRange(alignedSize, rootDeviceIndex, HeapIndex::HEAP_STANDARD);
|
||||
if (!gpuVirtualAddress) {
|
||||
return nullptr;
|
||||
}
|
||||
|
|
|
@ -93,7 +93,6 @@ class DrmMemoryManager : public MemoryManager {
|
|||
BufferObject *allocUserptr(uintptr_t address, size_t size, uint32_t rootDeviceIndex);
|
||||
bool setDomainCpu(GraphicsAllocation &graphicsAllocation, bool writeEnable);
|
||||
uint64_t acquireGpuRange(size_t &size, uint32_t rootDeviceIndex, HeapIndex heapIndex);
|
||||
uint64_t acquireGpuRangeWithCustomAlignment(size_t &size, uint32_t rootDeviceIndex, HeapIndex heapIndex, size_t alignment);
|
||||
MOCKABLE_VIRTUAL void releaseGpuRange(void *address, size_t size, uint32_t rootDeviceIndex);
|
||||
void emitPinningRequest(BufferObject *bo, const AllocationData &allocationData) const;
|
||||
uint32_t getDefaultDrmContextId(uint32_t rootDeviceIndex) const;
|
||||
|
|
|
@ -2807,23 +2807,6 @@ TEST_F(DrmMemoryManagerBasic, givenDrmMemoryManagerWhenAllocateGraphicsMemoryFor
|
|||
memoryManager->freeGraphicsMemory(allocation1);
|
||||
}
|
||||
|
||||
TEST_F(DrmMemoryManagerBasic, givenDrmMemoryManagerWhenAllocateGraphicsMemoryForNonSvmHostPtrThenGpuVaIsAlignedTo2Mb) {
|
||||
AllocationData allocationData;
|
||||
allocationData.rootDeviceIndex = rootDeviceIndex;
|
||||
std::unique_ptr<TestedDrmMemoryManager> memoryManager(new (std::nothrow) TestedDrmMemoryManager(false, false, false, executionEnvironment));
|
||||
|
||||
memoryManager->forceLimitedRangeAllocator(0xFFFFFFFFF);
|
||||
|
||||
allocationData.size = 2 * MemoryConstants::kiloByte;
|
||||
allocationData.hostPtr = reinterpret_cast<const void *>(0x1234);
|
||||
auto allocation = static_cast<DrmAllocation *>(memoryManager->allocateGraphicsMemoryForNonSvmHostPtr(allocationData));
|
||||
|
||||
EXPECT_EQ(static_cast<DrmAllocation *>(allocation)->getBO()->peekAddress(), castToUint64(allocation->getReservedAddressPtr()));
|
||||
EXPECT_TRUE(isAligned<MemoryConstants::pageSize2Mb>(static_cast<DrmAllocation *>(allocation)->getBO()->peekAddress()));
|
||||
|
||||
memoryManager->freeGraphicsMemory(allocation);
|
||||
}
|
||||
|
||||
TEST_F(DrmMemoryManagerBasic, givenDrmMemoryManagerWhenAllocateGraphicsMemoryForNonSvmHostPtrIsCalledButAllocationFailedThenNullPtrReturned) {
|
||||
AllocationData allocationData;
|
||||
allocationData.rootDeviceIndex = rootDeviceIndex;
|
||||
|
|
Loading…
Reference in New Issue