Kmd notify improvements [1/n]: Quick KMD sleep optimization

- KmdNotifyProperties struct for CapabilityTable that can be extended by
  incoming KmdNotify related optimizations
- Quick KMD sleep optimization that is called from async events handler
- Optimization makes a taskCount check in busy loop with much smaller
  delay than basic version of KMD Notify optimization

Change-Id: I60c851c59895f0cf9de1e1f21e755a8b4c2fe900
This commit is contained in:
Dunajski, Bartosz
2018-03-21 10:00:49 +01:00
committed by sys_ocldev
parent 029094437a
commit 516082e7c5
41 changed files with 309 additions and 102 deletions

View File

@ -558,14 +558,18 @@ 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 && flushStampToWait != 0,
this->hwInfo.capabilityTable.delayKmdNotifyMicroseconds,
taskCountToWait);
inline void CommandStreamReceiverHw<GfxFamily>::waitForTaskCountWithKmdNotifyFallback(uint32_t taskCountToWait, FlushStamp flushStampToWait, bool useQuickKmdSleep) {
const auto &kmdNotifyProperties = this->hwInfo.capabilityTable.kmdNotifyProperties;
const auto &kmdNotifyDelay = useQuickKmdSleep && kmdNotifyProperties.enableQuickKmdSleep ? kmdNotifyProperties.delayQuickKmdSleepMicroseconds
: kmdNotifyProperties.delayKmdNotifyMicroseconds;
auto status = waitForCompletionWithTimeout(kmdNotifyProperties.enableKmdNotify && flushStampToWait != 0,
kmdNotifyDelay, taskCountToWait);
if (!status) {
waitForFlushStamp(flushStampToWait);
//now call blocking wait, this is to ensure that task count is reached
waitForCompletionWithTimeout(false, this->hwInfo.capabilityTable.delayKmdNotifyMicroseconds, taskCountToWait);
waitForCompletionWithTimeout(false, kmdNotifyDelay, taskCountToWait);
}
UNRECOVERABLE_IF(*getTagAddress() < taskCountToWait);