Skip to content

Commit 9a92f43

Browse files
Use last sent task counter for Linux KMD wait function
Related-To: NEO-5845 Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
1 parent 2a77576 commit 9a92f43

File tree

6 files changed

+8
-10
lines changed

6 files changed

+8
-10
lines changed

opencl/source/os_interface/linux/drm_command_stream.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ class DrmCommandStreamReceiver : public DeviceCommandStreamReceiver<GfxFamily> {
3232
using BaseClass::requiredScratchSize;
3333
using CommandStreamReceiverHw<GfxFamily>::CommandStreamReceiver::getTagAddress;
3434
using CommandStreamReceiverHw<GfxFamily>::CommandStreamReceiver::getTagAllocation;
35+
using CommandStreamReceiverHw<GfxFamily>::CommandStreamReceiver::latestSentTaskCount;
3536
using CommandStreamReceiverHw<GfxFamily>::CommandStreamReceiver::taskCount;
3637
using CommandStreamReceiverHw<GfxFamily>::CommandStreamReceiver::useNotifyEnableForPostSync;
3738

opencl/source/os_interface/linux/drm_command_stream.inl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ bool DrmCommandStreamReceiver<GfxFamily>::flush(BatchBuffer &batchBuffer, Reside
116116
}
117117

118118
if (isUserFenceWaitActive()) {
119-
this->flushStamp->setStamp(taskCount);
119+
this->flushStamp->setStamp(latestSentTaskCount);
120120
} else {
121121
this->flushStamp->setStamp(bb->peekHandle());
122122
}

opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_2_tests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
using namespace NEO;
3434

35-
typedef UltCommandStreamReceiverTest CommandStreamReceiverFlushTaskTests;
35+
using CommandStreamReceiverFlushTaskTests = UltCommandStreamReceiverTest;
3636

3737
HWTEST_F(CommandStreamReceiverFlushTaskTests, GivenBlockedKernelNotRequiringDCFlushWhenUnblockedThenDCFlushIsNotAdded) {
3838
typedef typename FamilyType::PIPE_CONTROL PIPE_CONTROL;

opencl/test/unit_test/mocks/linux/mock_drm_command_stream_receiver.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ class TestedDrmCommandStreamReceiver : public DrmCommandStreamReceiver<GfxFamily
2121
using CommandStreamReceiver::flushStamp;
2222
using CommandStreamReceiver::getTagAddress;
2323
using CommandStreamReceiver::globalFenceAllocation;
24+
using CommandStreamReceiver::latestSentTaskCount;
2425
using CommandStreamReceiver::makeResident;
2526
using CommandStreamReceiver::taskCount;
2627
using CommandStreamReceiver::useGpuIdleImplicitFlush;

opencl/test/unit_test/mocks/mock_aub_csr.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,6 @@ struct MockAubCsr : public AUBCommandStreamReceiverHw<GfxFamily> {
7878
return this->tagAllocation;
7979
}
8080

81-
void setLatestSentTaskCount(uint32_t latestSentTaskCount) {
82-
this->latestSentTaskCount = latestSentTaskCount;
83-
}
84-
8581
bool flushBatchedSubmissions() override {
8682
flushBatchedSubmissionsCalled = true;
8783
return true;

opencl/test/unit_test/os_interface/linux/drm_command_stream_tests_2.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -789,7 +789,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, givenAllocationWithSingleBuffer
789789
}
790790

791791
HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest,
792-
givenWaitUserFenceFlagAndVmBindAvailableSetWhenDrmCsrFlushedThenExpectTaskCountStoredAsFlushStamp) {
792+
givenWaitUserFenceFlagAndVmBindAvailableSetWhenDrmCsrFlushedThenExpectLatestSentTaskCountStoredAsFlushStamp) {
793793
DebugManagerStateRestore restorer;
794794
DebugManager.flags.EnableUserFenceForCompletionWait.set(1);
795795

@@ -811,7 +811,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest,
811811
CommandStreamReceiverHw<FamilyType>::alignToCacheLine(cs);
812812
BatchBuffer batchBuffer{cs.getGraphicsAllocation(), 0, 0, nullptr, false, false, QueueThrottle::MEDIUM, QueueSliceCount::defaultSliceCount, cs.getUsed(), &cs, nullptr, false};
813813

814-
testedCsr->taskCount = 160u;
814+
testedCsr->latestSentTaskCount = 160u;
815815
testedCsr->flush(batchBuffer, testedCsr->getResidencyAllocations());
816816

817817
EXPECT_EQ(160u, testedCsr->flushStamp->peekStamp());
@@ -841,7 +841,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest,
841841

842842
DrmAllocation *alloc = static_cast<DrmAllocation *>(cs.getGraphicsAllocation());
843843
auto boHandle = static_cast<FlushStamp>(alloc->getBO()->peekHandle());
844-
testedCsr->taskCount = 160u;
844+
testedCsr->latestSentTaskCount = 160u;
845845

846846
testedCsr->flush(batchBuffer, testedCsr->getResidencyAllocations());
847847

@@ -875,7 +875,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest,
875875

876876
DrmAllocation *alloc = static_cast<DrmAllocation *>(cs.getGraphicsAllocation());
877877
auto boHandle = static_cast<FlushStamp>(alloc->getBO()->peekHandle());
878-
testedCsr->taskCount = 160u;
878+
testedCsr->latestSentTaskCount = 160u;
879879

880880
testedCsr->flush(batchBuffer, testedCsr->getResidencyAllocations());
881881

0 commit comments

Comments
 (0)