summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2020-10-31 07:17:05 +0100
committerbunnei <bunneidev@gmail.com>2020-11-01 09:52:38 +0100
commit848bdf8a40aa31f1525e7326225f0f9fc3126d4d (patch)
tree66aa1026ec70c9cddb0b81e353f1a960aa080361 /src/core
parentcore: Initialize GPU before services. (diff)
downloadyuzu-848bdf8a40aa31f1525e7326225f0f9fc3126d4d.tar
yuzu-848bdf8a40aa31f1525e7326225f0f9fc3126d4d.tar.gz
yuzu-848bdf8a40aa31f1525e7326225f0f9fc3126d4d.tar.bz2
yuzu-848bdf8a40aa31f1525e7326225f0f9fc3126d4d.tar.lz
yuzu-848bdf8a40aa31f1525e7326225f0f9fc3126d4d.tar.xz
yuzu-848bdf8a40aa31f1525e7326225f0f9fc3126d4d.tar.zst
yuzu-848bdf8a40aa31f1525e7326225f0f9fc3126d4d.zip
Diffstat (limited to '')
-rw-r--r--src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp13
-rw-r--r--src/core/hle/service/nvdrv/devices/nvhost_gpu.h1
2 files changed, 11 insertions, 3 deletions
diff --git a/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp b/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp
index 2b9a8722c..152019548 100644
--- a/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp
+++ b/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp
@@ -16,7 +16,10 @@ namespace Service::Nvidia::Devices {
nvhost_gpu::nvhost_gpu(Core::System& system, std::shared_ptr<nvmap> nvmap_dev,
SyncpointManager& syncpoint_manager)
- : nvdevice(system), nvmap_dev(std::move(nvmap_dev)), syncpoint_manager{syncpoint_manager} {}
+ : nvdevice(system), nvmap_dev(std::move(nvmap_dev)), syncpoint_manager{syncpoint_manager} {
+ channel_fence.id = syncpoint_manager.AllocateSyncpoint();
+ channel_fence.value = system.GPU().GetSyncpointValue(channel_fence.id);
+}
nvhost_gpu::~nvhost_gpu() = default;
@@ -129,8 +132,9 @@ u32 nvhost_gpu::AllocGPFIFOEx2(const std::vector<u8>& input, std::vector<u8>& ou
params.num_entries, params.flags, params.unk0, params.unk1, params.unk2,
params.unk3);
- params.fence_out.id = syncpoint_manager.AllocateSyncpoint();
- params.fence_out.value = syncpoint_manager.RefreshSyncpoint(params.fence_out.id);
+ channel_fence.value = system.GPU().GetSyncpointValue(channel_fence.id);
+
+ params.fence_out = channel_fence;
std::memcpy(output.data(), &params, output.size());
return 0;
@@ -194,6 +198,9 @@ u32 nvhost_gpu::SubmitGPFIFOImpl(IoctlSubmitGpfifo& params, std::vector<u8>& out
params.num_entries, params.flags.raw);
auto& gpu = system.GPU();
+
+ params.fence_out.id = channel_fence.id;
+
if (params.flags.add_wait.Value() &&
!syncpoint_manager.IsSyncpointExpired(params.fence_out.id, params.fence_out.value)) {
gpu.PushGPUEntries(Tegra::CommandList{BuildWaitCommandList(params.fence_out)});
diff --git a/src/core/hle/service/nvdrv/devices/nvhost_gpu.h b/src/core/hle/service/nvdrv/devices/nvhost_gpu.h
index 80054510f..a252fc06d 100644
--- a/src/core/hle/service/nvdrv/devices/nvhost_gpu.h
+++ b/src/core/hle/service/nvdrv/devices/nvhost_gpu.h
@@ -212,6 +212,7 @@ private:
std::shared_ptr<nvmap> nvmap_dev;
SyncpointManager& syncpoint_manager;
+ Fence channel_fence;
};
} // namespace Service::Nvidia::Devices