From 3511b4755fe5336d21540bdcb6680faab78f2bc8 Mon Sep 17 00:00:00 2001 From: Filip Hazubski Date: Thu, 9 Dec 2021 11:01:40 +0000 Subject: [PATCH] Remove redundant coherency variables for SCM Remove CommandStreamReceiver::lastSentCoherencyRequest Remove CsrSizeRequestFlags::coherencyRequestChanged Related-To: NEO-5995 Signed-off-by: Filip Hazubski --- .../command_stream_receiver_flush_task_1_tests.cpp | 13 +++++++++---- .../command_stream_receiver_flush_task_2_tests.cpp | 4 +++- .../command_stream_receiver_flush_task_3_tests.cpp | 2 +- ...eam_receiver_flush_task_tests_xehp_and_later.cpp | 4 ++-- ...mmand_stream_receiver_hw_tests_dg2_and_later.cpp | 2 ++ .../unit_test/command_stream/compute_mode_tests.h | 1 - .../fixtures/ult_command_stream_receiver_fixture.h | 3 ++- .../test/unit_test/gen11/coherency_tests_gen11.cpp | 4 +++- .../unit_test/gen12lp/coherency_tests_gen12lp.inl | 1 - .../xe_hpc_core/pvc/compute_mode_tests_pvc.cpp | 5 ++--- .../command_stream/command_stream_receiver.cpp | 1 - .../source/command_stream/command_stream_receiver.h | 1 - .../command_stream_receiver_hw_base.inl | 1 - .../command_stream_receiver_hw_tgllp_and_later.inl | 4 ++-- shared/source/command_stream/csr_definitions.h | 1 - .../definitions/stream_properties.inl | 4 ++-- shared/source/command_stream/stream_properties.cpp | 4 ++-- .../gen11/command_stream_receiver_hw_gen11.cpp | 5 ++--- .../gen12lp/command_stream_receiver_hw_gen12lp.cpp | 2 +- .../gen12lp/state_compute_mode_helper_gen12lp.cpp | 2 +- .../state_compute_mode_helper_xe_hp_core.cpp | 2 +- .../state_compute_mode_helper_xe_hpc_core.cpp | 2 +- .../state_compute_mode_helper_xe_hpg_core.cpp | 2 +- .../common/libult/ult_command_stream_receiver.h | 2 +- .../common/mocks/mock_command_stream_receiver.h | 2 +- .../command_stream_receiver_tests.cpp | 1 - 26 files changed, 39 insertions(+), 36 deletions(-) diff --git a/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_1_tests.cpp b/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_1_tests.cpp index 4295fc6b9b..d2bb39f4a3 100644 --- a/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_1_tests.cpp +++ b/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_1_tests.cpp @@ -939,7 +939,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, GivenEnoughMemoryOnlyForPreambleWh // Force a PIPE_CONTROL through a taskLevel transition taskLevel = commandStreamReceiver.peekTaskLevel() + 1; - commandStreamReceiver.lastSentCoherencyRequest = 0; + commandStreamReceiver.streamProperties.stateComputeMode.isCoherencyRequired.value = 0; auto l3Config = PreambleHelper::getL3Config(pDevice->getHardwareInfo(), false); commandStreamReceiver.lastSentL3Config = l3Config; @@ -952,6 +952,8 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, GivenEnoughMemoryOnlyForPreambleWh csrCS.getSpace(csrCS.getAvailableSpace() - sizeNeededForPreamble); + commandStreamReceiver.streamProperties.stateComputeMode.setProperties(flushTaskFlags.requiresCoherency, flushTaskFlags.numGrfRequired, + commandStreamReceiver.requiredThreadArbitrationPolicy); flushTask(commandStreamReceiver); EXPECT_EQ(sizeNeeded, csrCS.getUsed()); @@ -970,7 +972,6 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, GivenEnoughMemoryOnlyForPreambleAn commandStreamReceiver.timestampPacketWriteEnabled = false; // Force a PIPE_CONTROL through a taskLevel transition taskLevel = commandStreamReceiver.peekTaskLevel() + 1; - commandStreamReceiver.lastSentCoherencyRequest = 0; auto l3Config = PreambleHelper::getL3Config(mockDevice->getHardwareInfo(), false); commandStreamReceiver.lastSentL3Config = l3Config; @@ -985,6 +986,8 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, GivenEnoughMemoryOnlyForPreambleAn csrCS.getSpace(csrCS.getAvailableSpace() - sizeNeededForPreamble - sizeNeededForStateBaseAddress); + commandStreamReceiver.streamProperties.stateComputeMode.setProperties(flushTaskFlags.requiresCoherency, flushTaskFlags.numGrfRequired, + commandStreamReceiver.requiredThreadArbitrationPolicy); flushTask(commandStreamReceiver); EXPECT_EQ(sizeNeeded, csrCS.getUsed()); @@ -1005,7 +1008,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, GivenEnoughMemoryOnlyForPreambleAn // Force a PIPE_CONTROL through a taskLevel transition taskLevel = commandStreamReceiver.peekTaskLevel() + 1; - commandStreamReceiver.lastSentCoherencyRequest = 0; + commandStreamReceiver.streamProperties.stateComputeMode.isCoherencyRequired.value = 0; auto l3Config = PreambleHelper::getL3Config(mockDevice->getHardwareInfo(), false); commandStreamReceiver.lastSentL3Config = l3Config; @@ -1021,6 +1024,8 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, GivenEnoughMemoryOnlyForPreambleAn flushTaskFlags.preemptionMode = PreemptionHelper::getDefaultPreemptionMode(mockDevice->getHardwareInfo()); + commandStreamReceiver.streamProperties.stateComputeMode.setProperties(flushTaskFlags.requiresCoherency, flushTaskFlags.numGrfRequired, + commandStreamReceiver.requiredThreadArbitrationPolicy); commandStreamReceiver.flushTask( commandStream, 0, @@ -1159,7 +1164,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandStreamReceiverFlushTaskTests, GivenBlockingWh auto blocking = true; auto &commandStreamTask = commandQueue.getCS(1024); auto &commandStreamCSR = commandStreamReceiver->getCS(); - commandStreamReceiver->lastSentCoherencyRequest = 0; + commandStreamReceiver->streamProperties.stateComputeMode.isCoherencyRequired.value = 0; DispatchFlags dispatchFlags = DispatchFlagsHelper::createDefaultDispatchFlags(); dispatchFlags.preemptionMode = PreemptionHelper::getDefaultPreemptionMode(pDevice->getHardwareInfo()); 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 7248431de4..5d75822898 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 @@ -1039,8 +1039,8 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandStreamReceiverFlushTaskTests, GivenPreambleSe commandStreamReceiver.isPreambleSent = true; commandStreamReceiver.lastPreemptionMode = pDevice->getPreemptionMode(); commandStreamReceiver.lastMediaSamplerConfig = 0; - commandStreamReceiver.lastSentCoherencyRequest = false; commandStreamReceiver.lastSentThreadArbitrationPolicy = commandStreamReceiver.requiredThreadArbitrationPolicy; + commandStreamReceiver.streamProperties.stateComputeMode.isCoherencyRequired.value = 0; csrSizeRequest.l3ConfigChanged = true; commandStreamReceiver.overrideCsrSizeReqFlags(csrSizeRequest); @@ -1050,6 +1050,8 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandStreamReceiverFlushTaskTests, GivenPreambleSe auto expectedUsed = csrCS.getUsed() + sizeNeeded; expectedUsed = alignUp(expectedUsed, MemoryConstants::cacheLineSize); + commandStreamReceiver.streamProperties.stateComputeMode.setProperties(flushTaskFlags.requiresCoherency, flushTaskFlags.numGrfRequired, + commandStreamReceiver.requiredThreadArbitrationPolicy); commandStreamReceiver.flushTask(commandStream, 0, dsh, ioh, ssh, taskLevel, flushTaskFlags, *pDevice); // Verify that we didn't grab a new CS buffer diff --git a/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_3_tests.cpp b/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_3_tests.cpp index 8557e57e0c..f5faf8d926 100644 --- a/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_3_tests.cpp +++ b/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_3_tests.cpp @@ -379,7 +379,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandStreamReceiverFlushTaskTests, givenCsrInBatch dispatchFlags.guardCommandBufferWithPipeControl = true; dispatchFlags.requiresCoherency = true; - mockCsr->lastSentCoherencyRequest = 1; + mockCsr->streamProperties.stateComputeMode.isCoherencyRequired.value = 1; commandStream.getSpace(4); 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 012df86e58..28b8725a40 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 @@ -564,7 +564,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, CommandStreamReceiverFlushTaskXeHPAndLaterTests, Gi auto blocking = true; auto &commandStreamTask = commandQueue.getCS(1024); auto &commandStreamCSR = commandStreamReceiver->getCS(); - commandStreamReceiver->lastSentCoherencyRequest = 0; + commandStreamReceiver->streamProperties.stateComputeMode.isCoherencyRequired.value = 0; DispatchFlags dispatchFlags = DispatchFlagsHelper::createDefaultDispatchFlags(); dispatchFlags.preemptionMode = PreemptionHelper::getDefaultPreemptionMode(pDevice->getHardwareInfo()); @@ -676,7 +676,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, CommandStreamReceiverFlushTaskXeHPAndLaterTests, gi dispatchFlags.guardCommandBufferWithPipeControl = true; dispatchFlags.requiresCoherency = true; - mockCsr->lastSentCoherencyRequest = 1; + mockCsr->streamProperties.stateComputeMode.isCoherencyRequired.value = 1; commandStream.getSpace(4); diff --git a/opencl/test/unit_test/command_stream/command_stream_receiver_hw_tests_dg2_and_later.cpp b/opencl/test/unit_test/command_stream/command_stream_receiver_hw_tests_dg2_and_later.cpp index 1de55f0ebe..83ea530527 100644 --- a/opencl/test/unit_test/command_stream/command_stream_receiver_hw_tests_dg2_and_later.cpp +++ b/opencl/test/unit_test/command_stream/command_stream_receiver_hw_tests_dg2_and_later.cpp @@ -91,6 +91,8 @@ HWTEST2_F(CommandStreamReceiverFlushTasDg2AndLaterTests, givenProgramPipeControl dispatchFlags.preemptionMode = PreemptionHelper::getDefaultPreemptionMode(pDevice->getHardwareInfo()); dispatchFlags.usePerDssBackedBuffer = true; + commandStreamReceiver.streamProperties.stateComputeMode.setProperties(dispatchFlags.requiresCoherency, dispatchFlags.numGrfRequired, + commandStreamReceiver.requiredThreadArbitrationPolicy); auto cmdSizeForAllCommands = commandStreamReceiver.getRequiredCmdStreamSize(dispatchFlags, *pDevice); commandStreamReceiver.flushTask(commandStream, 0, diff --git a/opencl/test/unit_test/command_stream/compute_mode_tests.h b/opencl/test/unit_test/command_stream/compute_mode_tests.h index b7b86c57f8..54c1e8c833 100644 --- a/opencl/test/unit_test/command_stream/compute_mode_tests.h +++ b/opencl/test/unit_test/command_stream/compute_mode_tests.h @@ -51,7 +51,6 @@ struct ComputeModeRequirements : public ::testing::Test { bool numGrfRequiredChanged, uint32_t numGrfRequired) { auto csrHw = getCsrHw(); - csrHw->getCsrRequestFlags()->coherencyRequestChanged = coherencyRequestChanged; csrHw->getCsrRequestFlags()->hasSharedHandles = hasSharedHandles; csrHw->getCsrRequestFlags()->numGrfRequiredChanged = numGrfRequiredChanged; flags.requiresCoherency = requireCoherency; diff --git a/opencl/test/unit_test/fixtures/ult_command_stream_receiver_fixture.h b/opencl/test/unit_test/fixtures/ult_command_stream_receiver_fixture.h index 5989619329..085d530cef 100644 --- a/opencl/test/unit_test/fixtures/ult_command_stream_receiver_fixture.h +++ b/opencl/test/unit_test/fixtures/ult_command_stream_receiver_fixture.h @@ -139,9 +139,10 @@ struct UltCommandStreamReceiverTest commandStreamReceiver.taskLevel = taskLevel; commandStreamReceiver.lastSentThreadArbitrationPolicy = commandStreamReceiver.requiredThreadArbitrationPolicy; - commandStreamReceiver.lastSentCoherencyRequest = 0; commandStreamReceiver.lastMediaSamplerConfig = 0; commandStreamReceiver.lastSentUseGlobalAtomics = false; + commandStreamReceiver.streamProperties.stateComputeMode.setProperties(0, GrfConfig::DefaultGrfNumber, + commandStreamReceiver.requiredThreadArbitrationPolicy); } template diff --git a/opencl/test/unit_test/gen11/coherency_tests_gen11.cpp b/opencl/test/unit_test/gen11/coherency_tests_gen11.cpp index 11367d078d..8a50cbdb9b 100644 --- a/opencl/test/unit_test/gen11/coherency_tests_gen11.cpp +++ b/opencl/test/unit_test/gen11/coherency_tests_gen11.cpp @@ -22,12 +22,14 @@ struct Gen11CoherencyRequirements : public ::testing::Test { struct myCsr : public CommandStreamReceiverHw { using CommandStreamReceiver::commandStream; + using CommandStreamReceiver::streamProperties; myCsr(ExecutionEnvironment &executionEnvironment) : CommandStreamReceiverHw(executionEnvironment, 0, 1){}; CsrSizeRequestFlags *getCsrRequestFlags() { return &csrSizeRequestFlags; } }; void overrideCoherencyRequest(bool requestChanged, bool requireCoherency) { - csr->getCsrRequestFlags()->coherencyRequestChanged = requestChanged; + csr->streamProperties.stateComputeMode.isCoherencyRequired.isDirty = requestChanged; + csr->streamProperties.stateComputeMode.isCoherencyRequired.value = requireCoherency; flags.requiresCoherency = requireCoherency; } diff --git a/opencl/test/unit_test/gen12lp/coherency_tests_gen12lp.inl b/opencl/test/unit_test/gen12lp/coherency_tests_gen12lp.inl index 6653738d89..2e28c25f50 100644 --- a/opencl/test/unit_test/gen12lp/coherency_tests_gen12lp.inl +++ b/opencl/test/unit_test/gen12lp/coherency_tests_gen12lp.inl @@ -34,7 +34,6 @@ struct Gen12LpCoherencyRequirements : public ::testing::Test { } void overrideCoherencyRequest(bool reqestChanged, bool requireCoherency, bool hasSharedHandles) { - csr->getCsrRequestFlags()->coherencyRequestChanged = reqestChanged; csr->getCsrRequestFlags()->hasSharedHandles = hasSharedHandles; flags.requiresCoherency = requireCoherency; csr->streamProperties.stateComputeMode.isCoherencyRequired.value = requireCoherency; diff --git a/opencl/test/unit_test/xe_hpc_core/pvc/compute_mode_tests_pvc.cpp b/opencl/test/unit_test/xe_hpc_core/pvc/compute_mode_tests_pvc.cpp index 98c82d6422..dfff3ff4cb 100644 --- a/opencl/test/unit_test/xe_hpc_core/pvc/compute_mode_tests_pvc.cpp +++ b/opencl/test/unit_test/xe_hpc_core/pvc/compute_mode_tests_pvc.cpp @@ -64,7 +64,7 @@ PVCTEST_F(PvcComputeModeRequirements, givenRequiredThreadArbitrationPolicyAlread expectedScmCmd.setForceNonCoherent(STATE_COMPUTE_MODE::FORCE_NON_COHERENT_FORCE_GPU_NON_COHERENT); expectedScmCmd.setMaskBits(FamilyType::stateComputeModeForceNonCoherentMask | FamilyType::stateComputeModeLargeGrfModeMask); - overrideComputeModeRequest(false, false, false, true); + getCsrHw()->lastSentThreadArbitrationPolicy = getCsrHw()->requiredThreadArbitrationPolicy; getCsrHw()->programComputeMode(stream, flags, *defaultHwInfo); EXPECT_EQ(cmdsSize, stream.getUsed()); @@ -99,8 +99,7 @@ PVCTEST_F(PvcComputeModeRequirements, givenNumGrfRequiredChangedWhenCommandSizeI using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL; SetUpImpl(); - auto updateLastSentThreadArbitrationPolicy = true; - overrideComputeModeRequest(false, false, false, updateLastSentThreadArbitrationPolicy); + getCsrHw()->lastSentThreadArbitrationPolicy = getCsrHw()->requiredThreadArbitrationPolicy; auto numGrfRequired = 128u; auto numGrfRequiredChanged = false; diff --git a/shared/source/command_stream/command_stream_receiver.cpp b/shared/source/command_stream/command_stream_receiver.cpp index 911a63d87c..4309441fc7 100644 --- a/shared/source/command_stream/command_stream_receiver.cpp +++ b/shared/source/command_stream/command_stream_receiver.cpp @@ -376,7 +376,6 @@ void CommandStreamReceiver::initProgrammingFlags() { lastVmeSubslicesConfig = false; lastSentL3Config = 0; - lastSentCoherencyRequest = -1; lastMediaSamplerConfig = -1; lastPreemptionMode = PreemptionMode::Initial; latestSentStatelessMocsConfig = 0; diff --git a/shared/source/command_stream/command_stream_receiver.h b/shared/source/command_stream/command_stream_receiver.h index 6aba3f7151..968f8ebdce 100644 --- a/shared/source/command_stream/command_stream_receiver.h +++ b/shared/source/command_stream/command_stream_receiver.h @@ -383,7 +383,6 @@ class CommandStreamReceiver { const uint32_t rootDeviceIndex; const DeviceBitfield deviceBitfield; - int8_t lastSentCoherencyRequest = -1; int8_t lastMediaSamplerConfig = -1; bool isPreambleSent = false; diff --git a/shared/source/command_stream/command_stream_receiver_hw_base.inl b/shared/source/command_stream/command_stream_receiver_hw_base.inl index 93872cd8d1..09218cba6f 100644 --- a/shared/source/command_stream/command_stream_receiver_hw_base.inl +++ b/shared/source/command_stream/command_stream_receiver_hw_base.inl @@ -269,7 +269,6 @@ CompletionStamp CommandStreamReceiverHw::flushTask( this->requiredThreadArbitrationPolicy); csrSizeRequestFlags.l3ConfigChanged = this->lastSentL3Config != newL3Config; - csrSizeRequestFlags.coherencyRequestChanged = this->lastSentCoherencyRequest != static_cast(dispatchFlags.requiresCoherency); csrSizeRequestFlags.preemptionRequestChanged = this->lastPreemptionMode != dispatchFlags.preemptionMode; csrSizeRequestFlags.mediaSamplerConfigChanged = this->lastMediaSamplerConfig != static_cast(dispatchFlags.pipelineSelectArgs.mediaSamplerRequired); csrSizeRequestFlags.specialPipelineSelectModeChanged = isSpecialPipelineSelectModeChanged; diff --git a/shared/source/command_stream/command_stream_receiver_hw_tgllp_and_later.inl b/shared/source/command_stream/command_stream_receiver_hw_tgllp_and_later.inl index ec50008a0c..7a208cb109 100644 --- a/shared/source/command_stream/command_stream_receiver_hw_tgllp_and_later.inl +++ b/shared/source/command_stream/command_stream_receiver_hw_tgllp_and_later.inl @@ -19,7 +19,6 @@ void CommandStreamReceiverHw::programComputeMode(LinearStream &stream using PIPE_CONTROL = typename GfxFamily::PIPE_CONTROL; if (isComputeModeNeeded()) { programAdditionalPipelineSelect(stream, dispatchFlags.pipelineSelectArgs, true); - this->lastSentCoherencyRequest = static_cast(dispatchFlags.requiresCoherency); auto hwInfoConfig = HwInfoConfig::get(hwInfo.platform.eProductFamily); if (hwInfoConfig->isPipeControlPriorToNonPipelinedStateCommandsWARequired(hwInfo, isRcs())) { @@ -40,7 +39,8 @@ void CommandStreamReceiverHw::programComputeMode(LinearStream &stream template <> inline bool CommandStreamReceiverHw::isComputeModeNeeded() const { - return StateComputeModeHelper::isStateComputeModeRequired(csrSizeRequestFlags, this->lastSentThreadArbitrationPolicy != this->requiredThreadArbitrationPolicy); + return this->streamProperties.stateComputeMode.isDirty() || + StateComputeModeHelper::isStateComputeModeRequired(csrSizeRequestFlags, this->lastSentThreadArbitrationPolicy != this->requiredThreadArbitrationPolicy); } template <> diff --git a/shared/source/command_stream/csr_definitions.h b/shared/source/command_stream/csr_definitions.h index 2a509adbe2..ace000eff8 100644 --- a/shared/source/command_stream/csr_definitions.h +++ b/shared/source/command_stream/csr_definitions.h @@ -119,7 +119,6 @@ struct DispatchFlags { struct CsrSizeRequestFlags { bool l3ConfigChanged = false; - bool coherencyRequestChanged = false; bool preemptionRequestChanged = false; bool mediaSamplerConfigChanged = false; bool hasSharedHandles = false; diff --git a/shared/source/command_stream/definitions/stream_properties.inl b/shared/source/command_stream/definitions/stream_properties.inl index 985bc07fbd..35f8cf2518 100644 --- a/shared/source/command_stream/definitions/stream_properties.inl +++ b/shared/source/command_stream/definitions/stream_properties.inl @@ -18,7 +18,7 @@ struct StateComputeModeProperties { void setProperties(bool requiresCoherency, uint32_t numGrfRequired, uint32_t threadArbitrationPolicy); void setProperties(const StateComputeModeProperties &properties); - bool isDirty(); + bool isDirty() const; void clearIsDirty(); }; @@ -29,7 +29,7 @@ struct FrontEndProperties { void setProperties(bool isCooperativeKernel, bool disableOverdispatch, int32_t engineInstancedDevice, const HardwareInfo &hwInfo); void setProperties(const FrontEndProperties &properties); - bool isDirty(); + bool isDirty() const; void clearIsDirty(); }; diff --git a/shared/source/command_stream/stream_properties.cpp b/shared/source/command_stream/stream_properties.cpp index aa1944efa8..c9956769fc 100644 --- a/shared/source/command_stream/stream_properties.cpp +++ b/shared/source/command_stream/stream_properties.cpp @@ -48,7 +48,7 @@ void StateComputeModeProperties::setProperties(const StateComputeModeProperties threadArbitrationPolicy.set(properties.threadArbitrationPolicy.value); } -bool StateComputeModeProperties::isDirty() { +bool StateComputeModeProperties::isDirty() const { return isCoherencyRequired.isDirty || largeGrfMode.isDirty || zPassAsyncComputeThreadLimit.isDirty || pixelAsyncComputeThreadLimit.isDirty || threadArbitrationPolicy.isDirty; } @@ -78,7 +78,7 @@ void FrontEndProperties::setProperties(const FrontEndProperties &properties) { computeDispatchAllWalkerEnable.set(properties.computeDispatchAllWalkerEnable.value); } -bool FrontEndProperties::isDirty() { +bool FrontEndProperties::isDirty() const { return disableOverdispatch.isDirty || singleSliceDispatchCcsMode.isDirty || computeDispatchAllWalkerEnable.isDirty; } diff --git a/shared/source/gen11/command_stream_receiver_hw_gen11.cpp b/shared/source/gen11/command_stream_receiver_hw_gen11.cpp index 5ae217cbc6..bd0389fe61 100644 --- a/shared/source/gen11/command_stream_receiver_hw_gen11.cpp +++ b/shared/source/gen11/command_stream_receiver_hw_gen11.cpp @@ -18,7 +18,7 @@ static auto gfxCore = IGFX_GEN11_CORE; template <> size_t CommandStreamReceiverHw::getCmdSizeForComputeMode() { - if (csrSizeRequestFlags.coherencyRequestChanged) { + if (this->streamProperties.stateComputeMode.isDirty()) { return sizeof(typename Family::MI_LOAD_REGISTER_IMM); } return 0; @@ -26,12 +26,11 @@ size_t CommandStreamReceiverHw::getCmdSizeForComputeMode() { template <> void CommandStreamReceiverHw::programComputeMode(LinearStream &stream, DispatchFlags &dispatchFlags, const HardwareInfo &hwInfo) { - if (csrSizeRequestFlags.coherencyRequestChanged) { + if (this->streamProperties.stateComputeMode.isDirty()) { LriHelper::program(&stream, gen11HdcModeRegister::address, DwordBuilder::build(gen11HdcModeRegister::forceNonCoherentEnableBit, true, !dispatchFlags.requiresCoherency), false); - this->lastSentCoherencyRequest = static_cast(dispatchFlags.requiresCoherency); } } diff --git a/shared/source/gen12lp/command_stream_receiver_hw_gen12lp.cpp b/shared/source/gen12lp/command_stream_receiver_hw_gen12lp.cpp index 3f79fbc1b5..c3b24da524 100644 --- a/shared/source/gen12lp/command_stream_receiver_hw_gen12lp.cpp +++ b/shared/source/gen12lp/command_stream_receiver_hw_gen12lp.cpp @@ -39,7 +39,7 @@ size_t CommandStreamReceiverHw::getCmdSizeForComputeMode() { } size_t size = 0; - if (csrSizeRequestFlags.coherencyRequestChanged || csrSizeRequestFlags.hasSharedHandles || csrSizeRequestFlags.numGrfRequiredChanged) { + if (this->streamProperties.stateComputeMode.isDirty() || csrSizeRequestFlags.hasSharedHandles || csrSizeRequestFlags.numGrfRequiredChanged) { size += sizeof(typename Family::STATE_COMPUTE_MODE); if (csrSizeRequestFlags.hasSharedHandles) { size += sizeof(typename Family::PIPE_CONTROL); diff --git a/shared/source/gen12lp/state_compute_mode_helper_gen12lp.cpp b/shared/source/gen12lp/state_compute_mode_helper_gen12lp.cpp index 5ae0acdf89..3b46c0c0c8 100644 --- a/shared/source/gen12lp/state_compute_mode_helper_gen12lp.cpp +++ b/shared/source/gen12lp/state_compute_mode_helper_gen12lp.cpp @@ -11,7 +11,7 @@ namespace NEO { template <> bool StateComputeModeHelper::isStateComputeModeRequired(const CsrSizeRequestFlags &csrSizeRequestFlags, bool isThreadArbitionPolicyProgrammed) { - return csrSizeRequestFlags.coherencyRequestChanged || csrSizeRequestFlags.hasSharedHandles || csrSizeRequestFlags.numGrfRequiredChanged; + return csrSizeRequestFlags.hasSharedHandles || csrSizeRequestFlags.numGrfRequiredChanged; } } // namespace NEO diff --git a/shared/source/xe_hp_core/state_compute_mode_helper_xe_hp_core.cpp b/shared/source/xe_hp_core/state_compute_mode_helper_xe_hp_core.cpp index c69e9d5b50..7865099f90 100644 --- a/shared/source/xe_hp_core/state_compute_mode_helper_xe_hp_core.cpp +++ b/shared/source/xe_hp_core/state_compute_mode_helper_xe_hp_core.cpp @@ -11,7 +11,7 @@ namespace NEO { template <> bool StateComputeModeHelper::isStateComputeModeRequired(const CsrSizeRequestFlags &csrSizeRequestFlags, bool isThreadArbitionPolicyProgrammed) { - return csrSizeRequestFlags.coherencyRequestChanged || csrSizeRequestFlags.numGrfRequiredChanged; + return csrSizeRequestFlags.numGrfRequiredChanged; } } // namespace NEO diff --git a/shared/source/xe_hpc_core/state_compute_mode_helper_xe_hpc_core.cpp b/shared/source/xe_hpc_core/state_compute_mode_helper_xe_hpc_core.cpp index 67d07f557b..d8435c2a1a 100644 --- a/shared/source/xe_hpc_core/state_compute_mode_helper_xe_hpc_core.cpp +++ b/shared/source/xe_hpc_core/state_compute_mode_helper_xe_hpc_core.cpp @@ -11,7 +11,7 @@ namespace NEO { template <> bool StateComputeModeHelper::isStateComputeModeRequired(const CsrSizeRequestFlags &csrSizeRequestFlags, bool isThreadArbitionPolicyProgrammed) { - return csrSizeRequestFlags.coherencyRequestChanged || csrSizeRequestFlags.numGrfRequiredChanged || isThreadArbitionPolicyProgrammed; + return csrSizeRequestFlags.numGrfRequiredChanged || isThreadArbitionPolicyProgrammed; } } // namespace NEO diff --git a/shared/source/xe_hpg_core/state_compute_mode_helper_xe_hpg_core.cpp b/shared/source/xe_hpg_core/state_compute_mode_helper_xe_hpg_core.cpp index b208492b8a..dfc5f187b9 100644 --- a/shared/source/xe_hpg_core/state_compute_mode_helper_xe_hpg_core.cpp +++ b/shared/source/xe_hpg_core/state_compute_mode_helper_xe_hpg_core.cpp @@ -11,7 +11,7 @@ namespace NEO { template <> bool StateComputeModeHelper::isStateComputeModeRequired(const CsrSizeRequestFlags &csrSizeRequestFlags, bool isThreadArbitionPolicyProgrammed) { - return csrSizeRequestFlags.coherencyRequestChanged || csrSizeRequestFlags.numGrfRequiredChanged; + return csrSizeRequestFlags.numGrfRequiredChanged; } } // namespace NEO diff --git a/shared/test/common/libult/ult_command_stream_receiver.h b/shared/test/common/libult/ult_command_stream_receiver.h index 7cf88eed94..0f4a876e70 100644 --- a/shared/test/common/libult/ult_command_stream_receiver.h +++ b/shared/test/common/libult/ult_command_stream_receiver.h @@ -55,6 +55,7 @@ class UltCommandStreamReceiver : public CommandStreamReceiverHw, publ using BaseClass::rootDeviceIndex; using BaseClass::sshState; using BaseClass::staticWorkPartitioningEnabled; + using BaseClass::streamProperties; using BaseClass::wasSubmittedToSingleSubdevice; using BaseClass::CommandStreamReceiver::activePartitions; using BaseClass::CommandStreamReceiver::activePartitionsConfig; @@ -86,7 +87,6 @@ class UltCommandStreamReceiver : public CommandStreamReceiverHw, publ using BaseClass::CommandStreamReceiver::lastMediaSamplerConfig; using BaseClass::CommandStreamReceiver::lastMemoryCompressionState; using BaseClass::CommandStreamReceiver::lastPreemptionMode; - using BaseClass::CommandStreamReceiver::lastSentCoherencyRequest; using BaseClass::CommandStreamReceiver::lastSentL3Config; using BaseClass::CommandStreamReceiver::lastSentThreadArbitrationPolicy; using BaseClass::CommandStreamReceiver::lastSentUseGlobalAtomics; diff --git a/shared/test/common/mocks/mock_command_stream_receiver.h b/shared/test/common/mocks/mock_command_stream_receiver.h index 0155ce0315..b46ad34acf 100644 --- a/shared/test/common/mocks/mock_command_stream_receiver.h +++ b/shared/test/common/mocks/mock_command_stream_receiver.h @@ -166,7 +166,6 @@ class MockCsrHw2 : public CommandStreamReceiverHw { using CommandStreamReceiver::dispatchMode; using CommandStreamReceiver::globalFenceAllocation; using CommandStreamReceiver::isPreambleSent; - using CommandStreamReceiver::lastSentCoherencyRequest; using CommandStreamReceiver::latestFlushedTaskCount; using CommandStreamReceiver::mediaVfeStateDirty; using CommandStreamReceiver::nTo1SubmissionModelEnabled; @@ -174,6 +173,7 @@ class MockCsrHw2 : public CommandStreamReceiverHw { using CommandStreamReceiver::postSyncWriteOffset; using CommandStreamReceiver::requiredScratchSize; using CommandStreamReceiver::requiredThreadArbitrationPolicy; + using CommandStreamReceiver::streamProperties; using CommandStreamReceiver::tagAddress; using CommandStreamReceiver::taskCount; using CommandStreamReceiver::taskLevel; diff --git a/shared/test/unit_test/command_stream/command_stream_receiver_tests.cpp b/shared/test/unit_test/command_stream/command_stream_receiver_tests.cpp index 87286f5b34..061d56cf3a 100644 --- a/shared/test/unit_test/command_stream/command_stream_receiver_tests.cpp +++ b/shared/test/unit_test/command_stream/command_stream_receiver_tests.cpp @@ -84,7 +84,6 @@ HWTEST_F(CommandStreamReceiverTest, WhenCreatingCsrThenFlagsAreSetCorrectly) { EXPECT_TRUE(csr.mediaVfeStateDirty); EXPECT_FALSE(csr.lastVmeSubslicesConfig); EXPECT_EQ(0u, csr.lastSentL3Config); - EXPECT_EQ(-1, csr.lastSentCoherencyRequest); EXPECT_EQ(-1, csr.lastMediaSamplerConfig); EXPECT_EQ(PreemptionMode::Initial, csr.lastPreemptionMode); EXPECT_EQ(0u, csr.latestSentStatelessMocsConfig);