Skip to content

Commit 874ae35

Browse files
committed
Do not set gfx base if using STANDARD heap.
Change-Id: Ic7615f2304d53c824afc3c4d3567e5c7bbe9f9b3 Signed-off-by: Mrozek, Michal <[email protected]>
1 parent 26774a2 commit 874ae35

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

runtime/os_interface/linux/drm_memory_manager.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -433,8 +433,6 @@ GraphicsAllocation *DrmMemoryManager::createGraphicsAllocationFromSharedHandle(o
433433
if (requireSpecificBitness && this->force32bitAllocations) {
434434
drmAllocation->set32BitAllocation(true);
435435
drmAllocation->setGpuBaseAddress(GmmHelper::canonize(getExternalHeapBaseAddress()));
436-
} else {
437-
drmAllocation->setGpuBaseAddress(GmmHelper::canonize(gfxPartition->getHeapBase(HeapIndex::HEAP_STANDARD)));
438436
}
439437

440438
if (properties.imgInfo) {

unit_tests/os_interface/linux/drm_memory_manager_tests.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1713,7 +1713,7 @@ TEST_F(DrmMemoryManagerTest, given32BitAddressingWhenBufferFromSharedHandleIsCre
17131713
EXPECT_FALSE(graphicsAllocation->is32BitAllocation());
17141714
EXPECT_EQ(1, lseekCalledCount);
17151715

1716-
EXPECT_EQ(GmmHelper::canonize(memoryManager->gfxPartition->getHeapBase(HeapIndex::HEAP_STANDARD)), drmAllocation->getGpuBaseAddress());
1716+
EXPECT_EQ(0llu, drmAllocation->getGpuBaseAddress());
17171717

17181718
memoryManager->freeGraphicsMemory(graphicsAllocation);
17191719
}
@@ -1731,7 +1731,7 @@ TEST_F(DrmMemoryManagerTest, givenLimitedRangeAllocatorWhenBufferFromSharedHandl
17311731
EXPECT_FALSE(graphicsAllocation->is32BitAllocation());
17321732
auto drmAllocation = static_cast<DrmAllocation *>(graphicsAllocation);
17331733

1734-
EXPECT_EQ(GmmHelper::canonize(memoryManager->gfxPartition->getHeapBase(HeapIndex::HEAP_STANDARD)), drmAllocation->getGpuBaseAddress());
1734+
EXPECT_EQ(0llu, drmAllocation->getGpuBaseAddress());
17351735
EXPECT_EQ(1, lseekCalledCount);
17361736
memoryManager->freeGraphicsMemory(graphicsAllocation);
17371737
}
@@ -1749,7 +1749,7 @@ TEST_F(DrmMemoryManagerTest, givenNon32BitAddressingWhenBufferFromSharedHandleIs
17491749
auto drmAllocation = static_cast<DrmAllocation *>(graphicsAllocation);
17501750
EXPECT_FALSE(graphicsAllocation->is32BitAllocation());
17511751
EXPECT_EQ(1, lseekCalledCount);
1752-
EXPECT_EQ(GmmHelper::canonize(memoryManager->gfxPartition->getHeapBase(HeapIndex::HEAP_STANDARD)), drmAllocation->getGpuBaseAddress());
1752+
EXPECT_EQ(0llu, drmAllocation->getGpuBaseAddress());
17531753
memoryManager->freeGraphicsMemory(graphicsAllocation);
17541754
}
17551755

0 commit comments

Comments
 (0)