From 568306195fb96b65bca4d4f64586e56418e3f01c Mon Sep 17 00:00:00 2001 From: Billy Laws Date: Mon, 23 Jan 2023 21:19:22 +0000 Subject: [PATCH] Prevent Vulkan guest crashes by avoiding intermediate syncpt event signal state The vulkan guest driver doesn't expect a 0xB return code from SyncptEventWait, even though this is valid when an event is being signalled. Just ignore the intermediate state instead as doing so avoids races without causing any more. --- .../main/cpp/skyline/services/nvdrv/devices/nvhost/ctrl.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/src/main/cpp/skyline/services/nvdrv/devices/nvhost/ctrl.cpp b/app/src/main/cpp/skyline/services/nvdrv/devices/nvhost/ctrl.cpp index af416bec..9d0227a3 100644 --- a/app/src/main/cpp/skyline/services/nvdrv/devices/nvhost/ctrl.cpp +++ b/app/src/main/cpp/skyline/services/nvdrv/devices/nvhost/ctrl.cpp @@ -11,10 +11,8 @@ namespace skyline::service::nvdrv::device::nvhost { void Ctrl::SyncpointEvent::Signal() { // We should only signal the KEvent if the event is actively being waited on - if (state.exchange(State::Signalling) == State::Waiting) + if (state.exchange(State::Signalled) == State::Waiting) event->Signal(); - - state = State::Signalled; } void Ctrl::SyncpointEvent::Cancel(soc::host1x::Host1x &host1x) {