|
|
@ -36,8 +36,8 @@ u32 nvhost_ctrl::ioctl(Ioctl command, const std::vector<u8>& input, const std::v
|
|
|
|
return IocCtrlEventRegister(input, output);
|
|
|
|
return IocCtrlEventRegister(input, output);
|
|
|
|
case IoctlCommand::IocCtrlEventUnregisterCommand:
|
|
|
|
case IoctlCommand::IocCtrlEventUnregisterCommand:
|
|
|
|
return IocCtrlEventUnregister(input, output);
|
|
|
|
return IocCtrlEventUnregister(input, output);
|
|
|
|
case IoctlCommand::IocCtrlEventSignalCommand:
|
|
|
|
case IoctlCommand::IocCtrlClearEventWaitCommand:
|
|
|
|
return IocCtrlEventSignal(input, output);
|
|
|
|
return IocCtrlClearEventWait(input, output);
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
UNIMPLEMENTED_MSG("Unimplemented ioctl");
|
|
|
|
UNIMPLEMENTED_MSG("Unimplemented ioctl");
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
@ -154,23 +154,17 @@ u32 nvhost_ctrl::IocCtrlEventUnregister(const std::vector<u8>& input, std::vecto
|
|
|
|
return NvResult::Success;
|
|
|
|
return NvResult::Success;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
u32 nvhost_ctrl::IocCtrlEventSignal(const std::vector<u8>& input, std::vector<u8>& output) {
|
|
|
|
u32 nvhost_ctrl::IocCtrlClearEventWait(const std::vector<u8>& input, std::vector<u8>& output) {
|
|
|
|
IocCtrlEventSignalParams params{};
|
|
|
|
IocCtrlEventSignalParams params{};
|
|
|
|
std::memcpy(¶ms, input.data(), sizeof(params));
|
|
|
|
std::memcpy(¶ms, input.data(), sizeof(params));
|
|
|
|
// TODO(Blinkhawk): This is normally called when an NvEvents timeout on WaitSynchronization
|
|
|
|
u32 event_id = params.event_id & 0x00FF;
|
|
|
|
// It is believed from RE to cancel the GPU Event. However, better research is required
|
|
|
|
LOG_WARNING(Service_NVDRV, "cleared event wait on, event_id: {:X}", event_id);
|
|
|
|
u32 event_id = params.user_event_id & 0x00FF;
|
|
|
|
|
|
|
|
LOG_WARNING(Service_NVDRV, "(STUBBED) called, user_event_id: {:X}", event_id);
|
|
|
|
|
|
|
|
if (event_id >= MaxNvEvents) {
|
|
|
|
if (event_id >= MaxNvEvents) {
|
|
|
|
return NvResult::BadParameter;
|
|
|
|
return NvResult::BadParameter;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (events_interface.status[event_id] == EventState::Waiting) {
|
|
|
|
if (events_interface.status[event_id] == EventState::Waiting) {
|
|
|
|
auto& gpu = system.GPU();
|
|
|
|
events_interface.LiberateEvent(event_id);
|
|
|
|
if (gpu.CancelSyncptInterrupt(events_interface.assigned_syncpt[event_id],
|
|
|
|
events_interface.events[event_id].writable->Signal();
|
|
|
|
events_interface.assigned_value[event_id])) {
|
|
|
|
|
|
|
|
events_interface.LiberateEvent(event_id);
|
|
|
|
|
|
|
|
events_interface.events[event_id].writable->Signal();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return NvResult::Success;
|
|
|
|
return NvResult::Success;
|
|
|
|
}
|
|
|
|
}
|
|
|
|