diff --git a/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_tests_xehp_and_later.cpp b/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_tests_xehp_and_later.cpp index 703c93c8dd..25ec011c76 100644 --- a/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_tests_xehp_and_later.cpp +++ b/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_tests_xehp_and_later.cpp @@ -186,15 +186,23 @@ HWTEST2_F(CommandStreamReceiverFlushTaskXeHPAndLaterTests, givenProgramPipeContr parseCommands(commandStreamReceiver.getCS(0)); auto requiredCmdSize = PreemptionHelper::getRequiredStateSipCmdSize(*pDevice, false); - auto cmdSize = sizeof(STATE_SIP); - const auto &hwInfoConfig = *HwInfoConfig::get(defaultHwInfo->platform.eProductFamily); - const auto &[isBasicWARequired, isExtendedWARequired] = hwInfoConfig.isPipeControlPriorToNonPipelinedStateCommandsWARequired(*defaultHwInfo, commandStreamReceiver.isRcs()); - std::ignore = isExtendedWARequired; - if (isBasicWARequired) { - cmdSize += sizeof(PIPE_CONTROL); - } + auto cmdSize = sizeof(STATE_SIP) + sizeof(PIPE_CONTROL); EXPECT_EQ(cmdSize, requiredCmdSize); + // first PC prior SBA + auto pipeControlIterator = find(cmdList.begin(), cmdList.end()); + pipeControlIterator = find(++pipeControlIterator, cmdList.end()); + auto pipeControlCmd = genCmdCast(*pipeControlIterator); + + EXPECT_TRUE(UnitTestHelper::getPipeControlHdcPipelineFlush(*pipeControlCmd)); + EXPECT_TRUE(pipeControlCmd->getUnTypedDataPortCacheFlush()); + + EXPECT_FALSE(pipeControlCmd->getAmfsFlushEnable()); + EXPECT_FALSE(pipeControlCmd->getInstructionCacheInvalidateEnable()); + EXPECT_FALSE(pipeControlCmd->getTextureCacheInvalidationEnable()); + EXPECT_FALSE(pipeControlCmd->getConstantCacheInvalidationEnable()); + EXPECT_FALSE(pipeControlCmd->getStateCacheInvalidationEnable()); + auto sipIterator = find(cmdList.begin(), cmdList.end()); auto sipCmd = genCmdCast(*sipIterator); diff --git a/shared/source/xe_hpg_core/dg2/os_agnostic_hw_info_config_dg2.inl b/shared/source/xe_hpg_core/dg2/os_agnostic_hw_info_config_dg2.inl index 6308a8201e..7aecd16690 100644 --- a/shared/source/xe_hpg_core/dg2/os_agnostic_hw_info_config_dg2.inl +++ b/shared/source/xe_hpg_core/dg2/os_agnostic_hw_info_config_dg2.inl @@ -136,13 +136,14 @@ bool HwInfoConfigHw::isPrefetchDisablingRequired(const HardwareInfo template <> std::pair HwInfoConfigHw::isPipeControlPriorToNonPipelinedStateCommandsWARequired(const HardwareInfo &hwInfo, bool isRcs) const { - auto waRequired = hwInfo.gtSystemInfo.CCSInfo.NumberOfCCSEnabled > 1 && !isRcs; + auto isBasicWARequired = true; + auto isExtendedWARequired = hwInfo.gtSystemInfo.CCSInfo.NumberOfCCSEnabled > 1 && !isRcs; if (DebugManager.flags.ProgramExtendedPipeControlPriorToNonPipelinedStateCommand.get() != -1) { - waRequired = DebugManager.flags.ProgramExtendedPipeControlPriorToNonPipelinedStateCommand.get(); + isExtendedWARequired = DebugManager.flags.ProgramExtendedPipeControlPriorToNonPipelinedStateCommand.get(); } - return {waRequired, waRequired}; + return {isBasicWARequired, isExtendedWARequired}; } template <> diff --git a/shared/test/unit_test/xe_hpg_core/compute_mode_tests_xe_hpg_core.cpp b/shared/test/unit_test/xe_hpg_core/compute_mode_tests_xe_hpg_core.cpp index 9b565c4e62..28deff0a67 100644 --- a/shared/test/unit_test/xe_hpg_core/compute_mode_tests_xe_hpg_core.cpp +++ b/shared/test/unit_test/xe_hpg_core/compute_mode_tests_xe_hpg_core.cpp @@ -106,13 +106,7 @@ XE_HPG_CORETEST_F(ComputeModeRequirementsXeHpgCore, givenComputeModeCmdSizeWhenL overrideComputeModeRequest(false, false, false, false, 128u); EXPECT_FALSE(getCsrHw()->streamProperties.stateComputeMode.isDirty()); - auto cmdSize = sizeof(STATE_COMPUTE_MODE); - const auto &hwInfoConfig = *HwInfoConfig::get(defaultHwInfo->platform.eProductFamily); - const auto &[isBasicWARequired, isExtendedWARequired] = hwInfoConfig.isPipeControlPriorToNonPipelinedStateCommandsWARequired(*defaultHwInfo, getCsrHw()->isRcs()); - std::ignore = isExtendedWARequired; - if (isBasicWARequired) { - cmdSize += sizeof(PIPE_CONTROL); - } + auto cmdSize = sizeof(STATE_COMPUTE_MODE) + sizeof(PIPE_CONTROL); overrideComputeModeRequest(false, false, false, true, 256u); auto retSize = getCsrHw()->getCmdSizeForComputeMode(); @@ -136,13 +130,7 @@ XE_HPG_CORETEST_F(ComputeModeRequirementsXeHpgCore, givenCoherencyWithSharedHand overrideComputeModeRequest(false, true, true); EXPECT_FALSE(getCsrHw()->streamProperties.stateComputeMode.isDirty()); - auto cmdsSize = sizeof(STATE_COMPUTE_MODE) + sizeof(PIPE_CONTROL); - const auto &hwInfoConfig = *HwInfoConfig::get(defaultHwInfo->platform.eProductFamily); - const auto &[isBasicWARequired, isExtendedWARequired] = hwInfoConfig.isPipeControlPriorToNonPipelinedStateCommandsWARequired(*defaultHwInfo, getCsrHw()->isRcs()); - std::ignore = isExtendedWARequired; - if (isBasicWARequired) { - cmdsSize += sizeof(PIPE_CONTROL); - } + auto cmdsSize = sizeof(STATE_COMPUTE_MODE) + (2 * sizeof(PIPE_CONTROL)); overrideComputeModeRequest(true, true, true); auto retSize = getCsrHw()->getCmdSizeForComputeMode(); @@ -160,13 +148,7 @@ XE_HPG_CORETEST_F(ComputeModeRequirementsXeHpgCore, givenCoherencyWithoutSharedH using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL; setUpImpl(); - auto cmdsSize = sizeof(STATE_COMPUTE_MODE); - const auto &hwInfoConfig = *HwInfoConfig::get(defaultHwInfo->platform.eProductFamily); - const auto &[isBasicWARequired, isExtendedWARequired] = hwInfoConfig.isPipeControlPriorToNonPipelinedStateCommandsWARequired(*defaultHwInfo, getCsrHw()->isRcs()); - std::ignore = isExtendedWARequired; - if (isBasicWARequired) { - cmdsSize += sizeof(PIPE_CONTROL); - } + auto cmdsSize = sizeof(STATE_COMPUTE_MODE) + sizeof(PIPE_CONTROL); overrideComputeModeRequest(false, false, false, false); EXPECT_FALSE(getCsrHw()->streamProperties.stateComputeMode.isDirty()); diff --git a/shared/test/unit_test/xe_hpg_core/dg2/compute_mode_tests_dg2.cpp b/shared/test/unit_test/xe_hpg_core/dg2/compute_mode_tests_dg2.cpp index f089eb3992..17d46c056c 100644 --- a/shared/test/unit_test/xe_hpg_core/dg2/compute_mode_tests_dg2.cpp +++ b/shared/test/unit_test/xe_hpg_core/dg2/compute_mode_tests_dg2.cpp @@ -123,7 +123,7 @@ HWTEST2_F(ComputeModeRequirements, GivenSingleCCSEnabledSetupThenCorrectCommands using FORCE_NON_COHERENT = typename STATE_COMPUTE_MODE::FORCE_NON_COHERENT; using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL; - auto cmdsSize = sizeof(STATE_COMPUTE_MODE); + auto cmdsSize = sizeof(STATE_COMPUTE_MODE) + sizeof(PIPE_CONTROL); char buff[1024] = {0}; LinearStream stream(buff, 1024); @@ -144,7 +144,19 @@ HWTEST2_F(ComputeModeRequirements, GivenSingleCCSEnabledSetupThenCorrectCommands HardwareParse hwParser; hwParser.parseCommands(stream, startOffset); - auto stateComputeModeCmd = reinterpret_cast(stream.getCpuBase()); + auto pipeControlIterator = find(hwParser.cmdList.begin(), hwParser.cmdList.end()); + auto pipeControlCmd = genCmdCast(*pipeControlIterator); + + EXPECT_TRUE(UnitTestHelper::getPipeControlHdcPipelineFlush(*pipeControlCmd)); + EXPECT_TRUE(pipeControlCmd->getUnTypedDataPortCacheFlush()); + + EXPECT_FALSE(pipeControlCmd->getAmfsFlushEnable()); + EXPECT_FALSE(pipeControlCmd->getInstructionCacheInvalidateEnable()); + EXPECT_FALSE(pipeControlCmd->getTextureCacheInvalidationEnable()); + EXPECT_FALSE(pipeControlCmd->getConstantCacheInvalidationEnable()); + EXPECT_FALSE(pipeControlCmd->getStateCacheInvalidationEnable()); + + auto stateComputeModeCmd = reinterpret_cast(ptrOffset(stream.getCpuBase(), sizeof(PIPE_CONTROL))); EXPECT_TRUE(isValueSet(stateComputeModeCmd->getMaskBits(), expectedBitsMask)); expectedScmCmd.setMaskBits(stateComputeModeCmd->getMaskBits()); EXPECT_TRUE(memcmp(&expectedScmCmd, stateComputeModeCmd, sizeof(STATE_COMPUTE_MODE)) == 0); diff --git a/shared/test/unit_test/xe_hpg_core/dg2/hw_info_config_tests_dg2.cpp b/shared/test/unit_test/xe_hpg_core/dg2/hw_info_config_tests_dg2.cpp index 982b70009c..79676e12c0 100644 --- a/shared/test/unit_test/xe_hpg_core/dg2/hw_info_config_tests_dg2.cpp +++ b/shared/test/unit_test/xe_hpg_core/dg2/hw_info_config_tests_dg2.cpp @@ -180,7 +180,7 @@ DG2TEST_F(HwInfoConfigTestDg2, givenProgramPipeControlPriorToNonPipelinedStateCo const auto &[isBasicWARequired, isExtendedWARequired] = hwInfoConfig.isPipeControlPriorToNonPipelinedStateCommandsWARequired(hwInfo, isRcs); EXPECT_FALSE(isExtendedWARequired); - EXPECT_FALSE(isBasicWARequired); + EXPECT_TRUE(isBasicWARequired); } DG2TEST_F(HwInfoConfigTestDg2, givenHwInfoConfigWithMultipleCSSWhenIsPipeControlPriorToNonPipelinedStateCommandsWARequiredIsCalledOnCcsThenTrueIsReturned) { @@ -204,7 +204,7 @@ DG2TEST_F(HwInfoConfigTestDg2, givenHwInfoConfigWithMultipleCSSWhenIsPipeControl const auto &[isBasicWARequired, isExtendedWARequired] = hwInfoConfig.isPipeControlPriorToNonPipelinedStateCommandsWARequired(hwInfo, isRcs); EXPECT_FALSE(isExtendedWARequired); - EXPECT_FALSE(isBasicWARequired); + EXPECT_TRUE(isBasicWARequired); } DG2TEST_F(HwInfoConfigTestDg2, givenHwInfoConfigWithSingleCSSWhenIsPipeControlPriorToNonPipelinedStateCommandsWARequiredIsCalledOnCcsThenTrueIsReturned) { @@ -216,7 +216,7 @@ DG2TEST_F(HwInfoConfigTestDg2, givenHwInfoConfigWithSingleCSSWhenIsPipeControlPr const auto &[isBasicWARequired, isExtendedWARequired] = hwInfoConfig.isPipeControlPriorToNonPipelinedStateCommandsWARequired(hwInfo, isRcs); EXPECT_FALSE(isExtendedWARequired); - EXPECT_FALSE(isBasicWARequired); + EXPECT_TRUE(isBasicWARequired); } DG2TEST_F(HwInfoConfigTestDg2, givenHwInfoConfigWithSingleCSSWhenIsPipeControlPriorToNonPipelinedStateCommandsWARequiredIsCalledOnRcsThenTrueIsReturned) { @@ -228,7 +228,7 @@ DG2TEST_F(HwInfoConfigTestDg2, givenHwInfoConfigWithSingleCSSWhenIsPipeControlPr const auto &[isBasicWARequired, isExtendedWARequired] = hwInfoConfig.isPipeControlPriorToNonPipelinedStateCommandsWARequired(hwInfo, isRcs); EXPECT_FALSE(isExtendedWARequired); - EXPECT_FALSE(isBasicWARequired); + EXPECT_TRUE(isBasicWARequired); } DG2TEST_F(HwInfoConfigTestDg2, givenDg2WhenIsBlitterForImagesSupportedIsCalledThenTrueIsReturned) {