mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
ULT: Setup max os context count before using it
Change-Id: I6005cc9faed3a5650b03663b528f302940299112 Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:

committed by
sys_ocldev

parent
0105960e13
commit
234d408a40
@ -242,7 +242,7 @@ TEST_F(DrmBufferObjectTest, givenDeleterWhenBufferObjectIsCreatedAndDeletedThenC
|
||||
TEST(DrmBufferObject, givenPerContextVmRequiredWhenBoCreatedThenBindInfoIsInitializedToOsContextCount) {
|
||||
auto device = std::unique_ptr<MockDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
|
||||
device->getRootDeviceEnvironment().executionEnvironment.setPerContextMemorySpace();
|
||||
|
||||
device->getExecutionEnvironment()->calculateMaxOsContextCount();
|
||||
DrmMock drm(*(device->getExecutionEnvironment()->rootDeviceEnvironments[0].get()));
|
||||
EXPECT_TRUE(drm.isPerContextVMRequired());
|
||||
MockBufferObject bo(&drm);
|
||||
@ -262,6 +262,7 @@ TEST(DrmBufferObject, givenPerContextVmRequiredWhenBoBoundAndUnboundThenCorrectB
|
||||
executionEnvironment->setPerContextMemorySpace();
|
||||
executionEnvironment->prepareRootDeviceEnvironments(1);
|
||||
executionEnvironment->rootDeviceEnvironments[0]->setHwInfo(defaultHwInfo.get());
|
||||
executionEnvironment->calculateMaxOsContextCount();
|
||||
executionEnvironment->rootDeviceEnvironments[0]->osInterface = std::make_unique<OSInterface>();
|
||||
executionEnvironment->rootDeviceEnvironments[0]->memoryOperationsInterface = DrmMemoryOperationsHandler::create();
|
||||
|
||||
@ -285,4 +286,4 @@ TEST(DrmBufferObject, givenPerContextVmRequiredWhenBoBoundAndUnboundThenCorrectB
|
||||
|
||||
bo.unbind(osContext, 0);
|
||||
EXPECT_FALSE(bo.bindInfo[contextId][0]);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user