mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-07 21:27:04 +08:00
Optimize marker call in blocked scenarios.
- Do not emit batch buffer - obtain completion stamp directly from csr Change-Id: I7ff58f2f019ee8158665f6fb93682ce5aae17bd6 Signed-off-by: Mrozek, Michal <michal.mrozek@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
0f55eae106
commit
a38e9da034
@@ -219,6 +219,10 @@ void CommandStreamReceiver::setTagAllocation(GraphicsAllocation *allocation) {
|
||||
this->tagAddress = allocation ? reinterpret_cast<uint32_t *>(allocation->getUnderlyingBuffer()) : nullptr;
|
||||
}
|
||||
|
||||
FlushStamp CommandStreamReceiver::obtainCurrentFlushStamp() const {
|
||||
return flushStamp->peekStamp();
|
||||
}
|
||||
|
||||
void CommandStreamReceiver::setRequiredScratchSizes(uint32_t newRequiredScratchSize, uint32_t newRequiredPrivateScratchSize) {
|
||||
if (newRequiredScratchSize > requiredScratchSize) {
|
||||
requiredScratchSize = newRequiredScratchSize;
|
||||
|
||||
@@ -105,6 +105,7 @@ class CommandStreamReceiver {
|
||||
uint32_t peekTaskCount() const { return taskCount; }
|
||||
|
||||
uint32_t peekTaskLevel() const { return taskLevel; }
|
||||
FlushStamp obtainCurrentFlushStamp() const;
|
||||
|
||||
uint32_t peekLatestSentTaskCount() const { return latestSentTaskCount; }
|
||||
|
||||
|
||||
@@ -256,31 +256,9 @@ CompletionStamp &CommandMarker::submit(uint32_t taskLevel, bool terminated) {
|
||||
return completionStamp;
|
||||
}
|
||||
|
||||
bool blocking = true;
|
||||
auto lockCSR = this->csr.obtainUniqueOwnership();
|
||||
|
||||
auto &queueCommandStream = cmdQ.getCS(this->commandSize);
|
||||
size_t offset = queueCommandStream.getUsed();
|
||||
|
||||
DispatchFlags dispatchFlags;
|
||||
dispatchFlags.blocking = blocking;
|
||||
dispatchFlags.dcFlush = shouldFlushDC(clCommandType, nullptr);
|
||||
dispatchFlags.lowPriority = cmdQ.getPriority() == QueuePriority::LOW;
|
||||
dispatchFlags.throttle = cmdQ.getThrottle();
|
||||
dispatchFlags.preemptionMode = PreemptionHelper::taskPreemptionMode(cmdQ.getDevice(), nullptr);
|
||||
|
||||
DEBUG_BREAK_IF(taskLevel >= Event::eventNotReady);
|
||||
|
||||
gtpinNotifyPreFlushTask(&cmdQ);
|
||||
|
||||
completionStamp = csr.flushTask(queueCommandStream,
|
||||
offset,
|
||||
cmdQ.getIndirectHeap(IndirectHeap::DYNAMIC_STATE, 0u),
|
||||
cmdQ.getIndirectHeap(IndirectHeap::INDIRECT_OBJECT, 0u),
|
||||
cmdQ.getIndirectHeap(IndirectHeap::SURFACE_STATE, 0u),
|
||||
taskLevel,
|
||||
dispatchFlags,
|
||||
cmdQ.getDevice());
|
||||
completionStamp.taskCount = csr.peekTaskCount();
|
||||
completionStamp.taskLevel = csr.peekTaskLevel();
|
||||
completionStamp.flushStamp = csr.obtainCurrentFlushStamp();
|
||||
|
||||
return completionStamp;
|
||||
}
|
||||
|
||||
@@ -121,6 +121,9 @@ class CommandMarker : public Command {
|
||||
public:
|
||||
CommandMarker(CommandQueue &cmdQ, CommandStreamReceiver &csr, uint32_t clCommandType, uint32_t commandSize)
|
||||
: cmdQ(cmdQ), csr(csr), clCommandType(clCommandType), commandSize(commandSize) {
|
||||
(void)this->cmdQ;
|
||||
(void)this->clCommandType;
|
||||
(void)this->commandSize;
|
||||
}
|
||||
|
||||
CompletionStamp &submit(uint32_t taskLevel, bool terminated) override;
|
||||
|
||||
Reference in New Issue
Block a user