Assign pat_index to BO during creation

Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
Bartosz Dunajski
2022-04-19 19:24:19 +00:00
committed by Compute-Runtime-Automation
parent 5911515ed0
commit 06fa316a75
31 changed files with 376 additions and 256 deletions

View File

@@ -666,12 +666,16 @@ TEST(AllocatorHelper, givenExpectedSizeToReserveWhenGetSizeToReserveCalledThenEx
}
TEST(DrmMemoryManagerCreate, whenCallCreateMemoryManagerThenDrmMemoryManagerIsCreated) {
DebugManagerStateRestore restorer;
DebugManager.flags.OverridePatIndex.set(0);
MockExecutionEnvironment executionEnvironment(defaultHwInfo.get());
auto drm = new DrmMockSuccess(fakeFd, *executionEnvironment.rootDeviceEnvironments[0]);
drm->setupIoctlHelper(defaultHwInfo->platform.eProductFamily);
executionEnvironment.rootDeviceEnvironments[0]->osInterface = std::make_unique<OSInterface>();
executionEnvironment.rootDeviceEnvironments[0]->osInterface->setDriverModel(std::unique_ptr<DriverModel>(drm));
auto drmMemoryManager = MemoryManager::createMemoryManager(executionEnvironment);
EXPECT_NE(nullptr, drmMemoryManager.get());
executionEnvironment.memoryManager = std::move(drmMemoryManager);
@@ -681,6 +685,7 @@ TEST(DrmMemoryManagerCreate, givenEnableHostPtrValidationSetToZeroWhenCreateDrmM
DebugManagerStateRestore restorer;
DebugManager.flags.EnableHostPtrValidation.set(0);
DebugManager.flags.EnableGemCloseWorker.set(0);
DebugManager.flags.OverridePatIndex.set(0);
VariableBackup<UltHwConfig> backup(&ultHwConfig);
ultHwConfig.forceOsAgnosticMemoryManager = false;
@@ -691,6 +696,7 @@ TEST(DrmMemoryManagerCreate, givenEnableHostPtrValidationSetToZeroWhenCreateDrmM
drm->setupIoctlHelper(defaultHwInfo->platform.eProductFamily);
executionEnvironment.rootDeviceEnvironments[0]->osInterface = std::make_unique<OSInterface>();
executionEnvironment.rootDeviceEnvironments[0]->osInterface->setDriverModel(std::unique_ptr<DriverModel>(drm));
auto drmMemoryManager = MemoryManager::createMemoryManager(executionEnvironment);
EXPECT_NE(nullptr, drmMemoryManager.get());
EXPECT_FALSE(static_cast<DrmMemoryManager *>(drmMemoryManager.get())->isValidateHostMemoryEnabled());