@@ -894,6 +894,46 @@ HWTEST_F(UltCommandStreamReceiverTest, addPipeControlWithFlushAllCaches) {
894894 EXPECT_TRUE (pipeControl->getStateCacheInvalidationEnable ());
895895}
896896
897+ HWTEST_F (UltCommandStreamReceiverTest, givenDebugDisablingCacheFlushWhenAddingPipeControlWithCacheFlushThenOverrideRequestAndDisableCacheFlushFlags) {
898+ using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL;
899+ DebugManagerStateRestore dbgRestorer;
900+ DebugManager.flags .DoNotFlushCaches .set (true );
901+
902+ char buff[sizeof (PIPE_CONTROL) * 3 ];
903+ LinearStream stream (buff, sizeof (PIPE_CONTROL) * 3 );
904+
905+ PipeControlArgs args (true );
906+ args.constantCacheInvalidationEnable = true ;
907+ args.instructionCacheInvalidateEnable = true ;
908+ args.pipeControlFlushEnable = true ;
909+ args.renderTargetCacheFlushEnable = true ;
910+ args.stateCacheInvalidationEnable = true ;
911+ args.textureCacheInvalidationEnable = true ;
912+ args.vfCacheInvalidationEnable = true ;
913+
914+ MemorySynchronizationCommands<FamilyType>::addPipeControl (stream, args);
915+
916+ parseCommands<FamilyType>(stream, 0 );
917+
918+ PIPE_CONTROL *pipeControl = getCommand<PIPE_CONTROL>();
919+
920+ ASSERT_NE (nullptr , pipeControl);
921+
922+ // WA pipeControl added
923+ if (cmdList.size () == 2 ) {
924+ pipeControl++;
925+ }
926+
927+ EXPECT_FALSE (pipeControl->getDcFlushEnable ());
928+ EXPECT_FALSE (pipeControl->getRenderTargetCacheFlushEnable ());
929+ EXPECT_FALSE (pipeControl->getInstructionCacheInvalidateEnable ());
930+ EXPECT_FALSE (pipeControl->getTextureCacheInvalidationEnable ());
931+ EXPECT_FALSE (pipeControl->getPipeControlFlushEnable ());
932+ EXPECT_FALSE (pipeControl->getVfCacheInvalidationEnable ());
933+ EXPECT_FALSE (pipeControl->getConstantCacheInvalidationEnable ());
934+ EXPECT_FALSE (pipeControl->getStateCacheInvalidationEnable ());
935+ }
936+
897937HWCMDTEST_F (IGFX_GEN8_CORE, CommandStreamReceiverFlushTaskTests, givenEnabledPreemptionWhenFlushTaskCalledThenDontProgramMediaVfeStateAgain) {
898938 pDevice->setPreemptionMode (PreemptionMode::ThreadGroup);
899939 auto &csr = pDevice->getUltCommandStreamReceiver <FamilyType>();
0 commit comments