diff options
| author | 2021-10-16 00:20:19 +0200 | |
|---|---|---|
| committer | 2021-10-16 00:23:27 +0200 | |
| commit | 53cf91d151d1e3d289917b63cf17ca254674f1ce (patch) | |
| tree | b98a87d68243e1f9358c10a8870dd296c0aa5eb1 /src/core/core.cpp | |
| parent | Suspend temporally (diff) | |
| download | yuzu-53cf91d151d1e3d289917b63cf17ca254674f1ce.tar.gz yuzu-53cf91d151d1e3d289917b63cf17ca254674f1ce.tar.xz yuzu-53cf91d151d1e3d289917b63cf17ca254674f1ce.zip | |
NvHost/Core: Address Feedback.
Diffstat (limited to 'src/core/core.cpp')
| -rw-r--r-- | src/core/core.cpp | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/src/core/core.cpp b/src/core/core.cpp index 4abf037e2..3042d611b 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp | |||
| @@ -163,19 +163,19 @@ struct System::Impl { | |||
| 163 | return status; | 163 | return status; |
| 164 | } | 164 | } |
| 165 | 165 | ||
| 166 | void stallForGPU(bool pause) { | 166 | std::unique_lock<std::mutex> StallCPU() { |
| 167 | if (pause) { | 167 | std::unique_lock<std::mutex> lk(suspend_guard); |
| 168 | suspend_guard.lock(); | 168 | kernel.Suspend(true); |
| 169 | kernel.Suspend(pause); | 169 | core_timing.SyncPause(true); |
| 170 | core_timing.SyncPause(pause); | 170 | cpu_manager.Pause(true); |
| 171 | cpu_manager.Pause(pause); | 171 | return lk; |
| 172 | } else { | 172 | } |
| 173 | if (!is_paused) { | 173 | |
| 174 | core_timing.SyncPause(pause); | 174 | void UnstallCPU() { |
| 175 | kernel.Suspend(pause); | 175 | if (!is_paused) { |
| 176 | cpu_manager.Pause(pause); | 176 | core_timing.SyncPause(false); |
| 177 | } | 177 | kernel.Suspend(false); |
| 178 | suspend_guard.unlock(); | 178 | cpu_manager.Pause(false); |
| 179 | } | 179 | } |
| 180 | } | 180 | } |
| 181 | 181 | ||
| @@ -487,8 +487,12 @@ void System::Shutdown() { | |||
| 487 | impl->Shutdown(); | 487 | impl->Shutdown(); |
| 488 | } | 488 | } |
| 489 | 489 | ||
| 490 | void System::stallForGPU(bool pause) { | 490 | std::unique_lock<std::mutex> System::StallCPU() { |
| 491 | impl->stallForGPU(pause); | 491 | return impl->StallCPU(); |
| 492 | } | ||
| 493 | |||
| 494 | void System::UnstallCPU() { | ||
| 495 | impl->UnstallCPU(); | ||
| 492 | } | 496 | } |
| 493 | 497 | ||
| 494 | SystemResultStatus System::Load(Frontend::EmuWindow& emu_window, const std::string& filepath, | 498 | SystemResultStatus System::Load(Frontend::EmuWindow& emu_window, const std::string& filepath, |