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->latestFlushedTaskCount = 0u;
|
||||||
csr->taskCount = taskCountToWait++;
|
csr->taskCount = taskCountToWait++;
|
||||||
csr->flushStamp->setStamp(flushStampToWait++);
|
csr->flushStamp->setStamp(flushStampToWait++);
|
||||||
|
csr->captureWaitForTaskCountWithKmdNotifyInputParams = true;
|
||||||
csr->waitForTaskCountWithKmdNotifyFallbackReturnValue = WaitStatus::ready;
|
csr->waitForTaskCountWithKmdNotifyFallbackReturnValue = WaitStatus::ready;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6815,6 +6816,7 @@ HWTEST_F(DeviceSimpleTests, givenNoGpuHangWhenSynchronizingDeviceThenCallWaitFor
|
||||||
csr->latestFlushedTaskCount = 0u;
|
csr->latestFlushedTaskCount = 0u;
|
||||||
csr->taskCount = taskCountToWait++;
|
csr->taskCount = taskCountToWait++;
|
||||||
csr->flushStamp->setStamp(flushStampToWait++);
|
csr->flushStamp->setStamp(flushStampToWait++);
|
||||||
|
csr->captureWaitForTaskCountWithKmdNotifyInputParams = true;
|
||||||
csr->waitForTaskCountWithKmdNotifyFallbackReturnValue = WaitStatus::ready;
|
csr->waitForTaskCountWithKmdNotifyFallbackReturnValue = WaitStatus::ready;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -330,7 +330,11 @@ class UltCommandStreamReceiver : public CommandStreamReceiverHw<GfxFamily> {
|
||||||
}
|
}
|
||||||
|
|
||||||
WaitStatus waitForTaskCountWithKmdNotifyFallback(TaskCountType taskCountToWait, FlushStamp flushStampToWait, bool useQuickKmdSleep, QueueThrottle throttle) override {
|
WaitStatus waitForTaskCountWithKmdNotifyFallback(TaskCountType taskCountToWait, FlushStamp flushStampToWait, bool useQuickKmdSleep, QueueThrottle throttle) override {
|
||||||
|
if (captureWaitForTaskCountWithKmdNotifyInputParams) {
|
||||||
|
static std::mutex waitForTaskCountWithKmdNotifyInputParamsMtx;
|
||||||
|
std::unique_lock<std::mutex> lock(waitForTaskCountWithKmdNotifyInputParamsMtx);
|
||||||
waitForTaskCountWithKmdNotifyInputParams.push_back({taskCountToWait, flushStampToWait, useQuickKmdSleep, throttle});
|
waitForTaskCountWithKmdNotifyInputParams.push_back({taskCountToWait, flushStampToWait, useQuickKmdSleep, throttle});
|
||||||
|
}
|
||||||
if (waitForTaskCountWithKmdNotifyFallbackReturnValue.has_value()) {
|
if (waitForTaskCountWithKmdNotifyFallbackReturnValue.has_value()) {
|
||||||
return *waitForTaskCountWithKmdNotifyFallbackReturnValue;
|
return *waitForTaskCountWithKmdNotifyFallbackReturnValue;
|
||||||
}
|
}
|
||||||
|
@ -667,6 +671,7 @@ class UltCommandStreamReceiver : public CommandStreamReceiverHw<GfxFamily> {
|
||||||
bool isUserFenceWaitSupported = false;
|
bool isUserFenceWaitSupported = false;
|
||||||
bool isAnyDirectSubmissionEnabledCallBase = true;
|
bool isAnyDirectSubmissionEnabledCallBase = true;
|
||||||
bool isAnyDirectSubmissionEnabledResult = true;
|
bool isAnyDirectSubmissionEnabledResult = true;
|
||||||
|
std::atomic_bool captureWaitForTaskCountWithKmdNotifyInputParams = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace NEO
|
} // namespace NEO
|
||||||
|
|
Loading…
Reference in New Issue