diff --git a/opencl/test/unit_test/xe_hpc_core/pvc/test_hw_info_config_pvc.cpp b/opencl/test/unit_test/xe_hpc_core/pvc/test_hw_info_config_pvc.cpp index fc4783db87..3236829229 100644 --- a/opencl/test/unit_test/xe_hpc_core/pvc/test_hw_info_config_pvc.cpp +++ b/opencl/test/unit_test/xe_hpc_core/pvc/test_hw_info_config_pvc.cpp @@ -44,7 +44,7 @@ PVCTEST_F(PvcHwInfoConfig, givenHwInfoConfigWhenAskedIfPipeControlPriorToNonPipe const auto &[isBasicWARequired, isExtendedWARequired] = hwInfoConfig.isPipeControlPriorToNonPipelinedStateCommandsWARequired(hwInfo, isRcs); EXPECT_TRUE(isBasicWARequired); - EXPECT_TRUE(isExtendedWARequired); + EXPECT_FALSE(isExtendedWARequired); } PVCTEST_F(PvcHwInfoConfig, givenPvcHwInfoConfigWhenCheckDirectSubmissionSupportedThenTrueIsReturned) { @@ -153,4 +153,4 @@ PVCTEST_F(PvcHwInfo, givenPvcHwInfoConfigWhenIsIpSamplingSupportedThenCorrectRes hwInfo.platform.usDeviceID = deviceId; EXPECT_TRUE(hwInfoConfig.isIpSamplingSupported(hwInfo)); } -} \ No newline at end of file +} diff --git a/shared/source/command_stream/command_stream_receiver_hw_dg2_and_later.inl b/shared/source/command_stream/command_stream_receiver_hw_dg2_and_later.inl index 1aabcb3bd2..637e9868f3 100644 --- a/shared/source/command_stream/command_stream_receiver_hw_dg2_and_later.inl +++ b/shared/source/command_stream/command_stream_receiver_hw_dg2_and_later.inl @@ -49,6 +49,14 @@ size_t CommandStreamReceiverHw::getCmdSizeForPerDssBackedBuffer(const Ha template inline void CommandStreamReceiverHw::addPipeControlBefore3dState(LinearStream &commandStream, DispatchFlags &dispatchFlags) { + if (!dispatchFlags.usePerDssBackedBuffer) { + return; + } + + if (isPerDssBackedBufferSent) { + return; + } + auto &hwInfo = peekHwInfo(); auto hwInfoConfig = HwInfoConfig::get(hwInfo.platform.eProductFamily); const auto &[isBasicWARequired, isExtendedWARequired] = hwInfoConfig->isPipeControlPriorToNonPipelinedStateCommandsWARequired(hwInfo, isRcs()); @@ -57,9 +65,8 @@ inline void CommandStreamReceiverHw::addPipeControlBefore3dState(Line PipeControlArgs args; args.dcFlushEnable = MemorySynchronizationCommands::getDcFlushEnable(true, hwInfo); - if (isExtendedWARequired && dispatchFlags.usePerDssBackedBuffer && !isPerDssBackedBufferSent) { + if (isExtendedWARequired) { DEBUG_BREAK_IF(perDssBackedBuffer == nullptr); - NEO::EncodeWA::addPipeControlPriorToNonPipelinedStateCommand(commandStream, args, hwInfo, isRcs()); } } diff --git a/shared/source/xe_hpc_core/os_agnostic_hw_info_config_xe_hpc_core.inl b/shared/source/xe_hpc_core/os_agnostic_hw_info_config_xe_hpc_core.inl index 6d7849e04f..a3a809feae 100644 --- a/shared/source/xe_hpc_core/os_agnostic_hw_info_config_xe_hpc_core.inl +++ b/shared/source/xe_hpc_core/os_agnostic_hw_info_config_xe_hpc_core.inl @@ -28,7 +28,7 @@ bool HwInfoConfigHw::isFlushTaskAllowed() const { template <> std::pair HwInfoConfigHw::isPipeControlPriorToNonPipelinedStateCommandsWARequired(const HardwareInfo &hwInfo, bool isRcs) const { auto isBasicWARequired = true; - auto isExtendedWARequired = hwInfo.gtSystemInfo.CCSInfo.NumberOfCCSEnabled > 1; + auto isExtendedWARequired = false; if (DebugManager.flags.ProgramExtendedPipeControlPriorToNonPipelinedStateCommand.get() != -1) { isExtendedWARequired = DebugManager.flags.ProgramExtendedPipeControlPriorToNonPipelinedStateCommand.get(); diff --git a/shared/test/common/libult/ult_command_stream_receiver.h b/shared/test/common/libult/ult_command_stream_receiver.h index 61c51a24bc..fe36dd39d3 100644 --- a/shared/test/common/libult/ult_command_stream_receiver.h +++ b/shared/test/common/libult/ult_command_stream_receiver.h @@ -28,6 +28,7 @@ class UltCommandStreamReceiver : public CommandStreamReceiverHw, publ using BaseClass = CommandStreamReceiverHw; public: + using BaseClass::addPipeControlBefore3dState; using BaseClass::blitterDirectSubmission; using BaseClass::checkPlatformSupportsGpuIdleImplicitFlush; using BaseClass::checkPlatformSupportsNewResourceImplicitFlush; @@ -125,7 +126,6 @@ class UltCommandStreamReceiver : public CommandStreamReceiverHw, publ using BaseClass::CommandStreamReceiver::userPauseConfirmation; using BaseClass::CommandStreamReceiver::waitForTaskCountAndCleanAllocationList; using BaseClass::CommandStreamReceiver::workPartitionAllocation; - ; UltCommandStreamReceiver(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex, diff --git a/shared/test/unit_test/xe_hpc_core/compute_mode_tests_xe_hpc_core.cpp b/shared/test/unit_test/xe_hpc_core/compute_mode_tests_xe_hpc_core.cpp index 34597973ee..a768a23aca 100644 --- a/shared/test/unit_test/xe_hpc_core/compute_mode_tests_xe_hpc_core.cpp +++ b/shared/test/unit_test/xe_hpc_core/compute_mode_tests_xe_hpc_core.cpp @@ -378,13 +378,13 @@ HWTEST2_F(XeHpcComputeModeRequirements, givenComputeModeProgrammingThenCorrectCo auto pipeControlCmd = genCmdCast(*pipeControlIterator); EXPECT_TRUE(pipeControlCmd->getHdcPipelineFlush()); - EXPECT_TRUE(pipeControlCmd->getAmfsFlushEnable()); + EXPECT_FALSE(pipeControlCmd->getAmfsFlushEnable()); EXPECT_TRUE(pipeControlCmd->getCommandStreamerStallEnable()); - EXPECT_TRUE(pipeControlCmd->getInstructionCacheInvalidateEnable()); - EXPECT_TRUE(pipeControlCmd->getTextureCacheInvalidationEnable()); + EXPECT_FALSE(pipeControlCmd->getInstructionCacheInvalidateEnable()); + EXPECT_FALSE(pipeControlCmd->getTextureCacheInvalidationEnable()); EXPECT_TRUE(pipeControlCmd->getUnTypedDataPortCacheFlush()); - EXPECT_TRUE(pipeControlCmd->getConstantCacheInvalidationEnable()); - EXPECT_TRUE(pipeControlCmd->getStateCacheInvalidationEnable()); + EXPECT_FALSE(pipeControlCmd->getConstantCacheInvalidationEnable()); + EXPECT_FALSE(pipeControlCmd->getStateCacheInvalidationEnable()); auto stateComputeModeCmd = reinterpret_cast(ptrOffset(stream.getCpuBase(), sizeof(PIPE_CONTROL))); expectedScmCmd.setMaskBits(stateComputeModeCmd->getMaskBits()); @@ -439,6 +439,39 @@ HWTEST2_F(XeHpcComputeModeRequirements, givenProgramExtendedPipeControlPriorToNo EXPECT_TRUE(memcmp(&expectedScmCmd, stateComputeModeCmd, sizeof(STATE_COMPUTE_MODE)) == 0); } +HWTEST2_F(XeHpcComputeModeRequirements, givenProgramExtendedPipeControlPriorToNonPipelinedStateCommandEnabledWhenaddPipeControlBefore3dStateIsCalledThenCorrectCommandsAreAdded, IsXeHpcCore) { + DebugManagerStateRestore dbgRestorer; + DebugManager.flags.ProgramExtendedPipeControlPriorToNonPipelinedStateCommand.set(true); + + HardwareInfo hwInfo = *defaultHwInfo; + hwInfo.gtSystemInfo.CCSInfo.NumberOfCCSEnabled = 1; + + setUpImpl(&hwInfo); + using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL; + char buff[1024] = {0}; + LinearStream stream(buff, 1024); + flags.usePerDssBackedBuffer = true; + getCsrHw()->addPipeControlBefore3dState(stream, flags); + + auto startOffset = getCsrHw()->commandStream.getUsed(); + + HardwareParse hwParser; + + hwParser.parseCommands(stream, startOffset); + + auto pipeControlIterator = find(hwParser.cmdList.begin(), hwParser.cmdList.end()); + auto pipeControlCmd = genCmdCast(*pipeControlIterator); + + EXPECT_TRUE(pipeControlCmd->getHdcPipelineFlush()); + EXPECT_TRUE(pipeControlCmd->getAmfsFlushEnable()); + EXPECT_TRUE(pipeControlCmd->getCommandStreamerStallEnable()); + EXPECT_TRUE(pipeControlCmd->getInstructionCacheInvalidateEnable()); + EXPECT_TRUE(pipeControlCmd->getTextureCacheInvalidationEnable()); + EXPECT_TRUE(pipeControlCmd->getUnTypedDataPortCacheFlush()); + EXPECT_TRUE(pipeControlCmd->getConstantCacheInvalidationEnable()); + EXPECT_TRUE(pipeControlCmd->getStateCacheInvalidationEnable()); +} + HWTEST2_F(XeHpcComputeModeRequirements, GivenSingleCCSEnabledSetupThenCorrectCommandsAreAdded, IsXeHpcCore) { HardwareInfo hwInfo = *defaultHwInfo; hwInfo.gtSystemInfo.CCSInfo.NumberOfCCSEnabled = 1;