Do not use direct submission in internal and low priority contexts

Change-Id: Ifac52dd36737151ea4d84bec95750e1716cafa9a
Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
Zbigniew Zdanowicz
2020-03-03 23:33:31 +01:00
committed by sys_ocldev
parent 4181102ff1
commit ad4925aef9
51 changed files with 432 additions and 185 deletions

View File

@@ -161,7 +161,19 @@ bool WddmCommandStreamReceiver<GfxFamily>::initDirectSubmission(Device &device,
auto contextEngineType = osContext.getEngineType();
const DirectSubmissionProperties &directSubmissionProperty =
device.getHardwareInfo().capabilityTable.directSubmissionEngines.data[contextEngineType];
if (directSubmissionProperty.engineSupported) {
bool startDirect = true;
if (osContext.isLowPriority()) {
startDirect = directSubmissionProperty.useLowPriority;
}
if (osContext.isInternalEngine()) {
startDirect = directSubmissionProperty.useInternal;
}
if (osContext.isRootDevice()) {
startDirect = directSubmissionProperty.useRootDevice;
}
if (directSubmissionProperty.engineSupported && startDirect) {
if (contextEngineType == ENGINE_TYPE_BCS) {
directSubmission = std::make_unique<WddmDirectSubmission<GfxFamily>>(device,
std::make_unique<BlitterDispatcher<GfxFamily>>(),

View File

@@ -23,7 +23,8 @@ struct BlitAuxTranslationTests : public ::testing::Test {
class BcsMockContext : public MockContext {
public:
BcsMockContext(ClDevice *device) : MockContext(device) {
bcsOsContext.reset(OsContext::create(nullptr, 0, 0, aub_stream::ENGINE_BCS, PreemptionMode::Disabled, false));
bcsOsContext.reset(OsContext::create(nullptr, 0, 0, aub_stream::ENGINE_BCS, PreemptionMode::Disabled,
false, false, false));
bcsCsr.reset(createCommandStream(*device->getExecutionEnvironment(), device->getRootDeviceIndex()));
bcsCsr->setupContext(*bcsOsContext);
bcsCsr->initializeTagAllocation();
@@ -63,7 +64,8 @@ struct BlitAuxTranslationTests : public ::testing::Test {
if (createBcsEngine) {
auto &engine = device->getEngine(HwHelperHw<FamilyType>::lowPriorityEngineType, true);
bcsOsContext.reset(OsContext::create(nullptr, 1, 0, aub_stream::ENGINE_BCS, PreemptionMode::Disabled, false));
bcsOsContext.reset(OsContext::create(nullptr, 1, 0, aub_stream::ENGINE_BCS, PreemptionMode::Disabled,
false, false, false));
engine.osContext = bcsOsContext.get();
engine.commandStreamReceiver->setupContext(*bcsOsContext);
}

View File

@@ -235,7 +235,8 @@ HWTEST_F(CommandQueueWithSubDevicesTest, givenDeviceWithSubDevicesSupportingBlit
auto subDevice = device->getDeviceById(0);
if (createBcsEngine) {
auto &engine = subDevice->getEngine(HwHelperHw<FamilyType>::lowPriorityEngineType, true);
bcsOsContext.reset(OsContext::create(nullptr, 1, 0, aub_stream::ENGINE_BCS, PreemptionMode::Disabled, false));
bcsOsContext.reset(OsContext::create(nullptr, 1, 0, aub_stream::ENGINE_BCS, PreemptionMode::Disabled,
false, false, false));
engine.osContext = bcsOsContext.get();
engine.commandStreamReceiver->setupContext(*bcsOsContext);
}

View File

@@ -173,7 +173,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWithAubMana
HWTEST_F(AubCommandStreamReceiverTests, givenAubCsrWhenOsContextIsSetThenCreateHardwareContext) {
uint32_t deviceIndex = 3;
MockOsContext osContext(0, 8, aub_stream::ENGINE_BCS, PreemptionMode::Disabled, false);
MockOsContext osContext(0, 8, aub_stream::ENGINE_BCS, PreemptionMode::Disabled, false, false, false);
std::string fileName = "file_name.aub";
MockAubManager *mockManager = new MockAubManager();
MockAubCenter *mockAubCenter = new MockAubCenter(platformDevices[0], false, fileName, CommandStreamReceiverType::CSR_AUB);
@@ -190,7 +190,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCsrWhenOsContextIsSetThenCreateH
}
HWTEST_F(AubCommandStreamReceiverTests, givenAubCsrWhenLowPriorityOsContextIsSetThenDontCreateHardwareContext) {
MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, true);
MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, true, false, false);
std::string fileName = "file_name.aub";
MockAubManager *mockManager = new MockAubManager();
MockAubCenter *mockAubCenter = new MockAubCenter(platformDevices[0], false, fileName, CommandStreamReceiverType::CSR_AUB);
@@ -256,7 +256,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenMultipl
auto &hwInfo = pDevice->getHardwareInfo();
auto engineInstance = HwHelper::get(hwInfo.platform.eRenderCoreFamily).getGpgpuEngineInstances(hwInfo)[0];
MockOsContext osContext(0, 1, engineInstance, PreemptionMode::Disabled, false);
MockOsContext osContext(0, 1, engineInstance, PreemptionMode::Disabled, false, false, false);
auto aubCsr1 = std::make_unique<AUBCommandStreamReceiverHw<FamilyType>>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex());
auto aubCsr2 = std::make_unique<AUBCommandStreamReceiverHw<FamilyType>>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex());
@@ -823,7 +823,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenProcess
}
HWTEST_F(AubCommandStreamReceiverTests, givenOsContextWithMultipleDevicesSupportedWhenSetupIsCalledThenCreateMultipleHardwareContexts) {
MockOsContext osContext(1, 0b11, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false);
MockOsContext osContext(1, 0b11, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false);
auto aubCsr = std::make_unique<AUBCommandStreamReceiverHw<FamilyType>>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex());
aubCsr->setupContext(osContext);
@@ -1175,7 +1175,8 @@ using HardwareContextContainerTests = ::testing::Test;
TEST_F(HardwareContextContainerTests, givenOsContextWithMultipleDevicesSupportedThenInitialzeHwContextsWithValidIndexes) {
MockAubManager aubManager;
MockOsContext osContext(1, 0b11, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false);
MockOsContext osContext(1, 0b11, aub_stream::ENGINE_RCS, PreemptionMode::Disabled,
false, false, false);
HardwareContextController hwContextControler(aubManager, osContext, 0);
EXPECT_EQ(2u, hwContextControler.hardwareContexts.size());
@@ -1188,7 +1189,8 @@ TEST_F(HardwareContextContainerTests, givenOsContextWithMultipleDevicesSupported
TEST_F(HardwareContextContainerTests, givenSingleHwContextWhenSubmitMethodIsCalledOnHwContextControllerThenSubmitIsCalled) {
MockAubManager aubManager;
MockOsContext osContext(1, 0b1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false);
MockOsContext osContext(1, 0b1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled,
false, false, false);
HardwareContextController hwContextContainer(aubManager, osContext, 0);
EXPECT_EQ(1u, hwContextContainer.hardwareContexts.size());
@@ -1206,7 +1208,8 @@ TEST_F(HardwareContextContainerTests, givenSingleHwContextWhenSubmitMethodIsCall
TEST_F(HardwareContextContainerTests, givenSingleHwContextWhenWriteMemoryIsCalledThenWholeMemoryBanksArePassed) {
MockAubManager aubManager;
MockOsContext osContext(1, 0b1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false);
MockOsContext osContext(1, 0b1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled,
false, false, false);
HardwareContextController hwContextContainer(aubManager, osContext, 0);
EXPECT_EQ(1u, hwContextContainer.hardwareContexts.size());
@@ -1220,7 +1223,8 @@ TEST_F(HardwareContextContainerTests, givenSingleHwContextWhenWriteMemoryIsCalle
TEST_F(HardwareContextContainerTests, givenMultipleHwContextWhenSingleMethodIsCalledThenUseAllContexts) {
MockAubManager aubManager;
MockOsContext osContext(1, 0b11, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false);
MockOsContext osContext(1, 0b11, aub_stream::ENGINE_RCS, PreemptionMode::Disabled,
false, false, false);
HardwareContextController hwContextContainer(aubManager, osContext, 0);
EXPECT_EQ(2u, hwContextContainer.hardwareContexts.size());
@@ -1260,7 +1264,8 @@ TEST_F(HardwareContextContainerTests, givenMultipleHwContextWhenSingleMethodIsCa
TEST_F(HardwareContextContainerTests, givenMultipleHwContextWhenSingleMethodIsCalledThenUseFirstContext) {
MockAubManager aubManager;
MockOsContext osContext(1, 0b11, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false);
MockOsContext osContext(1, 0b11, aub_stream::ENGINE_RCS, PreemptionMode::Disabled,
false, false, false);
HardwareContextController hwContextContainer(aubManager, osContext, 0);
EXPECT_EQ(2u, hwContextContainer.hardwareContexts.size());

View File

@@ -460,7 +460,8 @@ HWTEST_F(AubCommandStreamReceiverNoHostPtrTests, givenAubCommandStreamReceiverWh
auto hwInfo = executionEnvironment->rootDeviceEnvironments[0]->getHardwareInfo();
auto engineInstance = HwHelper::get(hwInfo->platform.eRenderCoreFamily).getGpgpuEngineInstances(*hwInfo)[0];
MockOsContext osContext(0, 1, engineInstance, PreemptionMode::Disabled, false);
MockOsContext osContext(0, 1, engineInstance, PreemptionMode::Disabled,
false, false, false);
std::unique_ptr<AUBCommandStreamReceiverHw<FamilyType>> aubCsr(new AUBCommandStreamReceiverHw<FamilyType>("", true, *executionEnvironment, 0));
aubCsr->setupContext(osContext);
@@ -493,7 +494,9 @@ HWTEST_F(AubCommandStreamReceiverNoHostPtrTests, givenAubCommandStreamReceiverWh
executionEnvironment->memoryManager.reset(memoryManager);
std::unique_ptr<AUBCommandStreamReceiverHw<FamilyType>> aubCsr(new AUBCommandStreamReceiverHw<FamilyType>("", true, *executionEnvironment, 0));
auto osContext = memoryManager->createAndRegisterOsContext(aubCsr.get(), getChosenEngineType(**platformDevices), 0, PreemptionMode::Disabled, false);
auto osContext = memoryManager->createAndRegisterOsContext(aubCsr.get(), getChosenEngineType(**platformDevices), 0,
PreemptionMode::Disabled,
false, false, false);
aubCsr->setupContext(*osContext);
auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{MemoryConstants::pageSize});
@@ -707,7 +710,8 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenEngineI
MockExecutionEnvironment executionEnvironment(platformDevices[0]);
auto hwInfo = executionEnvironment.rootDeviceEnvironments[0]->getHardwareInfo();
auto engineInstance = HwHelper::get(hwInfo->platform.eRenderCoreFamily).getGpgpuEngineInstances(*hwInfo)[0];
MockOsContext osContext(0, 1, engineInstance, PreemptionMode::Disabled, false);
MockOsContext osContext(0, 1, engineInstance, PreemptionMode::Disabled,
false, false, false);
executionEnvironment.initializeMemoryManager();
auto aubCsr = std::make_unique<MockAubCsrToTestDumpContext<FamilyType>>("", true, executionEnvironment, 0);
@@ -875,7 +879,8 @@ HWTEST_F(AubCommandStreamReceiverTests, givenGraphicsAllocationWritableWhenDumpA
DebugManager.flags.AUBDumpBufferFormat.set("BIN");
MockAubCsr<FamilyType> aubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex());
MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false);
MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled,
false, false, false);
aubCsr.setupContext(osContext);
auto mockHardwareContext = static_cast<MockHardwareContext *>(aubCsr.hardwareContextController->hardwareContexts[0].get());
@@ -897,7 +902,8 @@ HWTEST_F(AubCommandStreamReceiverTests, givenBcsEngineWhenDumpAllocationCalledTh
DebugManager.flags.AUBDumpBufferFormat.set("BIN");
MockAubCsr<FamilyType> aubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex());
MockOsContext osContext(0, 1, aub_stream::ENGINE_BCS, PreemptionMode::Disabled, false);
MockOsContext osContext(0, 1, aub_stream::ENGINE_BCS, PreemptionMode::Disabled,
false, false, false);
aubCsr.setupContext(osContext);
auto mockHardwareContext = static_cast<MockHardwareContext *>(aubCsr.hardwareContextController->hardwareContexts[0].get());
@@ -924,7 +930,8 @@ HWTEST_F(AubCommandStreamReceiverTests, givenCompressedGraphicsAllocationWritabl
pDevice->executionEnvironment->rootDeviceEnvironments[0]->aubCenter.reset(mockAubCenter);
MockAubCsr<FamilyType> aubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex());
MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false);
MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled,
false, false, false);
aubCsr.setupContext(osContext);
auto mockHardwareContext = static_cast<MockHardwareContext *>(aubCsr.hardwareContextController->hardwareContexts[0].get());
@@ -945,7 +952,8 @@ HWTEST_F(AubCommandStreamReceiverTests, givenGraphicsAllocationWritableWhenDumpA
DebugManagerStateRestore dbgRestore;
MockAubCsr<FamilyType> aubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex());
MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false);
MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled,
false, false, false);
aubCsr.setupContext(osContext);
auto mockHardwareContext = static_cast<MockHardwareContext *>(aubCsr.hardwareContextController->hardwareContexts[0].get());
@@ -968,7 +976,8 @@ HWTEST_F(AubCommandStreamReceiverTests, givenGraphicsAllocationNonWritableWhenDu
DebugManager.flags.AUBDumpBufferFormat.set("BIN");
MockAubCsr<FamilyType> aubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex());
MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false);
MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled,
false, false, false);
aubCsr.setupContext(osContext);
auto mockHardwareContext = static_cast<MockHardwareContext *>(aubCsr.hardwareContextController->hardwareContexts[0].get());
@@ -992,7 +1001,8 @@ HWTEST_F(AubCommandStreamReceiverTests, givenGraphicsAllocationNotDumpableWhenDu
DebugManager.flags.AUBDumpBufferFormat.set("BIN");
MockAubCsr<FamilyType> aubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex());
MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false);
MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled,
false, false, false);
aubCsr.setupContext(osContext);
auto mockHardwareContext = static_cast<MockHardwareContext *>(aubCsr.hardwareContextController->hardwareContexts[0].get());
@@ -1017,7 +1027,8 @@ HWTEST_F(AubCommandStreamReceiverTests, givenGraphicsAllocationDumpableWhenDumpA
DebugManager.flags.AUBDumpBufferFormat.set("BIN");
MockAubCsr<FamilyType> aubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex());
MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false);
MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled,
false, false, false);
aubCsr.setupContext(osContext);
auto mockHardwareContext = static_cast<MockHardwareContext *>(aubCsr.hardwareContextController->hardwareContexts[0].get());
@@ -1041,7 +1052,8 @@ HWTEST_F(AubCommandStreamReceiverTests, givenGraphicsAllocationWritableWhenDumpA
DebugManager.flags.AUBDumpBufferFormat.set("BIN");
MockAubCsr<FamilyType> aubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex());
MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false);
MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled,
false, false, false);
aubCsr.setupContext(osContext);
aubCsr.latestSentTaskCount = 1;

View File

@@ -299,7 +299,8 @@ HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWhenCallingAddAubComme
HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWithAubManagerWhenCallingAddAubCommentThenCallAddCommentOnAubManager) {
MockAubCsr<FamilyType> aubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex());
MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false);
MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled,
false, false, false);
aubCsr.setupContext(osContext);
auto mockAubManager = static_cast<MockAubManager *>(aubCsr.aubManager);
ASSERT_NE(nullptr, mockAubManager);
@@ -380,7 +381,8 @@ HWTEST_F(AubFileStreamTests, givenNoNewTaskSinceLastPollWhenDeletingAubCsrThenDo
HWTEST_F(AubFileStreamTests, givenNewTasksAndHardwareContextPresentWhenCallingPollForCompletionThenCallPollForCompletion) {
MockAubCsr<FamilyType> aubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex());
MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false);
MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled,
false, false, false);
aubCsr.setupContext(osContext);
auto hardwareContext = static_cast<MockHardwareContext *>(aubCsr.hardwareContextController->hardwareContexts[0].get());
@@ -394,7 +396,8 @@ HWTEST_F(AubFileStreamTests, givenNewTasksAndHardwareContextPresentWhenCallingPo
HWTEST_F(AubFileStreamTests, givenNoNewTasksAndHardwareContextPresentWhenCallingPollForCompletionThenDontCallPollForCompletion) {
MockAubCsr<FamilyType> aubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex());
MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false);
MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled,
false, false, false);
aubCsr.setupContext(osContext);
auto hardwareContext = static_cast<MockHardwareContext *>(aubCsr.hardwareContextController->hardwareContexts[0].get());
@@ -493,7 +496,8 @@ HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWithHardwareContextInS
AubSubCaptureCommon aubSubCaptureCommon;
auto aubSubCaptureManagerMock = new AubSubCaptureManagerMock("", aubSubCaptureCommon);
MockAubCsr<FamilyType> aubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex());
MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false);
MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled,
false, false, false);
aubCsr.setupContext(osContext);
auto hardwareContext = static_cast<MockHardwareContext *>(aubCsr.hardwareContextController->hardwareContexts[0].get());
@@ -520,7 +524,8 @@ HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWithHardwareContextInS
AubSubCaptureCommon aubSubCaptureCommon;
auto aubSubCaptureManagerMock = new AubSubCaptureManagerMock("", aubSubCaptureCommon);
MockAubCsr<FamilyType> aubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex());
MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false);
MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled,
false, false, false);
aubCsr.setupContext(osContext);
auto hardwareContext = static_cast<MockHardwareContext *>(aubCsr.hardwareContextController->hardwareContexts[0].get());
@@ -571,7 +576,8 @@ HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWhenExpectMemoryNotEqu
HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWhenFlushIsCalledThenItShouldCallTheExpectedHwContextFunctions) {
MockAubCsr<FamilyType> aubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex());
MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false);
MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled,
false, false, false);
aubCsr.setupContext(osContext);
auto mockHardwareContext = static_cast<MockHardwareContext *>(aubCsr.hardwareContextController->hardwareContexts[0].get());
@@ -595,7 +601,8 @@ HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWhenFlushIsCalledThenI
HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWhenFlushIsCalledWithZeroSizedBufferThenSubmitIsNotCalledOnHwContext) {
MockAubCsr<FamilyType> aubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex());
MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false);
MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled,
false, false, false);
aubCsr.setupContext(osContext);
auto mockHardwareContext = static_cast<MockHardwareContext *>(aubCsr.hardwareContextController->hardwareContexts[0].get());
@@ -615,7 +622,8 @@ HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWhenFlushIsCalledWithZ
HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWhenMakeResidentIsCalledThenItShouldCallTheExpectedHwContextFunctions) {
MockAubCsr<FamilyType> aubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex());
MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false);
MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled,
false, false, false);
aubCsr.setupContext(osContext);
MockGraphicsAllocation allocation(reinterpret_cast<void *>(0x1000), 0x1000);
@@ -627,7 +635,8 @@ HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWhenMakeResidentIsCall
HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWhenExpectMemoryEqualIsCalledThenItShouldCallTheExpectedHwContextFunctions) {
MockAubCsr<FamilyType> aubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex());
MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false);
MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled,
false, false, false);
aubCsr.setupContext(osContext);
auto mockHardwareContext = static_cast<MockHardwareContext *>(aubCsr.hardwareContextController->hardwareContexts[0].get());
@@ -639,7 +648,8 @@ HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWhenExpectMemoryEqualI
HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWhenExpectMemoryNotEqualIsCalledThenItShouldCallTheExpectedHwContextFunctions) {
MockAubCsr<FamilyType> aubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex());
MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false);
MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled,
false, false, false);
aubCsr.setupContext(osContext);
auto mockHardwareContext = static_cast<MockHardwareContext *>(aubCsr.hardwareContextController->hardwareContexts[0].get());

View File

@@ -1635,7 +1635,8 @@ class MockCsrWithFailingFlush : public CommandStreamReceiverHw<GfxFamily> {
HWTEST_F(CommandStreamReceiverFlushTaskTests, givenWaitForCompletionWithTimeoutIsCalledWhenFlushBatchedSubmissionsReturnsFailureThenItIsPropagated) {
MockCsrWithFailingFlush<FamilyType> mockCsr(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex());
MockOsContext osContext(0, 8, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false);
MockOsContext osContext(0, 8, aub_stream::ENGINE_RCS, PreemptionMode::Disabled,
false, false, false);
mockCsr.setupContext(osContext);
mockCsr.latestSentTaskCount = 0;
auto cmdBuffer = std::make_unique<CommandBuffer>(*pDevice);

View File

@@ -273,7 +273,8 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandStreamReceiverFlushTaskGmockTests, givenPatch
DispatchFlags flags = DispatchFlagsHelper::createDefaultDispatchFlags();
mockCsr->requiredScratchSize = 0x200000;
MockOsContext osContext(0, 8, aub_stream::ENGINE_BCS, PreemptionMode::Disabled, false);
MockOsContext osContext(0, 8, aub_stream::ENGINE_BCS, PreemptionMode::Disabled,
false, false, false);
mockCsr->setupContext(osContext);
mockCsr->programVFEState(commandStream, flags, 10);
@@ -294,7 +295,8 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandStreamReceiverFlushTaskGmockTests, givenPatch
DispatchFlags flags = DispatchFlagsHelper::createDefaultDispatchFlags();
mockCsr->requiredScratchSize = 0x200000;
MockOsContext osContext(0, 8, aub_stream::ENGINE_BCS, PreemptionMode::Disabled, false);
MockOsContext osContext(0, 8, aub_stream::ENGINE_BCS, PreemptionMode::Disabled,
false, false, false);
mockCsr->setupContext(osContext);
mockCsr->programVFEState(commandStream, flags, 10);
@@ -313,7 +315,8 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandStreamReceiverFlushTaskGmockTests, givenPatch
DispatchFlags flags = DispatchFlagsHelper::createDefaultDispatchFlags();
mockCsr->requiredScratchSize = 0x200000;
MockOsContext osContext(0, 8, aub_stream::ENGINE_BCS, PreemptionMode::Disabled, false);
MockOsContext osContext(0, 8, aub_stream::ENGINE_BCS, PreemptionMode::Disabled,
false, false, false);
mockCsr->setupContext(osContext);
mockCsr->programVFEState(commandStream, flags, 10);

View File

@@ -312,7 +312,8 @@ struct BcsTests : public CommandStreamReceiverHwTest {
auto contextId = engine->osContext->getContextId();
delete engine->osContext;
engine->osContext = OsContext::create(nullptr, contextId, 0, aub_stream::EngineType::ENGINE_BCS, PreemptionMode::Disabled, false);
engine->osContext = OsContext::create(nullptr, contextId, 0, aub_stream::EngineType::ENGINE_BCS, PreemptionMode::Disabled,
false, false, false);
engine->osContext->incRefInternal();
csr.setupContext(*engine->osContext);
@@ -637,7 +638,8 @@ HWTEST_F(BcsTests, givenInputAllocationsWhenBlitDispatchedThenMakeAllAllocations
HWTEST_F(BcsTests, givenFenceAllocationIsRequiredWhenBlitDispatchedThenMakeAllAllocationsResident) {
RAIIHwHelperFactory<MockHwHelperWithFenceAllocation<FamilyType>> hwHelperBackup{pDevice->getHardwareInfo().platform.eRenderCoreFamily};
auto bcsOsContext = std::unique_ptr<OsContext>(OsContext::create(nullptr, 0, 0, aub_stream::ENGINE_BCS, PreemptionMode::Disabled, false));
auto bcsOsContext = std::unique_ptr<OsContext>(OsContext::create(nullptr, 0, 0, aub_stream::ENGINE_BCS, PreemptionMode::Disabled,
false, false, false));
auto bcsCsr = std::make_unique<UltCommandStreamReceiver<FamilyType>>(*pDevice->getExecutionEnvironment(), pDevice->getRootDeviceIndex());
bcsCsr->setupContext(*bcsOsContext);
bcsCsr->initializeTagAllocation();

View File

@@ -716,7 +716,9 @@ HWTEST_F(SimulatedCommandStreamReceiverTest, givenCsrWithOsContextWhenGetDeviceI
executionEnvironment.prepareRootDeviceEnvironments(1);
executionEnvironment.initializeMemoryManager();
MockSimulatedCsrHw<FamilyType> csr(executionEnvironment, 0);
auto osContext = executionEnvironment.memoryManager->createAndRegisterOsContext(&csr, aub_stream::EngineType::ENGINE_RCS, 0b11, PreemptionMode::Disabled, false);
auto osContext = executionEnvironment.memoryManager->createAndRegisterOsContext(&csr, aub_stream::EngineType::ENGINE_RCS,
0b11, PreemptionMode::Disabled,
false, false, false);
csr.setupContext(*osContext);
EXPECT_EQ(1u, csr.getDeviceIndex());
@@ -727,7 +729,9 @@ HWTEST_F(SimulatedCommandStreamReceiverTest, givenOsContextWithNoDeviceBitfieldW
executionEnvironment.prepareRootDeviceEnvironments(1);
executionEnvironment.initializeMemoryManager();
MockSimulatedCsrHw<FamilyType> csr(executionEnvironment, 0);
auto osContext = executionEnvironment.memoryManager->createAndRegisterOsContext(&csr, aub_stream::EngineType::ENGINE_RCS, 0b00, PreemptionMode::Disabled, false);
auto osContext = executionEnvironment.memoryManager->createAndRegisterOsContext(&csr, aub_stream::EngineType::ENGINE_RCS,
0b00, PreemptionMode::Disabled,
false, false, false);
csr.setupContext(*osContext);
EXPECT_EQ(0u, csr.getDeviceIndex());

View File

@@ -124,7 +124,8 @@ struct CommandStreamReceiverWithAubDumpTest : public ::testing::TestWithParam<bo
auto osContext = executionEnvironment->memoryManager->createAndRegisterOsContext(csrWithAubDump,
getChosenEngineType(DEFAULT_TEST_PLATFORM::hwInfo), 1,
PreemptionHelper::getDefaultPreemptionMode(DEFAULT_TEST_PLATFORM::hwInfo), false);
PreemptionHelper::getDefaultPreemptionMode(DEFAULT_TEST_PLATFORM::hwInfo),
false, false, false);
csrWithAubDump->setupContext(*osContext);
}
@@ -149,7 +150,7 @@ HWTEST_F(CommandStreamReceiverWithAubDumpSimpleTest, givenCsrWithAubDumpWhenSett
auto hwInfo = executionEnvironment->rootDeviceEnvironments[0]->getHardwareInfo();
MockOsContext osContext(0, 1, HwHelper::get(hwInfo->platform.eRenderCoreFamily).getGpgpuEngineInstances(*hwInfo)[0],
PreemptionHelper::getDefaultPreemptionMode(*hwInfo), false);
PreemptionHelper::getDefaultPreemptionMode(*hwInfo), false, false, false);
csrWithAubDump.setupContext(osContext);
EXPECT_EQ(&osContext, &csrWithAubDump.getOsContext());

View File

@@ -372,7 +372,7 @@ HWTEST_F(TbxCommandStreamTests, givenDbgDeviceIdFlagIsSetWhenTbxCsrIsCreatedThen
HWTEST_F(TbxCommandSteamSimpleTest, givenTbxCsrWhenCallingMakeSurfacePackNonResidentThenOnlyResidentAllocationsAddedAllocationsForDownload) {
MockTbxCsr<FamilyType> tbxCsr{*pDevice->executionEnvironment};
MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false);
MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false);
tbxCsr.setupContext(osContext);
EXPECT_EQ(0u, tbxCsr.allocationsForDownload.size());
@@ -403,7 +403,7 @@ HWTEST_F(TbxCommandSteamSimpleTest, givenTbxCsrWhenCallingWaitForTaskCountWithKm
};
MockTbxCsr tbxCsr{*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()};
MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false);
MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false);
uint32_t tag = 0u;
tbxCsr.setupContext(osContext);
tbxCsr.setTagAllocation(pDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties(MockAllocationProperties{false, sizeof(tag)}, &tag));
@@ -455,7 +455,7 @@ HWTEST_F(TbxCommandStreamTests, givenTbxCommandStreamReceiverWhenItIsCreatedWith
HWTEST_F(TbxCommandStreamTests, givenTbxCommandStreamReceiverWhenFlushIsCalledThenItShouldCallTheExpectedHwContextFunctions) {
MockTbxCsr<FamilyType> tbxCsr(*pDevice->executionEnvironment);
MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false);
MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false);
tbxCsr.setupContext(osContext);
auto mockHardwareContext = static_cast<MockHardwareContext *>(tbxCsr.hardwareContextController->hardwareContexts[0].get());
@@ -482,7 +482,7 @@ HWTEST_F(TbxCommandStreamTests, givenTbxCommandStreamReceiverInBatchedModeWhenFl
DebugManager.flags.CsrDispatchMode.set(static_cast<uint32_t>(DispatchMode::BatchedDispatch));
MockTbxCsr<FamilyType> tbxCsr(*pDevice->executionEnvironment);
MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false);
MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false);
tbxCsr.setupContext(osContext);
auto commandBuffer = pDevice->executionEnvironment->memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{MemoryConstants::pageSize});
@@ -500,7 +500,7 @@ HWTEST_F(TbxCommandStreamTests, givenTbxCommandStreamReceiverInBatchedModeWhenFl
HWTEST_F(TbxCommandStreamTests, givenTbxCommandStreamReceiverWhenFlushIsCalledWithZeroSizedBufferThenSubmitIsNotCalledOnHwContext) {
MockTbxCsr<FamilyType> tbxCsr(*pDevice->executionEnvironment);
MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false);
MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false);
tbxCsr.setupContext(osContext);
auto mockHardwareContext = static_cast<MockHardwareContext *>(tbxCsr.hardwareContextController->hardwareContexts[0].get());
@@ -518,7 +518,7 @@ HWTEST_F(TbxCommandStreamTests, givenTbxCommandStreamReceiverWhenFlushIsCalledWi
HWTEST_F(TbxCommandStreamTests, givenTbxCommandStreamReceiverWhenMakeResidentIsCalledThenItShouldCallTheExpectedHwContextFunctions) {
MockTbxCsr<FamilyType> tbxCsr(*pDevice->executionEnvironment);
MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false);
MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false);
tbxCsr.setupContext(osContext);
MockGraphicsAllocation allocation(reinterpret_cast<void *>(0x1000), 0x1000);
@@ -530,7 +530,7 @@ HWTEST_F(TbxCommandStreamTests, givenTbxCommandStreamReceiverWhenMakeResidentIsC
HWTEST_F(TbxCommandStreamTests, givenTbxCommandStreamReceiverWhenDownloadAllocationIsCalledThenItShouldCallTheExpectedHwContextFunctions) {
MockTbxCsr<FamilyType> tbxCsr(*pDevice->executionEnvironment);
MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false);
MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false);
tbxCsr.setupContext(osContext);
auto mockHardwareContext = static_cast<MockHardwareContext *>(tbxCsr.hardwareContextController->hardwareContexts[0].get());
@@ -555,7 +555,7 @@ HWTEST_F(TbxCommandStreamTests, givenTbxCsrWhenHardwareContextIsCreatedThenTbxSt
HWTEST_F(TbxCommandStreamTests, givenTbxCsrWhenOsContextIsSetThenCreateHardwareContext) {
auto hwInfo = pDevice->getHardwareInfo();
MockOsContext osContext(0, 1, HwHelper::get(hwInfo.platform.eRenderCoreFamily).getGpgpuEngineInstances(hwInfo)[0],
PreemptionMode::Disabled, false);
PreemptionMode::Disabled, false, false, false);
std::string fileName = "";
MockAubManager *mockManager = new MockAubManager();
MockAubCenter *mockAubCenter = new MockAubCenter(&hwInfo, false, fileName, CommandStreamReceiverType::CSR_TBX);
@@ -657,7 +657,7 @@ HWTEST_F(TbxCommandStreamTests, givenTbxCsrWhenCreatedWithAubDumpSeveralTimesThe
HWTEST_F(TbxCommandStreamTests, givenTbxCsrInSubCaptureModeWhenFlushIsCalledAndSubCaptureIsDisabledThenPauseShouldBeTurnedOn) {
MockTbxCsr<FamilyType> tbxCsr{*pDevice->executionEnvironment};
MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false);
MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false);
tbxCsr.setupContext(osContext);
AubSubCaptureCommon aubSubCaptureCommon;
@@ -680,7 +680,7 @@ HWTEST_F(TbxCommandStreamTests, givenTbxCsrInSubCaptureModeWhenFlushIsCalledAndS
HWTEST_F(TbxCommandStreamTests, givenTbxCsrInSubCaptureModeWhenFlushIsCalledAndSubCaptureIsEnabledThenPauseShouldBeTurnedOff) {
MockTbxCsr<FamilyType> tbxCsr{*pDevice->executionEnvironment};
MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false);
MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false);
tbxCsr.setupContext(osContext);
AubSubCaptureCommon aubSubCaptureCommon;
@@ -704,7 +704,7 @@ HWTEST_F(TbxCommandStreamTests, givenTbxCsrInSubCaptureModeWhenFlushIsCalledAndS
HWTEST_F(TbxCommandStreamTests, givenTbxCsrInSubCaptureModeWhenFlushIsCalledAndSubCaptureIsEnabledThenCallPollForCompletionAndDisableSubCapture) {
MockTbxCsr<FamilyType> tbxCsr{*pDevice->executionEnvironment};
MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false);
MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false);
tbxCsr.setupContext(osContext);
AubSubCaptureCommon aubSubCaptureCommon;
@@ -728,7 +728,7 @@ HWTEST_F(TbxCommandStreamTests, givenTbxCsrInSubCaptureModeWhenFlushIsCalledAndS
HWTEST_F(TbxCommandStreamTests, givenTbxCsrInSubCaptureModeWhenFlushIsCalledAndSubCaptureGetsActivatedThenCallSubmitBatchBufferWithOverrideRingBufferSetToTrue) {
MockTbxCsr<FamilyType> tbxCsr{*pDevice->executionEnvironment};
MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false);
MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false);
tbxCsr.setupContext(osContext);
AubSubCaptureCommon aubSubCaptureCommon;
@@ -753,7 +753,7 @@ HWTEST_F(TbxCommandStreamTests, givenTbxCsrInSubCaptureModeWhenFlushIsCalledAndS
HWTEST_F(TbxCommandStreamTests, givenTbxCsrInSubCaptureModeWhenFlushIsCalledAndSubCaptureRemainsActiveThenCallSubmitBatchBufferWithOverrideRingBufferSetToTrue) {
MockTbxCsr<FamilyType> tbxCsr{*pDevice->executionEnvironment};
MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false);
MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false);
tbxCsr.setupContext(osContext);
AubSubCaptureCommon aubSubCaptureCommon;
@@ -819,7 +819,7 @@ HWTEST_F(TbxCommandStreamTests, givenTbxCsrWhenProcessResidencyIsCalledWithoutDu
HWTEST_F(TbxCommandStreamTests, givenTbxCsrInSubCaptureModeWhenCheckAndActivateAubSubCaptureIsCalledAndSubCaptureIsInactiveThenDontForceDumpingAllocationsTbxNonWritable) {
MockTbxCsr<FamilyType> tbxCsr{*pDevice->executionEnvironment};
MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false);
MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false);
tbxCsr.setupContext(osContext);
AubSubCaptureCommon aubSubCaptureCommon;
@@ -842,7 +842,7 @@ HWTEST_F(TbxCommandStreamTests, givenTbxCsrInSubCaptureModeWhenCheckAndActivateA
HWTEST_F(TbxCommandStreamTests, givenTbxCsrInSubCaptureModeWhenCheckAndActivateAubSubCaptureIsCalledAndSubCaptureGetsActivatedThenForceDumpingAllocationsTbxNonWritable) {
MockTbxCsr<FamilyType> tbxCsr{*pDevice->executionEnvironment};
MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false);
MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false);
tbxCsr.setupContext(osContext);
AubSubCaptureCommon aubSubCaptureCommon;
@@ -867,7 +867,7 @@ HWTEST_F(TbxCommandStreamTests, givenTbxCsrInSubCaptureModeWhenCheckAndActivateA
HWTEST_F(TbxCommandStreamTests, givenTbxCsrInSubCaptureModeWhenCheckAndActivateAubSubCaptureIsCalledAndSubCaptureRemainsActivatedThenDontForceDumpingAllocationsTbxNonWritable) {
MockTbxCsr<FamilyType> tbxCsr{*pDevice->executionEnvironment};
MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false);
MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false);
tbxCsr.setupContext(osContext);
AubSubCaptureCommon aubSubCaptureCommon;
@@ -892,7 +892,7 @@ HWTEST_F(TbxCommandStreamTests, givenTbxCsrInSubCaptureModeWhenCheckAndActivateA
HWTEST_F(TbxCommandStreamTests, givenTbxCsrInNonSubCaptureModeWhenCheckAndActivateAubSubCaptureIsCalledThenReturnStatusInactive) {
MockTbxCsr<FamilyType> tbxCsr{*pDevice->executionEnvironment};
MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false);
MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false);
tbxCsr.setupContext(osContext);
MultiDispatchInfo dispatchInfo;
@@ -913,11 +913,11 @@ HWTEST_F(TbxCommandStreamTests, givenTbxCsrWhenDispatchBlitEnqueueThenProcessCor
MockTbxCsr<FamilyType> tbxCsr1{*pDevice->executionEnvironment};
tbxCsr1.initializeTagAllocation();
MockOsContext osContext0(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false);
MockOsContext osContext0(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false);
tbxCsr0.setupContext(osContext0);
EngineControl engineControl0{&tbxCsr0, &osContext0};
MockOsContext osContext1(1, 1, aub_stream::ENGINE_BCS, PreemptionMode::Disabled, false);
MockOsContext osContext1(1, 1, aub_stream::ENGINE_BCS, PreemptionMode::Disabled, false, false, false);
tbxCsr1.setupContext(osContext0);
EngineControl engineControl1{&tbxCsr1, &osContext1};

View File

@@ -31,7 +31,9 @@ class MemoryAllocatorFixture : public MemoryManagementFixture {
csr = &device->getGpgpuCommandStreamReceiver();
auto &hwInfo = device->getHardwareInfo();
auto engineType = HwHelper::get(hwInfo.platform.eRenderCoreFamily).getGpgpuEngineInstances(hwInfo)[0];
auto osContext = memoryManager->createAndRegisterOsContext(csr, engineType, 1, PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]), false);
auto osContext = memoryManager->createAndRegisterOsContext(csr, engineType, 1,
PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]),
false, false, false);
csr->setupContext(*osContext);
}

View File

@@ -25,7 +25,9 @@ void MemoryManagerWithCsrFixture::SetUp() {
csr->tagAddress = &currentGpuTag;
auto hwInfo = executionEnvironment.rootDeviceEnvironments[0]->getHardwareInfo();
auto engine = HwHelper::get(hwInfo->platform.eRenderCoreFamily).getGpgpuEngineInstances(*hwInfo)[0];
auto osContext = memoryManager->createAndRegisterOsContext(csr.get(), engine, 1, PreemptionHelper::getDefaultPreemptionMode(*hwInfo), false);
auto osContext = memoryManager->createAndRegisterOsContext(csr.get(), engine, 1,
PreemptionHelper::getDefaultPreemptionMode(*hwInfo),
false, false, false);
csr->setupContext(*osContext);
}

View File

@@ -23,8 +23,8 @@ using Gen12LPAubCommandStreamReceiverTests = Test<DeviceFixture>;
GEN12LPTEST_F(Gen12LPAubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenGetGUCWorkQueueItemHeaderIsCalledThenAppropriateValueDependingOnEngineTypeIsReturned) {
std::unique_ptr<AUBCommandStreamReceiverHw<FamilyType>> aubCsr(new AUBCommandStreamReceiverHw<FamilyType>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()));
MockOsContext rcsOsContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false);
MockOsContext ccsOsContext(0, 1, aub_stream::ENGINE_CCS, PreemptionMode::Disabled, false);
MockOsContext rcsOsContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false);
MockOsContext ccsOsContext(0, 1, aub_stream::ENGINE_CCS, PreemptionMode::Disabled, false, false, false);
aubCsr->setupContext(ccsOsContext);
uint32_t headerCCS = aubCsr->getGUCWorkQueueItemHeader();
@@ -45,7 +45,7 @@ GEN12LPTEST_F(Gen12LPAubCommandStreamReceiverTests, givenGraphicsAlloctionWhenGe
}
GEN12LPTEST_F(Gen12LPAubCommandStreamReceiverTests, givenCCSEnabledWhenEngineMmiosAreInitializedThenExpectL3ConfigMmioIsWritten) {
MockOsContext osContext(0, 1, aub_stream::ENGINE_CCS, PreemptionMode::Disabled, false);
MockOsContext osContext(0, 1, aub_stream::ENGINE_CCS, PreemptionMode::Disabled, false, false, false);
AUBCommandStreamReceiverHw<FamilyType> aubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex());
aubCsr.setupContext(osContext);
@@ -58,7 +58,7 @@ GEN12LPTEST_F(Gen12LPAubCommandStreamReceiverTests, givenCCSEnabledWhenEngineMmi
}
GEN12LPTEST_F(Gen12LPAubCommandStreamReceiverTests, givenRCSEnabledWhenEngineMmiosAreInitializedThenExpectL3ConfigMmioIsWritten) {
MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false);
MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false);
AUBCommandStreamReceiverHw<FamilyType> aubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex());
aubCsr.setupContext(osContext);

View File

@@ -655,7 +655,8 @@ struct BcsBufferTests : public ::testing::Test {
class BcsMockContext : public MockContext {
public:
BcsMockContext(ClDevice *device) : MockContext(device) {
bcsOsContext.reset(OsContext::create(nullptr, 0, 0, aub_stream::ENGINE_BCS, PreemptionMode::Disabled, false));
bcsOsContext.reset(OsContext::create(nullptr, 0, 0, aub_stream::ENGINE_BCS, PreemptionMode::Disabled,
false, false, false));
bcsCsr.reset(createCommandStream(*device->getExecutionEnvironment(), device->getRootDeviceIndex()));
bcsCsr->setupContext(*bcsOsContext);
bcsCsr->initializeTagAllocation();
@@ -717,7 +718,8 @@ struct BcsBufferTests : public ::testing::Test {
if (createBcsEngine) {
auto &engine = device->getEngine(HwHelperHw<FamilyType>::lowPriorityEngineType, true);
bcsOsContext.reset(OsContext::create(nullptr, 1, 0, aub_stream::ENGINE_BCS, PreemptionMode::Disabled, false));
bcsOsContext.reset(OsContext::create(nullptr, 1, 0, aub_stream::ENGINE_BCS, PreemptionMode::Disabled,
false, false, false));
engine.osContext = bcsOsContext.get();
engine.commandStreamReceiver->setupContext(*bcsOsContext);
}

View File

@@ -331,7 +331,10 @@ HWTEST_F(UsmDestructionTests, givenSharedUsmAllocationWhenBlockingFreeIsCalledTh
}
auto mockCsr = new ::testing::NiceMock<MyCsr<FamilyType>>(*mockDevice.executionEnvironment);
auto osContext = mockDevice.executionEnvironment->memoryManager->createAndRegisterOsContext(mockDevice.engines[0].commandStreamReceiver, aub_stream::ENGINE_RCS, {}, PreemptionMode::Disabled, false);
auto osContext = mockDevice.executionEnvironment->memoryManager->createAndRegisterOsContext(mockDevice.engines[0].commandStreamReceiver,
aub_stream::ENGINE_RCS, {},
PreemptionMode::Disabled,
false, false, false);
mockDevice.engines[0].osContext = osContext;
mockDevice.resetCommandStreamReceiver(mockCsr);
@@ -367,7 +370,10 @@ HWTEST_F(UsmDestructionTests, givenUsmAllocationWhenBlockingFreeIsCalledThenWait
}
auto mockCsr = new ::testing::NiceMock<MyCsr<FamilyType>>(*mockDevice.executionEnvironment);
auto osContext = mockDevice.executionEnvironment->memoryManager->createAndRegisterOsContext(mockDevice.engines[0].commandStreamReceiver, aub_stream::ENGINE_RCS, {}, PreemptionMode::Disabled, false);
auto osContext = mockDevice.executionEnvironment->memoryManager->createAndRegisterOsContext(mockDevice.engines[0].commandStreamReceiver,
aub_stream::ENGINE_RCS, {},
PreemptionMode::Disabled,
false, false, false);
mockDevice.engines[0].osContext = osContext;
mockDevice.resetCommandStreamReceiver(mockCsr);

View File

@@ -867,7 +867,8 @@ HWTEST_F(HostPtrAllocationTest, givenOverlappingFragmentsWhenCheckIsCalledThenWa
uint32_t csr1GpuTag = taskCountNotReady;
csr0->tagAddress = &csr0GpuTag;
csr1->tagAddress = &csr1GpuTag;
auto osContext = memoryManager->createAndRegisterOsContext(csr1.get(), aub_stream::EngineType::ENGINE_RCS, 0, PreemptionMode::Disabled, true);
auto osContext = memoryManager->createAndRegisterOsContext(csr1.get(), aub_stream::EngineType::ENGINE_RCS, 0, PreemptionMode::Disabled,
true, false, false);
csr1->setupContext(*osContext);
void *cpuPtr = reinterpret_cast<void *>(0x100004);

View File

@@ -200,7 +200,8 @@ TEST_F(MemoryAllocatorTest, allocateGraphics) {
memoryManager->createAndRegisterOsContext(csr,
HwHelper::get(platformDevices[0]->platform.eRenderCoreFamily).getGpgpuEngineInstances(*platformDevices[0])[0],
1, PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]), false);
1, PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]),
false, false, false);
auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{MemoryConstants::pageSize});
ASSERT_NE(nullptr, allocation);
@@ -1410,7 +1411,8 @@ TEST_F(MemoryManagerWithCsrTest, givenAllocationThatWasUsedAndIsCompletedWhenche
TEST_F(MemoryManagerWithCsrTest, givenAllocationThatWasUsedAndIsNotCompletedWhencheckGpuUsageAndDestroyGraphicsAllocationsIsCalledThenItIsAddedToTemporaryAllocationList) {
memoryManager->createAndRegisterOsContext(csr.get(),
HwHelper::get(platformDevices[0]->platform.eRenderCoreFamily).getGpgpuEngineInstances(*platformDevices[0])[0],
1, PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]), false);
1, PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]),
false, false, false);
auto usedAllocationAndNotGpuCompleted = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{MemoryConstants::pageSize});
auto tagAddress = csr->getTagAddress();
@@ -1661,7 +1663,8 @@ TEST(ResidencyDataTest, givenOsContextWhenItIsRegisteredToMemoryManagerThenRefCo
std::unique_ptr<CommandStreamReceiver> csr(createCommandStream(executionEnvironment, 0u));
memoryManager->createAndRegisterOsContext(csr.get(),
HwHelper::get(platformDevices[0]->platform.eRenderCoreFamily).getGpgpuEngineInstances(*platformDevices[0])[0],
1, PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]), false);
1, PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]),
false, false, false);
EXPECT_EQ(1u, memoryManager->getRegisteredEnginesCount());
EXPECT_EQ(1, memoryManager->registeredEngines[0].osContext->getRefInternalCount());
}
@@ -1689,7 +1692,8 @@ TEST(ResidencyDataTest, givenDeviceBitfieldWhenCreatingOsContextThenSetValidValu
PreemptionMode preemptionMode = PreemptionMode::MidThread;
memoryManager->createAndRegisterOsContext(csr.get(),
HwHelper::get(platformDevices[0]->platform.eRenderCoreFamily).getGpgpuEngineInstances(*platformDevices[0])[0],
deviceBitfield, preemptionMode, false);
deviceBitfield, preemptionMode,
false, false, false);
EXPECT_EQ(2u, memoryManager->registeredEngines[0].osContext->getNumSupportedDevices());
EXPECT_EQ(deviceBitfield, memoryManager->registeredEngines[0].osContext->getDeviceBitfield());
EXPECT_EQ(preemptionMode, memoryManager->registeredEngines[0].osContext->getPreemptionMode());
@@ -1703,10 +1707,12 @@ TEST(ResidencyDataTest, givenTwoOsContextsWhenTheyAreRegisteredFromHigherToLower
std::unique_ptr<CommandStreamReceiver> csr1(createCommandStream(executionEnvironment, 1u));
memoryManager->createAndRegisterOsContext(csr.get(),
HwHelper::get(platformDevices[0]->platform.eRenderCoreFamily).getGpgpuEngineInstances(*platformDevices[0])[0],
1, PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]), false);
1, PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]),
false, false, false);
memoryManager->createAndRegisterOsContext(csr1.get(),
HwHelper::get(platformDevices[0]->platform.eRenderCoreFamily).getGpgpuEngineInstances(*platformDevices[0])[1],
1, PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]), false);
1, PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]),
false, false, false);
EXPECT_EQ(2u, memoryManager->getRegisteredEnginesCount());
EXPECT_EQ(1, memoryManager->registeredEngines[0].osContext->getRefInternalCount());
EXPECT_EQ(1, memoryManager->registeredEngines[1].osContext->getRefInternalCount());
@@ -1726,10 +1732,10 @@ TEST(ResidencyDataTest, givenResidencyDataWhenUpdateCompletionDataIsCalledThenIt
MockOsContext osContext(0u, 1,
HwHelper::get(platformDevices[0]->platform.eRenderCoreFamily).getGpgpuEngineInstances(*platformDevices[0])[0],
PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]), false);
PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]), false, false, false);
MockOsContext osContext2(1u, 1,
HwHelper::get(platformDevices[0]->platform.eRenderCoreFamily).getGpgpuEngineInstances(*platformDevices[0])[1],
PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]), false);
PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]), false, false, false);
auto lastFenceValue = 45llu;
auto lastFenceValue2 = 23llu;

View File

@@ -66,7 +66,9 @@ HWTEST_TYPED_TEST(SurfaceTest, GivenSurfaceWhenInterfaceIsUsedThenSurfaceBehaves
auto csr = std::make_unique<MockCsr<FamilyType>>(execStamp, *executionEnvironment, 0);
auto hwInfo = *platformDevices[0];
auto engine = HwHelper::get(hwInfo.platform.eRenderCoreFamily).getGpgpuEngineInstances(hwInfo)[0];
auto osContext = executionEnvironment->memoryManager->createAndRegisterOsContext(csr.get(), engine, 1, PreemptionHelper::getDefaultPreemptionMode(hwInfo), false);
auto osContext = executionEnvironment->memoryManager->createAndRegisterOsContext(csr.get(), engine, 1,
PreemptionHelper::getDefaultPreemptionMode(hwInfo),
false, false, false);
csr->setupContext(*osContext);
Surface *surface = createSurface::Create<TypeParam>(this->data,

View File

@@ -193,7 +193,8 @@ std::unique_ptr<AubExecutionEnvironment> getEnvironment(bool createTagAllocation
auto osContext = executionEnvironment->memoryManager->createAndRegisterOsContext(commandStreamReceiver.get(),
getChosenEngineType(*platformDevices[0]), 1,
PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]), false);
PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]),
false, false, false);
commandStreamReceiver->setupContext(*osContext);
std::unique_ptr<AubExecutionEnvironment> aubExecutionEnvironment(new AubExecutionEnvironment);

View File

@@ -12,7 +12,9 @@ namespace NEO {
class MockOsContext : public OsContext {
public:
MockOsContext(uint32_t contextId, DeviceBitfield deviceBitfield,
aub_stream::EngineType engineType, PreemptionMode preemptionMode, bool lowPriority)
: OsContext(contextId, deviceBitfield, engineType, preemptionMode, lowPriority) {}
aub_stream::EngineType engineType, PreemptionMode preemptionMode,
bool lowPriority, bool internalEngine, bool rootDevice)
: OsContext(contextId, deviceBitfield, engineType, preemptionMode,
lowPriority, internalEngine, rootDevice) {}
};
} // namespace NEO

View File

@@ -37,7 +37,8 @@ class DrmCommandStreamTest : public ::testing::Test {
auto hwInfo = executionEnvironment.getHardwareInfo();
osContext = std::make_unique<OsContextLinux>(*mock, 0u, 1, HwHelper::get(hwInfo->platform.eRenderCoreFamily).getGpgpuEngineInstances(*hwInfo)[0],
PreemptionHelper::getDefaultPreemptionMode(*hwInfo), false);
PreemptionHelper::getDefaultPreemptionMode(*hwInfo),
false, false, false);
csr = new DrmCommandStreamReceiver<GfxFamily>(executionEnvironment, 0, gemCloseWorkerMode::gemCloseWorkerActive);
ASSERT_NE(nullptr, csr);

View File

@@ -213,7 +213,8 @@ HWTEST_TEMPLATED_F(DrmCommandStreamTest, givenDrmContextIdWhenFlushingThenSetIdT
osContext = std::make_unique<OsContextLinux>(*mock, 1, 1,
HwHelper::get(platformDevices[0]->platform.eRenderCoreFamily).getGpgpuEngineInstances(*platformDevices[0])[0],
PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]), false);
PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]),
false, false, false);
csr->setupContext(*osContext);
auto &cs = csr->getCS();

View File

@@ -178,7 +178,7 @@ TEST(DrmTest, givenDrmWhenOsContextIsCreatedThenCreateAndDestroyNewDrmOsContext)
{
drmMock.StoredCtxId = drmContextId1;
OsContextLinux osContext1(drmMock, 0u, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false);
OsContextLinux osContext1(drmMock, 0u, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false);
EXPECT_EQ(1u, osContext1.getDrmContextIds().size());
EXPECT_EQ(drmContextId1, osContext1.getDrmContextIds()[0]);
@@ -186,7 +186,7 @@ TEST(DrmTest, givenDrmWhenOsContextIsCreatedThenCreateAndDestroyNewDrmOsContext)
{
drmMock.StoredCtxId = drmContextId2;
OsContextLinux osContext2(drmMock, 0u, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false);
OsContextLinux osContext2(drmMock, 0u, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false);
EXPECT_EQ(1u, osContext2.getDrmContextIds().size());
EXPECT_EQ(drmContextId2, osContext2.getDrmContextIds()[0]);
EXPECT_EQ(0u, drmMock.receivedDestroyContextId);
@@ -209,14 +209,14 @@ TEST(DrmTest, givenDrmAndNegativeCheckNonPersistentContextsSupportWhenOsContextI
drmMock.StoredRetValForPersistant = -1;
drmMock.checkNonPersistentContextsSupport();
++expectedCount;
OsContextLinux osContext(drmMock, 0u, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false);
OsContextLinux osContext(drmMock, 0u, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false);
EXPECT_EQ(expectedCount, drmMock.receivedContextParamRequestCount);
}
{
drmMock.StoredRetValForPersistant = 0;
drmMock.checkNonPersistentContextsSupport();
++expectedCount;
OsContextLinux osContext(drmMock, 0u, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false);
OsContextLinux osContext(drmMock, 0u, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false);
++expectedCount;
EXPECT_EQ(expectedCount, drmMock.receivedContextParamRequestCount);
}
@@ -227,17 +227,17 @@ TEST(DrmTest, givenDrmPreemptionEnabledAndLowPriorityEngineWhenCreatingOsContext
drmMock.StoredCtxId = 123;
drmMock.preemptionSupported = false;
OsContextLinux osContext1(drmMock, 0u, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false);
OsContextLinux osContext2(drmMock, 0u, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, true);
OsContextLinux osContext1(drmMock, 0u, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false);
OsContextLinux osContext2(drmMock, 0u, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, true, false, false);
EXPECT_EQ(0u, drmMock.receivedContextParamRequestCount);
drmMock.preemptionSupported = true;
OsContextLinux osContext3(drmMock, 0u, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false);
OsContextLinux osContext3(drmMock, 0u, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false);
EXPECT_EQ(0u, drmMock.receivedContextParamRequestCount);
OsContextLinux osContext4(drmMock, 0u, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, true);
OsContextLinux osContext4(drmMock, 0u, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, true, false, false);
EXPECT_EQ(1u, drmMock.receivedContextParamRequestCount);
EXPECT_EQ(drmMock.StoredCtxId, drmMock.receivedContextParamRequest.ctx_id);
EXPECT_EQ(static_cast<uint64_t>(I915_CONTEXT_PARAM_PRIORITY), drmMock.receivedContextParamRequest.param);

View File

@@ -12,7 +12,18 @@
using namespace NEO;
TEST(OSContext, whenCreatingDefaultOsContextThenExpectInitializedAlways) {
OsContext *osContext = OsContext::create(nullptr, 0, 0, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false);
OsContext *osContext = OsContext::create(nullptr, 0, 0, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false);
EXPECT_TRUE(osContext->isInitialized());
EXPECT_FALSE(osContext->isLowPriority());
EXPECT_FALSE(osContext->isInternalEngine());
EXPECT_FALSE(osContext->isRootDevice());
delete osContext;
}
TEST(OSContext, givenLowPriorityRootDeviceInternalAreTrueWhenCreatingDefaultOsContextThenExpectGettersTrue) {
OsContext *osContext = OsContext::create(nullptr, 0, 0, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, true, true, true);
EXPECT_TRUE(osContext->isLowPriority());
EXPECT_TRUE(osContext->isInternalEngine());
EXPECT_TRUE(osContext->isRootDevice());
delete osContext;
}

View File

@@ -67,7 +67,8 @@ class WddmCommandStreamFixture {
executionEnvironment->memoryManager.reset(memoryManager);
wddm = static_cast<WddmMock *>(executionEnvironment->rootDeviceEnvironments[0]->osInterface->get()->getWddm());
osContext.reset(OsContext::create(executionEnvironment->rootDeviceEnvironments[0]->osInterface.get(),
0, 0, aub_stream::ENGINE_RCS, PreemptionMode::ThreadGroup, false));
0, 0, aub_stream::ENGINE_RCS, PreemptionMode::ThreadGroup,
false, false, false));
csr = new WddmCommandStreamReceiver<DEFAULT_TEST_FAMILY_NAME>(*executionEnvironment, 0);
device.reset(MockDevice::create<MockDevice>(executionEnvironment, 0u));
@@ -249,7 +250,8 @@ TEST(WddmPreemptionHeaderTests, givenWddmCommandStreamReceiverWhenPreemptionIsOf
executionEnvironment->memoryManager.reset(new MemoryManagerCreate<WddmMemoryManager>(false, false, *executionEnvironment));
csr->overrideDispatchPolicy(DispatchMode::ImmediateDispatch);
OsContextWin osContext(*wddm, 0u, 1, HwHelper::get(hwInfo->platform.eRenderCoreFamily).getGpgpuEngineInstances(*hwInfo)[0],
PreemptionHelper::getDefaultPreemptionMode(*hwInfo), false);
PreemptionHelper::getDefaultPreemptionMode(*hwInfo),
false, false, false);
csr->setupContext(osContext);
auto commandBuffer = executionEnvironment->memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{MemoryConstants::pageSize});
@@ -274,7 +276,8 @@ TEST(WddmPreemptionHeaderTests, givenWddmCommandStreamReceiverWhenPreemptionIsOn
executionEnvironment->memoryManager.reset(new MemoryManagerCreate<WddmMemoryManager>(false, false, *executionEnvironment));
csr->overrideDispatchPolicy(DispatchMode::ImmediateDispatch);
OsContextWin osContext(*wddm, 0u, 1, HwHelper::get(hwInfo->platform.eRenderCoreFamily).getGpgpuEngineInstances(*hwInfo)[0],
PreemptionHelper::getDefaultPreemptionMode(*hwInfo), false);
PreemptionHelper::getDefaultPreemptionMode(*hwInfo),
false, false, false);
csr->setupContext(osContext);
auto commandBuffer = executionEnvironment->memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{MemoryConstants::pageSize});
@@ -964,7 +967,8 @@ TEST_F(WddmCommandStreamTest, whenDirectSubmissionEnabledOnBcsThenExpectFeatureA
DebugManager.flags.EnableDirectSubmission.set(1);
osContext.reset(OsContext::create(device->getExecutionEnvironment()->rootDeviceEnvironments[0]->osInterface.get(),
0, 0, aub_stream::ENGINE_BCS, PreemptionMode::ThreadGroup, false));
0, 0, aub_stream::ENGINE_BCS, PreemptionMode::ThreadGroup,
false, false, false));
auto hwInfo = device->getExecutionEnvironment()->getMutableHardwareInfo();
hwInfo->capabilityTable.directSubmissionEngines.data[aub_stream::ENGINE_BCS].engineSupported = true;
@@ -978,7 +982,8 @@ TEST_F(WddmCommandStreamTest, givenDirectSubmissionEnabledWhenPlatformNotSupport
DebugManager.flags.EnableDirectSubmission.set(1);
osContext.reset(OsContext::create(device->getExecutionEnvironment()->rootDeviceEnvironments[0]->osInterface.get(),
0, 0, aub_stream::ENGINE_BCS, PreemptionMode::ThreadGroup, false));
0, 0, aub_stream::ENGINE_BCS, PreemptionMode::ThreadGroup,
false, false, false));
auto hwInfo = device->getExecutionEnvironment()->getMutableHardwareInfo();
hwInfo->capabilityTable.directSubmissionEngines.data[aub_stream::ENGINE_BCS].engineSupported = false;
@@ -987,3 +992,98 @@ TEST_F(WddmCommandStreamTest, givenDirectSubmissionEnabledWhenPlatformNotSupport
EXPECT_TRUE(ret);
EXPECT_FALSE(csr->isDirectSubmissionEnabled());
}
TEST_F(WddmCommandStreamTest, givenLowPriorityContextWhenDirectSubmissionDisabledOnLowPriorityThenExpectFeatureNotAvailable) {
DebugManager.flags.EnableDirectSubmission.set(1);
osContext.reset(OsContext::create(device->getExecutionEnvironment()->rootDeviceEnvironments[0]->osInterface.get(),
0, 0, aub_stream::ENGINE_RCS, PreemptionMode::ThreadGroup,
true, false, false));
auto hwInfo = device->getExecutionEnvironment()->getMutableHardwareInfo();
hwInfo->capabilityTable.directSubmissionEngines.data[aub_stream::ENGINE_RCS].engineSupported = true;
hwInfo->capabilityTable.directSubmissionEngines.data[aub_stream::ENGINE_RCS].useLowPriority = false;
bool ret = csr->initDirectSubmission(*device.get(), *osContext.get());
EXPECT_TRUE(ret);
EXPECT_FALSE(csr->isDirectSubmissionEnabled());
}
TEST_F(WddmCommandStreamTest, givenLowPriorityContextWhenDirectSubmissionEnabledOnLowPriorityThenExpectFeatureAvailable) {
DebugManager.flags.EnableDirectSubmission.set(1);
osContext.reset(OsContext::create(device->getExecutionEnvironment()->rootDeviceEnvironments[0]->osInterface.get(),
0, 0, aub_stream::ENGINE_RCS, PreemptionMode::ThreadGroup,
true, false, false));
auto hwInfo = device->getExecutionEnvironment()->getMutableHardwareInfo();
hwInfo->capabilityTable.directSubmissionEngines.data[aub_stream::ENGINE_RCS].engineSupported = true;
hwInfo->capabilityTable.directSubmissionEngines.data[aub_stream::ENGINE_RCS].useLowPriority = true;
bool ret = csr->initDirectSubmission(*device.get(), *osContext.get());
EXPECT_TRUE(ret);
EXPECT_TRUE(csr->isDirectSubmissionEnabled());
}
TEST_F(WddmCommandStreamTest, givenInternalContextWhenDirectSubmissionDisabledOnInternalThenExpectFeatureNotAvailable) {
DebugManager.flags.EnableDirectSubmission.set(1);
osContext.reset(OsContext::create(device->getExecutionEnvironment()->rootDeviceEnvironments[0]->osInterface.get(),
0, 0, aub_stream::ENGINE_RCS, PreemptionMode::ThreadGroup,
false, true, false));
auto hwInfo = device->getExecutionEnvironment()->getMutableHardwareInfo();
hwInfo->capabilityTable.directSubmissionEngines.data[aub_stream::ENGINE_RCS].engineSupported = true;
hwInfo->capabilityTable.directSubmissionEngines.data[aub_stream::ENGINE_RCS].useInternal = false;
bool ret = csr->initDirectSubmission(*device.get(), *osContext.get());
EXPECT_TRUE(ret);
EXPECT_FALSE(csr->isDirectSubmissionEnabled());
}
TEST_F(WddmCommandStreamTest, givenInternalContextWhenDirectSubmissionEnabledOnInternalThenExpectFeatureAvailable) {
DebugManager.flags.EnableDirectSubmission.set(1);
osContext.reset(OsContext::create(device->getExecutionEnvironment()->rootDeviceEnvironments[0]->osInterface.get(),
0, 0, aub_stream::ENGINE_RCS, PreemptionMode::ThreadGroup,
false, true, false));
auto hwInfo = device->getExecutionEnvironment()->getMutableHardwareInfo();
hwInfo->capabilityTable.directSubmissionEngines.data[aub_stream::ENGINE_RCS].engineSupported = true;
hwInfo->capabilityTable.directSubmissionEngines.data[aub_stream::ENGINE_RCS].useInternal = true;
bool ret = csr->initDirectSubmission(*device.get(), *osContext.get());
EXPECT_TRUE(ret);
EXPECT_TRUE(csr->isDirectSubmissionEnabled());
}
TEST_F(WddmCommandStreamTest, givenRootDeviceContextWhenDirectSubmissionDisabledOnRootDeviceThenExpectFeatureNotAvailable) {
DebugManager.flags.EnableDirectSubmission.set(1);
osContext.reset(OsContext::create(device->getExecutionEnvironment()->rootDeviceEnvironments[0]->osInterface.get(),
0, 0, aub_stream::ENGINE_RCS, PreemptionMode::ThreadGroup,
false, false, true));
auto hwInfo = device->getExecutionEnvironment()->getMutableHardwareInfo();
hwInfo->capabilityTable.directSubmissionEngines.data[aub_stream::ENGINE_RCS].engineSupported = true;
hwInfo->capabilityTable.directSubmissionEngines.data[aub_stream::ENGINE_RCS].useRootDevice = false;
bool ret = csr->initDirectSubmission(*device.get(), *osContext.get());
EXPECT_TRUE(ret);
EXPECT_FALSE(csr->isDirectSubmissionEnabled());
}
TEST_F(WddmCommandStreamTest, givenRootDeviceContextWhenDirectSubmissionEnabledOnRootDeviceThenExpectFeatureAvailable) {
DebugManager.flags.EnableDirectSubmission.set(1);
osContext.reset(OsContext::create(device->getExecutionEnvironment()->rootDeviceEnvironments[0]->osInterface.get(),
0, 0, aub_stream::ENGINE_RCS, PreemptionMode::ThreadGroup,
false, false, true));
auto hwInfo = device->getExecutionEnvironment()->getMutableHardwareInfo();
hwInfo->capabilityTable.directSubmissionEngines.data[aub_stream::ENGINE_RCS].engineSupported = true;
hwInfo->capabilityTable.directSubmissionEngines.data[aub_stream::ENGINE_RCS].useRootDevice = true;
bool ret = csr->initDirectSubmission(*device.get(), *osContext.get());
EXPECT_TRUE(ret);
EXPECT_TRUE(csr->isDirectSubmissionEnabled());
}

View File

@@ -333,7 +333,8 @@ TEST_F(GlArbSyncEventOsTest, GivenCallToSignalArbSyncObjectWhenSignalSynchroniza
auto preemptionMode = PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]);
wddm->init();
OsContextWin osContext(*osInterface.get()->getWddm(), 0u, 1,
HwHelper::get(platformDevices[0]->platform.eRenderCoreFamily).getGpgpuEngineInstances(*platformDevices[0])[0], preemptionMode, false);
HwHelper::get(platformDevices[0]->platform.eRenderCoreFamily).getGpgpuEngineInstances(*platformDevices[0])[0],
preemptionMode, false, false, false);
CL_GL_SYNC_INFO syncInfo = {};
syncInfo.serverSynchronizationObject = 0x5cU;
@@ -393,7 +394,8 @@ TEST_F(GlArbSyncEventOsTest, GivenCallToSignalArbSyncObjectWhenSignalSynchroniza
auto preemptionMode = PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]);
wddm->init();
OsContextWin osContext(*osInterface.get()->getWddm(), 0u, 1,
HwHelper::get(platformDevices[0]->platform.eRenderCoreFamily).getGpgpuEngineInstances(*platformDevices[0])[0], preemptionMode, false);
HwHelper::get(platformDevices[0]->platform.eRenderCoreFamily).getGpgpuEngineInstances(*platformDevices[0])[0],
preemptionMode, false, false, false);
CL_GL_SYNC_INFO syncInfo = {};
syncInfo.submissionSynchronizationObject = 0x7cU;

View File

@@ -26,28 +26,28 @@ struct OsContextWinTest : public WddmTestWithMockGdiDll {
};
TEST_F(OsContextWinTest, givenWddm20WhenCreatingOsContextThenOsContextIsInitialized) {
osContext = std::make_unique<OsContextWin>(*osInterface->get()->getWddm(), 0u, 1, engineType, preemptionMode, false);
osContext = std::make_unique<OsContextWin>(*osInterface->get()->getWddm(), 0u, 1, engineType, preemptionMode, false, false, false);
EXPECT_TRUE(osContext->isInitialized());
}
TEST_F(OsContextWinTest, givenWddm20WhenCreatingWddmContextFailThenOsContextIsNotInitialized) {
wddm->device = INVALID_HANDLE;
osContext = std::make_unique<OsContextWin>(*osInterface->get()->getWddm(), 0u, 1, engineType, preemptionMode, false);
osContext = std::make_unique<OsContextWin>(*osInterface->get()->getWddm(), 0u, 1, engineType, preemptionMode, false, false, false);
EXPECT_FALSE(osContext->isInitialized());
}
TEST_F(OsContextWinTest, givenWddm20WhenCreatingWddmMonitorFenceFailThenOsContextIsNotInitialized) {
*getCreateSynchronizationObject2FailCallFcn() = true;
osContext = std::make_unique<OsContextWin>(*osInterface->get()->getWddm(), 0u, 1, engineType, preemptionMode, false);
osContext = std::make_unique<OsContextWin>(*osInterface->get()->getWddm(), 0u, 1, engineType, preemptionMode, false, false, false);
EXPECT_FALSE(osContext->isInitialized());
}
TEST_F(OsContextWinTest, givenWddm20WhenRegisterTrimCallbackFailThenOsContextIsNotInitialized) {
*getRegisterTrimNotificationFailCallFcn() = true;
osContext = std::make_unique<OsContextWin>(*osInterface->get()->getWddm(), 0u, 1, engineType, preemptionMode, false);
osContext = std::make_unique<OsContextWin>(*osInterface->get()->getWddm(), 0u, 1, engineType, preemptionMode, false, false, false);
EXPECT_FALSE(osContext->isInitialized());
}
@@ -56,6 +56,6 @@ TEST_F(OsContextWinTest, givenWddm20WhenRegisterTrimCallbackIsDisabledThenOsCont
DebugManager.flags.DoNotRegisterTrimCallback.set(true);
*getRegisterTrimNotificationFailCallFcn() = true;
osContext = std::make_unique<OsContextWin>(*osInterface->get()->getWddm(), 0u, 1, engineType, preemptionMode, false);
osContext = std::make_unique<OsContextWin>(*osInterface->get()->getWddm(), 0u, 1, engineType, preemptionMode, false, false, false);
EXPECT_TRUE(osContext->isInitialized());
}

View File

@@ -33,7 +33,9 @@ TEST(OsContextTest, givenWddmWhenCreateOsContextAfterInitWddmThenOsContextIsInit
auto preemptionMode = PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]);
wddm->init();
EXPECT_EQ(0u, wddm->registerTrimCallbackResult.called);
auto osContext = std::make_unique<OsContextWin>(*wddm, 0u, 1, HwHelper::get(platformDevices[0]->platform.eRenderCoreFamily).getGpgpuEngineInstances(*platformDevices[0])[0], preemptionMode, false);
auto osContext = std::make_unique<OsContextWin>(*wddm, 0u, 1,
HwHelper::get(platformDevices[0]->platform.eRenderCoreFamily).getGpgpuEngineInstances(*platformDevices[0])[0],
preemptionMode, false, false, false);
EXPECT_TRUE(osContext->isInitialized());
EXPECT_EQ(osContext->getWddm(), wddm);
EXPECT_EQ(1u, wddm->registerTrimCallbackResult.called);

View File

@@ -42,7 +42,9 @@ struct Wddm23TestsWithoutWddmInit : public ::testing::Test, GdiDllFixture {
wddmMockInterface = static_cast<WddmMockInterface23 *>(wddm->wddmInterface.release());
wddm->init();
wddm->wddmInterface.reset(wddmMockInterface);
osContext = std::make_unique<OsContextWin>(*wddm, 0u, 1, HwHelper::get(platformDevices[0]->platform.eRenderCoreFamily).getGpgpuEngineInstances(*platformDevices[0])[0], preemptionMode, false);
osContext = std::make_unique<OsContextWin>(*wddm, 0u, 1,
HwHelper::get(platformDevices[0]->platform.eRenderCoreFamily).getGpgpuEngineInstances(*platformDevices[0])[0],
preemptionMode, false, false, false);
}
void TearDown() override {
@@ -75,8 +77,10 @@ TEST_F(Wddm23Tests, whenCreateContextIsCalledThenEnableHwQueues) {
TEST_F(Wddm23Tests, givenPreemptionModeWhenCreateHwQueueCalledThenSetGpuTimeoutIfEnabled) {
auto defaultEngine = HwHelper::get(platformDevices[0]->platform.eRenderCoreFamily).getGpgpuEngineInstances(*platformDevices[0])[0];
OsContextWin osContextWithoutPreemption(*osInterface->get()->getWddm(), 0u, 1, defaultEngine, PreemptionMode::Disabled, false);
OsContextWin osContextWithPreemption(*osInterface->get()->getWddm(), 0u, 1, defaultEngine, PreemptionMode::MidBatch, false);
OsContextWin osContextWithoutPreemption(*osInterface->get()->getWddm(), 0u, 1, defaultEngine, PreemptionMode::Disabled,
false, false, false);
OsContextWin osContextWithPreemption(*osInterface->get()->getWddm(), 0u, 1, defaultEngine, PreemptionMode::MidBatch,
false, false, false);
wddm->wddmInterface->createHwQueue(osContextWithoutPreemption);
EXPECT_EQ(0u, getCreateHwQueueDataFcn()->Flags.DisableGpuTimeout);

View File

@@ -43,7 +43,8 @@ struct WddmFixture : ::testing::Test {
wddm->init();
auto hwInfo = rootDeviceEnvironemnt->getHardwareInfo();
auto engine = HwHelper::get(platformDevices[0]->platform.eRenderCoreFamily).getGpgpuEngineInstances(*hwInfo)[0];
osContext = std::make_unique<OsContextWin>(*osInterface->get()->getWddm(), 0u, 1u, engine, preemptionMode, false);
osContext = std::make_unique<OsContextWin>(*osInterface->get()->getWddm(), 0u, 1u, engine, preemptionMode,
false, false, false);
mockTemporaryResources = static_cast<MockWddmResidentAllocationsContainer *>(wddm->temporaryResources.get());
}
@@ -79,7 +80,8 @@ struct WddmFixtureWithMockGdiDll : public GdiDllFixture {
auto hwInfo = rootDeviceEnvironment->getHardwareInfo();
auto engine = HwHelper::get(platformDevices[0]->platform.eRenderCoreFamily).getGpgpuEngineInstances(*hwInfo)[0];
osContext = std::make_unique<OsContextWin>(*osInterface->get()->getWddm(), 0u, 1, engine, preemptionMode, false);
osContext = std::make_unique<OsContextWin>(*osInterface->get()->getWddm(), 0u, 1, engine, preemptionMode,
false, false, false);
}
void TearDown() override {

View File

@@ -75,7 +75,9 @@ TEST(WddmMemoryManager, NonAssignable) {
TEST(WddmAllocationTest, givenAllocationIsTrimCandidateInOneOsContextWhenGettingTrimCandidatePositionThenReturnItsPositionAndUnusedPositionInOtherContexts) {
MockWddmAllocation allocation;
MockOsContext osContext(1u, 1, aub_stream::ENGINE_RCS, PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]), false);
MockOsContext osContext(1u, 1, aub_stream::ENGINE_RCS,
PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]),
false, false, false);
allocation.setTrimCandidateListPosition(osContext.getContextId(), 700u);
EXPECT_EQ(trimListUnusedPosition, allocation.getTrimCandidateListPosition(0u));
EXPECT_EQ(700u, allocation.getTrimCandidateListPosition(1u));
@@ -354,7 +356,7 @@ TEST_F(WddmMemoryManagerSimpleTest, givenNonZeroFenceValuesOnMultipleEnginesRegi
auto hwInfo = executionEnvironment->rootDeviceEnvironments[0]->getHardwareInfo();
memoryManager->createAndRegisterOsContext(csr.get(), HwHelper::get(hwInfo->platform.eRenderCoreFamily).getGpgpuEngineInstances(*hwInfo)[1],
2, PreemptionHelper::getDefaultPreemptionMode(*hwInfo), false);
2, PreemptionHelper::getDefaultPreemptionMode(*hwInfo), false, false, false);
ASSERT_EQ(2u, memoryManager->getRegisteredEnginesCount());
auto allocation = static_cast<WddmAllocation *>(memoryManager->allocateGraphicsMemoryWithProperties({0, 32, GraphicsAllocation::AllocationType::BUFFER}));
@@ -384,7 +386,7 @@ TEST_F(WddmMemoryManagerSimpleTest, givenNonZeroFenceValueOnSomeOfMultipleEngine
auto hwInfo = executionEnvironment->rootDeviceEnvironments[0]->getHardwareInfo();
memoryManager->createAndRegisterOsContext(csr.get(), HwHelper::get(hwInfo->platform.eRenderCoreFamily).getGpgpuEngineInstances(*hwInfo)[1],
2, PreemptionHelper::getDefaultPreemptionMode(*hwInfo), false);
2, PreemptionHelper::getDefaultPreemptionMode(*hwInfo), false, false, false);
ASSERT_EQ(2u, memoryManager->getRegisteredEnginesCount());
auto allocation = static_cast<WddmAllocation *>(memoryManager->allocateGraphicsMemoryWithProperties({0, 32, GraphicsAllocation::AllocationType::BUFFER}));
@@ -1446,9 +1448,12 @@ TEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerWithRegisteredOsContextWhenC
std::unique_ptr<CommandStreamReceiver> csr(createCommandStream(*executionEnvironment, 0u));
std::unique_ptr<CommandStreamReceiver> csr1(createCommandStream(*executionEnvironment, 1u));
std::unique_ptr<CommandStreamReceiver> csr2(createCommandStream(*executionEnvironment, 2u));
memoryManager->createAndRegisterOsContext(csr.get(), aub_stream::ENGINE_RCS, 1, PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]), false);
memoryManager->createAndRegisterOsContext(csr1.get(), aub_stream::ENGINE_RCS, 2, PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]), false);
memoryManager->createAndRegisterOsContext(csr2.get(), aub_stream::ENGINE_RCS, 3, PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]), false);
memoryManager->createAndRegisterOsContext(csr.get(), aub_stream::ENGINE_RCS, 1,
PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]), false, false, false);
memoryManager->createAndRegisterOsContext(csr1.get(), aub_stream::ENGINE_RCS, 2,
PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]), false, false, false);
memoryManager->createAndRegisterOsContext(csr2.get(), aub_stream::ENGINE_RCS, 3,
PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]), false, false, false);
EXPECT_FALSE(memoryManager->isMemoryBudgetExhausted());
}
@@ -1465,9 +1470,12 @@ TEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerWithRegisteredOsContextWithE
std::unique_ptr<CommandStreamReceiver> csr(createCommandStream(*executionEnvironment, 0u));
std::unique_ptr<CommandStreamReceiver> csr1(createCommandStream(*executionEnvironment, 1u));
std::unique_ptr<CommandStreamReceiver> csr2(createCommandStream(*executionEnvironment, 2u));
memoryManager->createAndRegisterOsContext(csr.get(), aub_stream::ENGINE_RCS, 1, PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]), false);
memoryManager->createAndRegisterOsContext(csr1.get(), aub_stream::ENGINE_RCS, 2, PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]), false);
memoryManager->createAndRegisterOsContext(csr2.get(), aub_stream::ENGINE_RCS, 3, PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]), false);
memoryManager->createAndRegisterOsContext(csr.get(), aub_stream::ENGINE_RCS, 1,
PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]), false, false, false);
memoryManager->createAndRegisterOsContext(csr1.get(), aub_stream::ENGINE_RCS, 2,
PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]), false, false, false);
memoryManager->createAndRegisterOsContext(csr2.get(), aub_stream::ENGINE_RCS, 3,
PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]), false, false, false);
auto osContext = static_cast<OsContextWin *>(memoryManager->getRegisteredEngines()[1].osContext);
osContext->getResidencyController().setMemoryBudgetExhausted();
EXPECT_TRUE(memoryManager->isMemoryBudgetExhausted());
@@ -1715,7 +1723,8 @@ TEST(WddmMemoryManagerCleanupTest, givenUsedTagAllocationInWddmMemoryManagerWhen
executionEnvironment.rootDeviceEnvironments[0]->osInterface->get()->setWddm(wddm);
executionEnvironment.rootDeviceEnvironments[0]->memoryOperationsInterface = std::make_unique<WddmMemoryOperationsHandler>(wddm);
executionEnvironment.memoryManager = std::make_unique<WddmMemoryManager>(executionEnvironment);
auto osContext = executionEnvironment.memoryManager->createAndRegisterOsContext(csr.get(), aub_stream::ENGINE_RCS, 1, preemptionMode, false);
auto osContext = executionEnvironment.memoryManager->createAndRegisterOsContext(csr.get(), aub_stream::ENGINE_RCS, 1, preemptionMode,
false, false, false);
csr->setupContext(*osContext);
auto tagAllocator = csr->getEventPerfCountAllocator(100);

View File

@@ -67,7 +67,7 @@ class MockWddmMemoryManagerFixture {
auto hwInfo = rootDeviceEnvironment->getHardwareInfo();
osContext = memoryManager->createAndRegisterOsContext(csr.get(),
HwHelper::get(hwInfo->platform.eRenderCoreFamily).getGpgpuEngineInstances(*hwInfo)[0],
1, PreemptionHelper::getDefaultPreemptionMode(*hwInfo), false);
1, PreemptionHelper::getDefaultPreemptionMode(*hwInfo), false, false, false);
osContext->incRefInternal();
mockTemporaryResources = reinterpret_cast<MockWddmResidentAllocationsContainer *>(wddm->getTemporaryResourcesContainer());
@@ -120,7 +120,8 @@ class WddmMemoryManagerFixtureWithGmockWddm : public ExecutionEnvironmentFixture
csr.reset(createCommandStream(*executionEnvironment, 0u));
auto hwInfo = executionEnvironment->rootDeviceEnvironments[0]->getHardwareInfo();
osContext = memoryManager->createAndRegisterOsContext(csr.get(),
HwHelper::get(hwInfo->platform.eRenderCoreFamily).getGpgpuEngineInstances(*hwInfo)[0], 1, preemptionMode, false);
HwHelper::get(hwInfo->platform.eRenderCoreFamily).getGpgpuEngineInstances(*hwInfo)[0],
1, preemptionMode, false, false, false);
osContext->incRefInternal();

View File

@@ -56,8 +56,10 @@ class MockWddmResidencyController : public WddmResidencyController {
class MockOsContextWin : public OsContextWin {
public:
MockOsContextWin(Wddm &wddm, uint32_t contextId, DeviceBitfield deviceBitfield,
aub_stream::EngineType engineType, PreemptionMode preemptionMode, bool lowPriority)
: OsContextWin(wddm, contextId, deviceBitfield, engineType, preemptionMode, lowPriority),
aub_stream::EngineType engineType, PreemptionMode preemptionMode,
bool lowPriority, bool internalEngine, bool rootDevice)
: OsContextWin(wddm, contextId, deviceBitfield, engineType, preemptionMode,
lowPriority, internalEngine, rootDevice),
mockResidencyController(wddm, contextId) {}
WddmResidencyController &getResidencyController() override { return mockResidencyController; };
@@ -73,7 +75,8 @@ struct WddmResidencyControllerTest : ::testing::Test {
rootDeviceEnvironment = std::make_unique<RootDeviceEnvironment>(*executionEnvironment);
wddm = std::unique_ptr<WddmMock>(static_cast<WddmMock *>(Wddm::createWddm(nullptr, *rootDeviceEnvironment)));
wddm->init();
mockOsContextWin = std::make_unique<MockOsContextWin>(*wddm, osContextId, 0, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false);
mockOsContextWin = std::make_unique<MockOsContextWin>(*wddm, osContextId, 0, aub_stream::ENGINE_RCS,
PreemptionMode::Disabled, false, false, false);
wddm->getWddmInterface()->createMonitoredFence(*mockOsContextWin);
residencyController = &mockOsContextWin->mockResidencyController;
}
@@ -96,7 +99,8 @@ struct WddmResidencyControllerWithGdiTest : ::testing::Test {
wddm->resetGdi(gdi);
wddm->init();
mockOsContextWin = std::make_unique<MockOsContextWin>(*wddm, osContextId, 0, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false);
mockOsContextWin = std::make_unique<MockOsContextWin>(*wddm, osContextId, 0, aub_stream::ENGINE_RCS, PreemptionMode::Disabled,
false, false, false);
wddm->getWddmInterface()->createMonitoredFence(*mockOsContextWin);
residencyController = &mockOsContextWin->mockResidencyController;
residencyController->registerCallback();
@@ -129,7 +133,8 @@ struct WddmResidencyControllerWithMockWddmTest : public WddmResidencyControllerT
csr.reset(createCommandStream(*executionEnvironment, 0u));
auto hwInfo = executionEnvironment->rootDeviceEnvironments[0]->getHardwareInfo();
osContext = memoryManager->createAndRegisterOsContext(csr.get(),
HwHelper::get(hwInfo->platform.eRenderCoreFamily).getGpgpuEngineInstances(*hwInfo)[0], 1, preemptionMode, false);
HwHelper::get(hwInfo->platform.eRenderCoreFamily).getGpgpuEngineInstances(*hwInfo)[0], 1, preemptionMode,
false, false, false);
osContext->incRefInternal();
residencyController = &static_cast<OsContextWin *>(osContext)->getResidencyController();
@@ -167,7 +172,8 @@ struct WddmResidencyControllerWithGdiAndMemoryManagerTest : ::testing::Test {
auto hwInfo = executionEnvironment->rootDeviceEnvironments[0]->getHardwareInfo();
osContext = memoryManager->createAndRegisterOsContext(csr.get(),
HwHelper::get(hwInfo->platform.eRenderCoreFamily).getGpgpuEngineInstances(*hwInfo)[0],
1, PreemptionHelper::getDefaultPreemptionMode(*hwInfo), false);
1, PreemptionHelper::getDefaultPreemptionMode(*hwInfo),
false, false, false);
osContext->incRefInternal();

View File

@@ -124,7 +124,8 @@ bool Device::createEngine(uint32_t deviceCsrIndex, aub_stream::EngineType engine
bool lowPriority = (deviceCsrIndex == HwHelper::lowPriorityGpgpuEngineIndex);
auto osContext = executionEnvironment->memoryManager->createAndRegisterOsContext(commandStreamReceiver.get(), engineType,
getDeviceBitfield(), preemptionMode, lowPriority);
getDeviceBitfield(), preemptionMode,
lowPriority, internalUsage, false);
commandStreamReceiver->setupContext(*osContext);
if (!commandStreamReceiver->initializeTagAllocation()) {

View File

@@ -98,7 +98,7 @@ void RootDevice::initializeRootCommandStreamReceiver() {
auto preemptionMode = PreemptionHelper::getDefaultPreemptionMode(hwInfo);
auto osContext = getMemoryManager()->createAndRegisterOsContext(rootCommandStreamReceiver.get(), defaultEngineType,
getDeviceBitfield(), preemptionMode, false);
getDeviceBitfield(), preemptionMode, false, false, true);
rootCommandStreamReceiver->setupContext(*osContext);
rootCommandStreamReceiver->initializeTagAllocation();

View File

@@ -89,7 +89,7 @@ bool DirectSubmissionHw<GfxFamily>::allocateResources() {
}
template <typename GfxFamily>
void DirectSubmissionHw<GfxFamily>::cpuCachelineFlush(void *ptr, size_t size) {
inline void DirectSubmissionHw<GfxFamily>::cpuCachelineFlush(void *ptr, size_t size) {
if (disableCpuCacheFlush) {
return;
}
@@ -156,7 +156,7 @@ bool DirectSubmissionHw<GfxFamily>::stopRingBuffer() {
}
template <typename GfxFamily>
void *DirectSubmissionHw<GfxFamily>::dispatchSemaphoreSection(uint32_t value) {
inline void *DirectSubmissionHw<GfxFamily>::dispatchSemaphoreSection(uint32_t value) {
using MI_SEMAPHORE_WAIT = typename GfxFamily::MI_SEMAPHORE_WAIT;
using COMPARE_OPERATION = typename GfxFamily::MI_SEMAPHORE_WAIT::COMPARE_OPERATION;
@@ -172,13 +172,13 @@ void *DirectSubmissionHw<GfxFamily>::dispatchSemaphoreSection(uint32_t value) {
}
template <typename GfxFamily>
size_t DirectSubmissionHw<GfxFamily>::getSizeSemaphoreSection() {
inline size_t DirectSubmissionHw<GfxFamily>::getSizeSemaphoreSection() {
size_t semaphoreSize = EncodeSempahore<GfxFamily>::getSizeMiSemaphoreWait();
return (semaphoreSize + prefetchSize);
}
template <typename GfxFamily>
void DirectSubmissionHw<GfxFamily>::dispatchStartSection(uint64_t gpuStartAddress) {
inline void DirectSubmissionHw<GfxFamily>::dispatchStartSection(uint64_t gpuStartAddress) {
using MI_BATCH_BUFFER_START = typename GfxFamily::MI_BATCH_BUFFER_START;
auto bbufferStart = ringCommandStream.getSpaceForCmd<MI_BATCH_BUFFER_START>();
*bbufferStart = GfxFamily::cmdInitBatchBufferStart;
@@ -188,14 +188,14 @@ void DirectSubmissionHw<GfxFamily>::dispatchStartSection(uint64_t gpuStartAddres
}
template <typename GfxFamily>
size_t DirectSubmissionHw<GfxFamily>::getSizeStartSection() {
inline size_t DirectSubmissionHw<GfxFamily>::getSizeStartSection() {
using MI_BATCH_BUFFER_START = typename GfxFamily::MI_BATCH_BUFFER_START;
size_t size = sizeof(MI_BATCH_BUFFER_START);
return size;
}
template <typename GfxFamily>
void DirectSubmissionHw<GfxFamily>::dispatchSwitchRingBufferSection(uint64_t nextBufferGpuAddress) {
inline void DirectSubmissionHw<GfxFamily>::dispatchSwitchRingBufferSection(uint64_t nextBufferGpuAddress) {
using MI_BATCH_BUFFER_START = typename GfxFamily::MI_BATCH_BUFFER_START;
auto bbufferStart = ringCommandStream.getSpaceForCmd<MI_BATCH_BUFFER_START>();
@@ -206,38 +206,38 @@ void DirectSubmissionHw<GfxFamily>::dispatchSwitchRingBufferSection(uint64_t nex
}
template <typename GfxFamily>
size_t DirectSubmissionHw<GfxFamily>::getSizeSwitchRingBufferSection() {
inline size_t DirectSubmissionHw<GfxFamily>::getSizeSwitchRingBufferSection() {
using MI_BATCH_BUFFER_START = typename GfxFamily::MI_BATCH_BUFFER_START;
return sizeof(MI_BATCH_BUFFER_START);
}
template <typename GfxFamily>
void *DirectSubmissionHw<GfxFamily>::dispatchFlushSection() {
inline void *DirectSubmissionHw<GfxFamily>::dispatchFlushSection() {
void *currentPosition = ringCommandStream.getSpace(0);
cmdDispatcher->dispatchCacheFlush(ringCommandStream, *hwInfo);
return currentPosition;
}
template <typename GfxFamily>
size_t DirectSubmissionHw<GfxFamily>::getSizeFlushSection() {
inline size_t DirectSubmissionHw<GfxFamily>::getSizeFlushSection() {
return cmdDispatcher->getSizeCacheFlush(*hwInfo);
}
template <typename GfxFamily>
void *DirectSubmissionHw<GfxFamily>::dispatchTagUpdateSection(uint64_t address, uint64_t value) {
inline void *DirectSubmissionHw<GfxFamily>::dispatchTagUpdateSection(uint64_t address, uint64_t value) {
void *currentPosition = ringCommandStream.getSpace(0);
cmdDispatcher->dispatchMonitorFence(ringCommandStream, address, value, *hwInfo);
return currentPosition;
}
template <typename GfxFamily>
size_t DirectSubmissionHw<GfxFamily>::getSizeTagUpdateSection() {
inline size_t DirectSubmissionHw<GfxFamily>::getSizeTagUpdateSection() {
size_t size = cmdDispatcher->getSizeMonitorFence(*hwInfo);
return size;
}
template <typename GfxFamily>
void DirectSubmissionHw<GfxFamily>::dispatchEndingSection() {
inline void DirectSubmissionHw<GfxFamily>::dispatchEndingSection() {
using MI_BATCH_BUFFER_END = typename GfxFamily::MI_BATCH_BUFFER_END;
auto bbufferEnd = ringCommandStream.getSpaceForCmd<MI_BATCH_BUFFER_END>();
@@ -245,13 +245,13 @@ void DirectSubmissionHw<GfxFamily>::dispatchEndingSection() {
}
template <typename GfxFamily>
size_t DirectSubmissionHw<GfxFamily>::getSizeEndingSection() {
inline size_t DirectSubmissionHw<GfxFamily>::getSizeEndingSection() {
using MI_BATCH_BUFFER_END = typename GfxFamily::MI_BATCH_BUFFER_END;
return sizeof(MI_BATCH_BUFFER_END);
}
template <typename GfxFamily>
size_t DirectSubmissionHw<GfxFamily>::getSizeDispatch() {
inline size_t DirectSubmissionHw<GfxFamily>::getSizeDispatch() {
return getSizeStartSection() +
getSizeFlushSection() +
getSizeTagUpdateSection() +
@@ -259,13 +259,13 @@ size_t DirectSubmissionHw<GfxFamily>::getSizeDispatch() {
}
template <typename GfxFamily>
size_t DirectSubmissionHw<GfxFamily>::getSizeEnd() {
inline size_t DirectSubmissionHw<GfxFamily>::getSizeEnd() {
return getSizeEndingSection() +
getSizeFlushSection();
}
template <typename GfxFamily>
uint64_t DirectSubmissionHw<GfxFamily>::getCommandBufferPositionGpuAddress(void *position) {
inline uint64_t DirectSubmissionHw<GfxFamily>::getCommandBufferPositionGpuAddress(void *position) {
void *currentBase = ringCommandStream.getCpuBase();
size_t offset = ptrDiff(position, currentBase);
@@ -325,7 +325,7 @@ bool DirectSubmissionHw<GfxFamily>::dispatchCommandBuffer(BatchBuffer &batchBuff
}
template <typename GfxFamily>
void DirectSubmissionHw<GfxFamily>::setReturnAddress(void *returnCmd, uint64_t returnAddress) {
inline void DirectSubmissionHw<GfxFamily>::setReturnAddress(void *returnCmd, uint64_t returnAddress) {
using MI_BATCH_BUFFER_START = typename GfxFamily::MI_BATCH_BUFFER_START;
MI_BATCH_BUFFER_START *returnBBStart = static_cast<MI_BATCH_BUFFER_START *>(returnCmd);
@@ -333,7 +333,7 @@ void DirectSubmissionHw<GfxFamily>::setReturnAddress(void *returnCmd, uint64_t r
}
template <typename GfxFamily>
GraphicsAllocation *DirectSubmissionHw<GfxFamily>::switchRingBuffersAllocations() {
inline GraphicsAllocation *DirectSubmissionHw<GfxFamily>::switchRingBuffersAllocations() {
GraphicsAllocation *nextAllocation = nullptr;
if (currentRingBuffer == RingBufferUse::FirstBuffer) {
nextAllocation = ringBuffer2;

View File

@@ -15,6 +15,9 @@ namespace NEO {
struct DirectSubmissionProperties {
bool engineSupported = false;
bool submitOnInit = false;
bool useInternal = false;
bool useLowPriority = false;
bool useRootDevice = false;
};
using EngineDirectSubmissionInitVec = std::vector<std::pair<aub_stream::EngineType, DirectSubmissionProperties>>;

View File

@@ -13,18 +13,18 @@
namespace NEO {
template <typename GfxFamily>
void RenderDispatcher<GfxFamily>::dispatchPreemption(LinearStream &cmdBuffer) {
inline void RenderDispatcher<GfxFamily>::dispatchPreemption(LinearStream &cmdBuffer) {
PreemptionHelper::programCmdStream<GfxFamily>(cmdBuffer, PreemptionMode::MidBatch, PreemptionMode::Disabled, nullptr);
}
template <typename GfxFamily>
size_t RenderDispatcher<GfxFamily>::getSizePreemption() {
inline size_t RenderDispatcher<GfxFamily>::getSizePreemption() {
size_t size = PreemptionHelper::getRequiredCmdStreamSize<GfxFamily>(PreemptionMode::MidBatch, PreemptionMode::Disabled);
return size;
}
template <typename GfxFamily>
void RenderDispatcher<GfxFamily>::dispatchMonitorFence(LinearStream &cmdBuffer,
inline void RenderDispatcher<GfxFamily>::dispatchMonitorFence(LinearStream &cmdBuffer,
uint64_t gpuAddress,
uint64_t immediateData,
const HardwareInfo &hwInfo) {
@@ -39,18 +39,18 @@ void RenderDispatcher<GfxFamily>::dispatchMonitorFence(LinearStream &cmdBuffer,
}
template <typename GfxFamily>
size_t RenderDispatcher<GfxFamily>::getSizeMonitorFence(const HardwareInfo &hwInfo) {
inline size_t RenderDispatcher<GfxFamily>::getSizeMonitorFence(const HardwareInfo &hwInfo) {
size_t size = MemorySynchronizationCommands<GfxFamily>::getSizeForPipeControlWithPostSyncOperation(hwInfo);
return size;
}
template <typename GfxFamily>
void RenderDispatcher<GfxFamily>::dispatchCacheFlush(LinearStream &cmdBuffer, const HardwareInfo &hwInfo) {
inline void RenderDispatcher<GfxFamily>::dispatchCacheFlush(LinearStream &cmdBuffer, const HardwareInfo &hwInfo) {
MemorySynchronizationCommands<GfxFamily>::addFullCacheFlush(cmdBuffer);
}
template <typename GfxFamily>
size_t RenderDispatcher<GfxFamily>::getSizeCacheFlush(const HardwareInfo &hwInfo) {
inline size_t RenderDispatcher<GfxFamily>::getSizeCacheFlush(const HardwareInfo &hwInfo) {
size_t size = MemorySynchronizationCommands<GfxFamily>::getSizeForFullCacheFlush();
return size;
}

View File

@@ -200,9 +200,12 @@ bool MemoryManager::isMemoryBudgetExhausted() const {
}
OsContext *MemoryManager::createAndRegisterOsContext(CommandStreamReceiver *commandStreamReceiver, aub_stream::EngineType engineType,
DeviceBitfield deviceBitfield, PreemptionMode preemptionMode, bool lowPriority) {
DeviceBitfield deviceBitfield, PreemptionMode preemptionMode,
bool lowPriority, bool internalEngine, bool rootDevice) {
auto contextId = ++latestContextId;
auto osContext = OsContext::create(peekExecutionEnvironment().rootDeviceEnvironments[commandStreamReceiver->getRootDeviceIndex()]->osInterface.get(), contextId, deviceBitfield, engineType, preemptionMode, lowPriority);
auto osContext = OsContext::create(peekExecutionEnvironment().rootDeviceEnvironments[commandStreamReceiver->getRootDeviceIndex()]->osInterface.get(),
contextId, deviceBitfield, engineType, preemptionMode,
lowPriority, internalEngine, rootDevice);
UNRECOVERABLE_IF(!osContext->isInitialized());
osContext->incRefInternal();

View File

@@ -147,7 +147,8 @@ class MemoryManager {
const ExecutionEnvironment &peekExecutionEnvironment() const { return executionEnvironment; }
OsContext *createAndRegisterOsContext(CommandStreamReceiver *commandStreamReceiver, aub_stream::EngineType engineType,
DeviceBitfield deviceBitfield, PreemptionMode preemptionMode, bool lowPriority);
DeviceBitfield deviceBitfield, PreemptionMode preemptionMode,
bool lowPriority, bool internalEngine, bool rootDevice);
uint32_t getRegisteredEnginesCount() const { return static_cast<uint32_t>(registeredEngines.size()); }
EngineControlContainer &getRegisteredEngines();
EngineControl *getRegisteredEngineForCsr(CommandStreamReceiver *commandStreamReceiver);

View File

@@ -14,16 +14,21 @@
namespace NEO {
OsContext *OsContext::create(OSInterface *osInterface, uint32_t contextId, DeviceBitfield deviceBitfield,
aub_stream::EngineType engineType, PreemptionMode preemptionMode, bool lowPriority) {
aub_stream::EngineType engineType, PreemptionMode preemptionMode,
bool lowPriority, bool internalEngine, bool rootDevice) {
if (osInterface) {
return new OsContextLinux(*osInterface->get()->getDrm(), contextId, deviceBitfield, engineType, preemptionMode, lowPriority);
return new OsContextLinux(*osInterface->get()->getDrm(), contextId, deviceBitfield, engineType, preemptionMode,
lowPriority, internalEngine, rootDevice);
}
return new OsContext(contextId, deviceBitfield, engineType, preemptionMode, lowPriority);
return new OsContext(contextId, deviceBitfield, engineType, preemptionMode,
lowPriority, internalEngine, rootDevice);
}
OsContextLinux::OsContextLinux(Drm &drm, uint32_t contextId, DeviceBitfield deviceBitfield,
aub_stream::EngineType engineType, PreemptionMode preemptionMode, bool lowPriority)
: OsContext(contextId, deviceBitfield, engineType, preemptionMode, lowPriority), drm(drm) {
aub_stream::EngineType engineType, PreemptionMode preemptionMode,
bool lowPriority, bool internalEngine, bool rootDevice)
: OsContext(contextId, deviceBitfield, engineType, preemptionMode, lowPriority, internalEngine, rootDevice),
drm(drm) {
for (auto deviceIndex = 0u; deviceIndex < deviceBitfield.size(); deviceIndex++) {
if (deviceBitfield.test(deviceIndex)) {
auto drmContextId = drm.createDrmContext();

View File

@@ -19,7 +19,8 @@ class OsContextLinux : public OsContext {
OsContextLinux() = delete;
~OsContextLinux() override;
OsContextLinux(Drm &drm, uint32_t contextId, DeviceBitfield deviceBitfield,
aub_stream::EngineType engineType, PreemptionMode preemptionMode, bool lowPriority);
aub_stream::EngineType engineType, PreemptionMode preemptionMode,
bool lowPriority, bool internalEngine, bool rootDevice);
unsigned int getEngineFlag() const { return engineFlag; }
const std::vector<uint32_t> &getDrmContextIds() const { return drmContextIds; }

View File

@@ -22,29 +22,37 @@ class OsContext : public ReferenceTrackedObject<OsContext> {
OsContext() = delete;
static OsContext *create(OSInterface *osInterface, uint32_t contextId, DeviceBitfield deviceBitfield,
aub_stream::EngineType engineType, PreemptionMode preemptionMode, bool lowPriority);
aub_stream::EngineType engineType, PreemptionMode preemptionMode,
bool lowPriority, bool internalEngine, bool rootDevice);
uint32_t getContextId() const { return contextId; }
uint32_t getNumSupportedDevices() const { return numSupportedDevices; }
DeviceBitfield getDeviceBitfield() const { return deviceBitfield; }
PreemptionMode getPreemptionMode() const { return preemptionMode; }
aub_stream::EngineType &getEngineType() { return engineType; }
bool isLowPriority() const { return lowPriority; }
bool isInternalEngine() const { return internalEngine; }
bool isRootDevice() const { return rootDevice; }
virtual bool isInitialized() const { return true; }
protected:
OsContext(uint32_t contextId, DeviceBitfield deviceBitfield, aub_stream::EngineType engineType, PreemptionMode preemptionMode, bool lowPriority)
OsContext(uint32_t contextId, DeviceBitfield deviceBitfield, aub_stream::EngineType engineType, PreemptionMode preemptionMode,
bool lowPriority, bool internalEngine, bool rootDevice)
: contextId(contextId),
deviceBitfield(deviceBitfield),
preemptionMode(preemptionMode),
numSupportedDevices(static_cast<uint32_t>(deviceBitfield.count())),
engineType(engineType),
lowPriority(lowPriority) {}
lowPriority(lowPriority),
internalEngine(internalEngine),
rootDevice(rootDevice) {}
const uint32_t contextId;
const DeviceBitfield deviceBitfield;
const PreemptionMode preemptionMode;
const uint32_t numSupportedDevices;
aub_stream::EngineType engineType = aub_stream::ENGINE_RCS;
const bool lowPriority;
const bool lowPriority = false;
const bool internalEngine = false;
const bool rootDevice = false;
};
} // namespace NEO

View File

@@ -14,16 +14,21 @@
namespace NEO {
OsContext *OsContext::create(OSInterface *osInterface, uint32_t contextId, DeviceBitfield deviceBitfield,
aub_stream::EngineType engineType, PreemptionMode preemptionMode, bool lowPriority) {
aub_stream::EngineType engineType, PreemptionMode preemptionMode,
bool lowPriority, bool internalEngine, bool rootDevice) {
if (osInterface) {
return new OsContextWin(*osInterface->get()->getWddm(), contextId, deviceBitfield, engineType, preemptionMode, lowPriority);
return new OsContextWin(*osInterface->get()->getWddm(), contextId, deviceBitfield, engineType, preemptionMode,
lowPriority, internalEngine, rootDevice);
}
return new OsContext(contextId, deviceBitfield, engineType, preemptionMode, lowPriority);
return new OsContext(contextId, deviceBitfield, engineType, preemptionMode, lowPriority, internalEngine, rootDevice);
}
OsContextWin::OsContextWin(Wddm &wddm, uint32_t contextId, DeviceBitfield deviceBitfield,
aub_stream::EngineType engineType, PreemptionMode preemptionMode, bool lowPriority)
: OsContext(contextId, deviceBitfield, engineType, preemptionMode, lowPriority), wddm(wddm), residencyController(wddm, contextId) {
aub_stream::EngineType engineType, PreemptionMode preemptionMode,
bool lowPriority, bool internalEngine, bool rootDevice)
: OsContext(contextId, deviceBitfield, engineType, preemptionMode, lowPriority, internalEngine, rootDevice),
wddm(wddm),
residencyController(wddm, contextId) {
auto wddmInterface = wddm.getWddmInterface();
if (!wddm.createContext(*this)) {

View File

@@ -26,7 +26,8 @@ class OsContextWin : public OsContext {
~OsContextWin() override;
OsContextWin(Wddm &wddm, uint32_t contextId, DeviceBitfield deviceBitfield,
aub_stream::EngineType engineType, PreemptionMode preemptionMode, bool lowPriority);
aub_stream::EngineType engineType, PreemptionMode preemptionMode,
bool lowPriority, bool internalEngine, bool rootDevice);
D3DKMT_HANDLE getWddmContextHandle() const { return wddmContextHandle; }
void setWddmContextHandle(D3DKMT_HANDLE wddmContextHandle) { this->wddmContextHandle = wddmContextHandle; }

View File

@@ -31,7 +31,8 @@ struct DirectSubmissionFixture : public DeviceFixture {
void SetUp() {
DeviceFixture::SetUp();
osContext.reset(OsContext::create(nullptr, 0u, 0u, aub_stream::ENGINE_RCS, PreemptionMode::ThreadGroup, false));
osContext.reset(OsContext::create(nullptr, 0u, 0u, aub_stream::ENGINE_RCS, PreemptionMode::ThreadGroup,
false, false, false));
}
std::unique_ptr<OsContext> osContext;

View File

@@ -19,7 +19,8 @@ struct DrmDirectSubmissionFixture : public DeviceFixture {
void SetUp() {
DeviceFixture::SetUp();
osContext = std::make_unique<OsContextLinux>(drmMock, 0u, 0u, aub_stream::ENGINE_RCS, PreemptionMode::ThreadGroup, false);
osContext = std::make_unique<OsContextLinux>(drmMock, 0u, 0u, aub_stream::ENGINE_RCS,
PreemptionMode::ThreadGroup, false, false, false);
}
void TearDown() {

View File

@@ -21,7 +21,8 @@ struct WddmDirectSubmissionFixture : public WddmFixture {
wddm->wddmInterface.reset(new WddmMockInterface20(*wddm));
wddmMockInterface = static_cast<WddmMockInterface20 *>(wddm->wddmInterface.get());
osContext = std::make_unique<OsContextWin>(*wddm, 0u, 0u, aub_stream::ENGINE_RCS, PreemptionMode::ThreadGroup, false);
osContext = std::make_unique<OsContextWin>(*wddm, 0u, 0u, aub_stream::ENGINE_RCS, PreemptionMode::ThreadGroup,
false, false, false);
device.reset(MockDevice::create<MockDevice>(executionEnvironment, 0u));
device->setPreemptionMode(PreemptionMode::ThreadGroup);
}

View File

@@ -43,7 +43,7 @@ class WddmPreemptionTests : public Test<WddmFixtureWithMockGdiDll> {
wddm->init();
auto hwInfo = executionEnvironment->rootDeviceEnvironments[0]->getHardwareInfo();
auto engine = HwHelper::get(platformDevices[0]->platform.eRenderCoreFamily).getGpgpuEngineInstances(*hwInfo)[0];
osContext = std::make_unique<OsContextWin>(*wddm, 0u, 1, engine, preemptionMode, false);
osContext = std::make_unique<OsContextWin>(*wddm, 0u, 1, engine, preemptionMode, false, false, false);
}
DebugManagerStateRestore *dbgRestorer = nullptr;