fix: flush dc when blocking flag set

Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
Lukasz Jobczyk
2023-08-17 09:10:07 +00:00
committed by Compute-Runtime-Automation
parent d96d092602
commit 6fcb0f1407
2 changed files with 35 additions and 1 deletions

View File

@@ -644,6 +644,40 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenUpdateTaskCountFromWaitEnable
EXPECT_EQ(cmd->getDcFlushEnable(), mockCsr->getDcFlushSupport());
}
HWTEST_F(CommandStreamReceiverFlushTaskTests, givenUpdateTaskCountFromWaitEnabledAndBlockingFlagWhenFlushTaskThenTaskCountIsFlushed) {
DebugManagerStateRestore restorer;
DebugManager.flags.UpdateTaskCountFromWait.set(3);
auto mockCsr = new MockCsrHw2<FamilyType>(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield());
mockCsr->overrideDispatchPolicy(DispatchMode::ImmediateDispatch);
pDevice->resetCommandStreamReceiver(mockCsr);
mockCsr->useNewResourceImplicitFlush = false;
mockCsr->useGpuIdleImplicitFlush = false;
DispatchFlags dispatchFlags = DispatchFlagsHelper::createDefaultDispatchFlags();
dispatchFlags.preemptionMode = PreemptionHelper::getDefaultPreemptionMode(pDevice->getHardwareInfo());
dispatchFlags.guardCommandBufferWithPipeControl = false;
dispatchFlags.blocking = true;
mockCsr->flushTask(commandStream,
0,
&dsh,
&ioh,
&ssh,
taskLevel,
dispatchFlags,
*pDevice);
parseCommands<FamilyType>(commandStream);
auto itorPipeControl = find<typename FamilyType::PIPE_CONTROL *>(cmdList.begin(), cmdList.end());
if (MemorySynchronizationCommands<FamilyType>::isBarrierWaRequired(pDevice->getRootDeviceEnvironment())) {
itorPipeControl++;
}
EXPECT_NE(itorPipeControl, cmdList.end());
auto cmd = genCmdCast<typename FamilyType::PIPE_CONTROL *>(*itorPipeControl);
EXPECT_EQ(cmd->getDcFlushEnable(), mockCsr->getDcFlushSupport());
}
HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrInDefaultModeWhenFlushTaskIsCalledThenFlushedTaskCountIsModifed) {
CommandQueueHw<FamilyType> commandQueue(nullptr, pClDevice, 0, false);
auto &commandStream = commandQueue.getCS(4096u);