diff --git a/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_2_tests.cpp b/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_2_tests.cpp index edc3ce579c..5ec87d0ab6 100644 --- a/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_2_tests.cpp +++ b/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_2_tests.cpp @@ -958,80 +958,6 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, GivenForced32BitAllocationsModeSto } } -HWTEST_F(UltCommandStreamReceiverTest, WhenFlushingAllCachesThenPipeControlIsAdded) { - typedef typename FamilyType::PIPE_CONTROL PIPE_CONTROL; - DebugManagerStateRestore dbgRestorer; - DebugManager.flags.FlushAllCaches.set(true); - - char buff[sizeof(PIPE_CONTROL) * 3]; - LinearStream stream(buff, sizeof(PIPE_CONTROL) * 3); - - PipeControlArgs args; - MemorySynchronizationCommands::addPipeControl(stream, args); - - parseCommands(stream, 0); - - PIPE_CONTROL *pipeControl = getCommand(); - - ASSERT_NE(nullptr, pipeControl); - - // WA pipeControl added - if (cmdList.size() == 2) { - pipeControl++; - } - - EXPECT_TRUE(pipeControl->getDcFlushEnable()); - EXPECT_TRUE(pipeControl->getRenderTargetCacheFlushEnable()); - EXPECT_TRUE(pipeControl->getInstructionCacheInvalidateEnable()); - EXPECT_TRUE(pipeControl->getTextureCacheInvalidationEnable()); - EXPECT_TRUE(pipeControl->getPipeControlFlushEnable()); - EXPECT_TRUE(pipeControl->getVfCacheInvalidationEnable()); - EXPECT_TRUE(pipeControl->getConstantCacheInvalidationEnable()); - EXPECT_TRUE(pipeControl->getStateCacheInvalidationEnable()); - EXPECT_TRUE(pipeControl->getTlbInvalidate()); -} - -HWTEST_F(UltCommandStreamReceiverTest, givenDebugDisablingCacheFlushWhenAddingPipeControlWithCacheFlushThenOverrideRequestAndDisableCacheFlushFlags) { - using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL; - DebugManagerStateRestore dbgRestorer; - DebugManager.flags.DoNotFlushCaches.set(true); - - char buff[sizeof(PIPE_CONTROL) * 3]; - LinearStream stream(buff, sizeof(PIPE_CONTROL) * 3); - - PipeControlArgs args; - args.dcFlushEnable = true; - args.constantCacheInvalidationEnable = true; - args.instructionCacheInvalidateEnable = true; - args.pipeControlFlushEnable = true; - args.renderTargetCacheFlushEnable = true; - args.stateCacheInvalidationEnable = true; - args.textureCacheInvalidationEnable = true; - args.vfCacheInvalidationEnable = true; - - MemorySynchronizationCommands::addPipeControl(stream, args); - - parseCommands(stream, 0); - - PIPE_CONTROL *pipeControl = getCommand(); - - ASSERT_NE(nullptr, pipeControl); - - // WA pipeControl added - if (cmdList.size() == 2) { - pipeControl++; - } - - EXPECT_FALSE(pipeControl->getDcFlushEnable()); - EXPECT_FALSE(pipeControl->getRenderTargetCacheFlushEnable()); - EXPECT_FALSE(pipeControl->getInstructionCacheInvalidateEnable()); - EXPECT_FALSE(pipeControl->getTextureCacheInvalidationEnable()); - EXPECT_FALSE(pipeControl->getPipeControlFlushEnable()); - EXPECT_FALSE(pipeControl->getVfCacheInvalidationEnable()); - EXPECT_FALSE(pipeControl->getConstantCacheInvalidationEnable()); - EXPECT_FALSE(pipeControl->getStateCacheInvalidationEnable()); -} - HWCMDTEST_F(IGFX_GEN8_CORE, CommandStreamReceiverFlushTaskTests, givenEnabledPreemptionWhenFlushTaskCalledThenDontProgramMediaVfeStateAgain) { pDevice->setPreemptionMode(PreemptionMode::ThreadGroup); auto &csr = pDevice->getUltCommandStreamReceiver(); diff --git a/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_4_tests.cpp b/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_4_tests.cpp index b1cc0b8e23..8275aa298d 100644 --- a/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_4_tests.cpp +++ b/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_4_tests.cpp @@ -763,3 +763,77 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenTagValueNotMeetingTaskCountTo const auto ret = mockCsr->waitForCompletionWithTimeout(WaitParams{true, true, 10}, taskCountToWait); EXPECT_EQ(NEO::WaitStatus::NotReady, ret); } + +HWTEST_F(UltCommandStreamReceiverTest, WhenFlushingAllCachesThenPipeControlIsAdded) { + typedef typename FamilyType::PIPE_CONTROL PIPE_CONTROL; + DebugManagerStateRestore dbgRestorer; + DebugManager.flags.FlushAllCaches.set(true); + + char buff[sizeof(PIPE_CONTROL) * 3]; + LinearStream stream(buff, sizeof(PIPE_CONTROL) * 3); + + PipeControlArgs args; + MemorySynchronizationCommands::addPipeControl(stream, args); + + parseCommands(stream, 0); + + PIPE_CONTROL *pipeControl = getCommand(); + + ASSERT_NE(nullptr, pipeControl); + + // WA pipeControl added + if (cmdList.size() == 2) { + pipeControl++; + } + + EXPECT_TRUE(pipeControl->getDcFlushEnable()); + EXPECT_TRUE(pipeControl->getRenderTargetCacheFlushEnable()); + EXPECT_TRUE(pipeControl->getInstructionCacheInvalidateEnable()); + EXPECT_TRUE(pipeControl->getTextureCacheInvalidationEnable()); + EXPECT_TRUE(pipeControl->getPipeControlFlushEnable()); + EXPECT_TRUE(pipeControl->getVfCacheInvalidationEnable()); + EXPECT_TRUE(pipeControl->getConstantCacheInvalidationEnable()); + EXPECT_TRUE(pipeControl->getStateCacheInvalidationEnable()); + EXPECT_TRUE(pipeControl->getTlbInvalidate()); +} + +HWTEST_F(UltCommandStreamReceiverTest, givenDebugDisablingCacheFlushWhenAddingPipeControlWithCacheFlushThenOverrideRequestAndDisableCacheFlushFlags) { + using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL; + DebugManagerStateRestore dbgRestorer; + DebugManager.flags.DoNotFlushCaches.set(true); + + char buff[sizeof(PIPE_CONTROL) * 3]; + LinearStream stream(buff, sizeof(PIPE_CONTROL) * 3); + + PipeControlArgs args; + args.dcFlushEnable = true; + args.constantCacheInvalidationEnable = true; + args.instructionCacheInvalidateEnable = true; + args.pipeControlFlushEnable = true; + args.renderTargetCacheFlushEnable = true; + args.stateCacheInvalidationEnable = true; + args.textureCacheInvalidationEnable = true; + args.vfCacheInvalidationEnable = true; + + MemorySynchronizationCommands::addPipeControl(stream, args); + + parseCommands(stream, 0); + + PIPE_CONTROL *pipeControl = getCommand(); + + ASSERT_NE(nullptr, pipeControl); + + // WA pipeControl added + if (cmdList.size() == 2) { + pipeControl++; + } + + EXPECT_FALSE(pipeControl->getDcFlushEnable()); + EXPECT_FALSE(pipeControl->getRenderTargetCacheFlushEnable()); + EXPECT_FALSE(pipeControl->getInstructionCacheInvalidateEnable()); + EXPECT_FALSE(pipeControl->getTextureCacheInvalidationEnable()); + EXPECT_FALSE(pipeControl->getPipeControlFlushEnable()); + EXPECT_FALSE(pipeControl->getVfCacheInvalidationEnable()); + EXPECT_FALSE(pipeControl->getConstantCacheInvalidationEnable()); + EXPECT_FALSE(pipeControl->getStateCacheInvalidationEnable()); +}