mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-20 08:53:55 +08:00
fix: Flush monitor fence only to context where needed
Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
51c0e80299
commit
c2093990d4
@@ -1183,9 +1183,12 @@ bool Wddm::waitFromCpu(uint64_t lastFenceValue, const MonitoredFence &monitoredF
|
||||
|
||||
if (!skipResourceCleanup() && lastFenceValue > *monitoredFence.cpuAddress) {
|
||||
if (lastFenceValue > monitoredFence.lastSubmittedFence) {
|
||||
this->forEachContextWithinWddm([](const EngineControl &engine) {
|
||||
auto lock = engine.commandStreamReceiver->obtainUniqueOwnership();
|
||||
engine.commandStreamReceiver->flushMonitorFence();
|
||||
this->forEachContextWithinWddm([&monitoredFence](const EngineControl &engine) {
|
||||
auto &contextMonitoredFence = static_cast<OsContextWin *>(engine.osContext)->getResidencyController().getMonitoredFence();
|
||||
if (contextMonitoredFence.cpuAddress == monitoredFence.cpuAddress) {
|
||||
auto lock = engine.commandStreamReceiver->obtainUniqueOwnership();
|
||||
engine.commandStreamReceiver->flushMonitorFence();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -1215,9 +1215,13 @@ HWTEST_TEMPLATED_F(WddmCommandStreamMockGdiTest, givenLastSubmittedFenceLowerTha
|
||||
wddm->callBaseWaitFromCpu = true;
|
||||
EXPECT_EQ(directSubmission->flushMonitorFenceCalled, 0u);
|
||||
|
||||
D3DKMT_HANDLE handle = 1;
|
||||
uint64_t value = 0u;
|
||||
NEO::MonitoredFence monitorFence = {};
|
||||
monitorFence.cpuAddress = &value;
|
||||
auto gpuVa = castToUint64(&value);
|
||||
|
||||
static_cast<OsContextWin *>(device->getDefaultEngine().osContext)->getResidencyController().resetMonitoredFenceParams(handle, &value, gpuVa);
|
||||
wddm->waitFromCpu(1, monitorFence, false);
|
||||
|
||||
EXPECT_EQ(directSubmission->flushMonitorFenceCalled, 1u);
|
||||
|
||||
Reference in New Issue
Block a user