refactor: add batch buffer attribute for explicit monitor fence dispatch

Related-To: NEO-8395

Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
Zbigniew Zdanowicz
2023-09-20 11:04:00 +00:00
committed by Compute-Runtime-Automation
parent 713511eea9
commit 40e169f8e2
5 changed files with 13 additions and 10 deletions

View File

@@ -123,7 +123,7 @@ NEO::SubmissionStatus CommandQueueImp::submitBatchBuffer(size_t offset, NEO::Res
NEO::BatchBuffer batchBuffer(this->startingCmdBuffer->getGraphicsAllocation(), offset, 0, 0, nullptr, false, NEO::BatchBuffer batchBuffer(this->startingCmdBuffer->getGraphicsAllocation(), offset, 0, 0, nullptr, false,
NEO::QueueThrottle::HIGH, NEO::QueueSliceCount::defaultSliceCount, NEO::QueueThrottle::HIGH, NEO::QueueSliceCount::defaultSliceCount,
this->startingCmdBuffer->getUsed(), this->startingCmdBuffer, endingCmdPtr, csr->getNumClients(), true, false); this->startingCmdBuffer->getUsed(), this->startingCmdBuffer, endingCmdPtr, csr->getNumClients(), true, false, true);
batchBuffer.disableFlatRingBuffer = true; batchBuffer.disableFlatRingBuffer = true;
if (this->startingCmdBuffer != &this->commandStream) { if (this->startingCmdBuffer != &this->commandStream) {

View File

@@ -237,7 +237,7 @@ CompletionStamp CommandStreamReceiverHw<GfxFamily>::flushBcsTask(LinearStream &c
BatchBuffer batchBuffer{streamToSubmit.getGraphicsAllocation(), startOffset, 0, taskStartAddress, nullptr, BatchBuffer batchBuffer{streamToSubmit.getGraphicsAllocation(), startOffset, 0, taskStartAddress, nullptr,
false, QueueThrottle::MEDIUM, NEO::QueueSliceCount::defaultSliceCount, false, QueueThrottle::MEDIUM, NEO::QueueSliceCount::defaultSliceCount,
streamToSubmit.getUsed(), &streamToSubmit, bbEndLocation, this->getNumClients(), (submitCSR || dispatchBcsFlags.hasStallingCmds), streamToSubmit.getUsed(), &streamToSubmit, bbEndLocation, this->getNumClients(), (submitCSR || dispatchBcsFlags.hasStallingCmds),
dispatchBcsFlags.hasRelaxedOrderingDependencies}; dispatchBcsFlags.hasRelaxedOrderingDependencies, false};
updateStreamTaskCount(streamToSubmit, taskCount + 1); updateStreamTaskCount(streamToSubmit, taskCount + 1);
@@ -629,7 +629,7 @@ CompletionStamp CommandStreamReceiverHw<GfxFamily>::flushTask(
BatchBuffer batchBuffer{streamToSubmit.getGraphicsAllocation(), startOffset, chainedBatchBufferStartOffset, taskStartAddress, chainedBatchBuffer, BatchBuffer batchBuffer{streamToSubmit.getGraphicsAllocation(), startOffset, chainedBatchBufferStartOffset, taskStartAddress, chainedBatchBuffer,
dispatchFlags.lowPriority, dispatchFlags.throttle, dispatchFlags.sliceCount, dispatchFlags.lowPriority, dispatchFlags.throttle, dispatchFlags.sliceCount,
streamToSubmit.getUsed(), &streamToSubmit, bbEndLocation, this->getNumClients(), (submitCSR || dispatchFlags.hasStallingCmds || hasStallingCmdsOnTaskStream), streamToSubmit.getUsed(), &streamToSubmit, bbEndLocation, this->getNumClients(), (submitCSR || dispatchFlags.hasStallingCmds || hasStallingCmdsOnTaskStream),
dispatchFlags.hasRelaxedOrderingDependencies}; dispatchFlags.hasRelaxedOrderingDependencies, dispatchFlags.blocking};
updateStreamTaskCount(streamToSubmit, taskCount + 1); updateStreamTaskCount(streamToSubmit, taskCount + 1);
@@ -1225,7 +1225,7 @@ TaskCountType CommandStreamReceiverHw<GfxFamily>::flushBcsTask(const BlitPropert
uint64_t taskStartAddress = commandStream.getGpuBase() + commandStreamStart; uint64_t taskStartAddress = commandStream.getGpuBase() + commandStreamStart;
BatchBuffer batchBuffer{commandStream.getGraphicsAllocation(), commandStreamStart, 0, taskStartAddress, nullptr, false, QueueThrottle::MEDIUM, QueueSliceCount::defaultSliceCount, BatchBuffer batchBuffer{commandStream.getGraphicsAllocation(), commandStreamStart, 0, taskStartAddress, nullptr, false, QueueThrottle::MEDIUM, QueueSliceCount::defaultSliceCount,
commandStream.getUsed(), &commandStream, endingCmdPtr, this->getNumClients(), hasStallingCmds, isRelaxedOrderingDispatch}; commandStream.getUsed(), &commandStream, endingCmdPtr, this->getNumClients(), hasStallingCmds, isRelaxedOrderingDispatch, blocking};
updateStreamTaskCount(commandStream, newTaskCount); updateStreamTaskCount(commandStream, newTaskCount);
@@ -1347,7 +1347,7 @@ SubmissionStatus CommandStreamReceiverHw<GfxFamily>::flushSmallTask(LinearStream
BatchBuffer batchBuffer{commandStreamTask.getGraphicsAllocation(), commandStreamStartTask, 0, taskStartAddress, BatchBuffer batchBuffer{commandStreamTask.getGraphicsAllocation(), commandStreamStartTask, 0, taskStartAddress,
nullptr, false, QueueThrottle::MEDIUM, QueueSliceCount::defaultSliceCount, nullptr, false, QueueThrottle::MEDIUM, QueueSliceCount::defaultSliceCount,
commandStreamTask.getUsed(), &commandStreamTask, endingCmdPtr, this->getNumClients(), true, false}; commandStreamTask.getUsed(), &commandStreamTask, endingCmdPtr, this->getNumClients(), true, false, true};
this->latestSentTaskCount = taskCount + 1; this->latestSentTaskCount = taskCount + 1;
auto submissionStatus = flushHandler(batchBuffer, getResidencyAllocations()); auto submissionStatus = flushHandler(batchBuffer, getResidencyAllocations());
@@ -2159,7 +2159,7 @@ CompletionStamp CommandStreamReceiverHw<GfxFamily>::handleImmediateFlushSendBatc
BatchBuffer batchBuffer{streamToSubmit.getGraphicsAllocation(), startOffset, chainedBatchBufferStartOffset, taskStartAddress, chainedBatchBuffer, BatchBuffer batchBuffer{streamToSubmit.getGraphicsAllocation(), startOffset, chainedBatchBufferStartOffset, taskStartAddress, chainedBatchBuffer,
immediateLowPriority, immediateThrottle, immediateSliceCount, immediateLowPriority, immediateThrottle, immediateSliceCount,
streamToSubmit.getUsed(), &streamToSubmit, flushData.endPtr, this->getNumClients(), hasStallingCmds, streamToSubmit.getUsed(), &streamToSubmit, flushData.endPtr, this->getNumClients(), hasStallingCmds,
dispatchFlags.hasRelaxedOrderingDependencies}; dispatchFlags.hasRelaxedOrderingDependencies, dispatchFlags.blockingAppend};
updateStreamTaskCount(streamToSubmit, taskCount + 1); updateStreamTaskCount(streamToSubmit, taskCount + 1);
auto submissionStatus = flushHandler(batchBuffer, this->getResidencyAllocations()); auto submissionStatus = flushHandler(batchBuffer, this->getResidencyAllocations());

View File

@@ -97,13 +97,13 @@ NEO::BatchBuffer::BatchBuffer(GraphicsAllocation *commandBufferAllocation, size_
size_t chainedBatchBufferStartOffset, uint64_t taskStartAddress, GraphicsAllocation *chainedBatchBuffer, size_t chainedBatchBufferStartOffset, uint64_t taskStartAddress, GraphicsAllocation *chainedBatchBuffer,
bool lowPriority, QueueThrottle throttle, uint64_t sliceCount, bool lowPriority, QueueThrottle throttle, uint64_t sliceCount,
size_t usedSize, LinearStream *stream, void *endCmdPtr, uint32_t numCsrClients, bool hasStallingCmds, size_t usedSize, LinearStream *stream, void *endCmdPtr, uint32_t numCsrClients, bool hasStallingCmds,
bool hasRelaxedOrderingDependencies) bool hasRelaxedOrderingDependencies, bool dispatchMonitorFence)
: commandBufferAllocation(commandBufferAllocation), startOffset(startOffset), : commandBufferAllocation(commandBufferAllocation), startOffset(startOffset),
chainedBatchBufferStartOffset(chainedBatchBufferStartOffset), taskStartAddress(taskStartAddress), chainedBatchBuffer(chainedBatchBuffer), chainedBatchBufferStartOffset(chainedBatchBufferStartOffset), taskStartAddress(taskStartAddress), chainedBatchBuffer(chainedBatchBuffer),
lowPriority(lowPriority), lowPriority(lowPriority),
throttle(throttle), sliceCount(sliceCount), throttle(throttle), sliceCount(sliceCount),
usedSize(usedSize), stream(stream), endCmdPtr(endCmdPtr), numCsrClients(numCsrClients), hasStallingCmds(hasStallingCmds), usedSize(usedSize), stream(stream), endCmdPtr(endCmdPtr), numCsrClients(numCsrClients), hasStallingCmds(hasStallingCmds),
hasRelaxedOrderingDependencies(hasRelaxedOrderingDependencies) {} hasRelaxedOrderingDependencies(hasRelaxedOrderingDependencies), dispatchMonitorFence(dispatchMonitorFence) {}
NEO::CommandBuffer::CommandBuffer(Device &device) : device(device) { NEO::CommandBuffer::CommandBuffer(Device &device) : device(device) {
flushStamp.reset(new FlushStampTracker(false)); flushStamp.reset(new FlushStampTracker(false));

View File

@@ -33,7 +33,8 @@ struct BatchBuffer {
void *endCmdPtr, void *endCmdPtr,
uint32_t numCsrClients, uint32_t numCsrClients,
bool hasStallingCmds, bool hasStallingCmds,
bool hasRelaxedOrderingDependencies); bool hasRelaxedOrderingDependencies,
bool dispatchMonitorFence);
BatchBuffer() {} BatchBuffer() {}
GraphicsAllocation *commandBufferAllocation = nullptr; GraphicsAllocation *commandBufferAllocation = nullptr;
size_t startOffset = 0u; size_t startOffset = 0u;
@@ -55,6 +56,7 @@ struct BatchBuffer {
bool hasRelaxedOrderingDependencies = false; bool hasRelaxedOrderingDependencies = false;
bool ringBufferRestartRequest = false; bool ringBufferRestartRequest = false;
bool disableFlatRingBuffer = false; bool disableFlatRingBuffer = false;
bool dispatchMonitorFence = false;
}; };
struct CommandBuffer : public IDNode<CommandBuffer> { struct CommandBuffer : public IDNode<CommandBuffer> {

View File

@@ -26,7 +26,8 @@ struct BatchBufferHelper {
nullptr, // endCmdPtr nullptr, // endCmdPtr
0, // numCsrClients 0, // numCsrClients
false, // hasStallingCmds false, // hasStallingCmds
false // hasRelaxedOrderingDependencies false, // hasRelaxedOrderingDependencies
false // dispatchMonitorFence
); );
} }