@@ -297,6 +297,23 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, higherTaskLevelShouldSendAPipeCont
297297 EXPECT_NE (cmdList.end (), itorPC);
298298}
299299
300+ HWTEST_F (CommandStreamReceiverFlushTaskTests, givenHigherTaskLevelWhenDebugVariableIsEnabledThenDontAddPipeControl) {
301+ DebugManagerStateRestore restore;
302+ DebugManager.flags .EnableTimestampPacket .set (true );
303+ auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver <FamilyType>();
304+ commandStreamReceiver.isPreambleSent = true ;
305+ configureCSRtoNonDirtyState<FamilyType>();
306+ commandStreamReceiver.taskLevel = taskLevel;
307+ taskLevel++; // submit with higher taskLevel
308+
309+ flushTask (commandStreamReceiver);
310+
311+ parseCommands<FamilyType>(commandStreamReceiver.commandStream , 0 );
312+
313+ auto itorPC = find<typename FamilyType::PIPE_CONTROL *>(cmdList.begin (), cmdList.end ());
314+ EXPECT_EQ (cmdList.end (), itorPC);
315+ }
316+
300317HWTEST_F (CommandStreamReceiverFlushTaskTests, whenSamplerCacheFlushNotRequiredThenDontSendPipecontrol) {
301318 auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver <FamilyType>();
302319 OCLRT::WorkaroundTable *waTable = nullptr ;
@@ -2902,6 +2919,46 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandStreamReceiverFlushTaskTests, givenCsrInBatch
29022919 EXPECT_NE (itorPipeControl, itorBatchBufferStartSecond);
29032920}
29042921
2922+ HWTEST_F (CommandStreamReceiverFlushTaskTests, givenCsrInBatchingModeAndOoqFlagSetToFalseWhenDebugVariableIsSetThenNoopPipeControl) {
2923+ DebugManagerStateRestore restore;
2924+ CommandQueueHw<FamilyType> commandQueue (nullptr , pDevice, 0 );
2925+ auto &commandStream = commandQueue.getCS (4096u );
2926+
2927+ auto mockCsr = new MockCsrHw2<FamilyType>(*platformDevices[0 ], *pDevice->executionEnvironment );
2928+ pDevice->resetCommandStreamReceiver (mockCsr);
2929+
2930+ mockCsr->overrideDispatchPolicy (DispatchMode::BatchedDispatch);
2931+
2932+ auto mockedSubmissionsAggregator = new mockSubmissionsAggregator ();
2933+ mockCsr->overrideSubmissionAggregator (mockedSubmissionsAggregator);
2934+
2935+ DispatchFlags dispatchFlags;
2936+ dispatchFlags.guardCommandBufferWithPipeControl = true ;
2937+ dispatchFlags.outOfOrderExecutionAllowed = false ;
2938+
2939+ auto taskLevelPriorToSubmission = mockCsr->peekTaskLevel ();
2940+
2941+ DebugManager.flags .EnableTimestampPacket .set (false );
2942+ mockCsr->flushTask (commandStream, 0 , dsh, ioh, ssh, taskLevelPriorToSubmission, dispatchFlags, *pDevice);
2943+ mockCsr->flushTask (commandStream, 0 , dsh, ioh, ssh, taskLevelPriorToSubmission, dispatchFlags, *pDevice);
2944+
2945+ auto firstCmdBuffer = mockedSubmissionsAggregator->peekCommandBuffers ().peekHead ();
2946+ EXPECT_EQ (nullptr , firstCmdBuffer->pipeControlThatMayBeErasedLocation );
2947+ auto secondCmdBuffer = firstCmdBuffer->next ;
2948+ EXPECT_EQ (nullptr , secondCmdBuffer->pipeControlThatMayBeErasedLocation );
2949+
2950+ mockCsr->flushBatchedSubmissions ();
2951+
2952+ DebugManager.flags .EnableTimestampPacket .set (true );
2953+ mockCsr->flushTask (commandStream, 0 , dsh, ioh, ssh, taskLevelPriorToSubmission, dispatchFlags, *pDevice);
2954+ mockCsr->flushTask (commandStream, 0 , dsh, ioh, ssh, taskLevelPriorToSubmission, dispatchFlags, *pDevice);
2955+
2956+ firstCmdBuffer = mockedSubmissionsAggregator->peekCommandBuffers ().peekHead ();
2957+ EXPECT_NE (nullptr , firstCmdBuffer->pipeControlThatMayBeErasedLocation );
2958+ secondCmdBuffer = firstCmdBuffer->next ;
2959+ EXPECT_NE (nullptr , secondCmdBuffer->pipeControlThatMayBeErasedLocation );
2960+ }
2961+
29052962HWCMDTEST_F (IGFX_GEN8_CORE, CommandStreamReceiverFlushTaskTests, givenCsrInBatchingModeWhenPipeControlForNoopAddressIsNullThenPipeControlIsNotNooped) {
29062963 CommandQueueHw<FamilyType> commandQueue (nullptr , pDevice, 0 );
29072964 auto &commandStream = commandQueue.getCS (4096u );
0 commit comments