diff --git a/runtime/command_stream/command_stream_receiver_hw.h b/runtime/command_stream/command_stream_receiver_hw.h index d4643e18a2..39cb99f509 100644 --- a/runtime/command_stream/command_stream_receiver_hw.h +++ b/runtime/command_stream/command_stream_receiver_hw.h @@ -38,6 +38,7 @@ class CommandStreamReceiverHw : public CommandStreamReceiver { void flushBatchedSubmissions() override; + PIPE_CONTROL *addPipeControlBase(LinearStream &commandStream, bool dcFlush); void addPipeControl(LinearStream &commandStream, bool dcFlush) override; int getRequiredPipeControlSize() const; @@ -86,7 +87,6 @@ class CommandStreamReceiverHw : public CommandStreamReceiver { virtual void initPageTableManagerRegisters(LinearStream &csr){}; void addPipeControlWA(LinearStream &commandStream); - void addDcFlushToPipeControl(typename GfxFamily::PIPE_CONTROL *pCmd, bool flushDC); void addClearSLMWorkAround(typename GfxFamily::PIPE_CONTROL *pCmd); PIPE_CONTROL *addPipeControlCmd(LinearStream &commandStream); size_t getSshHeapSize(); diff --git a/runtime/command_stream/command_stream_receiver_hw.inl b/runtime/command_stream/command_stream_receiver_hw.inl index f2a9ec6169..e5239a7c0e 100644 --- a/runtime/command_stream/command_stream_receiver_hw.inl +++ b/runtime/command_stream/command_stream_receiver_hw.inl @@ -584,18 +584,13 @@ inline void CommandStreamReceiverHw::flushBatchedSubmissions() { } template -void CommandStreamReceiverHw::addPipeControl(LinearStream &commandStream, bool dcFlush) { - typedef typename GfxFamily::PIPE_CONTROL PIPE_CONTROL; - +typename GfxFamily::PIPE_CONTROL *CommandStreamReceiverHw::addPipeControlBase(LinearStream &commandStream, bool dcFlush) { addPipeControlWA(commandStream); - // Add a PIPE_CONTROL w/ CS_stall auto pCmd = reinterpret_cast(commandStream.getSpace(sizeof(PIPE_CONTROL))); *pCmd = GfxFamily::cmdInitPipeControl; pCmd->setCommandStreamerStallEnable(true); pCmd->setDcFlushEnable(dcFlush); - //Some architectures (BDW) requires to have at least one flush bit set - addDcFlushToPipeControl(pCmd, true); if (DebugManager.flags.FlushAllCaches.get()) { pCmd->setDcFlushEnable(true); @@ -607,6 +602,12 @@ void CommandStreamReceiverHw::addPipeControl(LinearStream &commandStr pCmd->setConstantCacheInvalidationEnable(true); pCmd->setStateCacheInvalidationEnable(true); } + return pCmd; +} + +template +void CommandStreamReceiverHw::addPipeControl(LinearStream &commandStream, bool dcFlush) { + CommandStreamReceiverHw::addPipeControlBase(commandStream, dcFlush); } template @@ -805,10 +806,6 @@ template void CommandStreamReceiverHw::addPipeControlWA(LinearStream &commandStream) { } -template -void CommandStreamReceiverHw::addDcFlushToPipeControl(typename GfxFamily::PIPE_CONTROL *pCmd, bool flushDC) { -} - template int CommandStreamReceiverHw::getRequiredPipeControlSize() const { const auto pipeControlCount = KernelCommandsHelper::isPipeControlWArequired() ? 2u : 1u; diff --git a/runtime/gen8/command_stream_receiver_hw_gen8.cpp b/runtime/gen8/command_stream_receiver_hw_gen8.cpp index 7fe0594d33..41e1f635db 100644 --- a/runtime/gen8/command_stream_receiver_hw_gen8.cpp +++ b/runtime/gen8/command_stream_receiver_hw_gen8.cpp @@ -25,8 +25,9 @@ void CommandStreamReceiverHw::programComputeMode(LinearStream &stream, D } template <> -void CommandStreamReceiverHw::addDcFlushToPipeControl(Family::PIPE_CONTROL *pCmd, bool flushDC) { - pCmd->setDcFlushEnable(flushDC); +void CommandStreamReceiverHw::addPipeControl(LinearStream &commandStream, bool dcFlush) { + auto pCmd = CommandStreamReceiverHw::addPipeControlBase(commandStream, dcFlush); + pCmd->setDcFlushEnable(true); } template <>