Setup partition registers once per context

Related-To: NEO-6262

Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
Zbigniew Zdanowicz
2021-11-17 19:51:43 +00:00
committed by Compute-Runtime-Automation
parent c6c27ed328
commit f56773d166
17 changed files with 173 additions and 165 deletions

View File

@@ -1559,7 +1559,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterDispatchWalkerBasicTestStaticPartition,
if (device->getPreemptionMode() == PreemptionMode::MidThread || device->isDebuggerActive()) {
commandStreamReceiver.createPreemptionAllocation();
}
EXPECT_EQ(1u, commandStreamReceiver.activePartitions);
EXPECT_EQ(2u, commandStreamReceiver.activePartitions);
cmdQ->enqueueKernel(kernel->mockKernel, 1, nullptr, gws, lws, 0, nullptr, nullptr);
EXPECT_EQ(2u, commandStreamReceiver.activePartitions);
@@ -1585,7 +1585,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterDispatchWalkerBasicTestStaticPartition,
if (device->getPreemptionMode() == PreemptionMode::MidThread || device->isDebuggerActive()) {
commandStreamReceiver.createPreemptionAllocation();
}
EXPECT_EQ(1u, commandStreamReceiver.activePartitions);
EXPECT_EQ(2u, commandStreamReceiver.activePartitions);
kernel->mockProgram->allowNonUniform = true;
cmdQ->enqueueKernel(kernel->mockKernel, 1, nullptr, gws, lws, 0, nullptr, nullptr);
EXPECT_EQ(2u, commandStreamReceiver.activePartitions);

View File

@@ -935,48 +935,6 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, CommandStreamReceiverFlushTaskXeHPAndLaterMultiTile
verifyPipeControl<FamilyType>(commandStreamReceiver, 4, true);
}
HWCMDTEST_F(IGFX_XE_HP_CORE, CommandStreamReceiverFlushTaskXeHPAndLaterMultiTileTests,
givenMultipleDynamicActivePartitionsWhenFlushingTaskThenExpectTagUpdatePipeControlWithoutPartitionFlagOnAndNoActivePartitionConfig) {
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
if (pDevice->getPreemptionMode() == PreemptionMode::MidThread || pDevice->isDebuggerActive()) {
commandStreamReceiver.createPreemptionAllocation();
}
commandStreamReceiver.activePartitions = 2;
commandStreamReceiver.taskCount = 3;
commandStreamReceiver.staticWorkPartitioningEnabled = false;
flushTask(commandStreamReceiver, true);
EXPECT_EQ(2u, commandStreamReceiver.activePartitionsConfig);
prepareLinearStream<FamilyType>(commandStream, 0);
verifyPipeControl<FamilyType>(commandStreamReceiver, 4, false);
prepareLinearStream<FamilyType>(commandStreamReceiver.commandStream, 0);
verifyActivePartitionConfig<FamilyType>(commandStreamReceiver, false);
}
HWCMDTEST_F(IGFX_XE_HP_CORE, CommandStreamReceiverFlushTaskXeHPAndLaterMultiTileTests,
givenMultipleDynamicActivePartitionsWhenFlushingTagUpdateThenExpectTagUpdatePipeControlWithoutPartitionFlagOnAndNoActivePartitionConfig) {
DebugManagerStateRestore restorer;
DebugManager.flags.UpdateTaskCountFromWait.set(1);
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
if (pDevice->getPreemptionMode() == PreemptionMode::MidThread || pDevice->isDebuggerActive()) {
commandStreamReceiver.createPreemptionAllocation();
}
commandStreamReceiver.activePartitions = 2;
commandStreamReceiver.taskCount = 3;
commandStreamReceiver.staticWorkPartitioningEnabled = false;
flushTask(commandStreamReceiver, true);
commandStreamReceiver.flushTagUpdate();
EXPECT_EQ(2u, commandStreamReceiver.activePartitionsConfig);
prepareLinearStream<FamilyType>(commandStream, 0);
verifyPipeControl<FamilyType>(commandStreamReceiver, 4, false);
prepareLinearStream<FamilyType>(commandStreamReceiver.commandStream, 0);
verifyActivePartitionConfig<FamilyType>(commandStreamReceiver, false);
}
HWCMDTEST_F(IGFX_XE_HP_CORE, CommandStreamReceiverFlushTaskXeHPAndLaterMultiTileTests,
givenSingleStaticActivePartitionWhenFlushingTaskThenExpectTagUpdatePipeControlWithoutPartitionFlagOnAndNoActivePartitionConfig) {
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
@@ -1028,3 +986,65 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, CommandStreamReceiverFlushTaskXeHPAndLaterMultiTile
prepareLinearStream<FamilyType>(commandStreamReceiver.commandStream, usedBeforeCsrCmdStream);
verifyActivePartitionConfig<FamilyType>(commandStreamReceiver, false);
}
HWCMDTEST_F(IGFX_XE_HP_CORE, CommandStreamReceiverFlushTaskXeHPAndLaterMultiTileTests,
givenMultipleDynamicActivePartitionsWhenFlushingTaskTwiceThenExpectTagUpdatePipeControlWithoutPartitionFlagAndPartitionRegisters) {
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
if (pDevice->getPreemptionMode() == PreemptionMode::MidThread || pDevice->isDebuggerActive()) {
commandStreamReceiver.createPreemptionAllocation();
}
commandStreamReceiver.activePartitions = 2;
commandStreamReceiver.taskCount = 3;
commandStreamReceiver.staticWorkPartitioningEnabled = false;
flushTask(commandStreamReceiver, true);
EXPECT_EQ(2u, commandStreamReceiver.activePartitionsConfig);
prepareLinearStream<FamilyType>(commandStream, 0);
verifyPipeControl<FamilyType>(commandStreamReceiver, 4, false);
prepareLinearStream<FamilyType>(commandStreamReceiver.commandStream, 0);
verifyActivePartitionConfig<FamilyType>(commandStreamReceiver, false);
}
HWCMDTEST_F(IGFX_XE_HP_CORE, CommandStreamReceiverFlushTaskXeHPAndLaterMultiTileTests,
givenMultipleDynamicActivePartitionsWhenFlushingTagUpdateThenExpectTagUpdatePipeControlWithoutPartitionFlag) {
DebugManagerStateRestore restorer;
DebugManager.flags.UpdateTaskCountFromWait.set(1);
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
if (pDevice->getPreemptionMode() == PreemptionMode::MidThread || pDevice->isDebuggerActive()) {
commandStreamReceiver.createPreemptionAllocation();
}
commandStreamReceiver.activePartitions = 2;
commandStreamReceiver.taskCount = 3;
commandStreamReceiver.staticWorkPartitioningEnabled = false;
commandStreamReceiver.flushTagUpdate();
prepareLinearStream<FamilyType>(commandStreamReceiver.commandStream, 0);
verifyPipeControl<FamilyType>(commandStreamReceiver, 4, false);
}
HWCMDTEST_F(IGFX_XE_HP_CORE, CommandStreamReceiverFlushTaskXeHPAndLaterMultiTileTests,
givenMultipleStaticActivePartitionsAndDirectSubmissionActiveWhenFlushingTaskThenExpectTagUpdatePipeControlWithPartitionFlagOnAndNoActivePartitionConfig) {
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
if (pDevice->getPreemptionMode() == PreemptionMode::MidThread || pDevice->isDebuggerActive()) {
commandStreamReceiver.createPreemptionAllocation();
}
commandStreamReceiver.directSubmissionAvailable = true;
EXPECT_EQ(1u, commandStreamReceiver.activePartitionsConfig);
EXPECT_EQ(2u, commandStreamReceiver.activePartitions);
EXPECT_TRUE(commandStreamReceiver.staticWorkPartitioningEnabled);
commandStreamReceiver.taskCount = 3;
flushTask(commandStreamReceiver, true);
EXPECT_EQ(1u, commandStreamReceiver.activePartitionsConfig);
prepareLinearStream<FamilyType>(commandStream, 0);
verifyPipeControl<FamilyType>(commandStreamReceiver, 4, true);
prepareLinearStream<FamilyType>(commandStreamReceiver.commandStream, 0);
verifyActivePartitionConfig<FamilyType>(commandStreamReceiver, false);
}

View File

@@ -237,11 +237,13 @@ HWTEST_F(TimestampPacketTests, givenPipeControlRequestWhenFlushingThenProgramPip
EXPECT_FALSE(csr.stallingCommandsOnNextFlushRequired);
HardwareParse hwParser;
hwParser.parsePipeControl = true;
hwParser.parseCommands<FamilyType>(csr.commandStream, 0);
hwParser.findHardwareCommands<FamilyType>();
auto secondEnqueueOffset = csr.commandStream.getUsed();
auto pipeControl = genCmdCast<typename FamilyType::PIPE_CONTROL *>(*hwParser.cmdList.begin());
EXPECT_NE(nullptr, pipeControl);
auto pipeControl = genCmdCast<typename FamilyType::PIPE_CONTROL *>(*hwParser.pipeControlList.begin());
ASSERT_NE(nullptr, pipeControl);
EXPECT_EQ(PIPE_CONTROL::POST_SYNC_OPERATION::POST_SYNC_OPERATION_NO_WRITE, pipeControl->getPostSyncOperation());
EXPECT_TRUE(pipeControl->getCommandStreamerStallEnable());