@@ -187,6 +187,7 @@ CompletionStamp CommandStreamReceiverHw<GfxFamily>::flushTask(
187187 bool implicitFlush = dispatchFlags.implicitFlush || dispatchFlags.blocking || DebugManager.flags .ForceImplicitFlush .get ();
188188 void *currentPipeControlForNooping = nullptr ;
189189 void *epiloguePipeControlLocation = nullptr ;
190+ PipeControlArgs args;
190191
191192 bool csrFlush = this ->wasSubmittedToSingleSubdevice != dispatchFlags.useSingleSubdevice ;
192193
@@ -226,7 +227,6 @@ CompletionStamp CommandStreamReceiverHw<GfxFamily>::flushTask(
226227
227228 auto address = getTagAllocation ()->getGpuAddress ();
228229
229- PipeControlArgs args;
230230 args.dcFlushEnable = MemorySynchronizationCommands<GfxFamily>::getDcFlushEnable (dispatchFlags.dcFlush , hwInfo);
231231 args.notifyEnable = isUsedNotifyEnableForPostSync ();
232232 args.tlbInvalidation |= dispatchFlags.memoryMigrationRequired ;
@@ -613,6 +613,7 @@ CompletionStamp CommandStreamReceiverHw<GfxFamily>::flushTask(
613613 commandBuffer->flushStamp ->replaceStampObject (dispatchFlags.flushStampReference );
614614 commandBuffer->pipeControlThatMayBeErasedLocation = currentPipeControlForNooping;
615615 commandBuffer->epiloguePipeControlLocation = epiloguePipeControlLocation;
616+ commandBuffer->epiloguePipeControlArgs = args;
616617 this ->submissionAggregator ->recordCommandBuffer (commandBuffer);
617618 }
618619 } else {
@@ -716,6 +717,7 @@ inline bool CommandStreamReceiverHw<GfxFamily>::flushBatchedSubmissions() {
716717 auto nextCommandBuffer = commandBufferList.peekHead ();
717718 auto currentBBendLocation = primaryCmdBuffer->batchBufferEndLocation ;
718719 auto lastTaskCount = primaryCmdBuffer->taskCount ;
720+ auto lastPipeControlArgs = primaryCmdBuffer->epiloguePipeControlArgs ;
719721
720722 FlushStampUpdateHelper flushStampUpdateHelper;
721723 flushStampUpdateHelper.insert (primaryCmdBuffer->flushStamp ->getStampReference ());
@@ -760,6 +762,7 @@ inline bool CommandStreamReceiverHw<GfxFamily>::flushBatchedSubmissions() {
760762
761763 currentBBendLocation = nextCommandBuffer->batchBufferEndLocation ;
762764 lastTaskCount = nextCommandBuffer->taskCount ;
765+ lastPipeControlArgs = nextCommandBuffer->epiloguePipeControlArgs ;
763766 nextCommandBuffer = nextCommandBuffer->next ;
764767
765768 commandBufferList.removeFrontOne ();
@@ -771,13 +774,19 @@ inline bool CommandStreamReceiverHw<GfxFamily>::flushBatchedSubmissions() {
771774
772775 // make sure we flush DC if needed
773776 if (epiloguePipeControlLocation && MemorySynchronizationCommands<GfxFamily>::getDcFlushEnable (true , hwInfo)) {
777+ lastPipeControlArgs.dcFlushEnable = true ;
774778
775- auto emitDcFlush = true ;
776779 if (DebugManager.flags .DisableDcFlushInEpilogue .get ()) {
777- emitDcFlush = false ;
780+ lastPipeControlArgs. dcFlushEnable = false ;
778781 }
779782
780- ((PIPE_CONTROL *)epiloguePipeControlLocation)->setDcFlushEnable (emitDcFlush);
783+ MemorySynchronizationCommands<GfxFamily>::setPipeControlAndProgramPostSyncOperation (
784+ epiloguePipeControlLocation,
785+ PIPE_CONTROL::POST_SYNC_OPERATION_WRITE_IMMEDIATE_DATA,
786+ getTagAllocation ()->getGpuAddress (),
787+ lastTaskCount,
788+ hwInfo,
789+ lastPipeControlArgs);
781790 }
782791
783792 primaryCmdBuffer->batchBuffer .endCmdPtr = currentBBendLocation;
0 commit comments