Disable wait timeout when flushStamp is 0

Change-Id: I416ace1f8c1a3e5aa91d9bc2425a4faa77e2fbe7
This commit is contained in:
Dunajski, Bartosz 2018-03-15 13:46:58 +01:00 committed by sys_ocldev
parent f997b45145
commit c0d3eade30
2 changed files with 14 additions and 1 deletions

View File

@ -559,7 +559,9 @@ inline void CommandStreamReceiverHw<GfxFamily>::emitNoop(LinearStream &commandSt
template <typename GfxFamily>
inline void CommandStreamReceiverHw<GfxFamily>::waitForTaskCountWithKmdNotifyFallback(uint32_t taskCountToWait, FlushStamp flushStampToWait) {
auto status = waitForCompletionWithTimeout(this->hwInfo.capabilityTable.enableKmdNotify, this->hwInfo.capabilityTable.delayKmdNotifyMicroseconds, taskCountToWait);
auto status = waitForCompletionWithTimeout(this->hwInfo.capabilityTable.enableKmdNotify && flushStampToWait != 0,
this->hwInfo.capabilityTable.delayKmdNotifyMicroseconds,
taskCountToWait);
if (!status) {
waitForFlushStamp(flushStampToWait);
//now call blocking wait, this is to ensure that task count is reached

View File

@ -762,6 +762,17 @@ HWTEST_F(KmdNotifyTests, givenMultipleCommandQueuesWhenMarkerIsEmittedThenGraphi
EXPECT_EQ(commandStreamGraphicsAllocation, commandStreamGraphicsAllocation2);
}
HWTEST_F(KmdNotifyTests, givenZeroFlushStampWhenWaitIsCalledThenDisableTimeout) {
auto csr = new ::testing::NiceMock<MyCsr<FamilyType>>(device->getHardwareInfo());
device->resetCommandStreamReceiver(csr);
EXPECT_TRUE(device->getHardwareInfo().capabilityTable.enableKmdNotify);
EXPECT_CALL(*csr, waitForCompletionWithTimeout(false, ::testing::_, taskCountToWait)).Times(1).WillOnce(::testing::Return(true));
EXPECT_CALL(*csr, waitForFlushStamp(::testing::_)).Times(0);
csr->waitForTaskCountWithKmdNotifyFallback(taskCountToWait, 0);
}
constexpr char sipPattern[] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 39, 41};
static_assert(false == isAligned<MemoryConstants::cacheLineSize>(sizeof(sipPattern)),
"Will be checking for automatic cacheline alignment, so pattern length must not be a multiple of cacheline");