performance: use dedicated flag to dispatch monitor fence

Related-To: NEO-8395

Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
Zbigniew Zdanowicz
2023-09-20 12:54:50 +00:00
committed by Compute-Runtime-Automation
parent 054d4d04fa
commit 7dfd3e5e59
10 changed files with 136 additions and 21 deletions

View File

@@ -114,8 +114,8 @@ class DirectSubmissionHw {
virtual uint64_t switchRingBuffers();
virtual void handleSwitchRingBuffers() = 0;
GraphicsAllocation *switchRingBuffersAllocations();
virtual uint64_t updateTagValue(bool hasStallingCmds) = 0;
virtual bool dispatchMonitorFenceRequired(bool hasStallingCmds);
virtual uint64_t updateTagValue(bool requireMonitorFence) = 0;
virtual bool dispatchMonitorFenceRequired(bool requireMonitorFence);
virtual void getTagAddressValue(TagData &tagData) = 0;
void unblockGpu();
bool copyCommandBufferIntoRing(BatchBuffer &batchBuffer);

View File

@@ -938,7 +938,7 @@ bool DirectSubmissionHw<GfxFamily, Dispatcher>::dispatchCommandBuffer(BatchBuffe
this->startRingBuffer();
bool relaxedOrderingSchedulerWillBeNeeded = (this->relaxedOrderingSchedulerRequired || batchBuffer.hasRelaxedOrderingDependencies);
bool dispatchMonitorFence = this->dispatchMonitorFenceRequired(batchBuffer.hasStallingCmds);
bool dispatchMonitorFence = this->dispatchMonitorFenceRequired(batchBuffer.dispatchMonitorFence);
size_t dispatchSize = getSizeDispatch(relaxedOrderingSchedulerWillBeNeeded, batchBuffer.hasRelaxedOrderingDependencies, dispatchMonitorFence);
@@ -980,7 +980,7 @@ bool DirectSubmissionHw<GfxFamily, Dispatcher>::dispatchCommandBuffer(BatchBuffe
currentQueueWorkCount++;
DirectSubmissionDiagnostics::diagnosticModeOneSubmit(diagnostic.get());
uint64_t flushValue = updateTagValue(batchBuffer.hasStallingCmds);
uint64_t flushValue = updateTagValue(batchBuffer.dispatchMonitorFence);
flushStamp.setStamp(flushValue);
return ringStart;
@@ -1087,7 +1087,7 @@ inline GraphicsAllocation *DirectSubmissionHw<GfxFamily, Dispatcher>::switchRing
}
template <typename GfxFamily, typename Dispatcher>
bool DirectSubmissionHw<GfxFamily, Dispatcher>::dispatchMonitorFenceRequired(bool hasStallingCmds) {
bool DirectSubmissionHw<GfxFamily, Dispatcher>::dispatchMonitorFenceRequired(bool requireMonitorFence) {
return !this->disableMonitorFence;
}

View File

@@ -31,7 +31,7 @@ class DrmDirectSubmission : public DirectSubmissionHw<GfxFamily, Dispatcher> {
void ensureRingCompletion() override;
void handleSwitchRingBuffers() override;
uint64_t updateTagValue(bool hasStallingCmds) override;
uint64_t updateTagValue(bool requireMonitorFence) override;
void getTagAddressValue(TagData &tagData) override;
bool isCompleted(uint32_t ringBufferIndex) override;
bool isCompletionFenceSupported();

View File

@@ -211,7 +211,7 @@ void DrmDirectSubmission<GfxFamily, Dispatcher>::handleSwitchRingBuffers() {
}
template <typename GfxFamily, typename Dispatcher>
uint64_t DrmDirectSubmission<GfxFamily, Dispatcher>::updateTagValue(bool hasStallingCmds) {
uint64_t DrmDirectSubmission<GfxFamily, Dispatcher>::updateTagValue(bool requireMonitorFence) {
if (!this->disableMonitorFence) {
this->currentTagData.tagValue++;
this->ringBuffers[this->currentRingBuffer].completionFence = this->currentTagData.tagValue;

View File

@@ -34,8 +34,8 @@ class WddmDirectSubmission : public DirectSubmissionHw<GfxFamily, Dispatcher> {
void ensureRingCompletion() override;
void handleSwitchRingBuffers() override;
void handleStopRingBuffer() override;
uint64_t updateTagValue(bool hasStallingCmds) override;
bool dispatchMonitorFenceRequired(bool hasStallingCmds) override;
uint64_t updateTagValue(bool requireMonitorFence) override;
bool dispatchMonitorFenceRequired(bool requireMonitorFence) override;
uint64_t updateTagValueImpl();
void getTagAddressValue(TagData &tagData) override;
bool isCompleted(uint32_t ringBufferIndex) override;

View File

@@ -142,16 +142,16 @@ void WddmDirectSubmission<GfxFamily, Dispatcher>::handleSwitchRingBuffers() {
}
template <typename GfxFamily, typename Dispatcher>
uint64_t WddmDirectSubmission<GfxFamily, Dispatcher>::updateTagValue(bool hasStallingCmds) {
if (!this->disableMonitorFence || hasStallingCmds) {
uint64_t WddmDirectSubmission<GfxFamily, Dispatcher>::updateTagValue(bool requireMonitorFence) {
if (!this->disableMonitorFence || requireMonitorFence) {
return this->updateTagValueImpl();
}
return 0ull;
}
template <typename GfxFamily, typename Dispatcher>
bool WddmDirectSubmission<GfxFamily, Dispatcher>::dispatchMonitorFenceRequired(bool hasStallingCmds) {
return !this->disableMonitorFence || hasStallingCmds;
bool WddmDirectSubmission<GfxFamily, Dispatcher>::dispatchMonitorFenceRequired(bool requireMonitorFence) {
return !this->disableMonitorFence || requireMonitorFence;
}
template <typename GfxFamily, typename Dispatcher>