Move PageTableManager to RootDeviceEnvironment

Related-To: NEO-2285
Change-Id: I77699b5f540b6ac5b73cf1830712a5591326b766
Signed-off-by: Andrzej Swierczynski <andrzej.swierczynski@intel.com>
This commit is contained in:
Andrzej Swierczynski
2019-11-06 18:14:30 +01:00
committed by sys_ocldev
parent 8f5e9c8a3a
commit cc46cdf46c
66 changed files with 543 additions and 237 deletions

View File

@@ -7,9 +7,11 @@
#include "core/command_stream/preemption.h"
#include "core/helpers/cache_policy.h"
#include "core/memory_manager/graphics_allocation.h"
#include "core/memory_manager/memory_constants.h"
#include "core/unit_tests/helpers/debug_manager_state_restore.h"
#include "runtime/event/event.h"
#include "runtime/gmm_helper/page_table_mngr.h"
#include "runtime/helpers/dispatch_info.h"
#include "runtime/helpers/hardware_commands_helper.h"
#include "runtime/mem_obj/image.h"
@@ -2017,3 +2019,19 @@ HWTEST_F(MemoryAllocatorTest, givenMemoryManagerWhenHostPtrTrackingEnabledThenNo
result = memoryManager->useNonSvmHostPtrAlloc(GraphicsAllocation::AllocationType::MAP_ALLOCATION);
EXPECT_EQ(!executionEnvironment->isFullRangeSvm(), result);
}
using PageTableManagerTest = ::testing::Test;
HWTEST_F(PageTableManagerTest, givenMemoryManagerThatSupportsPageTableManagerWhenMapAuxGpuVAIsCalledThenItReturnsTrue) {
ExecutionEnvironment *executionEnvironment = platformImpl->peekExecutionEnvironment();
executionEnvironment->prepareRootDeviceEnvironments(2);
auto memoryManager = new MockMemoryManager(false, false, *executionEnvironment);
executionEnvironment->memoryManager.reset(memoryManager);
MockGraphicsAllocation allocation(1u, GraphicsAllocation::AllocationType::UNKNOWN, nullptr, 0, 0, 0, MemoryPool::MemoryNull);
MockGmm gmm;
allocation.setDefaultGmm(&gmm);
bool mapped = memoryManager->mapAuxGpuVA(&allocation);
auto hwInfo = executionEnvironment->getHardwareInfo();
EXPECT_EQ(HwHelper::get(hwInfo->platform.eRenderCoreFamily).isPageTableManagerSupported(*hwInfo), mapped);
}