@@ -88,14 +88,15 @@ inline void CommandStreamReceiverHw<GfxFamily>::addBatchBufferEnd(LinearStream &
8888}
8989
9090template <typename GfxFamily>
91- inline void CommandStreamReceiverHw<GfxFamily>::programEndingCmd(LinearStream &commandStream, void **patchLocation, bool directSubmissionEnabled) {
91+ inline void CommandStreamReceiverHw<GfxFamily>::programEndingCmd(LinearStream &commandStream, Device &device, void **patchLocation, bool directSubmissionEnabled) {
9292 if (directSubmissionEnabled) {
9393 *patchLocation = commandStream.getSpace (sizeof (MI_BATCH_BUFFER_START));
9494 auto bbStart = reinterpret_cast <MI_BATCH_BUFFER_START *>(*patchLocation);
9595 MI_BATCH_BUFFER_START cmd = {};
9696 addBatchBufferStart (&cmd, 0ull , false );
9797 *bbStart = cmd;
9898 } else {
99+ PreemptionHelper::programStateSipEndWa<GfxFamily>(commandStream, device);
99100 this ->addBatchBufferEnd (commandStream, patchLocation);
100101 }
101102}
@@ -515,7 +516,7 @@ CompletionStamp CommandStreamReceiverHw<GfxFamily>::flushTask(
515516 GraphicsAllocation *chainedBatchBuffer = nullptr ;
516517 bool directSubmissionEnabled = isDirectSubmissionEnabled ();
517518 if (submitTask) {
518- programEndingCmd (commandStreamTask, &bbEndLocation, directSubmissionEnabled);
519+ programEndingCmd (commandStreamTask, device, &bbEndLocation, directSubmissionEnabled);
519520 this ->emitNoop (commandStreamTask, bbEndPaddingSize);
520521 this ->alignToCacheLine (commandStreamTask);
521522
@@ -543,10 +544,10 @@ CompletionStamp CommandStreamReceiverHw<GfxFamily>::flushTask(
543544 } else if (dispatchFlags.epilogueRequired ) {
544545 this ->makeResident (*commandStreamCSR.getGraphicsAllocation ());
545546 }
546- this ->programEpilogue (commandStreamCSR, &bbEndLocation, dispatchFlags);
547+ this ->programEpilogue (commandStreamCSR, device, &bbEndLocation, dispatchFlags);
547548
548549 } else if (submitCSR) {
549- programEndingCmd (commandStreamCSR, &bbEndLocation, directSubmissionEnabled);
550+ programEndingCmd (commandStreamCSR, device, &bbEndLocation, directSubmissionEnabled);
550551 this ->emitNoop (commandStreamCSR, bbEndPaddingSize);
551552 this ->alignToCacheLine (commandStreamCSR);
552553 DEBUG_BREAK_IF (commandStreamCSR.getUsed () > commandStreamCSR.getMaxAvailableSpace ());
@@ -1094,14 +1095,14 @@ inline bool CommandStreamReceiverHw<GfxFamily>::isPipelineSelectAlreadyProgramme
10941095}
10951096
10961097template <typename GfxFamily>
1097- inline void CommandStreamReceiverHw<GfxFamily>::programEpilogue(LinearStream &csr, void **batchBufferEndLocation, DispatchFlags &dispatchFlags) {
1098+ inline void CommandStreamReceiverHw<GfxFamily>::programEpilogue(LinearStream &csr, Device &device, void **batchBufferEndLocation, DispatchFlags &dispatchFlags) {
10981099 if (dispatchFlags.epilogueRequired ) {
10991100 auto currentOffset = ptrDiff (csr.getSpace (0u ), csr.getCpuBase ());
11001101 auto gpuAddress = ptrOffset (csr.getGraphicsAllocation ()->getGpuAddress (), currentOffset);
11011102
11021103 addBatchBufferStart (reinterpret_cast <typename GfxFamily::MI_BATCH_BUFFER_START *>(*batchBufferEndLocation), gpuAddress, false );
11031104 this ->programEpliogueCommands (csr, dispatchFlags);
1104- programEndingCmd (csr, batchBufferEndLocation, isDirectSubmissionEnabled ());
1105+ programEndingCmd (csr, device, batchBufferEndLocation, isDirectSubmissionEnabled ());
11051106 this ->alignToCacheLine (csr);
11061107 }
11071108}
0 commit comments