mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-04 15:53:45 +08:00
Set root device index in OsContext
- correclty choose default engine context accounting for root device index and subdevices bitfield Related-To: NEO-7516 Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
4882f51721
commit
f19abda0e2
@@ -639,7 +639,7 @@ HWTEST_F(CommandStreamReceiverTest, givenDebugVariableEnabledWhenCreatingCsrThen
|
||||
HWTEST_F(CommandStreamReceiverTest, whenDirectSubmissionDisabledThenExpectNoFeatureAvailable) {
|
||||
DeviceFactory::prepareDeviceEnvironments(*pDevice->getExecutionEnvironment());
|
||||
CommandStreamReceiverHw<FamilyType> csr(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield());
|
||||
std::unique_ptr<OsContext> osContext(OsContext::create(pDevice->getExecutionEnvironment()->rootDeviceEnvironments[0]->osInterface.get(), 0,
|
||||
std::unique_ptr<OsContext> osContext(OsContext::create(pDevice->getExecutionEnvironment()->rootDeviceEnvironments[0]->osInterface.get(), pDevice->getRootDeviceIndex(), 0,
|
||||
EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_RCS, EngineUsage::Regular},
|
||||
PreemptionMode::ThreadGroup, pDevice->getDeviceBitfield())));
|
||||
osContext->setDefaultContext(true);
|
||||
@@ -750,7 +750,7 @@ HWTEST_F(InitDirectSubmissionTest, givenDirectSubmissionControllerEnabledWhenIni
|
||||
DebugManager.flags.EnableDirectSubmissionController.set(1);
|
||||
|
||||
auto csr = std::make_unique<CommandStreamReceiverHw<FamilyType>>(*device->executionEnvironment, device->getRootDeviceIndex(), device->getDeviceBitfield());
|
||||
std::unique_ptr<OsContext> osContext(OsContext::create(device->getExecutionEnvironment()->rootDeviceEnvironments[0]->osInterface.get(), 0,
|
||||
std::unique_ptr<OsContext> osContext(OsContext::create(device->getExecutionEnvironment()->rootDeviceEnvironments[0]->osInterface.get(), device->getRootDeviceIndex(), 0,
|
||||
EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_RCS, EngineUsage::Regular},
|
||||
PreemptionMode::ThreadGroup, device->getDeviceBitfield())));
|
||||
|
||||
@@ -782,7 +782,7 @@ HWTEST_F(InitDirectSubmissionTest, givenDirectSubmissionControllerDisabledWhenIn
|
||||
DebugManager.flags.EnableDirectSubmissionController.set(0);
|
||||
|
||||
auto csr = std::make_unique<CommandStreamReceiverHw<FamilyType>>(*device->executionEnvironment, device->getRootDeviceIndex(), device->getDeviceBitfield());
|
||||
std::unique_ptr<OsContext> osContext(OsContext::create(device->getExecutionEnvironment()->rootDeviceEnvironments[0]->osInterface.get(), 0,
|
||||
std::unique_ptr<OsContext> osContext(OsContext::create(device->getExecutionEnvironment()->rootDeviceEnvironments[0]->osInterface.get(), device->getRootDeviceIndex(), 0,
|
||||
EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_RCS, EngineUsage::Regular},
|
||||
PreemptionMode::ThreadGroup, device->getDeviceBitfield())));
|
||||
|
||||
@@ -806,7 +806,7 @@ HWTEST_F(InitDirectSubmissionTest, givenSetCsrFlagSetWhenInitDirectSubmissionThe
|
||||
DebugManager.flags.SetCommandStreamReceiver.set(1);
|
||||
|
||||
auto csr = std::make_unique<CommandStreamReceiverHw<FamilyType>>(*device->executionEnvironment, device->getRootDeviceIndex(), device->getDeviceBitfield());
|
||||
std::unique_ptr<OsContext> osContext(OsContext::create(device->getExecutionEnvironment()->rootDeviceEnvironments[0]->osInterface.get(), 0,
|
||||
std::unique_ptr<OsContext> osContext(OsContext::create(device->getExecutionEnvironment()->rootDeviceEnvironments[0]->osInterface.get(), device->getRootDeviceIndex(), 0,
|
||||
EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_RCS, EngineUsage::Regular},
|
||||
PreemptionMode::ThreadGroup, device->getDeviceBitfield())));
|
||||
|
||||
@@ -827,7 +827,7 @@ HWTEST_F(InitDirectSubmissionTest, givenSetCsrFlagSetWhenInitDirectSubmissionThe
|
||||
|
||||
HWTEST_F(InitDirectSubmissionTest, whenDirectSubmissionEnabledOnRcsThenExpectFeatureAvailable) {
|
||||
auto csr = std::make_unique<CommandStreamReceiverHw<FamilyType>>(*device->executionEnvironment, device->getRootDeviceIndex(), device->getDeviceBitfield());
|
||||
std::unique_ptr<OsContext> osContext(OsContext::create(device->getExecutionEnvironment()->rootDeviceEnvironments[0]->osInterface.get(), 0,
|
||||
std::unique_ptr<OsContext> osContext(OsContext::create(device->getExecutionEnvironment()->rootDeviceEnvironments[0]->osInterface.get(), device->getRootDeviceIndex(), 0,
|
||||
EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_RCS, EngineUsage::Regular},
|
||||
PreemptionMode::ThreadGroup, device->getDeviceBitfield())));
|
||||
osContext->ensureContextInitialized();
|
||||
@@ -860,7 +860,7 @@ class CommandStreamReceiverHwDirectSubmissionMock : public CommandStreamReceiver
|
||||
|
||||
HWTEST_F(InitDirectSubmissionTest, whenCallInitDirectSubmissionAgainThenItIsNotReinitialized) {
|
||||
auto csr = std::make_unique<CommandStreamReceiverHwDirectSubmissionMock<FamilyType>>(*device->executionEnvironment, device->getRootDeviceIndex(), device->getDeviceBitfield());
|
||||
std::unique_ptr<OsContext> osContext(OsContext::create(device->getExecutionEnvironment()->rootDeviceEnvironments[0]->osInterface.get(), 0,
|
||||
std::unique_ptr<OsContext> osContext(OsContext::create(device->getExecutionEnvironment()->rootDeviceEnvironments[0]->osInterface.get(), device->getRootDeviceIndex(), 0,
|
||||
EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_RCS, EngineUsage::Regular},
|
||||
PreemptionMode::ThreadGroup, device->getDeviceBitfield())));
|
||||
osContext->ensureContextInitialized();
|
||||
@@ -887,7 +887,7 @@ HWTEST_F(InitDirectSubmissionTest, whenCallInitDirectSubmissionAgainThenItIsNotR
|
||||
|
||||
HWTEST_F(InitDirectSubmissionTest, whenCallInitDirectSubmissionThenObtainLock) {
|
||||
auto csr = std::make_unique<CommandStreamReceiverHwDirectSubmissionMock<FamilyType>>(*device->executionEnvironment, device->getRootDeviceIndex(), device->getDeviceBitfield());
|
||||
std::unique_ptr<OsContext> osContext(OsContext::create(device->getExecutionEnvironment()->rootDeviceEnvironments[0]->osInterface.get(), 0,
|
||||
std::unique_ptr<OsContext> osContext(OsContext::create(device->getExecutionEnvironment()->rootDeviceEnvironments[0]->osInterface.get(), device->getRootDeviceIndex(), 0,
|
||||
EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_RCS, EngineUsage::Regular},
|
||||
PreemptionMode::ThreadGroup, device->getDeviceBitfield())));
|
||||
osContext->ensureContextInitialized();
|
||||
@@ -903,7 +903,7 @@ HWTEST_F(InitDirectSubmissionTest, whenCallInitDirectSubmissionThenObtainLock) {
|
||||
}
|
||||
HWTEST_F(InitDirectSubmissionTest, givenDirectSubmissionEnabledWhenPlatformNotSupportsRcsThenExpectFeatureNotAvailable) {
|
||||
auto csr = std::make_unique<CommandStreamReceiverHw<FamilyType>>(*device->executionEnvironment, device->getRootDeviceIndex(), device->getDeviceBitfield());
|
||||
std::unique_ptr<OsContext> osContext(OsContext::create(device->getExecutionEnvironment()->rootDeviceEnvironments[0]->osInterface.get(), 0,
|
||||
std::unique_ptr<OsContext> osContext(OsContext::create(device->getExecutionEnvironment()->rootDeviceEnvironments[0]->osInterface.get(), device->getRootDeviceIndex(), 0,
|
||||
EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_RCS, EngineUsage::Regular},
|
||||
PreemptionMode::ThreadGroup, device->getDeviceBitfield())));
|
||||
osContext->ensureContextInitialized();
|
||||
@@ -922,7 +922,7 @@ HWTEST_F(InitDirectSubmissionTest, givenDirectSubmissionEnabledWhenPlatformNotSu
|
||||
|
||||
HWTEST_F(InitDirectSubmissionTest, whenDirectSubmissionEnabledOnBcsThenExpectFeatureAvailable) {
|
||||
auto csr = std::make_unique<CommandStreamReceiverHw<FamilyType>>(*device->executionEnvironment, device->getRootDeviceIndex(), device->getDeviceBitfield());
|
||||
std::unique_ptr<OsContext> osContext(OsContext::create(device->getExecutionEnvironment()->rootDeviceEnvironments[0]->osInterface.get(), 0,
|
||||
std::unique_ptr<OsContext> osContext(OsContext::create(device->getExecutionEnvironment()->rootDeviceEnvironments[0]->osInterface.get(), device->getRootDeviceIndex(), 0,
|
||||
EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_BCS, EngineUsage::Regular},
|
||||
PreemptionMode::ThreadGroup, device->getDeviceBitfield())));
|
||||
osContext->ensureContextInitialized();
|
||||
@@ -943,7 +943,7 @@ HWTEST_F(InitDirectSubmissionTest, whenDirectSubmissionEnabledOnBcsThenExpectFea
|
||||
|
||||
HWTEST_F(InitDirectSubmissionTest, givenDirectSubmissionEnabledWhenPlatformNotSupportsBcsThenExpectFeatureNotAvailable) {
|
||||
auto csr = std::make_unique<CommandStreamReceiverHw<FamilyType>>(*device->executionEnvironment, device->getRootDeviceIndex(), device->getDeviceBitfield());
|
||||
std::unique_ptr<OsContext> osContext(OsContext::create(device->getExecutionEnvironment()->rootDeviceEnvironments[0]->osInterface.get(), 0,
|
||||
std::unique_ptr<OsContext> osContext(OsContext::create(device->getExecutionEnvironment()->rootDeviceEnvironments[0]->osInterface.get(), device->getRootDeviceIndex(), 0,
|
||||
EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_BCS, EngineUsage::Regular},
|
||||
PreemptionMode::ThreadGroup, device->getDeviceBitfield())));
|
||||
osContext->ensureContextInitialized();
|
||||
@@ -964,7 +964,7 @@ HWTEST_F(InitDirectSubmissionTest, givenDirectSubmissionEnabledWhenPlatformNotSu
|
||||
|
||||
HWTEST_F(InitDirectSubmissionTest, givenLowPriorityContextWhenDirectSubmissionDisabledOnLowPriorityThenExpectFeatureNotAvailable) {
|
||||
auto csr = std::make_unique<CommandStreamReceiverHw<FamilyType>>(*device->executionEnvironment, device->getRootDeviceIndex(), device->getDeviceBitfield());
|
||||
std::unique_ptr<OsContext> osContext(OsContext::create(device->getExecutionEnvironment()->rootDeviceEnvironments[0]->osInterface.get(), 0,
|
||||
std::unique_ptr<OsContext> osContext(OsContext::create(device->getExecutionEnvironment()->rootDeviceEnvironments[0]->osInterface.get(), device->getRootDeviceIndex(), 0,
|
||||
EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_RCS, EngineUsage::LowPriority},
|
||||
PreemptionMode::ThreadGroup, device->getDeviceBitfield())));
|
||||
osContext->ensureContextInitialized();
|
||||
@@ -985,7 +985,7 @@ HWTEST_F(InitDirectSubmissionTest, givenLowPriorityContextWhenDirectSubmissionDi
|
||||
|
||||
HWTEST_F(InitDirectSubmissionTest, givenLowPriorityContextWhenDirectSubmissionEnabledOnLowPriorityThenExpectFeatureAvailable) {
|
||||
auto csr = std::make_unique<CommandStreamReceiverHw<FamilyType>>(*device->executionEnvironment, device->getRootDeviceIndex(), device->getDeviceBitfield());
|
||||
std::unique_ptr<OsContext> osContext(OsContext::create(device->getExecutionEnvironment()->rootDeviceEnvironments[0]->osInterface.get(), 0,
|
||||
std::unique_ptr<OsContext> osContext(OsContext::create(device->getExecutionEnvironment()->rootDeviceEnvironments[0]->osInterface.get(), device->getRootDeviceIndex(), 0,
|
||||
EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_RCS, EngineUsage::LowPriority},
|
||||
PreemptionMode::ThreadGroup, device->getDeviceBitfield())));
|
||||
osContext->ensureContextInitialized();
|
||||
@@ -1004,7 +1004,7 @@ HWTEST_F(InitDirectSubmissionTest, givenLowPriorityContextWhenDirectSubmissionEn
|
||||
|
||||
HWTEST_F(InitDirectSubmissionTest, givenInternalContextWhenDirectSubmissionDisabledOnInternalThenExpectFeatureNotAvailable) {
|
||||
auto csr = std::make_unique<CommandStreamReceiverHw<FamilyType>>(*device->executionEnvironment, device->getRootDeviceIndex(), device->getDeviceBitfield());
|
||||
std::unique_ptr<OsContext> osContext(OsContext::create(device->getExecutionEnvironment()->rootDeviceEnvironments[0]->osInterface.get(), 0,
|
||||
std::unique_ptr<OsContext> osContext(OsContext::create(device->getExecutionEnvironment()->rootDeviceEnvironments[0]->osInterface.get(), device->getRootDeviceIndex(), 0,
|
||||
EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_RCS, EngineUsage::Internal}, PreemptionMode::ThreadGroup,
|
||||
device->getDeviceBitfield())));
|
||||
osContext->ensureContextInitialized();
|
||||
@@ -1025,7 +1025,7 @@ HWTEST_F(InitDirectSubmissionTest, givenInternalContextWhenDirectSubmissionDisab
|
||||
|
||||
HWTEST_F(InitDirectSubmissionTest, givenInternalContextWhenDirectSubmissionEnabledOnInternalThenExpectFeatureAvailable) {
|
||||
auto csr = std::make_unique<CommandStreamReceiverHw<FamilyType>>(*device->executionEnvironment, device->getRootDeviceIndex(), device->getDeviceBitfield());
|
||||
std::unique_ptr<OsContext> osContext(OsContext::create(device->getExecutionEnvironment()->rootDeviceEnvironments[0]->osInterface.get(), 0,
|
||||
std::unique_ptr<OsContext> osContext(OsContext::create(device->getExecutionEnvironment()->rootDeviceEnvironments[0]->osInterface.get(), device->getRootDeviceIndex(), 0,
|
||||
EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_RCS, EngineUsage::Internal}, PreemptionMode::ThreadGroup,
|
||||
device->getDeviceBitfield())));
|
||||
osContext->ensureContextInitialized();
|
||||
@@ -1045,7 +1045,7 @@ HWTEST_F(InitDirectSubmissionTest, givenInternalContextWhenDirectSubmissionEnabl
|
||||
|
||||
HWTEST_F(InitDirectSubmissionTest, givenRootDeviceContextWhenDirectSubmissionDisabledOnRootDeviceThenExpectFeatureNotAvailable) {
|
||||
auto csr = std::make_unique<CommandStreamReceiverHw<FamilyType>>(*device->executionEnvironment, device->getRootDeviceIndex(), device->getDeviceBitfield());
|
||||
std::unique_ptr<OsContext> osContext(OsContext::create(device->getExecutionEnvironment()->rootDeviceEnvironments[0]->osInterface.get(), 0,
|
||||
std::unique_ptr<OsContext> osContext(OsContext::create(device->getExecutionEnvironment()->rootDeviceEnvironments[0]->osInterface.get(), device->getRootDeviceIndex(), 0,
|
||||
EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_RCS, EngineUsage::Internal}, PreemptionMode::ThreadGroup,
|
||||
device->getDeviceBitfield(), true)));
|
||||
osContext->ensureContextInitialized();
|
||||
@@ -1066,7 +1066,7 @@ HWTEST_F(InitDirectSubmissionTest, givenRootDeviceContextWhenDirectSubmissionDis
|
||||
|
||||
HWTEST_F(InitDirectSubmissionTest, givenRootDeviceContextWhenDirectSubmissionEnabledOnRootDeviceThenExpectFeatureAvailable) {
|
||||
auto csr = std::make_unique<CommandStreamReceiverHw<FamilyType>>(*device->executionEnvironment, device->getRootDeviceIndex(), device->getDeviceBitfield());
|
||||
std::unique_ptr<OsContext> osContext(OsContext::create(device->getExecutionEnvironment()->rootDeviceEnvironments[0]->osInterface.get(), 0,
|
||||
std::unique_ptr<OsContext> osContext(OsContext::create(device->getExecutionEnvironment()->rootDeviceEnvironments[0]->osInterface.get(), device->getRootDeviceIndex(), 0,
|
||||
EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_RCS, EngineUsage::Internal}, PreemptionMode::ThreadGroup,
|
||||
device->getDeviceBitfield(), true)));
|
||||
osContext->ensureContextInitialized();
|
||||
@@ -1086,7 +1086,7 @@ HWTEST_F(InitDirectSubmissionTest, givenRootDeviceContextWhenDirectSubmissionEna
|
||||
|
||||
HWTEST_F(InitDirectSubmissionTest, givenNonDefaultContextWhenDirectSubmissionDisabledOnNonDefaultThenExpectFeatureNotAvailable) {
|
||||
auto csr = std::make_unique<CommandStreamReceiverHw<FamilyType>>(*device->executionEnvironment, device->getRootDeviceIndex(), device->getDeviceBitfield());
|
||||
std::unique_ptr<OsContext> osContext(OsContext::create(device->getExecutionEnvironment()->rootDeviceEnvironments[0]->osInterface.get(), 0,
|
||||
std::unique_ptr<OsContext> osContext(OsContext::create(device->getExecutionEnvironment()->rootDeviceEnvironments[0]->osInterface.get(), device->getRootDeviceIndex(), 0,
|
||||
EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_RCS, EngineUsage::Internal}, PreemptionMode::ThreadGroup,
|
||||
device->getDeviceBitfield())));
|
||||
osContext->ensureContextInitialized();
|
||||
@@ -1107,7 +1107,7 @@ HWTEST_F(InitDirectSubmissionTest, givenNonDefaultContextWhenDirectSubmissionDis
|
||||
|
||||
HWTEST_F(InitDirectSubmissionTest, givenNonDefaultContextContextWhenDirectSubmissionEnabledOnNonDefaultContextThenExpectFeatureAvailable) {
|
||||
auto csr = std::make_unique<CommandStreamReceiverHw<FamilyType>>(*device->executionEnvironment, device->getRootDeviceIndex(), device->getDeviceBitfield());
|
||||
std::unique_ptr<OsContext> osContext(OsContext::create(device->getExecutionEnvironment()->rootDeviceEnvironments[0]->osInterface.get(), 0,
|
||||
std::unique_ptr<OsContext> osContext(OsContext::create(device->getExecutionEnvironment()->rootDeviceEnvironments[0]->osInterface.get(), device->getRootDeviceIndex(), 0,
|
||||
EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_RCS, EngineUsage::Regular}, PreemptionMode::ThreadGroup,
|
||||
device->getDeviceBitfield())));
|
||||
osContext->ensureContextInitialized();
|
||||
@@ -1132,7 +1132,7 @@ HWTEST_F(InitDirectSubmissionTest, GivenBlitterOverrideEnabledWhenBlitterIsNonDe
|
||||
DebugManager.flags.DirectSubmissionInsertExtraMiMemFenceCommands.set(0);
|
||||
|
||||
auto csr = std::make_unique<CommandStreamReceiverHw<FamilyType>>(*device->executionEnvironment, device->getRootDeviceIndex(), device->getDeviceBitfield());
|
||||
std::unique_ptr<OsContext> osContext(OsContext::create(device->getExecutionEnvironment()->rootDeviceEnvironments[0]->osInterface.get(), 0,
|
||||
std::unique_ptr<OsContext> osContext(OsContext::create(device->getExecutionEnvironment()->rootDeviceEnvironments[0]->osInterface.get(), device->getRootDeviceIndex(), 0,
|
||||
EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_BCS, EngineUsage::Internal}, PreemptionMode::ThreadGroup,
|
||||
device->getDeviceBitfield())));
|
||||
osContext->ensureContextInitialized();
|
||||
@@ -1406,7 +1406,7 @@ TEST(CommandStreamReceiverSimpleTest, givenPrintfTagAllocationAddressFlagEnabled
|
||||
DebugManagerStateRestore restore;
|
||||
DebugManager.flags.PrintTagAllocationAddress.set(true);
|
||||
DeviceBitfield deviceBitfield(1);
|
||||
auto osContext = std::unique_ptr<OsContext>(OsContext::create(nullptr, 0,
|
||||
auto osContext = std::unique_ptr<OsContext>(OsContext::create(nullptr, 0, 0,
|
||||
EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_BCS, EngineUsage::Regular})));
|
||||
|
||||
MockExecutionEnvironment executionEnvironment;
|
||||
@@ -1483,7 +1483,7 @@ TEST(CommandStreamReceiverSimpleTest, givenMultipleActivePartitionsWhenWaitingFo
|
||||
executionEnvironment.initializeMemoryManager();
|
||||
DeviceBitfield deviceBitfield(0b11);
|
||||
MockCommandStreamReceiver csr(executionEnvironment, 0, deviceBitfield);
|
||||
auto osContext = std::unique_ptr<OsContext>(OsContext::create(nullptr, 0,
|
||||
auto osContext = std::unique_ptr<OsContext>(OsContext::create(nullptr, 0, 0,
|
||||
EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_BCS, EngineUsage::Regular})));
|
||||
csr.setupContext(*osContext);
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ TEST(DirectSubmissionControllerTests, givenDirectSubmissionControllerWhenRegiste
|
||||
|
||||
DeviceBitfield deviceBitfield(1);
|
||||
MockCommandStreamReceiver csr(executionEnvironment, 0, deviceBitfield);
|
||||
std::unique_ptr<OsContext> osContext(OsContext::create(nullptr, 0,
|
||||
std::unique_ptr<OsContext> osContext(OsContext::create(nullptr, 0, 0,
|
||||
EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_CCS, EngineUsage::Regular},
|
||||
PreemptionMode::ThreadGroup, deviceBitfield)));
|
||||
csr.setupContext(*osContext.get());
|
||||
@@ -83,7 +83,7 @@ TEST(DirectSubmissionControllerTests, givenDirectSubmissionControllerWhenTimeout
|
||||
|
||||
DeviceBitfield deviceBitfield(1);
|
||||
MockCommandStreamReceiver csr(executionEnvironment, 0, deviceBitfield);
|
||||
std::unique_ptr<OsContext> osContext(OsContext::create(nullptr, 0,
|
||||
std::unique_ptr<OsContext> osContext(OsContext::create(nullptr, 0, 0,
|
||||
EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_CCS, EngineUsage::Regular},
|
||||
PreemptionMode::ThreadGroup, deviceBitfield)));
|
||||
csr.setupContext(*osContext.get());
|
||||
@@ -140,31 +140,31 @@ TEST(DirectSubmissionControllerTests, givenDirectSubmissionControllerWhenRegiste
|
||||
DeviceBitfield deviceBitfield(1);
|
||||
|
||||
MockCommandStreamReceiver csr(executionEnvironment, 0, deviceBitfield);
|
||||
std::unique_ptr<OsContext> osContext(OsContext::create(nullptr, 0,
|
||||
std::unique_ptr<OsContext> osContext(OsContext::create(nullptr, 0, 0,
|
||||
EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_CCS, EngineUsage::Regular},
|
||||
PreemptionMode::ThreadGroup, deviceBitfield)));
|
||||
csr.setupContext(*osContext.get());
|
||||
|
||||
MockCommandStreamReceiver csr1(executionEnvironment, 0, deviceBitfield);
|
||||
std::unique_ptr<OsContext> osContext1(OsContext::create(nullptr, 0,
|
||||
std::unique_ptr<OsContext> osContext1(OsContext::create(nullptr, 0, 0,
|
||||
EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_CCS, EngineUsage::Regular},
|
||||
PreemptionMode::ThreadGroup, deviceBitfield)));
|
||||
csr1.setupContext(*osContext1.get());
|
||||
|
||||
MockCommandStreamReceiver csr2(executionEnvironment, 0, deviceBitfield);
|
||||
std::unique_ptr<OsContext> osContext2(OsContext::create(nullptr, 0,
|
||||
std::unique_ptr<OsContext> osContext2(OsContext::create(nullptr, 0, 0,
|
||||
EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_CCS, EngineUsage::Regular},
|
||||
PreemptionMode::ThreadGroup, deviceBitfield)));
|
||||
csr2.setupContext(*osContext2.get());
|
||||
|
||||
MockCommandStreamReceiver csr3(executionEnvironment, 0, deviceBitfield);
|
||||
std::unique_ptr<OsContext> osContext3(OsContext::create(nullptr, 0,
|
||||
std::unique_ptr<OsContext> osContext3(OsContext::create(nullptr, 0, 0,
|
||||
EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_BCS, EngineUsage::Regular},
|
||||
PreemptionMode::ThreadGroup, deviceBitfield)));
|
||||
csr3.setupContext(*osContext3.get());
|
||||
|
||||
MockCommandStreamReceiver csr4(executionEnvironment, 0, deviceBitfield);
|
||||
std::unique_ptr<OsContext> osContext4(OsContext::create(nullptr, 0,
|
||||
std::unique_ptr<OsContext> osContext4(OsContext::create(nullptr, 0, 0,
|
||||
EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_BCS, EngineUsage::Regular},
|
||||
PreemptionMode::ThreadGroup, deviceBitfield)));
|
||||
csr4.setupContext(*osContext4.get());
|
||||
@@ -208,67 +208,67 @@ TEST(DirectSubmissionControllerTests, givenDirectSubmissionControllerWhenRegiste
|
||||
DeviceBitfield deviceBitfield1(0b10);
|
||||
|
||||
MockCommandStreamReceiver csr(executionEnvironment, 0, deviceBitfield);
|
||||
std::unique_ptr<OsContext> osContext(OsContext::create(nullptr, 0,
|
||||
std::unique_ptr<OsContext> osContext(OsContext::create(nullptr, 0, 0,
|
||||
EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_CCS, EngineUsage::Regular},
|
||||
PreemptionMode::ThreadGroup, deviceBitfield)));
|
||||
csr.setupContext(*osContext.get());
|
||||
|
||||
MockCommandStreamReceiver csr1(executionEnvironment, 0, deviceBitfield);
|
||||
std::unique_ptr<OsContext> osContext1(OsContext::create(nullptr, 0,
|
||||
std::unique_ptr<OsContext> osContext1(OsContext::create(nullptr, 0, 0,
|
||||
EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_CCS, EngineUsage::Regular},
|
||||
PreemptionMode::ThreadGroup, deviceBitfield)));
|
||||
csr1.setupContext(*osContext1.get());
|
||||
|
||||
MockCommandStreamReceiver csr2(executionEnvironment, 0, deviceBitfield);
|
||||
std::unique_ptr<OsContext> osContext2(OsContext::create(nullptr, 0,
|
||||
std::unique_ptr<OsContext> osContext2(OsContext::create(nullptr, 0, 0,
|
||||
EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_CCS, EngineUsage::Regular},
|
||||
PreemptionMode::ThreadGroup, deviceBitfield)));
|
||||
csr2.setupContext(*osContext2.get());
|
||||
|
||||
MockCommandStreamReceiver csr3(executionEnvironment, 0, deviceBitfield);
|
||||
std::unique_ptr<OsContext> osContext3(OsContext::create(nullptr, 0,
|
||||
std::unique_ptr<OsContext> osContext3(OsContext::create(nullptr, 0, 0,
|
||||
EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_BCS, EngineUsage::Regular},
|
||||
PreemptionMode::ThreadGroup, deviceBitfield)));
|
||||
csr3.setupContext(*osContext3.get());
|
||||
|
||||
MockCommandStreamReceiver csr4(executionEnvironment, 0, deviceBitfield);
|
||||
std::unique_ptr<OsContext> osContext4(OsContext::create(nullptr, 0,
|
||||
std::unique_ptr<OsContext> osContext4(OsContext::create(nullptr, 0, 0,
|
||||
EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_BCS, EngineUsage::Regular},
|
||||
PreemptionMode::ThreadGroup, deviceBitfield)));
|
||||
csr4.setupContext(*osContext4.get());
|
||||
|
||||
MockCommandStreamReceiver csr5(executionEnvironment, 0, deviceBitfield);
|
||||
std::unique_ptr<OsContext> osContext5(OsContext::create(nullptr, 0,
|
||||
std::unique_ptr<OsContext> osContext5(OsContext::create(nullptr, 0, 0,
|
||||
EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_CCS, EngineUsage::Regular},
|
||||
PreemptionMode::ThreadGroup, deviceBitfield1)));
|
||||
csr5.setupContext(*osContext5.get());
|
||||
|
||||
MockCommandStreamReceiver csr6(executionEnvironment, 0, deviceBitfield);
|
||||
std::unique_ptr<OsContext> osContext6(OsContext::create(nullptr, 0,
|
||||
std::unique_ptr<OsContext> osContext6(OsContext::create(nullptr, 0, 0,
|
||||
EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_CCS, EngineUsage::Regular},
|
||||
PreemptionMode::ThreadGroup, deviceBitfield1)));
|
||||
csr6.setupContext(*osContext6.get());
|
||||
|
||||
MockCommandStreamReceiver csr7(executionEnvironment, 0, deviceBitfield);
|
||||
std::unique_ptr<OsContext> osContext7(OsContext::create(nullptr, 0,
|
||||
std::unique_ptr<OsContext> osContext7(OsContext::create(nullptr, 0, 0,
|
||||
EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_CCS, EngineUsage::Regular},
|
||||
PreemptionMode::ThreadGroup, deviceBitfield1)));
|
||||
csr7.setupContext(*osContext7.get());
|
||||
|
||||
MockCommandStreamReceiver csr8(executionEnvironment, 0, deviceBitfield);
|
||||
std::unique_ptr<OsContext> osContext8(OsContext::create(nullptr, 0,
|
||||
std::unique_ptr<OsContext> osContext8(OsContext::create(nullptr, 0, 0,
|
||||
EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_CCS, EngineUsage::Regular},
|
||||
PreemptionMode::ThreadGroup, deviceBitfield1)));
|
||||
csr8.setupContext(*osContext8.get());
|
||||
|
||||
MockCommandStreamReceiver csr9(executionEnvironment, 0, deviceBitfield);
|
||||
std::unique_ptr<OsContext> osContext9(OsContext::create(nullptr, 0,
|
||||
std::unique_ptr<OsContext> osContext9(OsContext::create(nullptr, 0, 0,
|
||||
EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_BCS, EngineUsage::Regular},
|
||||
PreemptionMode::ThreadGroup, deviceBitfield1)));
|
||||
csr9.setupContext(*osContext9.get());
|
||||
|
||||
MockCommandStreamReceiver csr10(executionEnvironment, 0, deviceBitfield);
|
||||
std::unique_ptr<OsContext> osContext10(OsContext::create(nullptr, 0,
|
||||
std::unique_ptr<OsContext> osContext10(OsContext::create(nullptr, 0, 0,
|
||||
EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_BCS, EngineUsage::Regular},
|
||||
PreemptionMode::ThreadGroup, deviceBitfield1)));
|
||||
csr10.setupContext(*osContext10.get());
|
||||
@@ -327,31 +327,31 @@ TEST(DirectSubmissionControllerTests, givenDirectSubmissionControllerDirectSubmi
|
||||
DeviceBitfield deviceBitfield(1);
|
||||
|
||||
MockCommandStreamReceiver csr(executionEnvironment, 0, deviceBitfield);
|
||||
std::unique_ptr<OsContext> osContext(OsContext::create(nullptr, 0,
|
||||
std::unique_ptr<OsContext> osContext(OsContext::create(nullptr, 0, 0,
|
||||
EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_CCS, EngineUsage::Regular},
|
||||
PreemptionMode::ThreadGroup, deviceBitfield)));
|
||||
csr.setupContext(*osContext.get());
|
||||
|
||||
MockCommandStreamReceiver csr1(executionEnvironment, 0, deviceBitfield);
|
||||
std::unique_ptr<OsContext> osContext1(OsContext::create(nullptr, 0,
|
||||
std::unique_ptr<OsContext> osContext1(OsContext::create(nullptr, 0, 0,
|
||||
EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_CCS, EngineUsage::Regular},
|
||||
PreemptionMode::ThreadGroup, deviceBitfield)));
|
||||
csr1.setupContext(*osContext1.get());
|
||||
|
||||
MockCommandStreamReceiver csr2(executionEnvironment, 0, deviceBitfield);
|
||||
std::unique_ptr<OsContext> osContext2(OsContext::create(nullptr, 0,
|
||||
std::unique_ptr<OsContext> osContext2(OsContext::create(nullptr, 0, 0,
|
||||
EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_CCS, EngineUsage::Regular},
|
||||
PreemptionMode::ThreadGroup, deviceBitfield)));
|
||||
csr2.setupContext(*osContext2.get());
|
||||
|
||||
MockCommandStreamReceiver csr3(executionEnvironment, 0, deviceBitfield);
|
||||
std::unique_ptr<OsContext> osContext3(OsContext::create(nullptr, 0,
|
||||
std::unique_ptr<OsContext> osContext3(OsContext::create(nullptr, 0, 0,
|
||||
EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_BCS, EngineUsage::Regular},
|
||||
PreemptionMode::ThreadGroup, deviceBitfield)));
|
||||
csr3.setupContext(*osContext3.get());
|
||||
|
||||
MockCommandStreamReceiver csr4(executionEnvironment, 0, deviceBitfield);
|
||||
std::unique_ptr<OsContext> osContext4(OsContext::create(nullptr, 0,
|
||||
std::unique_ptr<OsContext> osContext4(OsContext::create(nullptr, 0, 0,
|
||||
EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_BCS, EngineUsage::Regular},
|
||||
PreemptionMode::ThreadGroup, deviceBitfield)));
|
||||
csr4.setupContext(*osContext4.get());
|
||||
|
||||
@@ -79,7 +79,7 @@ HWTEST_F(DirectSubmissionTest, givenDirectSubmissionWhenStopThenRingIsNotStarted
|
||||
HWTEST_F(DirectSubmissionTest, givenBlitterDirectSubmissionWhenStopThenRingIsNotStarted) {
|
||||
MockDirectSubmissionHw<FamilyType, BlitterDispatcher<FamilyType>> directSubmission(*pDevice->getDefaultEngine().commandStreamReceiver);
|
||||
auto &csr = pDevice->getUltCommandStreamReceiver<FamilyType>();
|
||||
std::unique_ptr<OsContext> osContext(OsContext::create(pDevice->getExecutionEnvironment()->rootDeviceEnvironments[0]->osInterface.get(), 0,
|
||||
std::unique_ptr<OsContext> osContext(OsContext::create(pDevice->getExecutionEnvironment()->rootDeviceEnvironments[0]->osInterface.get(), pDevice->getRootDeviceIndex(), 0,
|
||||
EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_BCS, EngineUsage::Regular},
|
||||
PreemptionMode::ThreadGroup, pDevice->getDeviceBitfield())));
|
||||
csr.blitterDirectSubmission.reset(&directSubmission);
|
||||
|
||||
@@ -40,7 +40,7 @@ struct DrmDirectSubmissionTest : public DrmMemoryManagerBasic {
|
||||
true,
|
||||
executionEnvironment);
|
||||
device.reset(MockDevice::create<MockDevice>(&executionEnvironment, 0u));
|
||||
osContext = std::make_unique<OsContextLinux>(*executionEnvironment.rootDeviceEnvironments[0]->osInterface->getDriverModel()->as<Drm>(), 0u,
|
||||
osContext = std::make_unique<OsContextLinux>(*executionEnvironment.rootDeviceEnvironments[0]->osInterface->getDriverModel()->as<Drm>(), device->getRootDeviceIndex(), 0u,
|
||||
EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_RCS, EngineUsage::Regular},
|
||||
PreemptionMode::ThreadGroup, device->getDeviceBitfield()));
|
||||
osContext->ensureContextInitialized();
|
||||
@@ -251,7 +251,7 @@ HWTEST_F(DrmDirectSubmissionTest, givenCompletionFenceSupportAndFenceIsNotComple
|
||||
|
||||
{
|
||||
DeviceBitfield firstTileBitfield{0b01};
|
||||
OsContextLinux osContext(*drm, 0u,
|
||||
OsContextLinux osContext(*drm, 0, 0u,
|
||||
EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_RCS, EngineUsage::Regular},
|
||||
PreemptionMode::ThreadGroup, firstTileBitfield));
|
||||
osContext.ensureContextInitialized();
|
||||
@@ -267,7 +267,7 @@ HWTEST_F(DrmDirectSubmissionTest, givenCompletionFenceSupportAndFenceIsNotComple
|
||||
}
|
||||
{
|
||||
DeviceBitfield secondTileBitfield{0b10};
|
||||
OsContextLinux osContext(*drm, 0u,
|
||||
OsContextLinux osContext(*drm, 0, 0u,
|
||||
EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_RCS, EngineUsage::Regular},
|
||||
PreemptionMode::ThreadGroup, secondTileBitfield));
|
||||
osContext.ensureContextInitialized();
|
||||
@@ -284,7 +284,7 @@ HWTEST_F(DrmDirectSubmissionTest, givenCompletionFenceSupportAndFenceIsNotComple
|
||||
|
||||
{
|
||||
DeviceBitfield twoTilesBitfield{0b11};
|
||||
OsContextLinux osContext(*drm, 0u,
|
||||
OsContextLinux osContext(*drm, 0, 0u,
|
||||
EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_RCS, EngineUsage::Regular},
|
||||
PreemptionMode::ThreadGroup, twoTilesBitfield));
|
||||
osContext.ensureContextInitialized();
|
||||
@@ -347,7 +347,7 @@ HWTEST_F(DrmDirectSubmissionTest, givenTile0AndCompletionFenceSupportWhenSubmitt
|
||||
auto completionFenceBaseGpuAddress = commandStreamReceiver.getTagAllocation()->getGpuAddress() + Drm::completionFenceOffset;
|
||||
|
||||
DeviceBitfield firstTileBitfield{0b01};
|
||||
OsContextLinux osContextTile0(*drm, 0u,
|
||||
OsContextLinux osContextTile0(*drm, 0, 0u,
|
||||
EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_RCS, EngineUsage::Regular},
|
||||
PreemptionMode::ThreadGroup, firstTileBitfield));
|
||||
osContextTile0.ensureContextInitialized();
|
||||
@@ -386,7 +386,7 @@ HWTEST_F(DrmDirectSubmissionTest, givenTile1AndCompletionFenceSupportWhenSubmitt
|
||||
auto completionFenceBaseGpuAddress = commandStreamReceiver.getTagAllocation()->getGpuAddress() + Drm::completionFenceOffset;
|
||||
|
||||
DeviceBitfield secondTileBitfield{0b10};
|
||||
OsContextLinux osContextTile1(*drm, 0u,
|
||||
OsContextLinux osContextTile1(*drm, 0, 0u,
|
||||
EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_RCS, EngineUsage::Regular},
|
||||
PreemptionMode::ThreadGroup, secondTileBitfield));
|
||||
osContextTile1.ensureContextInitialized();
|
||||
@@ -425,7 +425,7 @@ HWTEST_F(DrmDirectSubmissionTest, givenTwoTilesAndCompletionFenceSupportWhenSubm
|
||||
auto completionFenceBaseGpuAddress = commandStreamReceiver.getTagAllocation()->getGpuAddress() + Drm::completionFenceOffset;
|
||||
|
||||
DeviceBitfield twoTilesBitfield{0b11};
|
||||
OsContextLinux osContextBothTiles(*drm, 0u,
|
||||
OsContextLinux osContextBothTiles(*drm, 0, 0u,
|
||||
EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_RCS, EngineUsage::Regular},
|
||||
PreemptionMode::ThreadGroup, twoTilesBitfield));
|
||||
osContextBothTiles.ensureContextInitialized();
|
||||
@@ -658,7 +658,7 @@ HWTEST_F(DrmDirectSubmissionTest,
|
||||
device->rootCsrCreated = true;
|
||||
device->numSubDevices = 2;
|
||||
|
||||
osContext = std::make_unique<OsContextLinux>(*executionEnvironment.rootDeviceEnvironments[0]->osInterface->getDriverModel()->as<Drm>(), 0u,
|
||||
osContext = std::make_unique<OsContextLinux>(*executionEnvironment.rootDeviceEnvironments[0]->osInterface->getDriverModel()->as<Drm>(), device->getRootDeviceIndex(), 0u,
|
||||
EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_RCS, EngineUsage::Regular},
|
||||
PreemptionMode::ThreadGroup, device->getDeviceBitfield()));
|
||||
osContext->ensureContextInitialized();
|
||||
@@ -709,7 +709,7 @@ HWTEST_F(DrmDirectSubmissionTest, givenBlitterDispatcherAndMultiTileDeviceWhenCr
|
||||
VariableBackup<bool> backup(&ImplicitScaling::apiSupport, true);
|
||||
device->deviceBitfield.set(0b11);
|
||||
|
||||
osContext = std::make_unique<OsContextLinux>(*executionEnvironment.rootDeviceEnvironments[0]->osInterface->getDriverModel()->as<Drm>(), 0u,
|
||||
osContext = std::make_unique<OsContextLinux>(*executionEnvironment.rootDeviceEnvironments[0]->osInterface->getDriverModel()->as<Drm>(), device->getRootDeviceIndex(), 0u,
|
||||
EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_RCS, EngineUsage::Regular},
|
||||
PreemptionMode::ThreadGroup, device->getDeviceBitfield()));
|
||||
osContext->ensureContextInitialized();
|
||||
|
||||
@@ -425,7 +425,7 @@ TEST(GraphicsAllocationTest, givenGraphicsAllocationWhenAssignedTaskCountEqualZe
|
||||
|
||||
HWTEST_F(GraphicsAllocationTests, givenGraphicsAllocationWhenAssignedTaskCountAbovelZeroThenPrepareForResidencyGetTaskCountWasCalled) {
|
||||
executionEnvironment.initializeMemoryManager();
|
||||
auto osContext = std::unique_ptr<OsContext>(OsContext::create(nullptr, 0, EngineDescriptorHelper::getDefaultDescriptor()));
|
||||
auto osContext = std::unique_ptr<OsContext>(OsContext::create(nullptr, 0, 0, EngineDescriptorHelper::getDefaultDescriptor()));
|
||||
MockCommandStreamReceiver csr(executionEnvironment, 0, 1);
|
||||
csr.osContext = osContext.get();
|
||||
MockGraphicsAllocationTaskCount::getTaskCountCalleedTimes = 0;
|
||||
@@ -438,7 +438,7 @@ HWTEST_F(GraphicsAllocationTests, givenGraphicsAllocationWhenAssignedTaskCountAb
|
||||
|
||||
HWTEST_F(GraphicsAllocationTests, givenGraphicsAllocationAllocTaskCountHigherThanInCsrThenUpdateTaskCountWasNotCalled) {
|
||||
executionEnvironment.initializeMemoryManager();
|
||||
auto osContext = std::unique_ptr<OsContext>(OsContext::create(nullptr, 0, EngineDescriptorHelper::getDefaultDescriptor()));
|
||||
auto osContext = std::unique_ptr<OsContext>(OsContext::create(nullptr, 0, 0, EngineDescriptorHelper::getDefaultDescriptor()));
|
||||
MockCommandStreamReceiver csr(executionEnvironment, 0, 1);
|
||||
csr.osContext = osContext.get();
|
||||
MockGraphicsAllocationTaskCount graphicsAllocation;
|
||||
@@ -452,7 +452,7 @@ HWTEST_F(GraphicsAllocationTests, givenGraphicsAllocationAllocTaskCountHigherTha
|
||||
|
||||
HWTEST_F(GraphicsAllocationTests, givenGraphicsAllocationAllocTaskCountLowerThanInCsrThenUpdateTaskCountWasCalled) {
|
||||
executionEnvironment.initializeMemoryManager();
|
||||
auto osContext = std::unique_ptr<OsContext>(OsContext::create(nullptr, 0, EngineDescriptorHelper::getDefaultDescriptor()));
|
||||
auto osContext = std::unique_ptr<OsContext>(OsContext::create(nullptr, 0, 0, EngineDescriptorHelper::getDefaultDescriptor()));
|
||||
MockCommandStreamReceiver csr(executionEnvironment, 0, 1);
|
||||
csr.osContext = osContext.get();
|
||||
MockGraphicsAllocationTaskCount graphicsAllocation;
|
||||
@@ -466,7 +466,7 @@ HWTEST_F(GraphicsAllocationTests, givenGraphicsAllocationAllocTaskCountLowerThan
|
||||
|
||||
HWTEST_F(GraphicsAllocationTests, givenGraphicsAllocationAllocTaskCountLowerThanInCsrThenAssignmentCountIsDecremented) {
|
||||
executionEnvironment.initializeMemoryManager();
|
||||
auto osContext = std::unique_ptr<OsContext>(OsContext::create(nullptr, 0, EngineDescriptorHelper::getDefaultDescriptor()));
|
||||
auto osContext = std::unique_ptr<OsContext>(OsContext::create(nullptr, 0, 0, EngineDescriptorHelper::getDefaultDescriptor()));
|
||||
MockCommandStreamReceiver csr(executionEnvironment, 0, 1);
|
||||
csr.osContext = osContext.get();
|
||||
MockGraphicsAllocationTaskCount graphicsAllocation;
|
||||
|
||||
@@ -69,6 +69,45 @@ TEST(MemoryManagerTest, givenMemoryManagerWhenGettingDefaultContextThenCorrectCo
|
||||
executionEnvironment.memoryManager->getDefaultEngineContext(0, 2));
|
||||
}
|
||||
|
||||
TEST(MemoryManagerTest, givenMultipleDevicesMemoryManagerWhenGettingDefaultContextThenCorrectContextForDeviceAndSubdeviceBitfieldIsReturned) {
|
||||
MockExecutionEnvironment executionEnvironment(defaultHwInfo.get(), true, 2);
|
||||
auto mockMemoryManager = new MockMemoryManager(false, false, executionEnvironment);
|
||||
executionEnvironment.memoryManager.reset(mockMemoryManager);
|
||||
auto csr0 = std::make_unique<MockCommandStreamReceiver>(executionEnvironment, 0, 1);
|
||||
auto csr1 = std::make_unique<MockCommandStreamReceiver>(executionEnvironment, 0, 1);
|
||||
auto csr2 = std::make_unique<MockCommandStreamReceiver>(executionEnvironment, 0, 3);
|
||||
auto csr3 = std::make_unique<MockCommandStreamReceiver>(executionEnvironment, 1, 1);
|
||||
auto csr4 = std::make_unique<MockCommandStreamReceiver>(executionEnvironment, 1, 3);
|
||||
|
||||
csr0->internalAllocationStorage.reset(new MockInternalAllocationStorage(*csr0));
|
||||
csr1->internalAllocationStorage.reset(new MockInternalAllocationStorage(*csr1));
|
||||
csr2->internalAllocationStorage.reset(new MockInternalAllocationStorage(*csr2));
|
||||
csr3->internalAllocationStorage.reset(new MockInternalAllocationStorage(*csr3));
|
||||
csr4->internalAllocationStorage.reset(new MockInternalAllocationStorage(*csr4));
|
||||
|
||||
auto osContext0 = executionEnvironment.memoryManager->createAndRegisterOsContext(csr0.get(), EngineDescriptorHelper::getDefaultDescriptor({aub_stream::EngineType::ENGINE_RCS, EngineUsage::LowPriority}));
|
||||
auto osContext1 = executionEnvironment.memoryManager->createAndRegisterOsContext(csr1.get(), EngineDescriptorHelper::getDefaultDescriptor({aub_stream::EngineType::ENGINE_RCS, EngineUsage::Regular}));
|
||||
auto osContext2 = executionEnvironment.memoryManager->createAndRegisterOsContext(csr2.get(), EngineDescriptorHelper::getDefaultDescriptor({aub_stream::EngineType::ENGINE_RCS, EngineUsage::Regular}, DeviceBitfield(0x3)));
|
||||
osContext1->setDefaultContext(true);
|
||||
osContext2->setDefaultContext(true);
|
||||
|
||||
auto osContext3 = executionEnvironment.memoryManager->createAndRegisterOsContext(csr3.get(), EngineDescriptorHelper::getDefaultDescriptor({aub_stream::EngineType::ENGINE_RCS, EngineUsage::Regular}));
|
||||
auto osContext4 = executionEnvironment.memoryManager->createAndRegisterOsContext(csr4.get(), EngineDescriptorHelper::getDefaultDescriptor({aub_stream::EngineType::ENGINE_RCS, EngineUsage::Regular}, DeviceBitfield(0x3)));
|
||||
osContext3->setDefaultContext(true);
|
||||
osContext4->setDefaultContext(true);
|
||||
|
||||
EXPECT_NE(nullptr, osContext0);
|
||||
EXPECT_NE(nullptr, osContext1);
|
||||
EXPECT_NE(nullptr, osContext2);
|
||||
EXPECT_NE(nullptr, osContext3);
|
||||
EXPECT_NE(nullptr, osContext4);
|
||||
|
||||
EXPECT_EQ(osContext3, executionEnvironment.memoryManager->getDefaultEngineContext(1, 1));
|
||||
EXPECT_EQ(osContext4, executionEnvironment.memoryManager->getDefaultEngineContext(1, 3));
|
||||
EXPECT_EQ(mockMemoryManager->getRegisteredEngines()[mockMemoryManager->defaultEngineIndex[1]].osContext,
|
||||
executionEnvironment.memoryManager->getDefaultEngineContext(0, 2));
|
||||
}
|
||||
|
||||
TEST(MemoryManagerTest, givenFailureOnRegisterSystemMemoryAllocationWhenAllocatingMemoryThenNullptrIsReturned) {
|
||||
AllocationProperties properties(mockRootDeviceIndex, true, MemoryConstants::cacheLineSize, AllocationType::BUFFER, false, mockDeviceBitfield);
|
||||
MockMemoryManager memoryManager;
|
||||
|
||||
@@ -17,7 +17,7 @@ using namespace NEO;
|
||||
TEST(DrmBindTest, givenBindAlreadyCompleteWhenWaitForBindThenWaitUserFenceIoctlIsNotCalled) {
|
||||
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
|
||||
DrmMock drm{*executionEnvironment->rootDeviceEnvironments[0]};
|
||||
OsContextLinux osContext(drm, 0u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
OsContextLinux osContext(drm, 0, 0u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
osContext.ensureContextInitialized();
|
||||
|
||||
drm.pagingFence[0] = 31u;
|
||||
@@ -38,7 +38,7 @@ TEST(DrmBindTest, givenBindAlreadyCompleteWhenWaitForBindThenWaitUserFenceIoctlI
|
||||
TEST(DrmBindTest, givenBindNotCompleteWhenWaitForBindThenWaitUserFenceIoctlIsCalled) {
|
||||
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
|
||||
DrmMock drm{*executionEnvironment->rootDeviceEnvironments[0]};
|
||||
OsContextLinux osContext(drm, 0u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
OsContextLinux osContext(drm, 0, 0u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
osContext.ensureContextInitialized();
|
||||
|
||||
drm.pagingFence[0] = 26u;
|
||||
|
||||
@@ -201,7 +201,7 @@ TEST(DrmBufferObjectSimpleTest, givenInvalidBoWhenValidateHostptrIsCalledThenErr
|
||||
MockExecutionEnvironment executionEnvironment;
|
||||
std::unique_ptr<DrmMockCustom> mock(new DrmMockCustom(*executionEnvironment.rootDeviceEnvironments[0]));
|
||||
executionEnvironment.rootDeviceEnvironments[0]->memoryOperationsInterface = DrmMemoryOperationsHandler::create(*mock.get(), 0u);
|
||||
OsContextLinux osContext(*mock, 0u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
OsContextLinux osContext(*mock, 0, 0u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
ASSERT_NE(nullptr, mock.get());
|
||||
std::unique_ptr<TestedBufferObject> bo(new TestedBufferObject(mock.get()));
|
||||
ASSERT_NE(nullptr, bo.get());
|
||||
@@ -226,7 +226,7 @@ TEST(DrmBufferObjectSimpleTest, givenInvalidBoWhenPinIsCalledThenErrorIsReturned
|
||||
MockExecutionEnvironment executionEnvironment;
|
||||
std::unique_ptr<DrmMockCustom> mock(new DrmMockCustom(*executionEnvironment.rootDeviceEnvironments[0]));
|
||||
executionEnvironment.rootDeviceEnvironments[0]->memoryOperationsInterface = DrmMemoryOperationsHandler::create(*mock.get(), 0u);
|
||||
OsContextLinux osContext(*mock, 0u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
OsContextLinux osContext(*mock, 0, 0u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
ASSERT_NE(nullptr, mock.get());
|
||||
std::unique_ptr<TestedBufferObject> bo(new TestedBufferObject(mock.get()));
|
||||
ASSERT_NE(nullptr, bo.get());
|
||||
@@ -259,7 +259,7 @@ TEST(DrmBufferObjectSimpleTest, givenArrayOfBosWhenPinnedThenAllBosArePinned) {
|
||||
MockExecutionEnvironment executionEnvironment;
|
||||
std::unique_ptr<DrmMockCustom> mock(new DrmMockCustom(*executionEnvironment.rootDeviceEnvironments[0]));
|
||||
ASSERT_NE(nullptr, mock.get());
|
||||
OsContextLinux osContext(*mock, 0u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
OsContextLinux osContext(*mock, 0, 0u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
|
||||
std::unique_ptr<TestedBufferObject> bo(new TestedBufferObject(mock.get()));
|
||||
ASSERT_NE(nullptr, bo.get());
|
||||
@@ -293,7 +293,7 @@ TEST(DrmBufferObjectSimpleTest, givenArrayOfBosWhenValidatedThenAllBosArePinned)
|
||||
MockExecutionEnvironment executionEnvironment;
|
||||
std::unique_ptr<DrmMockCustom> mock(new DrmMockCustom(*executionEnvironment.rootDeviceEnvironments[0]));
|
||||
ASSERT_NE(nullptr, mock.get());
|
||||
OsContextLinux osContext(*mock, 0u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
OsContextLinux osContext(*mock, 0, 0u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
|
||||
std::unique_ptr<TestedBufferObject> bo(new TestedBufferObject(mock.get()));
|
||||
ASSERT_NE(nullptr, bo.get());
|
||||
@@ -373,7 +373,7 @@ TEST(DrmBufferObject, givenDrmIoctlReturnsErrorNotSupportedThenBufferObjectRetur
|
||||
MockBufferObject bo(drm, 3, 0, 0, osContextCount);
|
||||
|
||||
std::unique_ptr<OsContextLinux> osContext;
|
||||
osContext.reset(new OsContextLinux(*drm, 0u, EngineDescriptorHelper::getDefaultDescriptor()));
|
||||
osContext.reset(new OsContextLinux(*drm, 0, 0u, EngineDescriptorHelper::getDefaultDescriptor()));
|
||||
|
||||
ExecObject execObjectsStorage = {};
|
||||
auto ret = bo.exec(0, 0, 0, false, osContext.get(), 0, 1, nullptr, 0u, &execObjectsStorage, 0, 0);
|
||||
|
||||
@@ -173,7 +173,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamTest, givenDrmContextIdWhenFlushingThenSetIdT
|
||||
|
||||
mock->storedDrmContextId = expectedDrmContextId;
|
||||
|
||||
osContext = std::make_unique<OsContextLinux>(*mock, 1,
|
||||
osContext = std::make_unique<OsContextLinux>(*mock, csr->getRootDeviceIndex(), 1,
|
||||
EngineDescriptorHelper::getDefaultDescriptor(HwHelper::get(defaultHwInfo->platform.eRenderCoreFamily).getGpgpuEngineInstances(*defaultHwInfo)[0],
|
||||
PreemptionHelper::getDefaultPreemptionMode(*defaultHwInfo)));
|
||||
osContext->ensureContextInitialized();
|
||||
@@ -701,7 +701,7 @@ struct DrmCommandStreamBlitterDirectSubmissionTest : public DrmCommandStreamDire
|
||||
DrmCommandStreamDirectSubmissionTest::setUpT<GfxFamily>();
|
||||
executionEnvironment->incRefInternal();
|
||||
|
||||
osContext.reset(OsContext::create(device->getExecutionEnvironment()->rootDeviceEnvironments[0]->osInterface.get(), 0,
|
||||
osContext.reset(OsContext::create(device->getExecutionEnvironment()->rootDeviceEnvironments[0]->osInterface.get(), 0, 0,
|
||||
EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_BCS, EngineUsage::Regular}, PreemptionMode::ThreadGroup, device->getDeviceBitfield())));
|
||||
osContext->ensureContextInitialized();
|
||||
|
||||
|
||||
@@ -294,7 +294,7 @@ class DrmCommandStreamForceTileTest : public ::testing::Test {
|
||||
executionEnvironment.rootDeviceEnvironments[0]->initGmm();
|
||||
|
||||
mock->createVirtualMemoryAddressSpace(HwHelper::getSubDevicesCount(hwInfo));
|
||||
osContext = std::make_unique<OsContextLinux>(*mock, rootDeviceIndex,
|
||||
osContext = std::make_unique<OsContextLinux>(*mock, rootDeviceIndex, 0,
|
||||
EngineDescriptorHelper::getDefaultDescriptor(HwHelper::get(hwInfo->platform.eRenderCoreFamily).getGpgpuEngineInstances(*hwInfo)[0],
|
||||
PreemptionHelper::getDefaultPreemptionMode(*hwInfo), DeviceBitfield(3)));
|
||||
osContext->ensureContextInitialized();
|
||||
@@ -408,7 +408,7 @@ struct DrmImplicitScalingCommandStreamTest : ::testing::Test {
|
||||
executionEnvironment->rootDeviceEnvironments[0]->memoryOperationsInterface = DrmMemoryOperationsHandler::create(*drm, 0u);
|
||||
executionEnvironment->rootDeviceEnvironments[0]->initGmm();
|
||||
|
||||
osContext = std::make_unique<OsContextLinux>(*drm, 0u,
|
||||
osContext = std::make_unique<OsContextLinux>(*drm, 0, 0u,
|
||||
EngineDescriptorHelper::getDefaultDescriptor(HwHelper::get(hwInfo->platform.eRenderCoreFamily).getGpgpuEngineInstances(*hwInfo)[0],
|
||||
PreemptionHelper::getDefaultPreemptionMode(*defaultHwInfo), DeviceBitfield(0b11)));
|
||||
osContext->ensureContextInitialized();
|
||||
@@ -505,7 +505,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, DrmImplicitScalingCommandStreamTest, whenForceExecu
|
||||
uint32_t execCalled = 0;
|
||||
};
|
||||
|
||||
auto osContext = std::make_unique<OsContextLinux>(*drm, 0u,
|
||||
auto osContext = std::make_unique<OsContextLinux>(*drm, 0, 0u,
|
||||
EngineDescriptorHelper::getDefaultDescriptor(HwHelper::get(hwInfo->platform.eRenderCoreFamily).getGpgpuEngineInstances(*hwInfo)[0],
|
||||
PreemptionHelper::getDefaultPreemptionMode(*defaultHwInfo)));
|
||||
osContext->ensureContextInitialized();
|
||||
|
||||
@@ -245,7 +245,7 @@ TEST_F(DrmDebugPrelimTest, givenAddedBindExtHandlesInBoWhenBindingWithinDefaultE
|
||||
bo.addBindExtHandle(4);
|
||||
bo.addBindExtHandle(5);
|
||||
|
||||
OsContextLinux osContext(drm, 0u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
OsContextLinux osContext(drm, 0, 0u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
osContext.ensureContextInitialized();
|
||||
bo.bind(&osContext, 0);
|
||||
|
||||
@@ -265,7 +265,7 @@ TEST_F(DrmDebugPrelimTest, givenAddedBindExtHandlesInBoWhenBindingWithinInternal
|
||||
bo.addBindExtHandle(4);
|
||||
bo.addBindExtHandle(5);
|
||||
|
||||
OsContextLinux osContext(drm, 0u, {{aub_stream::EngineType::ENGINE_RCS, EngineUsage::Internal}, 1 /*deviceBitfield*/, PreemptionMode::Disabled, true /* isRootDevice*/, false /* isEngineInstanced*/});
|
||||
OsContextLinux osContext(drm, 0, 0u, {{aub_stream::EngineType::ENGINE_RCS, EngineUsage::Internal}, 1 /*deviceBitfield*/, PreemptionMode::Disabled, true /* isRootDevice*/, false /* isEngineInstanced*/});
|
||||
osContext.ensureContextInitialized();
|
||||
bo.bind(&osContext, 0);
|
||||
|
||||
@@ -281,7 +281,7 @@ TEST_F(DrmDebugPrelimTest, givenAddedBindExtHandlesInBoWhenBindingWithinCopyEngi
|
||||
|
||||
drm.context.receivedVmBindUuidExt[0].reset();
|
||||
|
||||
OsContextLinux osContext(drm, 0u, {{aub_stream::EngineType::ENGINE_BCS, EngineUsage::Regular}, 1 /*deviceBitfield*/, PreemptionMode::Disabled, true /* isRootDevice*/, false /* isEngineInstanced*/});
|
||||
OsContextLinux osContext(drm, 0, 0u, {{aub_stream::EngineType::ENGINE_BCS, EngineUsage::Regular}, 1 /*deviceBitfield*/, PreemptionMode::Disabled, true /* isRootDevice*/, false /* isEngineInstanced*/});
|
||||
osContext.ensureContextInitialized();
|
||||
bo.bind(&osContext, 0);
|
||||
|
||||
@@ -296,7 +296,7 @@ HWTEST_F(DrmDebugPrelimTest, givenAddedBindExtHandlesInBoWhenUnbindingThenExtens
|
||||
bo.addBindExtHandle(4);
|
||||
bo.addBindExtHandle(5);
|
||||
|
||||
OsContextLinux osContext(drm, 0u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
OsContextLinux osContext(drm, 0, 0u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
osContext.ensureContextInitialized();
|
||||
bo.bind(&osContext, 0);
|
||||
EXPECT_NE(0u, drm.context.receivedVmBind.value().extensions);
|
||||
@@ -323,7 +323,7 @@ TEST(DrmPrelimTest, givenProgramDebuggingAndContextDebugAvailableAndCCSEnginesWh
|
||||
drm->contextDebugSupported = true;
|
||||
executionEnvironment->rootDeviceEnvironments[0]->osInterface->setDriverModel(std::unique_ptr<DriverModel>(drm));
|
||||
|
||||
OsContextLinux osContext(*drm, 5u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
OsContextLinux osContext(*drm, 0, 5u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
osContext.ensureContextInitialized();
|
||||
|
||||
EXPECT_EQ(DrmPrelimHelper::getSIPContextParamDebugFlag() << 32 | DrmPrelimHelper::getSIPContextParamDebugFlag(), drm->context.receivedSetContextParamValue);
|
||||
@@ -345,7 +345,7 @@ TEST(DrmPrelimTest, givenProgramDebuggingAndContextDebugAvailableAndCCSEnginesWh
|
||||
drm->contextDebugSupported = true;
|
||||
executionEnvironment->rootDeviceEnvironments[0]->osInterface->setDriverModel(std::unique_ptr<DriverModel>(drm));
|
||||
|
||||
OsContextLinux osContext(*drm, 5u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
OsContextLinux osContext(*drm, 0, 5u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
osContext.ensureContextInitialized();
|
||||
|
||||
EXPECT_EQ(DrmPrelimHelper::getSIPContextParamDebugFlag() << 32 | DrmPrelimHelper::getSIPContextParamDebugFlag(), drm->context.receivedSetContextParamValue);
|
||||
|
||||
@@ -4206,7 +4206,7 @@ TEST_F(DrmMemoryManagerTest, givenPageFaultIsUnSupportedWhenCallingBindBoOnBuffe
|
||||
DrmMock drm(*executionEnvironment->rootDeviceEnvironments[0]);
|
||||
EXPECT_FALSE(drm.pageFaultSupported);
|
||||
|
||||
OsContextLinux osContext(drm, 0u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
OsContextLinux osContext(drm, 0, 0u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
osContext.ensureContextInitialized();
|
||||
uint32_t vmHandleId = 0;
|
||||
|
||||
@@ -4232,7 +4232,7 @@ TEST_F(DrmMemoryManagerTest, givenPageFaultIsSupportedAndKmdMigrationEnabledForB
|
||||
DrmMock drm(*executionEnvironment->rootDeviceEnvironments[0]);
|
||||
EXPECT_FALSE(drm.pageFaultSupported);
|
||||
|
||||
OsContextLinux osContext(drm, 0u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
OsContextLinux osContext(drm, 0, 0u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
osContext.ensureContextInitialized();
|
||||
uint32_t vmHandleId = 0;
|
||||
|
||||
@@ -4264,7 +4264,7 @@ TEST_F(DrmMemoryManagerTest, givenPageFaultIsSupportedWhenCallingBindBoOnAllocat
|
||||
DrmMock drm(*executionEnvironment->rootDeviceEnvironments[0]);
|
||||
drm.pageFaultSupported = true;
|
||||
|
||||
OsContextLinux osContext(drm, 0u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
OsContextLinux osContext(drm, 0, 0u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
osContext.ensureContextInitialized();
|
||||
uint32_t vmHandleId = 0;
|
||||
|
||||
|
||||
@@ -331,7 +331,7 @@ TEST(DrmBufferObjectTestPrelim, givenBufferObjectSetToColourWithBindWhenBindingT
|
||||
bo.setColourWithBind();
|
||||
bo.setColourChunk(MemoryConstants::pageSize64k);
|
||||
bo.addColouringAddress(0xffeeffee);
|
||||
OsContextLinux osContext(drm, 0u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
OsContextLinux osContext(drm, 0, 0u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
osContext.ensureContextInitialized();
|
||||
|
||||
bo.bind(&osContext, 0);
|
||||
@@ -385,7 +385,7 @@ TEST(DrmBufferObjectTestPrelim, givenBufferObjectMarkedForCaptureWhenBindingThen
|
||||
executionEnvironment->initializeMemoryManager();
|
||||
DrmQueryMock drm{*executionEnvironment->rootDeviceEnvironments[0]};
|
||||
BufferObjectMock bo(&drm, 3, 1, 0, 1);
|
||||
OsContextLinux osContext(drm, 0u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
OsContextLinux osContext(drm, 0, 0u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
osContext.ensureContextInitialized();
|
||||
bo.markForCapture();
|
||||
|
||||
@@ -403,7 +403,7 @@ TEST(DrmBufferObjectTestPrelim, givenNoActiveDirectSubmissionAndForceUseImmediat
|
||||
executionEnvironment->initializeMemoryManager();
|
||||
DrmQueryMock drm{*executionEnvironment->rootDeviceEnvironments[0]};
|
||||
BufferObjectMock bo(&drm, 3, 1, 0, 1);
|
||||
OsContextLinux osContext(drm, 0u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
OsContextLinux osContext(drm, 0, 0u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
osContext.ensureContextInitialized();
|
||||
|
||||
bo.bind(&osContext, 0);
|
||||
@@ -419,7 +419,7 @@ TEST(DrmBufferObjectTestPrelim, whenBindingThenImmediateFlagIsSetAndExtensionLis
|
||||
DrmQueryMock drm{*executionEnvironment->rootDeviceEnvironments[0]};
|
||||
drm.setDirectSubmissionActive(true);
|
||||
BufferObjectMock bo(&drm, 3, 1, 0, 1);
|
||||
OsContextLinux osContext(drm, 0u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
OsContextLinux osContext(drm, 0, 0u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
osContext.ensureContextInitialized();
|
||||
osContext.setDirectSubmissionActive();
|
||||
|
||||
@@ -432,7 +432,7 @@ TEST(DrmBufferObjectTestPrelim, whenBindingThenImmediateFlagIsSetAndExtensionLis
|
||||
TEST(DrmBufferObjectTestPrelim, givenProvidedCtxIdWhenCallingWaitUserFenceThenExpectCtxFlagSetAndNoSoftFlagSet) {
|
||||
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
|
||||
DrmQueryMock drm{*executionEnvironment->rootDeviceEnvironments[0]};
|
||||
OsContextLinux osContext(drm, 0u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
OsContextLinux osContext(drm, 0, 0u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
osContext.ensureContextInitialized();
|
||||
|
||||
uint64_t gpuAddress = 0x1020304000ull;
|
||||
@@ -453,7 +453,7 @@ TEST(DrmBufferObjectTestPrelim, givenProvidedCtxIdWhenCallingWaitUserFenceThenEx
|
||||
TEST(DrmBufferObjectTestPrelim, givenProvidedNoCtxIdWhenCallingWaitUserFenceThenExpectCtxFlagNotSetAndSoftFlagSet) {
|
||||
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
|
||||
DrmQueryMock drm{*executionEnvironment->rootDeviceEnvironments[0]};
|
||||
OsContextLinux osContext(drm, 0u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
OsContextLinux osContext(drm, 0, 0u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
osContext.ensureContextInitialized();
|
||||
|
||||
uint64_t gpuAddress = 0x1020304000ull;
|
||||
|
||||
@@ -613,13 +613,13 @@ HWTEST_F(DrmMemoryOperationsHandlerBindTest, givenVmBindSupportAndMultiSubdevice
|
||||
EXPECT_EQ(0, mock->ioctlCount.execbuffer2);
|
||||
}
|
||||
|
||||
struct DrmMemoryOperationsHandlerBindWithPerContextVms : public DrmMemoryOperationsHandlerBindFixture<1> {
|
||||
struct DrmMemoryOperationsHandlerBindWithPerContextVms : public DrmMemoryOperationsHandlerBindFixture<2> {
|
||||
void SetUp() override {
|
||||
DrmMemoryOperationsHandlerBindFixture<1>::setUp(true);
|
||||
DrmMemoryOperationsHandlerBindFixture<2>::setUp(true);
|
||||
}
|
||||
|
||||
void TearDown() override {
|
||||
DrmMemoryOperationsHandlerBindFixture<1>::TearDown();
|
||||
DrmMemoryOperationsHandlerBindFixture<2>::TearDown();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -700,6 +700,87 @@ HWTEST_F(DrmMemoryOperationsHandlerBindWithPerContextVms, givenVmBindMultipleSub
|
||||
EXPECT_EQ(0, mock->ioctlCount.execbuffer2);
|
||||
}
|
||||
|
||||
HWTEST_F(DrmMemoryOperationsHandlerBindWithPerContextVms, givenVmBindMultipleRootDevicesAndPerContextVmsWhenValidateHostptrThenCorrectContextsVmIdIsUsed) {
|
||||
mock->bindAvailable = true;
|
||||
mock->incrementVmId = true;
|
||||
|
||||
auto device1 = devices[1].get();
|
||||
auto mock1 = executionEnvironment->rootDeviceEnvironments[1]->osInterface->getDriverModel()->as<DrmQueryMock>();
|
||||
mock1->bindAvailable = true;
|
||||
mock1->incrementVmId = true;
|
||||
|
||||
std::unique_ptr<TestedDrmMemoryManager> memoryManager(new (std::nothrow) TestedDrmMemoryManager(true,
|
||||
false,
|
||||
true,
|
||||
*executionEnvironment));
|
||||
|
||||
uint32_t vmIdForDevice0 = 0;
|
||||
uint32_t vmIdForDevice0Subdevice0 = 0;
|
||||
uint32_t vmIdForDevice1 = 0;
|
||||
|
||||
memoryManager->registeredEngines = EngineControlContainer{this->device->allEngines};
|
||||
memoryManager->registeredEngines.insert(memoryManager->registeredEngines.end(), this->device->getSubDevice(0)->getAllEngines().begin(), this->device->getSubDevice(0)->getAllEngines().end());
|
||||
memoryManager->registeredEngines.insert(memoryManager->registeredEngines.end(), device1->getAllEngines().begin(), device1->getAllEngines().end());
|
||||
|
||||
for (auto engine : memoryManager->registeredEngines) {
|
||||
engine.osContext->incRefInternal();
|
||||
if (engine.osContext->isDefaultContext()) {
|
||||
|
||||
if (engine.osContext->getRootDeviceIndex() == 0) {
|
||||
|
||||
if (engine.osContext->getDeviceBitfield().to_ulong() == 3) {
|
||||
auto osContexLinux = static_cast<OsContextLinux *>(engine.osContext);
|
||||
vmIdForDevice0 = osContexLinux->getDrmVmIds()[0];
|
||||
} else if (engine.osContext->getDeviceBitfield().to_ulong() == 1) {
|
||||
auto osContexLinux = static_cast<OsContextLinux *>(engine.osContext);
|
||||
vmIdForDevice0Subdevice0 = osContexLinux->getDrmVmIds()[0];
|
||||
}
|
||||
} else {
|
||||
if (engine.osContext->getDeviceBitfield().to_ulong() == 3) {
|
||||
auto osContexLinux = static_cast<OsContextLinux *>(engine.osContext);
|
||||
vmIdForDevice1 = osContexLinux->getDrmVmIds()[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
EXPECT_NE(0u, vmIdForDevice0);
|
||||
EXPECT_NE(0u, vmIdForDevice0Subdevice0);
|
||||
EXPECT_NE(0u, vmIdForDevice1);
|
||||
|
||||
AllocationData allocationData;
|
||||
allocationData.size = 13u;
|
||||
allocationData.hostPtr = reinterpret_cast<const void *>(0x5001);
|
||||
allocationData.rootDeviceIndex = device1->getRootDeviceIndex();
|
||||
allocationData.storageInfo.subDeviceBitfield = device1->getDeviceBitfield();
|
||||
|
||||
mock->context.vmBindCalled = 0;
|
||||
mock1->context.vmBindCalled = 0;
|
||||
|
||||
auto allocation = memoryManager->allocateGraphicsMemoryForNonSvmHostPtr(allocationData);
|
||||
EXPECT_NE(nullptr, allocation);
|
||||
|
||||
memoryManager->freeGraphicsMemory(allocation);
|
||||
|
||||
EXPECT_EQ(mock->context.vmBindCalled, 0u);
|
||||
EXPECT_EQ(mock1->context.vmBindCalled, 1u);
|
||||
EXPECT_EQ(vmIdForDevice1, mock1->context.receivedVmBind->vmId);
|
||||
|
||||
auto vmBindCalledBefore = mock1->context.vmBindCalled;
|
||||
|
||||
allocationData.storageInfo.subDeviceBitfield = device->getSubDevice(0)->getDeviceBitfield();
|
||||
allocation = memoryManager->allocateGraphicsMemoryForNonSvmHostPtr(allocationData);
|
||||
|
||||
EXPECT_NE(nullptr, allocation);
|
||||
|
||||
memoryManager->freeGraphicsMemory(allocation);
|
||||
|
||||
EXPECT_EQ(vmBindCalledBefore + 1, mock1->context.vmBindCalled);
|
||||
|
||||
EXPECT_FALSE(mock->context.receivedVmBind.has_value());
|
||||
EXPECT_EQ(vmIdForDevice1, mock1->context.receivedVmBind->vmId);
|
||||
}
|
||||
|
||||
HWTEST_F(DrmMemoryOperationsHandlerBindTest, givenDirectSubmissionWhenPinBOThenVmBindIsCalledInsteadOfExec) {
|
||||
DebugManager.flags.UseVmBind.set(1);
|
||||
mock->bindAvailable = true;
|
||||
|
||||
@@ -358,7 +358,7 @@ TEST(DrmTest, givenDrmWhenOsContextIsCreatedThenCreateAndDestroyNewDrmOsContext)
|
||||
executionEnvironment->rootDeviceEnvironments[0]->initGmm();
|
||||
|
||||
{
|
||||
OsContextLinux osContext1(drmMock, 0u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
OsContextLinux osContext1(drmMock, 0, 0u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
osContext1.ensureContextInitialized();
|
||||
|
||||
EXPECT_EQ(1u, osContext1.getDrmContextIds().size());
|
||||
@@ -366,7 +366,7 @@ TEST(DrmTest, givenDrmWhenOsContextIsCreatedThenCreateAndDestroyNewDrmOsContext)
|
||||
EXPECT_EQ(0u, drmMock.receivedDestroyContextId);
|
||||
|
||||
{
|
||||
OsContextLinux osContext2(drmMock, 0u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
OsContextLinux osContext2(drmMock, 0, 0u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
osContext2.ensureContextInitialized();
|
||||
EXPECT_EQ(1u, osContext2.getDrmContextIds().size());
|
||||
EXPECT_EQ(drmMock.storedDrmContextId, osContext2.getDrmContextIds()[0]);
|
||||
@@ -386,7 +386,7 @@ TEST(DrmTest, whenCreatingDrmContextWithVirtualMemoryAddressSpaceThenProperVmIdI
|
||||
|
||||
ASSERT_EQ(1u, drmMock.virtualMemoryIds.size());
|
||||
|
||||
OsContextLinux osContext(drmMock, 0u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
OsContextLinux osContext(drmMock, 0, 0u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
osContext.ensureContextInitialized();
|
||||
|
||||
EXPECT_EQ(2u, drmMock.receivedContextParamRequestCount);
|
||||
@@ -404,7 +404,7 @@ TEST(DrmTest, whenCreatingDrmContextWithNoVirtualMemoryAddressSpaceThenProperCon
|
||||
|
||||
ASSERT_EQ(0u, drmMock.virtualMemoryIds.size());
|
||||
|
||||
OsContextLinux osContext(drmMock, 0u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
OsContextLinux osContext(drmMock, 0, 0u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
osContext.ensureContextInitialized();
|
||||
|
||||
EXPECT_EQ(1u, drmMock.receivedContextParamRequestCount); // unrecoverable context
|
||||
@@ -422,7 +422,7 @@ TEST(DrmTest, givenDrmAndNegativeCheckNonPersistentContextsSupportWhenOsContextI
|
||||
drmMock.storedRetValForPersistant = -1;
|
||||
drmMock.checkNonPersistentContextsSupport();
|
||||
expectedCount += 2;
|
||||
OsContextLinux osContext(drmMock, 0u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
OsContextLinux osContext(drmMock, 0, 0u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
osContext.ensureContextInitialized();
|
||||
EXPECT_EQ(expectedCount, drmMock.receivedContextParamRequestCount);
|
||||
}
|
||||
@@ -430,7 +430,7 @@ TEST(DrmTest, givenDrmAndNegativeCheckNonPersistentContextsSupportWhenOsContextI
|
||||
drmMock.storedRetValForPersistant = 0;
|
||||
drmMock.checkNonPersistentContextsSupport();
|
||||
++expectedCount;
|
||||
OsContextLinux osContext(drmMock, 0u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
OsContextLinux osContext(drmMock, 0, 0u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
osContext.ensureContextInitialized();
|
||||
expectedCount += 3;
|
||||
EXPECT_EQ(expectedCount, drmMock.receivedContextParamRequestCount);
|
||||
@@ -445,20 +445,20 @@ TEST(DrmTest, givenDrmPreemptionEnabledAndLowPriorityEngineWhenCreatingOsContext
|
||||
DrmMock drmMock(*executionEnvironment->rootDeviceEnvironments[0]);
|
||||
drmMock.preemptionSupported = false;
|
||||
|
||||
OsContextLinux osContext1(drmMock, 0u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
OsContextLinux osContext1(drmMock, 0, 0u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
osContext1.ensureContextInitialized();
|
||||
OsContextLinux osContext2(drmMock, 0u, EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_RCS, EngineUsage::LowPriority}));
|
||||
OsContextLinux osContext2(drmMock, 0, 0u, EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_RCS, EngineUsage::LowPriority}));
|
||||
osContext2.ensureContextInitialized();
|
||||
|
||||
EXPECT_EQ(4u, drmMock.receivedContextParamRequestCount);
|
||||
|
||||
drmMock.preemptionSupported = true;
|
||||
|
||||
OsContextLinux osContext3(drmMock, 0u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
OsContextLinux osContext3(drmMock, 0, 0u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
osContext3.ensureContextInitialized();
|
||||
EXPECT_EQ(6u, drmMock.receivedContextParamRequestCount);
|
||||
|
||||
OsContextLinux osContext4(drmMock, 0u, EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_RCS, EngineUsage::LowPriority}));
|
||||
OsContextLinux osContext4(drmMock, 0, 0u, EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_RCS, EngineUsage::LowPriority}));
|
||||
osContext4.ensureContextInitialized();
|
||||
EXPECT_EQ(9u, drmMock.receivedContextParamRequestCount);
|
||||
EXPECT_EQ(drmMock.storedDrmContextId, drmMock.receivedContextParamRequest.contextId);
|
||||
@@ -645,7 +645,7 @@ TEST(DrmTest, givenDrmWhenCreatingOsContextThenCreateDrmContextWithVmId) {
|
||||
executionEnvironment->rootDeviceEnvironments[0]->initGmm();
|
||||
|
||||
DrmMock drmMock(*executionEnvironment->rootDeviceEnvironments[0]);
|
||||
OsContextLinux osContext(drmMock, 0u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
OsContextLinux osContext(drmMock, 0, 0u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
osContext.ensureContextInitialized();
|
||||
|
||||
drmMock.latestCreatedVmId = 0u;
|
||||
@@ -664,10 +664,10 @@ TEST(DrmTest, givenDrmWithPerContextVMRequiredWhenCreatingOsContextsThenImplicit
|
||||
DrmMock drmMock(rootEnv);
|
||||
EXPECT_TRUE(drmMock.requirePerContextVM);
|
||||
|
||||
OsContextLinux osContext1(drmMock, 0u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
OsContextLinux osContext1(drmMock, 0, 0u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
osContext1.ensureContextInitialized();
|
||||
|
||||
OsContextLinux osContext2(drmMock, 5u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
OsContextLinux osContext2(drmMock, 0, 5u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
osContext2.ensureContextInitialized();
|
||||
}
|
||||
|
||||
@@ -681,7 +681,7 @@ TEST(DrmTest, givenPerContextVMRequiredWhenCreatingOsContextsThenImplicitVmIdPer
|
||||
|
||||
drmMock.storedRetValForVmId = 20;
|
||||
|
||||
OsContextLinux osContext(drmMock, 0u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
OsContextLinux osContext(drmMock, 0, 0u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
osContext.ensureContextInitialized();
|
||||
EXPECT_EQ(2u, drmMock.receivedContextParamRequestCount);
|
||||
|
||||
@@ -702,7 +702,7 @@ TEST(DrmTest, givenPerContextVMRequiredWhenCreatingOsContextForSubDeviceThenImpl
|
||||
drmMock.storedRetValForVmId = 4;
|
||||
DeviceBitfield deviceBitfield(1 << 3);
|
||||
|
||||
OsContextLinux osContext(drmMock, 0u, EngineDescriptorHelper::getDefaultDescriptor(deviceBitfield));
|
||||
OsContextLinux osContext(drmMock, 0, 0u, EngineDescriptorHelper::getDefaultDescriptor(deviceBitfield));
|
||||
osContext.ensureContextInitialized();
|
||||
EXPECT_EQ(2u, drmMock.receivedContextParamRequestCount);
|
||||
|
||||
@@ -726,7 +726,7 @@ TEST(DrmTest, givenPerContextVMRequiredWhenCreatingOsContextsForRootDeviceThenIm
|
||||
drmMock.storedRetValForVmId = 4;
|
||||
DeviceBitfield deviceBitfield(1 | 1 << 1);
|
||||
|
||||
OsContextLinux osContext(drmMock, 0u, EngineDescriptorHelper::getDefaultDescriptor(deviceBitfield));
|
||||
OsContextLinux osContext(drmMock, 0, 0u, EngineDescriptorHelper::getDefaultDescriptor(deviceBitfield));
|
||||
osContext.ensureContextInitialized();
|
||||
EXPECT_EQ(2 * 2u, drmMock.receivedContextParamRequestCount);
|
||||
|
||||
@@ -749,7 +749,7 @@ TEST(DrmTest, givenNoPerContextVmsDrmWhenCreatingOsContextsThenVmIdIsNotQueriedA
|
||||
|
||||
drmMock.storedRetValForVmId = 1;
|
||||
|
||||
OsContextLinux osContext(drmMock, 0u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
OsContextLinux osContext(drmMock, 0, 0u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
osContext.ensureContextInitialized();
|
||||
EXPECT_EQ(2u, drmMock.receivedContextParamRequestCount);
|
||||
|
||||
@@ -770,7 +770,7 @@ TEST(DrmTest, givenProgramDebuggingAndContextDebugAvailableWhenCreatingContextTh
|
||||
drmMock.contextDebugSupported = true;
|
||||
drmMock.callBaseCreateDrmContext = false;
|
||||
|
||||
OsContextLinux osContext(drmMock, 5u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
OsContextLinux osContext(drmMock, 0, 5u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
osContext.ensureContextInitialized();
|
||||
|
||||
// drmMock returns ctxId == 0
|
||||
@@ -789,7 +789,7 @@ TEST(DrmTest, givenProgramDebuggingAndContextDebugAvailableWhenCreatingContextFo
|
||||
DrmMockNonFailing drmMock(*executionEnvironment->rootDeviceEnvironments[0]);
|
||||
drmMock.contextDebugSupported = true;
|
||||
|
||||
OsContextLinux osContext(drmMock, 5u, EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_RCS, EngineUsage::Internal}));
|
||||
OsContextLinux osContext(drmMock, 0, 5u, EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_RCS, EngineUsage::Internal}));
|
||||
osContext.ensureContextInitialized();
|
||||
|
||||
EXPECT_EQ(static_cast<uint32_t>(-1), drmMock.passedContextDebugId);
|
||||
@@ -810,7 +810,7 @@ TEST(DrmTest, givenNotEnabledDebuggingOrContextDebugUnsupportedWhenCreatingConte
|
||||
|
||||
EXPECT_FALSE(executionEnvironment->isDebuggingEnabled());
|
||||
|
||||
OsContextLinux osContext(drmMock, 5u, EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_RCS, EngineUsage::Regular}));
|
||||
OsContextLinux osContext(drmMock, 0, 5u, EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_RCS, EngineUsage::Regular}));
|
||||
osContext.ensureContextInitialized();
|
||||
|
||||
EXPECT_FALSE(drmMock.capturedCooperativeContextRequest);
|
||||
@@ -820,7 +820,7 @@ TEST(DrmTest, givenNotEnabledDebuggingOrContextDebugUnsupportedWhenCreatingConte
|
||||
drmMock.callBaseCreateDrmContext = false;
|
||||
drmMock.capturedCooperativeContextRequest = true;
|
||||
|
||||
OsContextLinux osContext2(drmMock, 5u, EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_RCS, EngineUsage::Regular}));
|
||||
OsContextLinux osContext2(drmMock, 0, 5u, EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_RCS, EngineUsage::Regular}));
|
||||
osContext2.ensureContextInitialized();
|
||||
|
||||
EXPECT_FALSE(drmMock.capturedCooperativeContextRequest);
|
||||
@@ -880,7 +880,7 @@ TEST(DrmTest, givenProgramDebuggingWhenCreatingContextThenUnrecoverableContextIs
|
||||
|
||||
DrmMock drm(*executionEnvironment->rootDeviceEnvironments[0]);
|
||||
|
||||
OsContextLinux osContext(drm, 0u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
OsContextLinux osContext(drm, 0, 0u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
osContext.ensureContextInitialized();
|
||||
|
||||
EXPECT_TRUE(drm.unrecoverableContextSet);
|
||||
@@ -1250,7 +1250,7 @@ TEST(DrmTest, GivenIoctlErrorWhenIsGpuHangIsCalledThenErrorIsThrown) {
|
||||
uint32_t contextId{0};
|
||||
EngineDescriptor engineDescriptor{EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_BCS, EngineUsage::Regular})};
|
||||
|
||||
MockOsContextLinux mockOsContextLinux{drm, contextId, engineDescriptor};
|
||||
MockOsContextLinux mockOsContextLinux{drm, 0, contextId, engineDescriptor};
|
||||
mockOsContextLinux.drmContextIds.push_back(0);
|
||||
mockOsContextLinux.drmContextIds.push_back(3);
|
||||
|
||||
@@ -1264,7 +1264,7 @@ TEST(DrmTest, GivenZeroBatchActiveAndZeroBatchPendingResetStatsWhenIsGpuHangIsCa
|
||||
uint32_t contextId{0};
|
||||
EngineDescriptor engineDescriptor{EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_BCS, EngineUsage::Regular})};
|
||||
|
||||
MockOsContextLinux mockOsContextLinux{drm, contextId, engineDescriptor};
|
||||
MockOsContextLinux mockOsContextLinux{drm, 0, contextId, engineDescriptor};
|
||||
mockOsContextLinux.drmContextIds.push_back(0);
|
||||
mockOsContextLinux.drmContextIds.push_back(3);
|
||||
|
||||
@@ -1287,7 +1287,7 @@ TEST(DrmTest, GivenBatchActiveGreaterThanZeroResetStatsWhenIsGpuHangIsCalledThen
|
||||
uint32_t contextId{0};
|
||||
EngineDescriptor engineDescriptor{EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_BCS, EngineUsage::Regular})};
|
||||
|
||||
MockOsContextLinux mockOsContextLinux{drm, contextId, engineDescriptor};
|
||||
MockOsContextLinux mockOsContextLinux{drm, 0, contextId, engineDescriptor};
|
||||
mockOsContextLinux.drmContextIds.push_back(0);
|
||||
mockOsContextLinux.drmContextIds.push_back(3);
|
||||
|
||||
@@ -1311,7 +1311,7 @@ TEST(DrmTest, GivenBatchPendingGreaterThanZeroResetStatsWhenIsGpuHangIsCalledThe
|
||||
uint32_t contextId{0};
|
||||
EngineDescriptor engineDescriptor{EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_BCS, EngineUsage::Regular})};
|
||||
|
||||
MockOsContextLinux mockOsContextLinux{drm, contextId, engineDescriptor};
|
||||
MockOsContextLinux mockOsContextLinux{drm, 0, contextId, engineDescriptor};
|
||||
mockOsContextLinux.drmContextIds.push_back(8);
|
||||
|
||||
ResetStats resetStats{};
|
||||
|
||||
@@ -25,7 +25,7 @@ TEST(DrmVmBindTest, givenBoRequiringImmediateBindWhenBindingThenImmediateFlagIsP
|
||||
MockBufferObject bo(&drm, 3, 0, 0, 1);
|
||||
bo.requireImmediateBinding(true);
|
||||
|
||||
OsContextLinux osContext(drm, 0u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
OsContextLinux osContext(drm, 0, 0u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
osContext.ensureContextInitialized();
|
||||
bo.bind(&osContext, 0);
|
||||
|
||||
@@ -43,7 +43,7 @@ TEST(DrmVmBindTest, givenBoRequiringExplicitResidencyWhenBindingThenMakeResident
|
||||
MockBufferObject bo(&drm, 3, 0, 0, 1);
|
||||
bo.requireExplicitResidency(requireResidency);
|
||||
|
||||
OsContextLinux osContext(drm, 0u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
OsContextLinux osContext(drm, 0, 0u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
osContext.ensureContextInitialized();
|
||||
uint32_t vmHandleId = 0;
|
||||
bo.bind(&osContext, vmHandleId);
|
||||
@@ -81,7 +81,7 @@ TEST(DrmVmBindTest, givenBoNotRequiringExplicitResidencyWhenCallingWaitForBindTh
|
||||
MockBufferObject bo(&drm, 3, 0, 0, 1);
|
||||
bo.requireExplicitResidency(requireResidency);
|
||||
|
||||
OsContextLinux osContext(drm, 0u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
OsContextLinux osContext(drm, 0, 0u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
osContext.ensureContextInitialized();
|
||||
uint32_t vmHandleId = 0;
|
||||
bo.bind(&osContext, vmHandleId);
|
||||
@@ -107,7 +107,7 @@ TEST(DrmVmBindTest, givenUseKmdMigrationWhenCallingBindBoOnUnifiedSharedMemoryTh
|
||||
DrmQueryMock drm(*executionEnvironment->rootDeviceEnvironments[0]);
|
||||
drm.pageFaultSupported = true;
|
||||
|
||||
OsContextLinux osContext(drm, 0u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
OsContextLinux osContext(drm, 0, 0u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
osContext.ensureContextInitialized();
|
||||
uint32_t vmHandleId = 0;
|
||||
|
||||
|
||||
@@ -497,7 +497,7 @@ TEST_F(IoctlHelperPrelimFixture, givenProgramDebuggingAndContextDebugSupportedWh
|
||||
|
||||
executionEnvironment->rootDeviceEnvironments[0]->getMutableHardwareInfo()->platform.eProductFamily = defaultHwInfo->platform.eProductFamily;
|
||||
|
||||
OsContextLinux osContext(*drm, 5u, EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_RCS, EngineUsage::Regular}));
|
||||
OsContextLinux osContext(*drm, 0, 5u, EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_RCS, EngineUsage::Regular}));
|
||||
osContext.ensureContextInitialized();
|
||||
|
||||
EXPECT_NE(static_cast<uint32_t>(-1), drm->passedContextDebugId);
|
||||
@@ -507,7 +507,7 @@ TEST_F(IoctlHelperPrelimFixture, givenProgramDebuggingAndContextDebugSupportedWh
|
||||
EXPECT_FALSE(drm->capturedCooperativeContextRequest);
|
||||
}
|
||||
|
||||
OsContextLinux osContext2(*drm, 5u, EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_RCS, EngineUsage::Cooperative}));
|
||||
OsContextLinux osContext2(*drm, 0, 5u, EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_RCS, EngineUsage::Cooperative}));
|
||||
osContext2.ensureContextInitialized();
|
||||
|
||||
EXPECT_NE(static_cast<uint32_t>(-1), drm->passedContextDebugId);
|
||||
|
||||
@@ -29,7 +29,7 @@ TEST(OSContextLinux, givenReinitializeContextWhenContextIsInitThenContextIsStill
|
||||
MockExecutionEnvironment executionEnvironment;
|
||||
std::unique_ptr<DrmMockCustom> mock(new DrmMockCustom(*executionEnvironment.rootDeviceEnvironments[0]));
|
||||
executionEnvironment.rootDeviceEnvironments[0]->memoryOperationsInterface = DrmMemoryOperationsHandler::create(*mock.get(), 0u);
|
||||
OsContextLinux osContext(*mock, 0u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
OsContextLinux osContext(*mock, 0, 0u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
EXPECT_NO_THROW(osContext.reInitializeContext());
|
||||
EXPECT_NO_THROW(osContext.ensureContextInitialized());
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
using namespace NEO;
|
||||
|
||||
TEST(OSContext, whenCreatingDefaultOsContextThenExpectInitializedAlways) {
|
||||
OsContext *osContext = OsContext::create(nullptr, 0, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
OsContext *osContext = OsContext::create(nullptr, 0, 0, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
EXPECT_FALSE(osContext->isLowPriority());
|
||||
EXPECT_FALSE(osContext->isInternalEngine());
|
||||
EXPECT_FALSE(osContext->isRootDevice());
|
||||
@@ -28,7 +28,7 @@ TEST(OSContext, givenInternalAndRootDeviceAreTrueWhenCreatingDefaultOsContextThe
|
||||
auto descriptor = EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_RCS, EngineUsage::Internal});
|
||||
descriptor.isRootDevice = true;
|
||||
|
||||
OsContext *osContext = OsContext::create(nullptr, 0, descriptor);
|
||||
OsContext *osContext = OsContext::create(nullptr, 0, 0, descriptor);
|
||||
EXPECT_FALSE(osContext->isLowPriority());
|
||||
EXPECT_TRUE(osContext->isInternalEngine());
|
||||
EXPECT_TRUE(osContext->isRootDevice());
|
||||
@@ -39,7 +39,7 @@ TEST(OSContext, givenLowPriorityAndRootDeviceAreTrueWhenCreatingDefaultOsContext
|
||||
auto descriptor = EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_RCS, EngineUsage::LowPriority});
|
||||
descriptor.isRootDevice = true;
|
||||
|
||||
OsContext *osContext = OsContext::create(nullptr, 0, descriptor);
|
||||
OsContext *osContext = OsContext::create(nullptr, 0, 0, descriptor);
|
||||
EXPECT_TRUE(osContext->isLowPriority());
|
||||
EXPECT_FALSE(osContext->isInternalEngine());
|
||||
EXPECT_TRUE(osContext->isRootDevice());
|
||||
@@ -47,7 +47,7 @@ TEST(OSContext, givenLowPriorityAndRootDeviceAreTrueWhenCreatingDefaultOsContext
|
||||
}
|
||||
|
||||
TEST(OSContext, givenOsContextCreatedDefaultIsFalseWhenSettingTrueThenFlagTrueReturned) {
|
||||
OsContext *osContext = OsContext::create(nullptr, 0, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
OsContext *osContext = OsContext::create(nullptr, 0, 0, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
EXPECT_FALSE(osContext->isDefaultContext());
|
||||
osContext->setDefaultContext(true);
|
||||
EXPECT_TRUE(osContext->isDefaultContext());
|
||||
@@ -57,7 +57,7 @@ TEST(OSContext, givenOsContextCreatedDefaultIsFalseWhenSettingTrueThenFlagTrueRe
|
||||
TEST(OSContext, givenCooperativeEngineWhenIsCooperativeEngineIsCalledThenReturnTrue) {
|
||||
auto engineDescriptor = EngineDescriptorHelper::getDefaultDescriptor();
|
||||
engineDescriptor.engineTypeUsage.second = EngineUsage::Cooperative;
|
||||
auto pOsContext = OsContext::create(nullptr, 0, engineDescriptor);
|
||||
auto pOsContext = OsContext::create(nullptr, 0, 0, engineDescriptor);
|
||||
EXPECT_FALSE(pOsContext->isRegular());
|
||||
EXPECT_FALSE(pOsContext->isLowPriority());
|
||||
EXPECT_FALSE(pOsContext->isInternalEngine());
|
||||
@@ -67,7 +67,7 @@ TEST(OSContext, givenCooperativeEngineWhenIsCooperativeEngineIsCalledThenReturnT
|
||||
|
||||
TEST(OSContext, givenReinitializeContextWhenContextIsInitThenContextIsStillIinitializedAfter) {
|
||||
auto engineDescriptor = EngineDescriptorHelper::getDefaultDescriptor();
|
||||
auto pOsContext = OsContext::create(nullptr, 0, engineDescriptor);
|
||||
auto pOsContext = OsContext::create(nullptr, 0, 0, engineDescriptor);
|
||||
EXPECT_NO_THROW(pOsContext->reInitializeContext());
|
||||
EXPECT_NO_THROW(pOsContext->ensureContextInitialized());
|
||||
delete pOsContext;
|
||||
@@ -75,7 +75,7 @@ TEST(OSContext, givenReinitializeContextWhenContextIsInitThenContextIsStillIinit
|
||||
|
||||
TEST(OSContext, givenSetPowerHintThenGetPowerHintShowsTheSameValue) {
|
||||
auto engineDescriptor = EngineDescriptorHelper::getDefaultDescriptor();
|
||||
auto pOsContext = OsContext::create(nullptr, 0, engineDescriptor);
|
||||
auto pOsContext = OsContext::create(nullptr, 0, 0, engineDescriptor);
|
||||
pOsContext->setUmdPowerHintValue(1);
|
||||
EXPECT_EQ(1, pOsContext->getUmdPowerHintValue());
|
||||
delete pOsContext;
|
||||
@@ -89,7 +89,7 @@ struct DeferredOsContextCreationTests : ::testing::Test {
|
||||
|
||||
std::unique_ptr<OsContext> createOsContext(EngineTypeUsage engineTypeUsage, bool defaultEngine) {
|
||||
OSInterface *osInterface = device->getRootDeviceEnvironment().osInterface.get();
|
||||
std::unique_ptr<OsContext> osContext{OsContext::create(osInterface, 0, EngineDescriptorHelper::getDefaultDescriptor(engineTypeUsage))};
|
||||
std::unique_ptr<OsContext> osContext{OsContext::create(osInterface, device->getRootDeviceIndex(), 0, EngineDescriptorHelper::getDefaultDescriptor(engineTypeUsage))};
|
||||
EXPECT_FALSE(osContext->isInitialized());
|
||||
return osContext;
|
||||
}
|
||||
@@ -169,7 +169,7 @@ TEST_F(DeferredOsContextCreationTests, givenBlitterEngineWhenCreatingOsContextTh
|
||||
TEST_F(DeferredOsContextCreationTests, givenEnsureContextInitializeCalledMultipleTimesWhenOsContextIsCreatedThenInitializeOnlyOnce) {
|
||||
struct MyOsContext : OsContext {
|
||||
MyOsContext(uint32_t contextId,
|
||||
const EngineDescriptor &engineDescriptor) : OsContext(contextId, engineDescriptor) {}
|
||||
const EngineDescriptor &engineDescriptor) : OsContext(0, contextId, engineDescriptor) {}
|
||||
|
||||
void initializeContext() override {
|
||||
initializeContextCalled++;
|
||||
|
||||
@@ -354,7 +354,7 @@ TEST_F(WddmPreemptionHeaderTests, givenWddmCommandStreamReceiverWhenPreemptionIs
|
||||
auto csr = std::make_unique<MockWddmCsr<DEFAULT_TEST_FAMILY_NAME>>(*executionEnvironment, 0, 1);
|
||||
executionEnvironment->memoryManager.reset(new MemoryManagerCreate<WddmMemoryManager>(false, false, *executionEnvironment));
|
||||
csr->overrideDispatchPolicy(DispatchMode::ImmediateDispatch);
|
||||
OsContextWin osContext(*wddm, 0u,
|
||||
OsContextWin osContext(*wddm, csr->getRootDeviceIndex(), 0u,
|
||||
EngineDescriptorHelper::getDefaultDescriptor(HwHelper::get(hwInfo->platform.eRenderCoreFamily).getGpgpuEngineInstances(*hwInfo)[0],
|
||||
PreemptionHelper::getDefaultPreemptionMode(*hwInfo)));
|
||||
csr->setupContext(osContext);
|
||||
@@ -379,7 +379,7 @@ TEST_F(WddmPreemptionHeaderTests, givenWddmCommandStreamReceiverWhenPreemptionIs
|
||||
auto csr = std::make_unique<MockWddmCsr<DEFAULT_TEST_FAMILY_NAME>>(*executionEnvironment, 0, 1);
|
||||
executionEnvironment->memoryManager.reset(new MemoryManagerCreate<WddmMemoryManager>(false, false, *executionEnvironment));
|
||||
csr->overrideDispatchPolicy(DispatchMode::ImmediateDispatch);
|
||||
OsContextWin osContext(*wddm, 0u,
|
||||
OsContextWin osContext(*wddm, csr->getRootDeviceIndex(), 0u,
|
||||
EngineDescriptorHelper::getDefaultDescriptor(HwHelper::get(hwInfo->platform.eRenderCoreFamily).getGpgpuEngineInstances(*hwInfo)[0],
|
||||
PreemptionHelper::getDefaultPreemptionMode(*hwInfo)));
|
||||
csr->setupContext(osContext);
|
||||
|
||||
@@ -26,25 +26,25 @@ struct OsContextWinTest : public WddmTestWithMockGdiDll {
|
||||
};
|
||||
|
||||
TEST_F(OsContextWinTest, givenWddm20WhenCreatingOsContextThenOsContextIsInitialized) {
|
||||
osContext = std::make_unique<OsContextWin>(*osInterface->getDriverModel()->as<Wddm>(), 0u, EngineDescriptorHelper::getDefaultDescriptor(engineTypeUsage, preemptionMode));
|
||||
osContext = std::make_unique<OsContextWin>(*osInterface->getDriverModel()->as<Wddm>(), 0, 0u, EngineDescriptorHelper::getDefaultDescriptor(engineTypeUsage, preemptionMode));
|
||||
EXPECT_NO_THROW(osContext->ensureContextInitialized());
|
||||
}
|
||||
|
||||
TEST_F(OsContextWinTest, givenWddm20WhenCreatingWddmContextFailThenOsContextCreationFails) {
|
||||
wddm->device = INVALID_HANDLE;
|
||||
osContext = std::make_unique<OsContextWin>(*osInterface->getDriverModel()->as<Wddm>(), 0u, EngineDescriptorHelper::getDefaultDescriptor(engineTypeUsage, preemptionMode));
|
||||
osContext = std::make_unique<OsContextWin>(*osInterface->getDriverModel()->as<Wddm>(), 0, 0u, EngineDescriptorHelper::getDefaultDescriptor(engineTypeUsage, preemptionMode));
|
||||
EXPECT_ANY_THROW(osContext->ensureContextInitialized());
|
||||
}
|
||||
|
||||
TEST_F(OsContextWinTest, givenWddm20WhenCreatingWddmMonitorFenceFailThenOsContextCreationFails) {
|
||||
*getCreateSynchronizationObject2FailCallFcn() = true;
|
||||
osContext = std::make_unique<OsContextWin>(*osInterface->getDriverModel()->as<Wddm>(), 0u, EngineDescriptorHelper::getDefaultDescriptor(engineTypeUsage, preemptionMode));
|
||||
osContext = std::make_unique<OsContextWin>(*osInterface->getDriverModel()->as<Wddm>(), 0, 0u, EngineDescriptorHelper::getDefaultDescriptor(engineTypeUsage, preemptionMode));
|
||||
EXPECT_ANY_THROW(osContext->ensureContextInitialized());
|
||||
}
|
||||
|
||||
TEST_F(OsContextWinTest, givenWddm20WhenRegisterTrimCallbackFailThenOsContextCreationFails) {
|
||||
*getRegisterTrimNotificationFailCallFcn() = true;
|
||||
osContext = std::make_unique<OsContextWin>(*osInterface->getDriverModel()->as<Wddm>(), 0u, EngineDescriptorHelper::getDefaultDescriptor(engineTypeUsage, preemptionMode));
|
||||
osContext = std::make_unique<OsContextWin>(*osInterface->getDriverModel()->as<Wddm>(), 0, 0u, EngineDescriptorHelper::getDefaultDescriptor(engineTypeUsage, preemptionMode));
|
||||
EXPECT_ANY_THROW(osContext->ensureContextInitialized());
|
||||
}
|
||||
|
||||
@@ -53,12 +53,12 @@ TEST_F(OsContextWinTest, givenWddm20WhenRegisterTrimCallbackIsDisabledThenOsCont
|
||||
DebugManager.flags.DoNotRegisterTrimCallback.set(true);
|
||||
*getRegisterTrimNotificationFailCallFcn() = true;
|
||||
|
||||
osContext = std::make_unique<OsContextWin>(*osInterface->getDriverModel()->as<Wddm>(), 0u, EngineDescriptorHelper::getDefaultDescriptor(engineTypeUsage, preemptionMode));
|
||||
osContext = std::make_unique<OsContextWin>(*osInterface->getDriverModel()->as<Wddm>(), 0, 0u, EngineDescriptorHelper::getDefaultDescriptor(engineTypeUsage, preemptionMode));
|
||||
EXPECT_NO_THROW(osContext->ensureContextInitialized());
|
||||
}
|
||||
|
||||
TEST_F(OsContextWinTest, givenReinitializeContextWhenContextIsInitThenContextIsDestroyedAndRecreated) {
|
||||
osContext = std::make_unique<OsContextWin>(*osInterface->getDriverModel()->as<Wddm>(), 0u, EngineDescriptorHelper::getDefaultDescriptor(engineTypeUsage, preemptionMode));
|
||||
osContext = std::make_unique<OsContextWin>(*osInterface->getDriverModel()->as<Wddm>(), 0, 0u, EngineDescriptorHelper::getDefaultDescriptor(engineTypeUsage, preemptionMode));
|
||||
EXPECT_NO_THROW(osContext->reInitializeContext());
|
||||
EXPECT_NO_THROW(osContext->ensureContextInitialized());
|
||||
}
|
||||
@@ -82,7 +82,7 @@ struct OsContextWinTestNoCleanup : public WddmTestWithMockGdiDllNoCleanup {
|
||||
};
|
||||
|
||||
TEST_F(OsContextWinTestNoCleanup, givenReinitializeContextWhenContextIsInitThenContextIsNotDestroyed) {
|
||||
osContext = std::make_unique<OsContextWin>(*osInterface->getDriverModel()->as<Wddm>(), 0u, EngineDescriptorHelper::getDefaultDescriptor(engineTypeUsage, preemptionMode));
|
||||
osContext = std::make_unique<OsContextWin>(*osInterface->getDriverModel()->as<Wddm>(), 0, 0u, EngineDescriptorHelper::getDefaultDescriptor(engineTypeUsage, preemptionMode));
|
||||
EXPECT_FALSE(this->wddm->isDriverAvailable());
|
||||
EXPECT_TRUE(this->wddm->skipResourceCleanup());
|
||||
EXPECT_NO_THROW(osContext->reInitializeContext());
|
||||
|
||||
@@ -32,7 +32,7 @@ TEST(OsContextTest, givenWddmWhenCreateOsContextAfterInitWddmThenOsContextIsInit
|
||||
auto preemptionMode = PreemptionHelper::getDefaultPreemptionMode(*defaultHwInfo);
|
||||
wddm->init();
|
||||
EXPECT_EQ(0u, wddm->registerTrimCallbackResult.called);
|
||||
auto osContext = std::make_unique<OsContextWin>(*wddm, 0u,
|
||||
auto osContext = std::make_unique<OsContextWin>(*wddm, 0, 0u,
|
||||
EngineDescriptorHelper::getDefaultDescriptor(HwHelper::get(defaultHwInfo->platform.eRenderCoreFamily).getGpgpuEngineInstances(*defaultHwInfo)[0], preemptionMode));
|
||||
osContext->ensureContextInitialized();
|
||||
EXPECT_EQ(osContext->getWddm(), wddm);
|
||||
|
||||
@@ -42,7 +42,7 @@ class WddmPreemptionTests : public Test<WddmFixtureWithMockGdiDll> {
|
||||
hwInfo = executionEnvironment->rootDeviceEnvironments[0]->getHardwareInfo();
|
||||
ASSERT_NE(nullptr, hwInfo);
|
||||
auto engine = HwHelper::get(defaultHwInfo->platform.eRenderCoreFamily).getGpgpuEngineInstances(*hwInfo)[0];
|
||||
osContext = std::make_unique<OsContextWin>(*wddm, 0u, EngineDescriptorHelper::getDefaultDescriptor(engine, preemptionMode));
|
||||
osContext = std::make_unique<OsContextWin>(*wddm, 0, 0u, EngineDescriptorHelper::getDefaultDescriptor(engine, preemptionMode));
|
||||
osContext->ensureContextInitialized();
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ class WddmSharedTestsFixture : public GdiDllFixture, public MockExecutionEnviron
|
||||
|
||||
auto hwInfo = rootDeviceEnvironment->getHardwareInfo();
|
||||
auto engine = HwHelper::get(defaultHwInfo->platform.eRenderCoreFamily).getGpgpuEngineInstances(*hwInfo)[0];
|
||||
osContext = std::make_unique<OsContextWin>(*osInterface->getDriverModel()->as<Wddm>(), 0u, EngineDescriptorHelper::getDefaultDescriptor(engine, preemptionMode));
|
||||
osContext = std::make_unique<OsContextWin>(*osInterface->getDriverModel()->as<Wddm>(), 0, 0u, EngineDescriptorHelper::getDefaultDescriptor(engine, preemptionMode));
|
||||
osContext->ensureContextInitialized();
|
||||
}
|
||||
|
||||
|
||||
@@ -100,7 +100,7 @@ TEST_F(WddmTests, whenftrEuDebugIsFalseThenDebuggingEnabledReturnsFalse) {
|
||||
TEST_F(WddmTests, whenProgramDebugIsEnabledAndCreatingContextWithInternalEngineThenDebuggableContextReturnsFalse) {
|
||||
executionEnvironment->setDebuggingEnabled();
|
||||
wddm->init();
|
||||
OsContextWin osContext(*wddm, 5u, EngineDescriptorHelper::getDefaultDescriptor({aub_stream::EngineType::ENGINE_RCS, EngineUsage::Internal}));
|
||||
OsContextWin osContext(*wddm, 0, 5u, EngineDescriptorHelper::getDefaultDescriptor({aub_stream::EngineType::ENGINE_RCS, EngineUsage::Internal}));
|
||||
osContext.ensureContextInitialized();
|
||||
EXPECT_FALSE(osContext.isDebuggableContext());
|
||||
}
|
||||
@@ -434,7 +434,7 @@ struct WddmSkipResourceCleanupFixtureWithMockGdiDll : public GdiDllFixture, publ
|
||||
|
||||
auto hwInfo = rootDeviceEnvironment->getHardwareInfo();
|
||||
auto engine = HwHelper::get(defaultHwInfo->platform.eRenderCoreFamily).getGpgpuEngineInstances(*hwInfo)[0];
|
||||
osContext = std::make_unique<OsContextWin>(*osInterface->getDriverModel()->as<Wddm>(), 0u, EngineDescriptorHelper::getDefaultDescriptor(engine, preemptionMode));
|
||||
osContext = std::make_unique<OsContextWin>(*osInterface->getDriverModel()->as<Wddm>(), 0, 0u, EngineDescriptorHelper::getDefaultDescriptor(engine, preemptionMode));
|
||||
osContext->ensureContextInitialized();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user