diff options
author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2019-07-04 16:19:25 +0200 |
---|---|---|
committer | FernandoS27 <fsahmkow27@gmail.com> | 2019-07-05 21:49:35 +0200 |
commit | 0fc98958a3efdc30e2d6ece5a2654df0987ce7ac (patch) | |
tree | 9f03719e8869f94013fbb4e4f1362c2fbbcd5ed3 /src/core | |
parent | Nv_Host_Ctrl: Correct difference calculation (diff) | |
download | yuzu-0fc98958a3efdc30e2d6ece5a2654df0987ce7ac.tar yuzu-0fc98958a3efdc30e2d6ece5a2654df0987ce7ac.tar.gz yuzu-0fc98958a3efdc30e2d6ece5a2654df0987ce7ac.tar.bz2 yuzu-0fc98958a3efdc30e2d6ece5a2654df0987ce7ac.tar.lz yuzu-0fc98958a3efdc30e2d6ece5a2654df0987ce7ac.tar.xz yuzu-0fc98958a3efdc30e2d6ece5a2654df0987ce7ac.tar.zst yuzu-0fc98958a3efdc30e2d6ece5a2654df0987ce7ac.zip |
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/hle/service/nvdrv/interface.cpp | 43 |
1 files changed, 19 insertions, 24 deletions
diff --git a/src/core/hle/service/nvdrv/interface.cpp b/src/core/hle/service/nvdrv/interface.cpp index b8877b6cb..d5be64ed2 100644 --- a/src/core/hle/service/nvdrv/interface.cpp +++ b/src/core/hle/service/nvdrv/interface.cpp @@ -46,32 +46,27 @@ void NVDRV::Ioctl(Kernel::HLERequestContext& ctx) { u32 result = nvdrv->Ioctl(fd, command, ctx.ReadBuffer(), output, ctrl); - if (!ctrl.must_delay) { - IPC::ResponseBuilder rb{ctx, 3}; - rb.Push(RESULT_SUCCESS); - rb.Push(result); - + if (ctrl.must_delay) { + ctrl.fresh_call = false; + ctx.SleepClientThread( + "NVServices::DelayedResponse", ctrl.timeout, + [=](Kernel::SharedPtr<Kernel::Thread> thread, Kernel::HLERequestContext& ctx, + Kernel::ThreadWakeupReason reason) { + IoctlCtrl ctrl2{ctrl}; + std::vector<u8> output2 = output; + u32 result = nvdrv->Ioctl(fd, command, ctx.ReadBuffer(), output2, ctrl2); + ctx.WriteBuffer(output2); + IPC::ResponseBuilder rb{ctx, 3}; + rb.Push(RESULT_SUCCESS); + rb.Push(result); + }, + nvdrv->GetEventWriteable(ctrl.event_id)); + } else { ctx.WriteBuffer(output); - return; } - ctrl.fresh_call = false; - ctx.SleepClientThread( - "NVServices::DelayedResponse", ctrl.timeout, - [this, ctrl = ctrl](Kernel::SharedPtr<Kernel::Thread> thread, - Kernel::HLERequestContext& ctx, Kernel::ThreadWakeupReason reason) { - IPC::RequestParser rp{ctx}; - u32 fd = rp.Pop<u32>(); - u32 command = rp.Pop<u32>(); - std::vector<u8> output(ctx.GetWriteBufferSize()); - IoctlCtrl ctrl2{ctrl}; - u32 result = nvdrv->Ioctl(fd, command, ctx.ReadBuffer(), output, ctrl2); - IPC::ResponseBuilder rb{ctx, 3}; - rb.Push(RESULT_SUCCESS); - rb.Push(result); - - ctx.WriteBuffer(output); - }, - nvdrv->GetEventWriteable(ctrl.event_id)); + IPC::ResponseBuilder rb{ctx, 3}; + rb.Push(RESULT_SUCCESS); + rb.Push(result); } void NVDRV::Close(Kernel::HLERequestContext& ctx) { |