summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Lioncash2022-11-29 08:55:30 -0500
committerGravatar Lioncash2022-11-29 08:55:33 -0500
commitc4af7b3f5cb9a24b48709fcabd21a3cceb2a43c5 (patch)
treee0dc3ca4de17440858c1a46ff662372b01ea2e62
parentMerge pull request #9340 from lioncash/nvdrv (diff)
downloadyuzu-c4af7b3f5cb9a24b48709fcabd21a3cceb2a43c5.tar.gz
yuzu-c4af7b3f5cb9a24b48709fcabd21a3cceb2a43c5.tar.xz
yuzu-c4af7b3f5cb9a24b48709fcabd21a3cceb2a43c5.zip
host1x/syncpoint_manager: Pass DeregisterAction() handle as const-ref
The handle is only compared against and not modified in any way, so we can pass it by const reference. This also allows us to mark the respective parameters for DeregisterGuestAction() and DeregisterHostAction() as const references as well.
-rw-r--r--src/video_core/host1x/syncpoint_manager.cpp6
-rw-r--r--src/video_core/host1x/syncpoint_manager.h6
2 files changed, 6 insertions, 6 deletions
diff --git a/src/video_core/host1x/syncpoint_manager.cpp b/src/video_core/host1x/syncpoint_manager.cpp
index a44fc83d3..8f23ce527 100644
--- a/src/video_core/host1x/syncpoint_manager.cpp
+++ b/src/video_core/host1x/syncpoint_manager.cpp
@@ -34,7 +34,7 @@ SyncpointManager::ActionHandle SyncpointManager::RegisterAction(
34} 34}
35 35
36void SyncpointManager::DeregisterAction(std::list<RegisteredAction>& action_storage, 36void SyncpointManager::DeregisterAction(std::list<RegisteredAction>& action_storage,
37 ActionHandle& handle) { 37 const ActionHandle& handle) {
38 std::unique_lock lk(guard); 38 std::unique_lock lk(guard);
39 39
40 // We want to ensure the iterator still exists prior to erasing it 40 // We want to ensure the iterator still exists prior to erasing it
@@ -49,11 +49,11 @@ void SyncpointManager::DeregisterAction(std::list<RegisteredAction>& action_stor
49 } 49 }
50} 50}
51 51
52void SyncpointManager::DeregisterGuestAction(u32 syncpoint_id, ActionHandle& handle) { 52void SyncpointManager::DeregisterGuestAction(u32 syncpoint_id, const ActionHandle& handle) {
53 DeregisterAction(guest_action_storage[syncpoint_id], handle); 53 DeregisterAction(guest_action_storage[syncpoint_id], handle);
54} 54}
55 55
56void SyncpointManager::DeregisterHostAction(u32 syncpoint_id, ActionHandle& handle) { 56void SyncpointManager::DeregisterHostAction(u32 syncpoint_id, const ActionHandle& handle) {
57 DeregisterAction(host_action_storage[syncpoint_id], handle); 57 DeregisterAction(host_action_storage[syncpoint_id], handle);
58} 58}
59 59
diff --git a/src/video_core/host1x/syncpoint_manager.h b/src/video_core/host1x/syncpoint_manager.h
index 50a264e23..feafc926e 100644
--- a/src/video_core/host1x/syncpoint_manager.h
+++ b/src/video_core/host1x/syncpoint_manager.h
@@ -48,9 +48,9 @@ public:
48 expected_value, std::move(func)); 48 expected_value, std::move(func));
49 } 49 }
50 50
51 void DeregisterGuestAction(u32 syncpoint_id, ActionHandle& handle); 51 void DeregisterGuestAction(u32 syncpoint_id, const ActionHandle& handle);
52 52
53 void DeregisterHostAction(u32 syncpoint_id, ActionHandle& handle); 53 void DeregisterHostAction(u32 syncpoint_id, const ActionHandle& handle);
54 54
55 void IncrementGuest(u32 syncpoint_id); 55 void IncrementGuest(u32 syncpoint_id);
56 56
@@ -76,7 +76,7 @@ private:
76 std::list<RegisteredAction>& action_storage, u32 expected_value, 76 std::list<RegisteredAction>& action_storage, u32 expected_value,
77 std::function<void()>&& action); 77 std::function<void()>&& action);
78 78
79 void DeregisterAction(std::list<RegisteredAction>& action_storage, ActionHandle& handle); 79 void DeregisterAction(std::list<RegisteredAction>& action_storage, const ActionHandle& handle);
80 80
81 void Wait(std::atomic<u32>& syncpoint, std::condition_variable& wait_cv, u32 expected_value); 81 void Wait(std::atomic<u32>& syncpoint, std::condition_variable& wait_cv, u32 expected_value);
82 82