summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/nvdrv
diff options
context:
space:
mode:
authorChloe Marcec <dmarcecguzman@gmail.com>2021-01-23 12:02:14 +0100
committerChloe Marcec <dmarcecguzman@gmail.com>2021-01-23 12:02:14 +0100
commit3b0458a7a59ba262836d7876ac7a2e1a822e9a6a (patch)
treeeaf77f2ac991c25b4f0a28eecaff1c3665daf432 /src/core/hle/service/nvdrv
parentMerge pull request #5776 from ogniK5377/lbl (diff)
downloadyuzu-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
Diffstat (limited to 'src/core/hle/service/nvdrv')
-rw-r--r--src/core/hle/service/nvdrv/devices/nvhost_ctrl.cpp9
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;