test: ensure thread safety when capturing input params for wait function
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
parent
f6796c7384
commit
adc40934ae
|
@ -6805,6 +6805,7 @@ HWTEST_F(DeviceSimpleTests, givenNoGpuHangWhenSynchronizingDeviceThenCallWaitFor
|
|||
csr->latestFlushedTaskCount = 0u;
|
||||
csr->taskCount = taskCountToWait++;
|
||||
csr->flushStamp->setStamp(flushStampToWait++);
|
||||
csr->captureWaitForTaskCountWithKmdNotifyInputParams = true;
|
||||
csr->waitForTaskCountWithKmdNotifyFallbackReturnValue = WaitStatus::ready;
|
||||
}
|
||||
|
||||
|
@ -6815,6 +6816,7 @@ HWTEST_F(DeviceSimpleTests, givenNoGpuHangWhenSynchronizingDeviceThenCallWaitFor
|
|||
csr->latestFlushedTaskCount = 0u;
|
||||
csr->taskCount = taskCountToWait++;
|
||||
csr->flushStamp->setStamp(flushStampToWait++);
|
||||
csr->captureWaitForTaskCountWithKmdNotifyInputParams = true;
|
||||
csr->waitForTaskCountWithKmdNotifyFallbackReturnValue = WaitStatus::ready;
|
||||
}
|
||||
|
||||
|
|
|
@ -330,7 +330,11 @@ class UltCommandStreamReceiver : public CommandStreamReceiverHw<GfxFamily> {
|
|||
}
|
||||
|
||||
WaitStatus waitForTaskCountWithKmdNotifyFallback(TaskCountType taskCountToWait, FlushStamp flushStampToWait, bool useQuickKmdSleep, QueueThrottle throttle) override {
|
||||
waitForTaskCountWithKmdNotifyInputParams.push_back({taskCountToWait, flushStampToWait, useQuickKmdSleep, throttle});
|
||||
if (captureWaitForTaskCountWithKmdNotifyInputParams) {
|
||||
static std::mutex waitForTaskCountWithKmdNotifyInputParamsMtx;
|
||||
std::unique_lock<std::mutex> lock(waitForTaskCountWithKmdNotifyInputParamsMtx);
|
||||
waitForTaskCountWithKmdNotifyInputParams.push_back({taskCountToWait, flushStampToWait, useQuickKmdSleep, throttle});
|
||||
}
|
||||
if (waitForTaskCountWithKmdNotifyFallbackReturnValue.has_value()) {
|
||||
return *waitForTaskCountWithKmdNotifyFallbackReturnValue;
|
||||
}
|
||||
|
@ -667,6 +671,7 @@ class UltCommandStreamReceiver : public CommandStreamReceiverHw<GfxFamily> {
|
|||
bool isUserFenceWaitSupported = false;
|
||||
bool isAnyDirectSubmissionEnabledCallBase = true;
|
||||
bool isAnyDirectSubmissionEnabledResult = true;
|
||||
std::atomic_bool captureWaitForTaskCountWithKmdNotifyInputParams = false;
|
||||
};
|
||||
|
||||
} // namespace NEO
|
||||
|
|
Loading…
Reference in New Issue