diff options
| author | 2021-10-01 23:10:55 -0400 | |
|---|---|---|
| committer | 2021-10-03 00:35:57 -0400 | |
| commit | 6c0d90237371c9adbe80a26c3e4f53b35ea57a0e (patch) | |
| tree | e6f143052a75856d401565fec173bf964d7ed032 /src/video_core/gpu.cpp | |
| parent | gpu: Migrate implementation to the cpp file (diff) | |
| download | yuzu-6c0d90237371c9adbe80a26c3e4f53b35ea57a0e.tar.gz yuzu-6c0d90237371c9adbe80a26c3e4f53b35ea57a0e.tar.xz yuzu-6c0d90237371c9adbe80a26c3e4f53b35ea57a0e.zip | |
nvhost_ctrl: Refactor usage of gpu.LockSync()
This seems to only be used to protect a later gpu function call. So we can move the lock into that call instead.
Diffstat (limited to 'src/video_core/gpu.cpp')
| -rw-r--r-- | src/video_core/gpu.cpp | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/src/video_core/gpu.cpp b/src/video_core/gpu.cpp index 520675873..ab7c21a49 100644 --- a/src/video_core/gpu.cpp +++ b/src/video_core/gpu.cpp | |||
| @@ -262,6 +262,7 @@ struct GPU::Impl { | |||
| 262 | } | 262 | } |
| 263 | 263 | ||
| 264 | void RegisterSyncptInterrupt(u32 syncpoint_id, u32 value) { | 264 | void RegisterSyncptInterrupt(u32 syncpoint_id, u32 value) { |
| 265 | std::lock_guard lock{sync_mutex}; | ||
| 265 | auto& interrupt = syncpt_interrupts.at(syncpoint_id); | 266 | auto& interrupt = syncpt_interrupts.at(syncpoint_id); |
| 266 | bool contains = std::any_of(interrupt.begin(), interrupt.end(), | 267 | bool contains = std::any_of(interrupt.begin(), interrupt.end(), |
| 267 | [value](u32 in_value) { return in_value == value; }); | 268 | [value](u32 in_value) { return in_value == value; }); |
| @@ -300,10 +301,6 @@ struct GPU::Impl { | |||
| 300 | return nanoseconds_num * gpu_ticks_num + (nanoseconds_rem * gpu_ticks_num) / gpu_ticks_den; | 301 | return nanoseconds_num * gpu_ticks_num + (nanoseconds_rem * gpu_ticks_num) / gpu_ticks_den; |
| 301 | } | 302 | } |
| 302 | 303 | ||
| 303 | [[nodiscard]] std::unique_lock<std::mutex> LockSync() { | ||
| 304 | return std::unique_lock{sync_mutex}; | ||
| 305 | } | ||
| 306 | |||
| 307 | [[nodiscard]] bool IsAsync() const { | 304 | [[nodiscard]] bool IsAsync() const { |
| 308 | return is_async; | 305 | return is_async; |
| 309 | } | 306 | } |
| @@ -862,10 +859,6 @@ u64 GPU::GetTicks() const { | |||
| 862 | return impl->GetTicks(); | 859 | return impl->GetTicks(); |
| 863 | } | 860 | } |
| 864 | 861 | ||
| 865 | std::unique_lock<std::mutex> GPU::LockSync() { | ||
| 866 | return impl->LockSync(); | ||
| 867 | } | ||
| 868 | |||
| 869 | bool GPU::IsAsync() const { | 862 | bool GPU::IsAsync() const { |
| 870 | return impl->IsAsync(); | 863 | return impl->IsAsync(); |
| 871 | } | 864 | } |