diff options
author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2022-01-30 10:31:13 +0100 |
---|---|---|
committer | Fernando Sahmkow <fsahmkow27@gmail.com> | 2022-10-06 21:00:52 +0200 |
commit | 668e80a9f42fb4ce0e16f6381d05bcbd286b2da1 (patch) | |
tree | a1c668d6c3d00eade849b1d31dba4116095e4c12 /src/video_core/host1x/sync_manager.h | |
parent | Texture Cache: Fix GC and GPU Modified on Joins. (diff) | |
download | yuzu-668e80a9f42fb4ce0e16f6381d05bcbd286b2da1.tar yuzu-668e80a9f42fb4ce0e16f6381d05bcbd286b2da1.tar.gz yuzu-668e80a9f42fb4ce0e16f6381d05bcbd286b2da1.tar.bz2 yuzu-668e80a9f42fb4ce0e16f6381d05bcbd286b2da1.tar.lz yuzu-668e80a9f42fb4ce0e16f6381d05bcbd286b2da1.tar.xz yuzu-668e80a9f42fb4ce0e16f6381d05bcbd286b2da1.tar.zst yuzu-668e80a9f42fb4ce0e16f6381d05bcbd286b2da1.zip |
Diffstat (limited to 'src/video_core/host1x/sync_manager.h')
-rw-r--r-- | src/video_core/host1x/sync_manager.h | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/src/video_core/host1x/sync_manager.h b/src/video_core/host1x/sync_manager.h new file mode 100644 index 000000000..aba72d5c5 --- /dev/null +++ b/src/video_core/host1x/sync_manager.h @@ -0,0 +1,53 @@ +// SPDX-FileCopyrightText: Ryujinx Team and Contributors +// SPDX-License-Identifier: MIT + +#pragma once + +#include <mutex> +#include <vector> +#include "common/common_types.h" + +namespace Tegra { + +class GPU; + +namespace Host1x { + +struct SyncptIncr { + u32 id; + u32 class_id; + u32 syncpt_id; + bool complete; + + SyncptIncr(u32 id_, u32 class_id_, u32 syncpt_id_, bool done = false) + : id(id_), class_id(class_id_), syncpt_id(syncpt_id_), complete(done) {} +}; + +class SyncptIncrManager { +public: + explicit SyncptIncrManager(GPU& gpu); + ~SyncptIncrManager(); + + /// Add syncpoint id and increment all + void Increment(u32 id); + + /// Returns a handle to increment later + u32 IncrementWhenDone(u32 class_id, u32 id); + + /// IncrememntAllDone, including handle + void SignalDone(u32 handle); + + /// Increment all sequential pending increments that are already done. + void IncrementAllDone(); + +private: + std::vector<SyncptIncr> increments; + std::mutex increment_lock; + u32 current_id{}; + + GPU& gpu; +}; + +} // namespace Host1x + +} // namespace Tegra |