Update latestSentTaskCount before flush during blit dispatch

Change-Id: I44e1f4e8a70c17b902164491c6d58e8523160ac3
Related-To: NEO-3020
Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
This commit is contained in:
Dunajski, Bartosz
2019-04-16 13:02:34 +02:00
committed by sys_ocldev
parent 2ca97d3881
commit 62e2ca05e1
3 changed files with 4 additions and 1 deletions

View File

@ -787,6 +787,7 @@ void CommandStreamReceiverHw<GfxFamily>::blitFromHostPtr(MemObj &destinationMemO
auto &commandStream = getCS(BlitCommandsHelper<GfxFamily>::estimateBlitCommandsSize(sourceSize));
auto commandStreamStart = commandStream.getUsed();
auto newTaskCount = taskCount + 1;
latestSentTaskCount = newTaskCount;
HostPtrSurface hostPtrSurface(sourceHostPtr, static_cast<size_t>(sourceSize), true);
bool success = createAllocationForHostSurface(hostPtrSurface, false);
@ -818,7 +819,6 @@ void CommandStreamReceiverHw<GfxFamily>::blitFromHostPtr(MemObj &destinationMemO
makeSurfacePackNonResident(getResidencyAllocations());
latestFlushedTaskCount = newTaskCount;
latestSentTaskCount = newTaskCount;
taskCount = newTaskCount;
lock.unlock();

View File

@ -316,6 +316,7 @@ HWTEST_F(BcsTests, givenBltSizeWithLeftoverWhenDispatchedThenProgramAllRequiredC
EXPECT_EQ(newTaskCount, csr.taskCount);
EXPECT_EQ(newTaskCount, csr.latestFlushedTaskCount);
EXPECT_EQ(newTaskCount, csr.latestSentTaskCount);
EXPECT_EQ(newTaskCount, csr.latestSentTaskCountValueDuringFlush);
EXPECT_EQ(1u, csr.recursiveLockCounter.load());
HardwareParse hwParser;

View File

@ -94,6 +94,7 @@ class UltCommandStreamReceiver : public CommandStreamReceiverHw<GfxFamily>, publ
if (recordFlusheBatchBuffer) {
latestFlushedBatchBuffer = batchBuffer;
}
latestSentTaskCountValueDuringFlush = latestSentTaskCount;
return BaseClass::flush(batchBuffer, allocationsForResidency);
}
@ -169,6 +170,7 @@ class UltCommandStreamReceiver : public CommandStreamReceiverHw<GfxFamily>, publ
bool initProgrammingFlagsCalled = false;
LinearStream *lastFlushedCommandStream = nullptr;
BatchBuffer latestFlushedBatchBuffer = {};
uint32_t latestSentTaskCountValueDuringFlush = 0;
std::atomic<uint32_t> latestWaitForCompletionWithTimeoutTaskCount{0};
protected: