mirror of
https://git.suyu.dev/suyu/suyu
synced 2024-12-24 18:32:49 -06:00
nvdrv: Unregister already registered events
This commit is contained in:
parent
12355cbf02
commit
3b0458a7a5
1 changed files with 8 additions and 1 deletions
|
@ -155,8 +155,15 @@ NvResult nvhost_ctrl::IocCtrlEventRegister(const std::vector<u8>& input, std::ve
|
||||||
return NvResult::BadParameter;
|
return NvResult::BadParameter;
|
||||||
}
|
}
|
||||||
if (events_interface.registered[event_id]) {
|
if (events_interface.registered[event_id]) {
|
||||||
|
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;
|
return NvResult::BadParameter;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
events_interface.RegisterEvent(event_id);
|
events_interface.RegisterEvent(event_id);
|
||||||
return NvResult::Success;
|
return NvResult::Success;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue