summaryrefslogtreecommitdiffstats
path: root/src/video_core
diff options
context:
space:
mode:
authorameerj <52414509+ameerj@users.noreply.github.com>2020-12-28 07:02:06 +0100
committerameerj <52414509+ameerj@users.noreply.github.com>2021-01-07 20:33:45 +0100
commit2c27127d04a155fe0f893e84263d58f14473785d (patch)
treee72b7d973f5c0dd4a553f815a632bf8fcc687998 /src/video_core
parentMerge pull request #5306 from MerryMage/ignore-library-Open (diff)
downloadyuzu-2c27127d04a155fe0f893e84263d58f14473785d.tar
yuzu-2c27127d04a155fe0f893e84263d58f14473785d.tar.gz
yuzu-2c27127d04a155fe0f893e84263d58f14473785d.tar.bz2
yuzu-2c27127d04a155fe0f893e84263d58f14473785d.tar.lz
yuzu-2c27127d04a155fe0f893e84263d58f14473785d.tar.xz
yuzu-2c27127d04a155fe0f893e84263d58f14473785d.tar.zst
yuzu-2c27127d04a155fe0f893e84263d58f14473785d.zip
Diffstat (limited to '')
-rw-r--r--src/video_core/cdma_pusher.cpp15
-rw-r--r--src/video_core/cdma_pusher.h10
-rw-r--r--src/video_core/command_classes/host1x.cpp6
-rw-r--r--src/video_core/command_classes/sync_manager.cpp2
4 files changed, 16 insertions, 17 deletions
diff --git a/src/video_core/cdma_pusher.cpp b/src/video_core/cdma_pusher.cpp
index e3e7432f7..94679d5d1 100644
--- a/src/video_core/cdma_pusher.cpp
+++ b/src/video_core/cdma_pusher.cpp
@@ -33,8 +33,7 @@ CDmaPusher::CDmaPusher(GPU& gpu_)
: gpu{gpu_}, nvdec_processor(std::make_shared<Nvdec>(gpu)),
vic_processor(std::make_unique<Vic>(gpu, nvdec_processor)),
host1x_processor(std::make_unique<Host1x>(gpu)),
- nvdec_sync(std::make_unique<SyncptIncrManager>(gpu)),
- vic_sync(std::make_unique<SyncptIncrManager>(gpu)) {}
+ sync_manager(std::make_unique<SyncptIncrManager>(gpu)) {}
CDmaPusher::~CDmaPusher() = default;
@@ -110,10 +109,10 @@ void CDmaPusher::ExecuteCommand(u32 state_offset, u32 data) {
const auto syncpoint_id = static_cast<u32>(data & 0xFF);
const auto cond = static_cast<u32>((data >> 8) & 0xFF);
if (cond == 0) {
- nvdec_sync->Increment(syncpoint_id);
+ sync_manager->Increment(syncpoint_id);
} else {
- nvdec_sync->IncrementWhenDone(static_cast<u32>(current_class), syncpoint_id);
- nvdec_sync->SignalDone(syncpoint_id);
+ sync_manager->SignalDone(
+ sync_manager->IncrementWhenDone(static_cast<u32>(current_class), syncpoint_id));
}
break;
}
@@ -135,10 +134,10 @@ void CDmaPusher::ExecuteCommand(u32 state_offset, u32 data) {
const auto syncpoint_id = static_cast<u32>(data & 0xFF);
const auto cond = static_cast<u32>((data >> 8) & 0xFF);
if (cond == 0) {
- vic_sync->Increment(syncpoint_id);
+ sync_manager->Increment(syncpoint_id);
} else {
- vic_sync->IncrementWhenDone(static_cast<u32>(current_class), syncpoint_id);
- vic_sync->SignalDone(syncpoint_id);
+ sync_manager->SignalDone(
+ sync_manager->IncrementWhenDone(static_cast<u32>(current_class), syncpoint_id));
}
break;
}
diff --git a/src/video_core/cdma_pusher.h b/src/video_core/cdma_pusher.h
index 0db1cd646..8ca70b6dd 100644
--- a/src/video_core/cdma_pusher.h
+++ b/src/video_core/cdma_pusher.h
@@ -116,12 +116,10 @@ private:
void ThiStateWrite(ThiRegisters& state, u32 state_offset, const std::vector<u32>& arguments);
GPU& gpu;
-
- std::shared_ptr<Nvdec> nvdec_processor;
- std::unique_ptr<Vic> vic_processor;
- std::unique_ptr<Host1x> host1x_processor;
- std::unique_ptr<SyncptIncrManager> nvdec_sync;
- std::unique_ptr<SyncptIncrManager> vic_sync;
+ std::shared_ptr<Tegra::Nvdec> nvdec_processor;
+ std::unique_ptr<Tegra::Vic> vic_processor;
+ std::unique_ptr<Tegra::Host1x> host1x_processor;
+ std::unique_ptr<SyncptIncrManager> sync_manager;
ChClassId current_class{};
ThiRegisters vic_thi_state{};
ThiRegisters nvdec_thi_state{};
diff --git a/src/video_core/command_classes/host1x.cpp b/src/video_core/command_classes/host1x.cpp
index c4dd4881a..9d0a1b4d9 100644
--- a/src/video_core/command_classes/host1x.cpp
+++ b/src/video_core/command_classes/host1x.cpp
@@ -34,6 +34,8 @@ void Tegra::Host1x::ProcessMethod(Method method, const std::vector<u32>& argumen
}
void Tegra::Host1x::Execute(u32 data) {
- // This method waits on a valid syncpoint.
- // TODO: Implement when proper Async is in place
+ u32 syncpointId = (data & 0xFF);
+ u32 threshold = state.load_syncpoint_payload32;
+
+ gpu.WaitFence(syncpointId, threshold);
}
diff --git a/src/video_core/command_classes/sync_manager.cpp b/src/video_core/command_classes/sync_manager.cpp
index 19dc9e0ab..579857766 100644
--- a/src/video_core/command_classes/sync_manager.cpp
+++ b/src/video_core/command_classes/sync_manager.cpp
@@ -38,7 +38,7 @@ u32 SyncptIncrManager::IncrementWhenDone(u32 class_id, u32 id) {
}
void SyncptIncrManager::SignalDone(u32 handle) {
- const auto done_incr =
+ const auto& done_incr =
std::find_if(increments.begin(), increments.end(),
[handle](const SyncptIncr& incr) { return incr.id == handle; });
if (done_incr != increments.cend()) {