diff options
author | Chloe Marcec <dmarcecguzman@gmail.com> | 2021-01-23 12:02:14 +0100 |
---|---|---|
committer | Chloe Marcec <dmarcecguzman@gmail.com> | 2021-01-23 12:02:14 +0100 |
commit | 3b0458a7a59ba262836d7876ac7a2e1a822e9a6a (patch) | |
tree | eaf77f2ac991c25b4f0a28eecaff1c3665daf432 | |
parent | Merge pull request #5776 from ogniK5377/lbl (diff) | |
download | yuzu-3b0458a7a59ba262836d7876ac7a2e1a822e9a6a.tar yuzu-3b0458a7a59ba262836d7876ac7a2e1a822e9a6a.tar.gz yuzu-3b0458a7a59ba262836d7876ac7a2e1a822e9a6a.tar.bz2 yuzu-3b0458a7a59ba262836d7876ac7a2e1a822e9a6a.tar.lz yuzu-3b0458a7a59ba262836d7876ac7a2e1a822e9a6a.tar.xz yuzu-3b0458a7a59ba262836d7876ac7a2e1a822e9a6a.tar.zst yuzu-3b0458a7a59ba262836d7876ac7a2e1a822e9a6a.zip |
-rw-r--r-- | src/core/hle/service/nvdrv/devices/nvhost_ctrl.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/core/hle/service/nvdrv/devices/nvhost_ctrl.cpp b/src/core/hle/service/nvdrv/devices/nvhost_ctrl.cpp index fea3b7b9f..73cd5a889 100644 --- a/src/core/hle/service/nvdrv/devices/nvhost_ctrl.cpp +++ b/src/core/hle/service/nvdrv/devices/nvhost_ctrl.cpp @@ -155,7 +155,14 @@ NvResult nvhost_ctrl::IocCtrlEventRegister(const std::vector<u8>& input, std::ve return NvResult::BadParameter; } if (events_interface.registered[event_id]) { - return NvResult::BadParameter; + const auto event_state = events_interface.status[event_id]; + if (event_state == EventState::Registered || event_state == EventState::Waiting || + event_state == EventState::Busy) { + LOG_WARNING(Service_NVDRV, "Event already registered! Unregistering previous event"); + events_interface.UnregisterEvent(event_id); + } else { + return NvResult::BadParameter; + } } events_interface.RegisterEvent(event_id); return NvResult::Success; |