Skip to content

Commit 4a4ad64

Browse files
committed
Revert: Setting the GpuAddress from a fragment in createGraphicsAllocation
Change-Id: Ifd0a26f58b748df5e43e57b4e0be6b94c2051890
1 parent fc8d3d9 commit 4a4ad64

File tree

3 files changed

+0
-48
lines changed

3 files changed

+0
-48
lines changed

runtime/os_interface/windows/wddm_memory_manager.cpp

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -411,22 +411,9 @@ void WddmMemoryManager::cleanOsHandles(OsHandleStorage &handleStorage) {
411411
}
412412
}
413413

414-
void WddmMemoryManager::obtainGpuAddresFromFragments(WddmAllocation *allocation, OsHandleStorage &handleStorage) {
415-
if (this->force32bitAllocations && (handleStorage.fragmentCount > 0)) {
416-
auto gpuPtr = handleStorage.fragmentStorageData[0].osHandleStorage->gpuPtr;
417-
for (uint32_t i = 1; i < handleStorage.fragmentCount; i++) {
418-
if (handleStorage.fragmentStorageData[i].osHandleStorage->gpuPtr < gpuPtr) {
419-
gpuPtr = handleStorage.fragmentStorageData[i].osHandleStorage->gpuPtr;
420-
}
421-
}
422-
allocation->setGpuAddress(gpuPtr);
423-
}
424-
}
425-
426414
GraphicsAllocation *WddmMemoryManager::createGraphicsAllocation(OsHandleStorage &handleStorage, size_t hostPtrSize, const void *hostPtr) {
427415
auto allocation = new WddmAllocation(const_cast<void *>(hostPtr), hostPtrSize, const_cast<void *>(hostPtr), hostPtrSize, nullptr);
428416
allocation->fragmentsStorage = handleStorage;
429-
obtainGpuAddresFromFragments(allocation, handleStorage);
430417
return allocation;
431418
}
432419

runtime/os_interface/windows/wddm_memory_manager.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,6 @@ class WddmMemoryManager : public MemoryManager {
6464
AllocationStatus populateOsHandles(OsHandleStorage &handleStorage) override;
6565
void cleanOsHandles(OsHandleStorage &handleStorage) override;
6666

67-
void obtainGpuAddresFromFragments(WddmAllocation *allocation, OsHandleStorage &handleStorage);
68-
6967
GraphicsAllocation *createGraphicsAllocation(OsHandleStorage &handleStorage, size_t hostPtrSize, const void *hostPtr) override;
7068

7169
static const D3DGPU_VIRTUAL_ADDRESS minimumAddress = static_cast<D3DGPU_VIRTUAL_ADDRESS>(0x0);

unit_tests/os_interface/windows/wddm_memory_manager_tests.cpp

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1573,39 +1573,6 @@ HWTEST_F(BufferWithWddmMemory, GivenPointerAndSizeWhenAskedToCreateGrahicsAlloca
15731573
memoryManager->freeGraphicsMemory(allocation);
15741574
}
15751575

1576-
HWTEST_F(BufferWithWddmMemory, givenFragmentsThatAreNotInOrderWhenGraphicsAllocationIsBeingCreatedThenGraphicsAddressIsPopulatedFromProperFragment) {
1577-
SetUpMm<FamilyType>();
1578-
memoryManager->setForce32bitAllocations(true);
1579-
OsHandleStorage handleStorage;
1580-
D3DGPU_VIRTUAL_ADDRESS lowestAdress = MemoryConstants::pageSize * 1;
1581-
D3DGPU_VIRTUAL_ADDRESS higherAdress = MemoryConstants::pageSize * 2;
1582-
1583-
auto ptr = reinterpret_cast<void *>(wddm->virtualAllocAddress + MemoryConstants::pageSize * 1);
1584-
auto ptr2 = reinterpret_cast<void *>(wddm->virtualAllocAddress + MemoryConstants::pageSize * 2);
1585-
auto size = MemoryConstants::pageSize;
1586-
OsHandle osHandle1;
1587-
OsHandle osHandle2;
1588-
handleStorage.fragmentStorageData[0].cpuPtr = ptr;
1589-
handleStorage.fragmentStorageData[0].fragmentSize = size;
1590-
handleStorage.fragmentStorageData[0].osHandleStorage = &osHandle1;
1591-
handleStorage.fragmentStorageData[0].osHandleStorage->gpuPtr = higherAdress;
1592-
1593-
handleStorage.fragmentStorageData[1].cpuPtr = ptr2;
1594-
handleStorage.fragmentStorageData[1].fragmentSize = size * 2;
1595-
handleStorage.fragmentStorageData[1].osHandleStorage = &osHandle2;
1596-
handleStorage.fragmentStorageData[1].osHandleStorage->gpuPtr = lowestAdress;
1597-
handleStorage.fragmentCount = 2;
1598-
1599-
auto allocation = memoryManager->createGraphicsAllocation(handleStorage, size, ptr);
1600-
1601-
EXPECT_EQ(ptr, allocation->getUnderlyingBuffer());
1602-
EXPECT_EQ(size, allocation->getUnderlyingBufferSize());
1603-
EXPECT_EQ(lowestAdress, allocation->getGpuAddress());
1604-
1605-
allocation->fragmentsStorage.fragmentCount = 0;
1606-
memoryManager->freeGraphicsMemory(allocation);
1607-
}
1608-
16091576
HWTEST_F(WddmMemoryManagerTest2, makeResidentResidencyAllocationsDoesNotMarkAllocationsResidentWhenMakeResidentFails) {
16101577
SetUpMm<FamilyType>();
16111578
WddmAllocation allocation1, allocation2, allocation3, allocation4;

0 commit comments

Comments
 (0)