From 874ae355f76e93c69ea626aad7e86a41756529aa Mon Sep 17 00:00:00 2001 From: "Mrozek, Michal" Date: Fri, 9 Aug 2019 12:36:20 +0200 Subject: [PATCH] Do not set gfx base if using STANDARD heap. Change-Id: Ic7615f2304d53c824afc3c4d3567e5c7bbe9f9b3 Signed-off-by: Mrozek, Michal --- runtime/os_interface/linux/drm_memory_manager.cpp | 2 -- unit_tests/os_interface/linux/drm_memory_manager_tests.cpp | 6 +++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/runtime/os_interface/linux/drm_memory_manager.cpp b/runtime/os_interface/linux/drm_memory_manager.cpp index 49abf6598b1a2..7c6eee2dca16f 100644 --- a/runtime/os_interface/linux/drm_memory_manager.cpp +++ b/runtime/os_interface/linux/drm_memory_manager.cpp @@ -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) { diff --git a/unit_tests/os_interface/linux/drm_memory_manager_tests.cpp b/unit_tests/os_interface/linux/drm_memory_manager_tests.cpp index 45c1d90f78bf0..7e45e64896997 100644 --- a/unit_tests/os_interface/linux/drm_memory_manager_tests.cpp +++ b/unit_tests/os_interface/linux/drm_memory_manager_tests.cpp @@ -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); } @@ -1731,7 +1731,7 @@ TEST_F(DrmMemoryManagerTest, givenLimitedRangeAllocatorWhenBufferFromSharedHandl EXPECT_FALSE(graphicsAllocation->is32BitAllocation()); auto drmAllocation = static_cast(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); } @@ -1749,7 +1749,7 @@ TEST_F(DrmMemoryManagerTest, givenNon32BitAddressingWhenBufferFromSharedHandleIs auto drmAllocation = static_cast(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); }