forked from ShuriZma/suyu
1
0
Fork 0

fixup! hle service: nvdrv: nvhost_gpu: Update to use SyncpointManager and other improvements.

This commit is contained in:
bunnei 2020-10-30 23:17:05 -07:00
parent 7d2839d7a3
commit 848bdf8a40
2 changed files with 11 additions and 3 deletions

View File

@ -16,7 +16,10 @@ namespace Service::Nvidia::Devices {
nvhost_gpu::nvhost_gpu(Core::System& system, std::shared_ptr<nvmap> nvmap_dev, nvhost_gpu::nvhost_gpu(Core::System& system, std::shared_ptr<nvmap> nvmap_dev,
SyncpointManager& syncpoint_manager) 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; 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.num_entries, params.flags, params.unk0, params.unk1, params.unk2,
params.unk3); params.unk3);
params.fence_out.id = syncpoint_manager.AllocateSyncpoint(); channel_fence.value = system.GPU().GetSyncpointValue(channel_fence.id);
params.fence_out.value = syncpoint_manager.RefreshSyncpoint(params.fence_out.id);
params.fence_out = channel_fence;
std::memcpy(output.data(), &params, output.size()); std::memcpy(output.data(), &params, output.size());
return 0; return 0;
@ -194,6 +198,9 @@ u32 nvhost_gpu::SubmitGPFIFOImpl(IoctlSubmitGpfifo& params, std::vector<u8>& out
params.num_entries, params.flags.raw); params.num_entries, params.flags.raw);
auto& gpu = system.GPU(); auto& gpu = system.GPU();
params.fence_out.id = channel_fence.id;
if (params.flags.add_wait.Value() && if (params.flags.add_wait.Value() &&
!syncpoint_manager.IsSyncpointExpired(params.fence_out.id, params.fence_out.value)) { !syncpoint_manager.IsSyncpointExpired(params.fence_out.id, params.fence_out.value)) {
gpu.PushGPUEntries(Tegra::CommandList{BuildWaitCommandList(params.fence_out)}); gpu.PushGPUEntries(Tegra::CommandList{BuildWaitCommandList(params.fence_out)});

View File

@ -212,6 +212,7 @@ private:
std::shared_ptr<nvmap> nvmap_dev; std::shared_ptr<nvmap> nvmap_dev;
SyncpointManager& syncpoint_manager; SyncpointManager& syncpoint_manager;
Fence channel_fence;
}; };
} // namespace Service::Nvidia::Devices } // namespace Service::Nvidia::Devices