Skip to content

Commit

Permalink
Do not set gfx base if using STANDARD heap.
Browse files Browse the repository at this point in the history
Change-Id: Ic7615f2304d53c824afc3c4d3567e5c7bbe9f9b3
Signed-off-by: Mrozek, Michal <[email protected]>
  • Loading branch information
MichalMrozek committed Aug 9, 2019
1 parent 26774a2 commit 874ae35
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 0 additions & 2 deletions runtime/os_interface/linux/drm_memory_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -433,8 +433,6 @@ GraphicsAllocation *DrmMemoryManager::createGraphicsAllocationFromSharedHandle(o
if (requireSpecificBitness && this->force32bitAllocations) {
drmAllocation->set32BitAllocation(true);
drmAllocation->setGpuBaseAddress(GmmHelper::canonize(getExternalHeapBaseAddress()));
} else {
drmAllocation->setGpuBaseAddress(GmmHelper::canonize(gfxPartition->getHeapBase(HeapIndex::HEAP_STANDARD)));
}

if (properties.imgInfo) {
Expand Down
6 changes: 3 additions & 3 deletions unit_tests/os_interface/linux/drm_memory_manager_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1713,7 +1713,7 @@ TEST_F(DrmMemoryManagerTest, given32BitAddressingWhenBufferFromSharedHandleIsCre
EXPECT_FALSE(graphicsAllocation->is32BitAllocation());
EXPECT_EQ(1, lseekCalledCount);

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

memoryManager->freeGraphicsMemory(graphicsAllocation);
}
Expand All @@ -1731,7 +1731,7 @@ TEST_F(DrmMemoryManagerTest, givenLimitedRangeAllocatorWhenBufferFromSharedHandl
EXPECT_FALSE(graphicsAllocation->is32BitAllocation());
auto drmAllocation = static_cast<DrmAllocation *>(graphicsAllocation);

EXPECT_EQ(GmmHelper::canonize(memoryManager->gfxPartition->getHeapBase(HeapIndex::HEAP_STANDARD)), drmAllocation->getGpuBaseAddress());
EXPECT_EQ(0llu, drmAllocation->getGpuBaseAddress());
EXPECT_EQ(1, lseekCalledCount);
memoryManager->freeGraphicsMemory(graphicsAllocation);
}
Expand All @@ -1749,7 +1749,7 @@ TEST_F(DrmMemoryManagerTest, givenNon32BitAddressingWhenBufferFromSharedHandleIs
auto drmAllocation = static_cast<DrmAllocation *>(graphicsAllocation);
EXPECT_FALSE(graphicsAllocation->is32BitAllocation());
EXPECT_EQ(1, lseekCalledCount);
EXPECT_EQ(GmmHelper::canonize(memoryManager->gfxPartition->getHeapBase(HeapIndex::HEAP_STANDARD)), drmAllocation->getGpuBaseAddress());
EXPECT_EQ(0llu, drmAllocation->getGpuBaseAddress());
memoryManager->freeGraphicsMemory(graphicsAllocation);
}

Expand Down

0 comments on commit 874ae35

Please sign in to comment.