fix: wait for first submission in TBX mode
Related-To: HSD-18039343751 Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
parent
2735b06206
commit
8e8b2582d8
|
@ -14,7 +14,13 @@ SubmissionStatus CommandStreamReceiverHw<GfxFamily>::initializeDeviceWithFirstSu
|
|||
if (this->latestFlushedTaskCount > 0) {
|
||||
return SubmissionStatus::success;
|
||||
}
|
||||
return flushTagUpdate();
|
||||
auto status = flushTagUpdate();
|
||||
|
||||
if (isTbxMode() && (status == SubmissionStatus::success)) {
|
||||
waitForTaskCountWithKmdNotifyFallback(this->taskCount, 0, false, QueueThrottle::MEDIUM);
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
|
|
|
@ -69,10 +69,17 @@ class MockCsrBase : public UltCommandStreamReceiver<GfxFamily> {
|
|||
processEvictionCalled = true;
|
||||
}
|
||||
|
||||
WaitStatus waitForTaskCountWithKmdNotifyFallback(TaskCountType taskCountToWait, FlushStamp flushStampToWait, bool useQuickKmdSleep, QueueThrottle throttle) override {
|
||||
waitForTaskCountWithKmdNotifyFallbackCalled++;
|
||||
|
||||
return BaseUltCsrClass::waitForTaskCountWithKmdNotifyFallback(taskCountToWait, flushStampToWait, useQuickKmdSleep, throttle);
|
||||
}
|
||||
|
||||
ResidencyContainer madeResidentGfxAllocations;
|
||||
ResidencyContainer madeNonResidentGfxAllocations;
|
||||
int32_t *executionStamp;
|
||||
int32_t flushTaskStamp;
|
||||
uint32_t waitForTaskCountWithKmdNotifyFallbackCalled = 0;
|
||||
bool processEvictionCalled = false;
|
||||
};
|
||||
|
||||
|
|
|
@ -5328,11 +5328,43 @@ HWTEST_F(CommandStreamReceiverTest, givenCsrWhenInitializeDeviceWithFirstSubmiss
|
|||
commandStreamReceiver.setupContext(mockOsContext);
|
||||
commandStreamReceiver.initializeTagAllocation();
|
||||
EXPECT_EQ(0u, commandStreamReceiver.taskCount);
|
||||
|
||||
EXPECT_EQ(SubmissionStatus::success, commandStreamReceiver.initializeDeviceWithFirstSubmission(*pDevice));
|
||||
EXPECT_EQ(1u, commandStreamReceiver.taskCount);
|
||||
|
||||
EXPECT_EQ(SubmissionStatus::success, commandStreamReceiver.initializeDeviceWithFirstSubmission(*pDevice));
|
||||
EXPECT_EQ(1u, commandStreamReceiver.taskCount);
|
||||
EXPECT_EQ(0u, commandStreamReceiver.waitForTaskCountWithKmdNotifyFallbackCalled);
|
||||
}
|
||||
|
||||
HWTEST_F(CommandStreamReceiverTest, givenTbxCsrWhenInitializingThenWaitForCompletion) {
|
||||
MockOsContext mockOsContext(0, EngineDescriptorHelper::getDefaultDescriptor({defaultHwInfo->capabilityTable.defaultEngineType, EngineUsage::regular}));
|
||||
pDevice->setPreemptionMode(PreemptionMode::Disabled);
|
||||
|
||||
MockCsrHw<FamilyType> commandStreamReceiver(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield());
|
||||
commandStreamReceiver.commandStreamReceiverType = CommandStreamReceiverType::tbx;
|
||||
commandStreamReceiver.setupContext(mockOsContext);
|
||||
commandStreamReceiver.initializeTagAllocation();
|
||||
|
||||
EXPECT_EQ(0u, commandStreamReceiver.taskCount);
|
||||
EXPECT_EQ(0u, commandStreamReceiver.waitForTaskCountWithKmdNotifyFallbackCalled);
|
||||
|
||||
EXPECT_EQ(SubmissionStatus::success, commandStreamReceiver.initializeDeviceWithFirstSubmission(*pDevice));
|
||||
EXPECT_EQ(1u, commandStreamReceiver.taskCount);
|
||||
EXPECT_EQ(1u, commandStreamReceiver.waitForTaskCountWithKmdNotifyFallbackCalled);
|
||||
|
||||
EXPECT_EQ(SubmissionStatus::success, commandStreamReceiver.initializeDeviceWithFirstSubmission(*pDevice));
|
||||
EXPECT_EQ(1u, commandStreamReceiver.taskCount);
|
||||
EXPECT_EQ(1u, commandStreamReceiver.waitForTaskCountWithKmdNotifyFallbackCalled);
|
||||
|
||||
MockCsrHw<FamilyType> failingCommandStreamReceiver(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield());
|
||||
failingCommandStreamReceiver.commandStreamReceiverType = CommandStreamReceiverType::tbx;
|
||||
failingCommandStreamReceiver.setupContext(mockOsContext);
|
||||
failingCommandStreamReceiver.initializeTagAllocation();
|
||||
failingCommandStreamReceiver.flushReturnValue = SubmissionStatus::outOfMemory;
|
||||
|
||||
EXPECT_EQ(SubmissionStatus::outOfMemory, failingCommandStreamReceiver.initializeDeviceWithFirstSubmission(*pDevice));
|
||||
EXPECT_EQ(0u, failingCommandStreamReceiver.waitForTaskCountWithKmdNotifyFallbackCalled);
|
||||
}
|
||||
|
||||
HWTEST_F(CommandStreamReceiverTest, givenCsrWhenGetUmdPowerHintValueCalledThenCorrectValueIsReturned) {
|
||||
|
|
Loading…
Reference in New Issue